From a247ef876e50bf3a7d890c7c1f9b409576674d7d Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Wed, 14 Oct 2026 15:13:23 -0400 Subject: [PATCH] Authenticate and compare the complete selected final-stage replay --- .../selected-final-replay-closure/POLICY.json | 279 +++++++++++++++ .../selected-final-replay-closure/README.md | 220 ++++++++++++ .../selected-final-replay-closure/RESULT.json | 318 ++++++++++++++++ .../SELECTION.json | 91 +++++ .../SOURCES.json | 288 +++++++++++++++ .../selected-final-replay-closure/TASK.json | 89 +++++ .../selected-final-replay-closure/VERIFY.json | 63 ++++ .../compare_outputs.py | 125 +++++++ .../vendor/invoice_compare.py | 125 +++++++ .../vendor/strict_compare.py | 260 ++++++++++++++ .../selected-final-replay-closure/verify.py | 338 ++++++++++++++++++ 11 files changed, 2196 insertions(+) create mode 100644 research/selected-final-replay-closure/POLICY.json create mode 100644 research/selected-final-replay-closure/README.md create mode 100644 research/selected-final-replay-closure/RESULT.json create mode 100644 research/selected-final-replay-closure/SELECTION.json create mode 100644 research/selected-final-replay-closure/SOURCES.json create mode 100644 research/selected-final-replay-closure/TASK.json create mode 100644 research/selected-final-replay-closure/VERIFY.json create mode 100755 research/selected-final-replay-closure/compare_outputs.py create mode 100755 research/selected-final-replay-closure/vendor/invoice_compare.py create mode 100755 research/selected-final-replay-closure/vendor/strict_compare.py create mode 100755 research/selected-final-replay-closure/verify.py diff --git a/research/selected-final-replay-closure/POLICY.json b/research/selected-final-replay-closure/POLICY.json new file mode 100644 index 0000000000..2ca89dfeab --- /dev/null +++ b/research/selected-final-replay-closure/POLICY.json @@ -0,0 +1,279 @@ +{ + "schema_version": 1, + "scope": "Exactly the selected PR1094 final-stage strict output inventory; not an arbitrary dependency graph.", + "files": [ + "ADMISSION-CONTROLS.json", + "ASSEMBLY.json", + "BIT-SUPPLIER-CONTROLS.json", + "INDEPENDENT-T16.json", + "REPLAY.json", + "STAGES.json", + "admission-controls.log", + "assembly.log", + "audit.log", + "bind.log", + "bind8.log", + "bit-supplier-controls.log", + "emit.log", + "global/BINDING.json", + "global/PLAN.json", + "global/audit/ASYNC-AUDIT.json", + "global/audit/GLOBAL-PREFIX.json", + "global/audit/IDLE-REMAINDER-FRAMES.json", + "global/audit/OWNERS-AND-PROFILE.json", + "global/audit/PREFIX-AND-INVOICE.json", + "global/base/providers/gauge44/CANONICAL-WORD.json.gz", + "global/base/providers/gauge44/CLIFFORD-RECIPES.json", + "global/base/providers/gauge44/CLIFFORD-REVIEW.json", + "global/base/providers/gauge44/FULL-WORD.json.gz", + "global/base/providers/gauge44/INDEPENDENT-LOCAL-REPLAY.json", + "global/base/providers/gauge44/LOCAL-CHECKS.json", + "global/base/providers/gauge44/LOCAL-PROGRAMS.json.gz", + "global/base/providers/gauge44/RESIDUAL-ADAPTERS.json", + "global/base/providers/gauge44/SCALAR-FRAME-AUDIT.json", + "global/base/providers/gauge44/WRAPPER-CHECKS.json", + "global/base/split-centres/CANONICAL-WORD.json.gz", + "global/base/split-centres/CLIFFORD-RECIPES.json", + "global/base/split-centres/CLIFFORD-REVIEW.json", + "global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "global/base/split-centres/INDEPENDENT-REPLAY.json", + "global/base/split-centres/INTEGRATION.json", + "global/base/split-centres/LOCAL-CHECKS.json", + "global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "global/base/split-centres/RESIDUAL-ADAPTERS.json", + "global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "global/base/split-centres/WRAPPER-CHECKS.json", + "global/base/work/complex-nine-native/DATA-PHASES.json", + "global/hosted/ACTUAL-SIGMAS.json.gz", + "global/hosted/GLOBAL-TEMPLATE.json.gz", + "global/hosted/HOSTED.json", + "global/hosted/IDLE-REMAINDER-FRAMES.json.gz", + "global8/BINDING.json", + "global8/PLAN.json", + "global8/base/providers/gauge44/CANONICAL-WORD.json.gz", + "global8/base/providers/gauge44/CLIFFORD-RECIPES.json", + "global8/base/providers/gauge44/CLIFFORD-REVIEW.json", + "global8/base/providers/gauge44/FULL-WORD.json.gz", + "global8/base/providers/gauge44/INDEPENDENT-LOCAL-REPLAY.json", + "global8/base/providers/gauge44/LOCAL-CHECKS.json", + "global8/base/providers/gauge44/LOCAL-PROGRAMS.json.gz", + "global8/base/providers/gauge44/RESIDUAL-ADAPTERS.json", + "global8/base/providers/gauge44/SCALAR-FRAME-AUDIT.json", + "global8/base/providers/gauge44/WRAPPER-CHECKS.json", + "global8/base/split-centres/CANONICAL-WORD.json.gz", + "global8/base/split-centres/CLIFFORD-RECIPES.json", + "global8/base/split-centres/CLIFFORD-REVIEW.json", + "global8/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "global8/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "global8/base/split-centres/INDEPENDENT-REPLAY.json", + "global8/base/split-centres/INTEGRATION.json", + "global8/base/split-centres/LOCAL-CHECKS.json", + "global8/base/split-centres/LOCAL-PROGRAMS.json.gz", + "global8/base/split-centres/RESIDUAL-ADAPTERS.json", + "global8/base/split-centres/SCALAR-FRAME-AUDIT.json", + "global8/base/split-centres/WRAPPER-CHECKS.json", + "global8/base/work/complex-nine-native/DATA-PHASES.json", + "independent-t16.log", + "invoice.log", + "lift/GLOBAL-TEMPLATE.json.gz", + "lift/PARENT-LIFT-RECEIPT.json", + "lift/PLAN.json", + "lift16.log", + "parent16/complex-global/base/split-centres/CANONICAL-WORD.json.gz", + "parent16/complex-global/base/split-centres/CLIFFORD-RECIPES.json", + "parent16/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "parent16/complex-global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "parent16/complex-global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "parent16/complex-global/base/split-centres/INDEPENDENT-REPLAY.json", + "parent16/complex-global/base/split-centres/INTEGRATION.json", + "parent16/complex-global/base/split-centres/LOCAL-CHECKS.json", + "parent16/complex-global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "parent16/complex-global/base/split-centres/RESIDUAL-ADAPTERS.json", + "parent16/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "parent16/complex-global/base/split-centres/WRAPPER-CHECKS.json", + "parent16/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "parent558/complex-global/base/split-centres/CANONICAL-WORD.json.gz", + "parent558/complex-global/base/split-centres/CLIFFORD-RECIPES.json", + "parent558/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "parent558/complex-global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "parent558/complex-global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "parent558/complex-global/base/split-centres/INDEPENDENT-REPLAY.json", + "parent558/complex-global/base/split-centres/INTEGRATION.json", + "parent558/complex-global/base/split-centres/LOCAL-CHECKS.json", + "parent558/complex-global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "parent558/complex-global/base/split-centres/RESIDUAL-ADAPTERS.json", + "parent558/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "parent558/complex-global/base/split-centres/WRAPPER-CHECKS.json", + "parent558/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "restore-parent.log" + ], + "stages": [ + "restore-parent", + "bind8", + "lift16", + "bind", + "emit", + "audit", + "invoice", + "assembly", + "admission-controls", + "bit-supplier-controls", + "independent-t16" + ], + "timings": { + "STAGES.json": [ + [ + 0, + "seconds" + ], + [ + 1, + "seconds" + ], + [ + 2, + "seconds" + ], + [ + 3, + "seconds" + ], + [ + 4, + "seconds" + ], + [ + 5, + "seconds" + ], + [ + 6, + "seconds" + ], + [ + 7, + "seconds" + ], + [ + 8, + "seconds" + ], + [ + 9, + "seconds" + ], + [ + 10, + "seconds" + ] + ], + "REPLAY.json": [ + [ + "stages", + 0, + "seconds" + ], + [ + "stages", + 1, + "seconds" + ], + [ + "stages", + 2, + "seconds" + ], + [ + "stages", + 3, + "seconds" + ], + [ + "stages", + 4, + "seconds" + ], + [ + "stages", + 5, + "seconds" + ], + [ + "stages", + 6, + "seconds" + ], + [ + "stages", + 7, + "seconds" + ], + [ + "stages", + 8, + "seconds" + ], + [ + "stages", + 9, + "seconds" + ], + [ + "stages", + 10, + "seconds" + ] + ] + }, + "input_roles": [ + { + "root": "work", + "suffix": "strict/global8/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "target": "global8/base/split-centres/GLOBAL-TEMPLATE.json.gz" + }, + { + "root": "work", + "suffix": "strict/global8/base/work/complex-nine-native/DATA-PHASES.json", + "target": "global8/base/work/complex-nine-native/DATA-PHASES.json" + }, + { + "root": "work", + "suffix": "strict/global8/base/split-centres/CANONICAL-WORD.json.gz", + "target": "global8/base/split-centres/CANONICAL-WORD.json.gz" + }, + { + "root": "local", + "suffix": "CANONICAL-WORD.json.gz", + "external": "local-word" + }, + { + "root": "local", + "suffix": "INDEPENDENT-LOCAL-REPLAY.json", + "external": "local-replay" + }, + { + "root": "work", + "suffix": "source/data/OWNERS.json.gz", + "external": "owners" + } + ], + "invoice_edges": [ + { + "file": "ADMISSION-CONTROLS.json", + "path": [ + "input_sha256", + "fresh_invoice" + ], + "target": "global/audit/PREFIX-AND-INVOICE.json" + }, + { + "file": "ASSEMBLY.json", + "path": [ + "input_sha256", + "fresh_invoice" + ], + "target": "global/audit/PREFIX-AND-INVOICE.json" + } + ] +} diff --git a/research/selected-final-replay-closure/README.md b/research/selected-final-replay-closure/README.md new file mode 100644 index 0000000000..813a60aade --- /dev/null +++ b/research/selected-final-replay-closure/README.md @@ -0,0 +1,220 @@ +# Complete portable comparison of the selected final replay + +**Verification engineering; no new supplier, paid profile or kappa.** This is an +opt-in caller for the selected PR1094 final stage, not a change to the selected +reproduction command. It closes the *caller-composition* handoff in +[PR2040](https://github.com/CrocSwap/integer-mult-bounds/pull/2040) and +[PR2059](https://github.com/CrocSwap/integer-mult-bounds/pull/2059): execute the +unchanged supplier stage, then compare its **complete 105-file strict output** +with the authenticated reviewed output, without requiring environment-specific +classification counts or erasing unclassified fields. + +The older PR1824 caller requires exactly 102 byte matches, one relocation and +two timing differences, then requires raw assembly equality. PR2040 reports a +Linux run where the final supplier passes but invoice object order changes two +consumer hashes and breaks that comparison. PR2059 repairs only the three-node +invoice predicate and explicitly leaves its complete caller open. This package +uses both new predicates **unchanged**, pinned and attributed in `vendor/`, and +adds the full execution, source binding, inventory and cross-receipt boundary. +The Linux observation belongs to PR2040; it is not a Linux run performed here. + +## Exact scope and comparison policy + +[POLICY.json](POLICY.json) names every output and permitted transformation. +The complete boundary consists of 94 JSON or gzip-JSON artifacts, 11 inner logs, +and the outer 13-line execution log. The complete 105-file inventory is required +on **each** side, even when both sides are identical. Missing and extra files +are errors. Directory loading rejects symlinks. + +Before comparing payloads, each side independently checks: + +1. **Two invoice edges.** Both consumers' literal `input_sha256/fresh_invoice` + values must hash that side's actual invoice bytes. PR2059 then replaces only + these two values with the complete canonical invoice digest. The entire + invoice and both entire consumers remain in the comparison. +2. **Twenty-two log edges.** The eleven ordered, successful stages must occur + in both `STAGES.json` and `REPLAY.json`. Their complete stage arrays must be + typed-equal *within that run*, including elapsed times, and every recorded + log hash must match that run's actual inner log bytes. Those eleven logs are + also compared byte for byte across runs. Repaired references cannot hide + altered log contents. +3. **Six input roles.** `INDEPENDENT-T16.json` must name exactly its three + work-tree inputs, two local inputs and source owner input, and all six + digests must match the corresponding bytes. Only these six exact path keys + are replaced with fixed role keys. Receipt paths are never followed to read + files. No general prefix rewrite applies to other keys or string values. +4. **Twenty-two execution times.** Only the eleven per-stage times in each of + the two receipts may differ across runs. They must be present, finite, + nonnegative numbers, not Booleans or strings. The **12 copied historical + timing fields** elsewhere remain exact. +5. **The complete outer log.** Its eleven ordered `PASS name time` lines must + agree with the same-side stage times, and its two final result lines must + match exactly. No arbitrary line, trailing token or generic `seconds` key + is stripped. + +After those checks, PR2040's strict comparison consumes every file's entire +payload. It rejects duplicate JSON keys and nonfinite numbers, retains numeric +types and every unfamiliar field, and compares exact Decimal values rather +than rounded binary64. The invoice and independent-input receipts use the +narrower integer/string/Boolean/null schema. Gzip streams are decompressed; +container headers alone do not establish a proof-relevant difference. The +comparison does **not** require a fixed count of formatting/container classes. + +### Why this composition preserves evidence + +Write the comparison as `V(A) and V(B) and N(A) = N(B)`. `V` is the per-side +inventory and raw-reference check above. `N` preserves every payload except the +explicit representation coordinates. Authenticating both invoice links is +necessary but insufficient: the complete canonical invoice is compared too, +so changing the invoice and repairing both links still rejects. Full consumer +comparison retains every other hash and proof field. Exact role-key sets make +path substitution injective on the six declared inputs. Typed equality retains +Boolean/integer distinctions and object/list boundaries. Stage timing removal +cannot detach a stage from its log or alter its order, status or exit code. + +This argument is about the declared comparison relation under the usual +SHA-256 collision-resistance assumption. It does not prove the Python programs +formally, authenticate historical execution, or establish that arbitrary +matching receipts describe true mathematics. + +### Deliberately closed graph boundary + +An exploratory census found 173 hash-valued leaves whose values happen to +match output bytes. Some are semantic digests or have several byte-identical +candidate targets. **Value coincidence is not a role contract**, so this caller +does not infer graph edges from that census and does not rewrite those hashes. +Only the two invoice edges are rebound; the six input and 22 log edges are +checked without digest rebinding. Every other digest field stays exact in the +full payload comparison. This is not an arbitrary reserialized-DAG validator, +and does not promise acceptance when other artifacts' changed raw hashes +propagate into other receipts. It completes the explicit invoice-format, +root-relocation and fresh-timing caller boundary, not universal portability. + +## Source and execution boundary + +The scientific base is `564148b82ae9df72163f22106f15e73efca8aff2`, priority +revision **4**, selected kappa `836330098538459/500000000000000000`. +[SELECTION.json](SELECTION.json) preserves the one-shot independent chooser +nonce `a1c9b8df7348849ae3ec156120abe878`; [TASK.json](TASK.json) records the +`portable-replay` refinement before the substantive archive experiment. + +[SOURCES.json](SOURCES.json) pins 42 live repository inputs by Git blob and raw +SHA-256, including the final package manifest and every member it names, the +strict driver's upstream pins, the entire copied frozen base, both reviewed +archives and the used review receipts. Both small vendored comparators retain +exact upstream bytes, immutable commit URLs, blob IDs and SHA-256 hashes. +Sources are authenticated before execution. `VERIFY.json` declares all 42 +inputs for replay invalidation. No network or unpinned dependency is required. + +The local input is all ten `slots/local` files from the authenticated PR1042 +archive, checked against its complete receipt. The output reference is the +PR1094 archive, additionally bound to the committed assembly and execution +receipts. The supplier runs in fresh external storage with assertions enabled; +source archives, selected pointers and frozen packages are never modified. + +The reviewed archive omits the extracted `source/` directory. Its owner-input +reference is therefore checked against the separately pinned selected package's +`data/OWNERS.json.gz`, not an invented archive member. The fresh run's owner +reference is checked against its actual extracted/overlaid input. + +At the submission checkpoint, canonical main +`0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2` changed guidance only; the catalogue, +selected record and scientific inputs remained unchanged. The new guidance was +read while the original scientific base was retained. The shared complete +snapshot contained 353 open PRs (including drafts, 19:00:33Z) and 738 discussion +records (19:02:09Z). Targeted searches and live PR2040/2059 heads were checked at +19:04Z; both heads were unchanged. These searches are not a novelty certificate. + +## Reproduce + +From a full-history checkout, with standard-library CPython 3.12: + +```sh +uv run --python 3.12 --no-project python -I -B research/selected-final-replay-closure/verify.py +uv run --python 3.12 --no-project python -B scripts/research_package.py --package research/selected-final-replay-closure --check-only +uv run --python 3.12 --no-project python -B scripts/research_package.py --package research/selected-final-replay-closure +``` + +Each scientific command actually executes the unchanged final supplier stage. +The default uses a temporary directory and writes nothing into the checkout. +`--work NEW_EXTERNAL_DIRECTORY` preserves diagnostics; `--write-result NEW_FILE` +is an explicit first-generation option that refuses overwriting. Normal replay +compares the complete deterministic result with [RESULT.json](RESULT.json). +Per-run classification counts are diagnostic, not the acceptance criterion. + +## Observed evidence + +The final direct scientific smoke freshly executed the unchanged supplier and +passed the complete comparison: **103 byte-equivalent normalized outputs and +two declared timing differences**. This classification is an observation, not +an exact-count acceptance rule. The direct command including controls completed +in 268.58 seconds on CPython **3.12.12**, macOS **27.0.1 arm64**, standard library. + +The metadata/source-pin check passed. The registered replay then passed in +261.47 seconds, freshly executing the supplier again and reproducing the +complete deterministic receipt. Its parent verifier uses `-I -O -B`; the +supplier subprocess deliberately runs without optimization and with inherited +`PYTHONOPTIMIZE` removed, so its assertions remain enabled. Observed markers: + +```text +PASS_FRESH_SELECTED_FINAL_STAGE {"bytes": 103, "json-diff:declared-timing": 2} +PASS_SELECTED_FINAL_REPLAY_CLOSURE files=105 edges=30 positives=5 negatives=287 no_new_kappa +PASS_REGISTERED_RESEARCH_PACKAGE research/selected-final-replay-closure outcome=completed +``` + +The deterministic receipt records **five constructed positive controls and 287 +negative controls**, separately from that fresh supplier execution: + +- all 105 single-file omissions and one extra output reject; +- one semantic mutation in each of all 105 outputs rejects, including all + eleven altered logs with both corresponding receipt hashes repaired and the + altered invoice with both consumer hashes repaired; +- valid invoice formatting, its composition with all six root-role changes and + all 22 fresh timing changes, a coupled outer log and a generated gzip-header/ + compression change accept; +- stale invoice links (including identical malformed sides), stale coupled log + references, six input digest faults and six role aliases reject; +- all 22 timing omissions, invalid coupled times, all 12 changed historical + timing fields, duplicate keys, invalid replay shapes/numbers, Boolean/integer + substitution, truncated gzip and outer-log faults reject; +- an immutable archive header change preserves decompressed tar content but + fails the committed raw SHA-256 equality. + +The semantic census is bounded: it is one mutation per output, not an +exhaustive mutation of every tree node or a formal verification of the caller. + + +## Limits and next questions + +This is not `make frontier1094-verify`: the PR1042/#799 ancestors are not rebuilt, +and local scalar/native/phase evidence is reused from authenticated archives. +The unchanged final stage does execute its restore, bind, lift, emit, audit, +invoice, assembly, admission, bit-control and independent-T16 checks. This does +not discharge the inherited all-size/compiler, common-label, hosting, +precision/tape, exact-recovery or analytic assumptions. No stronger exponent, +formal-kernel run, hosted CI result or independent human review is claimed. + +## Open next questions + +Can one earlier PR1042 stage receive an equally complete portable comparison? +This matters because the final stage alone does not establish portable cold +ancestry. A feasible first step is to choose one earlier source-bound stage, +read its actual producer, and derive its complete output/reference policy. +That requires a separate overlap review and its native dependencies; it is +outside this package. Structured scope and blockers are in `TASK.json`. + +## Attribution + +Josie Elliston (PR1824) supplied the source-bound final-stage replay, fixture +locations and original comparison. commdata2338 (PR2040) supplied the strict +typed/path/timing comparator, its counterexamples and the Linux invoice-format +observation. Adam Gall (PR2059) supplied the authenticated three-node invoice +predicate. Both comparator source files are preserved byte-for-byte, not +presented as new algorithms here. Credit Maxime Fleury and Antoine Olivier for +the payload-versus-container convention; Rohan Arun, Jeremy Kothe, Hao Yan, +Douglas Colkitt and the retained selected supplier/compiler lineage for the +construction and review archives. All original notices remain intact. + +New caller, controls and documentation prepared for Adam Gall (@adamgall) with +substantial OpenAI Codex assistance in design, implementation, experiments, +testing and writing. Apache-2.0. diff --git a/research/selected-final-replay-closure/RESULT.json b/research/selected-final-replay-closure/RESULT.json new file mode 100644 index 0000000000..bd3c7b1704 --- /dev/null +++ b/research/selected-final-replay-closure/RESULT.json @@ -0,0 +1,318 @@ +{ + "copied_historical_timings_retained": 12, + "fresh_supplier_stage": true, + "inner_logs": 11, + "input_roles_relocated_per_side": 6, + "invoice_edges_rebound_per_side": 2, + "json_outputs": 94, + "local_input_files": 10, + "negative_controls": [ + "missing:ADMISSION-CONTROLS.json", + "missing:ASSEMBLY.json", + "missing:BIT-SUPPLIER-CONTROLS.json", + "missing:INDEPENDENT-T16.json", + "missing:REPLAY.json", + "missing:STAGES.json", + "missing:admission-controls.log", + "missing:assembly.log", + "missing:audit.log", + "missing:bind.log", + "missing:bind8.log", + "missing:bit-supplier-controls.log", + "missing:emit.log", + "missing:global/BINDING.json", + "missing:global/PLAN.json", + "missing:global/audit/ASYNC-AUDIT.json", + "missing:global/audit/GLOBAL-PREFIX.json", + "missing:global/audit/IDLE-REMAINDER-FRAMES.json", + "missing:global/audit/OWNERS-AND-PROFILE.json", + "missing:global/audit/PREFIX-AND-INVOICE.json", + "missing:global/base/providers/gauge44/CANONICAL-WORD.json.gz", + "missing:global/base/providers/gauge44/CLIFFORD-RECIPES.json", + "missing:global/base/providers/gauge44/CLIFFORD-REVIEW.json", + "missing:global/base/providers/gauge44/FULL-WORD.json.gz", + "missing:global/base/providers/gauge44/INDEPENDENT-LOCAL-REPLAY.json", + "missing:global/base/providers/gauge44/LOCAL-CHECKS.json", + "missing:global/base/providers/gauge44/LOCAL-PROGRAMS.json.gz", + "missing:global/base/providers/gauge44/RESIDUAL-ADAPTERS.json", + "missing:global/base/providers/gauge44/SCALAR-FRAME-AUDIT.json", + "missing:global/base/providers/gauge44/WRAPPER-CHECKS.json", + "missing:global/base/split-centres/CANONICAL-WORD.json.gz", + "missing:global/base/split-centres/CLIFFORD-RECIPES.json", + "missing:global/base/split-centres/CLIFFORD-REVIEW.json", + "missing:global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "missing:global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "missing:global/base/split-centres/INDEPENDENT-REPLAY.json", + "missing:global/base/split-centres/INTEGRATION.json", + "missing:global/base/split-centres/LOCAL-CHECKS.json", + "missing:global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "missing:global/base/split-centres/RESIDUAL-ADAPTERS.json", + "missing:global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "missing:global/base/split-centres/WRAPPER-CHECKS.json", + "missing:global/base/work/complex-nine-native/DATA-PHASES.json", + "missing:global/hosted/ACTUAL-SIGMAS.json.gz", + "missing:global/hosted/GLOBAL-TEMPLATE.json.gz", + "missing:global/hosted/HOSTED.json", + "missing:global/hosted/IDLE-REMAINDER-FRAMES.json.gz", + "missing:global8/BINDING.json", + "missing:global8/PLAN.json", + "missing:global8/base/providers/gauge44/CANONICAL-WORD.json.gz", + "missing:global8/base/providers/gauge44/CLIFFORD-RECIPES.json", + "missing:global8/base/providers/gauge44/CLIFFORD-REVIEW.json", + "missing:global8/base/providers/gauge44/FULL-WORD.json.gz", + "missing:global8/base/providers/gauge44/INDEPENDENT-LOCAL-REPLAY.json", + "missing:global8/base/providers/gauge44/LOCAL-CHECKS.json", + "missing:global8/base/providers/gauge44/LOCAL-PROGRAMS.json.gz", + "missing:global8/base/providers/gauge44/RESIDUAL-ADAPTERS.json", + "missing:global8/base/providers/gauge44/SCALAR-FRAME-AUDIT.json", + "missing:global8/base/providers/gauge44/WRAPPER-CHECKS.json", + "missing:global8/base/split-centres/CANONICAL-WORD.json.gz", + "missing:global8/base/split-centres/CLIFFORD-RECIPES.json", + "missing:global8/base/split-centres/CLIFFORD-REVIEW.json", + "missing:global8/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "missing:global8/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "missing:global8/base/split-centres/INDEPENDENT-REPLAY.json", + "missing:global8/base/split-centres/INTEGRATION.json", + "missing:global8/base/split-centres/LOCAL-CHECKS.json", + "missing:global8/base/split-centres/LOCAL-PROGRAMS.json.gz", + "missing:global8/base/split-centres/RESIDUAL-ADAPTERS.json", + "missing:global8/base/split-centres/SCALAR-FRAME-AUDIT.json", + "missing:global8/base/split-centres/WRAPPER-CHECKS.json", + "missing:global8/base/work/complex-nine-native/DATA-PHASES.json", + "missing:independent-t16.log", + "missing:invoice.log", + "missing:lift/GLOBAL-TEMPLATE.json.gz", + "missing:lift/PARENT-LIFT-RECEIPT.json", + "missing:lift/PLAN.json", + "missing:lift16.log", + "missing:parent16/complex-global/base/split-centres/CANONICAL-WORD.json.gz", + "missing:parent16/complex-global/base/split-centres/CLIFFORD-RECIPES.json", + "missing:parent16/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "missing:parent16/complex-global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "missing:parent16/complex-global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "missing:parent16/complex-global/base/split-centres/INDEPENDENT-REPLAY.json", + "missing:parent16/complex-global/base/split-centres/INTEGRATION.json", + "missing:parent16/complex-global/base/split-centres/LOCAL-CHECKS.json", + "missing:parent16/complex-global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "missing:parent16/complex-global/base/split-centres/RESIDUAL-ADAPTERS.json", + "missing:parent16/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "missing:parent16/complex-global/base/split-centres/WRAPPER-CHECKS.json", + "missing:parent16/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "missing:parent558/complex-global/base/split-centres/CANONICAL-WORD.json.gz", + "missing:parent558/complex-global/base/split-centres/CLIFFORD-RECIPES.json", + "missing:parent558/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "missing:parent558/complex-global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "missing:parent558/complex-global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "missing:parent558/complex-global/base/split-centres/INDEPENDENT-REPLAY.json", + "missing:parent558/complex-global/base/split-centres/INTEGRATION.json", + "missing:parent558/complex-global/base/split-centres/LOCAL-CHECKS.json", + "missing:parent558/complex-global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "missing:parent558/complex-global/base/split-centres/RESIDUAL-ADAPTERS.json", + "missing:parent558/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "missing:parent558/complex-global/base/split-centres/WRAPPER-CHECKS.json", + "missing:parent558/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "missing:restore-parent.log", + "extra-file", + "semantic:ADMISSION-CONTROLS.json", + "semantic:ASSEMBLY.json", + "semantic:BIT-SUPPLIER-CONTROLS.json", + "semantic:INDEPENDENT-T16.json", + "semantic:REPLAY.json", + "semantic:STAGES.json", + "semantic:admission-controls.log", + "semantic:assembly.log", + "semantic:audit.log", + "semantic:bind.log", + "semantic:bind8.log", + "semantic:bit-supplier-controls.log", + "semantic:emit.log", + "semantic:global/BINDING.json", + "semantic:global/PLAN.json", + "semantic:global/audit/ASYNC-AUDIT.json", + "semantic:global/audit/GLOBAL-PREFIX.json", + "semantic:global/audit/IDLE-REMAINDER-FRAMES.json", + "semantic:global/audit/OWNERS-AND-PROFILE.json", + "semantic:global/audit/PREFIX-AND-INVOICE.json", + "semantic:global/base/providers/gauge44/CANONICAL-WORD.json.gz", + "semantic:global/base/providers/gauge44/CLIFFORD-RECIPES.json", + "semantic:global/base/providers/gauge44/CLIFFORD-REVIEW.json", + "semantic:global/base/providers/gauge44/FULL-WORD.json.gz", + "semantic:global/base/providers/gauge44/INDEPENDENT-LOCAL-REPLAY.json", + "semantic:global/base/providers/gauge44/LOCAL-CHECKS.json", + "semantic:global/base/providers/gauge44/LOCAL-PROGRAMS.json.gz", + "semantic:global/base/providers/gauge44/RESIDUAL-ADAPTERS.json", + "semantic:global/base/providers/gauge44/SCALAR-FRAME-AUDIT.json", + "semantic:global/base/providers/gauge44/WRAPPER-CHECKS.json", + "semantic:global/base/split-centres/CANONICAL-WORD.json.gz", + "semantic:global/base/split-centres/CLIFFORD-RECIPES.json", + "semantic:global/base/split-centres/CLIFFORD-REVIEW.json", + "semantic:global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "semantic:global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "semantic:global/base/split-centres/INDEPENDENT-REPLAY.json", + "semantic:global/base/split-centres/INTEGRATION.json", + "semantic:global/base/split-centres/LOCAL-CHECKS.json", + "semantic:global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "semantic:global/base/split-centres/RESIDUAL-ADAPTERS.json", + "semantic:global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "semantic:global/base/split-centres/WRAPPER-CHECKS.json", + "semantic:global/base/work/complex-nine-native/DATA-PHASES.json", + "semantic:global/hosted/ACTUAL-SIGMAS.json.gz", + "semantic:global/hosted/GLOBAL-TEMPLATE.json.gz", + "semantic:global/hosted/HOSTED.json", + "semantic:global/hosted/IDLE-REMAINDER-FRAMES.json.gz", + "semantic:global8/BINDING.json", + "semantic:global8/PLAN.json", + "semantic:global8/base/providers/gauge44/CANONICAL-WORD.json.gz", + "semantic:global8/base/providers/gauge44/CLIFFORD-RECIPES.json", + "semantic:global8/base/providers/gauge44/CLIFFORD-REVIEW.json", + "semantic:global8/base/providers/gauge44/FULL-WORD.json.gz", + "semantic:global8/base/providers/gauge44/INDEPENDENT-LOCAL-REPLAY.json", + "semantic:global8/base/providers/gauge44/LOCAL-CHECKS.json", + "semantic:global8/base/providers/gauge44/LOCAL-PROGRAMS.json.gz", + "semantic:global8/base/providers/gauge44/RESIDUAL-ADAPTERS.json", + "semantic:global8/base/providers/gauge44/SCALAR-FRAME-AUDIT.json", + "semantic:global8/base/providers/gauge44/WRAPPER-CHECKS.json", + "semantic:global8/base/split-centres/CANONICAL-WORD.json.gz", + "semantic:global8/base/split-centres/CLIFFORD-RECIPES.json", + "semantic:global8/base/split-centres/CLIFFORD-REVIEW.json", + "semantic:global8/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "semantic:global8/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "semantic:global8/base/split-centres/INDEPENDENT-REPLAY.json", + "semantic:global8/base/split-centres/INTEGRATION.json", + "semantic:global8/base/split-centres/LOCAL-CHECKS.json", + "semantic:global8/base/split-centres/LOCAL-PROGRAMS.json.gz", + "semantic:global8/base/split-centres/RESIDUAL-ADAPTERS.json", + "semantic:global8/base/split-centres/SCALAR-FRAME-AUDIT.json", + "semantic:global8/base/split-centres/WRAPPER-CHECKS.json", + "semantic:global8/base/work/complex-nine-native/DATA-PHASES.json", + "semantic:independent-t16.log", + "semantic:invoice.log", + "semantic:lift/GLOBAL-TEMPLATE.json.gz", + "semantic:lift/PARENT-LIFT-RECEIPT.json", + "semantic:lift/PLAN.json", + "semantic:lift16.log", + "semantic:parent16/complex-global/base/split-centres/CANONICAL-WORD.json.gz", + "semantic:parent16/complex-global/base/split-centres/CLIFFORD-RECIPES.json", + "semantic:parent16/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "semantic:parent16/complex-global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "semantic:parent16/complex-global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "semantic:parent16/complex-global/base/split-centres/INDEPENDENT-REPLAY.json", + "semantic:parent16/complex-global/base/split-centres/INTEGRATION.json", + "semantic:parent16/complex-global/base/split-centres/LOCAL-CHECKS.json", + "semantic:parent16/complex-global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "semantic:parent16/complex-global/base/split-centres/RESIDUAL-ADAPTERS.json", + "semantic:parent16/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "semantic:parent16/complex-global/base/split-centres/WRAPPER-CHECKS.json", + "semantic:parent16/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "semantic:parent558/complex-global/base/split-centres/CANONICAL-WORD.json.gz", + "semantic:parent558/complex-global/base/split-centres/CLIFFORD-RECIPES.json", + "semantic:parent558/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "semantic:parent558/complex-global/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "semantic:parent558/complex-global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "semantic:parent558/complex-global/base/split-centres/INDEPENDENT-REPLAY.json", + "semantic:parent558/complex-global/base/split-centres/INTEGRATION.json", + "semantic:parent558/complex-global/base/split-centres/LOCAL-CHECKS.json", + "semantic:parent558/complex-global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "semantic:parent558/complex-global/base/split-centres/RESIDUAL-ADAPTERS.json", + "semantic:parent558/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "semantic:parent558/complex-global/base/split-centres/WRAPPER-CHECKS.json", + "semantic:parent558/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "semantic:restore-parent.log", + "stale-invoice:ADMISSION-CONTROLS.json", + "identically-stale-invoice:ADMISSION-CONTROLS.json", + "stale-invoice:ASSEMBLY.json", + "identically-stale-invoice:ASSEMBLY.json", + "missing-time:STAGES.json:[0, 'seconds']", + "missing-time:STAGES.json:[1, 'seconds']", + "missing-time:STAGES.json:[2, 'seconds']", + "missing-time:STAGES.json:[3, 'seconds']", + "missing-time:STAGES.json:[4, 'seconds']", + "missing-time:STAGES.json:[5, 'seconds']", + "missing-time:STAGES.json:[6, 'seconds']", + "missing-time:STAGES.json:[7, 'seconds']", + "missing-time:STAGES.json:[8, 'seconds']", + "missing-time:STAGES.json:[9, 'seconds']", + "missing-time:STAGES.json:[10, 'seconds']", + "missing-time:REPLAY.json:['stages', 0, 'seconds']", + "missing-time:REPLAY.json:['stages', 1, 'seconds']", + "missing-time:REPLAY.json:['stages', 2, 'seconds']", + "missing-time:REPLAY.json:['stages', 3, 'seconds']", + "missing-time:REPLAY.json:['stages', 4, 'seconds']", + "missing-time:REPLAY.json:['stages', 5, 'seconds']", + "missing-time:REPLAY.json:['stages', 6, 'seconds']", + "missing-time:REPLAY.json:['stages', 7, 'seconds']", + "missing-time:REPLAY.json:['stages', 8, 'seconds']", + "missing-time:REPLAY.json:['stages', 9, 'seconds']", + "missing-time:REPLAY.json:['stages', 10, 'seconds']", + "invalid-coupled-time:boolean", + "invalid-coupled-time:negative", + "invalid-coupled-time:string", + "stale-coupled-log:restore-parent", + "stale-coupled-log:bind8", + "stale-coupled-log:lift16", + "stale-coupled-log:bind", + "stale-coupled-log:emit", + "stale-coupled-log:audit", + "stale-coupled-log:invoice", + "stale-coupled-log:assembly", + "stale-coupled-log:admission-controls", + "stale-coupled-log:bit-supplier-controls", + "stale-coupled-log:independent-t16", + "stale-input:/private/tmp/batch1099-selected/candidate/strict/global8/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "input-role-alias:/private/tmp/batch1099-selected/candidate/strict/global8/base/split-centres/GLOBAL-TEMPLATE.json.gz", + "stale-input:/private/tmp/batch1099-selected/candidate/strict/global8/base/work/complex-nine-native/DATA-PHASES.json", + "input-role-alias:/private/tmp/batch1099-selected/candidate/strict/global8/base/work/complex-nine-native/DATA-PHASES.json", + "stale-input:/private/tmp/batch1099-selected/candidate/strict/global8/base/split-centres/CANONICAL-WORD.json.gz", + "input-role-alias:/private/tmp/batch1099-selected/candidate/strict/global8/base/split-centres/CANONICAL-WORD.json.gz", + "stale-input:/private/tmp/batch1047-selected/slots/local/CANONICAL-WORD.json.gz", + "input-role-alias:/private/tmp/batch1047-selected/slots/local/CANONICAL-WORD.json.gz", + "stale-input:/private/tmp/batch1047-selected/slots/local/INDEPENDENT-LOCAL-REPLAY.json", + "input-role-alias:/private/tmp/batch1047-selected/slots/local/INDEPENDENT-LOCAL-REPLAY.json", + "stale-input:/private/tmp/batch1099-selected/candidate/source/data/OWNERS.json.gz", + "input-role-alias:/private/tmp/batch1099-selected/candidate/source/data/OWNERS.json.gz", + "copied-historical-time:global/base/providers/gauge44/CLIFFORD-REVIEW.json", + "copied-historical-time:global/base/providers/gauge44/SCALAR-FRAME-AUDIT.json", + "copied-historical-time:global/base/split-centres/CLIFFORD-REVIEW.json", + "copied-historical-time:global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "copied-historical-time:global8/base/providers/gauge44/CLIFFORD-REVIEW.json", + "copied-historical-time:global8/base/providers/gauge44/SCALAR-FRAME-AUDIT.json", + "copied-historical-time:global8/base/split-centres/CLIFFORD-REVIEW.json", + "copied-historical-time:global8/base/split-centres/SCALAR-FRAME-AUDIT.json", + "copied-historical-time:parent16/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "copied-historical-time:parent16/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "copied-historical-time:parent558/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "copied-historical-time:parent558/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "duplicate-key:ASSEMBLY.json", + "identically-duplicate-key:ASSEMBLY.json", + "duplicate-key:global/audit/PREFIX-AND-INVOICE.json", + "identically-duplicate-key:global/audit/PREFIX-AND-INVOICE.json", + "invalid-replay:nonfinite", + "invalid-replay:wrong-shape", + "boolean-is-not-integer", + "truncated-gzip", + "outer-log:extra-line", + "outer-log:stage-name", + "outer-log:uncoupled-time", + "immutable-source-header" + ], + "negative_count": 287, + "outer_log_lines_checked": 13, + "outer_times_bound_to_receipt": 11, + "policy_sha256": "1168976bd55a5e3bff657fc8877066d54fc68fe3bc8572c9d8d914c35b277a03", + "positive_controls": [ + "complete-authenticated-reference", + "reformatted-invoice-with-both-raw-links", + "composed-invoice-six-role-relocation-and-22-times", + "complete-outer-log-with-coupled-times", + "generated-gzip-container-change" + ], + "positive_count": 5, + "raw_edges_authenticated_per_side": 30, + "schema_version": 1, + "scope": "Unchanged final supplier stage from authenticated archived local inputs; not full cold ancestry, arbitrary graph admission, cross-platform execution, or a new kappa.", + "selected_kappa": "836330098538459/500000000000000000", + "source_inputs": 42, + "stage_timing_fields_normalized_per_side": 22, + "status": "PASS_SELECTED_FINAL_REPLAY_CLOSURE", + "strict_output_files": 105 +} diff --git a/research/selected-final-replay-closure/SELECTION.json b/research/selected-final-replay-closure/SELECTION.json new file mode 100644 index 0000000000..2dd47f1458 --- /dev/null +++ b/research/selected-final-replay-closure/SELECTION.json @@ -0,0 +1,91 @@ +{ + "seed": "a1c9b8df7348849ae3ec156120abe878", + "track": "verifier-engineering", + "suggestions": [ + { + "task_id": "portable-replay", + "scope_key": "831cc1a3c8f9ff01b197", + "question": "Can one reproducible environment or artifact-comparison failure be repaired?", + "method": "Reproduce one portability failure and add a minimal cross-environment fix.", + "starting_points": [ + "research/gzip-container-reproducibility/README.md", + "docs/ci-verification.md" + ], + "acceptance_gate": "Preserve immutable source hashes and proof-relevant content; a different compressed byte stream alone is not a mathematical mismatch.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the gzip-container reproducibility examples and distinguish frozen source bytes from regenerated payloads.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Reproduce one specific mismatch or audit one canonical comparison for omitted proof-relevant fields.", + "bottleneck_link": "Portable exact checks prevent environment failures from blocking valid contributions.", + "allowed_variations": [ + "One interpreter/version mismatch or one payload field comparison." + ], + "scope_change_triggers": [ + "Removing immutable-source pins because generated compressed bytes differ." + ], + "overlap_terms": [ + "gzip container", + "reproducibility", + "canonical payload" + ], + "scope_rule": "If you change the card's premise, record scope_status=changed and explain why. A package metadata check cannot establish mathematical relevance." + }, + { + "task_id": "replay-runtime", + "scope_key": "b1dd41940c60d240b47a", + "question": "Can one measured replay bottleneck be sped up without dropping coverage?", + "method": "Profile one isolated replay and optimize the measured bottleneck.", + "starting_points": [ + "scripts/run_isolated_tests.py", + "scripts/verify_replay_coverage.py", + "certificates/selected-result.json" + ], + "acceptance_gate": "Report before/after wall time on the same fixture, retained checks and invalidation behavior.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the selected reproduction command and choose a single replay stage for profiling.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Measure one unchanged fixture, preserve check coverage, and test one optimization with invalidation controls.", + "bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.", + "allowed_variations": [ + "Profile one stage or design one source-bound cache boundary." + ], + "scope_change_triggers": [ + "Skipping coverage or comparing different fixtures to claim speedup." + ], + "overlap_terms": [ + "replay runtime", + "cache invalidation", + "isolated tests" + ], + "scope_rule": "If you change the card's premise, record scope_status=changed and explain why. A package metadata check cannot establish mathematical relevance." + } + ], + "base_commit": "564148b82ae9df72163f22106f15e73efca8aff2", + "catalog_assessed_on": "2026-10-14", + "priority_revision": 4, + "priority_log": "docs/research/research-priority-log.md", + "catalog_sha256": "d46eb6d5b3e279428753d770653663fbdf1063e55c255ea073d768f344927ef7", + "selected_record_sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32", + "selected": { + "kappa": "836330098538459/500000000000000000", + "review": "docs/research/community-batch1099-review.md", + "source_manifest": "research/community-frontier1094-audit/SELECTED-SOURCE.json", + "reproduce": "make frontier1094-verify" + }, + "status": "SUGGESTIONS_ONLY_NOT_RESERVED", + "next_step": "Check live overlap, refine one question's object and domain, and record a bounded task card. A different seed or scope key is not evidence of novelty." +} diff --git a/research/selected-final-replay-closure/SOURCES.json b/research/selected-final-replay-closure/SOURCES.json new file mode 100644 index 0000000000..2c62938cac --- /dev/null +++ b/research/selected-final-replay-closure/SOURCES.json @@ -0,0 +1,288 @@ +{ + "schema_version": 1, + "base_commit": "564148b82ae9df72163f22106f15e73efca8aff2", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "e8870e5917057d59b730eb14721a778639eca050", + "sha256": "d46eb6d5b3e279428753d770653663fbdf1063e55c255ea073d768f344927ef7" + }, + { + "path": "research/community-frontier1042-audit/RESULT.json", + "usage": "input", + "git_blob": "8182d0818c0cbda7e52c10120f15b2c3a2c8f933", + "sha256": "bf12c6ed3b412539638b76addb40591a631609b2ab9e5ee0db1f6bbe067d0ec0" + }, + { + "path": "research/community-frontier1042-audit/selected-replay.tar.gz", + "usage": "input", + "git_blob": "6f4dc6fe7631d8aacf8081fcaecf32197181685b", + "sha256": "22c3f4dce4b897a1d423d1388801933e288b6a6b1906cb15e1b16a5eb68db754" + }, + { + "path": "research/community-frontier1094-audit/ASSEMBLY.json", + "usage": "input", + "git_blob": "5fd676df060f3b450782fdf5ff5f6beb63a5eeb0", + "sha256": "1122cb3a575f8c788345fc1bf4c108ac7c3250fb81a5988671f5eb04b3ab3045" + }, + { + "path": "research/community-frontier1094-audit/REPLAY.json", + "usage": "input", + "git_blob": "2cfb7fffa7cd78f418be16c13224c3206b6d0183", + "sha256": "ce0678fa7abaab221de74baeace0c6696d5ea23a36719a58cff230215a06aae7" + }, + { + "path": "research/community-frontier1094-audit/RESULT.json", + "usage": "input", + "git_blob": "131d9c96a54632ae385ced4138fd7f30ad448a3e", + "sha256": "1e3e47e9ec24bcb6fb5f703b7fce0aab658d84ff72bfae5da3ae429d17b6e752" + }, + { + "path": "research/community-frontier1094-audit/STAGES.json", + "usage": "input", + "git_blob": "a92499421609e4cdb5630f2697d2bad4b5a42a83", + "sha256": "72ad3ba266488da6bb6a41be404700dcea183a85002a5428df0033685c56d8be" + }, + { + "path": "research/community-frontier1094-audit/selected-replay.tar.gz", + "usage": "input", + "git_blob": "c24daf067f9c543421d89ca2eeaa4eb78a57fb6f", + "sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/CANONICAL-WORD.json.gz", + "usage": "input", + "git_blob": "a2e5a1ffd454a353bd2d2100bc26259ff5b57af7", + "sha256": "66d3c3c70983224650643a0a05a21ac6c6959f84d0f4528650601016f5a76844" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/CLIFFORD-RECIPES.json", + "usage": "input", + "git_blob": "526192f5056e4d7abd7c6ecd26d73319bc25d08e", + "sha256": "534ace870cabe515987e00f50f71550030965006ea18978e0924590ac6944345" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "usage": "input", + "git_blob": "d6670b5c1555eff7695811e60f75d1285af16ad2", + "sha256": "ee9b86428278392d2c933f76d60e51f5af90d4ab67e4d3937ed2fa416e7755ab" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "usage": "input", + "git_blob": "c2e057a3ab4e18ad9711bcd24071780918f81c40", + "sha256": "ad3f2b941127688f98ce6872d00f110644f1c2b156f8adad1b6700e838ed0e26" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/INDEPENDENT-REPLAY.json", + "usage": "input", + "git_blob": "c2e057a3ab4e18ad9711bcd24071780918f81c40", + "sha256": "ad3f2b941127688f98ce6872d00f110644f1c2b156f8adad1b6700e838ed0e26" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/INTEGRATION.json", + "usage": "input", + "git_blob": "ba436009d75f548e6345b7e32a21e343263bc5d4", + "sha256": "5c14538134dfffbc58fa4b4d2f26b270ec5f56d17d4bf23752c82964f45171db" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/LOCAL-CHECKS.json", + "usage": "input", + "git_blob": "2b019f86cd37f3112ee051241f93b7ab3ec6261c", + "sha256": "79177449e404403964ce1b2f4a9a8bd49e1916daba3123d7fd7f5cfd1f1ac0ea" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "usage": "input", + "git_blob": "3b2aa5db6747008c9f9c06a572cdc21e14eb8d27", + "sha256": "99a18eede965accf65943e490b8d2b2ffb9f1c9bc6babdb825413a80cbea2cde" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/RESIDUAL-ADAPTERS.json", + "usage": "input", + "git_blob": "2a81814dca80e70ae99a2f9ca403de07573c36bd", + "sha256": "baafef737acc16dafbe1150896feb16744f3d669fa123bb2bff19ecc4e71b275" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "usage": "input", + "git_blob": "089f202be813ab0221f52b8ac7072d478c3f7497", + "sha256": "73b3601a6239502475a272ea0c46945fd42034486aaf43e66a212eb4f012ca44" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/WRAPPER-CHECKS.json", + "usage": "input", + "git_blob": "5efe2efe55e1ef33eb3da11642034ad6085c21c1", + "sha256": "9a09146e686c4f535b04fdef3753fe01dad8f5e8881a69408a91394acb5b48f5" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/controller-input/split-centres/CANONICAL-WORD.json.gz", + "usage": "input", + "git_blob": "3b0a475178f4e4ad107e3595992c872e47e83c63", + "sha256": "de2be0f4b6d24ace368fd5b834b7a00f9625d0a1824c4ff969f2db5f115db667" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/code/run_portable.py", + "usage": "input", + "git_blob": "2fed13f432df4d76ce72185dd79fac63d96aee96", + "sha256": "322d29d43dbee8130cde15d4bf05396698b5e3dfe3735813899db91cc0ba7955" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/engines/base_two_moment.py", + "usage": "input", + "git_blob": "14a90fa0e788217856f070382c9e61bd7c603c61", + "sha256": "aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/engines/moment.py", + "usage": "input", + "git_blob": "7d697cb45203fe72d97037403d6da41f71f3b7fd", + "sha256": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/engines/outer.py", + "usage": "input", + "git_blob": "43007488ad2c43187c77cc6798beff8b1cd76ad2", + "sha256": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/inputs/PR543-EXPECTED.json", + "usage": "input", + "git_blob": "b61d859826246e0c3dabbe096e57ad7015eadfd5", + "sha256": "06eccee9f6b77e140833df83407e7996dc948c17d49b0779ab171fbe463fd28d" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/code/prepare_supplier_base.py", + "usage": "input", + "git_blob": "650fc9fd77fd61930ab3a352cd8d0fb5b7f0f03b", + "sha256": "f5eae94aca965d0008bc07cff8245ccb7509042ccad457d3bcb7d51c1e9409f0" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/evidence/audit/PREFIX-AND-INVOICE.json", + "usage": "input", + "git_blob": "a16bf40bccc81278a443e0d5f09b44495035de81", + "sha256": "ce1bfa49be88ae67a404f606a11db2232b7e1f2610d4418058e39749d86d8478" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor535/inputs/ROUND20-PARENT-TEMPLATE.json.gz", + "usage": "input", + "git_blob": "3e28a9b59f8fde608e59ebd5fbdbc22ca54558d4", + "sha256": "025448abdf2012d327e50a009084e1501690d05e650300d2982836aa0350ae00" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/CANDIDATE.json", + "usage": "input", + "git_blob": "d80e967cb9ee9003ace480474399b4e5ee16f7d1", + "sha256": "e5fe28718bd517bbb2e9cd377778bf76bd89012b71e48889784ea45e4dfd7dd4" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/MANIFEST.json", + "usage": "input", + "git_blob": "3216666bd231516f8d2387e3096d6a5bd413b519", + "sha256": "16a964621e718c8da4c859ccbb280c3c00816ca72874e955910fdf0ef27a0adc" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/MOVES.json", + "usage": "input", + "git_blob": "a0d272b433b05eead7d0b7bbf2962a84faf854e5", + "sha256": "d902f129f4c66e4bfe0e1a2e2c602ed71022d11ed938bfa801a087bb8b3b0d1a" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/OWNERS.json.gz", + "usage": "input", + "git_blob": "d3ba33d7e703a3229d9fb8a360f69d2f318bbb70", + "sha256": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/PRICE.json", + "usage": "input", + "git_blob": "f0e765d35128eef8079bdb90c2ebe25db9c9b7ba", + "sha256": "08372c20bee19530083ba15d3a95ce019df68679bae8a52a77fbe8d9c311fc5c" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/PROFILE.json", + "usage": "input", + "git_blob": "7acbdeb81015d4681b5773489369a2a8b0d46d79", + "sha256": "cf539f314584ee0b6d7102d2344be96a63defa88b9d9ab6ffe05cddd6c13a874" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/README.md", + "usage": "input", + "git_blob": "f205b7132243aedcb2aa85110a44f0c8cd1e4fe1", + "sha256": "da542711a6a3eb01ce1ebdf8f28a748e6195512687f61d003b95ac5ff281a7b2" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/SOURCE.json", + "usage": "input", + "git_blob": "1e43afd08c060373b6fde3c775c23c180cb6a794", + "sha256": "4cfd44cebfe88f4450294239fbea8feecb564338dc3027b76065227f5d19cb6f" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/VALIDATION.json", + "usage": "input", + "git_blob": "cf1de72638625b8d0845ce2756d68d97f7e55f42", + "sha256": "93d2f78759a7fdfaeb1023387d85f059a7db285b8767ef2c3692a0c21ea3e1c5" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz", + "usage": "input", + "git_blob": "d3ba33d7e703a3229d9fb8a360f69d2f318bbb70", + "sha256": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/data/PLAN.json", + "usage": "input", + "git_blob": "f1bec76e8e9b7a1f09c1e05cb6cce973b6e59f1b", + "sha256": "7bd786ba8e66408f02aa9ef446eaf20c1bfe981ea2e4dd1e5a929f0aa7767bc0" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/data/SPEC.json", + "usage": "input", + "git_blob": "af013ccc2975d9d575d116f8a463cc947f220c8d", + "sha256": "8cb51f25a5da4a29d3783853025b73ff1f452429d4fdb30c599e598bcab0e71d" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/upstream1087.tar.gz", + "usage": "input", + "git_blob": "2970ef79b0441e937449bed30f68f2e0558186ba", + "sha256": "d4acf04daef85d4514f80ec5fcd2492d0c60e5d6c49fa71b3e6523f8db2dea86" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/verify.py", + "usage": "input", + "git_blob": "9d471cf90835bc91d32bb0216c2bb867011a7420", + "sha256": "b8c2f76b305c5c9ceb42df203deef564857d17f1f8182d0745dda9ab96e3d4de" + } + ], + "vendored_sources": [ + { + "path": "vendor/strict_compare.py", + "upstream_path": "research/strict-replay-payload-comparison/compare.py", + "commit": "d31c1418c0c23994d1444dbd9d356b9a8238fd5e", + "url": "https://raw.githubusercontent.com/CrocSwap/integer-mult-bounds/d31c1418c0c23994d1444dbd9d356b9a8238fd5e/research/strict-replay-payload-comparison/compare.py", + "sha256": "7592c2475a851ac68a6db1a82af4ae9db466690c7e2c1daced654c5641b66492", + "git_blob": "127f143bb8e46ca9be26210bcdd2d15c12a79798" + }, + { + "path": "vendor/invoice_compare.py", + "upstream_path": "research/selected-invoice-reference-rebinding/compare_invoice.py", + "commit": "323703a83640f4c104469bf29db18d7d579cb587", + "url": "https://raw.githubusercontent.com/CrocSwap/integer-mult-bounds/323703a83640f4c104469bf29db18d7d579cb587/research/selected-invoice-reference-rebinding/compare_invoice.py", + "sha256": "ddd241a78c16ca4c8a10aaf4aee04a60fe9e171b82e586339d7c3be601a0e3ac", + "git_blob": "2b2460f5ca416e0944b3fb862d1354566bd239c2" + } + ] +} diff --git a/research/selected-final-replay-closure/TASK.json b/research/selected-final-replay-closure/TASK.json new file mode 100644 index 0000000000..2d8d1fadba --- /dev/null +++ b/research/selected-final-replay-closure/TASK.json @@ -0,0 +1,89 @@ +{ + "schema_version": 1, + "task_id": "portable-replay", + "priority_revision": 4, + "base_commit": "564148b82ae9df72163f22106f15e73efca8aff2", + "original_card": { + "id": "portable-replay", + "question": "Can one reproducible environment or artifact-comparison failure be repaired?", + "starting_points": [ + "research/gzip-container-reproducibility/README.md", + "docs/ci-verification.md" + ], + "methods": [ + "Reproduce one portability failure and add a minimal cross-environment fix.", + "Audit one canonical-payload comparison for omitted proof-relevant fields." + ], + "acceptance_gate": "Preserve immutable source hashes and proof-relevant content; a different compressed byte stream alone is not a mathematical mismatch.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the gzip-container reproducibility examples and distinguish frozen source bytes from regenerated payloads.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Reproduce one specific mismatch or audit one canonical comparison for omitted proof-relevant fields.", + "bottleneck_link": "Portable exact checks prevent environment failures from blocking valid contributions.", + "allowed_variations": [ + "One interpreter/version mismatch or one payload field comparison." + ], + "scope_change_triggers": [ + "Removing immutable-source pins because generated compressed bytes differ." + ], + "overlap_terms": [ + "gzip container", + "reproducibility", + "canonical payload" + ] + }, + "chooser_seed": "a1c9b8df7348849ae3ec156120abe878", + "scope_status": "refined", + "actual_scope": "Complete an opt-in, source-authenticated selected PR1094 final-stage replay caller: compare every one of its 105 archived strict outputs by complete typed payloads, authenticate declared raw-digest edges before rebinding, and permit only explicit timing fields and role-preserving input-root relocation.", + "scope_change_reason": "PR2040 supplies strict typed payload comparison and PR2059 supplies only a three-node invoice predicate. Both explicitly leave complete caller composition/replay open; this task tests the whole final-stage output boundary rather than repeating either mutation census.", + "bottleneck_link": "The selected construction is complex-limited. A complete source-bound portable comparison prevents formatting and container differences from blocking review of its final supplier stage without dropping proof-relevant coverage. This is verification engineering, not a new physical supplier or kappa.", + "budget_minutes": 60, + "stop_rule": "Accept only after a fresh unchanged final supplier stage passes and every output, declared raw edge, timing location and input role is checked. Stop or report the exact unsupported obligation rather than erase unknown fields/digests or change frozen inputs. No full cold ancestor replay.", + "optimistic_complete_bill": "No circuit, paid profile, moment or kappa change. Complete engineering bill: raw source authentication, ten archived local inputs, unchanged final supplier execution, all105 strict outputs, all11 inner logs, explicit timing/root/reference policy, semantic negative controls, and registered replay.", + "method": "Pin exact predecessors and source archives. Before execution authenticate all declared source bytes. Inventory actual archived outputs and links, write a closed explicit comparison policy, and compare complete typed trees after per-side raw-link validation. Use fresh replay plus bounded malformed/semantic/role/coverage controls. Keep every unknown field exact.", + "domain": "Pinned selected1094 final stage, scientific base564148b82ae9df72163f22106f15e73efca8aff2; CPython3.12 standard library. POLICY.json closes the boundary at all105 strict outputs,2 invoice edges normalized after authentication,22 stage-log edges and6 input roles authenticated,22 fresh stage times and11 coupled outer-log times. All other fields, digests and12 copied historical times remain exact. Not arbitrary graph admission or a cross-platform execution claim.", + "outcome": "completed", + "evidence": "RESULT.json: unchanged final supplier freshly executed; complete105-output comparison and13-line outer log pass,30 raw edges authenticated per side,5 constructed positive controls and287 negative controls. POLICY.json retains12 historical timing fields and every unclassified field/digest. README explains the complete proof-relevant boundary and limits. Direct scientific smoke completed in268.58seconds; metadata/pins check and registered optimized-parent replay passed in261.47seconds with another fresh supplier execution. CPython3.12.12/macOS27.0.1arm64. No full ancestor cold replay, cross-platform or hostedCI claim.", + "author": "Adam Gall (@adamgall)", + "ai_assistance": "Substantial OpenAI Codex assistance in scope, implementation, experiments, tests and writing. No independent human review claimed.", + "predecessors": [ + { + "pr": 1824, + "head": "ad5b1248f25a71983b20617e2f3a80be22f03990", + "contribution": "Josie Elliston: source-bound final-stage replay and comparator" + }, + { + "pr": 2040, + "head": "d31c1418c0c23994d1444dbd9d356b9a8238fd5e", + "contribution": "commdata2338: strict typed/path/timing comparison and Linux invoice-format observation" + }, + { + "pr": 2059, + "head": "323703a83640f4c104469bf29db18d7d579cb587", + "contribution": "Adam Gall: authenticate-before-rebind three-node invoice predicate" + } + ], + "freshness": { + "main_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "priority_revision": 4, + "open_prs_checked_at": "2026-10-14T19:00:33Z", + "discussions_checked_at": "2026-10-14T19:02:09Z", + "targeted_heads_checked_at": "2026-10-14T19:04:05Z", + "mode": "Shared complete snapshots:353 open PRs including drafts,738 discussion/comment/reply records. Targeted offline search plus live2040/2059 heads unchanged. Parent canonical refresh changed guidance only; revised guidance read, catalogue/scientific sources/selected record unchanged. Scientific base retained. No absence-based novelty claim." + }, + "open_questions": [ + { + "question": "Can the earlier selected1042 stages receive equally complete portable output comparison?", + "why_it_matters": "The final stage alone does not rebuild its ancestors or make full cold replay portable.", + "first_step": "Choose one earlier source-bound stage and explicitly derive its complete output/reference policy.", + "blocked_by": "Outside this final-stage scope; requires independent predecessor/overlap review and native stage dependencies." + } + ] +} diff --git a/research/selected-final-replay-closure/VERIFY.json b/research/selected-final-replay-closure/VERIFY.json new file mode 100644 index 0000000000..fab256bffe --- /dev/null +++ b/research/selected-final-replay-closure/VERIFY.json @@ -0,0 +1,63 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/community-frontier1042-audit/RESULT.json", + "research/community-frontier1042-audit/selected-replay.tar.gz", + "research/community-frontier1094-audit/ASSEMBLY.json", + "research/community-frontier1094-audit/REPLAY.json", + "research/community-frontier1094-audit/RESULT.json", + "research/community-frontier1094-audit/STAGES.json", + "research/community-frontier1094-audit/selected-replay.tar.gz", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/CANONICAL-WORD.json.gz", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/CLIFFORD-RECIPES.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/CLIFFORD-REVIEW.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/INDEPENDENT-LOCAL-REPLAY.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/INDEPENDENT-REPLAY.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/INTEGRATION.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/LOCAL-CHECKS.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/LOCAL-PROGRAMS.json.gz", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/RESIDUAL-ADAPTERS.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/SCALAR-FRAME-AUDIT.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/split-centres/WRAPPER-CHECKS.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/controller-input/split-centres/CANONICAL-WORD.json.gz", + "research/complex-k492-owner-repair/vendor/multicold/code/run_portable.py", + "research/complex-k492-owner-repair/vendor/multicold/engines/base_two_moment.py", + "research/complex-k492-owner-repair/vendor/multicold/engines/moment.py", + "research/complex-k492-owner-repair/vendor/multicold/engines/outer.py", + "research/complex-k492-owner-repair/vendor/multicold/inputs/PR543-EXPECTED.json", + "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/code/prepare_supplier_base.py", + "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor531/evidence/audit/PREFIX-AND-INVOICE.json", + "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor535/inputs/ROUND20-PARENT-TEMPLATE.json.gz", + "research/complex-t16-rare-pattern-exchanges/CANDIDATE.json", + "research/complex-t16-rare-pattern-exchanges/MANIFEST.json", + "research/complex-t16-rare-pattern-exchanges/MOVES.json", + "research/complex-t16-rare-pattern-exchanges/OWNERS.json.gz", + "research/complex-t16-rare-pattern-exchanges/PRICE.json", + "research/complex-t16-rare-pattern-exchanges/PROFILE.json", + "research/complex-t16-rare-pattern-exchanges/README.md", + "research/complex-t16-rare-pattern-exchanges/SOURCE.json", + "research/complex-t16-rare-pattern-exchanges/VALIDATION.json", + "research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz", + "research/complex-t16-rare-pattern-exchanges/data/PLAN.json", + "research/complex-t16-rare-pattern-exchanges/data/SPEC.json", + "research/complex-t16-rare-pattern-exchanges/upstream1087.tar.gz", + "research/complex-t16-rare-pattern-exchanges/verify.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 600, + "checks": "Authenticate all42 declared source inputs and vendored predicates, execute the unchanged selected final supplier stage with assertions enabled, compare all105 outputs plus complete outer log, and reject bounded coverage/semantic/reference/role/timing controls even under optimized parent Python." + } + ] +} diff --git a/research/selected-final-replay-closure/compare_outputs.py b/research/selected-final-replay-closure/compare_outputs.py new file mode 100755 index 0000000000..e020b39d8a --- /dev/null +++ b/research/selected-final-replay-closure/compare_outputs.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +"""Closed PR1094 final-output caller for the pinned PR2040/PR2059 predicates. + +All 105 output files are compared. Only two authenticated invoice links, six +exact input-path roles, and 22 stage-time fields receive normalization. +Adam Gall, with substantial OpenAI Codex assistance. Apache-2.0. +""" +from decimal import Decimal +import hashlib +import importlib.util +import json +from pathlib import Path + +HERE = Path(__file__).resolve().parent + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def digest(raw): + return hashlib.sha256(raw).hexdigest() + + +def load_vendor(name): + records = json.loads((HERE / 'SOURCES.json').read_bytes())['vendored_sources'] + record = next(row for row in records if row['path'] == 'vendor/' + name + '.py') + path = HERE / record['path'] + require(digest(path.read_bytes()) == record['sha256'], 'vendored source drift: ' + name) + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +strict = load_vendor('strict_compare') +invoice = load_vendor('invoice_compare') +POLICY = json.loads((HERE / 'POLICY.json').read_bytes()) +NAMES = frozenset(POLICY['files']) +STAGES = POLICY['stages'] + + +def read_files(directory): + return {name: path.read_bytes() for name, path in strict.inventory(directory).items()} + + +def prepare(files, context): + """Validate per-side raw edges before any equality or representation quotient. + + context contains logical work/local roots and exactly three actual external + input byte strings. No filesystem path from a receipt is followed. + Other digest fields remain literal, not inferred graph edges. + """ + require(set(files) == NAMES, 'complete 105-file inventory differs') + require(set(context) == {'work', 'local', 'external'}, 'invalid comparison context') + strict.Roots([('work', context['work']), ('local', context['local'])]) + external = context['external'] + require(set(external) == {'local-word', 'local-replay', 'owners'}, 'external role set differs') + stages = strict.read_json(files['STAGES.json']) + replay = strict.read_json(files['REPLAY.json']) + require(type(stages) is list and len(stages) == len(STAGES), 'stage inventory differs') + require(type(replay) is dict and 'stages' in replay, 'missing replay stage binding') + require(strict.tree(stages) == strict.tree(replay['stages']), 'stage receipts disagree') + for name, paths in POLICY['timings'].items(): + strict.validate_timings(stages if name == 'STAGES.json' else replay, paths) + for expected, stage in zip(STAGES, stages): + require(type(stage) is dict and stage.get('name') == expected, 'stage order differs') + require(type(stage.get('exit_code')) is int and stage['exit_code'] == 0, 'stage did not pass') + require(type(stage.get('log_sha256')) is str and + stage['log_sha256'] == digest(files[expected + '.log']), 'stale stage log: ' + expected) + independent = strict.read_json(files['INDEPENDENT-T16.json']) + require(type(independent) is dict and type(independent.get('input_sha256')) is dict, + 'missing independent input roles') + expected_inputs, rebound = {}, {} + for role in POLICY['input_roles']: + path = context[role['root']] + '/' + role['suffix'] + raw = files[role['target']] if 'target' in role else external[role['external']] + expected_inputs[path] = digest(raw) + rebound[role['root'] + ':' + role['suffix']] = digest(raw) + require(len(expected_inputs) == 6 and + strict.tree(independent['input_sha256']) == strict.tree(expected_inputs), + 'stale, missing, or misbound independent input role') + independent['input_sha256'] = rebound + # Reuse the three-node predecessor unchanged; it authenticates both links + # before rebinding and retains the complete invoice and consumer payloads. + replacements = invoice.normalized({name: files[name] for name in invoice.FILES}) + # This receipt's pinned schema is integer/string/Boolean JSON, like the + # invoice domain. Reparse through that domain before its serialization. + independent = invoice.parse(json.dumps(independent).encode('utf-8')) + replacements['INDEPENDENT-T16.json'] = invoice.canonical(independent) + return replacements + + +def compare(reference, candidate, reference_context, candidate_context): + left = prepare(reference, reference_context) + right = prepare(candidate, candidate_context) + result = {} + for name in sorted(NAMES): + result[name] = strict.classify(name, left.get(name, reference[name]), + right.get(name, candidate[name]), + timing_paths=POLICY['timings'].get(name, ())) + return {'equivalent': all(strict.accepted(row) for row in result.values()), + 'files': result, 'checked_files': len(result), + 'authenticated_raw_edges_per_side': 30, + 'normalized_invoice_edges_per_side': 2, + 'relocated_input_roles_per_side': 6, + 'permitted_stage_timing_fields_per_side': 22} + + +def outer_log(raw, files): + """Check all 13 lines and bind all printed times to the same-side receipt.""" + lines = raw.decode('utf-8').splitlines() + require(raw.endswith(b'\n') and len(lines) == 13, 'outer log inventory differs') + stages = strict.read_json(files['STAGES.json']) + for index, name in enumerate(STAGES): + fields = lines[index].split(' ') + require(len(fields) == 3 and fields[:2] == ['PASS', name], 'outer log stage differs') + seconds = Decimal(fields[2]) + require(seconds.is_finite() and seconds >= 0 and seconds == stages[index]['seconds'], + 'outer log timing differs from its receipt') + expected = ['PASS_GAUGE44_T16_STRICT_GLOBAL_REPLAY 0.001672660197076918', + 'PASS_T16_RARE_PATTERN_EXCHANGES 0.001672660197076918'] + require(lines[11:] == expected, 'outer log final result differs') + return [*('PASS ' + name for name in STAGES), *expected] diff --git a/research/selected-final-replay-closure/vendor/invoice_compare.py b/research/selected-final-replay-closure/vendor/invoice_compare.py new file mode 100755 index 0000000000..2b2460f5ca --- /dev/null +++ b/research/selected-final-replay-closure/vendor/invoice_compare.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +"""Compare only PR1094's three-node invoice subgraph, never admit a supplier. + +Authenticate each side's two literal raw invoice references before replacing +those two fields by a complete canonical invoice digest. Every other field is +retained. The accepted JSON domain is the reviewed integer/string/Boolean/null +schema: decimal/exponent numbers, duplicate keys and nonfinite values fail. + +Adam Gall, with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +import hashlib +import json +from pathlib import Path + +INVOICE = "global/audit/PREFIX-AND-INVOICE.json" +CONSUMERS = ("ADMISSION-CONTROLS.json", "ASSEMBLY.json") +FILES = (INVOICE, *CONSUMERS) +REFERENCE_PATH = ("input_sha256", "fresh_invoice") +SCOPE = "PR1094 three-node invoice subgraph only; not mathematical admission" + + +class InvalidGraph(ValueError): + """Malformed JSON, incomplete subgraph, or an unauthenticated raw edge.""" + + +def sha256(raw): + return hashlib.sha256(raw).hexdigest() + + +def _unique_object(pairs): + result = {} + for key, value in pairs: + if key in result: + raise InvalidGraph("duplicate JSON key: " + repr(key)) + result[key] = value + return result + + +def _unsupported_number(value): + raise InvalidGraph("outside reviewed integer JSON domain: " + value) + + +def parse(raw): + """Parse without binary64 rounding or Python Boolean/integer conflation.""" + try: + return json.loads(raw, object_pairs_hook=_unique_object, + parse_float=_unsupported_number, + parse_constant=_unsupported_number) + except (ValueError, UnicodeError) as exc: + raise InvalidGraph(str(exc)) from exc + + +def canonical(value): + """An injective encoding of parsed trees up to object order/string escapes.""" + return json.dumps(value, sort_keys=True, ensure_ascii=True, + separators=(",", ":"), allow_nan=False).encode("ascii") + + +def normalized(files): + """Return complete canonical bytes, after authenticating BOTH raw edges. + + Callers must establish trust in their reference separately. Byte-identical + inputs do not bypass parsing or edge checks. No path, time, generic digest, + or unknown field is masked. Only the named three files are in this API. + """ + if set(files) != set(FILES): + raise InvalidGraph("expected exactly the three declared subgraph files") + values = {name: parse(files[name]) for name in FILES} + if any(type(value) is not dict for value in values.values()): + raise InvalidGraph("each subgraph artifact must be a JSON object") + raw_digest = sha256(files[INVOICE]) + for name in CONSUMERS: + inputs = values[name].get("input_sha256") + if type(inputs) is not dict: + raise InvalidGraph(name + ": missing input_sha256 object") + digest = inputs.get("fresh_invoice") + if type(digest) is not str or digest != raw_digest: + raise InvalidGraph(name + ": stale or misbound fresh_invoice") + invoice = canonical(values[INVOICE]) + content_digest = sha256(invoice) + result = {INVOICE: invoice} + for name in CONSUMERS: + values[name]["input_sha256"]["fresh_invoice"] = content_digest + result[name] = canonical(values[name]) + return result + + +def compare(reference, candidate): + """A fresh parse and edge check on each side, then complete byte equality.""" + left, right = normalized(reference), normalized(candidate) + different = [name for name in FILES if left[name] != right[name]] + return { + "scope": SCOPE, + "equivalent": not different, + "different_files": different, + "authenticated_edges_per_side": len(CONSUMERS), + "reference_invoice_raw_sha256": sha256(reference[INVOICE]), + "candidate_invoice_raw_sha256": sha256(candidate[INVOICE]), + "reference_canonical_sha256": {name: sha256(left[name]) for name in FILES}, + "candidate_canonical_sha256": {name: sha256(right[name]) for name in FILES}, + } + + +def read_graph(directory): + """Read the three documented paths; other directory files are OUT OF SCOPE.""" + return {name: (directory / name).read_bytes() for name in FILES} + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("reference", type=Path, help="trusted strict-output directory") + parser.add_argument("candidate", type=Path, help="candidate strict-output directory") + args = parser.parse_args(argv) + try: + report = compare(read_graph(args.reference), read_graph(args.candidate)) + except (OSError, InvalidGraph) as exc: + print(json.dumps({"scope": SCOPE, "valid_graph": False, "error": str(exc)})) + return 2 + print(json.dumps(report, sort_keys=True, indent=2)) + return 0 if report["equivalent"] else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/research/selected-final-replay-closure/vendor/strict_compare.py b/research/selected-final-replay-closure/vendor/strict_compare.py new file mode 100755 index 0000000000..127f143bb8 --- /dev/null +++ b/research/selected-final-replay-closure/vendor/strict_compare.py @@ -0,0 +1,260 @@ +#!/usr/bin/env python3 +"""Strict, opt-in comparison of generated replay payloads (standard library). + +This does not authenticate a replay or replace immutable source hashes. +Prepared for commdata2338 with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +from decimal import Decimal, InvalidOperation +import gzip +import json +from pathlib import Path, PurePosixPath +import sys +import zlib + + +class InvalidPayload(ValueError): + pass + + +def require(condition, message): + if not condition: + raise InvalidPayload(message) + + +def read_json(raw): + """Reject ambiguous objects; preserve every JSON number exactly.""" + def pairs(items): + result = {} + for key, value in items: + require(key not in result, 'duplicate JSON key: ' + repr(key)) + result[key] = value + return result + + def constant(value): + raise InvalidPayload('nonfinite JSON constant: ' + value) + + return json.loads(raw, object_pairs_hook=pairs, parse_float=Decimal, + parse_constant=constant) + + +class Roots: + """Injective lexical POSIX path map; path tags cannot equal literal text.""" + def __init__(self, pairs=()): + self.pairs = [] + tokens, prefixes = set(), set() + for token, prefix in pairs: + require(type(token) is str and bool(token), 'empty root token') + require(type(prefix) is str and prefix.startswith('/'), + 'root must be an absolute POSIX path') + require(str(PurePosixPath(prefix)) == prefix and + not prefix.startswith('//') and '..' not in prefix.split('/'), + 'root must be lexically canonical') + require(token not in tokens, 'duplicate root token: ' + token) + require(prefix not in prefixes, 'duplicate root prefix: ' + prefix) + tokens.add(token) + prefixes.add(prefix) + self.pairs.append((token, prefix)) + self.tokens = frozenset(tokens) + self.pairs.sort(key=lambda pair: -len(pair[1])) + + def string(self, value): + for token, prefix in self.pairs: + if value == prefix: + return ('path', token, '') + if prefix == '/' and value.startswith('/'): + return ('path', token, value) + if value.startswith(prefix + '/'): + return ('path', token, value[len(prefix):]) + return ('string', value) + + +EMPTY_ROOTS = Roots() + + +def validate_timings(value, paths): + require(type(paths) in (list, tuple), 'timing paths must be an array') + seen = set() + for path in paths: + require(type(path) in (tuple, list), 'timing path must be an array') + require(all(type(p) in (str, int) for p in path), 'invalid timing path component') + path = tuple(path) + require(path not in seen, 'duplicate timing path') + seen.add(path) + node = value + for component in path: + if type(node) is dict and type(component) is str: + require(component in node, 'missing timing field: ' + repr(path)) + elif type(node) is list and type(component) is int: + require(0 <= component < len(node), 'missing timing index: ' + repr(path)) + else: + raise InvalidPayload('timing path has wrong shape: ' + repr(path)) + node = node[component] + require(type(node) in (int, Decimal), 'timing must be numeric, not Boolean/string') + require(node >= 0 and (type(node) is int or node.is_finite()), + 'timing must be finite and nonnegative') + return frozenset(seen) + + +def tree(value, roots=EMPTY_ROOTS, timings=frozenset(), path=()): + """A tagged, lossless tree, except for explicitly declared path/time quotients.""" + if path in timings: + return ('timing',) + if type(value) is dict: + items = [(roots.string(k), tree(v, roots, timings, path + (k,))) + for k, v in value.items()] + require(len({k for k, _ in items}) == len(items), 'relocation key collision') + return ('object', tuple(sorted(items))) + if type(value) is list: + return ('array', tuple(tree(v, roots, timings, path + (i,)) + for i, v in enumerate(value))) + if type(value) is str: + return roots.string(value) + if type(value) is bool: + return ('boolean', value) + if value is None: + return ('null',) + if type(value) is int: + return ('integer', value) + if type(value) is Decimal: + require(value.is_finite(), 'nonfinite decimal') + return ('decimal', value) + raise InvalidPayload('unsupported JSON type: ' + type(value).__name__) + + +def first_difference(a, b, path=()): + """Diagnostic typed path; equality is checked on the entire tagged trees.""" + if a == b: + return None + if a[0] == b[0] == 'object': + left, right = dict(a[1]), dict(b[1]) + for key in sorted(left.keys() | right.keys()): + if key not in left or key not in right: + return {'path': [*path, list(key)], 'kind': 'missing-or-extra-key'} + diff = first_difference(left[key], right[key], (*path, list(key))) + if diff: + return diff + elif a[0] == b[0] == 'array': + if len(a[1]) != len(b[1]): + return {'path': list(path), 'kind': 'array-length'} + for i, (x, y) in enumerate(zip(a[1], b[1])): + diff = first_difference(x, y, (*path, i)) + if diff: + return diff + return {'path': list(path), 'kind': 'value-or-type', + 'reference': repr(a)[:160], 'run': repr(b)[:160]} + + +def classify(name, reference, run, ref_roots=EMPTY_ROOTS, run_roots=EMPTY_ROOTS, + timing_paths=()): + require(ref_roots.tokens == run_roots.tokens, 'root-token sets must agree') + compressed = name.endswith('.gz') + json_name = name[:-3] if compressed else name + try: + a = gzip.decompress(reference) if compressed else reference + b = gzip.decompress(run) if compressed else run + if not json_name.endswith('.json'): + require(not timing_paths, 'timing policy on a non-JSON file') + if reference == run: + return {'cls': 'bytes'} + return {'cls': 'gzip-container' if a == b else 'binary-diff'} + ja, jb = read_json(a), read_json(b) + # Validate even byte-identical inputs: identical malformed JSON is not + # positive evidence, nor is a missing/invalid declared time field. + ta, tb = validate_timings(ja, timing_paths), validate_timings(jb, timing_paths) + # Equal payload bytes with the same path interpretation need no tree + # allocation. Parsing and time validation above still run in full. + if a == b and ref_roots.pairs == run_roots.pairs: + return {'cls': 'bytes' if reference == run else 'gzip-container'} + relocated_a, relocated_b = tree(ja, ref_roots), tree(jb, run_roots) + if relocated_a == relocated_b: + if reference == run: + return {'cls': 'bytes'} + if a == b: + return {'cls': 'gzip-container'} + if not ref_roots.pairs and not run_roots.pairs: + return {'cls': 'json-format'} + if tree(ja) == tree(jb): + return {'cls': 'json-format'} + return {'cls': 'json-relocated'} + timed_a = tree(ja, ref_roots, ta) if ta else relocated_a + timed_b = tree(jb, run_roots, tb) if tb else relocated_b + if timed_a == timed_b: + return {'cls': 'json-diff', 'verdict': 'declared-timing'} + return {'cls': 'json-diff', 'verdict': 'proof-relevant-candidate', + 'first_difference': first_difference(timed_a, timed_b)} + except (ValueError, UnicodeError, OSError, EOFError, zlib.error, InvalidOperation) as exc: + return {'cls': 'invalid', 'reason': str(exc)} + + +def accepted(result): + return result['cls'] in {'bytes', 'gzip-container', 'json-format', 'json-relocated'} or ( + result['cls'] == 'json-diff' and result['verdict'] == 'declared-timing') + + +def inventory(root): + require(root.is_dir(), 'comparison root is not a directory: ' + str(root)) + require(not root.is_symlink(), 'comparison root must not be a symlink') + result = {} + for path in sorted(root.rglob('*')): + require(not path.is_symlink(), 'symlink outside the file-comparison contract') + if path.is_file(): + result[path.relative_to(root).as_posix()] = path + return result + + +def compare(reference, run, ref_roots=EMPTY_ROOTS, run_roots=EMPTY_ROOTS, timings=None): + require(ref_roots.tokens == run_roots.tokens, 'root-token sets must agree') + timings = timings or {} + left, right = inventory(reference), inventory(run) + require(set(timings) <= left.keys() & right.keys(), 'timing policy names absent files') + result = {} + for name in sorted(left.keys() | right.keys()): + if name not in right: + result[name] = {'cls': 'missing'} + elif name not in left: + result[name] = {'cls': 'extra'} + else: + result[name] = classify(name, left[name].read_bytes(), right[name].read_bytes(), + ref_roots, run_roots, timings.get(name, ())) + return result + + +def main(): + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument('reference', type=Path) + parser.add_argument('run', type=Path) + parser.add_argument('--ref-root', action='append', default=[], metavar='TOKEN=/absolute/path') + parser.add_argument('--run-root', action='append', default=[], metavar='TOKEN=/absolute/path') + parser.add_argument('--timings', type=Path, help='JSON object: filename -> exact typed path arrays') + parser.add_argument('--out', type=Path, help='write detailed JSON to a new file') + args = parser.parse_args() + try: + def roots(values): + pairs = [] + for value in values: + token, sep, prefix = value.partition('=') + require(bool(sep), 'expected TOKEN=/absolute/path') + pairs.append((token, prefix)) + return Roots(pairs) + policy = read_json(args.timings.read_bytes()) if args.timings else {} + require(type(policy) is dict, 'timing policy must be an object') + result = compare(args.reference, args.run, roots(args.ref_root), roots(args.run_root), policy) + counts = {} + for value in result.values(): + key = value['cls'] + (':' + value['verdict'] if 'verdict' in value else '') + counts[key] = counts.get(key, 0) + 1 + report = {'equivalent': all(map(accepted, result.values())), 'counts': counts, 'files': result} + if args.out: + with args.out.open('x', encoding='utf-8') as stream: + json.dump(report, stream, indent=2, sort_keys=True) + stream.write('\n') + print(json.dumps({'equivalent': report['equivalent'], 'counts': counts}, sort_keys=True)) + return 0 if report['equivalent'] else 1 + except (ValueError, OSError) as exc: + print('INVALID_COMPARISON: ' + str(exc), file=sys.stderr) + return 2 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/research/selected-final-replay-closure/verify.py b/research/selected-final-replay-closure/verify.py new file mode 100755 index 0000000000..b9d1414698 --- /dev/null +++ b/research/selected-final-replay-closure/verify.py @@ -0,0 +1,338 @@ +#!/usr/bin/env python3 +"""Fresh unchanged final supplier stage plus complete closed-policy comparison. + +This is not the full ancestor cold replay or a multiplication theorem proof. +Adam Gall, with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +from collections import Counter +import gzip +import json +import os +from pathlib import Path, PurePosixPath +import subprocess +import sys +import tarfile +import tempfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +sys.path.insert(0, str(HERE)) +from compare_outputs import (POLICY, STAGES, compare, digest, invoice, outer_log, + prepare, read_files, require, strict) + +A1042 = 'research/community-frontier1042-audit/' +A1094 = 'research/community-frontier1094-audit/' +SUPPLIER = 'research/complex-t16-rare-pattern-exchanges/' +REF_WORK = '/private/tmp/batch1099-selected/candidate' +REF_LOCAL = '/private/tmp/batch1047-selected/slots/local' + + +def authenticate(root=ROOT): + sources = json.loads((HERE / 'SOURCES.json').read_bytes()) + for row in sources['files']: + if row['usage'] == 'input': + path = root / row['path'] + require(path.is_file() and not path.is_symlink() and + digest(path.read_bytes()) == row['sha256'], 'source drift: ' + row['path']) + for row in sources['vendored_sources']: + require(digest((HERE / row['path']).read_bytes()) == row['sha256'], 'vendor drift') + return sum(row['usage'] == 'input' for row in sources['files']) + + +def archive_files(path, prefix=''): + result = {} + with tarfile.open(path) as archive: + for member in archive.getmembers(): + if not member.name.startswith(prefix): + continue + if member.isdir(): + continue + name = member.name[len(prefix):] + p = PurePosixPath(name) + require(member.isfile() and name and not p.is_absolute() and '..' not in p.parts + and p.as_posix() == name and '\\' not in name, 'unsafe archive member') + require(name not in result, 'duplicate archive member') + result[name] = archive.extractfile(member).read() + return result + + +def fixture(): + inputs = archive_files(ROOT / (A1042 + 'selected-replay.tar.gz'), 'slots/local/') + receipt1042 = json.loads((ROOT / (A1042 + 'RESULT.json')).read_bytes()) + bound = {n.removeprefix('slots/local/'): h for n, h in receipt1042['artifacts'].items() + if n.startswith('slots/local/')} + require(len(bound) == 10 and {n: digest(b) for n, b in inputs.items()} == bound, + 'archived local input does not match complete reviewed receipt') + archived = archive_files(ROOT / (A1094 + 'selected-replay.tar.gz')) + for name in ('RESULT.json', 'STAGES.json'): + require(archived[name] == (ROOT / (A1094 + name)).read_bytes(), 'outer archive binding: ' + name) + for name in ('ASSEMBLY.json', 'REPLAY.json'): + require(archived['candidate/strict/' + name] == (ROOT / (A1094 + name)).read_bytes(), + 'selected archive binding: ' + name) + receipt1094 = json.loads(archived['RESULT.json']) + require(receipt1094['baseline_receipt_sha256'] == digest((ROOT / (A1042 + 'RESULT.json')).read_bytes()), + 'selected baseline binding differs') + require(receipt1094['assembly_sha256'] == digest(archived['candidate/strict/ASSEMBLY.json']), + 'selected certificate binding differs') + source_stage = [s for s in receipt1094['stages'] if s['name'] == 'rare-pattern-exchanges'] + require(len(source_stage) == 1 and source_stage[0]['script_sha256'] == + digest((ROOT / (SUPPLIER + 'verify.py')).read_bytes()), 'reviewed stage source differs') + files = {n.removeprefix('candidate/strict/'): b for n, b in archived.items() + if n.startswith('candidate/strict/')} + context = {'work': REF_WORK, 'local': REF_LOCAL, 'external': { + 'local-word': inputs['CANONICAL-WORD.json.gz'], + 'local-replay': inputs['INDEPENDENT-LOCAL-REPLAY.json'], + # The reviewed output archive omits source/. Its literal owner edge is + # authenticated against the separately pinned selected package input. + 'owners': (ROOT / (SUPPLIER + 'data/OWNERS.json.gz')).read_bytes()}} + prepare(files, context) + outer_log(archived['rare-pattern-exchanges.log'], files) + return inputs, files, context, archived['rare-pattern-exchanges.log'] + + +def run_stage(work, inputs): + local = work / 'local' + local.mkdir() + for name, raw in inputs.items(): + (local / name).write_bytes(raw) + output = work / 'run' + log = work / 'stage.log' + env = dict(os.environ, PYTHONDONTWRITEBYTECODE='1', PYTHONUTF8='1') + for key in ('PYTHONOPTIMIZE', 'PYTHONPATH', 'WITNESS_SPEC', 'WITNESS_DISCOVER', 'WITNESS_RECORD'): + env.pop(key, None) + argv = [sys.executable, '-B', str(ROOT / (SUPPLIER + 'verify.py')), + '--main', str(ROOT), '--local', str(local), '--work', str(output)] + with log.open('wb') as stream: + result = subprocess.run(argv, cwd=ROOT, env=env, stdout=stream, stderr=subprocess.STDOUT, + timeout=300) + require(result.returncode == 0, 'final supplier stage failed; log: ' + str(log)) + files = read_files(output / 'strict') + context = {'work': str(output.resolve()), 'local': str(local.resolve()), 'external': { + 'local-word': (local / 'CANONICAL-WORD.json.gz').read_bytes(), + 'local-replay': (local / 'INDEPENDENT-LOCAL-REPLAY.json').read_bytes(), + 'owners': (output / 'source/data/OWNERS.json.gz').read_bytes()}} + return files, context, log.read_bytes() + + +def decode(name, raw): + return json.loads(gzip.decompress(raw) if name.endswith('.gz') else raw) + + +def encode(name, value): + raw = (json.dumps(value, sort_keys=True, indent=1, allow_nan=False) + '\n').encode('utf-8') + return gzip.compress(raw, compresslevel=1, mtime=23) if name.endswith('.gz') else raw + + +def mutate(files, name, operation): + value = decode(name, files[name]) + operation(value) + return dict(files, **{name: encode(name, value)}) + + +def repoint_invoice(files): + result = dict(files) + for name in invoice.CONSUMERS: + result = mutate(result, name, + lambda value: value['input_sha256'].__setitem__('fresh_invoice', digest(result[invoice.INVOICE]))) + return result + + +def controls(reference, context, reference_log): + negative, positive = [], [] + + def rejects(label, candidate, candidate_context=None, against=None): + try: + report = compare(reference if against is None else against, candidate, + context, candidate_context or context) + except (ValueError, TypeError, KeyError, OSError, EOFError): + negative.append(label) + return + require(not report['equivalent'], 'control accepted: ' + label) + negative.append(label) + + def accepts(label, candidate, candidate_context=None): + require(compare(reference, candidate, context, candidate_context or context)['equivalent'], + 'positive rejected: ' + label) + positive.append(label) + + accepts('complete-authenticated-reference', reference) + for name in sorted(reference): + missing = dict(reference) + del missing[name] + rejects('missing:' + name, missing) + rejects('extra-file', dict(reference, **{'UNDECLARED.json': b'{}'})) + + # Full caller executions, one semantic change in EVERY output file. Logs + # have both references repaired, so equality of log contents is exercised. + for name in sorted(reference): + if name.endswith('.log'): + changed = dict(reference, **{name: reference[name] + b'UNDECLARED PROOF OUTPUT\n'}) + for receipt in ('STAGES.json', 'REPLAY.json'): + def repair(value, receipt=receipt): + rows = value if receipt == 'STAGES.json' else value['stages'] + next(row for row in rows if row['name'] + '.log' == name)['log_sha256'] = digest(changed[name]) + changed = mutate(changed, receipt, repair) + else: + def change(value): + if type(value) is dict: + value['unrecognized_proof_claim'] = True + else: + value.append({'unrecognized_proof_claim': True}) + changed = mutate(reference, name, change) + if name == invoice.INVOICE: + changed = repoint_invoice(changed) + rejects('semantic:' + name, changed) + + portable = dict(reference) + portable[invoice.INVOICE] = encode(invoice.INVOICE, decode(invoice.INVOICE, reference[invoice.INVOICE])) + require(portable[invoice.INVOICE] != reference[invoice.INVOICE], 'invoice formatting control is ineffective') + portable = repoint_invoice(portable) + accepts('reformatted-invoice-with-both-raw-links', portable) + for name in invoice.CONSUMERS: + stale = mutate(portable, name, lambda value: value['input_sha256'].__setitem__('fresh_invoice', '0' * 64)) + rejects('stale-invoice:' + name, stale) + rejects('identically-stale-invoice:' + name, stale, against=stale) + + relocated_context = {**context, 'work': '/portable/replay-root', 'local': '/portable/local-root'} + keymap = {context[r['root']] + '/' + r['suffix']: relocated_context[r['root']] + '/' + r['suffix'] + for r in POLICY['input_roles']} + portable = mutate(portable, 'INDEPENDENT-T16.json', + lambda value: value.__setitem__('input_sha256', {keymap[k]: v for k, v in value['input_sha256'].items()})) + for receipt in ('STAGES.json', 'REPLAY.json'): + def change_times(value, receipt=receipt): + rows = value if receipt == 'STAGES.json' else value['stages'] + for index, row in enumerate(rows): + row['seconds'] = 100 + index + portable = mutate(portable, receipt, change_times) + accepts('composed-invoice-six-role-relocation-and-22-times', portable, relocated_context) + portable_log = ('\n'.join(['PASS ' + name + ' ' + str(100 + i) for i, name in enumerate(STAGES)] + + reference_log.decode('utf-8').splitlines()[11:]) + '\n').encode('utf-8') + require(outer_log(portable_log, portable) == outer_log(reference_log, reference), 'outer log normalization differs') + positive.append('complete-outer-log-with-coupled-times') + gz = 'global/hosted/GLOBAL-TEMPLATE.json.gz' + recompressed = dict(reference, **{gz: gzip.compress(gzip.decompress(reference[gz]), compresslevel=1, mtime=51)}) + accepts('generated-gzip-container-change', recompressed) + + for name, paths in POLICY['timings'].items(): + for path in paths: + def omit(value, path=path): + node = value + for component in path[:-1]: + node = node[component] + del node[path[-1]] + rejects('missing-time:' + name + ':' + repr(path), mutate(reference, name, omit)) + for bad, label in [(True, 'boolean'), (-1, 'negative'), ('1', 'string')]: + candidate = dict(reference) + for receipt in ('STAGES.json', 'REPLAY.json'): + def wrong_time(value, receipt=receipt): + (value if receipt == 'STAGES.json' else value['stages'])[0]['seconds'] = bad + candidate = mutate(candidate, receipt, wrong_time) + rejects('invalid-coupled-time:' + label, candidate) + for index, name in enumerate(STAGES): + candidate = dict(reference) + for receipt in ('STAGES.json', 'REPLAY.json'): + def wrong_hash(value, receipt=receipt): + (value if receipt == 'STAGES.json' else value['stages'])[index]['log_sha256'] = '0' * 64 + candidate = mutate(candidate, receipt, wrong_hash) + rejects('stale-coupled-log:' + name, candidate) + independent = decode('INDEPENDENT-T16.json', reference['INDEPENDENT-T16.json']) + for key in independent['input_sha256']: + rejects('stale-input:' + key, mutate(reference, 'INDEPENDENT-T16.json', + lambda value: value['input_sha256'].__setitem__(key, '0' * 64))) + def alias(value): + value['input_sha256']['literal-placeholder:' + key] = value['input_sha256'].pop(key) + rejects('input-role-alias:' + key, mutate(reference, 'INDEPENDENT-T16.json', alias)) + copied_times = [] + for name, raw in reference.items(): + if name.endswith('.json') and name not in POLICY['timings']: + value = decode(name, raw) + if type(value) is dict and 'seconds' in value: + copied_times.append(name) + rejects('copied-historical-time:' + name, mutate(reference, name, + lambda value: value.__setitem__('seconds', value['seconds'] + 1))) + require(len(copied_times) == 12, 'copied timing inventory drift') + for name in ('ASSEMBLY.json', 'global/audit/PREFIX-AND-INVOICE.json'): + bad = b'{"duplicate":1,"duplicate":2,' + reference[name].lstrip()[1:] + candidate = dict(reference, **{name: bad}) + rejects('duplicate-key:' + name, candidate) + rejects('identically-duplicate-key:' + name, candidate, against=candidate) + for raw, label in [(b'NaN', 'nonfinite'), (b'{"schema":true}', 'wrong-shape')]: + rejects('invalid-replay:' + label, dict(reference, **{'REPLAY.json': raw})) + bad = mutate(reference, 'INDEPENDENT-T16.json', lambda value: value.__setitem__('live', True)) + rejects('boolean-is-not-integer', bad) + rejects('truncated-gzip', dict(reference, **{gz: reference[gz][:-8]})) + for raw, label in [(reference_log + b'extra\n', 'extra-line'), + (reference_log.replace(b'PASS restore-parent', b'PASS wrong-stage'), 'stage-name'), + (reference_log.replace(b'2.328', b'2.329', 1), 'uncoupled-time')]: + try: + outer_log(raw, reference) + except ValueError: + negative.append('outer-log:' + label) + else: + raise ValueError('outer log control accepted: ' + label) + # Immutable container hashes are not relaxed like generated outputs. + archive = (ROOT / (A1094 + 'selected-replay.tar.gz')).read_bytes() + changed_header = archive[:4] + bytes([archive[4] ^ 1]) + archive[5:] + require(gzip.decompress(archive) == gzip.decompress(changed_header) and digest(archive) != digest(changed_header), + 'immutable header mutation ineffective') + pinned = next(r for r in json.loads((HERE / 'SOURCES.json').read_bytes())['files'] + if r['path'] == A1094 + 'selected-replay.tar.gz')['sha256'] + require(digest(changed_header) != pinned, 'immutable archive header was accepted') + negative.append('immutable-source-header') + return {'positive_controls': positive, 'negative_controls': negative, + 'negative_count': len(negative), 'positive_count': len(positive), + 'copied_historical_timings_retained': len(copied_times)} + + +def run(work): + source_count = authenticate() + inputs, reference, reference_context, reference_log = fixture() + candidate, candidate_context, candidate_log = run_stage(work, inputs) + comparison = compare(reference, candidate, reference_context, candidate_context) + require(comparison['equivalent'], 'fresh final outputs differ: ' + json.dumps( + {n: row for n, row in comparison['files'].items() if not strict.accepted(row)})) + require(outer_log(candidate_log, candidate) == outer_log(reference_log, reference), 'fresh outer log differs') + classifications = Counter(row['cls'] + (':' + row['verdict'] if 'verdict' in row else '') + for row in comparison['files'].values()) + print('PASS_FRESH_SELECTED_FINAL_STAGE', json.dumps(classifications, sort_keys=True), flush=True) + checked = controls(reference, reference_context, reference_log) + result = {'schema_version': 1, 'status': 'PASS_SELECTED_FINAL_REPLAY_CLOSURE', + 'selected_kappa': '836330098538459/500000000000000000', 'fresh_supplier_stage': True, + 'source_inputs': source_count, 'local_input_files': len(inputs), + 'strict_output_files': len(reference), 'json_outputs': 94, 'inner_logs': len(STAGES), + 'raw_edges_authenticated_per_side': 30, 'invoice_edges_rebound_per_side': 2, + 'input_roles_relocated_per_side': 6, 'stage_timing_fields_normalized_per_side': 22, + 'outer_log_lines_checked': 13, 'outer_times_bound_to_receipt': 11, + 'policy_sha256': digest((HERE / 'POLICY.json').read_bytes()), **checked, + 'scope': 'Unchanged final supplier stage from authenticated archived local inputs; not full cold ancestry, arbitrary graph admission, cross-platform execution, or a new kappa.'} + return result + + +def main(): + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument('--work', type=Path, help='new external work directory; default cleans a temporary directory') + parser.add_argument('--write-result', type=Path, help='write deterministic result to a new file instead of comparing it') + args = parser.parse_args() + if args.work: + work = args.work.resolve() + require(not work.exists() and not work.is_relative_to(ROOT), 'use fresh external work') + work.mkdir(parents=True) + result = run(work) + else: + with tempfile.TemporaryDirectory(prefix='selected-final-closure.') as name: + result = run(Path(name).resolve()) + if args.write_result: + with args.write_result.open('x', encoding='utf-8') as stream: + json.dump(result, stream, indent=2, sort_keys=True) + stream.write('\n') + else: + require(strict.tree(result) == strict.tree(strict.read_json((HERE / 'RESULT.json').read_bytes())), + 'complete deterministic result differs') + print(result['status'], 'files=' + str(result['strict_output_files']), + 'edges=30', 'positives=' + str(result['positive_count']), + 'negatives=' + str(result['negative_count']), 'no_new_kappa') + + +if __name__ == '__main__': + main()