Skip to content

Carve manifest grammar: a moved row may also be replicated, and a replica may declare edits (RULED Q-L7 (a), split-opendox § 3.1) - #895

Merged
brettheap merged 6 commits into
mainfrom
change/opendox-carve-manifest-also-replicated-and-replica-edits
Sep 10, 2026
Merged

brettheap merged 6 commits into
mainfrom
change/opendox-carve-manifest-also-replicated-and-replica-edits

Conversation

@brettheap

@brettheap brettheap commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)

Refs #656

The ruling

RULED Q-L7 = (a) (Brett Heap, 2026-09-10, verbatim "rule Q-L7 (a)"): amend the carve manifest so tests/ideation-dashboard/session_fixtures.py (a moved_verbatim row to opendox_code) is ALSO replicated at openxdox_code, in ONE amendment together with the conftest-depth fix: the tests/ideation-dashboard/conftest.py replica's line 25 REPO_ROOT = HERE.parent.parent must read one level shallower at both code legs (it arrives at tests/conftest.py, one directory up from its source depth).

What that takes, because both facts sit outside today's grammar (a row is either moved or replicated; a replica is byte-identical and declares no line): a manifest-grammar extension plus its realizations — scripts/validate-carve-manifest.py (the grammar's check), scripts/verify-carve-arrival.py (replica admission: a moved row named by --replica-at only when the manifest says it is also replicated there; a replica with declared lines verified at phase B like a moved row), the runbook § 2.1 / § 5.6, tests/carve_manifest + tests/carve_arrival. Candidate encodings the author weighs and discloses: an optional also_replicated_to: list on a moved row (the FLOOR PART 1 successor's replicated_to: field is the natural home — this may be its first realization), and edits: permitted on a replicated_at_destination row, applied identically at every replica.

— #656 comment 5618683833, read with HEADS-UP for LEG 3 above it (5618632276) and LANDED — CARVE LEG 1 below it (5618797424).

One correction to the ruling's own wording, recorded rather than silently applied: session_fixtures.py is a moved_with_declared_edit row, not moved_verbatim — it declares four import rewrites lines (:43, :390, :413, :440). That is what makes the encoding decision below load-bearing rather than cosmetic, so it is stated here and in the row's own note.

The encoding, and why

addition where what it says
also_replicated_to: [<destination key>, …] optional, on a moved row the row's bytes MOVE to its destination and are ALSO replicated, on RULED OQ-A's terms, at each destination named. It carries no arrival path: a replica's placement is the leg's (RULED OQ-C), declared with --replica-at, which is why the completeness check's arrivals map is untouched
edits: permitted on a not_moved / replicated_at_destination row only the declared lines are the only lines a copy may differ from its carve blob on, applied identically at every replica; lines bounded by the source blob at carve_commit, exactly as a moved row's

Two optional fields; three dispositions still, no fourth; no new refusal code, no new --json key, no new arrival path. The old validator refuses the amended document (carve-shape-invalid — rows[310] carries the unknown key(s) ['also_replicated_to']) and the new validator accepts main's manifest unchanged (OK … 456 row(s) … 318 digest(s) recomputed), so the grammar and its check move together and nothing already landed re-reads.

Why also_replicated_to: rather than a second row. A second row would have to be a second disposition or a second source_path — and the surface check refuses two rows for one file by name (carve-file-duplicated: "a file has exactly one disposition and exactly one destination, and a file with two rows has neither"). One field on the one row keeps that true, adds no placement, and leaves check 4 alone.

Why the row's declared edits are lawful at the replica. MEASURED at the carve commit: the three modules :43/:390/:413/:440 name — ideation_dashboard.session_pr, .cli, .actor_identity — are all opendox_code rows arriving at src/opendox/. So ideation_dashboard.X → opendox.X is the correct text at openDox-code (its own package) and at openXdox-code (which pins openDox — § 5.1's "two pin moves per hop", realized as openXdox-code #4 → aef883dd). Not openxdox.X: that would name modules openXdox does not own.

Why edits: still refuses under every other not_moved reason. A replica's bytes arrive; a stays_* or deleted_at_carve row's arrive nowhere, and a carve edit to a file that arrives nowhere is the contradiction check 6 exists to name. This is what keeps RULING OQ-B's three stays_openxfactory_governance rows (tests/notebooklm/*) recording their import rewrite in evidence:, as their own text says they must.

It does NOT realize the owed replicated_to: field, and the packet spells no such name. Design § D6 (2) clause (b) and tasks.md § 5.4 (b) owe FLOOR PART 1 a field on a test-bearing replica row naming the set of repositories its copies land in — "the retained openxFactory copy included" — so that Σ over replicated rows of (m − 1) × row_test_count is computable; the packet's own words are "the row grammar of docs/opendox-carve-manifest.yaml gains the field in FLOOR PART 1's OWN successor pull request … until it lands the enumeration below IS the declaration", and it names no spelling for it. MEASURED at carve_commit: both files this ruling touches carry zero def test_, so neither enters that Σ and neither clause is realized here. also_replicated_to: names destinations: KEYS for arrival admission and excludes the retained openxFactory copy by construction; the owed field names repositories for an arithmetic. One row could carry both without either meaning the other. Recorded in the manifest header, the validator docstring and § 2 of the runbook so nobody later reads one as the other, and asserted by test_the_grammar_extension_names_the_ruling_and_not_the_owed_field.

Re-measured for § 9 while there: 20 replica rows now (18 when RULING OQ-K was measured, plus RULING Q-L1's two § 2.4 seams), of which 3 are test-bearing carrying the same 30 def test_ — test_conformance.py 20, test_interface_closure.py 6, test_no_home_vocabulary.py 4 — so every term in OQ-K's arithmetic stands and only the row total moved. The packet's own 18 is left alone: nothing under openspec/ is edited by this act, so the re-measurement lands in the runbook, which is where the operator reads it.

The two row changes

  - source_path: tests/ideation-dashboard/session_fixtures.py
    disposition: moved_with_declared_edit
    git_mode: '100644'
    sha256: "61cf18d0…"
    destination: opendox_code
    destination_path: tests/session_fixtures.py
    also_replicated_to: [openxdox_code]          # NEW
    edits:
      - class: import rewrites
        lines: [43, 390, 413, 440]               # unchanged; note AMENDED

  - source_path: tests/ideation-dashboard/conftest.py
    disposition: not_moved
    reason: replicated_at_destination
    evidence: "… AMENDED under RULING Q-L7 (a) …"
    edits:                                       # NEW — the first on any replica row
      - class: path constants
        lines: [25]

path constants and not adapter calls, under RULING OQ-1's own reservation of that class for PACKAGE-INTERNAL path arithmetic — gate_console.py:567's parents[2] is the ruling's own example and this is the same shape. Nothing corpus-shaped is settled here.

:24's TESTS_ROOT = HERE.parent is deliberately NOT declared, and that is measured, not assumed. Under pytest's default prepend import mode pytest itself puts the arrived conftest's own directory on sys.path before the module body runs, so :106's from session_fixtures import … and :94's from staging_shapes import … resolve at the destination while :27's own insert adds the repository root. Declaring a line no destination needs edited would be a claim the arrival verifier then has to be told to ignore. (Line numbers re-read out of the blob at b075fd91: :23 HERE, :24 TESTS_ROOT = HERE.parent, :25 REPO_ROOT = HERE.parent.parent, :26 sys.path.insert(0, str(REPO_ROOT / "scripts")), :46 base = (start or REPO_ROOT).resolve(), :245 runtime = REPO_ROOT / "scripts" / "ideation_dashboard".)

Validator and verifier semantics, in one table

the shape --replica-at may name it phase A phase B undeclared, in the walk manifest refusals
replica row, no edits: (19 rows) yes, at any destination byte-identical byte-identical admitted by identity with its non-empty carve blob unchanged
replica row declaring lines (1 row) yes, at any destination byte-identical — commit A places the copy diff against the carve blob touches ONLY the declared lines, else arrival-undeclared-edit naming them and the placed path its APPLIED bytes are no replica's → arrival-undeclared-file, whose remediation now names --replica-at first carve-shape-invalid (edits shape, line past EOF at carve_commit), carve-vocabulary-unknown (class), carve-disposition-inconsistent (any other not_moved reason)
moved row with also_replicated_to: (1 row) iff the destination verified is in the list and is not the row's own → else arrival-unreadable byte-identical, and its git_mode is compared (a moved row declares one) its own declared lines, exactly as at the destination it moves to admitted by identity with its carve blob, at the listed destinations only carve-shape-invalid (not a non-empty list of distinct labels; on a not_moved row, its own arm), carve-vocabulary-unknown (unknown key), carve-disposition-inconsistent (the row's own destination)

Refusal-code sets (both scripts, diffed against main: IDENTICAL), exit codes 0/2, the --json key sets (the arrival summary dict diffed against main: IDENTICAL; the validator's own key list identical run-for-run) and the surface walk are unchanged. The only behavioural change outside the new grammar is one remediation string: arrival-undeclared-file used to offer only --allow-created, which is the WRONG act for an edited replica placed without declaring it — it would record that the destination ASSEMBLED a file the carve shipped.

The unapplied-replica-edit decision

An unapplied declared edit on a replica is UNAPPLIED AND LAWFUL — the moved row's own rule, not a new one — and it is COUNTED in declared_edits_unapplied. Its diff touches no undeclared line, which is the only question RULING OQ-1's sentence asks. What refuses an unapplied REPO_ROOT = HERE.parent.parent is the destination's own suite, where a root pointing outside the repository is hundreds of setup errors and not an opinion. Stated in the verifier docstring, the runbook § 2.1 ("read the unapplied figure before reading the leg as done") and a test — and demonstrated live below as case (2) and case (8).

And the limit that comes with it, recorded rather than implied: "applied identically at every replica" is a bound on LINES. One destination is verified per run — that is what --destination means — so two legs that edited the same declared line differently would both pass. The identity of the applied text is the placing pull request's claim plus each leg's own validate. test_two_legs_may_apply_one_replicas_line_differently pins that limit. This is the one place a cross-destination refusal does not exist: there is no cross-destination comparison to refuse it with, and inventing one would mean this verifier deriving a claim the manifest does not make. What DOES refuse is a different edit at the second replica (arrival-undeclared-edit), which is tested and shown as case (5).

Counts (every one re-derived from the amended file)

figure before after
rows 456 456
moved_verbatim / moved_with_declared_edit / not_moved 172 / 146 / 138 172 / 146 / 138
rows that move (digests recomputed) 318 318
replicated_at_destination rows 20 20 (one of them now declaring a line)
declared edit lines 793 794
— by class (import rewrites / path constants / adapter calls) 636 / 131 / 26 636 / 132 / 26
rows carrying edits: 146 147 (146 moved + 1 replica)
per-destination declared lines (250 / 6 / 537 / 0) sum 793 unchanged — the 794th line is a replica row's and belongs to no destination column, which § 2 now says under the table
test-bearing replica rows / their def test_ 3 / 30 3 / 30

Carried into: the manifest's own header/grammar prose, docs/opendox-cutover-runbook.md § 2 (disposition table, totals, the amendment paragraph), § 2.1 (all 18 such rows → 20, two of the 18 → 20, plus the semantics table), § 5.5, § 5.6, § 9 (FLOOR PART 2's 18 → 20), the README doc index, and the two suites. scripts/verify-carve-arrival.py's stale :92 "18 replica rows" is corrected at all three of its sites (:92, :750, :1207) — and at the fourth site of the same claim, found on re-verification and fixed in fb170690: tests/carve_arrival/…::test_a_declared_replica_is_verified_against_the_carve_blob's docstring measured "all 18 rows carry neither". Re-measured: 20 replica rows, all 20 carrying no destination, no destination_path, no sha256 and no git_mode.

Proof

Every output below is from a fresh clone. The validator lines and the openspec/doc-health figures were captured at fb170690; the suite totals and the leg demonstration are re-run at this head (59a226d2), whose only change is the Copilot round's defensive read — no count, no refusal code and no --json key moves with it.

scripts/validate-carve-manifest.py, every documented mode, exit 0

$ python3 scripts/validate-carve-manifest.py                      # mode 1, from a descendant
OK <repo>/docs/opendox-carve-manifest.yaml: 456 row(s) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0), verified at fb170690d7d1 — 172 moved_verbatim, 146 moved_with_declared_edit, 138 not_moved; 318 digest(s) recomputed; 456 file(s) in the declared surface with none undeclared
exit=0

