diff --git a/research/merge5112-retention-receipt/README.md b/research/merge5112-retention-receipt/README.md new file mode 100644 index 0000000000..46223c8d86 --- /dev/null +++ b/research/merge5112-retention-receipt/README.md @@ -0,0 +1,125 @@ +# Post-merge retention receipt: the nine PRs integrated at 51122344 + +**Research consolidation (credit and provenance). No new kappa; no disposition, +ledger, closure or frontier change.** Prepared by **Aaron Wang**, with help from +opencode (substantial AI assistance; no independent human review claimed). +Apache-2.0. + +Card `overlap-receipt` (consolidation track, scope key `757723e3fd38f20fa774`, +chooser OS-draw nonce `66879550e1fc7c124e80fcde11281b4d`, priority revision 3), +**refined** to one existing integration receipt: the maintainer merge +[`51122344`](https://github.com/CrocSwap/integer-mult-bounds/commit/51122344de9382e784c7f89953456d8cd55513ef) +(2026-10-14, "Integrate reviewed research PRs #1805, #1806, #1808, #1810, #1811, +#1812, #1814, #1815, #1827"). Base main `51122344de9382e784c7f89953456d8cd55513ef`; +its first parent (pre-merge main) is `d33f15be91438e3de512fa544c3f5a7cb832588f`. + +## What was audited + +The existing receipt under audit is the scoped review +[`research/community-efficient800-audit/DISPOSITIONS.json`](../community-efficient800-audit/DISPOSITIONS.json) +plus the merge commit message. That review predates the merge: it records every +one of the nine PRs with `disposition: partially_reviewed` and +`github_state: OPEN`, and names each PR's `integration_location`. Whether the +merged tree actually retained each reviewed head's content byte-for-byte was +therefore open at selection time. This receipt answers exactly that, and nothing +else. + +## Method + +All facts except the GitHub-observed fields below are re-derived offline from +the local Git object store by [verify.py](verify.py): + +1. The parents of the merge commit must be exactly pre-merge main plus the nine + reviewed heads recorded in `DISPOSITIONS.json` (a changed head or an extra + parent fails the check). +2. For each reviewed head, its own changed-path set is the three-dot diff from + its merge base with pre-merge main (`git diff --name-status BASE...head`), so + paths where the head merely lags main are not counted as its changes. +3. Each changed path's Git blob at the head must equal its blob in the merge + tree (`retained-identical`). Modified or missing blobs are reported + separately, never folded into "retained". +4. GitHub observations (author, title, state, `mergedAt`) were pinned on + 2026-10-14 via `gh pr view`; the offline verifier does not re-check them. + +[RECEIPT.json](RECEIPT.json) holds the per-PR records with every path and blob. +Seven in-memory rejection controls (corrupted head blob, corrupted merge blob, +wrong verdict, dropped path, fabricated path, false changed-head flag, wrong +totals) must all fail; the identity comparison against fresh Git facts is the +positive fixture. [SOURCES.json](SOURCES.json) pins the scoped review and the +provenance files by Git blob and SHA256. + +## Result + +All nine reviewed heads are retained completely and identically: **77 of 77** +changed paths carry the same Git blob in the merge tree as at the reviewed +head; 0 modified, 0 missing, 0 deletions by any of the nine PRs. No head +changed since review (`headRefOid` equals the recorded `reviewed_head` for all +nine, and each is a merge parent). Every changed path lies inside the PR's +recorded `integration_location`. All nine authors appear in +[CONTRIBUTORS.md](../../CONTRIBUTORS.md). + +| PR | Author | Integration location | Changed paths | Retained identical | +|---|---|---|---:|---:| +| [#1805](https://github.com/CrocSwap/integer-mult-bounds/pull/1805) | VictorLiwentao | research/h2sem-copyshare-priced | 10 | 10 | +| [#1806](https://github.com/CrocSwap/integer-mult-bounds/pull/1806) | mtpsl | research/r439-abc-hosted-invoice | 9 | 9 | +| [#1808](https://github.com/CrocSwap/integer-mult-bounds/pull/1808) | JosieElliston | research/plane-port-copy-budgets | 6 | 6 | +| [#1810](https://github.com/CrocSwap/integer-mult-bounds/pull/1810) | RossRichardson | research/r439-dirty-workspace-frame-bound | 8 | 8 | +| [#1811](https://github.com/CrocSwap/integer-mult-bounds/pull/1811) | 1337isnot1337 | research/five-source-parity-hyperplanes-seed595e | 12 | 12 | +| [#1812](https://github.com/CrocSwap/integer-mult-bounds/pull/1812) | nedveder | research/two-connector-eight-transfer-threshold | 8 | 8 | +| [#1814](https://github.com/CrocSwap/integer-mult-bounds/pull/1814) | 1337isnot1337 | research/complex-gather-child-seed7a6d | 11 | 11 | +| [#1815](https://github.com/CrocSwap/integer-mult-bounds/pull/1815) | jmbarrancoml | research/polarized-p112-code-bound | 5 | 5 | +| [#1827](https://github.com/CrocSwap/integer-mult-bounds/pull/1827) | mightyOil | research/p112-joint-support-loss-audit | 8 | 8 | + +One recorded observation, not changed here: the nine +[docs/research/pr-ledger.md](../../docs/research/pr-ledger.md) rows still read +"partially reviewed" and cite the pre-merge scoped review. Updating a +disposition is a maintainer action; the open question below records it. + +## Limits + +Git blob identity is identity of file content and mode as Git records it; this +is not a ZIP-container or Windows-checkout byte comparison. Nothing here +re-reviews the nine packages' mathematics, re-runs their checkers, or certifies +their claims. The GitHub-observed fields are pinned observations and may drift +after 2026-10-14. No disposition is changed, no PR closure is requested, and +the selected record (`10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32`) +is untouched. + +## Reproduce + +From the repository root (needs Git history; standard library only): + +```sh +python3.12 scripts/research_package.py --package research/merge5112-retention-receipt +python3.12 scripts/research_package.py --package research/merge5112-retention-receipt --check-only +``` + +## Open next questions + +1. Should the nine ledger rows move from "partially reviewed" to "incorporated" + now that merge 51122344 retains their exact reviewed heads? It matters + because the ledger is the central review entry point and understated rows + make reviewers re-scan retained work. First step: a maintainer updates the + rows citing this receipt. Blocked on: disposition changes are maintainer + actions. +2. Do the nine contributed packages' own checkers still pass on the merged + tree? Blob identity is content retention, not green replays. First step: run + each package's `verify.py` or registered replay under Python 3.12 from a + merge-5112 checkout. Blocked on: bounded time for the longer replays. + +## Credit + +The nine packages and their claims belong to their PR authors: VictorLiwentao, +mtpsl, Josie Elliston (JosieElliston), Ross Richardson (RossRichardson), Cinna +Davis (1337isnot1337), nedveder, jmbarrancoml and Philipp (mightyOil). The +scoped review being audited is the maintainer's +`research/community-efficient800-audit` (with its own merge, integrity and +ledger-check receipts). The receipt style follows the PR148 source-retention +receipt (https://github.com/CrocSwap/integer-mult-bounds/pull/1572) and the +fourth100 family receipt (package +`research/pr636-family-witness-manifest-receipt/`, recorded in the handoffs +thread https://github.com/CrocSwap/integer-mult-bounds/discussions/1166), which +audited different +PR sets. Concurrent mathematical work that names PR1805 as a predecessor (an +independent PR1805 audit by Ross Richardson, and a PR1805/PR1062 composition +claim) addresses mechanisms, not merge retention, and is not duplicated here. diff --git a/research/merge5112-retention-receipt/RECEIPT.json b/research/merge5112-retention-receipt/RECEIPT.json new file mode 100644 index 0000000000..e969b8ea26 --- /dev/null +++ b/research/merge5112-retention-receipt/RECEIPT.json @@ -0,0 +1,807 @@ +{ + "schema_version": 1, + "kind": "source-bound post-merge integration-retention receipt", + "base_commit": "d33f15be91438e3de512fa544c3f5a7cb832588f", + "merge_commit": "51122344de9382e784c7f89953456d8cd55513ef", + "merge_commit_message_subject": "Integrate reviewed research PRs #1805, #1806, #1808, #1810, #1811, #1812, #1814, #1815, #1827", + "selected_record_sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32", + "observations_via_gh": { + "date_utc": "2026-10-14", + "command": "gh pr view --repo CrocSwap/integer-mult-bounds --json number,title,state,headRefOid,author,isDraft,mergedAt,mergeCommit", + "note": "GitHub-observed fields (author, title, state, mergedAt) are pinned observations; the offline verifier re-derives only git-verifiable facts." + }, + "totals": { + "prs": 9, + "changed_paths": 77, + "retained_identical": 77, + "retained_modified": 0, + "not_retained": 0, + "changed_heads_vs_reviewed": 0, + "merge_parents_extra_or_missing": [], + "ledger_rows_note": "docs/research/pr-ledger.md rows for these nine PRs read 'partially reviewed' and cite research/community-efficient800-audit/DISPOSITIONS.json; this receipt changes no disposition and requests no closure." + }, + "pull_requests": { + "1805": { + "pr": 1805, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1805", + "author": "VictorLiwentao", + "title": "Research: price H2-sem copy-path helper-sharing wraps (no new kappa)", + "head": "b34e0620bd92af49c9095e0eeb885f601fffd137", + "reviewed_head_recorded": "b34e0620bd92af49c9095e0eeb885f601fffd137", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:48Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/h2sem-copyshare-priced" + ], + "package_prefixes_of_changed_paths": [ + "research/h2sem-copyshare-priced" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/h2sem-copyshare-priced/CERTIFICATE.json", + "head_blob": "8a43123fff7fb0d1a85d6281de54428c66aa45b5", + "merge_blob": "8a43123fff7fb0d1a85d6281de54428c66aa45b5", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/CLAIM.md", + "head_blob": "d4d91261b5fa63fe71550343478f725ed2d9f274", + "merge_blob": "d4d91261b5fa63fe71550343478f725ed2d9f274", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/NOTICE.md", + "head_blob": "4df374b13dddee747216ebc68792248a9bb038d3", + "merge_blob": "4df374b13dddee747216ebc68792248a9bb038d3", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/PROOF.md", + "head_blob": "e672ef76b50f729dd7dfefe80f022ea8b1f0fec2", + "merge_blob": "e672ef76b50f729dd7dfefe80f022ea8b1f0fec2", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/README.md", + "head_blob": "1566f074cc0a6a4422157fc34f6ed88d30deb7de", + "merge_blob": "1566f074cc0a6a4422157fc34f6ed88d30deb7de", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/SOURCES.json", + "head_blob": "f11faac8ae68b1f9b0c9b8ce841c29a10e90d5d8", + "merge_blob": "f11faac8ae68b1f9b0c9b8ce841c29a10e90d5d8", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/TASK.json", + "head_blob": "ac6a46aba54dcb78fc7a46c9a26a156f935e0662", + "merge_blob": "ac6a46aba54dcb78fc7a46c9a26a156f935e0662", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/VERIFY.json", + "head_blob": "52ee133979cc6172ebc298329059d711ec699b62", + "merge_blob": "52ee133979cc6172ebc298329059d711ec699b62", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/test_package.py", + "head_blob": "4c3759b32b3807a23b6b40ed1d2b3084d1ca5584", + "merge_blob": "4c3759b32b3807a23b6b40ed1d2b3084d1ca5584", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/h2sem-copyshare-priced/verify.py", + "head_blob": "e777965a2a379c48b9ee1ec3dc4d3c352930a9d7", + "merge_blob": "e777965a2a379c48b9ee1ec3dc4d3c352930a9d7", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 10, + "retained_modified": 0, + "not_retained": 0 + }, + "1806": { + "pr": 1806, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1806", + "author": "mtpsl", + "title": "Research: complete PR1122 nine-stage hosted invoice (no new kappa)", + "head": "48153115a150af98a9c94adb34cab180dcd226e5", + "reviewed_head_recorded": "48153115a150af98a9c94adb34cab180dcd226e5", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:48Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/r439-abc-hosted-invoice" + ], + "package_prefixes_of_changed_paths": [ + "research/r439-abc-hosted-invoice" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/README.md", + "head_blob": "9a289d1090f9d6881dc3e71252e9092b64c2a7dd", + "merge_blob": "9a289d1090f9d6881dc3e71252e9092b64c2a7dd", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/RESULT.json", + "head_blob": "75fc85424f6f62e248a295483bf157de79724daa", + "merge_blob": "75fc85424f6f62e248a295483bf157de79724daa", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/SOURCES.json", + "head_blob": "0b2a99b5f04bedb47ca2fb24d2ee1e7678a8fa27", + "merge_blob": "0b2a99b5f04bedb47ca2fb24d2ee1e7678a8fa27", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/TASK.json", + "head_blob": "f9ccf5f82efe0ce79655cb7b228b07f6968991c3", + "merge_blob": "f9ccf5f82efe0ce79655cb7b228b07f6968991c3", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/VALIDATION.json", + "head_blob": "fa4dce8c7c00fee243101b711f3200862316b07c", + "merge_blob": "fa4dce8c7c00fee243101b711f3200862316b07c", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/VERIFY.json", + "head_blob": "9e27f59c131b1ded705996653fb6a7790f0a08be", + "merge_blob": "9e27f59c131b1ded705996653fb6a7790f0a08be", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/invoice.py", + "head_blob": "e7839ca55247c86fe87185b0bce27186ff7c6cb0", + "merge_blob": "e7839ca55247c86fe87185b0bce27186ff7c6cb0", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/invoke.py", + "head_blob": "74bc7c640a0408ce0994851d0891f01153989282", + "merge_blob": "74bc7c640a0408ce0994851d0891f01153989282", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-abc-hosted-invoice/verify.py", + "head_blob": "bec1d4f56580a45a4d0fb8d639f034c202242cdb", + "merge_blob": "bec1d4f56580a45a4d0fb8d639f034c202242cdb", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 9, + "retained_modified": 0, + "not_retained": 0 + }, + "1808": { + "pr": 1808, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1808", + "author": "JosieElliston", + "title": "Planning screen: certified decoder copy budgets for the plane-port coverage law on both suppliers (no new kappa)", + "head": "b3d9b9813e0f2e82d8379cd4dafa2a355a900a44", + "reviewed_head_recorded": "b3d9b9813e0f2e82d8379cd4dafa2a355a900a44", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:48Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/plane-port-copy-budgets" + ], + "package_prefixes_of_changed_paths": [ + "research/plane-port-copy-budgets" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/plane-port-copy-budgets/README.md", + "head_blob": "6fb7fa623726619ae7730ed20380d6f4e8489210", + "merge_blob": "6fb7fa623726619ae7730ed20380d6f4e8489210", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/plane-port-copy-budgets/RESULT.json", + "head_blob": "8422c4e82aa3ca96b0f7ad4e4c8eac9f13b0f51b", + "merge_blob": "8422c4e82aa3ca96b0f7ad4e4c8eac9f13b0f51b", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/plane-port-copy-budgets/SOURCES.json", + "head_blob": "e510863dac9d0779510da7da434e5eaf1cd39250", + "merge_blob": "e510863dac9d0779510da7da434e5eaf1cd39250", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/plane-port-copy-budgets/TASK.json", + "head_blob": "4bbac99a3c35c269acce46478d593c9eb88a867c", + "merge_blob": "4bbac99a3c35c269acce46478d593c9eb88a867c", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/plane-port-copy-budgets/VERIFY.json", + "head_blob": "f1398c79fad5a84da14bcd6f5ae4069a12801303", + "merge_blob": "f1398c79fad5a84da14bcd6f5ae4069a12801303", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/plane-port-copy-budgets/verify.py", + "head_blob": "7f8effca7c25f1439a55188fc99f59a5fea26cd4", + "merge_blob": "7f8effca7c25f1439a55188fc99f59a5fea26cd4", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 6, + "retained_modified": 0, + "not_retained": 0 + }, + "1810": { + "pr": 1810, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1810", + "author": "RossRichardson", + "title": "Research: extend R439 frame obstruction to dirty workspace", + "head": "aed73d574ff6145f056d3723ce87c61b06e631f8", + "reviewed_head_recorded": "aed73d574ff6145f056d3723ce87c61b06e631f8", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:48Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/r439-dirty-workspace-frame-bound" + ], + "package_prefixes_of_changed_paths": [ + "research/r439-dirty-workspace-frame-bound" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/r439-dirty-workspace-frame-bound/CERTIFICATE.json", + "head_blob": "b6f5e8969270bb2f54db8a52e0c31b6c3096f1a0", + "merge_blob": "b6f5e8969270bb2f54db8a52e0c31b6c3096f1a0", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-dirty-workspace-frame-bound/README.md", + "head_blob": "cb5225cbd2b6182ad4cd9fe4200b2744ea620f3b", + "merge_blob": "cb5225cbd2b6182ad4cd9fe4200b2744ea620f3b", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-dirty-workspace-frame-bound/SOURCES.json", + "head_blob": "7a7e55cae2de870032758b982651cdff0500418f", + "merge_blob": "7a7e55cae2de870032758b982651cdff0500418f", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-dirty-workspace-frame-bound/TASK.json", + "head_blob": "683f5078fbd44d10480162e6c4b7ed82f15d2df3", + "merge_blob": "683f5078fbd44d10480162e6c4b7ed82f15d2df3", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-dirty-workspace-frame-bound/VERIFY.json", + "head_blob": "e604d4afdd18190feac36f406751536ad43d9b50", + "merge_blob": "e604d4afdd18190feac36f406751536ad43d9b50", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-dirty-workspace-frame-bound/oracle.py", + "head_blob": "bb7f556ab221f7d9c0ff746b7559b029cde0570d", + "merge_blob": "bb7f556ab221f7d9c0ff746b7559b029cde0570d", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-dirty-workspace-frame-bound/test_package.py", + "head_blob": "e88d56e062387c84868b37e5db738ce3110e5d2c", + "merge_blob": "e88d56e062387c84868b37e5db738ce3110e5d2c", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/r439-dirty-workspace-frame-bound/verify.py", + "head_blob": "9c113c089950aac20fe2c8d98c517d4dc659f8f6", + "merge_blob": "9c113c089950aac20fe2c8d98c517d4dc659f8f6", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 8, + "retained_modified": 0, + "not_retained": 0 + }, + "1811": { + "pr": 1811, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1811", + "author": "1337isnot1337", + "title": "Exact five-source parity-hyperplane connector schedules", + "head": "7ac80c37c843cdb48f48772dc46817d5f591fd3e", + "reviewed_head_recorded": "7ac80c37c843cdb48f48772dc46817d5f591fd3e", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:48Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/five-source-parity-hyperplanes-seed595e" + ], + "package_prefixes_of_changed_paths": [ + "research/five-source-parity-hyperplanes-seed595e" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/CERTIFICATE.json", + "head_blob": "b8baf5011d24859a7e6499533b3515417a70dd5b", + "merge_blob": "b8baf5011d24859a7e6499533b3515417a70dd5b", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/HANDOFF.md", + "head_blob": "2267d001c838576bf463cf4c26820c8ebf689953", + "merge_blob": "2267d001c838576bf463cf4c26820c8ebf689953", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/NOTICE.md", + "head_blob": "5fbf4e85bc635a30da74ed52850c90900f404e87", + "merge_blob": "5fbf4e85bc635a30da74ed52850c90900f404e87", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/PROOF.md", + "head_blob": "8f55dcab22434513ebe60f0d5a084f584e92b621", + "merge_blob": "8f55dcab22434513ebe60f0d5a084f584e92b621", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/README.md", + "head_blob": "007f862f34ea35528c93e992fa4af8572f7e918b", + "merge_blob": "007f862f34ea35528c93e992fa4af8572f7e918b", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/SOURCES.json", + "head_blob": "d8a0ae42cc32473587429bc93910c7b9816bf30d", + "merge_blob": "d8a0ae42cc32473587429bc93910c7b9816bf30d", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/TASK.json", + "head_blob": "9024ebdca16b6762eefe8fad23984363eb846d2b", + "merge_blob": "9024ebdca16b6762eefe8fad23984363eb846d2b", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/VALIDATION.md", + "head_blob": "be2e42284b73aab11eb99e3dc9ff70fea76942cd", + "merge_blob": "be2e42284b73aab11eb99e3dc9ff70fea76942cd", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/VERIFY.json", + "head_blob": "e0b7da418aac0afc1897de0a37ab25f5fb8d1d10", + "merge_blob": "e0b7da418aac0afc1897de0a37ab25f5fb8d1d10", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/analyze.py", + "head_blob": "7c65da4b203766b9236952f7847838349e905628", + "merge_blob": "7c65da4b203766b9236952f7847838349e905628", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/independent_check.py", + "head_blob": "81bff03e61e194303c8380134257e72a97ef6478", + "merge_blob": "81bff03e61e194303c8380134257e72a97ef6478", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/five-source-parity-hyperplanes-seed595e/verify.py", + "head_blob": "3860ad6c155845e54070e2b6f052a3ce8f766c9e", + "merge_blob": "3860ad6c155845e54070e2b6f052a3ce8f766c9e", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 12, + "retained_modified": 0, + "not_retained": 0 + }, + "1812": { + "pr": 1812, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1812", + "author": "nedveder", + "title": "Research: eight paid transfers are exactly necessary for the two-conn\u2026", + "head": "e43abcde1c98c718f5b4d0b25cf4cd9c04200bd8", + "reviewed_head_recorded": "e43abcde1c98c718f5b4d0b25cf4cd9c04200bd8", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:48Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/two-connector-eight-transfer-threshold" + ], + "package_prefixes_of_changed_paths": [ + "research/two-connector-eight-transfer-threshold" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/two-connector-eight-transfer-threshold/EXPECTED.json", + "head_blob": "174225f8c074e800683f0475f9f8c6a022a5a311", + "merge_blob": "174225f8c074e800683f0475f9f8c6a022a5a311", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/two-connector-eight-transfer-threshold/README.md", + "head_blob": "024317f66332a549a1190b860564c201940bc1e4", + "merge_blob": "024317f66332a549a1190b860564c201940bc1e4", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/two-connector-eight-transfer-threshold/SOURCES.json", + "head_blob": "93a8c12fecf2c6a6e7e237579dc49d62ef326f9b", + "merge_blob": "93a8c12fecf2c6a6e7e237579dc49d62ef326f9b", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/two-connector-eight-transfer-threshold/TASK.json", + "head_blob": "4fdc41c8bd1f940cead1125182f170c8ab56d60e", + "merge_blob": "4fdc41c8bd1f940cead1125182f170c8ab56d60e", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/two-connector-eight-transfer-threshold/VERIFY.json", + "head_blob": "3a43ba39c654f0e627b94c8c4cb07503dd803eff", + "merge_blob": "3a43ba39c654f0e627b94c8c4cb07503dd803eff", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/two-connector-eight-transfer-threshold/native/census_literal.c", + "head_blob": "d118d545a9d6dc80f3f41e5c5697a9e7920d9d18", + "merge_blob": "d118d545a9d6dc80f3f41e5c5697a9e7920d9d18", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/two-connector-eight-transfer-threshold/native/census_prefix.c", + "head_blob": "83e575baf8a2abc290ad238fae23b62136301e62", + "merge_blob": "83e575baf8a2abc290ad238fae23b62136301e62", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/two-connector-eight-transfer-threshold/verify.py", + "head_blob": "77485867a34e5e146afc93f137baf7364255bea7", + "merge_blob": "77485867a34e5e146afc93f137baf7364255bea7", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 8, + "retained_modified": 0, + "not_retained": 0 + }, + "1814": { + "pr": 1814, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1814", + "author": "1337isnot1337", + "title": "Add exact C3 gather rank-shape obstruction", + "head": "915bf647756c20a07ab9b8523fe09dfcb4f33f7b", + "reviewed_head_recorded": "915bf647756c20a07ab9b8523fe09dfcb4f33f7b", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:48Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/complex-gather-child-seed7a6d" + ], + "package_prefixes_of_changed_paths": [ + "research/complex-gather-child-seed7a6d" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/CERTIFICATE.json", + "head_blob": "8d329e668df1a7c64aed5169212244c6ce33dcb2", + "merge_blob": "8d329e668df1a7c64aed5169212244c6ce33dcb2", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/CLAIM.md", + "head_blob": "154f1015a4aecb547d1d68349d229f1417e44398", + "merge_blob": "154f1015a4aecb547d1d68349d229f1417e44398", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/OVERLAP-GATHER.json", + "head_blob": "0fe765952ca326fcced31843a443be270512f548", + "merge_blob": "0fe765952ca326fcced31843a443be270512f548", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/OVERLAP.json", + "head_blob": "12321ae1db213c0742b0671237c21540824f5308", + "merge_blob": "12321ae1db213c0742b0671237c21540824f5308", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/README.md", + "head_blob": "3df0d4f148219536c2d19b223f15aed31c4a5907", + "merge_blob": "3df0d4f148219536c2d19b223f15aed31c4a5907", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/SELECTOR.json", + "head_blob": "e6c7b8262bde2e2716e0b424add61950009c15be", + "merge_blob": "e6c7b8262bde2e2716e0b424add61950009c15be", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/SOURCES.json", + "head_blob": "4395f84af73148f6dda7270f7554e76d73854e1b", + "merge_blob": "4395f84af73148f6dda7270f7554e76d73854e1b", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/TASK.json", + "head_blob": "0adbb2843d1fbb54f9eea3f36284ecf5036a20b4", + "merge_blob": "0adbb2843d1fbb54f9eea3f36284ecf5036a20b4", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/VERIFY.json", + "head_blob": "b371d6de51c46d3ed3f2b3733241bbc80dd044b5", + "merge_blob": "b371d6de51c46d3ed3f2b3733241bbc80dd044b5", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/test_verify.py", + "head_blob": "bac2ed2773cbdf6743b08f45b5e162611d89544e", + "merge_blob": "bac2ed2773cbdf6743b08f45b5e162611d89544e", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/complex-gather-child-seed7a6d/verify.py", + "head_blob": "dc6941e5db7122efd46438e94881c46fec1dcfc9", + "merge_blob": "dc6941e5db7122efd46438e94881c46fec1dcfc9", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 11, + "retained_modified": 0, + "not_retained": 0 + }, + "1815": { + "pr": 1815, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1815", + "author": "jmbarrancoml", + "title": "Derive one-sided P112 fitting rigidity from support spectra", + "head": "c4f1e3ace88ecc69cd1ea959ecf4f2e0930d015e", + "reviewed_head_recorded": "c4f1e3ace88ecc69cd1ea959ecf4f2e0930d015e", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:48Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/polarized-p112-code-bound" + ], + "package_prefixes_of_changed_paths": [ + "research/polarized-p112-code-bound" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/polarized-p112-code-bound/README.md", + "head_blob": "9429fcfbd0a1b5c3e544770c1faec28d6cf1af7b", + "merge_blob": "9429fcfbd0a1b5c3e544770c1faec28d6cf1af7b", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/polarized-p112-code-bound/SOURCES.json", + "head_blob": "43bb13c5c882563673e8b46ff5c336f5edb7c5cb", + "merge_blob": "43bb13c5c882563673e8b46ff5c336f5edb7c5cb", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/polarized-p112-code-bound/TASK.json", + "head_blob": "e4a68171429daf212943ed8c6e9634dee70e3b11", + "merge_blob": "e4a68171429daf212943ed8c6e9634dee70e3b11", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/polarized-p112-code-bound/VERIFY.json", + "head_blob": "3cf79b9cc3e5970ece6c023fb3f8ba6ef9912aba", + "merge_blob": "3cf79b9cc3e5970ece6c023fb3f8ba6ef9912aba", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/polarized-p112-code-bound/verify.py", + "head_blob": "580e355eb93576d4a018e7ad1a5c5021e6684ff6", + "merge_blob": "580e355eb93576d4a018e7ad1a5c5021e6684ff6", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 5, + "retained_modified": 0, + "not_retained": 0 + }, + "1827": { + "pr": 1827, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/1827", + "author": "mightyOil", + "title": "Audit: sharp joint P112 deletion loss and full-rank two-total COPY floor 66", + "head": "5273822d94a87804664cf9965ebd92bec4222955", + "reviewed_head_recorded": "5273822d94a87804664cf9965ebd92bec4222955", + "head_equals_reviewed_head": true, + "merge_parent": true, + "github_state_observed": "MERGED", + "github_state_at_review_recorded": "OPEN", + "merged_at_observed": "2026-10-14T16:38:47Z", + "merge_commit_observed": "51122344de9382e784c7f89953456d8cd55513ef", + "integration_location_recorded": [ + "research/p112-joint-support-loss-audit" + ], + "package_prefixes_of_changed_paths": [ + "research/p112-joint-support-loss-audit" + ], + "credit_in_CONTRIBUTORS_md": true, + "changed_paths": [ + { + "status": "A", + "path": "research/p112-joint-support-loss-audit/PROOF.md", + "head_blob": "d0b0ba257cc7fb8d0f18dc5a029dcec30cb09207", + "merge_blob": "d0b0ba257cc7fb8d0f18dc5a029dcec30cb09207", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/p112-joint-support-loss-audit/README.md", + "head_blob": "0e14a0b721326a144b784436d5b9b9ae62883004", + "merge_blob": "0e14a0b721326a144b784436d5b9b9ae62883004", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/p112-joint-support-loss-audit/RESULT.json", + "head_blob": "00aa70a4476f3448f1923f67dc3bff61a339dfd3", + "merge_blob": "00aa70a4476f3448f1923f67dc3bff61a339dfd3", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/p112-joint-support-loss-audit/SOURCES.json", + "head_blob": "7bbb723a0af6d04b1b73af1208741bdec3be0415", + "merge_blob": "7bbb723a0af6d04b1b73af1208741bdec3be0415", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/p112-joint-support-loss-audit/TASK.json", + "head_blob": "822b3d7c7af79c24b15c3554399975c7d9f3e16e", + "merge_blob": "822b3d7c7af79c24b15c3554399975c7d9f3e16e", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/p112-joint-support-loss-audit/VERIFY.json", + "head_blob": "208114bf60bb3779f35532cd62191c2e4ec5167e", + "merge_blob": "208114bf60bb3779f35532cd62191c2e4ec5167e", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/p112-joint-support-loss-audit/test_package.py", + "head_blob": "072c25183675b77f9c1f6556fb71f37a57f34286", + "merge_blob": "072c25183675b77f9c1f6556fb71f37a57f34286", + "verdict": "retained-identical" + }, + { + "status": "A", + "path": "research/p112-joint-support-loss-audit/verify.py", + "head_blob": "0d386fff0ff0963246b8be8f46bd6f6bdd41f4ba", + "merge_blob": "0d386fff0ff0963246b8be8f46bd6f6bdd41f4ba", + "verdict": "retained-identical" + } + ], + "deletions_by_pr": [], + "retained_identical": 8, + "retained_modified": 0, + "not_retained": 0 + } + } +} diff --git a/research/merge5112-retention-receipt/SOURCES.json b/research/merge5112-retention-receipt/SOURCES.json new file mode 100644 index 0000000000..582b05fde3 --- /dev/null +++ b/research/merge5112-retention-receipt/SOURCES.json @@ -0,0 +1,24 @@ +{ + "schema_version": 1, + "base_commit": "51122344de9382e784c7f89953456d8cd55513ef", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "06c96f5579bb67ed1b86d334e78fbed7da6945f1", + "sha256": "6686ad58f1fbdbc87134a78901b60fd53a20d3984355e91defbbebc9e9fa8075" + }, + { + "path": "research/community-efficient800-audit/DISPOSITIONS.json", + "usage": "provenance", + "git_blob": "d10a94133f2614cfb86a45d3a088967a56619be3", + "sha256": "7d6285385d910a50ff4f7926d960c4ef82ef9d2d41128e828e3ee9f2ac3338c1" + } + ] +} diff --git a/research/merge5112-retention-receipt/TASK.json b/research/merge5112-retention-receipt/TASK.json new file mode 100644 index 0000000000..e645855ce3 --- /dev/null +++ b/research/merge5112-retention-receipt/TASK.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "task_id": "overlap-receipt", + "priority_revision": 3, + "base_commit": "51122344de9382e784c7f89953456d8cd55513ef", + "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": "Source-bound post-merge content-and-credit receipt for the nine PRs integrated at merge commit 51122344de9382e784c7f89953456d8cd55513ef (#1805, #1806, #1808, #1810, #1811, #1812, #1814, #1815, #1827): whether each reviewed head's own changed paths are retained byte-identically in the merged tree, whether any head changed since review, and whether author credit is recorded.", + "scope_change_reason": "The card names no family; this refines it to one existing integration receipt (the maintainer merge of the research/community-efficient800-audit batch), the newest small named set whose post-merge retention had no receipt. Its scoped review predates the merge and records every PR as github_state OPEN, so content retention in the merged tree was an open question at selection time. Distinct from mathematical audits of individual members (for example the independent PR1805 audit and the PR1805/PR1062 composition claim of 2026-10-14), which concern mechanisms rather than merge retention.", + "bottleneck_link": "Reliable overlap evidence preserves credit and prevents repeated review of already-retained material: this receipt certifies the nine efficient800 packages are on main byte-identically under their reviewed heads, so reviewers need not re-scan their content, and it records (without changing) the still-partial ledger dispositions. Side result: no kappa, supplier or frontier effect.", + "budget_minutes": 60, + "stop_rule": "Stop after the nine heads' complete changed-path sets are compared against the merge tree, with rejection controls and source pins; no mathematical re-review of package contents, no ledger edits, no closures, no package replays beyond this receipt's verifier.", + "outcome": "completed", + "evidence": "RECEIPT.json: 77/77 changed paths across the nine PRs retained byte-identically in the merge tree (0 modified, 0 missing), 0 changed heads versus research/community-efficient800-audit/DISPOSITIONS.json reviewed_head fields, merge parents exactly base d33f15be plus the nine reviewed heads, and all nine authors present in CONTRIBUTORS.md. research/merge5112-retention-receipt/verify.py prints PASS_MERGE5112_RETENTION_RECEIPT with source pins ok and 7/7 rejection controls.", + "author": "Aaron Wang", + "ai_assistance": "Substantial AI assistance from opencode (agent session); no independent human review claimed.", + "open_questions": [ + { + "question": "Should the nine docs/research/pr-ledger.md rows move from 'partially reviewed' to 'incorporated' now that merge 51122344 retains their exact reviewed heads?", + "why_it_matters": "The ledger is the central review entry point; rows that understate retention make reviewers re-scan already-retained work.", + "first_step": "A maintainer updates the nine rows citing this receipt and research/community-efficient800-audit/DISPOSITIONS.json, keeping the scoped-review limitations on record.", + "blocked_by": "Disposition and closure changes are maintainer actions; this package deliberately makes none." + }, + { + "question": "Do the nine contributed packages' own checkers still pass on the merged tree?", + "why_it_matters": "Blob identity establishes content retention but not that each contributed verifier runs green in the merged repository state.", + "first_step": "Run each package's registered replay or verify.py under Python 3.12 from a merge-5112 checkout and record a per-package result table.", + "blocked_by": "Session time; several packages declare long or dependency-bearing replays that need their own bounded runs." + } + ] +} diff --git a/research/merge5112-retention-receipt/VERIFY.json b/research/merge5112-retention-receipt/VERIFY.json new file mode 100644 index 0000000000..f72cd7c600 --- /dev/null +++ b/research/merge5112-retention-receipt/VERIFY.json @@ -0,0 +1,18 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Re-derives from the local Git object store the merge-parent set of 51122344 and each reviewed head's complete three-dot changed-path set with blob identities, compares all of it to RECEIPT.json (identity positive fixture), re-checks SOURCES.json blob and SHA256 pins, and runs seven in-memory rejection controls (corrupted head blob, corrupted merge blob, wrong verdict, dropped path, fabricated path, false changed-head flag, wrong totals) that must all be rejected." + } + ] +} diff --git a/research/merge5112-retention-receipt/verify.py b/research/merge5112-retention-receipt/verify.py new file mode 100644 index 0000000000..b96ca59cff --- /dev/null +++ b/research/merge5112-retention-receipt/verify.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +"""Offline verifier for research/merge5112-retention-receipt. + +Re-derives the post-merge retention facts of merge commit 51122344 from the +local Git object store and compares them with RECEIPT.json, then runs +in-memory rejection controls that must all fail. Standard library + git only. +Aaron Wang, with help from opencode. Apache-2.0. +""" +import hashlib +import json +import subprocess +import sys +from pathlib import Path + +BASE = "d33f15be91438e3de512fa544c3f5a7cb832588f" +MERGE = "51122344de9382e784c7f89953456d8cd55513ef" +PACKAGE = "research/merge5112-retention-receipt" + +ROOT = Path(__file__).resolve().parents[2] + + +def git(*args): + p = subprocess.run(["git", "-C", str(ROOT)] + list(args), capture_output=True, + stdin=subprocess.DEVNULL, timeout=120) + if p.returncode != 0: + raise SystemExit("git failed: " + " ".join(args) + ": " + p.stderr.decode()[:200]) + return p.stdout.decode("utf-8", errors="replace") + + +def git_bytes(*args): + p = subprocess.run(["git", "-C", str(ROOT)] + list(args), capture_output=True, + stdin=subprocess.DEVNULL, timeout=120) + if p.returncode != 0: + raise SystemExit("git failed: " + " ".join(args) + ": " + p.stderr.decode()[:200]) + return p.stdout + + +def tree(commit): + out = {} + for line in git("ls-tree", "-r", commit).splitlines(): + meta, path = line.split("\t", 1) + out[path] = meta.split()[2] + return out + + +def rederive(): + """Fresh facts from Git: nothing read from the receipt.""" + t_head_trees = {} + facts = {"base": BASE, "merge": MERGE} + parents = git("rev-list", "--parents", "-n", "1", MERGE).split()[1:] + facts["merge_parents"] = parents + tmerge = tree(MERGE) + facts["prs"] = {} + receipt = json.loads((ROOT / PACKAGE / "RECEIPT.json").read_text(encoding="utf-8")) + for pr_str, rec in receipt["pull_requests"].items(): + head = rec["head"] + if head not in t_head_trees: + t_head_trees[head] = tree(head) + th = t_head_trees[head] + paths = [] + for line in git("diff", "--name-status", f"{BASE}...{head}").splitlines(): + parts = line.split("\t") + status, path = parts[0], parts[-1] + if status.startswith("D"): + continue + hb, mb = th.get(path), tmerge.get(path) + verdict = "retained-identical" if mb == hb else ("retained-modified" if mb else "not-retained") + paths.append({"status": status, "path": path, "head_blob": hb, + "merge_blob": mb, "verdict": verdict}) + facts["prs"][pr_str] = paths + return facts + + +def compare(facts, receipt): + """Return a list of defects; empty means the receipt matches the fresh facts.""" + errors = [] + if receipt["base_commit"] != facts["base"]: + errors.append("base_commit mismatch") + if receipt["merge_commit"] != facts["merge"]: + errors.append("merge_commit mismatch") + heads = {rec["head"] for rec in receipt["pull_requests"].values()} + expected_parents = sorted([facts["base"]] + list(heads)) + if sorted(facts["merge_parents"]) != expected_parents: + errors.append("merge parents are not exactly base + recorded heads: " + + repr(sorted(facts["merge_parents"]))) + if set(facts["prs"]) != set(receipt["pull_requests"]): + errors.append("PR set mismatch") + return errors + totals = {"changed_paths": 0, "retained_identical": 0, "retained_modified": 0, "not_retained": 0} + for pr_str, fresh_paths in facts["prs"].items(): + rec = receipt["pull_requests"][pr_str] + if not rec["head_equals_reviewed_head"]: + errors.append(f"PR {pr_str}: head differs from recorded reviewed head") + if rec["head"] not in facts["merge_parents"]: + errors.append(f"PR {pr_str}: head is not a merge parent") + if [p["path"] for p in fresh_paths] != [p["path"] for p in rec["changed_paths"]]: + errors.append(f"PR {pr_str}: changed path list mismatch") + continue + for fresh, saved in zip(fresh_paths, rec["changed_paths"]): + for key in ("status", "path", "head_blob", "merge_blob", "verdict"): + if fresh[key] != saved[key]: + errors.append(f"PR {pr_str} {saved['path']}: {key} mismatch " + f"(fresh={fresh[key]} saved={saved[key]})") + for p in fresh_paths: + totals["changed_paths"] += 1 + totals[p["verdict"].replace("-", "_")] += 1 + for key, value in totals.items(): + if receipt["totals"].get(key) != value: + errors.append(f"totals.{key}: fresh={value} saved={receipt['totals'].get(key)}") + return errors + + +def controls(facts, receipt): + """Mutations of the receipt that the comparison must reject.""" + passed = 0 + results = [] + + def mutate(name, fn): + nonlocal passed + import copy + bad = copy.deepcopy(receipt) + fn(bad) + errs = compare(facts, bad) + ok = bool(errs) + results.append((name, ok, errs[:1])) + if ok: + passed += 1 + + def flip_blob(rec, key): + rec_path = next(iter(rec["pull_requests"].values()))["changed_paths"][0] + blob = rec_path[key] + rec_path[key] = ("0" if blob[0] != "0" else "1") + blob[1:] + + mutate("corrupted head_blob", lambda r: flip_blob(r, "head_blob")) + mutate("corrupted merge_blob", lambda r: flip_blob(r, "merge_blob")) + mutate("wrong verdict", lambda r: next(iter(r["pull_requests"].values()))["changed_paths"][0].__setitem__("verdict", "not-retained")) + mutate("dropped path", lambda r: next(iter(r["pull_requests"].values()))["changed_paths"].pop()) + mutate("fabricated path", lambda r: next(iter(r["pull_requests"].values()))["changed_paths"].append( + {"status": "A", "path": "research/fake/f.txt", "head_blob": "0" * 40, + "merge_blob": "0" * 40, "verdict": "retained-identical"})) + mutate("false changed-head flag", lambda r: next(iter(r["pull_requests"].values())).__setitem__("head_equals_reviewed_head", False)) + mutate("wrong totals", lambda r: r["totals"].__setitem__("retained_identical", 0)) + return passed, results + + +def source_pins(): + """Re-check the package's own SOURCES.json pins against the recorded Git snapshot. + + Each row is bound through its git blob at SOURCES.json's base_commit, so the + historical bytes replay even after the live files advance. Only rows declared + as live inputs are additionally required to match the working tree.""" + sources = json.loads((ROOT / PACKAGE / "SOURCES.json").read_text(encoding="utf-8")) + errors = [] + for row in sources["files"]: + name = row["path"] + obj = git("rev-parse", f"{sources['base_commit']}:{name}").strip() + if obj != row["git_blob"]: + errors.append("blob pin mismatch: " + name) + data = git_bytes("cat-file", "blob", obj) + if hashlib.sha256(data).hexdigest() != row["sha256"]: + errors.append("sha256 pin mismatch: " + name) + if row["usage"] == "input" and data != (ROOT / name).read_bytes(): + errors.append("input drift: " + name) + return errors + + +def main(): + receipt = json.loads((ROOT / PACKAGE / "RECEIPT.json").read_text(encoding="utf-8")) + pin_errors = source_pins() + if pin_errors: + for e in pin_errors: + print("FAIL_SOURCE_PIN:", e) + raise SystemExit(1) + facts = rederive() + errors = compare(facts, receipt) + if errors: + for e in errors: + print("FAIL_RECEIPT:", e) + raise SystemExit(1) + n_ctrl, results = controls(facts, receipt) + failed_controls = [r for r in results if not r[1]] + if failed_controls: + for name, ok, errs in failed_controls: + print("FAIL_CONTROL_ACCEPTED:", name, errs) + raise SystemExit(1) + t = receipt["totals"] + print("PASS_MERGE5112_RETENTION_RECEIPT") + print(f"prs={t['prs']} changed_paths={t['changed_paths']} " + f"retained_identical={t['retained_identical']} retained_modified={t['retained_modified']} " + f"not_retained={t['not_retained']} changed_heads={t['changed_heads_vs_reviewed']}") + print(f"source_pins=ok controls_rejected={n_ctrl}/{len(results)}") + for name, ok, _ in results: + print(" control rejected:", name) + + +if __name__ == "__main__": + main()