diff --git a/research/selected-replay-tooling-receipt/README.md b/research/selected-replay-tooling-receipt/README.md new file mode 100644 index 0000000000..3196b7899f --- /dev/null +++ b/research/selected-replay-tooling-receipt/README.md @@ -0,0 +1,137 @@ +# Overlap receipt: open selected-replay tooling PRs + +**Consolidation receipt. No new κ, no disposition, nothing closed.** The selected +frontier and every pinned file are unchanged. + +This receipt covers eight open PRs at exact heads, against main `1f7a9349`. Seven +have the selected #1094 cold replay path as their premise; that path runs +`verify_frontier1094.py` → `1042` → `799` → `741`. The eighth, #1108, is included +because #1142 re-adds its package. Four of them (#1101, #1108, #1142, #1151) are +in the maintainer queue's next batch +(`research/community-efficient200-audit/QUEUE-CURSOR.json`). + +| PR | Head | Author | Subject | Applies to main | Own checks at trial merge | +|---|---|---|---|---|---| +| #1101 | `4d45bef9` | rcfc-jreed | concurrent bit589/complex741 driver for the #741 ancestry | clean | PASS (8 tests) | +| #1108 | `b76bb285` | martinxxx9 | compact-boundary cancellation obstruction | clean | PASS | +| #1142 | `0c2873e6` | martinxxx9 | #1042 replay-capsule closure audit | clean | **FAIL** (see below) | +| #1151 | `99d4f42f` | thakrarsagar | parallel layer-end controls, frontier1042 chain | clean | PASS (`verify.py`, 155 s) | +| #1277 | `02d27951` | thakrarsagar | #1094 reuse-mode ancestry binding audit | clean | PASS | +| #1361 | `40965b22` | thakrarsagar | CI drift/trigger guard for the 35 hash-asserted files | clean | PASS (35 pins, 0 drift, 21 tests) | +| #1509 | `362d2f91` | thakrarsagar | checked `cpp_int` stand-in for bit589 step 4 | clean | PASS | +| #1646 | `3f21415b` | JosieElliston | sparse phase recipes, frontier1042 `phases` steps | clean (head on `858771bc`) | not rerun | + +**Retention.** None of the eight heads has content already on main: no changed +path has an identical blob at the base. The only path that exists on main is +`.github/workflows/frontier1094.yml`, which #1361 edits. So there is nothing to +receipt as "already integrated". Each PR needs its own review. + +**#1142 does not pass on current main.** + +1. `research/frontier1042-capsule-closure-seed75/verify.py` prints `FAIL: repository pin + differs: certificates/selected-result.json`. `PINS.json` pins the #1042 record + (sha256 `207d1f49…`) at the path that now holds #1094's record. +2. That record is retained byte for byte at `certificates/checkpoints/frontier1042.json`. + Changing only `selected_record.path` to that file gives + `PASS_FRONTIER1042_CAPSULE_CLOSURE`. This was tested in scratch and is not part of this + package. The contributor or reviewer should decide whether to repin. +3. The body's reproduce command, `make frontier1042-capsule-closure-verify`, exists + neither in the PR nor on main. +4. #1142 also adds all seven files of #1108's `research/compact-boundary-cancellation-seed51/`. + Five of them still differ after CRLF→LF normalization. #1142's copy is the + earlier one: it pins `certificates/selected-result.json` to the #942 blob `3d7529d7` + and fails with `Source drift`. #1108's copy pins `certificates/checkpoints/frontier942.json` + and passes. Merging either PR and then the other gives an add/add conflict. + +**Premises that still hold at the base.** +- #1277: `verify_frontier1094.py` still has exactly one bare `check_selected(...)` + statement, so the `--baseline1042` reuse path discards its result. +- #1361: the guard still finds 35 live pins. +- #1101: `verify_frontier741.py` is unchanged since #1101's base. +- #1151, #1509: their declared inputs are unchanged. + +**Pairwise overlap.** Apart from the #1108/#1142 collision, no two PRs in the family change the same file. The pairs that +look similar address different steps or questions: +- #1151 and #1646 cover the lec and phases steps of the frontier1042 chain. +- #1101 and #1509 both concern bit589 in the #741 ancestry. #1101 runs it concurrently + with complex741; #1509 replaces Boost for its step 4. #1101's driver does not scrub + `BOOST_INCLUDE`, but I did not test the two together. +- #1277, #1361 and #1142 cover three different parts of the selected evidence: + #1277 checks the reuse-mode binding, #1361 checks CI drift and triggers, and #1142 + checks the archive bytes. + +All the speed-up PRs (#1101, #1151, #1646) are opt-in and unwired. The pinned drivers +are unchanged, so none of them shortens `make frontier1094-verify` by itself. Their +equality claims differ, as their own PR bodies state: +- #1151: its receipts are byte-identical to the archived ones. +- #1646: it reproduces the pinned recipe digests. +- #1101: its output trees match the sequential driver's only after timing fields and + timing-dependent digests are masked. + +## Reproduce + +```sh +python3 -B research/selected-replay-tooling-receipt/verify.py # base-side facts + 5 controls +for n in 1101 1108 1142 1151 1277 1361 1509 1646; do + git fetch origin pull/$n/head:refs/receipt/pr$n; done # exact heads, if still reachable +python3 -B research/selected-replay-tooling-receipt/verify.py --heads # recompute per-PR facts +``` + +The default run, which is the registered one, needs Git history containing the base. +It checks the following at `1f7a9349`: +- the selected and #1042-checkpoint record hashes; +- the cold-chain calls; +- #1277's premise; +- the absent make target. + +It also checks that five mutated receipts are rejected. + +`--heads` recomputes, for every recorded head: +- the changed paths; +- the identical-on-main paths; +- clean application to the base; +- the #1108/#1142 byte differences, pin and add/add conflict; +- #1142's capsule pin. + +It writes one temporary merge commit object, which Git garbage-collects as unreachable. +If a contributor force-pushes, `--heads` fails rather than silently re-reading. + +The trial-merge check results in `RECEIPT.json` (`trial_merge_checks_recorded`) are +recorded evidence from this session, not recomputed by `verify.py`. They come from a +shared macOS arm64 host with Python 3.14, and Python 3.12 for the registered packages. + +**Not checked:** correctness of any PR's mathematics or speed claims beyond its own +verifier, the cold `make frontier1094-verify`, Linux, and the PRs outside this family. + +## Open next questions + +1. **Should #1142 be repinned or narrowed before review?** Its audit holds once it points + at the retained #1042 checkpoint. The bundled seed51 copy duplicates #1108. First step: + the contributor drops the seed51 files and repins one path. Blocked on: the contributor + or a maintainer decision. +2. **Do other next-batch PRs collide with each other?** #1142 re-adding #1108's directory + was found only because both were in this family. + + I ran an unregistered path-collision scan of the 100 `next_batch` heads (recorded only + here, not checked by `verify.py`). Each pair was merged in order with true merge parents. + - #1129→#1157 and #1148/#1178/#1195 merge cleanly in any order tried. + - Besides #1108/#1142, these pairs conflict textually: + - #1110/#1190 (`docs/research/pr-ledger.md`); + - #1112/#1137 (`Makefile`); + - `.gitattributes` in the gauge44-ends7 family. Merging any of #1104, #1107, #1117 or + #1121 and then #1124 or #1130 conflicts, even though those heads are ancestors of + #1124 and #1130; the reason was not traced. Merging any of the seven and then #1193 + also conflicts. #1104→#1107→#1117→#1121 merge cleanly. + - #1172 conflicts with each of #1107, #1117, #1121, #1124 and #1130 inside + `research/gauge44-ends7-t16/` (`MANIFEST.json`, `README.md`, `RESULT.json`, + `data/`…). These look like competing versions of one package, which needs a reviewer's + choice rather than a mechanical merge. I did not compare their contents. +3. **Which opt-in speedups should be wired into the pinned cold chain?** #1101, #1151 and + #1646 each state their own equality evidence (see above). Wiring them needs pinned-driver + changes that only a maintainer can approve. + +## Credit + +Covered PRs and their authors are listed above. The maintainer queue cursor and +efficient-review audit are by Douglas Colkitt. Prepared by Josie Elliston's donated +session with Claude Code (Claude Opus); see [TASK.json](TASK.json). Apache-2.0. diff --git a/research/selected-replay-tooling-receipt/RECEIPT.json b/research/selected-replay-tooling-receipt/RECEIPT.json new file mode 100644 index 0000000000..73c8206640 --- /dev/null +++ b/research/selected-replay-tooling-receipt/RECEIPT.json @@ -0,0 +1,477 @@ +{ + "schema": "selected-replay-tooling-receipt-v1", + "base_commit": "1f7a934975e5eacaf83511c9ac870263bf095e05", + "observed_at": "PR metadata 2026-10-14T05:10Z; heads and merges rechecked 2026-10-14T05:15Z", + "scope": "Open PRs whose premise is the selected #1094 cold replay path (1094 -> 1042 -> 799 -> 741), plus #1108 because #1142 re-adds its package. Exact heads only; not a review of correctness, not a disposition, no closures.", + "main_facts": { + "selected_record_sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32", + "selected_decimal": "0.001672660197076918", + "frontier1042_checkpoint_sha256": "207d1f49f113c585024b9d3c17eadbb8b1be17c1321e3d190aabe2f18ce1c5b7", + "frontier942_checkpoint_blob": "3d7529d77a5f22d8c6f64f98bd5a0e71b8eee892", + "cold_chain": [ + [ + "scripts/verify_frontier1094.py", + "run('baseline1042-cold', ROOT/'scripts/verify_frontier1042.py'" + ], + [ + "scripts/verify_frontier1042.py", + "run('baseline799-cold', ROOT/'scripts/verify_frontier799.py'" + ], + [ + "scripts/verify_frontier799.py", + "run('ancestor',[sys.executable,'-B',ROOT/'scripts/verify_frontier741.py'" + ] + ], + "bare_check_selected_statements": 1, + "absent_make_targets": [ + "frontier1042-capsule-closure-verify" + ] + }, + "collision": { + "first": 1108, + "second": 1142, + "path_prefix": "research/compact-boundary-cancellation-seed51/", + "paths": 7, + "differ_raw": [ + "research/compact-boundary-cancellation-seed51/CLAIM.json", + "research/compact-boundary-cancellation-seed51/README.md", + "research/compact-boundary-cancellation-seed51/RESULT.json", + "research/compact-boundary-cancellation-seed51/SOURCES.json", + "research/compact-boundary-cancellation-seed51/VALIDATION.json", + "research/compact-boundary-cancellation-seed51/verify.py" + ], + "differ_after_crlf_normalization": [ + "research/compact-boundary-cancellation-seed51/CLAIM.json", + "research/compact-boundary-cancellation-seed51/README.md", + "research/compact-boundary-cancellation-seed51/SOURCES.json", + "research/compact-boundary-cancellation-seed51/VALIDATION.json", + "research/compact-boundary-cancellation-seed51/verify.py" + ], + "second_pins_selected_result_blob": "3d7529d77a5f22d8c6f64f98bd5a0e71b8eee892" + }, + "capsule_pin": { + "pins_file": "research/frontier1042-capsule-closure-seed75/PINS.json", + "pinned_path": "certificates/selected-result.json" + }, + "prs": [ + { + "number": 1101, + "author": "rcfc-jreed", + "title": "Tooling: overlap bit589 and complex741 in the #741 ancestry replay, 17% (50% with --complex-jobs 3) less wall time (no new kappa)", + "head": "4d45bef9bd0b52cc4989f195cd2dd4597f4a6d08", + "created_at": "2026-10-13T18:11:28Z", + "changed": [ + [ + "A", + "docs/research/frontier741-concurrent-replay.md" + ], + [ + "A", + "scripts/verify_frontier741_concurrent.py" + ], + [ + "A", + "tests/test_frontier741_concurrent.py" + ] + ], + "paths_identical_on_base": [], + "paths_present_on_base_with_other_bytes": [], + "merges_cleanly_into_base": true, + "trial_merge_checks_recorded": [ + { + "command": "python3 -B -m unittest discover -s tests -p test_frontier741_concurrent.py", + "result": "PASS, 8 tests" + } + ], + "github_base_ref_oid": "ba82555c64e1879e4b7decce28186f208fcb8262" + }, + { + "number": 1108, + "author": "martinxxx9", + "title": "Research: exact compact-control boundary cancellation obstruction (no new kappa)", + "head": "b76bb2853be4e7001508582b10913e32ad7aba9f", + "created_at": "2026-10-13T18:21:07Z", + "changed": [ + [ + "A", + "research/compact-boundary-cancellation-seed51/CLAIM.json" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/README.md" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/RESULT.json" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/SOURCES.json" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/VALIDATION.json" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/test_package.py" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/verify.py" + ] + ], + "paths_identical_on_base": [], + "paths_present_on_base_with_other_bytes": [], + "merges_cleanly_into_base": true, + "trial_merge_checks_recorded": [ + { + "command": "python3 -B research/compact-boundary-cancellation-seed51/verify.py", + "result": "PASS_COMPACT_BOUNDARY_CANCELLATION states=40800 production=1176 controls=8" + } + ], + "github_base_ref_oid": "ba82555c64e1879e4b7decce28186f208fcb8262" + }, + { + "number": 1142, + "author": "martinxxx9", + "title": "Independent verification: selected PR1042 replay-capsule closure (no new κ)", + "head": "0c2873e6ac844b369a5962f06ef0a74ac86cf4a4", + "created_at": "2026-10-13T18:59:53Z", + "changed": [ + [ + "A", + "research/compact-boundary-cancellation-seed51/CLAIM.json" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/README.md" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/RESULT.json" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/SOURCES.json" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/VALIDATION.json" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/test_package.py" + ], + [ + "A", + "research/compact-boundary-cancellation-seed51/verify.py" + ], + [ + "A", + "research/frontier1042-capsule-closure-seed75/CLAIM.md" + ], + [ + "A", + "research/frontier1042-capsule-closure-seed75/NOTICE.md" + ], + [ + "A", + "research/frontier1042-capsule-closure-seed75/PINS.json" + ], + [ + "A", + "research/frontier1042-capsule-closure-seed75/PROOF.md" + ], + [ + "A", + "research/frontier1042-capsule-closure-seed75/README.md" + ], + [ + "A", + "research/frontier1042-capsule-closure-seed75/RESULT.json" + ], + [ + "A", + "research/frontier1042-capsule-closure-seed75/test_package.py" + ], + [ + "A", + "research/frontier1042-capsule-closure-seed75/verify.py" + ] + ], + "paths_identical_on_base": [], + "paths_present_on_base_with_other_bytes": [], + "merges_cleanly_into_base": true, + "trial_merge_checks_recorded": [ + { + "command": "python3 -B research/frontier1042-capsule-closure-seed75/verify.py", + "result": "FAIL: repository pin differs: certificates/selected-result.json" + }, + { + "command": "python3 -B -m unittest research/frontier1042-capsule-closure-seed75/test_package.py", + "result": "PASS, 6 tests (fixtures only)" + }, + { + "command": "make frontier1042-capsule-closure-verify (the PR body's reproduce command)", + "result": "No rule to make target" + }, + { + "command": "python3 -B research/compact-boundary-cancellation-seed51/verify.py (#1142's copy)", + "result": "FAIL: Source drift: certificates/selected-result.json" + }, + { + "command": "capsule verify.py with only PINS.json selected_record.path changed to certificates/checkpoints/frontier1042.json (scratch, not committed)", + "result": "PASS_FRONTIER1042_CAPSULE_CLOSURE" + } + ], + "github_base_ref_oid": "ce7ad1b6ab09452c3478723a2e96ed5ff212dc08" + }, + { + "number": 1151, + "author": "thakrarsagar", + "title": "Tooling: opt-in parallel layer-end controls for the frontier1042 leaver chain, byte-identical receipts, 3.1x (extends #1059, no new kappa)", + "head": "99d4f42f7cfe5f60d14316ef18e9455c38eaa290", + "created_at": "2026-10-13T19:10:51Z", + "changed": [ + [ + "A", + "research/frontier1042-lec-parallel/BENCHMARK-macos-arm64.json" + ], + [ + "A", + "research/frontier1042-lec-parallel/CLAIM.json" + ], + [ + "A", + "research/frontier1042-lec-parallel/PINS.json" + ], + [ + "A", + "research/frontier1042-lec-parallel/README.md" + ], + [ + "A", + "research/frontier1042-lec-parallel/audit_worker.py" + ], + [ + "A", + "research/frontier1042-lec-parallel/chain_lec.py" + ], + [ + "A", + "research/frontier1042-lec-parallel/lec_parallel.py" + ], + [ + "A", + "research/frontier1042-lec-parallel/test_package.py" + ], + [ + "A", + "research/frontier1042-lec-parallel/verify.py" + ] + ], + "paths_identical_on_base": [], + "paths_present_on_base_with_other_bytes": [], + "merges_cleanly_into_base": true, + "trial_merge_checks_recorded": [ + { + "command": "python3 -B -m unittest discover -s research/frontier1042-lec-parallel -p test_package.py", + "result": "PASS" + }, + { + "command": "python3 -B research/frontier1042-lec-parallel/verify.py --work NEW_DIR", + "result": "PASS_FRONTIER1042_LEC_PARALLEL, 154.5 s wall" + } + ], + "github_base_ref_oid": "ce7ad1b6ab09452c3478723a2e96ed5ff212dc08" + }, + { + "number": 1277, + "author": "thakrarsagar", + "title": "Research audit: the selected #1094 reuse replay discards its ancestry recheck; binding certified from committed archives (no new kappa)", + "head": "02d279515ff1fc468ab99a19d89461f1b6391507", + "created_at": "2026-10-13T21:36:35Z", + "changed": [ + [ + "A", + "research/frontier1094-ancestry-binding-seed69/EXPECTED.json" + ], + [ + "A", + "research/frontier1094-ancestry-binding-seed69/README.md" + ], + [ + "A", + "research/frontier1094-ancestry-binding-seed69/SOURCES.json" + ], + [ + "A", + "research/frontier1094-ancestry-binding-seed69/TASK.json" + ], + [ + "A", + "research/frontier1094-ancestry-binding-seed69/VERIFY.json" + ], + [ + "A", + "research/frontier1094-ancestry-binding-seed69/verify.py" + ] + ], + "paths_identical_on_base": [], + "paths_present_on_base_with_other_bytes": [], + "merges_cleanly_into_base": true, + "trial_merge_checks_recorded": [ + { + "command": "python3 scripts/research_package.py --package research/frontier1094-ancestry-binding-seed69 --check-only", + "result": "PASS_PACKAGE_METADATA_AND_PINS" + }, + { + "command": "python3.12 scripts/research_package.py --package research/frontier1094-ancestry-binding-seed69", + "result": "PASS_FRONTIER1094_ANCESTRY_BINDING_AUDIT 22575ff2..., outcome=completed" + } + ], + "github_base_ref_oid": "dadfea6e8a78ff6ba901705f87532a71c6f5bbb8" + }, + { + "number": 1361, + "author": "thakrarsagar", + "title": "Tooling: fast guard for the 35 live-checkout files the selected #1094 replay hash-asserts, plus complete replay triggers (no new kappa)", + "head": "40965b228001a95c1f55054e5ed661fa85190813", + "created_at": "2026-10-13T23:24:54Z", + "changed": [ + [ + "A", + "scripts/check_selected_ci_inputs.py" + ], + [ + "A", + "tests/test_selected_ci_inputs.py" + ], + [ + "M", + ".github/workflows/frontier1094.yml" + ] + ], + "paths_identical_on_base": [], + "paths_present_on_base_with_other_bytes": [ + ".github/workflows/frontier1094.yml" + ], + "merges_cleanly_into_base": true, + "trial_merge_checks_recorded": [ + { + "command": "python3 -B scripts/check_selected_ci_inputs.py --require-triggers", + "result": "PASS_SELECTED_CI_INPUTS, live_pins 35, pin_drift 0" + }, + { + "command": "python3 -B -m unittest discover -s tests -p test_selected_ci_inputs.py", + "result": "PASS, 21 tests" + } + ], + "github_base_ref_oid": "bce54fb3f895cbe5cd4c0eb477c3afeed100190f" + }, + { + "number": 1509, + "author": "thakrarsagar", + "title": "Portability tooling: checked cpp_int stand-in runs the selected replay's only native step (bit589 step 4) without Boost, matching the committed Boost receipts (no new kappa)", + "head": "362d2f91f30b96bc2596ff431c9baf7a78503683", + "created_at": "2026-10-14T02:00:09Z", + "changed": [ + [ + "A", + "research/bit589-checked-cpp-int-seed92/EXPECTED.json" + ], + [ + "A", + "research/bit589-checked-cpp-int-seed92/README.md" + ], + [ + "A", + "research/bit589-checked-cpp-int-seed92/SOURCES.json" + ], + [ + "A", + "research/bit589-checked-cpp-int-seed92/TASK.json" + ], + [ + "A", + "research/bit589-checked-cpp-int-seed92/VERIFY.json" + ], + [ + "A", + "research/bit589-checked-cpp-int-seed92/include/boost/multiprecision/cpp_int.hpp" + ], + [ + "A", + "research/bit589-checked-cpp-int-seed92/mutants.py" + ], + [ + "A", + "research/bit589-checked-cpp-int-seed92/verify.py" + ] + ], + "paths_identical_on_base": [], + "paths_present_on_base_with_other_bytes": [], + "merges_cleanly_into_base": true, + "trial_merge_checks_recorded": [ + { + "command": "python3 scripts/research_package.py --package research/bit589-checked-cpp-int-seed92 --check-only", + "result": "PASS_PACKAGE_METADATA_AND_PINS" + }, + { + "command": "python3.12 scripts/research_package.py --package research/bit589-checked-cpp-int-seed92", + "result": "PASS_BIT589_STEP4_CHECKED_CPP_INT_STANDIN, outcome=completed" + } + ], + "github_base_ref_oid": "ef5f39403610d231a0c27e8a6b4f08c10209bcd6" + }, + { + "number": 1646, + "author": "JosieElliston", + "title": "Tooling: exact sparse phase recipes reproduce the three frontier1042 phases pins, 12x on a shared host (no new kappa)", + "head": "3f21415bd54bfc7028c3d92f047cac876bc95a91", + "created_at": "2026-10-14T05:05:15Z", + "changed": [ + [ + "A", + "research/frontier1042-phase-fastpath/BENCHMARK-macos-arm64.json" + ], + [ + "A", + "research/frontier1042-phase-fastpath/README.md" + ], + [ + "A", + "research/frontier1042-phase-fastpath/SOURCES.json" + ], + [ + "A", + "research/frontier1042-phase-fastpath/TASK.json" + ], + [ + "A", + "research/frontier1042-phase-fastpath/VERIFY.json" + ], + [ + "A", + "research/frontier1042-phase-fastpath/bench.py" + ], + [ + "A", + "research/frontier1042-phase-fastpath/verify.py" + ] + ], + "paths_identical_on_base": [], + "paths_present_on_base_with_other_bytes": [], + "merges_cleanly_into_base": true, + "trial_merge_checks_recorded": [ + { + "command": "(base is this receipt's base; checked by its own session, not rerun here)", + "result": "not rerun" + } + ], + "github_base_ref_oid": "1f7a934975e5eacaf83511c9ac870263bf095e05" + } + ], + "trial_merge_checks_environment": "macOS arm64, shared host (load 15-30), python3 = 3.14, python3.12 for registered packages; run in a scratch worktree at the trial merge of base and head" +} diff --git a/research/selected-replay-tooling-receipt/SOURCES.json b/research/selected-replay-tooling-receipt/SOURCES.json new file mode 100644 index 0000000000..029af4b180 --- /dev/null +++ b/research/selected-replay-tooling-receipt/SOURCES.json @@ -0,0 +1,42 @@ +{ + "schema_version": 1, + "base_commit": "1f7a934975e5eacaf83511c9ac870263bf095e05", + "files": [ + { + "path": "certificates/checkpoints/frontier1042.json", + "usage": "input", + "git_blob": "f451ced6626a1f03aba6915ce23a136b01ebe51d", + "sha256": "207d1f49f113c585024b9d3c17eadbb8b1be17c1321e3d190aabe2f18ce1c5b7" + }, + { + "path": "certificates/selected-result.json", + "usage": "input", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "06c96f5579bb67ed1b86d334e78fbed7da6945f1", + "sha256": "6686ad58f1fbdbc87134a78901b60fd53a20d3984355e91defbbebc9e9fa8075" + }, + { + "path": "scripts/verify_frontier1042.py", + "usage": "input", + "git_blob": "e4f129b0570865330e39ae11eafafe7167f7e374", + "sha256": "700fdcaeb6e8f57f6e63c71c2dd1652fc5b183e8d706cd092779bdc0d271e854" + }, + { + "path": "scripts/verify_frontier1094.py", + "usage": "input", + "git_blob": "96e6c1386bd052b9bcaf136d934406f3f0c3f777", + "sha256": "c7e20f59968ed5736fb859735de4de207de3418083e37012310ebcded946b949" + }, + { + "path": "scripts/verify_frontier799.py", + "usage": "input", + "git_blob": "c0d8b0d0c9c52ed17ad37cbf7dc88838daea203a", + "sha256": "19fe1b32079095160dc00fe2f7df75e0fcbc82cff37f7159b755c8a63bd5ce99" + } + ] +} diff --git a/research/selected-replay-tooling-receipt/TASK.json b/research/selected-replay-tooling-receipt/TASK.json new file mode 100644 index 0000000000..6a1f0c69c7 --- /dev/null +++ b/research/selected-replay-tooling-receipt/TASK.json @@ -0,0 +1,72 @@ +{ + "schema_version": 1, + "task_id": "overlap-receipt", + "priority_revision": 3, + "base_commit": "1f7a934975e5eacaf83511c9ac870263bf095e05", + "original_card": { + "id": "overlap-receipt", + "question": "What exact content and credit of a small named PR set has already been retained?", + "starting_points": [ + "docs/research/pr-ledger.md", + "CONTRIBUTORS.md" + ], + "methods": [ + "Compare exact heads and retained artifacts to write a source-bound disposition receipt.", + "Audit an existing receipt for missing content or predecessor attribution." + ], + "acceptance_gate": "Separate complete integration, partial retention and changed heads; make no autonomous closures.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read one small PR set in the ledger and identify exact reviewed heads and unresolved content.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Compare that set to retained artifacts; produce a complete or explicitly partial disposition receipt.", + "bottleneck_link": "Reliable overlap evidence preserves credit and prevents repeated review of already-retained material.", + "allowed_variations": [ + "One small related PR family or one existing integration receipt." + ], + "scope_change_triggers": [ + "Treating matching titles or one shared blob as proof of full incorporation." + ], + "overlap_terms": [ + "overlap receipt", + "partial integration", + "attribution" + ] + }, + "scope_status": "refined", + "actual_scope": "Exact-head overlap and retention receipt for eight open PRs on the selected #1094 cold replay path (#1101, #1142, #1151, #1277, #1361, #1509, #1646) plus #1108, which #1142 duplicates, against main 1f7a9349.", + "scope_change_reason": "The card names no family; this picks the open replay-tooling family because four members are in the maintainer queue next batch and none had a family-level receipt. No ledger entry exists for these PRs yet, so the receipt compares heads with main rather than with a prior integration receipt.", + "bottleneck_link": "Side result for review throughput: it tells the reviewer that nothing in this family is already retained, that #1142 fails on current main and collides with #1108, and which premises still hold, so the next batch is not reviewed twice or merged into a conflict.", + "budget_minutes": 60, + "stop_rule": "Stop after one receipt for the named family; no correctness review of the PRs, no dispositions, no wider queue census.", + "outcome": "completed", + "evidence": "verify.py (default: base-side facts and five receipt-mutation controls; --heads: recomputes per-PR changed paths, retention, clean application, the #1108/#1142 collision and the #1142 capsule pin). RECEIPT.json records each PR's own checks run at the trial merge in this session.", + "author": "Josie Elliston (with Claude)", + "ai_assistance": "Prepared with Claude Code (Claude Opus) in Josie Elliston's donated session. No independent human review.", + "open_questions": [ + { + "question": "Should #1142 be repinned to certificates/checkpoints/frontier1042.json and its bundled copy of #1108's package dropped?", + "why_it_matters": "As submitted it fails on current main and conflicts with #1108; the capsule audit itself passes after a one-path repin.", + "first_step": "Contributor or reviewer applies the one-line PINS.json path change and removes research/compact-boundary-cancellation-seed51 from #1142.", + "blocked_by": "Contributor or maintainer decision." + }, + { + "question": "Do other next-batch PRs collide in ways a batch merge will hit?", + "why_it_matters": "The #1108/#1142 add/add collision was found only because both fell in this family.", + "first_step": "Done once in scratch (README, open question 2): besides #1108/#1142, textual conflicts #1110/#1190 (pr-ledger.md), #1112/#1137 (Makefile), .gitattributes between #1104/#1107/#1117/#1121 and #1124/#1130 and between the gauge44-ends7 heads and #1193, and competing research/gauge44-ends7-t16 contents between #1172 and #1107/#1117/#1121/#1124/#1130. Repeat when the cursor moves.", + "blocked_by": "Nothing." + }, + { + "question": "Which opt-in replay speedups (#1101, #1151, #1646) should be wired into the pinned cold chain?", + "why_it_matters": "Each states its own equality evidence (#1151 byte-identical receipts, #1646 pinned digests, #1101 equal after masking timing fields), but none shortens make frontier1094-verify until the pinned drivers call it.", + "first_step": "Maintainer chooses whether to change verify_frontier741/799 and reproduce_leaver_chain.py pins.", + "blocked_by": "Pinned-driver changes need maintainer approval." + } + ] +} diff --git a/research/selected-replay-tooling-receipt/VERIFY.json b/research/selected-replay-tooling-receipt/VERIFY.json new file mode 100644 index 0000000000..833b004f57 --- /dev/null +++ b/research/selected-replay-tooling-receipt/VERIFY.json @@ -0,0 +1,24 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "certificates/checkpoints/frontier1042.json", + "certificates/selected-result.json", + "scripts/verify_frontier1042.py", + "scripts/verify_frontier1094.py", + "scripts/verify_frontier799.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 60, + "checks": "Base-side facts at 1f7a9349 (selected and #1042 checkpoint hashes, cold chain, #1277 premise, absent make target) and five receipt-mutation controls. Per-PR head facts need --heads and fetched PR refs, so they are not part of the registered run." + } + ] +} diff --git a/research/selected-replay-tooling-receipt/verify.py b/research/selected-replay-tooling-receipt/verify.py new file mode 100644 index 0000000000..f393ce25b2 --- /dev/null +++ b/research/selected-replay-tooling-receipt/verify.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python3 +"""Check the selected-replay tooling overlap receipt (stdlib only). + +Default mode checks the main-side facts at the receipt's base commit. With +--heads it also recomputes every per-PR fact from the exact PR head objects, +which must already be in the local object store (see README for the fetch). + +Josie Elliston's donated session with Claude Code. Apache-2.0. +""" +import argparse +import ast +import hashlib +import json +import subprocess +import sys +from pathlib import Path + +PKG = Path(__file__).resolve().parent +ROOT = PKG.parents[1] + + +def fail(msg): + print('FAIL_SELECTED_REPLAY_TOOLING_RECEIPT:', msg) + sys.exit(1) + + +def require(cond, msg): + if not cond: + fail(msg) + + +def git(*args, check=True): + r = subprocess.run(['git', '-C', str(ROOT), *args], capture_output=True) + if check and r.returncode: + fail('git %s: %s' % (' '.join(args), r.stderr.decode(errors='replace').strip())) + return r + + +def show(rev, path): + return git('show', '%s:%s' % (rev, path)).stdout + + +def has_object(rev): + return git('cat-file', '-e', rev + '^{commit}', check=False).returncode == 0 + + +def blob(rev, path): + r = git('rev-parse', '--verify', '-q', '%s:%s' % (rev, path), check=False) + return r.stdout.decode().strip() if r.returncode == 0 else None + + +def sha256(data): + return hashlib.sha256(data).hexdigest() + + +def main_side(rc): + base = rc['base_commit'] + m = rc['main_facts'] + # Selected record moved to #1094; the #1042 record is retained as a checkpoint. + sel = show(base, 'certificates/selected-result.json') + ck = show(base, 'certificates/checkpoints/frontier1042.json') + require(sha256(sel) == m['selected_record_sha256'], 'selected record differs at base') + require(json.loads(sel)['decimal'] == m['selected_decimal'], 'selected decimal differs') + require(sha256(ck) == m['frontier1042_checkpoint_sha256'], 'frontier1042 checkpoint differs') + require(sha256(sel) != sha256(ck), 'selected record still equals the #1042 record') + require(blob(base, 'certificates/checkpoints/frontier942.json') == m['frontier942_checkpoint_blob'], + 'frontier942 checkpoint blob differs') + # Live files must equal the base for the default (registered) run. + for p in ('certificates/selected-result.json', 'certificates/checkpoints/frontier1042.json'): + require(sha256((ROOT / p).read_bytes()) == sha256(show(base, p)), 'live %s drifted from base' % p) + # Cold chain 1094 -> 1042 -> 799 -> 741. + for script, callee in m['cold_chain']: + require(callee.encode() in show(base, script), '%s no longer runs %s' % (script, callee)) + # PR1277 premise: the --baseline1042 reuse path discards check_selected's result. + # Every call of check_selected must be a bare statement on `ancestor`, i.e. its result unused. + tree = ast.parse(show(base, 'scripts/verify_frontier1094.py')) + calls = [n for n in ast.walk(tree) if isinstance(n, ast.Call) + and getattr(n.func, 'id', None) == 'check_selected'] + bare = [n.value for n in ast.walk(tree) if isinstance(n, ast.Expr) and n.value in calls + and getattr(n.value.args[0], 'id', None) == 'ancestor'] + require(len(calls) == len(bare) == m['bare_check_selected_statements'], + 'check_selected calls %d, bare on ancestor %d' % (len(calls), len(bare))) + # PR1142's documented make target does not exist at base. + mk = show(base, 'Makefile').decode() + for tgt in m['absent_make_targets']: + require(('\n%s:' % tgt) not in mk, 'make target %s now exists' % tgt) + return ['base %s: selected %s, #1042 checkpoint retained, cold chain, PR1277 premise, ' + '%d absent make target(s)' % (base[:8], m['selected_decimal'], len(m['absent_make_targets']))] + + +def merge_tree(a, b): + r = git('merge-tree', '--write-tree', '--name-only', a, b, check=False) + lines = r.stdout.decode().splitlines() + return r.returncode, lines[0] if lines else None, lines + + +def pr_facts(base, pr): + head = pr['head'] + mb = git('merge-base', base, head).stdout.decode().strip() + diff = git('diff', '--name-status', '--no-renames', mb, head).stdout.decode().splitlines() + changed = sorted(tuple(x.split('\t', 1)) for x in diff) + on_main_same = sorted(p for _, p in changed if blob(base, p) is not None and blob(base, p) == blob(head, p)) + on_main_diff = sorted(p for _, p in changed if blob(base, p) is not None and blob(base, p) != blob(head, p)) + code, _, _ = merge_tree(base, head) + return { + 'changed': [list(c) for c in changed], + 'paths_identical_on_base': on_main_same, + 'paths_present_on_base_with_other_bytes': on_main_diff, + 'merges_cleanly_into_base': code == 0, + } + + +def unexpected_shared(rc): + c = rc['collision'] + owners = {} + for pr in rc['prs']: + for _, path in pr['changed']: + owners.setdefault(path, []).append(pr['number']) + return sorted(k for k, v in owners.items() if len(v) > 1 + and not (k.startswith(c['path_prefix']) and v == [c['first'], c['second']])) + + +def heads(rc): + base = rc['base_commit'] + missing = [str(p['number']) for p in rc['prs'] if not has_object(p['head'])] + require(not missing, 'missing PR head objects for %s; fetch them as in README' % ', '.join(missing)) + out = [] + for pr in rc['prs']: + got = pr_facts(base, pr) + for k, v in got.items(): + require(pr[k] == v, 'PR%d %s: receipt %r, recomputed %r' % (pr['number'], k, pr[k], v)) + out.append('PR%d %s: %d paths, clean=%s, retained=%d' + % (pr['number'], pr['head'][:8], len(got['changed']), + got['merges_cleanly_into_base'], len(got['paths_identical_on_base']))) + c = rc['collision'] + a, b = (next(p for p in rc['prs'] if p['number'] == n) for n in (c['first'], c['second'])) + # Both PRs add the same package directory with different bytes. + # Apart from the recorded collision, no two family PRs change the same path. + require(not unexpected_shared(rc), 'unexpected shared paths %r' % unexpected_shared(rc)) + bad = json.loads(json.dumps(rc)) + bad['prs'][0]['changed'].append(['A', bad['prs'][1]['changed'][0][1]]) + require(unexpected_shared(bad), 'control: injected shared path was accepted') + pa = {p for _, p in map(tuple, a['changed']) if p.startswith(c['path_prefix'])} + pb = {p for _, p in map(tuple, b['changed']) if p.startswith(c['path_prefix'])} + require(pa == pb and len(pa) == c['paths'], 'collision path set differs') + raw = sorted(p for p in pa if blob(a['head'], p) != blob(b['head'], p)) + lf = sorted(p for p in pa if show(a['head'], p).replace(b'\r\n', b'\n') != show(b['head'], p).replace(b'\r\n', b'\n')) + require(raw == c['differ_raw'] and lf == c['differ_after_crlf_normalization'], 'collision bytes differ: %r %r' % (raw, lf)) + # The copy in the second PR pins selected-result.json to the #942 record blob. + src = json.loads(show(b['head'], c['path_prefix'] + 'SOURCES.json').replace(b'\r\n', b'\n')) + files = src.get('files', src) + pinned = files['certificates/selected-result.json']['git_blob'] + require(pinned == c['second_pins_selected_result_blob'] == rc['main_facts']['frontier942_checkpoint_blob'], + 'second copy pin %s' % pinned) + require(blob(base, 'certificates/selected-result.json') != pinned, 'base selected record equals #942 blob') + # Merging the first then the second conflicts (add/add). + t = git('merge-tree', '--write-tree', base, a['head']).stdout.decode().split()[0] + mc = git('commit-tree', t, '-p', base, '-p', a['head'], '-m', 'receipt trial merge').stdout.decode().strip() + code, _, lines = merge_tree(mc, b['head']) + require(code == 1 and any('CONFLICT (add/add)' in x for x in lines), 'sequential merge did not conflict') + # PR1142's capsule audit pins the #1042 record at the path that is now #1094's. + p = rc['capsule_pin'] + pins = json.loads(show(b['head'], p['pins_file'])) + require(pins['selected_record']['path'] == p['pinned_path'], 'capsule pin path') + require(pins['selected_record']['sha256'] == rc['main_facts']['frontier1042_checkpoint_sha256'], 'capsule pin sha') + out.append('collision PR%d/PR%d: %d paths, %d differ raw, %d after CRLF normalization; ' + 'sequential merge add/add conflict' % (c['first'], c['second'], len(pa), len(raw), len(lf))) + return out + + +def controls(rc): + """Each mutated receipt must be rejected by the base-side checks.""" + import copy + import contextlib + import io + muts = { + 'selected decimal': ('selected_decimal', '0.001672188119205421'), + 'checkpoint sha': ('frontier1042_checkpoint_sha256', '0' * 64), + 'chain callee': ('cold_chain', [['scripts/verify_frontier1094.py', 'scripts/verify_frontier890.py']]), + 'PR1277 premise': ('bare_check_selected_statements', 0), + 'existing target': ('absent_make_targets', ['frontier1094-verify']), + } + for name, (key, value) in muts.items(): + bad = copy.deepcopy(rc) + bad['main_facts'][key] = value + try: + with contextlib.redirect_stdout(io.StringIO()): + main_side(bad) + except SystemExit: + continue + fail('control %r was accepted' % name) + return ['%d receipt mutation controls rejected' % len(muts)] + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument('--heads', action='store_true', help='also recompute per-PR facts from fetched heads') + a = ap.parse_args() + if sys.flags.optimize: + fail('run without -O') + rc = json.loads((PKG / 'RECEIPT.json').read_text()) + lines = main_side(rc) + controls(rc) + if a.heads: + lines += heads(rc) + for line in lines: + print(line) + print('PASS_SELECTED_REPLAY_TOOLING_RECEIPT', 'heads' if a.heads else 'base-only') + + +if __name__ == '__main__': + main()