$ python3 scripts/validate-carve-manifest.py --at b075fd91dc8fced8e1373825ba80220c33536bae   # mode 2, the carve commit
OK <repo>/docs/opendox-carve-manifest.yaml: 456 row(s) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0) — 172 moved_verbatim, 146 moved_with_declared_edit, 138 not_moved; 318 digest(s) recomputed; 456 file(s) in the declared surface with none undeclared
exit=0

$ python3 scripts/validate-carve-manifest.py --at fb170690d7d163c5cdad50002e2e0f64d53c0807   # mode 3, this head
OK <repo>/docs/opendox-carve-manifest.yaml: 456 row(s) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0), verified at fb170690d7d1 — 172 moved_verbatim, 146 moved_with_declared_edit, 138 not_moved; 318 digest(s) recomputed; 456 file(s) in the declared surface with none undeclared
exit=0

$ python3 scripts/validate-carve-manifest.py --json               # mode 4
{"result": "ok", "manifest": "<repo>/docs/opendox-carve-manifest.yaml", "carve_commit": "b075fd91dc8fced8e1373825ba80220c33536bae", "verified_at": "fb170690d7d163c5cdad50002e2e0f64d53c0807", "carve_tag": "opendox-carve-0", "source_repository": "opensoft/openxFactory", "rows": 456, "dispositions": {"moved_verbatim": 172, "moved_with_declared_edit": 146, "not_moved": 138}, "digests_recomputed": 318, "surface": 456}
exit=0

