Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
518 changes: 518 additions & 0 deletions research/invoice-realpath-replay/EXPECTED.json

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions research/invoice-realpath-replay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Make the selected invoice audit tolerate temporary-root aliases

The one-line repair in `REPAIR.patch` canonicalizes `work` before PR2158's
extraction containment checks. It fixes a real false rejection of benign
temporary-root aliases while retaining the file-only guard, resolved-member
containment, archive/member pins, and every invoice assertion. The complete
37-mutant replay still matches the original receipt: 31 mutations are rejected
by the invoice, and all six accepted mutations are rejected downstream.

This addresses [PR2158](https://github.com/CrocSwap/integer-mult-bounds/pull/2158)
at `8051d06df24704915fa7a6ec930a2c103a9f66f5`. The maintainer already diagnosed
the path alias and tried `TMPDIR=/private/tmp`; the latest c3c94c2e review records
a batch execution timeout after that workaround. **The diagnosis and workaround
are not claimed as new.** This contribution adds a portable source repair,
rejection regressions and a completed replay of that existing scientific audit.

## Exact cause and fix

Previously `prepare` compared a resolved member path against an unresolved
`src` or `fixture` root. A legitimate path such as `spelling/../work` names the
same directory as `work`, but it is not a lexical prefix of the resolved member.
The same mismatch occurs with macOS `/tmp` versus `/private/tmp`, or a Windows
directory junction. The resulting `unsafe archive member` assertion confuses a
path spelling with a containment failure.

The source fix is exactly:

```diff
def prepare(work):
"""Extract the pinned PR1087 source and the archived selected fixture."""
+ work = work.resolve()
src = work / 'src1087'
```

Both child roots now start in the same canonical coordinate system as every
resolved member. The existing pre-extraction validation still rejects relative
escapes, absolute escapes and non-regular members. The fixture archive retains
the same separate containment check. This is not a general hostile-filesystem
or concurrent symlink-race hardening claim; the existing trusted pinned archive
and private temporary-directory model is unchanged.

`audit.py` is the exact predecessor verifier with that single line inserted.
`verify.py` removes the unique inserted line and checks the reconstructed bytes
against the original source SHA-256 on every replay. `EXPECTED.json` is the
unchanged original receipt. All nine original external inputs are byte-pinned.
No original invoice or selected archive is edited, and no check is bypassed to
obtain the result.

## What is actually checked

The replay first demonstrates that the original function rejects a benign
dot-dot alias, then that the repaired function extracts both actual pinned
archives through the same kind of alias and returns canonical roots. Four bad
source archives exercise relative escape, absolute escape, symlink and directory
members; a separate bad fixture exercises its containment guard.

It then launches the minimally changed audit in an assertion-enabled isolated
Python process. That process executes its original positive control, all 37
mutations and all six downstream admission probes. The wrapper compares every
field and type of the emitted receipt with the unchanged predecessor receipt.
It does not replace the original scientific checks with aggregate counts.

Local validation also uses a real Windows junction for the temporary directory,
separately from the portable dot-dot regression. Execution evidence and its
limits are recorded in `VALIDATION.md`. The archive guard is intentionally not
assertion-disabled: `-O` is rejected because the retained invoice relies on
assertions.

## Reproduce

Python 3.12, standard library only, from the repository root:

```sh
python3 -I -B research/invoice-realpath-replay/verify.py
python3 scripts/research_package.py --package research/invoice-realpath-replay
```

Expected summary:

```text
PASS_INVOICE_REALPATH_REPLAY original_alias_rejected repaired_alias_passed traversal_controls=5 mutants=37 invoice_rejected=31 downstream_rejected=6
```

The repair can also be applied directly to the pinned original package using
`REPAIR.patch`; its original commands and original receipt then remain valid.
The wrapper's default replay writes only into private temporary directories.

## Scope, credit and stopping decision

The selected finite invoice findings belong to Aaron Wang / navinor and the
retained PR1087 invoice lineage, including Jeremy Kothe, Hao Yan, Rohan Arun,
the selected frontier audit and Josie Elliston's mutation-audit handoff. The
original source's attribution is retained verbatim in `audit.py`. Credit the
maintainer's efficient1200 review for the path-alias diagnosis and workaround.
This repair and regression wrapper were prepared by ywz65 with substantial
OpenAI Codex assistance. Apache-2.0; no independent human review is claimed.

The picker on base `6bd33bc0` selected the bit register model; its required
baseline passed, and current finite algebra scopes were already covered or
claimed. TASK.json records the change to this concrete review blocker and its
[canonical claim](https://github.com/CrocSwap/integer-mult-bounds/pull/2158#issuecomment-6198945252).
The contribution stops at the source portability and exact replay obligation.
It is not a new mutation census, invoice theorem, selected-supplier cold replay,
complete multiplication audit, native runtime result or new kappa.

## Open next questions

Can the original PR incorporate the one-line repair and completed replay
evidence? Apply `REPAIR.patch` at the pinned head and rerun its unchanged commands
under a temporary-root alias. Original-author or maintainer integration remains;
no larger mathematical search is needed for this fix.
10 changes: 10 additions & 0 deletions research/invoice-realpath-replay/REPAIR.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/research/invoice-mutant-coverage/verify.py
+++ b/research/invoice-mutant-coverage/verify.py
@@ -73,6 +73,7 @@

def prepare(work):
"""Extract the pinned PR1087 source and the archived selected fixture."""
+ work = work.resolve()
src = work / 'src1087'
src.mkdir()
with tarfile.open(ARCHIVE) as t:
95 changes: 95 additions & 0 deletions research/invoice-realpath-replay/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"schema_version": 1,
"base_commit": "6bd33bc0b87a01e9c9d8b1c01576f3ddbcaee850",
"files": [
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11",
"sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32"
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "889b95d936746df124872133ae1e7cc339adcb92",
"sha256": "7d185cd8c2af35988d638d969748ad7b670f902606444dbfc748e4402c340df6"
},
{
"path": "research/community-frontier1094-audit/selected-replay.tar.gz",
"usage": "input",
"git_blob": "c24daf067f9c543421d89ca2eeaa4eb78a57fb6f",
"sha256": "f1da80610bf33c58527f18ad63b4350d0b864e1d4486141ee17ac9bed4d529d6"
},
{
"path": "research/complex-t16-rare-pattern-exchanges/upstream1087.tar.gz",
"usage": "input",
"git_blob": "2970ef79b0441e937449bed30f68f2e0558186ba",
"sha256": "d4acf04daef85d4514f80ec5fcd2492d0c60e5d6c49fa71b3e6523f8db2dea86"
},
{
"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-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/engines/moment.py",
"usage": "input",
"git_blob": "7d697cb45203fe72d97037403d6da41f71f3b7fd",
"sha256": "81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482"
},
{
"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/outer.py",
"usage": "input",
"git_blob": "43007488ad2c43187c77cc6798beff8b1cd76ad2",
"sha256": "c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c"
}
],
"derived_source": {
"path": "research/invoice-realpath-replay/audit.py",
"source_commit": "8051d06df24704915fa7a6ec930a2c103a9f66f5",
"source_path": "research/invoice-mutant-coverage/verify.py",
"git_blob": "8284e045082bc9ba153b06242e54f008a3bd40b1",
"sha256": "674c04027dc8a6c58a8e6e4044845c45e7457ff7137dcbcdc2b02895c5783f4d",
"repair": "Insert work = work.resolve() as the first prepare operation; removing this unique line reproduces every original byte."
},
"vendored_files": [
{
"path": "research/invoice-realpath-replay/EXPECTED.json",
"usage": "input",
"source_commit": "8051d06df24704915fa7a6ec930a2c103a9f66f5",
"source_path": "research/invoice-mutant-coverage/EXPECTED.json",
"git_blob": "3c7c36dd3c09497ec69463408b50ea665104f7d8",
"sha256": "47b35631d846b44998ae73134a2bdb233314ed5c813cb0fda3afcd53fe51dd29"
}
],
"review_context": {
"commit": "c3c94c2ea2ebcd5d69d1e51b5fe8a36bf79819f5",
"path": "docs/research/community-efficient1200-review.md",
"credit": "Maintainer already diagnosed path alias and tried TMPDIR=/private/tmp; latest disposition is batch execution timeout."
}
}
86 changes: 86 additions & 0 deletions research/invoice-realpath-replay/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"schema_version": 1,
"task_id": "bit-new-register-model",
"priority_revision": 5,
"base_commit": "6bd33bc0b87a01e9c9d8b1c01576f3ddbcaee850",
"original_card": {
"id": "bit-new-register-model",
"question": "Can an explicitly larger or nonabelian register model escape the scoped three-register obstruction?",
"starting_points": [
"docs/research/research-family-status.md",
"research/bit-three-register-lower-bound/README.md",
"certificates/selected-result.json",
"research/bit-gl3-mixed-targets-length10/README.md",
"docs/research/community-efficient1000-review.md"
],
"methods": [
"Construct the smallest exact identity in a newly specified legal operation alphabet.",
"Derive a target-specific relaxation bound for that same explicit alphabet."
],
"acceptance_gate": "Name the changed hypothesis, all counted roles and a uniform identity; finite column tests alone do not certify it. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.",
"first_step": {
"command": [
"python3",
"-B",
"scripts/research_baseline.py"
],
"expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY",
"inspect": "Read Model section 1 of the three-register bound and identify the exact excluded free operations.",
"scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay."
},
"first_experiment": "First compare the alphabet, role count and length with the fully replayed #1974 census and #2027 mixed-root tariff. Identify a changed premise and a legal native implementation; then price one smallest completed instance before searching larger words.",
"bottleneck_link": "A small-width completed saving changes the bit primitive; a finite-address identity alone is insufficient.",
"allowed_variations": [
"Choose a fixed larger register count or a specified nonabelian operation family."
],
"scope_change_triggers": [
"Remaining inside the already-excluded three-register abelian model.",
"Repeating the two-register GL3 census or a covered three-register length without changing a hypothesis; a formal group-algebra word without native conversion is a partial result."
],
"overlap_terms": [
"three-register",
"nonabelian",
"group algebra"
]
},
"scope_status": "changed",
"actual_scope": "Portable extraction-root repair and completed source-bound PR2158 invoice mutation replay.",
"scope_change_reason": "Primary register mechanisms are covered or actively claimed. A precise current reviewer execution blocker remains after a documented platform workaround; this fixes source behavior and finishes that replay without claiming a new diagnosis.",
"bottleneck_link": "Selected finite invoice acceptance audit; closes an execution blocker, not a new supplier or bound.",
"budget_minutes": 60,
"stop_rule": "Stop after one-line source repair, alias/traversal regressions and complete unchanged37-mutant receipt agreement; no broader archive or invoice redesign.",
"outcome": "completed",
"evidence": "audit.py, REPAIR.patch, unchanged EXPECTED.json, verify.py and VALIDATION.md.",
"author": "ywz65",
"ai_assistance": "Substantial OpenAI Codex assistance in diagnosis, implementation, validation and writing.",
"open_questions": [
{
"question": "Can the original PR incorporate the one-line canonical-root repair and the completed replay evidence?",
"why_it_matters": "The maintained review records alias failure then a workaround timeout.",
"first_step": "Apply REPAIR.patch and run the unchanged full37-mutant receipt under a temporary-root alias.",
"blocked_by": "Original-author or maintainer integration; no scientific census expansion required."
}
],
"picker_nonce": "98795ea2eaeadaf92e422932c9e52655",
"canonical_thread": "https://github.com/CrocSwap/integer-mult-bounds/pull/2158#issuecomment-6198945252",
"first_steps": [
"PASS_RESEARCH_BASELINE_BINDINGS_ONLY; read exact three-register excluded free operations and current GL3 coverage."
],
"family_decision": {
"boundary": "Exact PR2158 source and selected fixture; arbitrary benign extraction-root spellings; pins, file-only guards, containment and assertion-enabled invoice semantics unchanged.",
"proved": "Canonical root and member paths use one coordinate system; original source reconstructed byte-for-byte after removing one line.",
"unknown": "No new invoice completeness, supplier or exponent conclusion.",
"consumer": "No input validation or mutant obligation is waived.",
"decision": "Finish the current source portability and replay obligation; stop."
},
"overlap": {
"open_prs": "767 complete records at2026-10-15T18:06:42.717923UTC",
"discussions": "1239 complete cached records at2026-10-15T15:22:22.047084UTC; later changes outside coverage",
"targeted": "PR2158 head8051d06d unchanged; no owner fix; canonical claim updated to credit new maintainer diagnosis/workaround"
},
"upstream_checkpoint": {
"commit": "c3c94c2ea2ebcd5d69d1e51b5fe8a36bf79819f5",
"priority_revision": 5,
"decision": "Retain6bd33 scientific/startbase; unchanged guidance, selected inputs and actual source head; changed review disposition credited."
}
}
38 changes: 38 additions & 0 deletions research/invoice-realpath-replay/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Validation record

Observed locally on Windows with CPython 3.12.14, October 15, 2026:

- The original byte-pinned verifier completed the entire 37-mutant census on
an ordinary canonical temporary root, matching every original receipt field.
- The original `prepare` rejected a benign `spelling/../work` root with
`unsafe archive member`; the repaired function extracted both actual pinned
archives through the same spelling and returned canonical roots.
- A real Windows directory junction reproduced the old rejection. The one-line
repair passed through that junction. This uses an actual filesystem alias,
separately from the portable dot-dot regression; no macOS execution is claimed.
- The registered replay passed with both `TEMP` and `TMP` set to that junction.
It checked the source reconstruction, all five traversal/non-file controls,
all 37 original mutations, the archived positive invoice and six downstream
rejection probes. The emitted complete receipt was compared with type-sensitive
recursive equality against unchanged `EXPECTED.json`.
- A Git-free export containing this package and only its nine declared external
files passed the same complete replay, also using the junction temporary root.
Default replay changed no exported bytes. Mutated external input, original
receipt and reconstructed source were rejected; `-O` and an unknown CLI flag
were rejected. All files matched their initial hashes after restoration.

The maintainer's c3c94c2e checkpoint already contains the macOS alias diagnosis
and `TMPDIR=/private/tmp` workaround. Its updated review reports a batch timeout;
this note credits that diagnosis and records the completed local replay rather
than inferring a mathematical failure from the timeout.

Prepublication overlap used the complete 767-open-PR title/body snapshot at
18:06:42 UTC and the complete cached Discussion snapshot at 15:22:22 UTC.
Later Discussion changes and every code diff are outside that coverage.
Targeted REST checks retained PR2158 head `8051d06d` with no owner repair.
Canonical main `c3c94c2e` has unchanged guidance and selected inputs relative to
the exact starting base `6bd33bc0`.

These are source portability and finite acceptance-boundary checks, not a
new invoice theorem, a general hostile-filesystem proof, independent human
review, hosted CI, selected cold replay or a complete supplier audit.
29 changes: 29 additions & 0 deletions research/invoice-realpath-replay/VERIFY.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"schema_version": 1,
"status": "ready",
"python": "3.12",
"requirements": [],
"inputs": [
"research/community-frontier1094-audit/selected-replay.tar.gz",
"research/complex-t16-rare-pattern-exchanges/upstream1087.tar.gz",
"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-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/engines/moment.py",
"research/complex-k492-owner-repair/vendor/multicold/engines/base_two_moment.py",
"research/complex-k492-owner-repair/vendor/multicold/engines/outer.py"
],
"commands": [
{
"argv": [
"{python}",
"-I",
"-B",
"{package}/verify.py"
],
"timeout_seconds": 600,
"checks": "Actual old/fixed aliased-root behavior, preserved traversal guards, one-line source reconstruction and full unchanged37-mutant receipt."
}
]
}
Loading