From de7581055cdcd3bb27b79232b2a327f7b657d55f Mon Sep 17 00:00:00 2001 From: nightangelflowerwin-ops Date: Tue, 13 Oct 2026 01:25:29 -0700 Subject: [PATCH 1/3] Tooling: enforce source-versioned coverage for selected frontier replays --- .github/workflows/frontier741.yml | 23 +- .github/workflows/frontier799.yml | 25 +- Makefile | 4 +- .../replay-coverage/pr741-sw4-v1.json | 94 +++ research/required-replay-coverage/CLAIM.md | 24 + .../required-replay-coverage/EXPECTED.json | 604 ++++++++++++++++++ .../FRESH-REPLAY.json | 133 ++++ research/required-replay-coverage/README.md | 120 ++++ .../required-replay-coverage/SOURCES.json | 13 + .../required-replay-coverage/VALIDATION.md | 50 ++ .../required-replay-coverage/check_package.py | 74 +++ research/required-replay-coverage/verify.py | 175 +++++ scripts/verify_frontier_complete.py | 54 ++ scripts/verify_replay_coverage.py | 151 +++++ tests/test_frontier799_bindings.py | 7 +- tests/test_replay_coverage.py | 50 ++ 16 files changed, 1582 insertions(+), 19 deletions(-) create mode 100644 certificates/replay-coverage/pr741-sw4-v1.json create mode 100644 research/required-replay-coverage/CLAIM.md create mode 100644 research/required-replay-coverage/EXPECTED.json create mode 100644 research/required-replay-coverage/FRESH-REPLAY.json create mode 100644 research/required-replay-coverage/README.md create mode 100644 research/required-replay-coverage/SOURCES.json create mode 100644 research/required-replay-coverage/VALIDATION.md create mode 100644 research/required-replay-coverage/check_package.py create mode 100644 research/required-replay-coverage/verify.py create mode 100644 scripts/verify_frontier_complete.py create mode 100644 scripts/verify_replay_coverage.py create mode 100644 tests/test_replay_coverage.py diff --git a/.github/workflows/frontier741.yml b/.github/workflows/frontier741.yml index 23e56ff27f..149717d7ac 100644 --- a/.github/workflows/frontier741.yml +++ b/.github/workflows/frontier741.yml @@ -9,6 +9,10 @@ on: - 'research/direct-delivery504-global/**' - 'research/complex-sw4-frame8/**' - 'scripts/verify_frontier741*.py' + - 'scripts/verify_frontier_complete.py' + - 'scripts/verify_replay_coverage.py' + - 'certificates/replay-coverage/**' + - 'tests/test_replay_coverage.py' - 'tests/test_frontier741_bindings.py' - 'scripts/verify_selected_result.py' - 'certificates/selected-result.json' @@ -23,6 +27,10 @@ on: - 'research/direct-delivery504-global/**' - 'research/complex-sw4-frame8/**' - 'scripts/verify_frontier741*.py' + - 'scripts/verify_frontier_complete.py' + - 'scripts/verify_replay_coverage.py' + - 'certificates/replay-coverage/**' + - 'tests/test_replay_coverage.py' - 'tests/test_frontier741_bindings.py' - 'scripts/verify_selected_result.py' - 'certificates/selected-result.json' @@ -57,7 +65,7 @@ jobs: env: CXX: g++ BOOST_INCLUDE: /usr/include - run: python -B scripts/verify_frontier741.py --work "$RUNNER_TEMP/frontier741" + run: python -B scripts/verify_frontier_complete.py --frontier 741 --work "$RUNNER_TEMP/frontier741" - name: Require committed files unchanged run: git diff --exit-code - uses: actions/upload-artifact@v4 @@ -66,9 +74,10 @@ jobs: name: frontier741-linux-python312 path: | ${{ runner.temp }}/frontier741/RESULT.json - ${{ runner.temp }}/frontier741/STEPS.json - ${{ runner.temp }}/frontier741/*.log - ${{ runner.temp }}/frontier741/complex/RESULT.json - ${{ runner.temp }}/frontier741/complex/RECEIPT.json - ${{ runner.temp }}/frontier741/complex/STAGES.json - ${{ runner.temp }}/frontier741/complex/global-replay/ASSEMBLY.json + ${{ runner.temp }}/frontier741/COVERAGE.json + ${{ runner.temp }}/frontier741/replay/STEPS.json + ${{ runner.temp }}/frontier741/replay/*.log + ${{ runner.temp }}/frontier741/replay/complex/RESULT.json + ${{ runner.temp }}/frontier741/replay/complex/RECEIPT.json + ${{ runner.temp }}/frontier741/replay/complex/STAGES.json + ${{ runner.temp }}/frontier741/replay/complex/global-replay/ASSEMBLY.json diff --git a/.github/workflows/frontier799.yml b/.github/workflows/frontier799.yml index 58a4a9a1a6..d7815fce50 100644 --- a/.github/workflows/frontier799.yml +++ b/.github/workflows/frontier799.yml @@ -10,6 +10,10 @@ on: - 'research/complex-sw4-frame8/**' - 'research/gauge44-frames-x/**' - 'scripts/verify_frontier799*.py' + - 'scripts/verify_frontier_complete.py' + - 'scripts/verify_replay_coverage.py' + - 'certificates/replay-coverage/**' + - 'tests/test_replay_coverage.py' - 'tests/test_frontier799_bindings.py' - 'scripts/verify_selected_result.py' - 'certificates/selected-result.json' @@ -25,6 +29,10 @@ on: - 'research/complex-sw4-frame8/**' - 'research/gauge44-frames-x/**' - 'scripts/verify_frontier799*.py' + - 'scripts/verify_frontier_complete.py' + - 'scripts/verify_replay_coverage.py' + - 'certificates/replay-coverage/**' + - 'tests/test_replay_coverage.py' - 'tests/test_frontier799_bindings.py' - 'scripts/verify_selected_result.py' - 'certificates/selected-result.json' @@ -59,7 +67,7 @@ jobs: env: CXX: g++ BOOST_INCLUDE: /usr/include - run: python -B scripts/verify_frontier799.py --work "$RUNNER_TEMP/frontier799" + run: python -B scripts/verify_frontier_complete.py --frontier 799 --work "$RUNNER_TEMP/frontier799" - name: Require committed files unchanged run: git diff --exit-code - uses: actions/upload-artifact@v4 @@ -68,10 +76,11 @@ jobs: name: frontier799-linux-python312 path: | ${{ runner.temp }}/frontier799/RESULT.json - ${{ runner.temp }}/frontier799/ANCESTRY.json - ${{ runner.temp }}/frontier799/STEPS.json - ${{ runner.temp }}/frontier799/*.log - ${{ runner.temp }}/frontier799/INDEPENDENT-*.json - ${{ runner.temp }}/frontier799/global/ASSEMBLY.json - ${{ runner.temp }}/frontier799/global/STAGES.json - ${{ runner.temp }}/frontier799/native/STEPS.json + ${{ runner.temp }}/frontier799/COVERAGE.json + ${{ runner.temp }}/frontier799/replay/ANCESTRY.json + ${{ runner.temp }}/frontier799/replay/STEPS.json + ${{ runner.temp }}/frontier799/replay/*.log + ${{ runner.temp }}/frontier799/replay/INDEPENDENT-*.json + ${{ runner.temp }}/frontier799/replay/global/ASSEMBLY.json + ${{ runner.temp }}/frontier799/replay/global/STAGES.json + ${{ runner.temp }}/frontier799/replay/native/STEPS.json diff --git a/Makefile b/Makefile index d0a21163fb..0c04d04871 100644 --- a/Makefile +++ b/Makefile @@ -582,9 +582,9 @@ frontier626-verify: selected-record-check .PHONY: frontier741-verify frontier741-verify: selected-record-check @work=$$(mktemp -d "$${TMPDIR:-/tmp}/integer-mult-frontier741.XXXXXX"); \ - python3 -B scripts/verify_frontier741.py --work "$$work/replay" + python3 -B scripts/verify_frontier_complete.py --frontier 741 --work "$$work/replay" .PHONY: frontier799-verify frontier799-verify: selected-record-check @work=$$(mktemp -d "$${TMPDIR:-/tmp}/integer-mult-frontier799.XXXXXX"); \ - python3 -B scripts/verify_frontier799.py --work "$$work/replay" + python3 -B scripts/verify_frontier_complete.py --frontier 799 --work "$$work/replay" diff --git a/certificates/replay-coverage/pr741-sw4-v1.json b/certificates/replay-coverage/pr741-sw4-v1.json new file mode 100644 index 0000000000..1acec5f34c --- /dev/null +++ b/certificates/replay-coverage/pr741-sw4-v1.json @@ -0,0 +1,94 @@ +{ + "schema": "integer-mult-replay-coverage-v1", + "id": "pr741-sw4-v1", + "producer": "research/complex-sw4-frame8/verify.py", + "producer_sha256": "7706065e3d2934ea493910638b40e6285348d337507e0fb695d8d1e536926637", + "manifest_sha256": "b9b39c206fcd2613382b0dcbda23a371e8781d1bedaf8e2f8e7df1e79dc1fa89", + "spec_sha256": "7fc2bd2e3c0ac13729c1fa1f0f327a4eb7c72373ba58e5ed3954b30e23c803be", + "stages": [ + "ancestral558-fresh", + "gauge44-exact-construction", + "notri56-construction", + "notri-control-g44", + "layered66-construction", + "p6n-cold72-construction", + "four-promotions", + "promotion-controls", + "sw4-read-exchanges", + "eight-B-frame-construction", + "all728-columns-native", + "both-native-ledgers", + "independent-native-controls", + "residual-wrappers", + "all-native-phase-edges", + "independent-scalar-frames-cones", + "inherited-cold-controls", + "eight-frame-controls", + "owner-construction-controls", + "strict-global-admission", + "independent-literal-map-moment", + "independent-two-engine-outer47" + ], + "artifacts": [ + "ANCESTRAL-LINK.json", + "FRAME-CONTROLS.json", + "INDEPENDENT-LOCAL.json", + "INDEPENDENT-MAP.json", + "INDEPENDENT-PRICE.json", + "OWNER-CONSTRUCTION-CONTROLS.json", + "PROMO-CONTROLS.json", + "RECONSTRUCTED-OWNERS.json.gz", + "RESULT.json", + "STAGES.json", + "cold-controls/COLD-END-CONTROLS.json", + "frames/BUILD.json", + "frames/FULL-WORD.json.gz", + "gauge44/STEPS.json", + "global-replay/ADMISSION-CONTROLS.json", + "global-replay/ASSEMBLY.json", + "global-replay/BIT-SUPPLIER-CONTROLS.json", + "global-replay/REPLAY.json", + "global-replay/STAGES.json", + "global-replay/global/audit/ASYNC-AUDIT.json", + "global-replay/global/audit/OWNERS-AND-PROFILE.json", + "global-replay/global/audit/PREFIX-AND-INVOICE.json", + "layered66/STEPS.json", + "layered66/controls/COLD-END-CONTROLS.json", + "layered66/swap/PIVOT-SWAP.json", + "local/CANONICAL-WORD.json.gz", + "local/CLIFFORD-RECIPES.json", + "local/CLIFFORD-REVIEW.json", + "local/FULL-WORD.json.gz", + "local/INDEPENDENT-LOCAL-REPLAY.json", + "local/LOCAL-CHECKS.json", + "local/LOCAL-PROGRAMS.json.gz", + "local/RESIDUAL-ADAPTERS.json", + "local/SCALAR-FRAME-AUDIT.json", + "local/WRAPPER-CHECKS.json", + "notri-control/STEPS.json", + "notri56/STEPS.json", + "notri56/cold44/CONSTRUCTION.json", + "p6n/STEPS.json", + "p6n/controls/COLD-END-CONTROLS.json", + "p6n/p6n/FULL-WORD.json.gz", + "promoted/FULL-WORD.json.gz", + "sw4/BUILD.json", + "sw4/FULL-WORD.json.gz" + ], + "selected": { + "id": "pr799-x4-v1", + "source_sha256": { + "scripts/verify_frontier799.py": "19fe1b32079095160dc00fe2f7df75e0fcbc82cff37f7159b755c8a63bd5ce99", + "scripts/verify_frontier799_bindings.py": "43897b3c99212d6134870898a1840f32898aa1b3679b299e654901568ad7e19b", + "research/gauge44-frames-x/construction/jx/reproduce_jx.py": "5c7afebb4eb7fcdeb7e971cfbc457cf071850e2da21c3c71295efdd453c2399c", + "research/gauge44-frames-x/verify_global.py": "16bd5e54598592e92e210f99065348c5df261b8350fdc688072ce053d15b088a" + }, + "stages": [ + "manifest", + "native", + "global", + "independent-local", + "independent-price" + ] + } +} diff --git a/research/required-replay-coverage/CLAIM.md b/research/required-replay-coverage/CLAIM.md new file mode 100644 index 0000000000..0a07155624 --- /dev/null +++ b/research/required-replay-coverage/CLAIM.md @@ -0,0 +1,24 @@ +# User-selected follow-up scope + +The user selected PR838 and PR781 for substantial completed follow-ups. +This branch handles PR838: establish reachability through current PR799, +enforce a versioned coverage contract in production replay entrypoints, +retain valid historical evidence, and package negative controls and source pins. + +Base f567884aeb8851b6e794af1184119a3bfbe1e631; PR838 head +2a50020bb9564229874cbfbdc112e17b235bacfc. No pinned sprint issue found in +the prior and current searches. No external claim comment sent. Source and +review pins are explicit; predecessor authors retain credit. PR781 remains +a separate construction investigation, not a dependency of this contribution. + +No new random track selection: the user explicitly chose these follow-up objects. +Overlap refresh through PR845 found PR841's distinct primary-proof-pointer gate +but no other enforced stage/artifact-coverage implementation. Final refresh and +publication link will be recorded when the verified contribution is submitted. + +Completed result: full current PR799 binding accepts 112 corrupted evidence +cases; enforced path rejects all 118 tested mutations. Fresh native/global, +phase and independent replay passes with verified archived ancestry reuse. +Selected proof pins remain unchanged. Concurrent PR847 independently delivered +the basic Make/CI gate; our additional version/result/log checks and actual +fresh replay are described in README.md, with explicit predecessor credit. diff --git a/research/required-replay-coverage/EXPECTED.json b/research/required-replay-coverage/EXPECTED.json new file mode 100644 index 0000000000..b215b6c25d --- /dev/null +++ b/research/required-replay-coverage/EXPECTED.json @@ -0,0 +1,604 @@ +{ + "base": "f567884aeb8851b6e794af1184119a3bfbe1e631", + "parent_audit_pr": 838, + "selected_frontier": 799, + "pristine": "accepted", + "historical_pr741": "accepted", + "mutation_results": [ + { + "case": "replace-stage:ancestral558-fresh", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:gauge44-exact-construction", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:notri56-construction", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:notri-control-g44", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:layered66-construction", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:p6n-cold72-construction", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:four-promotions", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:promotion-controls", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:sw4-read-exchanges", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:eight-B-frame-construction", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:all728-columns-native", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:both-native-ledgers", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:independent-native-controls", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:residual-wrappers", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:all-native-phase-edges", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:independent-scalar-frames-cones", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:inherited-cold-controls", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:eight-frame-controls", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:owner-construction-controls", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:strict-global-admission", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:independent-literal-map-moment", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "replace-stage:independent-two-engine-outer47", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:ANCESTRAL-LINK.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:ANCESTRAL-LINK.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:FRAME-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:FRAME-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:INDEPENDENT-LOCAL.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:INDEPENDENT-LOCAL.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:INDEPENDENT-MAP.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:INDEPENDENT-MAP.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:INDEPENDENT-PRICE.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:INDEPENDENT-PRICE.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:OWNER-CONSTRUCTION-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:OWNER-CONSTRUCTION-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:PROMO-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:PROMO-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:RECONSTRUCTED-OWNERS.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:RECONSTRUCTED-OWNERS.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:RESULT.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:STAGES.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:STAGES.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:cold-controls/COLD-END-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:cold-controls/COLD-END-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:frames/BUILD.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:frames/BUILD.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:frames/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:frames/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:gauge44/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:gauge44/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:global-replay/ADMISSION-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:global-replay/ADMISSION-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:global-replay/ASSEMBLY.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:global-replay/BIT-SUPPLIER-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:global-replay/BIT-SUPPLIER-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:global-replay/REPLAY.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:global-replay/REPLAY.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:global-replay/STAGES.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:global-replay/STAGES.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:global-replay/global/audit/ASYNC-AUDIT.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:global-replay/global/audit/ASYNC-AUDIT.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:global-replay/global/audit/OWNERS-AND-PROFILE.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:global-replay/global/audit/OWNERS-AND-PROFILE.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:global-replay/global/audit/PREFIX-AND-INVOICE.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:global-replay/global/audit/PREFIX-AND-INVOICE.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:layered66/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:layered66/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:layered66/controls/COLD-END-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:layered66/controls/COLD-END-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:layered66/swap/PIVOT-SWAP.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:layered66/swap/PIVOT-SWAP.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/CANONICAL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/CANONICAL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/CLIFFORD-RECIPES.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/CLIFFORD-RECIPES.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/CLIFFORD-REVIEW.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/CLIFFORD-REVIEW.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/INDEPENDENT-LOCAL-REPLAY.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/INDEPENDENT-LOCAL-REPLAY.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/LOCAL-CHECKS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/LOCAL-CHECKS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/LOCAL-PROGRAMS.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/LOCAL-PROGRAMS.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/RESIDUAL-ADAPTERS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/RESIDUAL-ADAPTERS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/SCALAR-FRAME-AUDIT.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/SCALAR-FRAME-AUDIT.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:local/WRAPPER-CHECKS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:local/WRAPPER-CHECKS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:notri-control/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:notri-control/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:notri56/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:notri56/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:notri56/cold44/CONSTRUCTION.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:notri56/cold44/CONSTRUCTION.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:p6n/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:p6n/STEPS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:p6n/controls/COLD-END-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:p6n/controls/COLD-END-CONTROLS.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:p6n/p6n/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:p6n/p6n/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:promoted/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:promoted/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:sw4/BUILD.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:sw4/BUILD.json", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "omit-inventory:sw4/FULL-WORD.json.gz", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "delete-artifact:sw4/FULL-WORD.json.gz", + "original_pr799": "rejected", + "enforced_pr799": "rejected" + }, + { + "case": "empty-inventory", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "execution-record-order", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "failed-stage", + "original_pr799": "rejected", + "enforced_pr799": "rejected" + }, + { + "case": "boolean-exit-code", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "wrong-source-pin", + "original_pr799": "rejected", + "enforced_pr799": "rejected" + }, + { + "case": "wrong-listed-hash", + "original_pr799": "rejected", + "enforced_pr799": "rejected" + }, + { + "case": "missing-listed-file", + "original_pr799": "rejected", + "enforced_pr799": "rejected" + }, + { + "case": "traversal-inventory", + "original_pr799": "rejected", + "enforced_pr799": "rejected" + }, + { + "case": "missing-selected-native-log", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + }, + { + "case": "missing-selected-independent-price-log", + "original_pr799": "accepted", + "enforced_pr799": "rejected" + } + ], + "original_pr799_accepted": 112, + "enforced_rejections": 118, + "public_cli_witness": "reproduced_and_rejected", + "incomplete_reuse": "rejected_before_launch", + "isolated_optimized": "passed" +} diff --git a/research/required-replay-coverage/FRESH-REPLAY.json b/research/required-replay-coverage/FRESH-REPLAY.json new file mode 100644 index 0000000000..da363875ce --- /dev/null +++ b/research/required-replay-coverage/FRESH-REPLAY.json @@ -0,0 +1,133 @@ +{ + "base": "f567884aeb8851b6e794af1184119a3bfbe1e631", + "status": "PASS_COMPLETE_PR799_REPLAY_COVERAGE", + "kappa": "1661634653669567/1000000000000000000", + "reused_ancestry": true, + "coverage_contract": "pr741-sw4-v1", + "contract_sha256": "c100f6934557b99b89b3f11fb76737cd46ce970f71fc9add566db0ece544803b", + "selected_binding": { + "status": "PASS_REBUILT_PR589_PR799_COMPOSITION", + "kappa": "1661634653669567/1000000000000000000", + "decimal": "0.001661634653669567", + "ancestry": { + "status": "PASS_REBUILT_PR589_PR741_COMPOSITION", + "kappa": "1661202643272239/1000000000000000000", + "decimal": "0.001661202643272239", + "bit_input_sha256": "b9f0e5ca038abe837b0007c8fe006f366a6f02009244ac57705a8a200e2301f4", + "bit_result_sha256": "28795393651ef4fbbc6232eb2b32f7b39b91fbd5ea6d2315583f350714698055", + "complex_receipt_sha256": "68600c734560bb155037e3973f7fbfb2fd1cb678485f8ac128c0b1e1bb1840a0", + "complex_assembly_sha256": "35ccaac474236b2e244f02cc599fbe4ddee783713f37ea623842ecb8de31f209", + "scope": "Rebuilt finite suppliers and exact composition. All-size/compiler, common-label/mutable-source, whole-call hosting, precision/tape and analytic transfer hypotheses remain conditional; not a full Lean theorem." + }, + "package_manifest_sha256": "e1b7998c8f7cb24f8674d250d0510f2b5b351b2ed0b35f17a17e6bacf3d9824b", + "assembly_sha256": "754205fd96ae6145686ee57d314a6ae7a439d9ceefc604f5a89aeffd82e946a0", + "independent_sha256": "bbb84021f37902863f1c5af9c3795ef016511c1c25148fb0840920c32837e7e4", + "price_sha256": "04bff9778b12a8dd878e0bf304c163d93aea09f3b7b3ebc878dab66e23054dd9", + "scope": "Exact finite X4 scalar/frame/phase/owner/invoice/assembly checks, bound to rebuilt PR589 and SW4 ancestry. Inherited all-size/compiler, common-label/mutable-source, whole-call hosting, precision/tape and analytic assumptions remain; not a full Lean theorem." + }, + "steps": [ + { + "name": "manifest", + "exit_code": 0, + "seconds": 0.5629999999655411, + "log_sha256": "6417db85cfd652aba078a0836604b2fb7d956d29aadd17df6522552172fcfbb5" + }, + { + "name": "native", + "exit_code": 0, + "seconds": 2905.671999999904, + "log_sha256": "ed258ab7cb444102059bc8c5e7dd10d16783f13ca221b67ca632522ebc5e1cb8" + }, + { + "name": "global", + "exit_code": 0, + "seconds": 142.18700000003446, + "log_sha256": "c0907b981b10ec5c4a640b7d29eca4e440536eb3289bc089d435b7830fd30bd1" + }, + { + "name": "independent-local", + "exit_code": 0, + "seconds": 10.438000000081956, + "log_sha256": "8afe414780a1a94e275602d83428798308e4ff19066ddc54836fd206296bc608" + }, + { + "name": "independent-price", + "exit_code": 0, + "seconds": 3.875, + "log_sha256": "eb0707c7c19b32e65e9481b5d4f1c13e19d77d388e579cb9d25e8a6657a62267" + } + ], + "native_steps": [ + { + "step": "jx", + "exit_code": 0, + "seconds": 1.953 + }, + { + "step": "jx-control-C0_identity", + "exit_code": 0, + "seconds": 1.687 + }, + { + "step": "jx-control-C1_741_only", + "exit_code": 0, + "seconds": 1.547 + }, + { + "step": "jx-control-M1_one_pair_448", + "exit_code": 0, + "seconds": 1.578 + }, + { + "step": "jx-control-N1_drop_preread", + "exit_code": 0, + "seconds": 1.563 + }, + { + "step": "jx-control-N2_wrong_sign_preread", + "exit_code": 0, + "seconds": 1.485 + }, + { + "step": "jx-control-N3_plain_join_moved_reads", + "exit_code": 0, + "seconds": 2.157 + }, + { + "step": "jx-control-N4_raise_dim7_at_855", + "exit_code": 0, + "seconds": 1.203 + }, + { + "step": "layer-end-controls", + "exit_code": 0, + "seconds": 1244.328 + }, + { + "step": "native", + "exit_code": 0, + "seconds": 17.063 + }, + { + "step": "ledgers", + "exit_code": 0, + "seconds": 19.188 + }, + { + "step": "local-replay", + "exit_code": 0, + "seconds": 87.812 + }, + { + "step": "wrappers", + "exit_code": 0, + "seconds": 30.937 + }, + { + "step": "phases", + "exit_code": 0, + "seconds": 1491.156 + } + ], + "scope": "Fresh X4 native/global/independent replay using source-bound complete archived PR741 ancestry; final coverage and publication rechecked with current code. No fresh ancestral bit/SW4 reconstruction or hosted CI." +} diff --git a/research/required-replay-coverage/README.md b/research/required-replay-coverage/README.md new file mode 100644 index 0000000000..0db0a6d264 --- /dev/null +++ b/research/required-replay-coverage/README.md @@ -0,0 +1,120 @@ +# Enforce PR838's coverage contract in the selected replay + +Lucas (@ljste)'s PR838 showed that the PR741 composition binding accepted +omitted ancestry stages and artifacts. This follow-up tests the complete +selected PR799 binding on actual archive files and enforces a versioned +coverage contract in the standard Makefile replay paths. + +The pristine archived PR799 and historical PR741 replays pass. Removing +`ancestor/complex/local/CLIFFORD-REVIEW.json` and its receipt inventory entry +still makes the original **complete PR799 binding** return +`PASS_REBUILT_PR589_PR799_COMPOSITION`. The new check rejects that witness. +This is an evidence-admission defect, not a disproved scalar identity or +counterexample to the multiplication theorem. + +## Implementation + +`certificates/replay-coverage/pr741-sw4-v1.json` defines the exact ordered +22-stage sequence and all 44 required artifacts, separately from the candidate +receipt. The producer, manifest and spec are SHA-256 pinned. Stage names and +the 34 explicit artifact declarations are independently compared with the +producer AST; the remaining ten local output names are explicit in the +source-bound contract. The current X4 consumer and producer scripts have +their own version pins. A new producer requires a reviewed contract version. + +`scripts/verify_replay_coverage.py` checks exact inventory and stage sequence, +execution-record equality, strict integer exit codes, containment and existing +hash bindings, then runs every original mathematical binding check. For PR799 +it also checks top-level execution logs, the stored ancestry binding and result, +and existence of all named native logs. Native stage records have no log +digests; this check does not pretend otherwise. + +`scripts/verify_frontier_complete.py` executes the unchanged historical cold +runner inside `work/replay/` and only then atomically publishes the public +`work/RESULT.json`, alongside `COVERAGE.json`. An explicitly reused ancestor must +pass coverage **before** any new native/global work starts. Both standard +`make frontier741-verify` and `make frontier799-verify` now invoke this runner; +`make verify` consequently enforces coverage on its historical PR741 stage. +Both existing cold-replay CI workflows also enforce this gate, with triggers +for contract/entrypoint changes and corrected nested artifact upload paths. +The old runners and binding scripts remain byte-identical because the selected +record pins them as reviewed proof supplements. Direct old-script invocations +retain their historical semantics; they are not the strengthened entrypoint. + +The existing PR799 regression fixture uses ordinary copies instead of symlinks +so the same input bytes are tested without requiring Windows symlink privileges. + +## Reproduce + +Standard library, Python 3.11+; no solver or network: + +```sh +python -I -B research/required-replay-coverage/verify.py +python -I -B research/required-replay-coverage/check_package.py +python -B -m unittest discover -s tests -p 'test_replay_coverage.py' -v +python -B -m unittest discover -s tests -p 'test_frontier7*bindings.py' -v +``` + +The deterministic receipt records the old/current outcome for every mutation. +Expected: `PASS_REQUIRED_REPLAY_COVERAGE 112 original PR799 accepts; 118 enforced rejections; valid historical and selected replays accepted`. +The matrix covers all 22 stage replacements, all 44 single inventory omissions, +all 42 otherwise-deletable ancestor artifacts, empty inventory, inconsistent +execution order, six additional type/hash/admission controls and two missing +selected logs. A public current-binding CLI witness is reproduced, the new +CLI rejects it, and incomplete ancestor reuse is rejected before launch. +Contract tests reject unknown versions, producer drift and escaping paths. + +Check an existing complete historical PR799 replay, or the `replay/` directory +of a completed strengthened run: + +```sh +python -I -B scripts/verify_replay_coverage.py --frontier 799 \ + --work /absolute/path/to/replay --ancestor /absolute/path/to/ancestor +``` + +Omit `--ancestor` only when its recorded reuse flag is false and the complete +ancestor is inside the replay's `ancestor/` directory. The explicit path avoids +guessing a relocated reuse directory from old logs. A fresh run can use: + +```sh +python -B scripts/verify_frontier_complete.py --frontier 799 \ + --work /fresh/outside/repository/path --ancestor /complete/source-bound/ancestor +``` + +Without an ancestor argument, the original runner rebuilds it from scratch. +Coverage adds linear work in the artifact bytes plus small fixed manifest/AST +checks; it does not weaken, skip or replace original verification stages. + +## Sources, credit and limits + +Base: `f567884aeb8851b6e794af1184119a3bfbe1e631`. +PR838: `2a50020bb9564229874cbfbdc112e17b235bacfc`. +Input archives and historical checkers are pinned in SOURCES.json. The contract +was derived from the pinned producer and complete archive, not a mutable +candidate's self-declared inventory. The omission-domain design follows PR838; +its original audit is credited and not superseded or described as repaired in +place. No original PR838 source is edited or imported without attribution. + +Credit Douglas Colkitt's reviewed checkers and retained replay; Chafik +Boukhalfa's PR741 construction; PR799's X4 construction; DreamingOfClouds' +PR589 transport on eumemic's PR555 supplier; all original predecessor notices. +Prepared for **nightangelflowerwin-ops** with substantial **OpenAI Codex** +assistance in implementation, testing and writing. Apache-2.0. No independent +human review is claimed. Concurrent PR841 addresses proof-pointer binding, +not these stage/artifact omissions. + +Concurrent **PR847**, Chinmay (@chinmayarvind23), head +`72b8406b96ea2e0f37bb5143f594e12d4817c92a`, arrived during validation with +the basic public Make/CI coverage integration and a separately published +success record. That design is explicitly credited; no priority for it is +claimed. This independent implementation adds version-pinned producer and +consumer contracts, full current PR799 reachability evidence, checks on the +selected replay's own logs/result, strict exit metadata, offline source-drift +controls and a fresh native/global replay. The older bindings and selected +proof pins remain unchanged in both approaches. No PR847 code is imported. + +Presence and hash consistency do not authenticate execution or independently +re-prove every mathematical artifact. Inherited all-size/compiler, common-label, +mutable-source, hosting, precision/tape and analytic conditions remain. +No kappa, selected record, construction source or `upstream/` byte is changed. +Validation, including any incomplete repository-wide run, is recorded separately. diff --git a/research/required-replay-coverage/SOURCES.json b/research/required-replay-coverage/SOURCES.json new file mode 100644 index 0000000000..46c850a22d --- /dev/null +++ b/research/required-replay-coverage/SOURCES.json @@ -0,0 +1,13 @@ +{ + "base": "f567884aeb8851b6e794af1184119a3bfbe1e631", + "pr838_head": "2a50020bb9564229874cbfbdc112e17b235bacfc", + "inputs": { + "research/community-frontier741-audit/composed-replay-evidence.tar.gz": "27516447e242c264030ba427dabc5e616f9a4aacbff9e0623db4d00c058e1a7b", + "research/community-frontier799-audit/integrated799-replay.tar.gz": "70dfdfcf2ff95352c6020ee9dfca6dca9032b33c10daed3f3dc574c014f4e2cb", + "scripts/verify_frontier741_bindings.py": "eff455167e2fd0bc9a67d35241d0e69d8edc58f3a23e776dcfe8f500ca8e8d67", + "scripts/verify_frontier799_bindings.py": "43897b3c99212d6134870898a1840f32898aa1b3679b299e654901568ad7e19b", + "scripts/verify_frontier741.py": "215ee6a12de8dc2392e6811a1b8f2140035f6b2d2a0d2100ff4bd2fdcb8bb39b", + "scripts/verify_frontier799.py": "19fe1b32079095160dc00fe2f7df75e0fcbc82cff37f7159b755c8a63bd5ce99", + "research/complex-sw4-frame8/verify.py": "7706065e3d2934ea493910638b40e6285348d337507e0fb695d8d1e536926637" + } +} diff --git a/research/required-replay-coverage/VALIDATION.md b/research/required-replay-coverage/VALIDATION.md new file mode 100644 index 0000000000..1ca1b8b68c --- /dev/null +++ b/research/required-replay-coverage/VALIDATION.md @@ -0,0 +1,50 @@ +# Validation + +Windows CPython 3.11.9, base f567884aeb8851b6e794af1184119a3bfbe1e631. + +Completed: + +- Full archived PR799 reachability matrix: 112 altered-evidence cases accepted + by the original complete binding; all 118 mutations rejected by enforcement. + Pristine selected and supported historical replays accepted. +- Actual public old-binding CLI witness, new-CLI rejection, and refusal of + incomplete ancestor reuse before any producer launches. +- Three contract/version/path tests and six existing binding tests pass. + Existing PR799 tests now use ordinary copies to avoid Windows symlink + privilege requirements; no mathematical expectation changed. +- Minimal offline relocation in a path with spaces passes under isolated + optimized Python. Source drift and unsupported contract versions are rejected. + Real archived evidence exercises final publication: missing native phase + evidence cannot leave a newly published public RESULT.json. +- Fresh PR799 X4 native reconstruction, all 95 cold-end controls, native ledgers, + independent local replay, residual wrappers, all 2949 phase edges, global + owner/invoice/assembly and both independent local and price stages pass. + This uses a complete, source-bound archived PR741 ancestor, explicitly recorded + as reused. It does not freshly reconstruct that bit/SW4 ancestor. +- Final current coverage and publication functions rechecked that real fresh + output. The cold run began with the prior direct-output wrapper layout; + publication was later hardened to nest historical output under replay/. + Mathematical check code, selected scripts and worker commands are unchanged; + final publication is separately tested on actual evidence. +- Selected-record integrity passes with original source inventory and proof + supplements. Both Makefile recipes resolve to the enforced entrypoint. + +FRESH-REPLAY.json retains source/version IDs, complete native/top-level stages, +their measured durations and the final composition binding. EXPECTED.json is +the deterministic omission-matrix receipt. Timing is diagnostic, not a proof. + +The first omission-matrix run reached the public CLI check and failed because +the historical PR799 script does not support isolated Python imports. Its CLI +invocation was corrected to ordinary assertion-enabled Python. The corrected +full matrix passes; the new entrypoint independently supports isolated checking. + +`make verify` is running in the existing Ubuntu WSL environment. It has not +completed and no repository-wide pass is claimed. Hosted CI is not claimed. +All validation above concerns the verification gate and finite selected replay, +not the inherited all-size/compiler/hosting/analytic multiplication theorem. + +Final overlap refresh found PR847 at 72b8406b96ea2e0f37bb5143f594e12d4817c92a. +Its basic integration is credited. This package adds versioned source contracts, +current-wrapper reachability, PR799 execution/result evidence checks and a fresh +native/global replay. PR851 changes bit bridge-control identities and is not +consumed; its selected-proof-hash change is not included here. diff --git a/research/required-replay-coverage/check_package.py b/research/required-replay-coverage/check_package.py new file mode 100644 index 0000000000..7e814fb6da --- /dev/null +++ b/research/required-replay-coverage/check_package.py @@ -0,0 +1,74 @@ +"""Minimal offline relocation and source/contract corruption controls.""" +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from verify import extract, require, ROOT + + +def main(): + with tempfile.TemporaryDirectory(prefix='coverage relocation ') as temporary: + root = Path(temporary) / 'root with spaces' + files = [ + 'scripts/verify_frontier741_bindings.py', 'scripts/verify_frontier799_bindings.py', + 'scripts/verify_frontier741.py', 'scripts/verify_frontier799.py', + 'scripts/verify_replay_coverage.py', 'scripts/verify_frontier_complete.py', + 'certificates/replay-coverage/pr741-sw4-v1.json', + 'research/complex-sw4-frame8/verify.py', 'research/complex-sw4-frame8/MANIFEST.json', + 'research/complex-sw4-frame8/data/SPEC.json', 'research/complex-sw4-frame8/inputs/PR589-EXPECTED.json', + 'research/e8-bit-p111-tuned/tune/EXPECTED.json', + ] + for name in files: + destination = root / name + destination.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(ROOT / name, destination) + shutil.copytree(ROOT / 'research/gauge44-frames-x', root / 'research/gauge44-frames-x', + ignore=shutil.ignore_patterns('__pycache__')) + replay = Path(temporary) / 'replay with spaces' + extract(ROOT / 'research/community-frontier741-audit/composed-replay-evidence.tar.gz', replay / 'ancestor') + extract(ROOT / 'research/community-frontier799-audit/integrated799-replay.tar.gz', replay) + command = [sys.executable, '-I', '-O', '-B', str(root / 'scripts/verify_replay_coverage.py'), + '--frontier', '799', '--work', str(replay), '--ancestor', str(replay / 'ancestor')] + result = subprocess.run(command, cwd=temporary, capture_output=True, text=True) + require(result.returncode == 0 and 'PASS_COMPLETE_PR799_REPLAY_COVERAGE' in result.stdout, + 'Relocated isolated replay failed: ' + result.stderr[-2000:]) + # Exercise publication using real evidence, without claiming another + # expensive supplier execution. The cold run uses this same postflight. + sys.path.insert(0, str(ROOT / 'scripts')) + import verify_frontier_complete as entrypoint + output = Path(temporary) / 'public output' + output.mkdir() + entrypoint.publish(output, replay, '799', replay / 'ancestor') + require((output / 'RESULT.json').is_file(), 'Complete result not published') + (output / 'RESULT.json').unlink() + phase_log = replay / 'native/phases.log' + phase_log.unlink() + try: + entrypoint.publish(output, replay, '799', replay / 'ancestor') + except ValueError: + pass + else: + raise ValueError('Incomplete evidence published') + require(not (output / 'RESULT.json').exists(), 'Failure left a public success record') + # Restore the native log from the complete archived output. + extract(ROOT / 'research/community-frontier799-audit/integrated799-replay.tar.gz', replay) + producer = root / 'research/complex-sw4-frame8/verify.py' + before = producer.read_bytes() + producer.write_bytes(before + b'\n# unexpected source drift\n') + result = subprocess.run(command, cwd=temporary, capture_output=True, text=True) + require(result.returncode != 0 and 'Coverage producer version differs' in result.stderr, + 'Changed producer accepted') + producer.write_bytes(before) + contract = root / 'certificates/replay-coverage/pr741-sw4-v1.json' + contract.write_text(contract.read_text().replace('integer-mult-replay-coverage-v1', 'unknown-version'), encoding='utf-8') + result = subprocess.run(command, cwd=temporary, capture_output=True, text=True) + require(result.returncode != 0 and 'Unsupported replay coverage version' in result.stderr, + 'Unknown relocated contract accepted') + print('PASS_REQUIRED_COVERAGE_PACKAGE: isolated relocation; producer drift and unknown version rejected') + + +if __name__ == '__main__': + main() diff --git a/research/required-replay-coverage/verify.py b/research/required-replay-coverage/verify.py new file mode 100644 index 0000000000..68ed45a867 --- /dev/null +++ b/research/required-replay-coverage/verify.py @@ -0,0 +1,175 @@ +"""Replay PR838's omissions against the complete PR799 binding and enforced gate. + +Lucas (@ljste) supplied the original PR741 audit. New PR799 reachability and +production enforcement by nightangelflowerwin-ops with substantial Codex help. +Apache-2.0. Archive replays are not fresh multiplication theorem proofs. +""" +import hashlib +import json +from pathlib import Path +import shutil +import subprocess +import sys +import tarfile +import tempfile + +ROOT = Path(__file__).resolve().parents[2] +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(ROOT / 'scripts')) +import verify_replay_coverage as covered +import verify_frontier799_bindings as original + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def extract(path, destination): + with tarfile.open(path) as archive: + for member in archive: + if member.isfile(): + target = covered.artifact_path(destination, member.name) + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(archive.extractfile(member).read()) + else: + require(member.isdir(), 'Unexpected archive member type') + + +def outcome(action): + try: + action() + return 'accepted' + except (ValueError, OSError, KeyError, TypeError): + return 'rejected' + + +def run(): + sources = json.loads((HERE / 'SOURCES.json').read_bytes()) + for name, pin in sources['inputs'].items(): + require(covered.digest(ROOT / name) == pin, 'Pinned input drift: ' + name) + contract = covered.contract() + results = [] + with tempfile.TemporaryDirectory(prefix='required-coverage-') as temporary: + root = Path(temporary) + baseline = root / 'baseline' + extract(ROOT / 'research/community-frontier741-audit/composed-replay-evidence.tar.gz', baseline / 'ancestor') + extract(ROOT / 'research/community-frontier799-audit/integrated799-replay.tar.gz', baseline) + def old(directory): + return original.check(directory / 'ancestor', directory / 'native', directory / 'global', + directory / 'INDEPENDENT-LOCAL.json', directory / 'INDEPENDENT-PRICE.json') + def new(directory): + return covered.check_selected(directory, directory / 'ancestor') + require(outcome(lambda: old(baseline)) == outcome(lambda: new(baseline)) == 'accepted', 'Pristine current replay rejected') + # Historical ordinary archive includes the same supported producer, + # without the selected X4 evidence. It remains a valid PR741 input. + covered.check_ancestor(baseline / 'ancestor/bit', baseline / 'ancestor/complex') + directory = root / 'case' + shutil.copytree(baseline, directory) + mutable = ['ancestor/complex/RECEIPT.json', 'ancestor/complex/STAGES.json', + 'native/phases.log', 'independent-price.log'] + mutable += ['ancestor/complex/' + name for name in contract['artifacts']] + mutable += ['ancestor/complex/' + name + '.log' for name in contract['stages']] + snapshots = {name: (baseline / name).read_bytes() for name in set(mutable)} + + def case(label, mutation): + mutation(directory) + old_result = outcome(lambda: old(directory)) + new_result = outcome(lambda: new(directory)) + require(new_result == 'rejected', 'Coverage mutation accepted: ' + label) + results.append(dict(case=label, original_pr799=old_result, enforced_pr799=new_result)) + for name, payload in snapshots.items(): + path = directory / name + if not path.exists() or path.read_bytes() != payload: + path.write_bytes(payload) + (directory / 'ancestor/complex/unrelated-successful-command.log').unlink(missing_ok=True) + if len(results) % 20 == 0: + print('PASS', len(results), 'mutation cases', flush=True) + + def mutate_receipt(directory, action): + path = directory / 'ancestor/complex/RECEIPT.json' + receipt = covered.read(path) + action(receipt, directory / 'ancestor/complex') + path.write_text(json.dumps(receipt, indent=2) + '\n', encoding='utf-8') + + for name in contract['stages']: + def stage_mutation(directory, name=name): + def change(receipt, complex_dir): + row = next(s for s in receipt['stages'] if s['name'] == name) + (complex_dir / (name + '.log')).unlink() + row['name'] = 'unrelated-successful-command' + log = complex_dir / (row['name'] + '.log') + log.write_text('Unrelated successful command.\n', encoding='utf-8') + row['log_sha256'] = covered.digest(log) + stages = complex_dir / 'STAGES.json' + stages.write_text(json.dumps(receipt['stages']), encoding='utf-8') + receipt['artifacts']['STAGES.json'] = covered.digest(stages) + mutate_receipt(directory, change) + case('replace-stage:' + name, stage_mutation) + for name in contract['artifacts']: + def omission(directory, name=name): + mutate_receipt(directory, lambda receipt, folder: receipt['artifacts'].pop(name)) + case('omit-inventory:' + name, omission) + if name not in ('RESULT.json', 'global-replay/ASSEMBLY.json'): + def deletion(directory, name=name): + omission(directory, name) + (directory / 'ancestor/complex' / name).unlink() + case('delete-artifact:' + name, deletion) + case('empty-inventory', lambda d: mutate_receipt(d, lambda r,p: r.update(artifacts={}))) + def wrong_order(d): + path = d / 'ancestor/complex/STAGES.json' + rows = covered.read(path);rows.reverse();path.write_text(json.dumps(rows), encoding='utf-8') + mutate_receipt(d, lambda r,p: r['artifacts'].update({'STAGES.json':covered.digest(path)})) + case('execution-record-order', wrong_order) + for label, action in [ + ('failed-stage', lambda r,p: r['stages'][0].update(exit_code=1)), + ('boolean-exit-code', lambda r,p: r['stages'][0].update(exit_code=False)), + ('wrong-source-pin', lambda r,p: r.update(manifest_sha256='0'*64)), + ('wrong-listed-hash', lambda r,p: r['artifacts'].update({'RESULT.json':'0'*64})), + ('missing-listed-file', lambda r,p: (p/'INDEPENDENT-LOCAL.json').unlink()), + ('traversal-inventory', lambda r,p: r['artifacts'].update({'../outside':'0'*64})), + ]: + case(label, lambda d, action=action: mutate_receipt(d, action)) + case('missing-selected-native-log', lambda d: (d / 'native/phases.log').unlink()) + case('missing-selected-independent-price-log', lambda d: (d / 'independent-price.log').unlink()) + # Public CLI on actual archived files: complete selected binding passes; + # after removing the ancestor phase evidence, original CLI still passes. + directory = root / 'public' + shutil.copytree(baseline, directory) + phase = 'local/CLIFFORD-REVIEW.json' + mutate_receipt(directory, lambda r,p: (r['artifacts'].pop(phase), (p/phase).unlink())) + cli = [sys.executable, '-B', str(ROOT / 'scripts/verify_frontier799_bindings.py'), + '--ancestor', str(directory / 'ancestor'), '--native', str(directory / 'native'), + '--global', str(directory / 'global'), '--independent', str(directory / 'INDEPENDENT-LOCAL.json'), + '--price', str(directory / 'INDEPENDENT-PRICE.json'), '--out', str(root / 'old-result.json')] + p = subprocess.run(cli, capture_output=True, text=True) + require(p.returncode == 0 and 'PASS_REBUILT_PR589_PR799_COMPOSITION' in p.stdout, 'Public current CLI did not reproduce witness') + fixed_cli = [sys.executable, '-I', '-B', str(ROOT / 'scripts/verify_replay_coverage.py'), + '--frontier', '799', '--work', str(directory), '--ancestor', str(directory / 'ancestor')] + p = subprocess.run(fixed_cli, capture_output=True, text=True) + require(p.returncode != 0 and 'Required ancestry artifact inventory differs' in p.stderr, 'Enforced public CLI did not reject witness') + # Reject invalid reuse before starting the expensive producer. + destination = root / 'must-not-be-created' + p = subprocess.run([sys.executable, '-B', str(ROOT / 'scripts/verify_frontier_complete.py'), + '--frontier', '799', '--work', str(destination), '--ancestor', str(directory / 'ancestor')], + capture_output=True, text=True) + require(p.returncode != 0 and not destination.exists(), 'Incomplete reuse was launched') + p = subprocess.run([sys.executable, '-I', '-O', '-B', str(ROOT / 'scripts/verify_replay_coverage.py'), + '--frontier', '799', '--work', str(baseline), '--ancestor', str(baseline / 'ancestor')], + capture_output=True, text=True) + require(p.returncode == 0, 'Optimized complete coverage rejected pristine evidence') + return dict(base=sources['base'], parent_audit_pr=838, selected_frontier=799, + pristine='accepted', historical_pr741='accepted', mutation_results=results, + original_pr799_accepted=sum(row['original_pr799'] == 'accepted' for row in results), + enforced_rejections=len(results), public_cli_witness='reproduced_and_rejected', + incomplete_reuse='rejected_before_launch', isolated_optimized='passed') + + +if __name__ == '__main__': + result = run() + if '--write' in sys.argv: + (HERE / 'EXPECTED.json').write_text(json.dumps(result, indent=2) + '\n', encoding='utf-8') + else: + require(result == json.loads((HERE / 'EXPECTED.json').read_bytes()), 'Evidence receipt differs') + print('PASS_REQUIRED_REPLAY_COVERAGE', result['original_pr799_accepted'], 'original PR799 accepts;', + result['enforced_rejections'], 'enforced rejections; valid historical and selected replays accepted') diff --git a/scripts/verify_frontier_complete.py b/scripts/verify_frontier_complete.py new file mode 100644 index 0000000000..93860370cc --- /dev/null +++ b/scripts/verify_frontier_complete.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +"""Run the immutable historical replay with enforced versioned coverage.""" +import argparse +from pathlib import Path +import subprocess +import sys +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from verify_replay_coverage import check_ancestor, check_selected, require +import json + +ROOT = Path(__file__).resolve().parents[1] + + +def publish(work, replay, frontier, ancestor=None): + """Publish a public success record only after real evidence passes.""" + if frontier == '799': + result = check_selected(replay, ancestor) + else: + parent = check_ancestor(replay / 'bit', replay / 'complex') + result = dict(status='PASS_COMPLETE_PR741_REPLAY_COVERAGE', binding=parent) + temporary = work / 'RESULT.json.tmp' + temporary.write_text(json.dumps(result, indent=2) + '\n', encoding='utf-8') + temporary.replace(work / 'RESULT.json') + (work / 'COVERAGE.json').write_text(json.dumps(result, indent=2) + '\n', encoding='utf-8') + return result + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--frontier', choices=['741', '799'], required=True) + p.add_argument('--work', type=Path, required=True) + p.add_argument('--ancestor', type=Path) + a = p.parse_args() + require(not sys.flags.optimize, 'Cold replay workers require enabled assertions') + require(a.frontier == '799' or a.ancestor is None, 'Ancestor flag is only for PR799') + work = a.work.resolve() + require(not work.exists() and not work.is_relative_to(ROOT), + 'Use a fresh output directory outside the repository') + # Reject incomplete reuse before paying for any new native/global work. + if a.ancestor is not None: + check_ancestor(a.ancestor / 'bit', a.ancestor / 'complex') + work.mkdir(parents=True) + replay = work / 'replay' + command = [sys.executable, '-B', str(ROOT / ('scripts/verify_frontier' + a.frontier + '.py')), + '--work', str(replay)] + if a.ancestor is not None: + command += ['--ancestor', str(a.ancestor)] + subprocess.run(command, check=True) + result = publish(work, replay, a.frontier, a.ancestor.resolve() if a.ancestor else None) + print(result['status'], flush=True) + + +if __name__ == '__main__': + main() diff --git a/scripts/verify_replay_coverage.py b/scripts/verify_replay_coverage.py new file mode 100644 index 0000000000..59e1fdaf66 --- /dev/null +++ b/scripts/verify_replay_coverage.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python3 +"""Versioned evidence coverage, supplementary to immutable frontier bindings. + +Credit Lucas (@ljste), PR838, for the ancestor-coverage audit. Prepared for +nightangelflowerwin-ops with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +import ast +from hashlib import sha256 +import json +from pathlib import Path, PurePosixPath +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +ROOT = Path(__file__).resolve().parents[1] +CONTRACT = ROOT / 'certificates/replay-coverage/pr741-sw4-v1.json' + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def read(path): + return json.loads(Path(path).read_bytes()) + + +def digest(path): + return sha256(Path(path).read_bytes()).hexdigest() + + +def artifact_path(directory, name): + require(type(name) is str and name and '\\' not in name, 'Invalid evidence path') + relative = PurePosixPath(name) + require(not relative.is_absolute() and '..' not in relative.parts and + relative.as_posix() == name and ':' not in name, 'Invalid evidence path') + path = (directory / name).resolve() + require(path.is_relative_to(directory.resolve()), 'Evidence escapes replay directory') + return path + + +def contract(): + value = read(CONTRACT) + require(value['schema'] == 'integer-mult-replay-coverage-v1' and + value['id'] == 'pr741-sw4-v1', 'Unsupported replay coverage version') + producer = ROOT / value['producer'] + require(value['producer'] == 'research/complex-sw4-frame8/verify.py' and + digest(producer) == value['producer_sha256'], 'Coverage producer version differs') + require(digest(producer.parent / 'MANIFEST.json') == value['manifest_sha256'] and + digest(producer.parent / 'data/SPEC.json') == value['spec_sha256'], 'Coverage package version differs') + tree = ast.parse(producer.read_bytes()) + calls = [n.value for n in tree.body if isinstance(n, ast.Expr) and + isinstance(n.value, ast.Call) and isinstance(n.value.func, ast.Name) and n.value.func.id == 'run'] + require([ast.literal_eval(call.args[0]) for call in calls] == value['stages'], 'Contract stages differ from producer') + lists = [n.value for n in tree.body if isinstance(n, ast.Assign) and + any(isinstance(t, ast.Name) and t.id == 'files' for t in n.targets)] + require(len(lists) == 1, 'Producer artifact declaration differs') + fixed = ast.literal_eval(lists[0]) + require(type(value['artifacts']) is list and len(value['artifacts']) == 44 and + len(set(value['artifacts'])) == 44 and set(fixed) <= set(value['artifacts']), 'Contract artifact inventory differs') + dynamic = set(value['artifacts']) - set(fixed) + require(len(fixed) == 34 and len(dynamic) == 10 and + all(name.startswith('local/') for name in dynamic), 'Contract local artifact inventory differs') + for name in value['stages']: + require(type(name) is str and '/' not in name and '\\' not in name and ':' not in name, 'Invalid stage name') + return value + + +def check_ancestor(bit, complex_dir): + """Require source-versioned complete coverage, then all original checks.""" + value = contract() + receipt = read(complex_dir / 'RECEIPT.json') + stages = receipt['stages'] + require(type(stages) is list and [s['name'] for s in stages] == value['stages'], 'Required ancestry stage sequence differs') + require(all(type(s['exit_code']) is int and s['exit_code'] == 0 for s in stages), 'Required ancestry stage failed') + artifacts = receipt['artifacts'] + require(type(artifacts) is dict and set(artifacts) == set(value['artifacts']), 'Required ancestry artifact inventory differs') + require(read(complex_dir / 'STAGES.json') == stages, 'Ancestry execution record differs from receipt') + for name, expected in artifacts.items(): + require(type(expected) is str and digest(artifact_path(complex_dir, name)) == expected, 'Required ancestry artifact hash differs: ' + name) + for stage in stages: + require(type(stage['log_sha256']) is str and + digest(artifact_path(complex_dir, stage['name'] + '.log')) == stage['log_sha256'], 'Required ancestry log differs') + from verify_frontier741_bindings import check + return check(bit, complex_dir) + + +def check_selected(work, ancestor=None): + """Enforce coverage in the complete selected PR799 replay, without reuse guesses.""" + ancestry_record = read(work / 'ANCESTRY.json') + require(type(ancestry_record['reused']) is bool, 'Invalid ancestry reuse flag') + require(ancestor is not None or ancestry_record['reused'] is False, + 'Explicit ancestor path required for reused evidence') + parent = ancestor if ancestor is not None else work / 'ancestor' + ancestry = check_ancestor(parent / 'bit', parent / 'complex') + selected = contract()['selected'] + require(selected['id'] == 'pr799-x4-v1', 'Unsupported selected coverage version') + for name, expected_hash in selected['source_sha256'].items(): + require(digest(artifact_path(ROOT, name)) == expected_hash, 'Selected coverage producer version differs: ' + name) + require(ancestry_record['binding'] == ancestry, 'Ancestry receipt binding differs') + expected = ([] if ancestry_record['reused'] else ['ancestor']) + selected['stages'] + stages = read(work / 'STEPS.json') + require(type(stages) is list and [s['name'] for s in stages] == expected and + all(type(s['exit_code']) is int and s['exit_code'] == 0 for s in stages), 'Required selected stage sequence differs') + for stage in stages: + require(digest(artifact_path(work, stage['name'] + '.log')) == stage['log_sha256'], 'Selected stage log differs') + # The original binding independently validates the named native stages. + # Also require each corresponding native log to exist. Native STEPS.json + # does not contain log digests, so no authentication claim is made here. + for stage in read(work / 'native/STEPS.json'): + require(type(stage['exit_code']) is int and stage['exit_code'] == 0, 'Required native stage failed') + require(artifact_path(work / 'native', stage['step'] + '.log').is_file(), 'Required native stage log missing') + from verify_frontier799_bindings import check + result = check(parent, work / 'native', work / 'global', + work / 'INDEPENDENT-LOCAL.json', work / 'INDEPENDENT-PRICE.json') + recorded = read(work / 'RESULT.json') + require(recorded['status'] == result['status'] and recorded['kappa'] == result['kappa'] and + recorded['ancestry'] == result['ancestry'] and + recorded['reused_ancestry'] is ancestry_record['reused'], 'Selected result binding differs') + return dict(status='PASS_COMPLETE_PR799_REPLAY_COVERAGE', kappa=result['kappa'], + decimal=result['decimal'], + coverage_contract=value_id(), contract_sha256=digest(CONTRACT), + selected_binding=result, reused_ancestry=ancestry_record['reused'], + scope='Required evidence presence, ordered stages and existing hash/mathematical bindings. Not execution authentication or a full multiplication proof.') + + +def value_id(): + return 'pr741-sw4-v1' + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--frontier', choices=['741', '799'], required=True) + p.add_argument('--work', type=Path, required=True) + p.add_argument('--ancestor', type=Path) + p.add_argument('--out', type=Path) + a = p.parse_args() + if a.frontier == '741': + require(a.ancestor is None, 'Ancestor flag is only for PR799') + result = check_ancestor(a.work / 'bit', a.work / 'complex') + result = dict(status='PASS_COMPLETE_PR741_REPLAY_COVERAGE', binding=result, + coverage_contract=value_id(), contract_sha256=digest(CONTRACT)) + else: + result = check_selected(a.work, a.ancestor) + if a.out: + a.out.write_text(json.dumps(result, indent=2) + '\n', encoding='utf-8') + print(result['status']) + + +if __name__ == '__main__': + main() diff --git a/tests/test_frontier799_bindings.py b/tests/test_frontier799_bindings.py index c9461282ab..9f1a4f9f3d 100644 --- a/tests/test_frontier799_bindings.py +++ b/tests/test_frontier799_bindings.py @@ -5,6 +5,7 @@ from pathlib import Path import sys import tarfile +import shutil from unittest.mock import patch import unittest from test_frontier741_bindings import Composition as ParentComposition @@ -20,8 +21,10 @@ def setUpClass(cls): cls.parent=ParentComposition cls.root=cls.parent.root cls.ancestor=cls.root/'ancestor';cls.ancestor.mkdir() - (cls.ancestor/'bit').symlink_to(cls.parent.bit,target_is_directory=True) - (cls.ancestor/'complex').symlink_to(cls.parent.complex,target_is_directory=True) + # Ordinary copies exercise the same bytes without requiring Windows + # symlink privileges or linking test mutations to a shared fixture. + shutil.copytree(cls.parent.bit,cls.ancestor/'bit') + shutil.copytree(cls.parent.complex,cls.ancestor/'complex') with tarfile.open(ROOT/'research/community-frontier799-audit/pr799-replay.tar.gz') as archive: for member in archive: dest=(cls.root/member.name).resolve() diff --git a/tests/test_replay_coverage.py b/tests/test_replay_coverage.py new file mode 100644 index 0000000000..93e3fb62da --- /dev/null +++ b/tests/test_replay_coverage.py @@ -0,0 +1,50 @@ +"""Evidence contracts reject version drift and incomplete replay reuse.""" +from copy import deepcopy +import json +from pathlib import Path +import sys +import tempfile +import unittest +from unittest.mock import patch + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / 'scripts')) +import verify_replay_coverage as coverage + + +class ContractVersion(unittest.TestCase): + def test_current_producer_is_bound(self): + contract = coverage.contract() + self.assertEqual(contract['id'], 'pr741-sw4-v1') + self.assertEqual(len(contract['stages']), 22) + self.assertEqual(len(contract['artifacts']), 44) + + def test_changed_contract_and_producer_versions_fail(self): + original = coverage.read(coverage.CONTRACT) + mutations = [ + lambda x: x.update(schema='integer-mult-replay-coverage-v2'), + lambda x: x.update(producer_sha256='0' * 64), + lambda x: x['stages'].reverse(), + lambda x: x['artifacts'].pop(), + lambda x: x['artifacts'].append('../outside'), + ] + with tempfile.TemporaryDirectory() as temporary: + path = Path(temporary) / 'contract.json' + for mutate in mutations: + changed = deepcopy(original) + mutate(changed) + path.write_text(json.dumps(changed), encoding='utf-8') + with self.subTest(mutation=changed), patch.object(coverage, 'CONTRACT', path): + with self.assertRaises(ValueError): + coverage.contract() + + def test_paths_cannot_leave_replay(self): + with tempfile.TemporaryDirectory() as temporary: + root = Path(temporary) + for name in ('../outside', '/absolute', 'C:/absolute', 'local\\file', 'local/../file'): + with self.subTest(path=name), self.assertRaises(ValueError): + coverage.artifact_path(root, name) + + +if __name__ == '__main__': + unittest.main() From 8b98c56dbbdffa6e14e855e8c4979ab12715945c Mon Sep 17 00:00:00 2001 From: nightangelflowerwin-ops Date: Tue, 13 Oct 2026 01:30:35 -0700 Subject: [PATCH 2/3] Record publication and bind fresh coverage to committed contract bytes --- research/required-replay-coverage/CLAIM.md | 1 + research/required-replay-coverage/FRESH-REPLAY.json | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/research/required-replay-coverage/CLAIM.md b/research/required-replay-coverage/CLAIM.md index 0a07155624..ec6ee70e6f 100644 --- a/research/required-replay-coverage/CLAIM.md +++ b/research/required-replay-coverage/CLAIM.md @@ -22,3 +22,4 @@ phase and independent replay passes with verified archived ancestry reuse. Selected proof pins remain unchanged. Concurrent PR847 independently delivered the basic Make/CI gate; our additional version/result/log checks and actual fresh replay are described in README.md, with explicit predecessor credit. +Submitted: https://github.com/CrocSwap/integer-mult-bounds/pull/865 diff --git a/research/required-replay-coverage/FRESH-REPLAY.json b/research/required-replay-coverage/FRESH-REPLAY.json index da363875ce..5397478180 100644 --- a/research/required-replay-coverage/FRESH-REPLAY.json +++ b/research/required-replay-coverage/FRESH-REPLAY.json @@ -4,7 +4,7 @@ "kappa": "1661634653669567/1000000000000000000", "reused_ancestry": true, "coverage_contract": "pr741-sw4-v1", - "contract_sha256": "c100f6934557b99b89b3f11fb76737cd46ce970f71fc9add566db0ece544803b", + "contract_sha256": "7acd5033bc78e3f473718269edaa267c2785d84fbe95ccf6815a33dcf58c2756", "selected_binding": { "status": "PASS_REBUILT_PR589_PR799_COMPOSITION", "kappa": "1661634653669567/1000000000000000000", @@ -129,5 +129,6 @@ "seconds": 1491.156 } ], - "scope": "Fresh X4 native/global/independent replay using source-bound complete archived PR741 ancestry; final coverage and publication rechecked with current code. No fresh ancestral bit/SW4 reconstruction or hosted CI." + "scope": "Fresh X4 native/global/independent replay using source-bound complete archived PR741 ancestry; final coverage and publication rechecked with current code. No fresh ancestral bit/SW4 reconstruction or hosted CI.", + "contract_bytes": "Final coverage rechecked after LF normalization to match committed Git bytes." } From 7519ad89d7eb0e2f8c54f1424f5d9022eebda3f9 Mon Sep 17 00:00:00 2001 From: nightangelflowerwin-ops Date: Tue, 13 Oct 2026 03:26:42 -0700 Subject: [PATCH 3/3] Document final aggregate verification timeout limitation --- research/required-replay-coverage/VALIDATION.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/research/required-replay-coverage/VALIDATION.md b/research/required-replay-coverage/VALIDATION.md index 1ca1b8b68c..dc1efaff36 100644 --- a/research/required-replay-coverage/VALIDATION.md +++ b/research/required-replay-coverage/VALIDATION.md @@ -38,8 +38,13 @@ the historical PR799 script does not support isolated Python imports. Its CLI invocation was corrected to ordinary assertion-enabled Python. The corrected full matrix passes; the new entrypoint independently supports isolated checking. -`make verify` is running in the existing Ubuntu WSL environment. It has not -completed and no repository-wide pass is claimed. Hosted CI is not claimed. +`make verify` completed with a failure in the unchanged historical +`tests/test_recycled_bit_integration.py`: eleven optimized-entrypoint subprocess +checks exceeded their ten-second timeout under Ubuntu WSL on this checkout. +The preceding long historical producer checks passed, including full fallback +and both suppliers at kappa 0.000472154791. The aggregate stopped at +`verify-recycled-bit`, so no repository-wide or hosted-CI pass is claimed. +This contribution does not modify that test or its producer scripts. All validation above concerns the verification gate and finite selected replay, not the inherited all-size/compiler/hosting/analytic multiplication theorem.