$ cd /tmp && python3 <abs>/scripts/validate-carve-manifest.py --repo <abs> \
      --at $CARVE_COMMIT --manifest <abs>/docs/opendox-carve-manifest.yaml   # mode 5, § 5.2's control
OK <repo>/docs/opendox-carve-manifest.yaml: 456 row(s) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0) — 172 moved_verbatim, 146 moved_with_declared_edit, 138 not_moved; 318 digest(s) recomputed; 456 file(s) in the declared surface with none undeclared
exit=0

Seven mutations of the REAL manifest, each refusing with the code the grammar promises. A control first, because a mutation suite that never passes proves nothing: the amended document round-tripped through yaml.safe_dump still answers OK … 456 row(s).

--- M1 also_replicated_to names a destination nobody declared
FAIL <scratch>/mut.yaml: carve-vocabulary-unknown — rows[310] (tests/ideation-dashboard/session_fixtures.py).also_replicated_to[0] declares 'opendox_kode', which is not a key of `destinations:` (['opendox_code', 'opendox_root', 'opendox_spec', 'openxdox_code', 'openxdox_spec'])…

--- M2 also_replicated_to names the row's OWN destination
FAIL <scratch>/mut.yaml: carve-disposition-inconsistent — rows[310] … moves to `destination: 'opendox_code'` and lists that same key in `also_replicated_to:`. The row already places the file there, at its own `destination_path` — ALSO means somewhere else…

--- M3 the replica row declares a line past the end of its blob at the carve commit
FAIL <scratch>/mut.yaml: carve-shape-invalid — rows[291].edits[0] (tests/ideation-dashboard/conftest.py) names line 9999, and the blob at b075fd91dc8f carries 271 line(s)…

--- M4 the replica row's edits: moved onto a stays_openxfactory_adapter row
FAIL <scratch>/mut.yaml: carve-disposition-inconsistent — rows[292] (…/avatar-client-lab.md) is `not_moved / stays_openxfactory_adapter` and declares 1 edit(s); a file that arrives nowhere takes no carve edit. RULED Q-L7 (a) admits `edits:` on a `replicated_at_destination` row ONLY…

--- M5 also_replicated_to on a not_moved row (its own arm)
FAIL <scratch>/mut.yaml: carve-shape-invalid — rows[291] … is `not_moved` and carries `also_replicated_to:`. RULED Q-L7 (a) puts that key on a MOVED row … a `not_moved` row declares no destination at all, so it cannot declare an additional one…

--- M6 also_replicated_to as an empty list
FAIL <scratch>/mut.yaml: carve-shape-invalid — rows[310] … declares `also_replicated_to: []`; a non-empty list of `destinations:` labels is required…

--- M7 the replica row declares an edit class outside the closed three
FAIL <scratch>/mut.yaml: carve-vocabulary-unknown — rows[291].edits[0] … declares `class: 'depth arithmetic'`, which is not one of ['import rewrites', 'path constants', 'adapter calls']…

python3 -m pytest -q tests/carve_manifest tests/carve_arrival

187 passed in 53.17s

