Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions docs/research/research-package-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,57 @@ Tekalign, with substantial OpenAI Codex assistance. Apache-2.0. The exact
HEAD/index fallback premise follows Arham-Tahir64's PR3102 sparse-reference work;
this applies it to replay declarations. The original planner, canonical Git
spelling, symlink and inventory-error controls retain their predecessor credit.

## Historical source/credit receipt adapters

Two source/credit receipts now register an explicit historical-only wrapper:
`research/pr1-retention-receipt` and
`research/pr636-family-witness-manifest-receipt`. Their original package bytes
are frozen at `20ecf2891d80b5acf18d980b2164fb44ea7faa90`, with original input
bases `d8e0f83f00191df62174b641e9fff055c357f641` and
`1f7a934975e5eacaf83511c9ac870263bf095e05`, respectively. Later additions to
CONTRIBUTORS.md and the ledger must not be rolled back to satisfy those old
live-input pins.

Their current SOURCES.json retains each original commit/blob/SHA256 pin as
historical provenance. Current VERIFY.json and README.md explicitly describe
the historical scope. The adapter permits only the exact reviewed transformation
of those three files; current verifier, evidence and other package bytes must
still equal the frozen original. This is a two-package policy, not a fallback
for arbitrary stale live pins.

```sh
python3 -B scripts/replay_historical_receipt.py --package research/pr1-retention-receipt
python3 -B scripts/replay_historical_receipt.py --package research/pr636-family-witness-manifest-receipt
python3 -W error -B -m unittest discover -s tests -p 'test_research_historical_receipts.py' -v
```

CI must fetch full Git history (`fetch-depth: 0`). Required historical commit,
tree and blob objects must be locally available; missing objects fail closed,
and this adapter never fetches them. The adapter authenticates exact
commit/path/blob identities and SHA256 pins, then copies only the original
package, source bytes and required Git objects into a private temporary tree.
It shares no Git object store, config, refs, hooks, worktree or alternate with
the live repository. Replacement objects and inherited Git configuration cannot
substitute history; legacy grafts, symlinks and path aliases are rejected.
The unchanged generic validator and unchanged original commands run there,
including the PR1 positive/twelve failure controls and PR636 positive/four
failure controls. Original per-command timeouts and Python cache isolation
remain in force. The temporary tree is removed after success or failure.

Success requires final unchanged-file checks for original materialized files
and live package/input bytes, and emits `PASS_HISTORICAL_RECEIPT_ONLY` with both
commit IDs and `live_inputs_validated=false`. `--check-only` authenticates only
metadata and pins, emitting `PASS_HISTORICAL_METADATA_ONLY`; it runs no verifier.
Missing history, changed pins, unapproved wrapper/code/evidence changes or
failed controls exit nonzero. This is not a sandbox against arbitrary untrusted
code, an atomic snapshot of a changing checkout, a current-state validation,
a new scientific acceptance or a PR closure decision.

The current registered wrappers also run the focused regression suite and
declare its file and the adapter as inputs. Their edits therefore invalidate
these two consumers without changing the shared planner or workflows. All
other packages retain normal live-input validation. The original manifests
remain immutable in Git; running their original live contract against later
input bytes still fails closed as before. Existing contributor credit,
scientific evidence and selected-frontier obligations are unchanged.
30 changes: 30 additions & 0 deletions research/pr1-retention-receipt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,33 @@ this package follows.
Prepared by **Aaron Wang**, with help from opencode (substantial AI assistance;
no model named; no independent human review claimed). Apache-2.0. Predecessor
licenses and notices remain in force.

## Explicit historical-only registered replay

The registered command now authenticates and replays the original package at
`20ecf2891d80b5acf18d980b2164fb44ea7faa90` against its original pinned base.
It does not validate today's ledger, contributor list, or other live input
bytes. The original SOURCES.json, VERIFY.json, verifier and evidence are read
unchanged from that commit into an isolated temporary tree. Current source
rows keep their exact original commit/blob/SHA256 pins as historical provenance.

Only these three wrapper files (README.md, SOURCES.json and VERIFY.json) may
differ from the frozen package, and the adapter checks their exact approved
transformation. All current verifier and evidence bytes must still equal the
original tree. The original positive and negative controls run without edits;
materialized and live package/input files must remain unchanged afterward.
`PASS_HISTORICAL_RECEIPT_ONLY` is a historical source/credit result, not a
current-state validation, new scientific acceptance, or closure decision.

Run the historical adapter with Python 3.12:

```sh
python3 -B scripts/replay_historical_receipt.py --package research/pr1-retention-receipt
```

