Repository navigation
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
Conversation
…, 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]>
Reviewer's GuideThe 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 Sequence diagram for validating and verifying replicated carve rowssequenceDiagram
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
State diagram for replicated row verification across carve phasesstateDiagram-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 --> [*]
Flow diagram for moved rows with additional replicasflowchart 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]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
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]>
There was a problem hiding this comment.
🟡 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_toon moved rows, andedits:onnot_moved / replicated_at_destinationrows. - 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.
…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]>
…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]>
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🔵 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()usesdestination 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]>
There was a problem hiding this comment.
🔵 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 Trueis 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 Trueinside 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_tois 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"). Sinceverify-carve-arrival.pyis 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
There was a problem hiding this comment.
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]>
There was a problem hiding this comment.
🔵 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 Trueis 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 Trueis 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 explicitlypytest.skipand update the docstring).
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
|
Lane: openxfactory-4-opendox-extraction Copilot round 2 (
WORDING — declined, and the pattern is not this act's. 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 TrueTwo occurrences on The branch is also dead in fact: the manifest landed at 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 Gate at 🤖 Generated with Claude Code |



Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
Refs #656
The ruling
—
#656comment5618683833, read withHEADS-UP for LEG 3above it (5618632276) andLANDED — CARVE LEG 1below it (5618797424).One correction to the ruling's own wording, recorded rather than silently applied:
session_fixtures.pyis amoved_with_declared_editrow, notmoved_verbatim— it declares fourimport rewriteslines (: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
also_replicated_to: [<destination key>, …]destinationand 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 untouchededits:not_moved / replicated_at_destinationrow onlycarve_commit, exactly as a moved row'sTwo optional fields; three dispositions still, no fourth; no new refusal code, no new
--jsonkey, 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 acceptsmain'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 secondsource_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/:440name —ideation_dashboard.session_pr,.cli,.actor_identity— are allopendox_coderows arriving atsrc/opendox/. Soideation_dashboard.X → opendox.Xis 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). Notopenxdox.X: that would name modules openXdox does not own.Why
edits:still refuses under every othernot_movedreason. A replica's bytes arrive; astays_*ordeleted_at_carverow'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 threestays_openxfactory_governancerows (tests/notebooklm/*) recording their import rewrite inevidence:, 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) andtasks.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 retainedopenxFactorycopy included" — so thatΣ over replicated rows of (m − 1) × row_test_countis computable; the packet's own words are "the row grammar ofdocs/opendox-carve-manifest.yamlgains 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 atcarve_commit: both files this ruling touches carry zerodef test_, so neither enters that Σ and neither clause is realized here.also_replicated_to:namesdestinations: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 bytest_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.py20,test_interface_closure.py6,test_no_home_vocabulary.py4 — so every term in OQ-K's arithmetic stands and only the row total moved. The packet's own18is left alone: nothing underopenspec/is edited by this act, so the re-measurement lands in the runbook, which is where the operator reads it.The two row changes
path constantsand notadapter calls, under RULING OQ-1's own reservation of that class for PACKAGE-INTERNAL path arithmetic —gate_console.py:567'sparents[2]is the ruling's own example and this is the same shape. Nothing corpus-shaped is settled here.:24'sTESTS_ROOT = HERE.parentis 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 onsys.pathbefore the module body runs, so:106'sfrom session_fixtures import …and:94'sfrom 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 atb075fd91::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
--replica-atmay name itedits:(19 rows)arrival-undeclared-editnaming them and the placed patharrival-undeclared-file, whose remediation now names--replica-atfirstcarve-shape-invalid(edits shape, line past EOF atcarve_commit),carve-vocabulary-unknown(class),carve-disposition-inconsistent(any othernot_movedreason)also_replicated_to:(1 row)arrival-unreadablegit_modeis compared (a moved row declares one)carve-shape-invalid(not a non-empty list of distinct labels; on anot_movedrow, 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 codes0/2, the--jsonkey sets (the arrival summary dict diffed againstmain: 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-fileused 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 unappliedREPO_ROOT = HERE.parent.parentis 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 theunappliedfigure 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
--destinationmeans — 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 ownvalidate.test_two_legs_may_apply_one_replicas_line_differentlypins 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)
moved_verbatim/moved_with_declared_edit/not_movedreplicated_at_destinationrowsimport rewrites/path constants/adapter calls)edits:def test_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 infb170690: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 nodestination, nodestination_path, nosha256and nogit_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--jsonkey moves with it.scripts/validate-carve-manifest.py, every documented mode, exit 0Seven 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_dumpstill answersOK … 456 row(s).python3 -m pytest -q tests/carve_manifest tests/carve_arrival159 existing collected on
main(88 + 71, re-collected here in amainworktree) + 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 raisesOPENSPEC_TELEMETRY=0 openspec validate --all --strict(CLI 1.2.0) — no NEW failureThe one-item difference is
main's own newchange/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 vsmain(3b45c03) — delta namedThe only delta is the governance-word denominator:
39.5% (362863 / 918816)→39.4% (362863 / 919933), fromdraft 158938 → 160055words — i.e. +1,117 governance words of new runbook § 2 / § 2.1 text and no canon words. That is the expected direction when adraftdocument 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_codedestination materialised from the carve blobs — all 92 rows (9 verbatim / 83 declared-edit, 537 declared lines) plus the two declared replicas attests/conftest.pyandtests/session_fixtures.py: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
unappliedfigure before reading a leg as done. Which is also why leg 1 (openDox-code#6, mergece53b489) 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
b8302354validate-carve-manifest.pyandverify-carve-arrival.py, and the:92/:750/:1207"18 replica rows" wording149d50949919d7eaarrival-undeclared-filenaming--replica-atfirst)13de5e2ffb17069059a226d2also_replicated_to:read as a list of strings or nothingCopilot's round
Three threads, all replied and resolved.
also_replicated_to… is not exercised by the existing carve-manifest tests" (validate-carve-manifest.py)b8302354, the machinery commit, whose own message says "the manifest amendment and the counts follow". 12 manifest cases landed at9919d7ea, each named in the replyverify-carve-arrival.py)also_replicated_rows()… tests membership withdestination in (row.get("also_replicated_to") or []). Ifalso_replicated_tois accidentally a string … Python will treat it as an iterable of characters" (verify-carve-arrival.py:585)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-atcould then re-point itThe 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.pyremediations), and_declared_line_setalready guardsedits[].linesat 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_rowsreturns 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 stale18). 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