From 1b732744b66cc3461559d52349ae07fa31d444f8 Mon Sep 17 00:00:00 2001 From: josecarlosgonzalezroque-design Date: Wed, 14 Oct 2026 22:53:35 -0600 Subject: [PATCH] Audit Windows path-key rejection in selected PR1094 manifests Reproduce the unchanged entry-point failure, test a two-expression in-memory repair, and reject 391 payload/inventory/source mutations. Frozen sources and the selected frontier remain unchanged. Prepared with substantial OpenAI Codex assistance. --- .../README.md | 131 ++++++++ .../RESULT.json | 197 ++++++++++++ .../SOURCES.json | 108 +++++++ .../TASK.json | 104 +++++++ .../VALIDATION.json | 51 ++++ .../VERIFY.json | 36 +++ .../verify.py | 288 ++++++++++++++++++ 7 files changed, 915 insertions(+) create mode 100644 research/selected1094-windows-manifest-audit/README.md create mode 100644 research/selected1094-windows-manifest-audit/RESULT.json create mode 100644 research/selected1094-windows-manifest-audit/SOURCES.json create mode 100644 research/selected1094-windows-manifest-audit/TASK.json create mode 100644 research/selected1094-windows-manifest-audit/VALIDATION.json create mode 100644 research/selected1094-windows-manifest-audit/VERIFY.json create mode 100644 research/selected1094-windows-manifest-audit/verify.py diff --git a/research/selected1094-windows-manifest-audit/README.md b/research/selected1094-windows-manifest-audit/README.md new file mode 100644 index 0000000000..6342caeea5 --- /dev/null +++ b/research/selected1094-windows-manifest-audit/README.md @@ -0,0 +1,131 @@ +# Selected PR1094: Windows manifest-key admission failure + +**Reproduced portability defect and tested repair candidate. No new kappa.** +The unchanged selected final-stage entry point stops on native Windows before +creating its output directory: `Submission file inventory or hash changed`. +All file bytes match their pins. Its two inventory guards serialize relative +paths with `str(...)`, producing backslashes instead of the manifest's `/`. + +At canonical main `0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2`, +`research/complex-t16-rare-pattern-exchanges/verify.py` has this problem at +lines 9–10 (submission) and 18 (extracted upstream archive). + +| Guard | Pinned payload files | Keys whose spelling changes | Digest mismatches | +| --- | ---: | ---: | ---: | +| Submission | 13 | 3 | 0 | +| Extracted PR1087 archive | 179 | 160 | 0 | + +For example, the unchanged `data/PLAN.json` becomes `data\PLAN.json` on +Windows. The second guard is independently executed on the authenticated +archive: it has the same defect, although the unmodified full entry point +cannot reach it on Windows because the first guard fails. + +## Repair candidate and coverage + +Replace `str(f.relative_to(P))` with `f.relative_to(P).as_posix()`, and make +the corresponding change for `source` in the second guard. The audit applies +these two substitutions **only to separately compiled in-memory guard ASTs**. +It changes neither the selected script nor its manifest, archive or source pins. +This is a reviewable repair candidate, not an installed production repair. + +The test executes the actual pinned assignments/assertions. Filesystem +enumeration and SHA-256 reads are real; the cross-platform models replace only +the string conversion of a relative path. Both original guards accept POSIX +spelling and reject Windows spelling. Both corrected guards accept the +unchanged fixtures. Native guard execution agrees with the host's path model. +On Windows, a child process also runs the unmodified original entry point and +requires the exact first-guard failure before output-directory creation. + +All 192 payloads are then individually changed and individually omitted on +disk while the original manifests remain fixed. Two extra-file and two +same-bytes rename controls also reject. Three additional controls corrupt the +immutable wrapper script, its manifest, or its archive and require source-pin +rejection before code evaluation: **391 rejections total**. Fixtures are +restored and checked again. The frozen assertions are compiled with +`optimize=0`, so the audit's own `-O` run retains their checks. + +For this fixed, authenticated inventory, the repair is a bijective spelling +change: canonical names have no backslashes, colons, absolute prefixes or dot +components; their Windows spellings are distinct. The enumerated files, +exclusion predicates, raw SHA-256 values and exact dictionary-equality +conditions are otherwise identical. This establishes the coverage of these +two guards, not a generic path sanitizer or a mathematical supplier proof. + +## Reproduce + +From a checkout containing the pinned inputs (Python 3.12, standard library): + +```sh +python3.12 -I -O -B research/selected1094-windows-manifest-audit/verify.py +python3.12 scripts/research_package.py --package research/selected1094-windows-manifest-audit --check-only +python3.12 scripts/research_package.py --package research/selected1094-windows-manifest-audit +``` + +Expected marker: + +```text +PASS_SELECTED1094_WINDOWS_MANIFEST_AUDIT guards=2 files=192 controls=391 no_new_kappa +``` + +`RESULT.json` records deterministic evidence, including every affected key. +`SOURCES.json` pins all 14 wrapper-package files and the frozen selected source +manifest; the selected record and catalogue are historical provenance. +The archive's complete member hashes are also checked against its original +manifest and PR1087 source inventory. The direct verifier does not need Git; +the repository metadata checker uses the pinned base commit. + +The optional `--root` accepts a relocated minimal source export. `--report` +writes host-specific observations separately from the deterministic receipt. +`--write` regenerates the receipt only after the same checks have passed. + +## Local evidence and limits + +The investigation ran on native Windows with CPython 3.12.14. The original +PR1824 portability caller failed at the first manifest guard. Separately, +`scripts/research_baseline.py` passed after invoking its path with the Windows +extended-length prefix: that verified all 1,579 selected input files and +retained the selected kappa `836330098538459/500000000000000000`. +The ordinary long workspace path initially caused Python to omit overlong +paths; this environmental setup issue is distinct from the reproduced +separator defect, which also occurs in short temporary directories. + +See `VALIDATION.json` for executed commands and results. The local sandbox +requires a writable temporary directory; the runs set process-local `TEMP` +and `TMP` to a workspace directory, using its extended-length Windows path. +Neither system settings nor repository inputs were changed. + +No complete final-stage, cold ancestry, native mathematical supplier, Linux, +macOS or hosted-CI replay is claimed. Pure-path models are not OS execution. +PR2040/2059/2101 cover payload equivalence and reference binding downstream of +these guards; their results are credited, not repeated or replaced here. + +## Open next questions + +Run a separately versioned successor wrapper with the two POSIX-key changes, +then diagnose its next Windows failure while retaining all assertions and +strict complete-output comparisons. This matters because inventory success +alone is not supplier admission. The first step is to bind the successor to +the original source and record its two-line delta. Full downstream execution +is outside this audit's bounded scope; see the structured question in +`TASK.json`. + +## Credit and overlap + +Rohan Arun supplied PR1094; Jeremy Kothe supplied the frozen PR1087 strict +verifier, with Hao Yan's T16 controller and the retained supplier lineage. +Douglas Colkitt supplied the selected driver and review records. Josie +Elliston's PR1824 posed the Windows replay question. Maxime Fleury and Antoine +Olivier established the payload/container convention. Credit commdata2338's +PR2040 and Adam Gall's PR2059/2101 for later comparator and reference work. + +The one-shot assignment selected verifier engineering, nonce +`effac00be71b189171c4803530783d88`, priority revision 4. `TASK.json` records +the refined card, method choice, predecessor heads and partial overlap +coverage. The local overlap helper lacked authenticated `gh`; supplemental +live PR searches and Discussion reads do not imply a complete-board search. +No advance public claim was posted. + +Prepared for `josecarlosgonzalezroque-design` with substantial OpenAI Codex +assistance in investigation, implementation, testing and writing. Self-reviewed; +no independent human review claimed. New work Apache-2.0. All predecessor +licenses, frozen files and selected-frontier metadata are unchanged. diff --git a/research/selected1094-windows-manifest-audit/RESULT.json b/research/selected1094-windows-manifest-audit/RESULT.json new file mode 100644 index 0000000000..635ee07472 --- /dev/null +++ b/research/selected1094-windows-manifest-audit/RESULT.json @@ -0,0 +1,197 @@ +{ + "status": "PASS_SELECTED1094_WINDOWS_MANIFEST_AUDIT", + "guards": { + "submission": { + "files": 13, + "nested_keys": [ + "data/OWNERS.json.gz", + "data/PLAN.json", + "data/SPEC.json" + ], + "digest_mismatches": 0, + "original_posix_accepts": true, + "original_windows_accepts": false, + "corrected_accepts": true, + "changed_file_rejections": 13, + "omitted_file_rejections": 13, + "extra_file_rejections": 1, + "rename_rejections": 1 + }, + "upstream": { + "files": 179, + "nested_keys": [ + "code/assemble.py", + "code/assembly_controls.py", + "code/audit_allcold.py", + "code/bind_providers_portable.py", + "code/bit_supplier_controls.py", + "code/emit_allcold.py", + "code/freeze_spec.py", + "code/generated_identity.py", + "code/invoice_allcold.py", + "code/prepare_global.py", + "code/restore_parent.py", + "code/witness.py", + "construction/COLD44-RECIPE.json.gz", + "construction/COMPLETION-PRIORITY.json", + "construction/INPUTS.json", + "construction/LICENSE", + "construction/NOTICE.md", + "construction/REBUILD-CHECKS.json", + "construction/UPSTREAM-NOTICE.md", + "construction/barch/LOCAL-PINS-barch-U8.json", + "construction/barch/RECIPE-U8.json", + "construction/barch/build_tri.py", + "construction/barch/reproduce_barch.py", + "construction/barch/run_controls.py", + "construction/build_gauge_cold44.py", + "construction/construct_gauge_xcentre.py", + "construction/frames/FRAME-RECIPE-sw4.json", + "construction/frames/LOCAL-PINS-frames-sw4.json", + "construction/frames/build_frames.py", + "construction/frames/frame_controls.py", + "construction/frames/reproduce_frames.py", + "construction/jx/LOCAL-PINS-jx-X4.json", + "construction/jx/RECIPE-X4.json", + "construction/jx/build_jx.py", + "construction/jx/reproduce_jx.py", + "construction/layers/build_pivot_swap.py", + "construction/layers/layer_end_controls.py", + "construction/layers/reproduce_layers.py", + "construction/layers_np/COLD-LAYERS-RECIPE-NP.json.gz", + "construction/layers_np/HPE-RECIPE-NP.json", + "construction/layers_np/PIVOT-SWAP-NP.json", + "construction/layers_np/reproduce_np.py", + "construction/layers_p6n/COLD-LAYERS-RECIPE-P6N.json.gz", + "construction/layers_p6n/P6N-SPEC.json", + "construction/layers_p6n/layer_end_controls.py", + "construction/layers_p6n/reproduce_p6n.py", + "construction/leaver/CHAIN-PINS-k8.json", + "construction/leaver/CODED-CELLS-k8.json", + "construction/leaver/COLD-LAYERS-RECIPE-NP-k8.json.gz", + "construction/leaver/COLD-LAYERS-RECIPE-P6N-k8.json.gz", + "construction/leaver/FRAME-RECIPE-LV-k8.json", + "construction/leaver/HPE-RECIPE-k8.json", + "construction/leaver/LEAVER-PINS-k8.json", + "construction/leaver/LEC-REASON-PINS-STACK-k8.json", + "construction/leaver/LEC-REASON-PINS-k8.json", + "construction/leaver/PIVOT-SWAP-k8.json", + "construction/leaver/PROMO-RECIPE-k8.json", + "construction/leaver/RECIPE-U8-k8.json", + "construction/leaver/RECIPE-X4-k8.json", + "construction/leaver/REGROUP-LEAVER-k8.json", + "construction/leaver/TRI-LEAVER-k8.json", + "construction/leaver/build_frames_lv.py", + "construction/leaver/cells-k8/CORE-01+.json", + "construction/leaver/cells-k8/CORE-01-.json", + "construction/leaver/cells-k8/CORE-23+.json", + "construction/leaver/cells-k8/CORE-23-.json", + "construction/leaver/cells-k8/CORE-45+.json", + "construction/leaver/cells-k8/CORE-45-.json", + "construction/leaver/cells-k8/CORE-67+.json", + "construction/leaver/cells-k8/CORE-67-.json", + "construction/leaver/cgx_leaver.py", + "construction/leaver/layer_end_controls_leaver.py", + "construction/leaver/reproduce_leaver.py", + "construction/leaver/reproduce_leaver_chain.py", + "construction/notri/PRIO6.json", + "construction/notri/cgx.py", + "construction/notri/cold44x.py", + "construction/notri/port_stage_x.py", + "construction/notri/reproduce_notri.py", + "construction/promo/LOCAL-PINS-p6n-k4.json", + "construction/promo/PROMO-RECIPE-p6n-k4.json", + "construction/promo/build_promotion.py", + "construction/promo/make_recipe.py", + "construction/promo/promo_controls.py", + "construction/promo/reproduce_promo.py", + "construction/reproduce.py", + "construction/slots/RECIPE-SLOTS-k8.json", + "construction/slots/SLOT-PINS-k8.json", + "construction/slots/verify_slots.py", + "construction/sw4/LOCAL-PINS-sw4-P6k4.json", + "construction/sw4/NOTES.md", + "construction/sw4/SW4-RECIPE-P6k4.json", + "construction/sw4/build_sw4.py", + "construction/sw4/reproduce_sw4.py", + "data/FRONTIER.json", + "data/OWNERS.json.gz", + "data/PLAN.json", + "data/PREPARATION.json", + "data/SPEC-T8.json", + "data/SPEC.json", + "data/T8/OWNERS.json.gz", + "data/T8/PLAN.json", + "data/UPSTREAM-PINS.json", + "evidence/ADMISSION-CONTROLS.json", + "evidence/ASSEMBLY.json", + "evidence/BINDING.json", + "evidence/CENTER-COMPATIBILITY.json", + "evidence/LOCAL-STAGES.json", + "evidence/REPLAY.json", + "evidence/STAGES.json", + "evidence/audit/ASYNC-AUDIT.json", + "evidence/audit/GLOBAL-PREFIX.json", + "evidence/audit/IDLE-REMAINDER-FRAMES.json", + "evidence/audit/OWNERS-AND-PROFILE.json", + "evidence/audit/PREFIX-AND-INVOICE.json", + "evidence/global/ACTUAL-SIGMAS.json.gz", + "evidence/global/GLOBAL-TEMPLATE.json.gz", + "evidence/global/HOSTED.json", + "evidence/global/IDLE-REMAINDER-FRAMES.json.gz", + "evidence/layers/LOCAL-AUDIT-LAYERED.json", + "evidence/leaver/CELL-MUTANTS-LV.json", + "evidence/leaver/FRAME-CONTROLS-LV-k8.json", + "evidence/local/CANONICAL-WORD.json.gz", + "evidence/local/CLIFFORD-RECIPES.json", + "evidence/local/CLIFFORD-REVIEW.json", + "evidence/local/FULL-WORD.json.gz", + "evidence/local/INDEPENDENT-LOCAL-REPLAY.json", + "evidence/local/LOCAL-CHECKS.json", + "evidence/local/LOCAL-PROGRAMS.json.gz", + "evidence/local/RESIDUAL-ADAPTERS.json", + "evidence/local/SCALAR-FRAME-AUDIT.json", + "evidence/local/WRAPPER-CHECKS.json", + "hosting/PROOF.md", + "hosting/README.md", + "hosting/audit_frozen.py", + "hosting/expand_owners.py", + "hosting/frozen/FROZEN-AUDIT.json", + "hosting/frozen/MAJORIZATION.json.gz", + "hosting/frozen/MANIFEST.json", + "hosting/frozen/MATCHING-RECEIPT.json", + "hosting/frozen/OWNERS.json.gz", + "hosting/frozen/REPRODUCTION.json", + "hosting/frozen/SEED-OWNERS.json.gz", + "hosting/frozen/SEED-RECEIPT.json", + "hosting/frozen/SEED-REPRODUCTION.json", + "hosting/reproduce.py", + "hosting/reuse_owners.py", + "independent/CENTRE-GUARD-REVIEW.md", + "independent/GAUGE-COLD44-INDEPENDENT-AUDIT.json", + "independent/GAUGE44-GLOBAL-GUARD-REVIEW.json", + "independent/GAUGE44-INDEPENDENT-PRICE.json", + "independent/README.md", + "independent/audit_local.py", + "independent/price_profile.py", + "independent/review_guards.py", + "inputs/PR589-EXPECTED.json", + "t16/NOTICE.md", + "t16/build_parent.py", + "t16/indep16.py", + "t16/lift16.py" + ], + "digest_mismatches": 0, + "original_posix_accepts": true, + "original_windows_accepts": false, + "corrected_accepts": true, + "changed_file_rejections": 179, + "omitted_file_rejections": 179, + "extra_file_rejections": 1, + "rename_rejections": 1 + } + }, + "immutable_source_rejections": 3, + "total_corruption_rejections": 391, + "scope": "Two inventory guards only; no supplier replay or new kappa" +} diff --git a/research/selected1094-windows-manifest-audit/SOURCES.json b/research/selected1094-windows-manifest-audit/SOURCES.json new file mode 100644 index 0000000000..fe5c4516e4 --- /dev/null +++ b/research/selected1094-windows-manifest-audit/SOURCES.json @@ -0,0 +1,108 @@ +{ + "schema_version": 1, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "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-frontier1094-audit/SELECTED-SOURCE.json", + "usage": "input", + "git_blob": "6a75493790b4eff9c4a98051ef8b01d6aad0d5a8", + "sha256": "79b3de5db3dbcb9829789ba58e9e45758926031e2a7d80667a08429d369be53b" + }, + { + "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" + } + ] +} diff --git a/research/selected1094-windows-manifest-audit/TASK.json b/research/selected1094-windows-manifest-audit/TASK.json new file mode 100644 index 0000000000..70444869e7 --- /dev/null +++ b/research/selected1094-windows-manifest-audit/TASK.json @@ -0,0 +1,104 @@ +{ + "schema_version": 1, + "task_id": "portable-replay", + "priority_revision": 4, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "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" + ] + }, + "scope_status": "refined", + "actual_scope": "Reproduce native Windows rejection of the two PR1094 inventory guards, and test an in-memory POSIX-key-only repair against every pinned file without changing frozen sources.", + "scope_change_reason": "Take the explicit Windows open question from PR1824. Choose the card's allowed environment-mismatch method after checking the newer comparator work; this concerns inventory admission before any payload comparison.", + "bottleneck_link": "The selected final-stage replay cannot begin on Windows when a platform-specific relative-path spelling is compared with a POSIX manifest. A source-bound diagnosis and coverage-preserving repair candidate make that barrier reviewable.", + "budget_minutes": 60, + "stop_rule": "Stop after the two wrapper inventory guards and meaningful corruption controls. Do not claim Windows supplier admission, alter pinned files, or start a full cold ancestry replay.", + "outcome": "completed", + "evidence": "Native Windows CPython 3.12.14 entry-point rejection; exact original AST guard execution with POSIX and Windows path serialization; canonical equality for 13 submission and 179 archived files; 391 corruption rejections; deterministic RESULT.json.", + "author": "josecarlosgonzalezroque-design, with substantial OpenAI Codex assistance", + "ai_assistance": "Substantial OpenAI Codex assistance in investigation, implementation, verification and writing. Self-reviewed; no independent human or subagent review claimed.", + "open_questions": [ + { + "question": "After an explicitly versioned successor applies POSIX inventory keys at both guards, what is the next native Windows failure in the unchanged selected stage?", + "why_it_matters": "Passing inventory admission alone does not establish successful construction execution or equivalent proof-relevant outputs.", + "first_step": "Create a successor wrapper with two documented as_posix substitutions and its own manifest, authenticate the original package, then run the final stage with all assertions and strict output comparison enabled.", + "blocked_by": "This bounded audit deliberately stops before the supplier; the selected wrapper and archive are frozen and remain unchanged." + } + ], + "selection": { + "seed": "effac00be71b189171c4803530783d88", + "track": "verifier-engineering", + "scope_key": "91a9a2afec282c926282", + "method_override": "Use the same card's environment-mismatch method for the explicit Windows handoff; no reroll." + }, + "coordination": { + "status": "Completed local verification; preparing a focused PR. No advance public claim was posted.", + "limitation": "The GitHub connector has no Discussion write operation. The local overlap helper had no authenticated gh executable and no remote snapshot. Supplemental live connector searches and public Discussion pages were read; full live pagination was not established.", + "publication": "An authenticated browser session was found after verification and used to create a personal fork for submission." + }, + "overlap": [ + { + "pr": 1824, + "relation": "Josie Elliston's retained cross-Python replay leaves Windows as an explicit open question." + }, + { + "pr": 2040, + "relation": "Strict payload comparator audit; not an inventory-path admission check." + }, + { + "pr": 2059, + "relation": "Invoice-reference authentication; downstream of these guards." + }, + { + "pr": 2101, + "head": "a247ef876e50bf3a7d890c7c1f9b409576674d7d", + "relation": "Full final-stage comparison caller, explicitly no Windows execution; does not repair the frozen entry-point guards." + } + ], + "upstream_checkpoint": { + "commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "priority_revision": 4, + "checked_at_utc": "2026-10-15T04:51:02.595092+00:00", + "guidance_and_selected_inputs_changed": false + }, + "overlap_refresh": { + "queries": [ + "manifest backslash", + "Windows manifest in:title" + ], + "remote_results": 0, + "limit": "Targeted PR search only; no complete Discussion pagination. The local helper still lacks authenticated gh." + } +} diff --git a/research/selected1094-windows-manifest-audit/VALIDATION.json b/research/selected1094-windows-manifest-audit/VALIDATION.json new file mode 100644 index 0000000000..d97db943fb --- /dev/null +++ b/research/selected1094-windows-manifest-audit/VALIDATION.json @@ -0,0 +1,51 @@ +{ + "scope": "Local native Windows inventory-guard audit; not a full supplier replay", + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "python": "3.12.14 (main, Aug 25 2026, 14:01:42) [MSC v.1944 64 bit (AMD64)]", + "platform": "Windows-11-10.0.26300-SP0", + "environment": "Process-local TEMP and TMP point to a writable workspace temporary directory using the Windows extended-length prefix. No system settings changed.", + "commands": [ + { + "command": "python -B scripts/research_baseline.py", + "result": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "note": "Invoked with an extended-length Windows script path; 1579 selected package files matched. The ordinary long path initially missed overlong files." + }, + { + "command": "python -B research/selected-final-stage-portability/verify.py --work FRESH_DIRECTORY", + "result": "EXPECTED_PLATFORM_FAILURE", + "diagnostic": "AssertionError: Submission file inventory or hash changed", + "note": "Unchanged retained caller and stage; before output creation in the stage." + }, + { + "command": "python -B research/selected1094-windows-manifest-audit/verify.py --write --report REPORT.json", + "result": "PASS_SELECTED1094_WINDOWS_MANIFEST_AUDIT", + "controls": 391 + }, + { + "command": "python -B scripts/research_package.py --package research/selected1094-windows-manifest-audit --check-only", + "result": "PASS_PACKAGE_METADATA_AND_PINS" + }, + { + "command": "python -B scripts/research_package.py --package research/selected1094-windows-manifest-audit", + "result": "PASS_REGISTERED_RESEARCH_PACKAGE", + "child_flags": [ + "-I", + "-O", + "-B" + ], + "controls": 391 + } + ], + "metadata_plus_registered_replay_elapsed_seconds": 42.8903374, + "native_entry_point": "unmodified entry point rejects at submission guard before output creation", + "initial_audit_harness_failure": "Sandbox default temporary directory denied child-directory access; process-local writable TEMP/TMP resolved the harness setup. Not a repository or mathematical finding.", + "not_run": [ + "complete final-stage supplier", + "cold ancestry", + "Linux execution", + "macOS execution", + "hosted CI", + "formal mathematical proof" + ], + "assistance": "Substantial OpenAI Codex assistance; self-reviewed only" +} diff --git a/research/selected1094-windows-manifest-audit/VERIFY.json b/research/selected1094-windows-manifest-audit/VERIFY.json new file mode 100644 index 0000000000..603f5a268c --- /dev/null +++ b/research/selected1094-windows-manifest-audit/VERIFY.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/community-frontier1094-audit/SELECTED-SOURCE.json", + "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 all 15 live inputs and selected bindings; execute both original source AST guards with POSIX/Windows/native path spellings; check a key-only repair, 192 changed-file and 192 omission controls, four inventory controls and three immutable-source controls. On Windows reproduce the unmodified entry-point rejection before output creation. Compare the full deterministic receipt. Frozen assertions are explicitly compiled with optimize=0." + } + ] +} diff --git a/research/selected1094-windows-manifest-audit/verify.py b/research/selected1094-windows-manifest-audit/verify.py new file mode 100644 index 0000000000..d65c60ac34 --- /dev/null +++ b/research/selected1094-windows-manifest-audit/verify.py @@ -0,0 +1,288 @@ +#!/usr/bin/env python3 +"""Audit two frozen PR1094 manifest guards; never modify the supplier. + +Prepared for josecarlosgonzalezroque-design with substantial OpenAI Codex +assistance. Apache-2.0. The evaluated guards belong to Rohan Arun's PR1094; +the archived source is Jeremy Kothe's PR1087 with its retained notices. +""" +import argparse +import ast +import copy +import hashlib +import json +import os +from pathlib import Path, PurePosixPath, PureWindowsPath +import platform +import shutil +import subprocess +import sys +import tarfile +import tempfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +PACKAGE = "research/complex-t16-rare-pattern-exchanges" +SELECTED = "research/community-frontier1094-audit/SELECTED-SOURCE.json" +SUBMISSION = "Submission file inventory or hash changed" +ARCHIVE = "Upstream archive mismatch" + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def sha(data): + return hashlib.sha256(data).hexdigest() + + +def canonical_name(name): + path = PurePosixPath(name) + require(name and not path.is_absolute() and ".." not in path.parts + and "\\" not in name and ":" not in name + and path.as_posix() == name, "noncanonical input name: " + name) + + +def authenticate(root): + sources = json.loads((HERE / "SOURCES.json").read_bytes()) + rows = [row for row in sources["files"] if row["usage"] == "input"] + require({row["path"] for row in rows} == { + SELECTED, *[PACKAGE + "/" + name for name in ( + "CANDIDATE.json", "MANIFEST.json", "MOVES.json", "OWNERS.json.gz", + "PRICE.json", "PROFILE.json", "README.md", "SOURCE.json", + "upstream1087.tar.gz", "VALIDATION.json", "verify.py", + "data/OWNERS.json.gz", "data/PLAN.json", "data/SPEC.json")]}, + "audit input inventory changed") + for row in rows: + canonical_name(row["path"]) + require(sha((root / row["path"]).read_bytes()) == row["sha256"], + "immutable input changed: " + row["path"]) + selected = json.loads((root / SELECTED).read_bytes())["files"] + for row in rows: + if row["path"].startswith(PACKAGE + "/"): + require(selected[row["path"]] == row["sha256"], + "input is not the selected source: " + row["path"]) + return rows + + +def guards(source): + """Extract the actual two assertions and the first guard's assignments.""" + body = ast.parse(source).body + + def assignment(name): + matches = [n for n in body if isinstance(n, ast.Assign) + and any(isinstance(t, ast.Name) and t.id == name for t in n.targets)] + require(len(matches) == 1, "source assignment changed: " + name) + return matches[0] + + def assertion(message): + matches = [n for n in body if isinstance(n, ast.Assert) + and isinstance(n.msg, ast.Constant) and n.msg.value == message] + require(len(matches) == 1, "source guard changed: " + message) + return matches[0] + + return { + "submission": (SUBMISSION, [assignment("sha"), assignment("manifest"), + assignment("actual"), assertion(SUBMISSION)]), + "upstream": (ARCHIVE, [assignment("sha"), assertion(ARCHIVE)]), + } + + +class PosixKeys(ast.NodeTransformer): + """Change only str(f.relative_to(...)) into (...).as_posix() in memory.""" + def __init__(self): + self.changed = 0 + + def visit_Call(self, node): + if (isinstance(node.func, ast.Name) and node.func.id == "str" + and len(node.args) == 1 and not node.keywords + and isinstance(node.args[0], ast.Call) + and isinstance(node.args[0].func, ast.Attribute) + and node.args[0].func.attr == "relative_to"): + self.changed += 1 + return ast.copy_location(ast.Call( + func=ast.Attribute(value=node.args[0], attr="as_posix", ctx=ast.Load()), + args=[], keywords=[]), node) + return self.generic_visit(node) + + +def guard_code(nodes, corrected=False): + tree = ast.Module(body=copy.deepcopy(nodes), type_ignores=[]) + if corrected: + transformer = PosixKeys() + tree = transformer.visit(tree) + require(transformer.changed == 1, "expected exactly one path-key change") + # The frozen assertions must execute even when this audit uses -O. + return compile(ast.fix_missing_locations(tree), "", + "exec", optimize=0) + + +def accepts(code, directory, spelling, message): + namespace = {"P": directory, "source": directory, "json": json, + "hashlib": hashlib, + "pins": json.loads((directory / "MANIFEST.json").read_bytes())} + # Only relative-path serialization is modeled; enumeration and file bytes + # remain actual filesystem operations. This is not full OS emulation. + if spelling == "windows": + namespace["str"] = lambda p: str(PureWindowsPath(p.as_posix())) + elif spelling == "posix": + namespace["str"] = lambda p: PurePosixPath(p.as_posix()).as_posix() + try: + exec(code, namespace) + except AssertionError as exc: + require(str(exc) == message, "unexpected guard assertion") + return False + return True + + +def archive_files(path): + files = {} + with tarfile.open(path) as archive: + for member in archive: + canonical_name(member.name) + require(member.isfile() and member.name not in files, + "nonregular or duplicate archive member") + files[member.name] = archive.extractfile(member).read() + return files + + +def exercise(name, nodes, message, files, directory): + for relative, data in files.items(): + canonical_name(relative) + path = directory / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(data) + expected = json.loads(files["MANIFEST.json"]) + for relative in expected: + canonical_name(relative) + actual = {relative: sha(data) for relative, data in files.items() + if relative != "MANIFEST.json"} + require(actual == expected, name + ": actual bytes differ from immutable manifest") + nested = sorted(relative for relative in expected if "/" in relative) + require(nested, "fixture must exercise nested paths") + windows_names = {str(PureWindowsPath(relative)) for relative in expected} + require(len(windows_names) == len(expected), "Windows path alias in fixture") + + original, corrected = guard_code(nodes), guard_code(nodes, corrected=True) + require(accepts(original, directory, "posix", message), "POSIX original rejected") + require(not accepts(original, directory, "windows", message), "Windows original accepted") + require(accepts(original, directory, "native", message) == (os.name != "nt"), + "native result disagrees with the path model") + for spelling in ("posix", "windows", "native"): + require(accepts(corrected, directory, spelling, message), "corrected guard rejected") + + # Each payload is actually changed and omitted on disk, with the original + # manifest untouched. All hashes, names, and inventory equality stay active. + for relative in sorted(expected): + path, old = directory / relative, files[relative] + path.write_bytes(old + b"\x00") + require(not accepts(corrected, directory, "native", message), + "changed bytes accepted: " + relative) + path.unlink() + require(not accepts(corrected, directory, "native", message), + "omitted file accepted: " + relative) + path.write_bytes(old) + extra = directory / "unexpected-audit-file" + extra.write_bytes(b"extra") + require(not accepts(corrected, directory, "native", message), "extra file accepted") + extra.unlink() + old_name = nested[0] + renamed = directory / "renamed-audit-file" + (directory / old_name).unlink() + renamed.write_bytes(files[old_name]) + require(not accepts(corrected, directory, "native", message), "renamed file accepted") + renamed.unlink() + (directory / old_name).write_bytes(files[old_name]) + require(accepts(corrected, directory, "native", message), "restored positive rejected") + return {"files": len(expected), "nested_keys": nested, + "digest_mismatches": 0, "original_posix_accepts": True, + "original_windows_accepts": False, "corrected_accepts": True, + "changed_file_rejections": len(expected), + "omitted_file_rejections": len(expected), "extra_file_rejections": 1, + "rename_rejections": 1} + + +def audit(root, work): + rows = authenticate(root) + package = root / PACKAGE + parsed = guards((package / "verify.py").read_bytes()) + outer = {p.relative_to(package).as_posix(): p.read_bytes() + for p in package.rglob("*") if p.is_file()} + inner = archive_files(package / "upstream1087.tar.gz") + source = json.loads(outer["SOURCE.json"]) + require(sha(inner["MANIFEST.json"]) == source["manifest_sha256"], + "archived manifest differs from PR1087 source pin") + require(json.loads(inner["MANIFEST.json"]) == source["files"], + "archived manifest differs from PR1087 source inventory") + results = {} + for name, files in (("submission", outer), ("upstream", inner)): + message, nodes = parsed[name] + results[name] = exercise(name, nodes, message, files, work / name) + + # Check immutable-source pins before code evaluation; a changed manifest + # or container header must not become a portability waiver. + export = work / "pin-controls" + for row in rows: + dest = export / row["path"] + dest.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(root / row["path"], dest) + for relative in ("verify.py", "MANIFEST.json", "upstream1087.tar.gz"): + path = export / PACKAGE / relative + old = path.read_bytes() + path.write_bytes(old + b"\x00") + try: + authenticate(export) + except ValueError as exc: + require(str(exc) == "immutable input changed: " + PACKAGE + "/" + relative, + "unexpected immutable-source failure") + else: + raise ValueError("corrupt immutable source accepted") + path.write_bytes(old) + authenticate(export) + + native = "not run (non-Windows host); guard models checked" + if os.name == "nt": + env = dict(os.environ, PYTHONDONTWRITEBYTECODE="1") + env.pop("PYTHONOPTIMIZE", None) + output = work / "must-not-be-created" + run = subprocess.run([sys.executable, "-B", str(package / "verify.py"), + "--main", str(root), "--local", str(work / "unused-local"), + "--work", str(output)], capture_output=True, env=env, timeout=30) + require(run.returncode != 0 and ("AssertionError: " + SUBMISSION).encode() in run.stderr, + "native unmodified entry point did not reproduce the first-guard failure") + require(not output.exists(), "failed submission guard reached output creation") + native = "unmodified entry point rejects at submission guard before output creation" + authenticate(root) + result = {"status": "PASS_SELECTED1094_WINDOWS_MANIFEST_AUDIT", "guards": results, + "immutable_source_rejections": 3, + "total_corruption_rejections": sum(2*r["files"] + 2 for r in results.values()) + 3, + "scope": "Two inventory guards only; no supplier replay or new kappa"} + return result, native + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--root", type=Path, default=ROOT) + parser.add_argument("--write", action="store_true", help="write deterministic audit receipt") + parser.add_argument("--report", type=Path, help="write environment-specific execution report") + args = parser.parse_args() + with tempfile.TemporaryDirectory(prefix="pr1094-manifest-") as temporary: + work = Path(temporary).resolve() + require(work.is_relative_to(Path(tempfile.gettempdir()).resolve()), "unexpected temporary root") + result, native = audit(args.root.resolve(), work) + receipt = HERE / "RESULT.json" + if args.write: + receipt.write_text(json.dumps(result, indent=2) + "\n", encoding="utf-8", newline="\n") + else: + require(result == json.loads(receipt.read_bytes()), "audit receipt differs") + if args.report: + args.report.write_text(json.dumps({"python": sys.version, "platform": platform.platform(), + "native_entry_point": native, "result": result}, indent=2) + "\n", + encoding="utf-8", newline="\n") + print(result["status"], "guards=2 files=192 controls=" + str(result["total_corruption_rejections"]), + "no_new_kappa") + print("Native observation:", native) + + +if __name__ == "__main__": + main()