The generic runner's default live-input contract is unchanged. To inspect the
original live contract, replay the original frozen package metadata against live
inputs: it correctly rejects later byte drift. The registered wrapper declares
the adapter and its focused tests as inputs, so changes select these two
consumers without a global shared-workflow invalidation. See
[the replay guide](../../docs/research/research-package-guide.md#historical-sourcecredit-receipt-adapters).
18 changes: 9 additions & 9 deletions research/pr1-retention-receipt/SOURCES.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
"files": [
{
"path": "CITATION.cff",
"usage": "input",
"usage": "provenance",
"git_blob": "574b2108bc40b5799f5a8c54fa3519d8aea51892",
"sha256": "4b17b8cff777e2f619afc47d7421e49e9309bdff9f8fe2f185fc774ff18a25e1"
},
{
"path": "CONTRIBUTORS.md",
"usage": "input",
"usage": "provenance",
"git_blob": "6431453337f4ff2fec9b560decce3267f443ea5a",
"sha256": "e16a737af455f68cf329710bf9bc48ec1728101cbeaf1519dd7aef0fbafad172"
},
{
"path": "Makefile",
"usage": "input",
"usage": "provenance",
"git_blob": "02055437d2b90c705e8b82d2ef2b58633101ca7d",
"sha256": "cbcc8cb5e977970fce52ad0b2e4440eb6b6a9c9e87fa1bcfd6af11a16f9344b7"
},
{
"path": "NOTICE",
"usage": "input",
"usage": "provenance",
"git_blob": "59d8e0cf3102e15bd11db430838365531e2d7f18",
"sha256": "b49022cb4104d90b182e4c335f670faf45529025b15db77bf0291835083c28bd"
},
{
"path": "README.md",
"usage": "input",
"usage": "provenance",
"git_blob": "74f49a5eca5910b915cb8446462c081c0372b141",
"sha256": "00162212b6ae88b02330d824c8d1469ef41097c88b91e32b0876f83d29a94caa"
},
Expand All @@ -40,7 +40,7 @@
},
{
"path": "docs/reproducibility.md",
"usage": "input",
"usage": "provenance",
"git_blob": "ce620954a86c0b6688859a7421441fc97a3d9259",
"sha256": "333f87bf13c4aa911af89d278923ea84bfd091966e23f5fb1332e83aa4565db9"
},
Expand All @@ -52,19 +52,19 @@
},
{
"path": "docs/research/pr-ledger.json",
"usage": "input",
"usage": "provenance",
"git_blob": "f5ce7e4c467d3e9bfe1d16a1524228b11c655769",
"sha256": "f36486250793e396bebe63f51adafcee82fe28a4a0c7e9a40cf6b5d1713cb066"
},
{
"path": "research/overnight-pr-review-20261009/dispositions.json",
"usage": "input",
"usage": "provenance",
"git_blob": "ed53da272d6dc016420f2a6a75321e9c18fb5bc1",
"sha256": "9dd0264e667551852a7d6747df490e3e542465caf347d9f43998c6f0665faae9"
},
{
"path": "research/overnight-pr-review-20261009/source-inventory.json",
"usage": "input",
"usage": "provenance",
"git_blob": "ab2e653500b152ca672d8651d2c4476d5672d9fb",
"sha256": "0dc9bc5fc0da37f4442014e17106823f24c4ecaf36b144643fc5684474ac2261"
}
Expand Down
27 changes: 17 additions & 10 deletions research/pr1-retention-receipt/VERIFY.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,37 @@
"docs/reproducibility.md",
"docs/research/pr-ledger.json",
"research/overnight-pr-review-20261009/dispositions.json",
"research/overnight-pr-review-20261009/source-inventory.json"
"research/overnight-pr-review-20261009/source-inventory.json",
"scripts/replay_historical_receipt.py",
"tests/test_research_historical_receipts.py"
],
"commands": [
{
"argv": [
"{python}",
"-I",
"-O",
"-B",
"{package}/verify.py"
"scripts/replay_historical_receipt.py",
"--package",
"{package}"
],
"timeout_seconds": 60,
"checks": "Authenticate the 11 vendored PR1 head files against their recorded live REST blob identities, reparse every changed file's REST patch hunk-exactly against the API additions field, classify each path at the base commit, recompute the multiset survival of PR1's added lines in the five shared files, exclude byte-identical copies of the six new files in the exact base-tree enumeration, and verify credit against CONTRIBUTORS.md, NOTICE, README.md, CITATION.cff, the ledger and the 2026-10-09 review records."
"timeout_seconds": 480,
"checks": "Historical-only replay: authenticate the exact frozen package and original source pins, run unchanged original commands and failure controls in an isolated Git snapshot, and require historical/live bytes unchanged; does not validate today's input bytes."
},
{
"argv": [
"{python}",
"-I",
"-O",
"-B",
"{package}/test_verify.py"
"-m",
"unittest",
"discover",
"-s",
"tests",
"-p",
"test_research_historical_receipts.py",
"-v"
],
"timeout_seconds": 120,
"checks": "One real-evidence positive case and twelve failure controls over vendored bytes, REST blob identities, patch parse counts, base-file content, the CITATION.cff convention line, the CONTRIBUTORS credit row, a forged tree copy, the credit enumeration, both 2026-10-09 review records and the expected result itself."
"checks": "Focused historical-adapter regression controls for wrong history/pins, path aliases, missing inputs, wrapper/code/evidence drift, isolation and unchanged-file gates; the generic live-input validator remains strict."
}
]
}
30 changes: 30 additions & 0 deletions research/pr636-family-witness-manifest-receipt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,33 @@ which audited a different family.