159 existing collected on main (88 + 71, re-collected here in a main worktree) + 28 new = 187 (100 + 87): 12 manifest cases, 16 arrival cases (14 authored, 2 from the Copilot round). tests/doc-health (the checker's own suite, which reads the runbook and the README): 1680 passed, 7 warnings in 393.52s.

Whole-manifest re-parse under a duplicate-key-RAISING loader (a previous amendment shipped a duplicate note: key PyYAML swallowed), with a control proving the loader raises

DUPLICATE-KEY-RAISING RE-PARSE: OK — 456 rows, 14 top-level keys, no duplicate key anywhere in the document
CONTROL: the loader DOES raise — duplicate key 'a'

OPENSPEC_TELEMETRY=0 openspec validate --all --strict (CLI 1.2.0) — no NEW failure

branch (fb170690):     Totals: 98 passed, 3 failed (101 items)
main   (3b45c037):     Totals: 99 passed, 3 failed (102 items)
both, the same three:  ✗ change/disposition-codexfactory-declared-renames
                       ✗ spec/neutral-product-pin
                       ✗ spec/repo-boundary-governance

The one-item difference is main's own new change/amend-modified-block-currency-standing, which PASSES; the item-list diff between the two runs is exactly that one line.

doc-health --single-repo ., branch vs main (3b45c03) — delta named

main:   Findings: 32 critical, 5 error, 47 warning, 14 info. New regressions vs previous report: 0.
branch: Findings: 32 critical, 5 error, 47 warning, 14 info. New regressions vs previous report: 0.
finding-set diff (98 findings each side, repo label normalised): 0 added, 0 removed — IDENTICAL
whole-report diff: 2 lines, both the same fact

The only delta is the governance-word denominator: 39.5% (362863 / 918816) → 39.4% (362863 / 919933), from draft 158938 → 160055 words — i.e. +1,117 governance words of new runbook § 2 / § 2.1 text and no canon words. That is the expected direction when a draft document grows (the README's own note: the ratio dips when new drafts land).

The leg-side demonstration, on the REAL manifest at the destination LEG 3 will use. A scratch openxdox_code destination materialised from the carve blobs — all 92 rows (9 verbatim / 83 declared-edit, 537 declared lines) plus the two declared replicas at tests/conftest.py and tests/session_fixtures.py:

(1) phase A, everything byte-identical from the carve blobs
OK <dest>: openxdox_code (opensoft/openXdox-code) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0), phase A — 92 row(s) arrived, 92 digest(s) verified, 0 declared-edit row(s) within their lines, 0 unapplied; 2 of 2 declared replica(s) verified (byte-identical, or — where the row declares lines — differing only on them); 94 file(s) under scripts, src/openxdox, tests with none undeclared (0 scaffold, 0 replica, 0 created); scaffold admissions by NAME ONLY (no --dest-base and no origin/main at the destination)
exit=0

(2) phase B, NOTHING applied yet — THE UNAPPLIED QUESTION: still OK
… phase B — 92 row(s) arrived, 9 digest(s) verified, 0 declared-edit row(s) within their lines, 85 unapplied; 2 of 2 declared replica(s) verified …
exit=0                    # 85 = 83 moved-with-edit rows + BOTH replicas' unapplied declared lines

(3) phase B, conftest :25 -> HERE.parent and session_fixtures :43/:390/:413/:440 -> opendox.X
… phase B — 92 row(s) arrived, 9 digest(s) verified, 2 declared-edit row(s) within their lines, 83 unapplied; 2 of 2 declared replica(s) verified …
exit=0                    # the ruling's intended arrival: both replicas edited, within their lines

(8) phase B, session_fixtures APPLIED and the conftest replica UNEDITED
… phase B — 92 row(s) arrived, 9 digest(s) verified, 1 declared-edit row(s) within their lines, 84 unapplied; 2 of 2 declared replica(s) verified …
exit=0                    # mixed: one replica diffed, the other unapplied — and lawful

(4) phase A over that same applied tree — REFUSES
FAIL <dest>: arrival-digest-mismatch — the replica of tests/ideation-dashboard/conftest.py at tests/conftest.py has sha256 918e3c2ec033430e62200424fa840435fb9cb5be14a72a86e2a4a4b98286cd60 where its blob at b075fd91dc8f has ee935aa4e3550683508b999d477f47d75682fd078222c3779c964d5133f59601. … Its row DECLARES lines (RULED Q-L7 (a)) and PHASE A requires the carve commit's bytes exactly: commit A places the copy, commit B applies the declared edit, at a replica exactly as at a moved row.
exit=2

(5) phase B with :24 ALSO edited (a line the row does NOT declare) — the fence holds
FAIL <dest>: arrival-undeclared-edit — tests/conftest.py was edited at carve-commit line(s) [24] which the row for tests/ideation-dashboard/conftest.py does not declare; it declares [25] under class(es) path constants. …
--- carve:tests/ideation-dashboard/conftest.py
+++ arrived:tests/conftest.py
@@ -23,4 +23,4 @@
 HERE = Path(__file__).resolve().parent
-TESTS_ROOT = HERE.parent
-REPO_ROOT = HERE.parent.parent
+TESTS_ROOT = HERE
+REPO_ROOT = HERE.parent
 sys.path.insert(0, str(REPO_ROOT / "scripts"))
exit=2

(6) the applied conftest left UNDECLARED — the walk's own refusal, with the right remedy
FAIL <dest>: arrival-undeclared-file — tests/conftest.py sits under a declared root and no row places it … If it IS a replica this destination places, declare it with `--replica-at <source_path>=tests/conftest.py` — which is also the ONLY way a replica whose row declares lines (RULED Q-L7 (a)) can be read as one, because its edited bytes match no blob at the carve commit and the byte-identity admission cannot see it. …
exit=2

(7) --replica-at naming the moved row at the destination it MOVES to — the `iff`
FAIL <dest>: arrival-unreadable — --replica-at names 'tests/ideation-dashboard/session_fixtures.py', which at destination 'opendox_code' is neither a `not_moved / replicated_at_destination` row of this manifest nor a moved row whose `also_replicated_to:` lists this destination (RULED Q-L7 (a)). …
exit=2

So, to the question asked in as many words: the edited form is OK at phase B, and the UNEDITED form is also OK at phase B — unapplied, lawful, counted, and the runbook § 2.1 says exactly that and tells the operator to read the unapplied figure before reading a leg as done. Which is also why leg 1 (openDox-code #6, merge ce53b489) is not re-cut for the depth fix: it takes it in a later declared act, on the ruling's own sequencing, and § 5.5 now says so in the runbook.

Commits

commit what
b8302354 the machinery — both grammar halves in validate-carve-manifest.py and verify-carve-arrival.py, and the :92/:750/:1207 "18 replica rows" wording
149d5094 the manifest amendment — the two rows, with the measurements in their notes and the amended header counts
9919d7ea the 26 tests, and the one code change a test found (arrival-undeclared-file naming --replica-at first)
13de5e2f the runbook § 2 / § 2.1 / § 5.5 / § 5.6 / § 9 and the README doc index
fb170690 re-verification of the pushed branch: the FOURTH site of the stale replica count, and the two wraps this act left
59a226d2 the Copilot round's one FACTUAL finding: also_replicated_to: read as a list of strings or nothing

Copilot's round

Three threads, all replied and resolved.

thread class disposition
"the new grammar/validation for also_replicated_to … is not exercised by the existing carve-manifest tests" (validate-carve-manifest.py) STALE reviewed at b8302354, the machinery commit, whose own message says "the manifest amendment and the counts follow". 12 manifest cases landed at 9919d7ea, each named in the reply
"the new arrival-verification behavior for replicas … is not covered by the current subprocess test suite" (verify-carve-arrival.py) STALE same commit; 16 arrival cases, each named in the reply, plus the eight-case live demonstration above
"also_replicated_rows() … tests membership with destination in (row.get("also_replicated_to") or []). If also_replicated_to is accidentally a string … Python will treat it as an iterable of characters" (verify-carve-arrival.py:585) FACTUAL — accepted fixed in 59a226d2. Real: 'scratch_spec' in 'not_scratch_spec_at_all' is True, so a substring of a hand-edited string admitted the row and --replica-at could then re-point it

The third is the one worth stating plainly, because Copilot's premise is the file's own posture rather than a guess: this script READS the manifest and does not revalidate it (it says so at eleven run scripts/validate-carve-manifest.py remediations), and _declared_line_set already guards edits[].lines at every level for exactly this reason — the new key was read one level less carefully than the key beside it. _also_replicated_labels(row) now returns a list of strings or nothing; one call site. The shape itself is still the VALIDATOR's refusal (carve-shape-invalid, pinned over six malformed forms including the bare string), which is why this is a defensive read and not a second validation.

Two tests, and the first FAILS against the unguarded line — proven by reverting it, at which point also_replicated_rows returns the row and the copy walks in.

Sourcery declined the round on a rate limit ("you've used your own review budget of 250,000 diff characters for the last 7 days"), not on the diff. SonarCloud: pass.

Fence

Nothing under openspec/ is edited (read-only throughout; the packet's own § D6 / § 5.4 text is quoted, not amended — including its own stale 18). No row added, moved or re-dispositioned. No digest recomputed and no history rewritten. Leg 1 is not re-cut.

Lands on Brett Heap's ruling Q-L7 (a), via the lane's gate; required before LEG 3 (openXdox-code) builds commit B.

🤖 Generated with Claude Code

…, and a replica may declare edits

RULED Q-L7 (a) (Brett Heap, 2026-09-10, verbatim "rule Q-L7 (a)"; #656
comment 5618683833). Carve leg 1 measured two facts today's grammar cannot
hold — a row is either moved or replicated, and a replica is byte-identical
and declares no line — so the act is one grammar extension with its two
realizations. This commit is the machinery; the manifest amendment and the
counts follow.

`validate-carve-manifest.py`
  * `also_replicated_to: [<destination key>, ...]` on a MOVED row: shape in
    check 1 (non-empty list of distinct labels; its own refusal arm on a
    `not_moved` row, whose "nothing arrives" message is false of a replica),
    membership in check 5 beside `destination`, and the row's OWN destination
    refused in check 6 — a row already places the file there, and admitting it
    would let `--replica-at` re-point a declared arrival.
  * `edits:` on a `not_moved / replicated_at_destination` row: check 6 admits
    it under that ONE reason and refuses it under every other, so RULING OQ-B's
    three `stays_openxfactory_governance` rows keep recording their rewrite in
    `evidence:`. The lines are bounded by the source blob at `carve_commit` in
    check 3, where every other declared line is bounded — one `cat-file` per
    such row, because a `not_moved` row carries no digest for pass 1 to have
    read the blob for.
  * It is NOT RULING OQ-K's owed FLOOR PART 2 field: that one names
    REPOSITORIES on a TEST-BEARING replica row for the multiplicity sum, the
    packet spells no name for it, and both files this ruling touches carry zero
    `def test_` at the carve commit. Recorded in the docstring rather than
    conflated.

`verify-carve-arrival.py`
  * `--replica-at` admits a MOVED row's `source_path` iff the manifest lists
    the destination being verified in that row's `also_replicated_to:` and it
    is not the row's own destination — the flag still cannot re-point an
    arrival the manifest declared.
  * A declared replica whose row declares lines is verified at phase B like a
    moved row (`_check_declared_lines`, now naming the `--replica-at` path
    rather than a `destination_path:` a replica row does not carry) and
    byte-identical at phase A. Its mode is compared only where the row declares
    one. Unapplied is lawful and COUNTED with the moved rows' unapplied edits.
  * The walk admits an also-replicated row's carve bytes as a replica's; an
    EDITED replica must be declared, and undeclared it refuses
    `arrival-undeclared-file` naming the flag.
  * "Applied identically at every replica" is a bound on LINES: one destination
    is verified per run, so nothing here compares two legs' copies with each
    other. Stated in "WHAT IT DELIBERATELY DOES NOT PROVE" rather than implied.
  * The stale ":92 18 replica rows" wording is corrected to 20 at all three
    sites.

Refusal codes, exit codes 0/2 and the `--json` key set are unchanged; the
surface walk and every existing refusal are untouched (88 + 71 = 159 existing
tests green, and the real manifest answers `OK 456 row(s)`).

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 10, 2026 13:19
@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR amends the carve grammar and arrival verifier so a moved row can declare additional replica destinations and a replicated row can declare identical edits applied at every replica, with closed-vocabulary validation, source-blob line bounds, destination-scoped --replica-at admission, and consistent verification/accounting.

Sequence diagram for validating and verifying replicated carve rows

sequenceDiagram
    participant Manifest as CarveManifest
    participant Validator as validate-carve-manifest.py
    participant Verifier as verify-carve-arrival.py
    participant Destination as DestinationRepository

    Manifest->>Validator: check_vocabularies()
    Validator-->>Manifest: Validate also_replicated_to destinations
    Manifest->>Validator: check_disposition_consistency()
    Validator-->>Manifest: Admit moved replicas or replicated_at_destination edits
    Verifier->>Verifier: parse_replica_placements(values, doc, destination)
    Verifier->>Destination: Check --replica-at SOURCE=PATH
    Destination-->>Verifier: Read arrived bytes and mode
    Verifier->>Verifier: check_replicas(..., phase)
    Verifier-->>Destination: Verify byte identity or declared lines
    Verifier-->>Manifest: Count verified, diffed, and unapplied replicas
Loading

State diagram for replicated row verification across carve phases

stateDiagram-v2
    [*] --> PhaseA
    PhaseA: Replica arrives byte-identical to carve blob
    PhaseA --> PhaseB: Destination advances to phase B
    PhaseB --> DeclaredEdit: Row has edits and --replica-at path
    PhaseB --> ByteIdentity: Row has no edits
    DeclaredEdit --> Verified: Diff touches only declared lines
    DeclaredEdit --> Unapplied: Arrived bytes remain identical
    ByteIdentity --> Verified: Bytes match carve blob
    Verified --> [*]
    Unapplied --> [*]
Loading

Flow diagram for moved rows with additional replicas

flowchart LR
    M[Moved row\ndestination + destination_path] --> V{also_replicated_to?}
    V -->|No| D[Verify at declared destination]
    V -->|Yes| L[Validate non-empty unique destination keys]
    L --> A[Admit replicas only at listed destinations]
    A --> R[Use --replica-at SOURCE=PATH]
    D --> C[Check mode and bytes]
    R --> C
    C --> E{edits declared?}
    E -->|No| B[Require byte identity]
    E -->|Yes| X[Require phase-B changes only on declared lines]
Loading

File-Level Changes

Change Details Files
Extend manifest validation to represent moved files that are also replicated and replicas that receive declared edits.
  • Allow non-empty, unique replica destination keys on moved rows and reject self-references or invalid destinations.
  • Permit edits only for not_moved / replicated_at_destination rows while preserving source-blob line bounds and existing disposition checks.
  • Keep replica-only rows free of destination, digest, and mode claims, and provide precise shape, vocabulary, and consistency refusals.
scripts/validate-carve-manifest.py
Verify additional replica arrivals and replica-specific edits without widening operator-controlled placement claims.
  • Treat also_replicated_to entries as replicas only at explicitly listed non-primary destinations.
  • Allow --replica-at for those additional replicas, validate moved-row modes, and verify phase A identity plus phase B declared-line-only changes.
  • Count verified, diffed, and unapplied replica edits alongside moved-row results and include additional replicas in undeclared-file admission.
scripts/verify-carve-arrival.py

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

…so replicated at openXdox-code, and the conftest replica declares its depth line

The ruling's two facts, in one amendment, with no row added, moved or
re-dispositioned:

  * `tests/ideation-dashboard/session_fixtures.py` gains
    `also_replicated_to: [openxdox_code]`. It stays a `moved_with_declared_edit`
    row to `opendox_code`; the replicated `conftest.py` imports it
    UNCONDITIONALLY at `:106`, so collecting `tests/` at openXdox-code would
    have failed at import on a file no row placed there. Its note records the
    measurement that makes one row's declared edit lawful at two legs: the three
    modules `:43`, `:390`, `:413` and `:440` name are all `opendox_code` rows
    arriving at `src/opendox/`, so `opendox.X` is the correct rewrite at
    openDox-code (its own package) AND at openXdox-code (which PINS openDox) —
    not `openxdox.X`, which would name modules openXdox does not own.
  * `tests/ideation-dashboard/conftest.py` gains the first `edits:` any replica
    row has carried: `path constants`, line 25. `REPO_ROOT = HERE.parent.parent`
    resolves outside the destination repository once the replica lands one
    directory shallower at `tests/conftest.py`, and must read `HERE.parent`. The
    class is `path constants` under RULING OQ-1's own reservation for
    package-internal path arithmetic (`gate_console.py:567`'s `parents[2]` is
    its example), not `adapter calls` — nothing corpus-shaped is resolved here.

MEASURED, not reasoned about. `:24`'s `TESTS_ROOT = HERE.parent` is deliberately
NOT declared: under pytest's default prepend import mode pytest itself puts the
arrived conftest's own `tests/` on `sys.path` before the module body runs, so
`:106` and `:94` resolve at the destination without it — measured in a scratch
tree at the arrived depth. A line no destination needs edited would be a claim
the arrival verifier then has to be told to ignore. Leg 1 is NOT re-cut for the
depth fix (the ruling's own sequencing); the record's two figures for it (391
node-gated errors, 405 conftest-depth setup errors) are carried, not re-derived.

Counts, all re-measured from the file: 456 rows and 172/146/138 dispositions
UNCHANGED; 20 `replicated_at_destination` rows unchanged (a row that is also
replicated is still a moved row); declared lines 793 → 794 with `path constants`
131 → 132; rows carrying `edits:` 146 → 147, the extra one a replica.

`python3 scripts/validate-carve-manifest.py` → `OK … 456 row(s) … 318 digest(s)
recomputed; 456 file(s) in the declared surface with none undeclared`, and the
whole document re-parses under a duplicate-key-RAISING loader.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[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

The new grammar and verification branches are not covered by the existing test suite, so correctness regressions could land without detection.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR extends the carve-manifest/arrival-verification tooling to implement RULED Q-L7 (a): a moved manifest row may also be replicated to additional destinations, and replica rows may declare bounded edits that are validated consistently across phases A/B.

Changes:

  • Extend manifest validation to support and validate also_replicated_to on moved rows, and edits: on not_moved / replicated_at_destination rows.
  • Extend arrival verification to (a) treat certain moved rows as replicas at other destinations, and (b) validate replica declared-edits in phase B using the same declared-line bounding logic as moved rows.
  • Update reporting/messages to reflect “replicas verified” semantics (byte-identical or line-bounded diffs where declared).
File summaries
File Description
scripts/verify-carve-arrival.py Adds replica handling for moved rows replicated elsewhere and supports replica rows with declared edits across phases.
scripts/validate-carve-manifest.py Extends manifest grammar/shape and consistency checks for also_replicated_to and replica-row edits: under RULED Q-L7 (a).
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • 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/validate-carve-manifest.py Resolved
Comment thread scripts/verify-carve-arrival.py Resolved
…plica-at` in the refusal an edited replica now reaches

26 new cases, 159 existing ones untouched and green (185 passed).

`tests/carve_manifest/` (+12): a moved row also replicated elsewhere verifies,
on both moved dispositions; an unknown destination in `also_replicated_to:`
refuses `carve-vocabulary-unknown`; the row's OWN destination refuses
`carve-disposition-inconsistent`; the malformed forms (empty list, bare string,
empty entry, repeat, non-string, nested list) refuse `carve-shape-invalid`; a
`not_moved` row carrying the key refuses with its own arm; a replica row may
declare edits; its line is bounded by the source blob (`names line 2` on a
one-line file); its class is still closed; `edits: []` is still the empty-list
refusal; and the FLOOR-PART-2 disclosure is asserted in the docstring that
carries it. `test_not_moved_with_edits_refuses` keeps its name and gains the
docstring saying WHICH reasons it now covers — it is RULING OQ-B's
`stays_openxfactory_governance` shape, which must keep refusing.

`tests/carve_arrival/` (+14): the fixture gains a four-line replica blob
(`harness.py`), because a one-line replica cannot express "edited a line the row
does not declare" — every insertion into it is adjacent to its only line. Then:
`--replica-at` admits a moved row at the leg the manifest replicates it to and
refuses it at the leg the row MOVES to and at a leg the list does not name; the
undeclared byte-identity admission follows the same list; an also-replicated
replica's MODE is compared, because a moved row declares one; a replica that
declares a line is verified at phase B like a moved row (counted in
`declared_edits_diffed`), refuses `arrival-undeclared-edit` naming line 4 and
the PLACED path when edited elsewhere, and refuses `arrival-digest-mismatch` at
phase A; an unapplied replica edit is lawful and counted; two legs may apply one
declared line differently and both pass — THE LIMIT, recorded by test; the human
line no longer calls an edited replica "byte-identical"; and the LANDED
manifest's two rows are read through the verifier's own row readers, with
`parse_replica_placements` admitting exactly the pair LEG 3 places.

ONE CODE CHANGE, found by the test that would not pass without it: the
`arrival-undeclared-file` refusal offered only `--allow-created`, which is the
WRONG act for a replica whose declared edit was applied without declaring the
placement — it would record that the destination ASSEMBLED a file the carve
shipped. The message now names `--replica-at` first and says why it is the only
way an edited replica can be read as one (its bytes match no blob at the carve
commit). The empty-bytes clause drops its own duplicate hint.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 10, 2026 13:30
…x: the amended counts, the per-shape semantics table, and the two placements both -code legs owe

Counts, all re-derived from the amended manifest and none transcribed from
another document:

  * § 2's disposition table: the `not_moved` row now records that ONE of the 20
    `replicated_at_destination` rows declares a line and its copies are held to
    it. 172 / 146 / 138 and 318 moved rows are unchanged.
  * § 2's totals: **793 → 794 declared edit lines** (`path constants` 131 →
    132), over **146 → 147 rows carrying `edits:`**. The 794th line belongs to
    a REPLICA row and therefore to no destination column, so the per-leg
    figures still sum to 793 and the extra line is owed by every leg that
    places that conftest — stated under the table, because 794 ≠ 250+6+537+0
    otherwise reads as an error.
  * § 2.1: `all 18 such rows` → 20, and `two of the 18 rows` → 20. Those were
    stale from RULING Q-L1 and are inside this act's fence.
  * § 9 (FLOOR PART 2): 18 → **20** replica rows, with the re-measurement that
    keeps RULING OQ-K's arithmetic intact — three test-bearing rows carrying the
    same 30 `def test_`, and Q-L7 (a)'s two rows zero-test, so no term moves.

Semantics, in one table (§ 2.1): the three shapes a replica can now take, with
what `--replica-at`, phase A, phase B and the undeclared walk each prove about
them. Then the two paragraphs the ruling's own wording needs: an UNAPPLIED
declared edit on a replica does not refuse (the moved row's rule, unchanged) and
is counted in `declared_edits_unapplied`, with the destination's own suite as
what actually refuses an unapplied `REPO_ROOT = HERE.parent.parent`; and
"applied identically at every replica" is a bound on LINES, because one
destination is verified per run — two legs editing the same declared line
differently would both pass, which the arrival suite records by test.

Operator text: § 5.5's expected phase-B line follows the human line's new
wording (`verified (byte-identical, or …)`), and says that leg 1 is NOT re-cut
for the depth fix. § 5.6 gains the two placements both `-code` legs owe — the
conftest replica everywhere, `session_fixtures.py` at openXdox-code only —
each with why it is a `--replica-at` and not an `--allow-created`.

README: the two doc-index entries carry the grammar clause and the amended
totals.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[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

also_replicated_rows() in scripts/verify-carve-arrival.py can mis-handle malformed also_replicated_to values (e.g., a string) and produce incorrect replica admission behavior rather than refusing cleanly.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify-carve-arrival.py Resolved
Copilot AI review requested due to automatic review settings September 10, 2026 13:35

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

scripts/verify-carve-arrival.py currently treats malformed also_replicated_to values as iterable containers (e.g., strings) which can incorrectly admit moved rows as replicated at a destination due to substring membership.

Review details

Suppressed comments (1)

scripts/verify-carve-arrival.py:585

  • also_replicated_rows() uses destination in (row.get("also_replicated_to") or []), which will do substring membership if a malformed manifest provides a string (e.g. "openxdox_code") instead of a list. This script explicitly does not fully validate manifest shape, so it should fail closed here to avoid incorrectly treating unrelated rows as replicated at a destination.
    return [row for row in doc["rows"]
            if isinstance(row, dict)
            and row.get("disposition") in MOVED_DISPOSITIONS
            and row.get("destination") != destination
            and destination in (row.get("also_replicated_to") or [])]
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…raps this act left

Found on re-verification of the pushed branch, all three inside this act's own
fence and none of them a restyle of anything it did not author:

  * `tests/carve_arrival/test_verify_carve_arrival.py` — the docstring of
    `test_a_declared_replica_is_verified_against_the_carve_blob` measured "all
    18 rows carry neither" (no destination, no destination_path, no sha256, no
    git_mode). That is the SAME claim, about the same rows, that this act
    corrected at `verify-carve-arrival.py:92`, `:750` and `:1207` — and it is a
    MEASUREMENT, re-measured here: 20 `replicated_at_destination` rows, all 20
    carrying none of the four. Leaving one site of a four-site claim stale is
    how the ":92 18 replica rows" item reached the leg-1 landing census in the
    first place.
  * `tests/carve_manifest/test_carve_manifest.py` — three blank lines where the
    file uses two, ahead of the RULED Q-L7 (a) section header this act added.
  * `docs/opendox-cutover-runbook.md` § 5.5 — the sentence this act extended
    left one line at 112 columns in a paragraph that wraps at ~78. Split at two
    word boundaries, so nothing after it re-wraps.

No count, no semantic and no refusal changes: `validate-carve-manifest.py` →
`OK … 456 row(s) … 318 digest(s) recomputed`, and
`pytest -q tests/carve_manifest tests/carve_arrival` → 185 passed.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 10, 2026 14: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 arrival verifier currently treats malformed also_replicated_to values as iterables (risking substring matches), and a couple of new tests include redundant assert True branches that should be simplified.

Review details

Suppressed comments (3)

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

tests/carve_arrival/test_verify_carve_arrival.py:1417

  • Same issue here: assert True is redundant in the early-return path and obscures the intent. A plain return is equivalent and clearer.
    tests/carve_manifest/test_carve_manifest.py:1656
  • assert True inside the early-return branch is redundant and makes the intent harder to read (it doesn’t assert anything about the pre-§6 case). A plain return preserves the “branch and never skip” behavior while removing dead code.

scripts/verify-carve-arrival.py:585

  • also_replicated_to is assumed to be a list, but the current implementation will treat a malformed string value as an iterable and potentially match destinations by substring (e.g., "opendox_code" would match "code"). Since verify-carve-arrival.py is an operator-facing verifier, it should at least guard against non-list types here to avoid incorrect admissions.
    return [row for row in doc["rows"]
            if isinstance(row, dict)
            and row.get("disposition") in MOVED_DISPOSITIONS
            and row.get("destination") != destination
            and destination in (row.get("also_replicated_to") or [])]
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap
brettheap marked this pull request as ready for review September 10, 2026 14:19

@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 11 hours and 55 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

… string admits no destination (Copilot round)

FACTUAL, and the first Copilot finding of the round that is not stale.
`also_replicated_rows()` tested membership with
`destination in (row.get("also_replicated_to") or [])`. A bare STRING there is
an iterable of CHARACTERS, so the test admits every destination key that is a
SUBSTRING of it: `'scratch_spec' in 'not_scratch_spec_at_all'` is True. That
reads a hand-edited manifest as replicating a file at a leg it never named —
and `--replica-at` may then re-point it, which is the one thing that flag was
narrowed to prevent.

`validate-carve-manifest.py` DOES refuse the shape
(`carve-shape-invalid`, pinned by `test_a_malformed_also_replicated_to_refuses`
with the bare-string case among six). But this file reads the manifest and does
NOT revalidate it — the shape is the validator's finding, said in as many words
at eleven `run scripts/validate-carve-manifest.py` remediations — so it must not
ACT on a shape it did not check. `_declared_line_set` already guards
`edits[].lines` at every level for exactly this reason; the new key was reading
one level less carefully than the key beside it.

`_also_replicated_labels(row)` returns a list of strings or nothing: anything
that is not a list declares nothing, and a non-string entry inside a list is
dropped rather than compared. One call site, `also_replicated_rows()`, which is
what both the `--replica-at` admission and the undeclared walk's replica set
read.

TWO TESTS, and the first one FAILS against the unguarded line (proven by
reverting it): `also_replicated_rows` returns the row, so the flag is admitted
and the copy walks in. Guarded, the flag refuses `arrival-unreadable` and the
undeclared copy refuses `arrival-undeclared-file`.

187 passed (was 185). No count, no refusal code, no `--json` key and no
behavioural change on any well-formed manifest: `validate-carve-manifest.py` →
`OK … 456 row(s) … 318 digest(s) recomputed`, and the openxdox_code leg
demonstration reproduces both phases unchanged.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 10, 2026 14:24

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

Two newly added “real manifest” tests currently no-op when the manifest is missing (assert True), contradicting their stated intent and reducing the effectiveness of the regression check.

Review details

Suppressed comments (2)

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

tests/carve_arrival/test_verify_carve_arrival.py:1417

  • Same issue as the validator suite’s “real manifest” test: assert True is a no-op, so this test passes even if the landed manifest is missing, despite the docstring claiming it’s “never a skip”. If the manifest must exist in-repo, assert it and fail loudly when it’s absent.
    tests/carve_manifest/test_carve_manifest.py:1656
  • This guard contradicts the docstring (“A BRANCH and never a skip”) and doesn’t enforce anything: assert True is a no-op, so the test silently passes when the manifest is missing. If the intent is to always assert the landed manifest is present, replace the guard with an assertion (or explicitly pytest.skip and update the docstring).
  • Files reviewed: 7/7 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-opendox-extraction

Copilot round 2 (59a226d2) raised no new review thread — its one point came through as SUPPRESSED comments, so there is nothing to resolve, and it is answered here for the record.

Two newly added "real manifest" tests currently no-op when the manifest is missing (assert True), contradicting their stated intent.

WORDING — declined, and the pattern is not this act's. assert True in the if not manifest.is_file(): arm is the PRE-EXISTING, documented idiom of these suites on main, with the reason written next to it:

    manifest = REPO_ROOT / MODULE.MANIFEST_RELPATH
    if not manifest.is_file():
        # Before the § 6 ceremony landed the manifest there is nothing to
        # compare; a BRANCH, not a skip, for the module docstring's reason.
        assert True

Two occurrences on main (tests/carve_arrival/…:1078 and :1512 at b91af6ea); the two this act adds follow it so that the § 8.2 seat reads the same way in both suites. The docstrings say A BRANCH and never a skip for that reason: a pytest.skip would make the seat report as skipped in a suite whose own floor asserts SKIPPED exactly, and this repository's pytest-suite.yml pins that triple.

The branch is also dead in fact: the manifest landed at 17167481, both real-manifest tests execute their bodies here, and the assertions they make are what pins the amendment ((794, 147) declared lines/rows, 20 replica rows, also_replicated_rows(doc, "openxdox_code") naming exactly session_fixtures.py, and parse_replica_placements admitting exactly the pair LEG 3 places). If the manifest ever were absent, validate-carve-manifest.py's own NO MANIFEST … (nothing to validate) seat is what says so, and test_the_real_repository_answers_at_the_ruled_path asserts that seat.

Changing the idiom would re-litigate a landed decision in a file this act did not author it in, so it stays. The FACTUAL finding of round 1 was accepted and fixed in 59a226d2 (also_replicated_to: read as a list of strings or nothing); all three round-1 threads are replied and resolved.

Gate at 59a226d2: SonarCloud pass, lane-line / merge-master-approval / clearing-dispatch-gate / openreposhape-pin / openspec-cli-pin / release-tag-gate / signed-execution-chain-gate / wallet-validation all pass; pytest-suite running (run 34488824919); Sourcery declined on its own 7-day diff budget, not on this diff.

🤖 Generated with Claude Code

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