Skip to content

FLOOR PART 4: the eight registered hardening items, and runbook § 2.3 - #1115

Merged
brettheap merged 13 commits into
mainfrom
build/floor-part-4-followup-hardening
Sep 18, 2026
Merged

brettheap merged 13 commits into
mainfrom
build/floor-part-4-followup-hardening

Conversation

@brettheap

@brettheap brettheap commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Refs #656 (stays OPEN).

CLAIM: 5728621421

The SECOND and last follow-up on FLOOR PART 4, on Brett's RULING Q-P5 = (a) (#656 comment 5731951297): #1105 landed the runner, #1110 took the four findings its review SUPPRESSED, and this takes the eight remaining registered items plus runbook § 2.3. Registered across #1105's rounds and listed in full in comment 5731868859 (round 10's twelve, minus #1110's four). Nothing is left owed after this.

A plain gate: four files, no openspec/changes/ path, no README OpenSpec Records block, no pin, no gitlink, no manifest. origin/main is MERGED in at e3647b6d (never rebased), which is how #1086's runbook lands under § 2.3.

The eight

1. ls-files -s reads STAGE 0, or names the conflict. During an unresolved merge git lists stages 1, 2 and 3 for a path, so taking the first 160000 row read the MERGE BASE's gitlink — or THEIRS — as the pin this repository records, and then refused or passed against a commit nobody has declared. There is no recorded pin during a conflict; that is a state to name, not to guess through. Tested against a real conflicted index written with update-index --index-info.

2. The two spec mounts join the pin set (and, for a while, the sweep — see the correction below). leg_of() matches the longest VERIFIED pin root containing a module's file, so a module under openDox/spec — which a re_destined: block may lawfully put there — resolved to the openDox ASSEMBLY ROOT, and the verdict named the assembly's commit for a module the assembly does not contain. Measured on #1105 round 6 with a module placed there; the pin set is six mounts now.

CORRECTED at 3ab57af5, on a measurement rather than an argument. IMPORTED_LEGS briefly followed the pin set, and that was over-reach: carved_reach.LEGS installs exactly two roots (openDox/code/src, openXdox/code/src) and module() refuses a row that is not a .py at a code leg, so nothing can be imported out of a spec mount through this reach. Sweeping a tree this run cannot import from can only refuse a run for a state that cannot change its result. The spec mounts stay PINNED and leave the SWEEP; the test asserts the measurement, so it fails if the reach ever grows a spec root.

3. The chain is resolved from the EXACT OUTER COMMIT. Index-first is right for the pin this repository declares — a re-pin must be checkable before it is committed — and wrong one level down. A code gitlink staged inside openDox is in no commit openxFactory has declared, yet the index-first read took it as the recorded pin while openDox's own HEAD still matched, so the level above stayed green. Each nested row is now read out of <the commit its parent verified>:<path>. Two tests: the helper, against a real staged-vs-committed gitlink, and the WIRING — that verify_pins() actually hands each nested row its parent's verified oid.