Prepared by Aaron Wang / navinor with help from opencode. Substantial AI
assistance is disclosed; no independent human review is claimed. Apache-2.0.

## Explicit historical-only registered replay

The registered command now authenticates and replays the original package at
`20ecf2891d80b5acf18d980b2164fb44ea7faa90` against its original pinned base.
It does not validate today's ledger, contributor list, or other live input
bytes. The original SOURCES.json, VERIFY.json, verifier and evidence are read
unchanged from that commit into an isolated temporary tree. Current source
rows keep their exact original commit/blob/SHA256 pins as historical provenance.

Only these three wrapper files (README.md, SOURCES.json and VERIFY.json) may
differ from the frozen package, and the adapter checks their exact approved
transformation. All current verifier and evidence bytes must still equal the
original tree. The original positive and negative controls run without edits;
materialized and live package/input files must remain unchanged afterward.
`PASS_HISTORICAL_RECEIPT_ONLY` is a historical source/credit result, not a
current-state validation, new scientific acceptance, or closure decision.

Run the historical adapter with Python 3.12:

```sh
python3 -B scripts/replay_historical_receipt.py --package research/pr636-family-witness-manifest-receipt
```

The generic runner's default live-input contract is unchanged. To inspect the
original live contract, replay the original frozen package metadata against live
inputs: it correctly rejects later byte drift. The registered wrapper declares
the adapter and its focused tests as inputs, so changes select these two
consumers without a global shared-workflow invalidation. See
[the replay guide](../../docs/research/research-package-guide.md#historical-sourcecredit-receipt-adapters).
4 changes: 2 additions & 2 deletions research/pr636-family-witness-manifest-receipt/SOURCES.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
},
{
"path": "docs/research/pr-ledger.json",
"usage": "input",
"usage": "provenance",
"git_blob": "20df7e36f5378796816db70aa755f281f550b45a",
"sha256": "905c5efdf20883dbc212b936bde516c192017869754bcbd4bca9052f03c0f07e"
},
{
"path": "research/larger-gain/MANIFEST.json",
"usage": "input",
"usage": "provenance",
"git_blob": "c8c22f51ca33156f696b48ea8214ef2ffcc13f00",
"sha256": "73c186c2807c703e43293c7cf785557a046958c245fa812e433f7fe208cdef6d"
}
Expand Down
26 changes: 23 additions & 3 deletions research/pr636-family-witness-manifest-receipt/VERIFY.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,37 @@
"requirements": [],
"inputs": [
"docs/research/pr-ledger.json",
"research/larger-gain/MANIFEST.json"
"research/larger-gain/MANIFEST.json",
"scripts/replay_historical_receipt.py",
"tests/test_research_historical_receipts.py"
],
"commands": [
{
"argv": [
"{python}",
"-B",
"{package}/verify.py"
"scripts/replay_historical_receipt.py",
"--package",
"{package}"
],
"timeout_seconds": 480,
"checks": "Historical-only replay: authenticate the exact frozen package and original source pins, run unchanged original commands and failure controls in an isolated Git snapshot, and require historical/live bytes unchanged; does not validate today's input bytes."
},
{
"argv": [
"{python}",
"-B",
"-m",
"unittest",
"discover",
"-s",
"tests",
"-p",
"test_research_historical_receipts.py",
"-v"
],
"timeout_seconds": 120,
"checks": "Drift identity of the two committed larger-gain MANIFEST copies against their recorded digests and against the working tree's research/larger-gain/MANIFEST.json; per-PR pin verdicts and retention counts recomputed from the per-PR audit rows; every changed-path retention class re-derived against git ls-tree -r <base>; cross-PR shared-blob counts recomputed; one positive fixture of the classification rule; four failure controls (tampered digest, substituted manifest diff, omitted row, substituted class) that must each be rejected."
"checks": "Focused historical-adapter regression controls for wrong history/pins, path aliases, missing inputs, wrapper/code/evidence drift, isolation and unchanged-file gates; the generic live-input validator remains strict."
}
]
}
Loading