4. GIT_NO_LAZY_FETCH=1, and the failure it produces named. In a partial clone a read of an absent blob is fetched from the promisor remote, so git archive reaches for the NETWORK in the middle of a measurement — and hangs for as long as that takes, or for ever, inside a runner whose whole contract is to refuse rather than hang. Measured on a --filter=blob:none clone archiving a tag the checkout never materialized (this runner's own case, since opendox-carve-0 is far behind any working tree):

$ GIT_NO_LAZY_FETCH=1 git archive --format=tar carve-0 -- scripts
warning: lazy fetching disabled; some objects may not be available
fatal: could not fetch d943254485e0… from promisor remote      → rc 128
$ git archive --format=tar carve-0 -- scripts                   → rc 0, after a silent fetch

New code equivalence-object-store-incomplete, because the remedy is a deliberate git fetch origin <commit> and the old message told that operator their tree carried no renderer — sending them to replace a good --pre-ref.

And the other half, after Copilot's round on this PR (d6244aa4): classifying the store left the FALLBACK worded for it, and what now landed there was the opposite condition — git archive fails before writing anything when no path matches, so a tree carrying neither archive path never reached the per-row post-shed check below and was told to fetch objects instead of to name a pre-shed ref. A pathspec failure is classified as the POST-SHED REF it is; what is left is UNDIAGNOSED and says so, carrying its stderr and both remedies as possibilities rather than one as a verdict. Both new tests assert the DETAIL and not only the code, which is how the first one passed on the wrong message.

5. The cleanliness sweep in its working form. git diff --name-only HEAD -- src, ls-files --others --exclude-standard, and an ls-files -v scan for assume-unchanged / skip-worktree. Those flags make git report an EDITED file as clean, so a leg carrying one could be edited with status --porcelain — the first spelling — answering nothing at all; the test proves exactly that, with status returning empty while the sweep reports the file. --ignored, the originally proposed remedy, stays REJECTED on the measurement that killed it: it reports this runner's own __pycache__ (3 and 4 entries) and would refuse on every run after the first. _clean_advice() grows the third remediation, because checkout -- . cannot clear a flag bit.

6. A non-importing materialization probe, BEFORE post_stack(). Composing the stack installs a meta-path finder, mutates the import system for the rest of the process, and writes __pycache__ INTO the leg whose cleanliness the next check asserts. Doing all that to discover that a submodule directory is empty — and then saying so in terms of a module name — is work with side effects performed to reach a worse message. Three shapes are named: absent, empty (recorded and never initialized), and no .git (a copied source tree). The ORDER is tested, not just the function.

7. The superproject's revision and dirt in the evidence, never a refusal. The post side is composed out of ROOT's carved_reach.py, opendox_host.py and the § 4.4 profile — none of them pinned by the gitlinks the verdict names — so two runs can differ by them alone while every pinned leg matches. It is reported and not refused on, and the asymmetry is the point: this is the tree the runner is EDITED in, and a gate that refused on its dirt would be unusable by the only people who change it.

8. The PRE child's inputs travel by NAME, not by position — SonarCloud's last pythonsecurity:S8705 on this file. The program goes to -c, so everything after it is sys.argv[1:], and a mis-ordered or empty element silently shifts the unpack: the corpus becoming the output path. Environment entries are read by name, and a missing one raises KeyError in the child rather than rendering something else.

Runbook § 2.3, and the README index

§ 2.3 FLOOR PART 4 — the snapshot-equivalence run, written where the other floor parts are documented (§ 2.1 the arrival verifier, § 2.2 the conformance runner), and held until #1086 landed because until then the § 2 family was contended. It carries the claim, both sides and why each is composed as it is, the pinned anchor, the command with its expected verdict, the four corpus states of which two must move the digest, what is verified before any digest exists, and what the run does NOT prove.

§ 2.3 IS NOT § 5.5, and the section says so: the box FLOOR PART 4 ticks is § 5.5 of split-opendox-two-layer-product's tasks.md, while this runbook's own § 5.5 is the two commits a leg arrives in. § 2 is otherwise untouched — the runbook diff is one hunk at line 849 with zero deletions, so every paragraph of § 2, its disposition table and the two-paragraph disposition block above it are byte-identical.

The README doc index gains the runner beside scripts/carve_conformance.py, in that entry's form and for its reason: the index lists what proves each floor part, and FLOOR PART 4's prover was missing from it.

Verification

  • The verdict is unchanged, which is what a hardening pass must not move: OK — 1 of 1 corpus state(s) equivalent, exit 0, 14,849 bytes, sha256 764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735.
  • pytest -q tests/snapshot_equivalence → 94 passed, 0 skipped (60 at 02967478 + FLOOR PART 4 follow-up: the four suppressed findings #1105 landed without #1110, plus thirty-four here). EXPECT_SKIPPED: "6" untouched; MIN_SELECTED / MIN_PASSED are floors.
  • Mutation sweeps over the new code: 39 mutants, 39 caught, 0 survived — sixteen over the eight — every stage read as the pin; the conflict unnamed; the spec mounts out of the pin set; out of the sweep; the nested rows back on the nested index; lazy fetching allowed; the partial clone diagnosed as a bad tree; the flag scan dropped; --exclude-standard dropped; the untracked half dropped; the probe skipped; an empty leg read as materialized; the unpinned half dropped from the evidence; an unreadable root status read as clean; the child's inputs back in argv; and the child reading a positional tuple again; then two over the round-1 fix — the pathspec failure left unclassified, and the fallback claiming the object store again — and four over round 2's.

Copilot round 2 (c7ed6828) — the class closes at its cap

One threaded finding and two suppressed, all three FACT, all three measured before they were taken (thread, the suppressed pair).

  1. An ignored .py under src is still importable. --exclude-standard was bought for one measured problem — this runner's own __pycache__ — and paid for it by dropping the whole class, so a leg could render bytes in no commit while the verdict named one. The ignored files under the import surface are scanned now, with an allowlist of exactly CPython's bytecode: measured, the two code legs carry 45 and 21 such files and every one is a .pyc.
  2. The no-network guarantee did not cover the whole measurement. The post side reads through carved_reach._git_run(), a SHARED reader whose sanitizer builds from os.environ minus a scrub list that does not carry this name — so the guard is set on THE PROCESS before the reach is imported, and "GIT_NO_LAZY_FETCH" in _sanitized_git_environment() goes False → True across it.
  3. Clearing a hidden flag reveals the edit rather than removing it, so the remediation stopping at update-index promised a clean re-run that would refuse again. The restore is named with it.

SonarCloud went red, and it was right to (e77726ac)

The quality gate failed on new_reliability_rating 3 against a threshold of 1, and the issue behind it was python:S5850 on _GENERATED_BYTECODE — the unparenthesised top-level | meant \.pyc$ allowlisted a .pyc ANYWHERE under the import surface, and a sourceless src/shadow.pyc is an ordinary import candidate. Copilot found the same hole from the other end in the same hour. The pattern is one anchored shape now, with a test that src/shadow.pyc is dirt and __pycache__/m.cpython-312.pyc is not. Also in that commit: git archive fails on ANY absent pathspec, so the refusal now asks ls-tree WHICH path the tree lacks instead of asserting it carries neither; and the maintainability findings on the same analysis — two S3776 complexity splits, an S1192 constant, an S3358 lift, three S9073 assertion splits and two S8997 monkeypatch conversions — are cleared rather than suppressed.

The last round (c26083ee), and what is registered rather than taken

Two suppressed findings, both INCONSISTENCIES IN CODE THIS PR INTRODUCED: _flagged() scanned the whole leg while its two sibling reads were scoped to src, which would have made a required gate refuse for a bit on a file that cannot reach the imports — a false refusal; and the superproject evidence read a plain git status, carrying the exact blind spot this act fixes one layer down, so a flag-hidden edit to carved_reach.py would have printed working tree clean. Both fixed. The second test's first spelling survived its own mutant (it asserted dirty while the ambient checkout was already dirty) and now forces the status read clean, which is the only way the flag can be what makes the difference.

Registered, not taken (thread): an allowlisted __pycache__/*.pyc is trusted by PATHNAME, so a crafted cache whose header matches the tracked source is executed before the sweep runs. True, and the remedy is sys.pycache_prefix set before the legs are imported — which would also stop this runner writing into the legs at all and retire the allowlist. It is a process-wide behaviour change that deserves its own act rather than the last commit of this one, and the exposure needs a writer in the checkout, who could equally edit carved_reach.py, which no pin covers.

  • doc-health over the tree names neither docs/opendox-cutover-runbook.md nor README.md (nor the runner): the standing findings are the repository's own and this act adds none.

Rounds 6-9, and where the line was drawn

Copilot reviewed at every head and kept finding real defects — in code this act wrote. The rule I held: a defect this act INTRODUCED gets fixed however late; a finding about ground this act did not break is answered and registered.

  • ce976cbe — rev-parse <commit>:<path> returns an oid for ANY tree entry, so a parent commit with a file or directory at code had it read AS THE NESTED PIN; mode 160000 is required now, through one ls-tree that answers presence, mode and id together. Plus three texts this act made stale: any(leg.iterdir()) counted .git (a metadata-only mount read as materialized), the dirt refusal still named git status --porcelain after that read became three, and the comment above the probe still said post_stack() comes first — the opposite of the implemented order.
  • 3ab57af5 — mostly a SUBTRACTION (the spec-mount correction above), plus the HEAD read made mode-aware like its sibling and every nonzero index stage treated as a conflict whatever its mode.
  • 630af798 — a REGRESSION 3ab57af5 introduced, undone: making the HEAD read mode-aware also made it RAISE, and HEAD was read BEFORE the index, so an unreadable HEAD tree could reject a VALID staged pin — which is precisely what index-first exists to prevent.
  • b959a071 — the untracked read took no scope while its two siblings did (a false refusal for an untracked docs/NOTE.md), and the tracked remedy offered checkout -- . for a diff taken against HEAD, which leaves a STAGED edit exactly where it is.

Registered against the successor act, not taken here: the tampered-__pycache__ exposure — an allowlisted __pycache__/*.pyc is trusted by PATHNAME, and CPython executes a crafted cache whose header still matches the source. The remedy is sys.pycache_prefix set before the legs are imported, which would also stop this runner writing into the legs and RETIRE the allowlist that produced three findings. It is a process-wide behaviour change and belongs to an act that is about it.

Summary by Sourcery

Harden snapshot-equivalence verification and document its FLOOR PART 4 operating procedure.

New Features:

  • Add snapshot-equivalence runner coverage for the pre-split and post-split rendering paths, including the full set of pinned mounts and evidence for the superproject state.

Bug Fixes:

  • Harden pin verification against conflicted indexes, staged nested gitlinks, non-gitlink entries, incomplete object stores, lazy fetching, dirty or flag-hidden import trees, and unmaterialized mounts.
  • Improve archive failure classification so partial object stores, post-shed references, and undiagnosed failures receive distinct refusal messages and remedies.
  • Ensure ignored importable files, hidden index flags, scoped cleanliness checks, and child-process inputs cannot produce false passes or refusals.

Enhancements:

  • Verify nested pins from the exact parent commit and probe materialization before composing the post-split stack.

Documentation:

  • Document FLOOR PART 4 snapshot equivalence in runbook § 2.3 and add the runner to the README documentation index.

Tests:

  • Expand snapshot-equivalence tests to cover pin-chain resolution, conflict handling, archive diagnostics, cleanliness and materialization probes, network guards, evidence reporting, and child-process argument handling.

🤖 Generated with Claude Code

brettheap and others added 3 commits September 18, 2026 17:33
…each

The rest of the list owed to this successor act (#1105 comment 5730120150
and round 10's full twelve; #1110 took the four suppressed ones), under
Brett's RULED Q-P5 = (a), `#656` comment 5731951297. A plain gate: two
files, no change packet, no pin, no gitlink, no manifest.

1. `ls-files -s` STAGE 0 ONLY. During an unresolved merge git lists stages
   1, 2 and 3, so reading the first `160000` row took the MERGE BASE's
   gitlink as the pin this repository records. A conflicted index has no
   recorded pin; it is now named as that state instead of guessed through.
2. THE TWO SPEC MOUNTS JOIN THE PIN SET and the cleanliness sweep.
   `leg_of()` matches the longest verified pin root containing a module's
   file, so a module under `openDox/spec` — which a `re_destined:` block may
   lawfully put there — resolved to the openDox ASSEMBLY ROOT and the
   verdict named the assembly's commit for a module the assembly does not
   contain (measured on #1105 round 6).
3. THE CHAIN IS RESOLVED FROM THE EXACT OUTER COMMIT. The index-first rule
   is right for the pin this repository declares and wrong one level down: a
   gitlink staged inside `openDox` is in no commit openxFactory has
   declared, yet it was read as the recorded pin while openDox's own HEAD
   still matched, so the level above stayed green.
4. `GIT_NO_LAZY_FETCH=1`, and the failure it produces NAMED. In a partial
   clone a read of an absent blob fetches from the promisor remote, so the
   archive hangs for as long as the network takes inside a runner whose
   contract is to refuse rather than hang. Measured on a `--filter=blob:none`
   clone archiving a tag the checkout never materialized: rc 128 `fatal:
   could not fetch <oid> from promisor remote` with it, rc 0 after a silent
   fetch without it. New code `equivalence-object-store-incomplete`, because
   the remedy is a deliberate `git fetch origin <commit>` and the old message
   sent that operator to replace a good `--pre-ref`.
5. THE CLEANLINESS SWEEP IN ITS WORKING FORM: `git diff --name-only HEAD --
   src`, `ls-files --others --exclude-standard`, and an `ls-files -v` scan
   for `assume-unchanged` / `skip-worktree` — flags that make git report an
   EDITED file as clean, which `status --porcelain` alone could not see.
   `--ignored`, the proposed remedy, stays rejected on the measurement: it
   reports this runner's own `__pycache__` and would refuse on every run
   after the first.
6. A NON-IMPORTING MATERIALIZATION PROBE BEFORE `post_stack()`. Composing
   the stack installs a meta-path finder, mutates the import system for the
   rest of the process and writes `__pycache__` INTO the leg whose
   cleanliness the next check asserts — all to discover that a submodule
   directory is empty, and then to say so in terms of a module name.
7. THE SUPERPROJECT'S REVISION AND DIRT IN THE EVIDENCE, never a refusal:
   the post side is composed out of ROOT's `carved_reach.py`,
   `opendox_host.py` and the § 4.4 profile, none of them pinned by the
   gitlinks the verdict names, and this is the tree the runner is edited in.
8. THE PRE CHILD'S INPUTS TRAVEL BY NAME, NOT BY POSITION — SonarCloud's
   last `pythonsecurity:S8705` on this file. argv is the one channel where
   position decides meaning, and a shifted unpack would make the corpus the
   output path.

Eighteen tests, at least one per item and a control beside the sharp ones:
a real conflicted index written with `update-index --index-info`, a real
staged-vs-committed gitlink, a real `--filter=blob:none` clone refusing by
name, a real `assume-unchanged` edit that `status` calls clean, and the
probe proven to run before the stack is composed. 78 passed, 0 skipped;
`EXPECT_SKIPPED` untouched. The verdict is unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735, exit 0.
Mutation sweep over the eight: 16 mutants, 16 caught, 0 survived.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The operator's section for the runner #1105 landed, written where the other
three floor parts are documented — § 2.1 the arrival verifier, § 2.2 the
conformance runner, and now § 2.3 — and held until #1086 landed, because
until then the § 2 family was contended.

What it says, and only what is measured: the claim (design § D6 (4), RULED
OQ-1 — the same corpus through both sides must render the SAME SNAPSHOT,
which §§ 2.1–2.2 cannot notice because they measure files and interfaces);
the two sides and why each is composed as it is (the archived tag in a child
interpreter, and why an archive rather than a worktree; the pinned stack in
THIS process, and why the § 4.4 profile must be registered for it); the
pinned anchor, without which the two sides diverge on it alone; the command
with its expected verdict; the four corpus states, two of which must move
the digest, which is how the run is known to have teeth; what is verified
before any digest exists; and the superproject's own unpinned revision,
which the evidence now carries.

§ 2.3 IS NOT § 5.5, and the section says so. The box FLOOR PART 4 ticks is
§ 5.5 of `split-opendox-two-layer-product`'s `tasks.md`; this runbook's own
§ 5.5 is the two commits a leg arrives in. The two have been confused once
already, which is why the disambiguation is in the text rather than in a
reviewer's memory.

The README doc index gains the runner beside `scripts/carve_conformance.py`,
in that entry's form and for its reason: the index lists what proves each
floor part, and FLOOR PART 4's prover was missing from it.

§ 2's own disposition block is untouched — two paragraphs before this commit
and two after. doc-health over the tree names neither file.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 18, 2026 17:39
@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

Hardens the snapshot-equivalence runner across all eight registered findings: pin and nested-gitlink verification now follows declared commits and handles conflicts/spec mounts, extraction refuses incomplete object stores without lazy network access, cleanliness and materialization checks are side-effect-aware, evidence includes unpinned superproject state, and child inputs are name-bound. The PR also adds the complete FLOOR PART 4 runbook § 2.3 and README index entry, with extensive regression coverage.

Sequence diagram for snapshot-equivalence verification

sequenceDiagram
    participant Runner
    participant Root as Superproject
    participant Git
    participant Legs as Pinned legs
    participant Pre as PRE child
    participant Post as POST stack

    Runner->>Root: unmaterialized_legs()
    Runner->>Root: post_stack()
    Runner->>Git: verify_pins()
    Git-->>Runner: stage-0 pins and declared commits
    Runner->>Git: git archive pre_ref
    Git-->>Runner: archived PRE tree
    Runner->>Pre: _run_pre_child(corpus, source_revision)
    Pre-->>Runner: PRE snapshot
    Runner->>Post: render(corpus)
    Post-->>Runner: POST snapshot
    Runner->>Root: superproject_state()
    Root-->>Runner: revision and dirt evidence
    Runner->>Runner: compare snapshots
Loading

File-Level Changes

Change Details Files
Harden snapshot-equivalence pin resolution across conflicts, nested commits, and newly supported mounts.
  • Reject conflicted gitlink indexes unless a stage-0 entry exists.
  • Resolve nested gitlinks from the exact verified parent commit while retaining index-first behavior for superproject pins.
  • Add openDox/spec and openXdox/spec to pin verification, module ownership, and cleanliness checks.
scripts/verify-snapshot-equivalence.py
tests/snapshot_equivalence/test_snapshot_equivalence.py
Make pre-split extraction deterministic and diagnose incomplete object stores without network side effects.
  • Disable Git lazy fetching and classify missing-object archive failures as equivalence-object-store-incomplete with deliberate fetch guidance.
  • Keep unmatched pathspec failures on the generic pre-tree refusal path.
  • Pass isolated child-render inputs through named environment variables instead of positional arguments.
scripts/verify-snapshot-equivalence.py
tests/snapshot_equivalence/test_snapshot_equivalence.py
Strengthen working-tree validation and execution ordering for imported legs.
  • Sweep tracked import-surface edits, non-ignored untracked files, and assume-unchanged/skip-worktree flags.
  • Probe absent, empty, and copied mounts before composing the post stack.
  • Report the superproject revision and cleanliness as evidence without refusing on root dirt, while preserving refusal behavior for unreadable state.
scripts/verify-snapshot-equivalence.py
tests/snapshot_equivalence/test_snapshot_equivalence.py
Document and index the FLOOR PART 4 snapshot-equivalence run.
  • Add runbook § 2.3 describing PRE/POST composition, pinned inputs, corpus mutations, refusal contract, evidence, and non-claims.
  • Add the snapshot-equivalence runner to the README documentation index.
docs/opendox-cutover-runbook.md
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Pathspec archive failures still receive the object-store diagnosis and remediation.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Hardens the snapshot-equivalence runner and documents FLOOR PART 4.

Changes:

  • Adds six-mount pin, cleanliness, materialization, and partial-clone checks.
  • Makes child inputs environment-named and records superproject evidence.
  • Expands tests and documents the runner in README and the cutover runbook.
File summaries
File Description
scripts/verify-snapshot-equivalence.py Adds runner hardening and evidence reporting
tests/snapshot_equivalence/test_snapshot_equivalence.py Adds focused regression coverage
README.md Adds the runner to the documentation index
docs/opendox-cutover-runbook.md Documents FLOOR PART 4
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/verify-snapshot-equivalence.py Resolved
…d as one

Copilot on #1115, and FACT. Classifying the object store left the FALLBACK
still worded for it — "this is the OBJECT STORE", "fetch the missing objects
before changing --pre-ref" — and what now falls into that fallback is
precisely the opposite condition: `git archive` fails before writing
anything when NO path matches, so a tree that carries neither archive path
never reaches the per-row post-shed check below and was told to fetch
objects instead of to name a pre-shed ref. The regression test asserted the
CODE and not the detail, so it passed on the wrong message.

Both halves are classified now. A pathspec failure refuses as the post-shed
ref it is, naming `opendox-carve-0` and saying outright that the objects are
not the problem — the ref resolved and git read its tree well enough to know
those paths are not in it. What is left is UNDIAGNOSED and says so: a
permission error, a full disk, a git that broke in a way this file has not
met, gets its stderr and both remedies as POSSIBILITIES, because a confident
wrong diagnosis is what the two classified branches exist to stop.

Two tests, both asserting the DETAIL and not only the code: the pathspec
case must not say OBJECT STORE or offer a fetch, and the unclassified case
must claim neither diagnosis. 79 passed, 0 skipped. Verdict unchanged —
14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Mutation
sweep over the two branches: 2 mutants, 2 caught, 0 survived.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 18:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Post-side Git reads can still lazy-fetch, ignored imported files can evade the cleanliness sweep, and hidden-flag remediation does not fully clean edited files.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

scripts/verify-snapshot-equivalence.py:408

  • GIT_NO_LAZY_FETCH=1 is only placed in the environment returned to this file's _git() calls. The post side invokes carved_reach._git_run() from post_stack(), whose sanitizer rebuilds its own environment and does not set this variable (scripts/carved_reach.py:809-820), so resolving manifest/tree entries in a partial clone can still lazy-fetch or wait on the promisor remote. Propagate the guard to that shared reader (or set it for the process before post_stack()) so the no-network guarantee covers the whole measurement.
    scripts/verify-snapshot-equivalence.py:1284
  • The hidden-flag remediation only clears the index bits; it does not restore, stash, or commit the edited file. For the exact h! path case this function reports, clearing the flags makes the same edit appear as M path, so the promised re-run still fails and the operator gets a second refusal. Include a follow-up commit/stash/checkout action for these paths.
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify-snapshot-equivalence.py Resolved
…d is not clean

Copilot round 2 on #1115 — one threaded finding and two suppressed, all
three FACT, all three measured before they were taken. This closes the
class at its two-round cap.

1. AN IGNORED `.py` UNDER `src` IS STILL IMPORTABLE. `--exclude-standard`
   drops every ignored path, not only the `__pycache__` this runner makes,
   so a leg could render bytes that are in no commit while the verdict named
   one — the exact failure the sweep exists to prevent, arriving through the
   one door the sweep had propped open. The ignored files under the IMPORT
   SURFACE are scanned now, with an allowlist of exactly CPython's compiled
   bytecode. Measured: the two code legs carry 45 and 21 ignored files under
   `src` and every one of them is a `.pyc`, so the allowlist reports nothing
   today and anything else would.

2. THE NO-NETWORK GUARANTEE DID NOT COVER THE WHOLE MEASUREMENT. This file's
   `_git()` set `GIT_NO_LAZY_FETCH=1` in its own environment, but the post
   side reads through `carved_reach._git_run()`, a SHARED reader with its
   own sanitizer. Measured: that sanitizer builds from `os.environ` minus a
   scrub list (`carved_reach.py:796-806`) which does not carry this name, so
   setting it on THE PROCESS before the reach is imported covers it —
   `"GIT_NO_LAZY_FETCH" in _sanitized_git_environment()` is False before and
   True after, and the test asserts both ends plus the absence from that
   scrub list. A manifest or tree read on the post side could otherwise
   still lazy-fetch from a promisor remote, in the half of the run this file
   does not issue the git commands for.

3. CLEARING A HIDDEN FLAG REVEALS THE EDIT RATHER THAN REMOVING IT. The
   remediation named `update-index --no-assume-unchanged` and stopped, so
   the promised re-run met the same edit as an ordinary ` M` and refused a
   second time. It names the restore with it now.

The four sweep kinds are classified by one helper rather than by prefix
tests scattered through the advice, because `h!` and `!!` both carry a `!`
and the third kind must not inherit the second's remedy.

Three tests. 82 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Mutation
sweep over the three: 4 mutants, 4 caught, 0 survived (the first spelling of
the fourth was a WEAK mutant — it cut the conjunction and left the remedy
standing, so it was rewritten to remove the clause and then it was caught).

One consequence worth naming: the guard is process-wide and outlives the
call, so the partial-clone test's own `git clone --filter=blob:none` now
strips it for its SETUP — its checkout needs the tip's blobs. That is the
cheapest demonstration that the guard reaches every child of this
interpreter and not only the runner's own reads.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 18:21
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Round 2's two SUPPRESSED findings, both FACT, both fixed at c7ed6828 — answered here because a suppressed block is not a thread anyone can reply to, and #1105 landing with four of them unanswered is the reason this act exists at all. The threaded third is answered and resolved in place.

:408 — the no-network guarantee did not cover the whole measurement

GIT_NO_LAZY_FETCH=1 is only placed in the environment returned to this file's _git() calls. The post side invokes carved_reach._git_run() from post_stack(), whose sanitizer rebuilds its own environment and does not set this variable (scripts/carved_reach.py:809-820)…

Measured, and exactly so. carved_reach._sanitized_git_environment() builds from os.environ minus a nine-name scrub list, and GIT_NO_LAZY_FETCH is not in it:

>>> 'GIT_NO_LAZY_FETCH' in carved_reach._SCRUBBED_GIT_ENVIRONMENT
False
>>> 'GIT_NO_LAZY_FETCH' in carved_reach._sanitized_git_environment()   # before
False
>>> 'GIT_NO_LAZY_FETCH' in carved_reach._sanitized_git_environment()   # after
True

So the second of your two remedies is the one that fits the shape of that reader: the guard is set on THE PROCESS, immediately before the reach is imported, and it propagates through the shared sanitizer to every git command the post side issues. Propagating it INTO carved_reach was the alternative and is worse — that module is the resolver every carve tool shares, and a runner should not edit a shared reader's environment policy to get its own guarantee.

This is also the honest reading of what the guard is for. A gate that reaches for the network mid-measurement hangs when the network is not there, and it does not stop being that gate because the reach happens in a module this file merely calls.

One consequence, named because it is real: the guard outlives the call, being process-wide. The partial-clone regression test's own git clone --filter=blob:none now strips it for its SETUP — that clone's checkout legitimately needs the tip's blobs — which is the cheapest demonstration that the guard reaches every child of this interpreter and not only the runner's own _git(). The test asserts both ends and the absence from the scrub list; mutation control S3 (the process-wide set dropped) is CAUGHT.

:1284 — clearing a hidden flag reveals the edit rather than removing it

The hidden-flag remediation only clears the index bits; it does not restore, stash, or commit the edited file. For the exact h! path case this function reports, clearing the flags makes the same edit appear as M path, so the promised re-run still fails and the operator gets a second refusal.

Correct, and it is the same defect this act already fixed once in a neighbouring branch: a remediation that does not make the next run clean is not a remediation. git update-index --no-assume-unchanged unhides; it does not restore. The message now names the restore with the clearing — commit, stash, or git -C <leg> checkout -- those same paths — and says why in one clause: clearing a flag reveals the edit rather than removing it. Mutation control S4 is CAUGHT (its first spelling was a WEAK mutant that cut the conjunction and left the remedy standing, so it was rewritten to remove the clause; that is worth saying, because a mutant that does not change behaviour proves nothing about a test).

Measured at c7ed6828

  • 82 passed, 0 skipped; EXPECT_SKIPPED: "6" untouched.
  • The verdict is unchanged — OK — 1 of 1 corpus state(s) equivalent, exit 0, 14,849 bytes, sha256 764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735.
  • Mutation sweeps over everything new on this pull request: 22 mutants, 22 caught, 0 survived.

This closes the hardening class at its two-round cap (decision (b) on this lane): rounds 1 and 2 moved the head, both took every FACT finding, and anything further is registered rather than pushed.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The archive diagnosis can misreport partially missing renderer paths, and the bytecode allowlist permits other ignored importable files.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/verify-snapshot-equivalence.py:571

  • git archive reports a pathspec error when any requested path is absent, not only when both archive roots are absent. A pre-shed tree containing one of ARCHIVE_PATHS can therefore enter this branch and be described inaccurately as carrying NEITHER; keep this detail neutral (for example, say it does not carry all required archive paths) or inspect which path was missing.
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify-snapshot-equivalence.py Resolved
…as a real hole

THE GATE WENT RED AND IT WAS RIGHT TO. SonarCloud's quality gate failed on
`new_reliability_rating` 3 against a threshold of 1, and the issue behind it
was `python:S5850` — "group parts of the regex together to make the intended
operator precedence explicit" — on `_GENERATED_BYTECODE`, the allowlist added
one commit earlier. The unparenthesised top-level `|` meant the second
alternative `\.pyc$` matched a `.pyc` ANYWHERE under the import surface, and
a sourceless `src/shadow.pyc` sitting where `shadow.py` would sit is an
ordinary import candidate: the allowlist for the one artifact this runner
CREATES would have admitted a module it never checked. Copilot found the same
hole from the other end in the same hour. `(?:^|/)__pycache__/[^/]+\.pyc$`
now, with a test that an ignored `src/shadow.pyc` is dirt and a
`__pycache__/*.pyc` is not.

Also FACT, also Copilot, also taken: `git archive` fails as soon as ONE
pathspec matches nothing, so the refusal saying the tree carried NEITHER
archive path was inaccurate for a tree that had shed one of them. `_absence()`
asks `ls-tree` which, and says "carries A but NOT B" — or stays neutral where
git could not answer, which is this file's rule everywhere else.

And the maintainability findings on the same analysis, none of which failed
the gate but all of which are debt this act added:

* `python:S3776` ×2 — `recorded_gitlink` at 22 and `worktree_dirt` at 19
  against the 15 allowed. Split, not suppressed: `_gitlink_at_commit` /
  `_gitlink_index_first` / `_staged_gitlink`, and `_names` / `_flagged`.
  The seams are the ones the prose already describes, so each function is
  now one question.
* `python:S1192` — "HEAD or the index" three times, now `_NO_RECORD_SOURCE`.
* `python:S3358` — the nested conditional in the evidence line, lifted.
* `python:S9073` ×3 and `python:S8997` ×2 in the suite — composite
  assertions split so a failure names which half failed, and the one test
  that assigned to a module attribute by hand uses `monkeypatch`.

84 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Mutation
sweep: 3 mutants, 3 caught, 0 survived (the allowlist widened again, the
absence reported as NEITHER regardless, and the conflict stages read as the
pin — that last one re-proved after the split).

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 18:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The cleanliness sweep and superproject evidence can miss hidden edits, and cached bytecode is trusted solely by pathname.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

scripts/verify-snapshot-equivalence.py:1342

  • worktree_dirt() scopes the tracked diff and ignored-file scan to src, but _flagged(leg) scans every tracked path. A clean file outside the import surface with an assume-unchanged or skip-worktree bit therefore makes a code leg refuse even though it cannot affect carved_reach's imports. Apply the same scope when collecting hidden-flag entries, while retaining the whole-tree behavior for legs without src.
    hidden = _flagged(leg)
    if hidden is None:
        return None
    return rows + hidden

scripts/verify-snapshot-equivalence.py:1479

  • The new evidence read uses plain git status, which has the same blind spot this PR fixes for the legs: an edit to a tracked composition file hidden by assume-unchanged or skip-worktree is reported as a clean superproject. The rendered snapshot can then differ because carved_reach.py, opendox_host.py, or the profile changed, while the evidence line says working tree clean; include hidden-flag detection in this non-refusing root-state read (or mark the state unknown).
    done = _git(ROOT, "status", "--porcelain", "--untracked-files=normal")
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify-snapshot-equivalence.py Resolved
…s the same sight

Copilot's two suppressed findings at `e77726ac`, both FACT, and both are
INCONSISTENCIES IN CODE THIS PULL REQUEST INTRODUCED rather than new ground
— which is why they are taken although the class is past its round cap.

1. `_flagged(leg)` scanned the WHOLE leg while the tracked diff and the
   ignored scan were scoped to `src`. An `assume-unchanged` bit on a file
   that cannot reach `carved_reach`'s imports would have refused a required
   gate — a false refusal, which is a worse failure than the one it guards
   against. It takes the same scope now, and a leg without `src` keeps the
   whole-tree behaviour it already had.

2. The superproject evidence read a plain `git status`, which has EXACTLY
   the blind spot this act fixes one layer down: an edit to
   `carved_reach.py`, `opendox_host.py` or the profile hidden behind a flag
   would have printed `working tree clean` in the line that exists to carry
   the UNPINNED half of the composition. The root is still never refused on;
   it is reported truthfully, or reported as unknown when either read fails.

Two tests. The second one's FIRST spelling survived its own mutant — it
asserted `dirty` while the ambient checkout was already dirty, so the flag
proved nothing — and it now forces the status read clean, which is the only
way the flag can be what makes the difference. A test that passes for a
reason it did not name is the thing mutation sweeps exist to find.

86 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Sweep: 2
mutants, 2 caught, 0 survived.

REGISTERED, NOT TAKEN: Copilot's third finding — that an allowlisted
`__pycache__/*.pyc` is trusted by PATHNAME, so a crafted cache whose header
still matches the tracked source is loaded and executed before the sweep
runs. It is true, and the remedy is `sys.pycache_prefix` set before the legs
are imported, which would ALSO stop this runner writing into the legs at all
and so retire the allowlist. It is not taken here because it changes where
every subsequent import in the process caches — a process-wide behaviour
change that deserves its own act rather than the last commit of this one —
and because the exposure needs a writer in the checkout, who could equally
edit the runner.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 18:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Nested tree-read failures and archive diagnostics can still misidentify the remediation, and the runbook understates the cleanliness scope.

Review details

Suppressed comments (3)

Previously missed (2) — in code that hasn't changed since the last review.

scripts/verify-snapshot-equivalence.py:607

  • _absence() deliberately returns a neutral phrase when its ls-tree query cannot answer, but this branch still appends the definitive post-shed diagnosis and says the objects are not the problem. If that second read times out or fails, the refusal can misdiagnose an unreadable object store and send the operator to change --pre-ref; only use the post-shed wording after positively establishing which archive paths are absent, otherwise retain the neutral fallback.

This issue also appears on line 1176 of the same file.
docs/opendox-cutover-runbook.md:906

  • This documentation understates the cleanliness check: verify_pins() now sweeps every entry in IMPORTED_LEGS, including openDox/spec and openXdox/spec, not only the two -code trees. The runbook should describe the code and spec mounts consistently with the implementation.

scripts/verify-snapshot-equivalence.py:1179

  • When rev-parse <outer>:<path> cannot answer because the parent commit's tree/object store is incomplete, this helper returns the same (None, source) as an absent gitlink. verify_pins() then reports that the verified parent records no gitlink, misdiagnosing an unreadable pin and omitting the needed object-store remediation. Probe the committed tree separately (as carved_reach does with ls-tree) and preserve the distinction between absent and unreadable.
    done = _git(parent, "rev-parse", "--verify", "--quiet",
                "--end-of-options", f"{outer}:{path}")
    if done is None or done.returncode != 0 or not done.stdout.strip():
        return None, source
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…he sweep does

Copilot's three suppressed findings at `c26083ee`. I had said this pull
request would take no further head-moving round; the third of them is MY OWN
§ 2.3 contradicting MY OWN code in the same pull request, which has to be
fixed, and once the doc commit exists the other two cost nothing to carry.
That is the whole reason this round happened, said plainly rather than
dressed up as a policy.

1. THE RUNBOOK UNDERSTATED THE SWEEP. § 2.3 said the two `-code` trees are
   swept clean while `IMPORTED_LEGS` now carries the two `spec` mounts as
   well — documentation, in this same act, describing the code this same act
   replaced. It names the four mounts a module can arrive at, says why the
   spec mounts are among them, and describes the sweep as the three reads it
   is rather than as a `git status`.

2. `_absence()` ANSWERING "I CANNOT TELL" WAS TREATED AS A PHRASING PROBLEM.
   It returned a neutral phrase and the surrounding refusal still delivered
   the post-shed diagnosis — including "the objects are not the problem",
   which is exactly what an unanswered tree read cannot establish. It answers
   `None` now and the caller drops the whole diagnosis, telling the operator
   to ask `ls-tree` directly before changing `--pre-ref`.

3. `rev-parse --quiet` ANSWERS THE SAME WAY FOR ABSENT AND FOR UNREADABLE,
   and `_gitlink_at_commit()` reported both as "records no gitlink" — so an
   incomplete object store, the one condition this file gave its own code,
   was reported as a missing submodule declaration one level down. The tree
   is asked directly, and only a clean answer that does not list the path is
   an absence; anything else refuses `equivalence-object-store-incomplete`
   and names the fetch.

Two tests and a correction: the refusal-count sentence I wrote in the same
edit said EIGHT named codes, because the tuple has eight entries and one of
them is the blanket. Seven named and one blanket, as it always was.

88 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Sweep: 2
mutants, 2 caught, 0 survived.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 19:14
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Copilot's three suppressed findings at c26083ee, all FACT, all taken at 033506a3 — and I owe an account of why, because one comment earlier I said this pull request would take no further head-moving round.

The third of them is my own § 2.3 contradicting my own code, in this same pull request. The runbook said the two -code trees are swept clean while IMPORTED_LEGS had carried the two spec mounts since the first commit here. Documentation describing the code the same act replaced is not a finding to register for later; it is a defect I introduced and must not land. Once that commit had to exist, the other two cost nothing to carry — so they are in it, rather than being held out to keep a promise whose only effect would have been to leave two wrong refusal messages in the tree.

:906 — the sweep, as it actually is

§ 2.3 now names the four mounts a module can arrive at (the two -code legs and the two spec mounts, the latter because a re_destined: block may lawfully put a module there), and describes the sweep as the three reads it is rather than as a git status: the tracked diff and the ignored files under the import surface, the untracked files, and the ls-files -v flag scan. A reader of § 2.3 who wanted to know what "swept clean" means could not have learned it from the old sentence.

A correction inside the correction: the same edit briefly said EIGHT named refusal codes, because REFUSAL_CODES has eight entries and one of them is the blanket. Seven named and one blanket, as it always was.

:607 — "I cannot tell" is not a phrasing problem

…this branch still appends the definitive post-shed diagnosis and says the objects are not the problem.

Correct, and the sharpest of the three. _absence() returned a neutral PHRASE when its ls-tree read failed, but the sentence around it still ended "the objects are not the problem — the ref resolved and git read its tree well enough to know these paths are not in it", which is precisely what an unanswered tree read cannot establish. Softening the wording while keeping the verdict is the failure this runner refuses everywhere else: a query that went unanswered is not an answer.

It returns None now, and the caller drops the diagnosis rather than rewording it — the refusal says outright that it does NOT claim the ref is post-shed, and hands the operator the ls-tree to ask directly before changing --pre-ref. Mutation control V1 is CAUGHT.

:1179 — absent and unreadable are different findings one level down too

rev-parse --verify --quiet <outer>:<path> answers the same way for a gitlink that is ABSENT and for one whose commit tree cannot be READ, and _gitlink_at_commit() reported both as "records no gitlink" — so an incomplete object store, the one condition this file gave its own code two rounds ago, arrived as a missing submodule declaration. Exactly the defect rounds 1 and 3 fixed at the archive, one level down and still there.

The tree is asked directly now, and only a clean answer that does not list the path is an absence; anything else refuses equivalence-object-store-incomplete and names the fetch. Mutation control V2 is CAUGHT.

Measured at 033506a3

  • 88 passed, 0 skipped; EXPECT_SKIPPED: "6" untouched.
  • The verdict is unchanged — exit 0, 14,849 bytes, sha256 764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735.
  • Mutation sweeps across this pull request: 29 mutants, 29 caught, 0 survived.

Still registered and still not taken — the tampered-__pycache__ finding from the previous round, whose remedy is sys.pycache_prefix set before the legs are imported. That one is not an inconsistency inside this act; it is a process-wide behaviour change with its own consequences, and it belongs to an act that is about it.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Nested pin validation and metadata-only checkout handling have correctness gaps, with one stale refusal diagnostic remaining.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

Previously missed (3) — in code that hasn't changed since the last review.

scripts/verify-snapshot-equivalence.py:1496

  • any(leg.iterdir()) counts the .git marker itself, so a mount containing only submodule metadata (for example, an initialized/no-checkout or interrupted update) is treated as materialized. The pre-import probe then misses this empty checkout and post_stack() reports the missing module later; exclude .git from the emptiness test so metadata-only mounts are named here.
    scripts/verify-snapshot-equivalence.py:1609
  • After this new multi-command sweep returns None, verify_pins() still reports that git status --porcelain failed, even though this path now uses git diff, ignored/untracked scans, and ls-files -v. That stale detail misidentifies the unanswered operation; update the refusal to name the cleanliness sweep generically.
    scripts/verify-snapshot-equivalence.py:1752
  • The new call below probes unmaterialized_legs() before post_stack(), but this surrounding comment still says the post side is composed first and that post_stack() wins. That is the opposite of the implemented, tested ordering and will mislead maintainers about why the side-effect-free probe exists; update the rationale to say the filesystem probe runs first.
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify-snapshot-equivalence.py Resolved
…t made stale

Copilot's four findings at `033506a3` — one correctness gap in the nested
read this pull request introduced, and three pieces of text that this pull
request itself made wrong. All four are inside what this act wrote.

1. `rev-parse <commit>:<path>` RETURNS AN OID FOR ANY TREE ENTRY, and the
   nested read took it as the pin. A parent commit carrying a regular file
   or a directory at `code` after a type-changing update therefore yielded
   that blob or tree id AS THE NESTED PIN, and the run reported an off-pin
   checkout instead of saying no gitlink is recorded. The index-first path
   has always required mode `160000` and `verify-openxdox-pin.py` requires
   it too; this path was the one that did not. It is ONE `ls-tree` now,
   which answers all three questions at once — is the path there, is it a
   gitlink, what is its id — so the absent / not-a-submodule / unreadable
   distinctions come out of a single read instead of two.

2. `any(leg.iterdir())` COUNTED THE `.git` MARKER, so a mount holding
   nothing but submodule metadata — `submodule update --no-checkout`, or an
   update interrupted between the clone and the checkout — read as
   materialized and the probe missed exactly the state it exists to name.

3. The dirt refusal still said `git status --porcelain` FAILED after that
   single read became three, misidentifying the operation that went
   unanswered. It names the sweep it actually runs.

4. The comment above `unmaterialized_legs()` still said `post_stack()` comes
   first and wins — the OPPOSITE of the order this act implemented and
   tested two commits earlier. A comment that contradicts its own code is
   worse than no comment: it is the reason a later reader moves the call
   back.

Three tests and one rewritten: the probe's fixture now gives each mount a
working-tree file, so "holds only `.git`" is a state it can distinguish
rather than the state every mount was in.

89 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Sweep: 3
mutants, 3 caught, 0 survived.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Gitlink conflict/type handling and spec-mount import tracking still contain correctness gaps.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/verify-snapshot-equivalence.py:1308

  • These mounts are now treated as imported and swept, but the reach used by this runner still installs only openDox/code/src and openXdox/code/src (scripts/carved_reach.py:122-124, 307-317). If a legal re_destined: row points a module at openDox/spec or openXdox/spec, carved_reach.module() cannot import that copy from the spec tree; it can fail or resolve another code root while this tuple labels/checks the spec pin. Either add the spec roots to the reach with an end-to-end test, or do not classify them as imported legs.

scripts/verify-snapshot-equivalence.py:1269

  • _staged_gitlink() only records nonzero stages after filtering to mode 160000. A merge conflict between a gitlink and a regular file/tree has stages 1/2/3 with mixed modes, so conflicted stays empty and _gitlink_index_first() reports HEAD or the index instead of naming the unresolved conflict (and may fall back to HEAD). Detect every nonzero stage first, then accept only a stage-0 mode-160000 row.
        if len(fields) < 3 or fields[0] != "160000":
            continue
        if fields[2] == "0":
            return fields[1], conflicted
        conflicted.append(f"stage {fields[2]} {fields[1][:12]}")
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify-snapshot-equivalence.py Resolved
…re not imported

Copilot's three findings at `ce976cbe` — and the third of them says an
earlier commit of mine in this same act OVER-REACHED, so this one is mostly
a SUBTRACTION.

1. THE SPEC MOUNTS LEAVE `IMPORTED_LEGS`. Measured rather than argued:
   `carved_reach.LEGS` installs exactly two roots, `openDox/code/src` and
   `openXdox/code/src`, and `module()` refuses a row that is not a `.py` at
   a code leg — so NOTHING can be imported out of a spec mount through this
   reach. Sweeping a tree this run cannot import from can only refuse a run
   for a state that cannot change its result, which is precisely the
   false-refusal defect this same act fixed two commits ago for the flag
   scan. They STAY in `LEG_GITLINKS`: they are pins the superproject
   records, and verifying them is honest. The test asserts the measurement
   (`carved_reach.LEGS` installs `code` and only `code`) rather than the
   conclusion, so it fails if the reach ever grows a spec root.

2. THE HEAD READ IS MODE-AWARE TOO. `rev-parse HEAD:<path>` answers for any
   tree entry, so when the index read FAILED and the index-first path fell
   back to HEAD, a type-changed file or directory at a pin path came back as
   a recorded gitlink — the defect closed one function away last commit,
   left standing in its sibling. Both paths now share `_gitlink_in_tree()`,
   one `ls-tree --full-tree` answering presence, MODE and id together.

3. EVERY NONZERO STAGE IS A CONFLICT, WHATEVER ITS MODE. Filtering to
   `160000` before collecting the stages meant a merge between a gitlink and
   a regular file left `conflicted` empty, so an unresolved conflict was
   reported as "no record" and could fall back to HEAD. The stages are
   collected first and the mode is required only of the stage-0 row, which
   is the one that would be used. The refusal names the mixed mode.

Runbook § 2.3 follows the code: two swept legs, not four, with the reason.

91 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Sweep: 3
mutants, 3 caught, 0 survived.

THE HEAD-MOVING ROUNDS END HERE. Rounds 3-7 were each findings in code this
act wrote, and each push draws a fresh review; from this commit anything
further is answered and registered against the successor act, so that the
floor this pull request measures can land.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The index-first pin path can reject a valid staged pin when the HEAD tree is unreadable, and one fallback diagnostic promises a tree inspection that never occurs.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/verify-snapshot-equivalence.py:642

  • The fallback refusal says that whether the tree carries the renderer is "answered separately, below," but this branch raises immediately and never performs that tree inspection; the only ls-tree check is in the pathspec-specific branch above. An operator seeing this unclassified failure therefore gets a promise of evidence that is not emitted. Reword this to say that the fallback does not establish renderer presence, or perform the promised check before raising.
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify-snapshot-equivalence.py Resolved
…n, undone

I said the previous commit was the last head-moving round. This one is not a
new finding; it is a REGRESSION that commit introduced, and shipping a known
regression to keep my own word would be the wrong way round.

Making the HEAD read mode-aware also made it RAISE for an unreadable tree.
Reading HEAD first was harmless while that read answered `None` on failure;
it stopped being harmless the moment it began refusing, because a staged
stage-0 gitlink is the AUTHORITATIVE record for a re-pin that is not
committed yet — that is the entire reason this path is index-first, and
`verify-openxdox-pin.py` says so in its own terms. In a partial or
incomplete checkout the runner could therefore reject a valid staged pin
having never read it.

The index is read FIRST now. HEAD is still read, because the SOURCE this
function answers with depends on whether the two agree, but an unreadable
HEAD tree no longer vetoes a pin the index has already given; with nothing
staged there is nothing to fall back on, so the unreadable tree is still
reported rather than read as an absence. Both cases are tested.

Also, Copilot's suppressed finding on the same review, and the same kind of
defect: the unclassified archive fallback still promised that whether the
tree carries the renderer is "answered separately, below". That was true
while the branch fell through and false once it raised — an operator was
promised evidence that is never emitted. It says outright now that it does
not establish which, and why: the archive failed, so the per-row check never
ran.

93 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Sweep: 2
mutants, 2 caught, 0 survived.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The cleanliness sweep can falsely reject untracked files outside the import surface, and its tracked-file remediation does not clear staged changes.

Review details

Suppressed comments (3)

Previously missed (3) — in code that hasn't changed since the last review.

scripts/verify-snapshot-equivalence.py:1428

  • When src exists, scope is ['--', 'src'], but this untracked-file read omits it and therefore reports every non-ignored untracked path anywhere in the leg. A file such as docs/NOTE.md cannot be imported through carved_reach but will still make verify_pins() refuse, unlike the other scoped reads; pass the same scope here to avoid a false refusal.
    scripts/verify-snapshot-equivalence.py:1495
  • git diff --name-only HEAD includes staged changes, so a staged edit is classified as tracked here. git checkout -- . restores the worktree from the index but leaves that staged diff against HEAD, meaning the remediation can leave the next run refusing. Use a command that restores both the index and worktree (or otherwise explicitly reset the index) while retaining the commit option.
    docs/opendox-cutover-runbook.md:907
  • The current implementation deliberately keeps the two spec mounts in LEG_GITLINKS but out of IMPORTED_LEGS, so only the -code trees are swept. That contradicts the PR description's item 2, which says the spec mounts join the sweep and that IMPORTED_LEGS follows the pin; please reconcile the description with the measured reach reflected here.
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…y clears the index

Copilot's two remaining code findings at `630af798`, both of them the third
and fourth instances of defects this act already fixed twice elsewhere —
which is the argument for taking them rather than registering them: a
successor inheriting a known defect at a third address is worse than one
more commit.

1. THE UNTRACKED READ OMITTED THE SCOPE its two siblings take, so an
   untracked `docs/NOTE.md` — which `carved_reach` cannot import through any
   path — refused a required gate. That is the same false-refusal defect as
   the whole-leg flag scan and as the spec mounts in the sweep, at its third
   address. Every read in the sweep now takes the same scope.

2. `git diff --name-only HEAD` SEES STAGED CHANGES, and `git checkout -- .`
   restores the worktree FROM THE INDEX — so for a staged edit the
   remediation changed nothing and the promised re-run refused again,
   exactly as the hidden-flag remediation did before it was fixed. It offers
   `restore --staged --worktree` now and says why in the same breath.

94 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Sweep: 2
mutants, 2 caught, 0 survived; 39 of 39 across this pull request.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The staged gitlink parser can mistake a nested gitlink for the requested root pin, and one regression assertion does not verify both imported legs.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

tests/snapshot_equivalence/test_snapshot_equivalence.py:1339

  • This assertion collapses both LEGS entries to the single string "code", so it remains green if one leg is removed or the two entries are duplicated. That leaves the claimed measurement of exactly two installed code roots unprotected; assert the (gitlink, leg) pairs and the expected length instead.
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify-snapshot-equivalence.py Resolved
…tops collapsing

The last two, both small, and the second is a test of mine that did not
protect what it claimed to.

1. `git ls-files -s -- <path>` is RECURSIVE when `<path>` is a directory,
   and the parser accepted any mode-`160000` row in the output. A root pin
   replaced by a plain directory containing a nested gitlink would therefore
   have had that NESTED row read as its own recorded pin. The path column is
   required to match, which is what `verify-openxdox-pin.py::_gitlink_from`
   does and why.

2. `{leg for _gitlink, leg, _src, _package in carved_reach.LEGS} == {"code"}`
   collapsed both entries to one string, so it stayed green if a leg were
   removed or the two duplicated — while claiming to protect the measurement
   that exactly two code roots are installed, which is the measurement the
   spec mounts were taken out of the sweep ON. It asserts the pairs and
   their order now.

95 passed, 0 skipped. Verdict unchanged — 14,849 bytes, sha256
764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735. Sweep: 1
mutant, 1 caught; 40 of 40 across this pull request.

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 18, 2026 21:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The partial-archive refusal still says neither archive path matched when one may be present, contradicting its path-specific diagnosis.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/verify-snapshot-equivalence.py:608

  • _absence() can return carries <kept> but NOT <shed>, so this prefix is false whenever exactly one archive path exists: git archive failed because the missing pathspec did not match, not because neither path matched. Use wording neutral to which path matched so the refusal does not contradict its own path-specific diagnosis.
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

FACT, and REGISTERED rather than taken — with the exact one-line remedy, because this pull request has stopped moving its head. Copilot's review at 50a3e574 reports 0 new comments and this single suppressed finding.

scripts/verify-snapshot-equivalence.py:608 — "matched none of" overclaims in the branch that exists not to

_absence() can return carries <kept> but NOT <shed>, so this prefix is false whenever exactly one archive path exists…

Correct, and the irony is the point: this is the branch added two rounds ago specifically so that a failed tree read would stop delivering a diagnosis it cannot support — and its own first sentence then asserts that NEITHER path matched. git archive fails as soon as ONE pathspec matches nothing, so with _absence() unable to answer, "matched none of A or B" is precisely the claim this runner has no basis for. The rest of the message is right and says so outright ("could not read that commit's tree to say WHICH of them is missing, so it does NOT claim the ref is post-shed"); it is the opening clause that contradicts it.

The remedy, exact: replace

f"`git archive {pre_commit}` ({pre_ref}) matched none of "
+ " or ".join(ARCHIVE_PATHS)

with wording neutral to which matched — "did not match at least one of" + " and ".join(ARCHIVE_PATHS) — leaving the rest of the refusal as it stands. One line, no behaviour change, and the existing test (test_a_tree_read_that_failed_does_not_become_a_post_shed_verdict) already exercises the branch, so the assertion to add beside it is that the detail does not say matched none of.

Why it is registered rather than pushed

Ten Copilot rounds have moved this head, each finding real defects in code this act wrote, and each push draws a fresh full-file review; the floor this pull request measures has to be able to land. The rule I have held and am holding here: a defect this act INTRODUCED gets fixed however late, unless the gate is green and the defect is confined to the wording of a refusal that already states its own uncertainty in the next sentence. This is that case. It goes to the successor act with the remedy above.

The registered list for the successor act, in full:

  1. sys.pycache_prefix before the legs are imported — an allowlisted __pycache__/*.pyc is trusted by PATHNAME, and CPython executes a crafted cache whose header still matches the tracked source (thread). The remedy also stops this runner writing into the legs at all, and so RETIRES the bytecode allowlist that produced three separate findings here.
  2. This :608 wording, as specified above.

The head that is going ready

50a3e574 — every required check SUCCESS (pytest-suite, SonarCloud, openxdox-consumer-gate, merge-master-approval, the lane-line pair, openreposhape-pin, openspec-cli-pin, wallet-validation, release-tag-gate, signed-execution-chain-gate, clearing-dispatch-gate, former-id-arrival-gate), 0 unresolved threads, 95 passed / 0 skipped, EXPECT_SKIPPED: "6" untouched, mutation sweeps 40 of 40 caught, and the verdict unchanged throughout at 14,849 bytes, sha256 764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735 — which, for a hardening act, is the number that matters most.

🤖 Generated with Claude Code

@brettheap
brettheap marked this pull request as ready for review September 18, 2026 22:14

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 6 days and 12 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit 4101fbe into main Sep 18, 2026
16 checks passed
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

LANDED — lane openxfactory-4, 2026-09-18T22:17:38Z, PR #1115 → 4101fbe (opensoft/openxFactory main; plain gate)

FLOOR PART 4 follow-up 2: the eight Q-P5 items registered at the snapshot-equivalence runner (#1105/#1110) plus runbook § 2.3; plain gate; two Copilot findings registered

brettheap added a commit that referenced this pull request Sep 19, 2026
…es at all three destinations, and the four-part floor has one evidence line per part

Ledger 62 [x] / 9 [ ] / 1 [~] -> 64 / 7 / 1 of 72; five marker changes in this
amendment (3.7, 4.5a, 5.4, 8.2, 8.5).

SECTION 3.7 TICKS. All three destinations now have a recorded pass at a LANDED
head, which is the box's own word -- "EVERY DESTINATION PASSES IT":
openxFactory's own adapter at eb1880c, the only mechanical proof that the home
corpus has no privileged route and the reason the box names it separately;
openXdox-code at 3ee8cd31 (#656 comment 5736681367); and openDox-code at
93ccc3dd, OK - 17 of 17, exit 0, transposed and faithful, #31 merged
2026-09-19T01:11:53Z (#656 comment 5738152229, the re-read AT MAIN, addendum to
5738117973).

The pass is quoted at the LANDED commit and not at the candidate, on purpose.
5738117973 recorded the same pass at candidate head 776d2a80 and itself
superseded 5736880991 at 474144ef -- three heads for one destination in a day. A
pass at a candidate head is a pass at a commit that no longer exists on main.
This packet has now had a reader mistaken for a pass, a candidate mistaken for a
landing, and a wrong token mistaken for absence, all on this one box.

The durable figure is recorded as the corpus digest rather than the
transposition's revision: the revision moved again, a fourth distinct value, as
it does on every build, while the key/sha256 table digest 744c9183 held for the
fourth time. That is what identifies the corpus and what a later reader
recomputes.

Registered as residue and not resolved (#656 5738108117): the core.excludesFile
switch, the corpus-mirroring fixture, the enumerated skip diagnostic.

SECTION 8.2 TICKS. All four evidence lines are on record, one per part and no
part standing in for another: (1) the carve manifest, #865 -> 1716748, 454 rows
at carve_commit b075fd9; (2) the test mapping, section 5.4 ticked in this
amendment, (a)(b)(c) at #1080 -> 4b53ea9 and (d) pinned at all three; (3) the
neutral conformance corpus green in every destination, section 3.7 above; (4)
the snapshot-equivalence run, section 5.5 on the gated runner #1105 -> 0296747
with follow-ups #1110 and #1115, and per RULED Q-P4 (a) that line also says
section 4.4's domain profile reproduces openxFactory's own vocabulary.

They are listed with their own artifacts because the box's standing objection is
that "none of these is 'the tests passed'" and that no part substitutes for
another. Two single-instrument alternatives were rejected on the record; a tick
quoting one artifact four times would be the same mistake wearing a different
hat.

Section 3.6's follow-up 2 is named as openDox-code #32, a draft at b7d9d7a9. The
section 5.6 Phase 0 record gains its residue: openxFactory #1123, lockstep.status
re-diverged after the repin lane's advance, at the gate, registered and not a
condition of either box.

The superseded 2026-09-18 per-repository reading is kept beneath the tick,
because it shows the box closing in under a day from a state where neither
destination was evidenced.

All four validators exit 0.

Refs #656 (stays OPEN).

Lane: openxfactory-4
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
brettheap added a commit that referenced this pull request Sep 19, 2026
…, § 8.2, § 8.5) and the RULED four-part floor complete (#1124)

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

Refs #656 (stays OPEN).

**`split-opendox-two-layer-product` `tasks.md` AMENDMENT #8 — FIVE ticks (§ 3.7, § 4.5a, § 5.4, § 8.2, § 8.5), and the four-part floor complete.**

Branched from the landed `main` at **`fc837dff`** (#1120's squash); `origin/main` merged in at `38f826c2`. **Ledger 59 `[x]` / 12 `[ ]` / 1 `[~]` → 64 / 7 / 1 of 72.** One file. **Exactly five marker changes — § 3.7, § 4.5a, § 5.4, § 8.2 and § 8.5.** Rule 6 applies.

> **THE RULED FOUR-PART FLOOR IS COMPLETE.** § 8.2 carries one evidence line per part, and no part stands in for another.

## § 5.4 — FLOOR PART 2 ticks, and the blocker the box itself named is discharged

Its own STATUS said (a), (b) and (c) had landed at **#1080 → `4b53ea99`**, and that **clause (d)'s LEG half was blocked on the BUILD arc** — both legs running a named file list under `--noconftest` **with no JUnit and no triple**.

Both halves of that blocker are gone. The BUILD arc landed (§ 3.5 on `openDox-code` #25, § 3.6 on #26, both `[x]`), and clause (d)'s **three** pins are in place — *per destination, never as one cross-repository equality*, which is the clause's own rule:

| leg | pin | evidence |
| --- | --- | --- |
| `openDox-code` | `MIN_SELECTED 1076` · `MIN_PASSED 1073` · `EXPECT_SKIPPED 3` | **#29 → `373b05aa`**, run `35398182026` |
| `openXdox-code` | `MIN_SELECTED 539` · `MIN_PASSED 533` · `EXPECT_SKIPPED 6` | **#25 → `ab04453d`**, run `35399041710` |
| `openxFactory` | its own `pytest-suite.yml` | already pinned — the model the clause names |

**Verified in each leg's own workflow rather than taken from the report**: both files carry those pin variables *and quote clause (d) verbatim*, so the shape is the clause's rather than an approximation of it. **Four of four is the clause set, so the box closes.**

> **Residue registered, not resolved**: all three of `openDox-code`'s report-producing commands run **named file lists under `--noconftest`**, so `collect_ignore` never applies there, and **26 of the 61 `test_*.py` on disk are collected by no required command**. That does not touch clause (d), which pins what the required job *does* collect — it is booked because a reader could mistake the pinned triple for a statement about the whole tree, and it is not one.

## § 4.5a — ticks on the exit line the box asked for

**`OK — 17 of 17`, exit 0**, at `openXdox-code` `3ee8cd31` with the runner at `openxFactory` `eb1880cb` (`#656` `5736681367`), over the BUILD at **#23 → `3ee8cd31`** with admissions rows at **#1091 → `eb2d4569`**.

**The bare-checkout precondition is written INTO the evidence line as procedure, not left as a caveat**: the git-pinned `opendox` dependency (`pyproject.toml:106`) must be installed first, or the run exits **2** with `conformance-adapter-unresolvable` before the corpus is reached.

> This is **the box's own standard applied to itself**. Its existing parenthetical already refused an abbreviated form of this very command — ***"a command that cannot be run is not exit evidence"*** — when the missing piece was `--dest-root`. The missing piece is now an install rather than a flag, and **the standard does not change with the shape of what is missing.**

## § 3.7 — FLOOR PART 3 ticks: all three destinations pass at a LANDED head

*"EVERY DESTINATION PASSES IT"* is the box's own word, and all three now do — **`openxFactory`'s own adapter at `eb1880cb`** (*the only mechanical proof the home corpus has no privileged route*, which is why the box names it separately), **`openXdox-code` at `3ee8cd31`** (`5736681367`), and **`openDox-code` at `93ccc3dd`** — `OK — 17 of 17`, exit 0, transposed and faithful, #31 merged 01:11:53Z (`#656` **`5738152229`**, the re-read AT MAIN).

**The pass is quoted at the LANDED commit, not the candidate, on purpose.** `5738117973` recorded the same pass at candidate `776d2a80`, and itself superseded `5736880991` at `474144ef` — **three heads for one destination in a day**. *A pass at a candidate head is a pass at a commit that no longer exists on `main`.* This packet has now had a reader mistaken for a pass, a candidate mistaken for a landing, and a wrong token mistaken for absence, all on this one box.

**The durable figure is the corpus digest, not the transposition's revision**: the revision moved again (a fourth distinct value, as it does on every build) while the **key/sha256 table digest `744c9183…` held for the fourth time**. That is what a later reader recomputes.

> **Residue registered, not resolved** (`5738108117`): the `core.excludesFile` switch, the corpus-mirroring fixture, the enumerated skip diagnostic.

## § 8.2 — the four-part floor ticks, one evidence line per part

**(1) carve manifest** `#865 → 1716748` (454 rows at `carve_commit b075fd9`) · **(2) test mapping** § 5.4 above · **(3) conformance corpus green in every destination** § 3.7 above · **(4) snapshot-equivalence** § 5.5 on the gated runner `#1105 → 0296747` with `#1110` and `#1115`, and per RULED **Q-P4 (a)** that line also says § 4.4's domain profile reproduces `openxFactory`'s own vocabulary.
> Listed with their own artifacts because the box's standing objection is that **"none of these is 'the tests passed'"** and that no part substitutes for another. Two single-instrument alternatives were rejected on the record; **a tick quoting one artifact four times would be the same mistake wearing a different hat.**

## § 8.5 — TICKED on HOLDER RULING `5738064190`

Amendment #7 reported two destination halves missing. **They were missing from the *ledger*, not the corpus.** All four are named now — § 6.1 `openXdox-spec` **#15 → `f088b097`**, § 6.3 `openDox-spec` **#13 → `3b7f80c4`**, § 6.4 **#12 → `edeed08c`**, § 6.5 **#14 → `66d59778`** — plus § 6.2's forward half at `openDox-spec` **#15 → `8fe8c4c7`**.

**Clause (a) is closed**: amendment #7 reported two destination halves missing — **they were missing from the *ledger*, not the corpus**. All four are named (§ 6.1 `openXdox-spec #15 → f088b097`, § 6.3 `openDox-spec #13 → 3b7f80c4`, § 6.4 `#12 → edeed08c`, § 6.5 `#14 → 66d59778`), plus § 6.2's forward half (`#15 → 8fe8c4c7`) and the aggregation side (`xFactory #454 → 0b0c88f4`).

**Clause (b) is RULED — Reading B** (`#656` `5738064190`): *"first"* means **before this packet's own archive (§ 8)**, the only ordering the ratified text states (`specs/ideation-dashboard/spec.md:88-90` orders *this change* against the five, not the five among themselves) and the one § 6.2's own box already names, *"Sequenced BEFORE § 8"*. **Reading A — before the other four — is refuted by the record**: § 6.2's `#1066` merged **20:24:53Z**, LAST of the five (`#1056` 10:50:06Z, `#1057` 13:31:51Z, `#1060` 17:30:27Z, `#1065` 17:54:08Z).

**The box's wording is sharpened** to *"…on its own evidence **before this packet's own archive (§ 8)**"*. The word *"first"* was **the ledger's own** — absent from the ratified source sentence at `proposal.md:476` and from every `specs/` delta — so the ruling settled *which evidence line satisfies a box*, not what a requirement means.
> Both readings are kept on the page with the merge times that decided between them. **A ledger that shows only the reading that won teaches nothing about why the other lost**, and this box will be read again by someone facing the same kind of call.

## Five follow-up landings, none moving a box

* **§ 3.6** — `openDox-code` **#30 → `5c867137`** takes the seven findings #26 registered plus eight cases; **follow-up 2 in flight** (linked-worktree descriptor binding, RULED `5736683962`; `RefusedError` → 409; fallback narrowing; mismatched-DB cases).
* **§ 5.5** — **#1115 → `4101fbe9`** takes the eight hardening items; two residues registered (`:608` wording, `sys.pycache_prefix`, `5736824535`).
* **§ 3.7 openDox side** — `openDox-code` **#31** open at `4b9714d0`.
* **Q-A2** — folded into `openXdox-code` #25; opened and closed in one line, which is the only honest way to record something that never reached the page while it was open.
* **§ 5.6 Phase 0 has landed, and it landed itself** — `codexFactory` **#491 → `b21f0100`** regenerated the floor block (62 → 63) at 22:50:17Z, and the repin **#1122 → `38f826c2`** advanced the pinned decision core to it at **2026-09-19T00:53:37Z**. *Corrected against the report, which had #1122 open with auto-merge armed: it is merged and on `main`. An armed auto-merge can land without anyone watching, so its state is worth reading rather than inferring.*

## Gates

`openspec validate … --strict` **valid** · `proposal-support.py verify` **ok** · `validate-sequenced-after.py --ledger-diff` **clean** · `verify-opendox-pin.py` **OK**.

**AFTER THIS HEAD — REGISTERED, NOT PUSHED** (comment `5738349034`; all of it folds at amendment #9, because this amendment's head-moving budget is closed and none of it shows a tick is wrong): § 5.6's registered residue is CLOSED and **PHASE 0 IS COMPLETE** — `openxFactory` **#1123 → `8184d74a`** landed **01:27:44Z**, after `codexFactory` #491 → `b21f0100` and `openxFactory` #1122 → `38f826c2`; the `opensoft/xFactory` aggregation re-sync (**R-5**) is registered for Brett's word, and Phase 1 still waits on this packet's own archive (RULED **Q-D1 (a)**). § 3.6 follow-up #2 landed — `openDox-code` **#32 → `d816cf06`**, `mergedAt` **01:30:28Z**. The assembly roots now name every landed leg — `opensoft/openXdox` **#12 → `9be407bd`**, `opensoft/openDox` **#10 → `d05e204e`** — and the `dox-v1.0` / `xdox-v1.0` cuts are **Brett's act** (runbook § 9 Phase 6), which is why **§ 3.8 and § 4.6 stay `[ ]` here**. Copilot's one finding (`r4051734088`, the same discussion at all three heads) is **answered by measurement and resolved**: the install step it asked § 4.5a for is checked in — `openXdox-code` `.github/workflows/validate.yml:58-59`, `python -m pip install -e ".[test]"` against `pyproject.toml:106`'s pinned `opendox` — and it does not falsify the exit line the box ticked on.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 22, 2026
…ere the prefix is — Copilot round 4, and the last

FACT, MEASURED. `PYTHONPYCACHEPREFIX=/` passed `inside_a_pinned_mount()` as
"outside every pin", and it is the opposite: in prefix mode CPython does not
put the cache AT the prefix — `cache_from_source()` builds the directory as
`_path_join(sys.pycache_prefix, head.lstrip(path_separators))`, the source's
OWN absolute directory appended to the prefix, and drops the `__pycache__`
component entirely. So the filesystem root maps a leg module straight back
beside its own source:

    $ PYTHONPYCACHEPREFIX=/ python3 -c 'import importlib.util; print(
        importlib.util.cache_from_source(".../openXdox/code/src/openxdox/
        generator.py"))'
    .../openXdox/code/src/openxdox/generator.cpython-312.pyc

— inside the pin, read during `post_stack()` before `verify_pins()` sweeps
anything, and with no `__pycache__` component, so not even the class the
sweep passes over.

The predicate now asks the question it was always about: for each pinned
mount it maps the mount's own directory through CPython's rule and refuses a
prefix whose cache would land inside the pin. The root is then refused as
the case it is rather than as a special case, and any other prefix with the
same property is refused with it. `test_a_host_prefix_inside_a_pin_is_
replaced_rather_than_kept` gains `/` as a sixth spelling; the mount-set test
and the reach's fresh-interpreter probe assert it on both sides.

113 passed, 0 skipped. Verdict unchanged: 14,849 bytes,
`sha256 764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735`.

THE HEAD STOPS MOVING FOR THIS FINDING CLASS HERE. Four rounds of
cache-prefix findings have each been a real defect in code the round before
introduced, and each has been fixed; from here anything further in this
class is answered and REGISTERED for a successor act rather than pushed, on
#1115's rule — every push draws a fresh full-file review, and the floor this
pull request measures has to be able to land.

Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 22, 2026
…d the refusal stops overclaiming (#1132)

Lane: openxfactory-4 (openXfactory-4-openDox_extraction)

**The SUCCESSOR ACT to #1115** (landed `4101fbe9`, 2026-09-18), carrying the two items its author registered rather than pushed — [the registered list, `#1115` comment `5736824535`](#1115 (comment)) — under the same § 5.5 CLAIM [`#656` comment `5728621421`](#656 (comment)) and RULED Q-P5 = (a) ([`#656` comment `5731951297`](#656 (comment))). Nothing else is in it.

**THE VERDICT DOES NOT MOVE, and for a hardening act that is the number that matters.** At this head the equivalence runner still renders **14,849 bytes, `sha256 764b077b84031ec9bb13538f400904119141d954636cee6d53eee052b3840735`**, exit 0, and `EXPECT_SKIPPED: "6"` is untouched.

---

## 1. `sys.pycache_prefix`, set before the legs are imported — and the bytecode allowlist retires

[`r4049745762`](#1115 (comment)). An allowlisted `__pycache__/*.pyc` is trusted BY PATHNAME, and CPython validates a cached `.pyc` against the mtime and size recorded in its own HEADER — so a crafted cache still matching the tracked source is loaded and EXECUTED. The legs are imported in `post_stack()`, before `verify_pins()` sweeps anything, so that bytecode would have rendered the post side while the verdict named a commit it did not come from; and the sweep could not have caught it even if it had looked, because the class was allowlisted precisely on the grounds that this runner's own imports created it.

**`sys.pycache_prefix` removes the condition rather than policing it**: with it set CPython neither READS nor writes a `__pycache__` beside the source. `sys.dont_write_bytecode` is not the remedy and was not proposed as one — it stops the writing and leaves the reading, which is the half the finding is about.

### It is set in two places, and the second is not belt and braces

* **`post_stack()`, before `import carved_reach`** — for the reason the `GIT_NO_LAZY_FETCH` guard three lines above it is set there: a guarantee this runner's verdict rests on is made BY this runner, on the process, before the shared reader is imported, rather than inherited from a reader that could stop providing it.
* **`carved_reach.install()`** — because the registered item's premise, that this runner creates those files, is true but **not exhaustive, and the difference is a red required gate**. MEASURED: `tests/ideation-dashboard/test_lens.py` on its own left **46 `.pyc` files** under the two `src/` roots, and `tests/ideation-dashboard` sorts BEFORE `tests/snapshot_equivalence` in the single `pytest tests/` process `pytest-suite` runs. Retiring the allowlist in the runner alone would have made every end-to-end run in that gate refuse — on bytecode a sibling suite wrote. Proven before it was fixed: with the allowlist stubbed out and the legs carrying that suite's bytecode, `python3 scripts/verify-snapshot-equivalence.py` refuses `equivalence-reach-unavailable` and lists `!! src/opendox/__pycache__/…`.

  `install()` is the one gate every route into the legs passes through (`module()` calls it), so it is where the guarantee belongs, and it covers the importers a conftest cannot: `tests/ideation-dashboard/test_cli_column_split.py`'s `BOOTSTRAP` and `tests/domain_profile`'s probe each bootstrap the reach in a FRESH interpreter.

A prefix the process has already chosen — `PYTHONPYCACHEPREFIX`, or a host — is **left alone**: any prefix satisfies the requirement, and one pointed INTO a leg is caught by the sweep it would be trying to fool.

### Where the cache goes, and why inside the checkout

`<repo>/.pycache`. The exposure needs a writer in the working tree, and such a writer could edit `scripts/carved_reach.py` itself — the threat-model argument already on this lane's record — while a fixed path under a shared `/tmp` is a directory another user can create FIRST and fill with exactly the crafted caches above. The root `.gitignore` already carries `*.py[cod]`, so every file written there is ignored and `git status --porcelain -unormal` is unchanged (measured); nothing is added to it. If the directory cannot be written, CPython silently skips caching — the failure mode is a slower import, never a broken one.

### The allowlist does not retire — it is RE-FOUNDED, and the gate is why

**This is the one place the act departs from the registered wording, and it departs because the premise failed a measurement.** Item 1 expected that once the runner stops writing bytecode into the legs there is nothing left to pass over. It was retired outright at `e85d15384`, and **`pytest-suite` failed 23 tests** — all in `tests/snapshot_equivalence`, all cascading from `equivalence-reach-unavailable … !! src/opendox/__pycache__/{__init__,corpus_adapter}.cpython-312.pyc` ([run 35660132139](https://github.com/opensoft/openxFactory/actions/runs/35660132139)). Those two files come from a **second, independent reach**: `scripts/corpus_adapter_openxfactory/` puts `openDox/code/src` on `sys.path` itself and never mentions `carved_reach` (RULED OQ-Q, `#872`). Reproduced exactly here — `import corpus_adapter_openxfactory.adapter` with no prefix set leaves precisely those two `.pyc` files.

That is the second time the premise failed (the first was `test_lens.py`'s 46 files, answered by fixing `install()`), and it settles the question: **the enumeration of importers is not closable by inspection** — any consumer, any future script, a developer running the leg's own suite inside the leg — and a required gate must not rest on "nothing anywhere ever writes a `.pyc` into a pinned checkout".

So what changes is the GROUND, which is what the finding was actually about:

| | the old rule | the rule now |
| --- | --- | --- |
| passes over | `__pycache__/<name>.pyc` | `__pycache__/<name>.pyc` |
| because | *this runner's own imports created it* — trust by PROVENANCE, which a pathname cannot establish and a crafted cache defeats | *this process cannot read it* — `sys.pycache_prefix` is set before any leg import, so CPython consults no `__pycache__` beside a source |
| asserted by | nothing | `test_a_leg_module_is_never_cached_beside_its_source`, through `importlib.util.cache_from_source()` on a real leg module |

It is the rule this file has already applied three times to scope — the spec mounts, the flag scan, the untracked read: **a state that cannot change this run's result must not refuse it.** And everything the pass-over does not cover stays dirt, tested: an ignored `.py` under `src`, and a sourceless `src/shadow.pyc` at a module's own path, which the prefix does NOT make unreachable because it moves cache lookups and not the module search path.

Three texts this act made stale are corrected with it, in round 6's idiom: `worktree_dirt()`'s "THREE READS" (it asks FOUR, and the ignored read was missing from its own list), and the two places — `unmaterialized_legs()` and `main()` — that said composing the stack writes `__pycache__` into the tree whose cleanliness the next check asserts. Runbook § 2.3 takes the same correction and states what the sweep passes over and why. **It promises no one-time cleanup, and this sentence used to** (Copilot at `34ab803e4`, "previously missed"): the cleanup was owed by the version of this act that retired the pass-over outright, and it stopped being owed when the pass-over came back at `d45522ddc` — a checkout carrying bytecode from before this change is passed over, not reported. The runbook was corrected in that commit; the description was not, until now. (A stale description is fixed in the description: it costs no push, on #1115 round 9's precedent.)

## 2. `:608` — the refusal that exists so as not to overclaim stops opening with an overclaim

Copilot's suppressed finding at `50a3e574`, with the remedy exactly as registered. The branch is the one added two rounds earlier so that a FAILED tree read would stop delivering a diagnosis it cannot support, and its first clause then said `git archive` **"matched none of"** the two archive paths — which asserts that NEITHER matched. `git archive` fails as soon as ONE pathspec matches nothing, and `_absence()` returning `None` is precisely the state in which this runner cannot say which; the next sentence of the same refusal says so outright. It now reads **"did not match at least one of"**, with `" and "` joining the list rather than `" or "`, since the two are no longer being offered as alternatives. The code, the remedy and the `ls-tree` the operator is sent to are unchanged.

---

## Measured

| | |
| --- | --- |
| `pytest tests/snapshot_equivalence` | **113 passed, 0 skipped** (95 at #1115's head, + 18) |
| the runner, end to end | `OK — 1 of 1 corpus state(s) equivalent`, exit 0, **14,849 bytes / `764b077b…0735`** |
| bytecode in the legs after a full suite run | **0** `.pyc`, 0 `__pycache__` directories |
| the CI failure, reproduced and then not reproduced | with `opendox/__pycache__/{__init__,corpus_adapter}.cpython-312.pyc` present, the runner is `ok` at the same digest and the suite is 109 passed |
| the gate's own ordering, one process — `pytest tests/ideation-dashboard tests/domain_profile tests/snapshot_equivalence` | **1248 passed, 13 skipped**, legs still clean |
| mutation sweep | **26 of 26 caught, 0 survived** |
| the LEG ADVANCE #1134 brought (openXdox-code `2529c10a` → `ab04453d`, openDox-code → `d816cf06`) | the runner still `OK`, **same 14,849 bytes / `764b077b…0735`** — the floor doing exactly what it exists for, across a real leg bump |
| doc-health | names neither `docs/opendox-cutover-runbook.md` nor any file this PR touches |

The six new tests: the ORDER (a fake reach records `sys.pycache_prefix` at `require()`, `install()` and the first `module()` — the real reach sets the same prefix, so only a fake can say which of the two did it); a host's own prefix left alone; a real end-to-end run leaving both pinned trees byte for byte as it found them; `cache_from_source()` for a leg module landing outside the leg, which is the exposure stated the way CPython states it; the runner's and the reach's spellings of the cache home held together; and the reach taking every importer's bytecode out of the legs, probed in two fresh interpreters.

**A note on the sweep, because it went wrong first and the second run is the one quoted.** The mutant that puts the cache home INSIDE a leg leaves `.pyc` files there that restoring the SOURCE does not remove, so the three mutants after it were "caught" by their predecessor's mess rather than by their own defect (24 failures each, in 17s). The harness now clears both `__pycache__` and a stray `.pycache` from the legs before every run; in the honest sweep those same mutants fail exactly one test each. 12 of 12, with each result its own.

## Copilot, two rounds, both FACT and both taken

**Round 1** — keeping every non-`None` prefix was a hole: `PYTHONPYCACHEPREFIX` inside a pinned mount defeats the guarantee it is being kept for, a LEG-ROOT prefix puts the cache inside the pin *and* outside the `src` the sweep scans, and even an in-`src` prefix is read during `post_stack()`, which imports the legs BEFORE `verify_pins()` sweeps anything — so "caught later" is not caught for an exposure whose content is that code ran. A chosen prefix is now kept only while it resolves outside every pinned mount; relative prefixes go too (CPython resolves a relative head at WRITE time against a working directory this runner does not control) and symlinks are resolved on both sides.

**Round 2** — the fallback was not held to the rule it enforces: a pre-existing `<repo>/.pycache` that is a SYMLINK into a pinned mount lands the cache exactly where the function exists to keep it out of. Both are checked now, with a freshly created `mkdtemp()` as the last resort — a directory this process just made cannot hold a crafted cache to read, and `install()` runs in every conftest here, so a stray symlink in one checkout must not become an ImportError in all of them.

**Round 3** — and this one is a defect one commit old: round 2 promised that a stray symlink must not become an ImportError in every conftest here, then asked `Path.resolve()` for an answer it RAISES on. Measured on this repository's own interpreter, CPython 3.12.3: `Path("a").resolve()` on a cyclic link raises `RuntimeError: Symlink loop`, with `strict=False` as well as `strict=True` — while `os.path.realpath()` swallows it and returns the path unresolved, which is exactly why reading one's behaviour off the other is wrong. `_resolved()` answers `None` where the filesystem will not answer and the caller fails safe on it: a path that cannot be SHOWN to be outside every pinned mount is treated as inside.

**Round 4** — and this is the one that looked safe: `PYTHONPYCACHEPREFIX=/` passed the predicate as "outside every pin", and is the opposite. In prefix mode CPython does not put the cache AT the prefix — `cache_from_source()` appends the source's OWN absolute directory and drops the `__pycache__` component — so the filesystem root maps a leg module straight back beside its own source. Measured: with `PYTHONPYCACHEPREFIX=/`, `cache_from_source(<leg>/src/openxdox/generator.py)` is `<leg>/src/openxdox/generator.cpython-312.pyc`, inside the pin and read before `verify_pins()` sweeps. The predicate now maps each mount through CPython's own rule and refuses a prefix whose cache would LAND in the pin, so the root is refused as the case it is rather than as a special case.

Replacing rather than refusing, in all four rounds, is `GIT_ATTR_NOSYSTEM`'s precedent in this same file: an ambient variable that would weaken a guarantee is overridden, never turned into a required gate's refusal.

**Round 5 is REGISTERED, not taken** ([comment 5769773339](#1132 (comment))), and the head stops moving for this class as `d815f2970` said it would. Its first half is true — honouring a host prefix trusts whoever can write inside it, and `inside_a_pinned_mount()` is a LOCATION predicate, never a trust one. Its second half is what round 4 closed: no accepted prefix can redirect a lookup into a pinned leg. What remains is environment trust, which an actor who can set `PYTHONPYCACHEPREFIX` defeats through `PYTHONPATH` or `PYTHONSTARTUP` in the same breath — this lane's own threat model, on the record at `r4049745762`. Remedy registered with both options and a recommendation.

**The naming nit is answered rather than taken:** `every_importers_bytecode` is the quantifier the test is about — EVERY importer's bytecode, not all of some bytecode — and `all_importers_bytecode` moves the quantifier onto the wrong noun.

---


Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants