Repository navigation
The openDox cutover runbook (OQ-J) and verify-carve-arrival.py, the destination-side check the manifest lacked (split-opendox CARVE arc, step 1) - #875
Conversation
RULED OQ-J (Brett Heap, #656, 2026-09-09): author `docs/opendox-cutover-runbook.md` before the first move. This is that document, on the openXwallet extraction's task 3.2 discipline — a rollback written BEFORE each phase is taken, because a rollback written afterwards is a description of what happened. It carries: the seven preconditions, with `validate-carve-manifest.py` as the gate rather than a courtesy; the named carve commit `b075fd91` and RULED OQ-I's three provenance records (`carved_from:` in each assembly root's hand-authored `contracts/manifest.yaml`, `carve_commit:` in both pin files, and the runbook), with no bare CARVE_COMMIT file; the floor's per-row form and the per-destination row/edit-line census the manifest actually landed with; RULED OQ-H's history-preserving `filter-repo` method, why the openXwallet precedent transfers now that the source is public, and the one fact that does not transfer — six scaffolds that already have history, so the filtered orphan is joined with `--allow-unrelated-histories` as a PULL-REQUEST branch and no protected `main` is ever rewritten; the two-commit leg shape (A byte-identical, B the declared lines and nothing else); RULED OQ-O's levelling first, with the import root riding it; RULED OQ-L's openXdox submodule pin and the import mechanism the memo flagged as undeclared; the § 5 remainder; RULED OQ-N's carve/build split and RULED OQ-K's restated FLOOR PART 2; rollback collected per phase; the re-cut procedure; and the six acts reserved to Brett Heap. Status: draft, and the document says why: § 3 carries no task naming this file, so the obligation is OQ-J's and the change's own text is amended by a later act, not by this runbook. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]>
`validate-carve-manifest.py` validates the manifest AGAINST openxFactory and says nothing about whether anything ARRIVED — the moves memo § 2.3 names the gap in one line, "this needs a verifier that does not exist". This is it, and `docs/opendox-cutover-runbook.md` is the procedure it serves. Run from openxFactory with a destination checkout in hand; it is never copied into six repositories, because the manifest lives here and a verifier copied six ways is six things to keep in step with one document. FIVE FINDINGS AND ONE ENVIRONMENT CODE, closed, ordered by the check that raises them: `arrival-missing`; `arrival-digest-mismatch` (bytes AND mode — every moved row at phase A, every `moved_verbatim` row in BOTH phases); `arrival-undeclared-edit` (phase B: the diff against the carve blob touches a line no `edits[].lines` declares — the refusal names the lines and carries a unified-diff excerpt); `arrival-undeclared-file`; `arrival-carved-from-mismatch` (RULED OQ-I, at an assembly root); `arrival-unreadable`. Exit 0 or 2 and nothing else. THE OWNERSHIP SPLIT IS DELIBERATE: every `carve-*` code is a manifest that disagrees with openxFactory, every `arrival-*` code is a destination that disagrees with the manifest. So a manifest defect — an unparseable document, a source blob whose digest is not the row's — refuses here as `arrival-unreadable` NAMING `validate-carve-manifest.py`, rather than this file inventing a second, weaker opinion about the same bytes. The declared roots are COMPUTED from the manifest (the minimal directories a destination's rows land under), never configured. Three ordered admission rules cover what the manifest cannot declare: the scaffold, read from the DESTINATION's own `tests/test_leg_shape.py` `REQUIRED_FILES` (parsed with `ast`, never imported — a destination checkout is untrusted input); a replica admitted by identity with its blob at `carve_commit`, because a `replicated_at_destination` row carries no destination and no digest by the row grammar; and `--allow-created`, one exact path at a time and no wildcard, for the files RULED OQ-C says get no row. What it does not prove is stated in the file rather than discovered: a drifted replica is unverifiable by construction, and an unapplied declared edit is COUNTED and printed rather than refused, because it touches no undeclared line and the leg's own `validate` refuses it. The seat-holding pass (no `--destination` -> `NO DESTINATION`, exit 0) is the manifest validator's own not-fail-closed branch, and for the same reason: this lands BEFORE the trees it checks, and no destination holds one carved byte until Phase 2 of the runbook runs. It keys off `--destination` being ABSENT, never off a lookup failing — a named destination that is misspelled refuses. Driver: `tests/carve_arrival/test_verify_carve_arrival.py`, 43 tests, every code pinned by a case that can only pass if that check runs, all through the documented subprocess invocation over a throwaway source repository and a destination materialised from the manifest's own rows. Zero skips: the required suite pins `EXPECT_SKIPPED` exactly, and a skip reads as a pass. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]>
document, and declared replicas Both findings come from running the verifier against the LANDED manifest rather than against its own fixtures, and each is one the fixture suite could not have produced. 1. `docs/branch-protection.md` refused a faultless openDox-spec leg. `docs/` IS a declared root for `opendox_spec` — the manifest places `docs/ideation-dashboard-session-runbook.md` there — and the scaffold's posture document sits beside it, in no leg's `REQUIRED_FILES` and no row's `destination_path`. Measured: a 56-row openDox-spec destination built from the manifest at b075fd9 refused `arrival-undeclared-file` on a file the carve never touched. It is admitted as SCAFFOLD, not left to `--allow-created`, because the two claims differ: `--allow-created` records that the destination ASSEMBLED the file, and a document whose whole subject is provenance may not arrive carrying a false one. 2. `--replica-at SOURCE=DESTPATH` — the replica question, answered where it can be. All 18 `not_moved / replicated_at_destination` rows carry no `destination`, no `destination_path`, no `sha256` and no `git_mode` (measured, not inferred: the row grammar gives a `not_moved` row none of them, RULED OQ-C). Nothing in the document says where a replica landed, so the verifier does not guess — the OPERATOR declares it, which is the runbook's per-leg table in machine form. A declared replica is then answered with the two codes a ROW is answered with, `arrival-missing` and `arrival-digest-mismatch`, so the vocabulary stays at six; and it is admitted in the walk by NAME rather than by a coincidence of bytes. This withdraws nothing. An UNDECLARED replica is still admitted by identity with its carve blob and still counted, so every run that passes today still passes. What declaring buys is the two questions digest admission cannot ask — is the replica there at all (the memo's own worry about `scripts/corpus_adapter.py`), and is it the carve's bytes at the path the operator says. `tests/corpus-adapter/test_conformance.py` is deliberately left undeclarable-by-choice: its implementation-aware block is rewritten at each destination by design. The runbook records both, and its per-leg phase-B invocation now carries the three permanent neutral replicas (RULED OQ-A) plus `corpus_adapter.py` while it is one (RULED OQ-Q). Evidence: `pytest -q tests/carve_arrival tests/carve_manifest` 139 passed (131 before; +8 tests, one per new behaviour). Real-manifest dry run at b075fd9 — 56 `opendox_spec` rows placed byte-identical verify at phase A; the declared edit applied on exactly its six declared lines verifies at phase B; phase A over the commit-B tree refuses `arrival-digest-mismatch`; a declared replica verifies, and refuses `arrival-digest-mismatch` when drifted and `arrival-missing` when absent. doc-health `--single-repo` unchanged at 10 critical / 6 error / 47 warning / 14 info. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]>
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 1 day and 6 hours by commenting @sourcery-ai review. Upgrade to get a review now.
|
@codex review |
Reviewer's GuideThis PR authors the pre-move openDox CARVE cutover procedure and adds the destination-side verifier and hermetic test suite needed to prove arrivals against the landed manifest, while deliberately performing no scaffold levelling, repository carve, or destination push. Sequence diagram for two-commit destination arrival verificationsequenceDiagram
participant Operator
participant Source as SourceRepository
participant Destination
participant Verifier as verify-carve-arrival.py
Operator->>Verifier: invoke phase A
Verifier->>Source: read carve_commit blobs
Verifier->>Destination: read destination paths and modes
Verifier-->>Operator: verify byte-identical rows
Operator->>Destination: apply declared edits in commit B
Operator->>Verifier: invoke phase B
Verifier->>Source: read carve_commit blobs
Verifier->>Destination: read edited files
Verifier-->>Operator: verify declared lines only
Flow diagram for destination-side CARVE arrival verificationflowchart LR
M["Landed carve manifest"] --> V["verify-carve-arrival.py"]
S["Source repository at carve_commit"] --> V
D["Destination checkout"] --> V
V --> A["Phase A: byte and mode identity"]
V --> B["Phase B: declared-line edits"]
V --> R["Declared replica checks"]
V --> U["Undeclared-file and provenance checks"]
A --> O["Exit 0: verified"]
B --> O
R --> O
U --> O
A --> X["Exit 2: arrival refusal"]
B --> X
R --> X
U --> X
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟡 Changes recommended
The verifier currently has confirmed exit-code contract violations (uncaught exceptions leading to exit 1) and a JSON output structure issue that should be addressed before relying on it operationally.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds the operational and verification foundation for the openDox/openXdox CARVE arc: a draft cutover runbook plus a destination-side “arrival” verifier (with subprocess-driven tests) so the manifest’s declared movements can be proved against a destination checkout before any files are actually moved.
Changes:
- Add
scripts/verify-carve-arrival.pyto verify destination checkouts against the carve manifest across phase A (byte-identical) and phase B (declared-lines-only edits). - Add
tests/carve_arrival/test_verify_carve_arrival.pyto pin the refusal vocabulary and exercise each refusal path via subprocess invocation. - Add a draft runbook documenting the phased procedure and link it from the README.
File summaries
| File | Description |
|---|---|
docs/opendox-cutover-runbook.md |
Draft end-to-end CARVE arc runbook (preconditions, phases, rollback, re-cut). |
scripts/verify-carve-arrival.py |
New destination-side verifier with closed refusal vocabulary and JSON/human output modes. |
tests/carve_arrival/test_verify_carve_arrival.py |
Subprocess-based test suite covering verifier behavior, refusal codes, and “seat” behavior. |
README.md |
Adds the runbook link in the core docs index section. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8aa6f92ebe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Lane: openxfactory-4-opendox-extraction INDEPENDENT VERIFICATION of head PASS
THE THREE BLOCKING CORRECTIONS (runbook § 5.2–5.4 — the part an operator pastes)I ran the documented sequence against a scratch repository with
SHOULD-FIX (none blocks landing; the file is
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8aa6f92ebe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The three BLOCKING corrections to § 5.2-5.4, each reproduced against `git-filter-repo ed61b405` on a scratch repository of two commits and three files with one listed, and the corrected sequence then proved end to end against the LANDED manifest: 1. THE PATH FILE FILTERED NOTHING. `--paths-from-file` reads a plain line as a path SELECTOR and a `source==>destination` line as a RENAME. The generator emitted renames only, so the run renamed what it named and KEPT EVERYTHING ELSE — all three scratch files where one was listed, and 5,404 openxFactory files on the real `opendox_spec` leg. Against a PUBLIC destination that is the difference between publishing 56 files and publishing the repository, and the arrival verifier would not have caught it: its walk is scoped to the destination's declared roots, so `openspec/`, `contracts/` and `.github/` would have ridden in silently. § 5.3 now emits BOTH lines per row. 2. `--refs "$CARVE_COMMIT"` RETARGETED NOTHING. A raw object id is not a ref: the rewrite was written and no ref pointed at it, `refs/heads/main` kept the unfiltered tree, and § 5.5's merge would have taken unfiltered history. § 5.4 now creates `carve-src` at the carve commit and rewrites that ref, and § 5.5 fetches it by explicit refspec — partial mode leaves the mirror's other refs unfiltered, so a bare `git fetch carved` puts them within reach of a mistyped merge. The neighbouring claim that filter-repo removes `origin` when it finishes did not hold in any run made for this document and is withdrawn. 3. THE SEQUENCE COULD NOT RUN. `git clone` then `git checkout "$CARVE_COMMIT"` leaves two HEAD reflog entries and filter-repo refuses a clone that is not fresh. § 5.2 now takes a `--mirror` clone, which needs no `--force`, and states `--force` as the fallback with the reason the check exists. And a fourth defect found while proving them: § 5.2's CONTROL validated nothing and reported success. `validate-carve-manifest.py` holds a seat when its default `<repo>/docs/…` manifest path is not a file — and a mirror has no working tree, and the manifest does not exist at `b075fd91` in any case, having landed at `17167481`. Both § 5.2 and § 5.5 now name the manifest absolutely. PROVED, 2026-09-09: the `opendox_spec` leg carved from a fresh mirror to exactly its 56 files under `contracts/`, `docs/` and `examples/`, fetched by refspec, merged with `--allow-unrelated-histories`, and verified at phase A — 56 rows arrived, 56 digests verified, 57 files walked, none undeclared. Five holes in `verify-carve-arrival.py`, each pinned by a test proven to fail against this file at `8aa6f92e`: * EXIT 1 EXISTED and the module docstring said it did not. A row missing `destination_path:` escaped `main()` as a `KeyError` traceback. `main()` now owns the contract: every unnamed `Exception` renders as `arrival-unreadable` and exit 2, `KeyboardInterrupt` and `SystemExit` left alone. The `ast.literal_eval` guard also names `SyntaxError` and the rest. * DIRECTORY SYMLINKS WERE INVISIBLE. `os.walk` puts them in `dirnames`, never descends and never reads: a tree of undeclared content behind one name returned OK. git stores such a link as a `120000` blob, so it is pulled out of `dirnames` and answered as any other entry is. * AN EMPTY ROWLESS FILE WAS ADMITTED AS A REPLICA. Two of the 18 replica rows are `fixtures/empty/*/.gitkeep`, so the empty digest admitted any empty created file — true of the bytes, false of the file, the same error the `.gitkeep`-by-name rule already refused. Empty blobs are excluded from the identity set; an empty replica is admitted by `--replica-at`, which is the stronger claim anyway. * `--destination openxdox_root` WAS UNREACHABLE. `destinations:` maps the places rows GO and openXdox's assembly root receives none, so RULED OQ-I's second provenance record could not be checked by the tool that checks the first. `--assembly-root <owner>/<name>` addresses a root by the repository it is, runs the `carved_from:` check and reports the key where there is one. * SCAFFOLD ADMISSION TOOK ITS ALLOWLIST FROM ITS SUBJECT. `SECRET CARVE PAYLOAD` at `docs/branch-protection.md` returned OK; a `.gitkeep` with content was admitted anywhere; and `REQUIRED_FILES` was read from the destination's WORKING TREE, so an arrival commit that added a path to its own `tests/test_leg_shape.py` admitted that path. The allowlist is now read from `--dest-base` (default `origin/main`) and every scaffold admission's BYTES must equal the destination's own copy there. Without a baseline the run still passes and SAYS `scaffold admissions by NAME ONLY`, so the weaker claim never passes for the stronger. `--json` with no `--destination` now carries `destinations` as a LIST with a `destinations_unreadable` flag, rather than a comma-joined sentence that was sometimes an apology. Evidence: `pytest -q tests/carve_arrival tests/carve_manifest` — 156 passed (68 + 88), 0 skipped; 14 of the 17 new tests fail against `HEAD:scripts/verify-carve-arrival.py` and the other three are regression guards. `pytest tests/ --collect-only` 11,122 collected, 0 errors. `proposal-support verify` ok. doc-health `--single-repo .` in ONE checkout, this round's three files against `8aa6f92e`: 76 findings, BYTE-IDENTICAL. 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 verifier should fail fast on unsafe user-provided destination paths (--replica-at / --allow-created) to prevent reading outside --dest-root, and the runbook’s declared-roots table should align with the verifier’s printed root spellings.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Lite
SonarCloud's `pythonsecurity:S8705` on `2a08d512`, and it is right about the
shape even though the exploit is narrow: `--dest-base` is the ONE value this
tool hands to git that comes from the COMMAND LINE rather than from the
manifest, and it reached `subprocess.run` untouched. `subprocess` is called
with an argument list and never a shell, so there is no shell injection — but
`f"{ref}^{{commit}}"` with a ref beginning `--` is read by `git rev-parse` as an
OPTION and not a revision, which is argument injection and a real one.
So it is validated where it enters, against a conservative allowlist: letters,
digits, `.` `_` `/` `@` `^` `~` `{` `}` `-`, never a leading dash, at most 256
characters. A revision git would accept can carry far more than that, and
nothing this tool needs to name does. `--end-of-options` is passed to
`rev-parse` as well, so the two defences are independent rather than one
defence written twice.
Pinned by `test_a_dest_base_is_validated_before_a_process_is_started`, which
refuses `--dest-base=--upload-pack=/bin/sh`, `--dest-base=-x`,
`--dest-base=origin/main; rm -rf /` and `--dest-base=$(id)` — the `=` form
matters, because argparse itself rejects a separate argument beginning with a
dash and would have hidden the case. 157 passed (69 + 88), 0 skipped.
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
It includes policy-breaking host-absolute paths in committed docs and needs path-validation hardening for --allow-created / --replica-at to prevent reading outside --dest-root.
Review details
Suppressed comments (5)
Previously missed (2) — in code that hasn't changed since the last review.
docs/opendox-cutover-runbook.md:42
- This runbook embeds a host-absolute path (
/usr/bin/git-filter-repo), which violates the repository constitution (“Committed files MUST NOT contain host-absolute paths”; .specify/memory/constitution.md:72-73). Prefer a PATH-based or generic statement instead.
docs/opendox-cutover-runbook.md:155 - This uses a host-absolute placeholder path (
/path/to/...). The repository constitution forbids host-absolute paths in committed files (.specify/memory/constitution.md:72-73); use a repo-relative placeholder consistent with later sections instead.
This issue also appears on line 166 of the same file.
scripts/verify-carve-arrival.py:737
--replica-at SOURCE=DESTPATHaccepts DESTPATH without validating that it is destination-relative. If a caller passes an absolute path or..segments, the verifier can be tricked into reading outside--dest-root(and the error messages will still look like an arrival finding). Reject absolute / traversal paths and normalize both\\and/separators.
relpath = relpath.replace(os.sep, "/")
scripts/verify-carve-arrival.py:1341
--allow-createdpaths are normalized withp.replace(os.sep, "/")but not validated. A caller can pass an absolute path or..traversal segments, causing the walk to treat files outside--dest-rootas admitted/allowed. Normalize both\\and/and reject absolute or traversal paths before passing the set intoverify().
summary = verify(doc, args.destination, dest_root, source_repo,
args.phase,
{p.replace(os.sep, "/") for p in args.allow_created},
parse_replica_placements(args.replica_at, doc),
resolve_dest_base(dest_root, args.dest_base))
docs/opendox-cutover-runbook.md:166
- This uses a host-absolute placeholder path (
/path/to/...). The repository constitution forbids host-absolute paths in committed files (.specify/memory/constitution.md:72-73); use a repo-relative placeholder consistent with later sections instead.
--dest-root /path/to/openXdox
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
Three Copilot threads on `d4cc2bf3`, and the first two are the same defect on
two flags. `Path("/dest") / "/etc/passwd"` is `/etc/passwd` — an absolute
right-hand operand REPLACES the root — and `..` segments walk out of it. So
`--replica-at scripts/pkg/neutral.py=/etc/passwd` read a file the run was not
about and reported the answer as the destination's, and an out-of-root
`--allow-created` value could never match and passed as a silent admission the
operator believed they had made.
`dest_relative()` now guards both, on `scripts/proposal-support.py`'s own
requirement rather than as a nicety: empty, absolute, and `.`/`..` bearing
values refuse `arrival-unreadable`. NON-CANONICAL forms refuse rather than
being normalised, because the value has to EQUAL a path the walk produced and
the walk produces canonical ones — `src/./pkg/x.py` would otherwise silently
never match.
The third thread is the § 2 table: its declared-roots column carried trailing
slashes where a run prints none, and comparing the two is the first thing an
operator does after a leg lands. The column is now spelled exactly as the
verifier prints it, and the section says that the five cells are asserted
against the landed manifest by
`test_the_real_manifest_declares_the_roots_the_runbook_names` — so the table is
checked rather than described.
159 passed (71 + 88), 0 skipped. `proposal-support verify` ok. doc-health
`--single-repo .` in ONE checkout, this round's three files against `8aa6f92e`:
76 findings, BYTE-IDENTICAL.
Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
dest_relative() does not currently refuse Windows-style backslash paths on POSIX, which can lead to “accepted but never matches” operator inputs; the verifier and its tests should pin/handle this case explicitly.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
tests/carve_arrival/test_verify_carve_arrival.py:1354
- Similarly,
--allow-createdshould refuse backslash-separated paths on POSIX so operators don’t accidentally supply a value that can never match any walked path. Add asrc\\...hostile case here to pin that behavior.
for hostile in ("/etc/passwd", "../outside.py", "src/../src/pkg/x.py"):
done = run(carve, manifest, "--destination", "scratch_code",
"--dest-root", str(dest), "--phase", "A", "--json",
"--allow-created", hostile)
assert refusal(done) == "arrival-unreadable", hostile
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
Two Copilot threads on `dad5cb97`, one point: `dest_relative()`'s `value.replace(os.sep, "/")` is a NO-OP on a POSIX host, where `os.sep` is already `/`. So `--allow-created src\pkg\x.py` passed the canonicality test as one long filename, matched nothing under the walk — which joins with `/` — and became the exact failure the guard exists to prevent: a silent admission the operator believes they made. The replacement still runs FIRST, so on a Windows host a backslash path is converted as intended; what refuses is a backslash that SURVIVES it. The regression case is platform-guarded in both tests for the same reason: on Windows that value IS a path. 159 passed (71 + 88), 0 skipped. `proposal-support verify` ok. 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 verifier has path-escape cases (Windows drive paths and symlinked directories) that can read outside --dest-root, undermining the verifier’s safety guarantees.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
scripts/verify-carve-arrival.py:997
check_undeclared_files()computesrelpath = os.path.relpath(full, dest_root)and then readsfull. If a declared root (or part of its path) is a symlink that escapes--dest-root,relpathcan contain..and the verifier will read outside the destination tree.
full = Path(dirpath) / name
relpath = os.path.relpath(full, dest_root).replace(os.sep, "/")
walked += 1
if relpath in placed:
continue
_mode, data = read_arrived(full)
scripts/verify-carve-arrival.py:568
check_arrivals()readsdest_root / destination_pathdirectly. If any parent directory in that path is a symlink, path resolution can escape--dest-rootand cause the verifier to read (and potentially accept) bytes from outside the destination checkout.
for row in rows:
relpath = row["destination_path"]
target = dest_root / relpath
if not os.path.lexists(target):
raise ArrivalRefusal(
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
Copilot on `6c4876ff`, and correct: `C:/x` is not POSIX-absolute, so `dest_relative()` admitted it. On Windows `Path(dest) / "C:/x"` leaves `--dest-root`; on POSIX it is a filename with a colon in it that can never match a walked path, which is the silent-admission failure again. `ntpath.splitdrive` names both forms — a drive letter and a `//server/share` UNC root — on every platform, so the check does not depend on where this runs and the regression cases are asserted everywhere rather than platform-guarded like the backslash one. 159 passed (71 + 88), 0 skipped. `proposal-support verify` ok. 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 new runbook includes host-absolute paths (e.g. /usr/bin/..., /path/to/...), which violates the repo constitution rule prohibiting host-absolute paths in committed files.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
docs/opendox-cutover-runbook.md:42
- This runbook includes a host-absolute path (
/usr/bin/git-filter-repo) in a committed document, which violates the repo constitution rule that committed files must not contain host-absolute paths (use repo-relative paths or runtime resolution).
This issue also appears in the following locations of the same file:
- line 160
- line 171
docs/opendox-cutover-runbook.md:164
- This example uses a host-absolute placeholder path (
/path/to/openDox-code), which conflicts with the repository rule to avoid host-absolute paths in committed files. Prefer a repo-relative example (e.g. a sibling checkout) or an environment variable placeholder.
python3 scripts/verify-carve-arrival.py \
--destination opendox_code \
--dest-root /path/to/openDox-code \
--source-repo . \
--phase A
docs/opendox-cutover-runbook.md:173
- This example uses a host-absolute placeholder path (
/path/to/openXdox), which conflicts with the repository rule to avoid host-absolute paths in committed files. Prefer a repo-relative example or an environment variable placeholder.
python3 scripts/verify-carve-arrival.py \
--assembly-root opensoft/openXdox \
--dest-root /path/to/openXdox
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
…oxes — bookkeeping on Brett Heap's word (#897) Bookkeeping on Brett Heap's word "tick the carve boxes" (2026-09-10): the split-opendox-two-layer-product § 3 boxes whose acceptance text is fully met by landed evidence are ticked, each with its citation — § 3.1 (manifest #865 → 1716748 + #889 → 15ebb37), § 3.2 (openDox-code #6 → ce53b489; all 24 design § D3 modules present), § 3.3 (the serve.py/cli.py app-server and neutral halves with the § 2.4 extension points, live in openDox-code). Boxes only partly met (the openXdox legs are not yet carved) and the BUILD-arc, runtime, repository-creation, FLOOR PART 3 and tag boxes stay open. Evidence, all on #656: the mapping manifest #865 → 1716748 and its amendments #889 → 15ebb37; the cutover runbook and arrival verifier #875 → a970fd9; leg 1 openDox-code #6 → ce53b489 (123 rows); leg 2 openDox-spec #4 → fc67332d (56 rows); the openDox root pin openDox #4 → 49a99df2 (gitlinks, pins, carved_from). On the word "tick 0.6, 1.8, 1.9 and 2.5 too when green": § 0.6 (PR-5 #832 → 56e69a1, archived with promotion), § 1.8 (opensoft/xFactory #284 → 05cb5abf, rule 1 confirmed live) and § 2.5 (the D-2 exercise: dispatch PR #176 → 7681e40, refusal 36d07ec; the box names no Omnigent-Install act, so its `[OmI]` tag is a repo tag without a clause) are ticked; § 1.9 stays open because its project-register rows land with § 5.8, still open. No manifest, validator or runbook change; landed under a Rule 6 window. Refs #656 (stays OPEN). Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]>



Lane: openxfactory-4-opendox-extraction
Refs #656 — step 1 of the CARVE arc, the first act after the manifest landed (#865 →
17167481).Two authors, one tree — the collision is disclosed. Two windows dispatched an author for this step into the same worktree and branch. The first authored commits 1 and 2; it was stopped mid-flight and will not resume. The second (this author) re-read both files in full, re-ran their suites, and added commit 3. During the overlap both authors made whole-file writes to
scripts/verify-carve-arrival.pyandtests/carve_arrival/test_verify_carve_arrival.py, so the committed versions were re-read end to end rather than assumed intact: 131 tests green on the base of commit 2, 139 after commit 3, collection clean at 11,105.What lands
docs/opendox-cutover-runbook.md(RULED OQ-J — "author the runbook before the first move") — 810 lines,Status: draft,Kind: runbook, in the estate's runbook style, on the openXwallet extraction's task 3.2 discipline: a rollback written before each phase is taken, because a rollback written afterwards is a description of what happened.17167481;carve_commit = b075fd91dc8fced8e1373825ba80220c33536bae; tagopendox-carve-0, a LABEL beside the commit and never the referent;validate-carve-manifest.pyas the gate, not a courtesy.carved_from:in each assembly root's hand-authoredcontracts/manifest.yaml,carve_commit:in both pin files, and this runbook. No bareCARVE_COMMITfile — the wallet arc rejected that by name.moved_verbatim, 146moved_with_declared_edit, 136not_moved(18 of them replicas) across 454 rows; the per-destination censusopendox_code123 /opendox_spec56 /openxdox_code92 /openxdox_spec47 /opendox_root0.pytest.ini,conftest.py, pinned pytest), so a carve failure is never confounded with a scaffold difference.git filter-repo --paths-from-file <that destination's rows> --forcefrom a fresh mirror of the now-public openxFactory, paths rewritten to the destination layout, the path file generated FROM the manifest. The shape, and why it is not a graft onto the scaffold's root: the wallet's carve pushed its filtered history as the new repository's OWN history and committed the scaffold ON TOP — it had no scaffold to graft onto. Here all six destinations already carry scaffold history and a requiredvalidate, so the filtered orphan is joined to the scaffold as a pull-request branch with--allow-unrelated-histories; rewriting the carved commits to sit on the scaffold's root would change every carved sha and the arrival would stop being reproducible from a re-run offilter-repo. No protectedmainis ever rewritten.edits[].lines(import rewrites/path constants/adapter calls) and nothing else, each re-verified. A reviewer reads 782 declared lines rather than 172,627.replicated_at_destinationcopies, and the RULED OQ-C creations named with--allow-created.carved_from+ gitlink + pin in ONE commit.git cat-file -tverification.scripts/verify-carve-arrival.py(930 → 1,474 lines) — the destination-side check the manifest lacked, named by the moves memo § 2.3: "This needs a verifier that does not exist." It lives in openxFactory beside the manifest and is never copied into six repositories.Six refusal codes, closed and complete (the tuple is held complete by an AST scan of the file's own raise sites):
arrival-missing,arrival-digest-mismatch,arrival-undeclared-edit,arrival-undeclared-file,arrival-carved-from-mismatch,arrival-unreadable. Exit 0 or 2, never 1.--manifest,--destination <closed key>,--dest-root,--source-repo,--phase A|B,--allow-created,--replica-at,--json. The ownership split is stated rather than assumed: everycarve-*code is a manifest that disagrees with openxFactory and isvalidate-carve-manifest.py's finding; everyarrival-*code is a destination that disagrees with the manifest.No destination configured is a deliberate exit 0 —
NO DESTINATION, keyed off--destinationbeing ABSENT and never off a lookup failing, so a misspelled destination still refuses. It is the same seat-holding branchvalidate-carve-manifest.pycarries, for the same reason: this file lands before the trees it checks, and a required suite that went red for every lane between here and the carve would train the lane to ignore it. It is a BRANCH and never apytest.skip—pytest-suite.ymlpinsEXPECT_SKIPPEDexactly, and my tests add zero skips.Tests
tests/carve_arrival/test_verify_carve_arrival.py— 71 tests, subprocess driver over throwaway fixtures (a scratch source repository at a carve commit, a manifest generated FROM that tree, a destination materialised from its own rows), one per code, both phases, plus the seat test against the real repository.Commit 3 — two measured repairs, both found by running against the LANDED manifest
docs/branch-protection.mdrefused a faultless openDox-spec leg.docs/IS a declared root foropendox_spec, and the scaffold's posture document sits beside the row placed there, in no leg'sREQUIRED_FILES. Admitted as SCAFFOLD, not left to--allow-created: the latter records that the destination ASSEMBLED the file, and a document whose whole subject is provenance may not arrive carrying a false one.--replica-at SOURCE=DESTPATH. All 18replicated_at_destinationrows carry nodestination, nodestination_path, nosha256and nogit_mode— measured, and RULED OQ-C is why. Nothing in the document says where a replica landed, so the verifier does not guess; the operator declares it, and a declared replica is answered with the two codes a ROW gets, so the vocabulary stays at six. It withdraws nothing: an undeclared replica is still admitted by identity with its carve blob.test_conformance.pyis deliberately left undeclared — its implementation-aware block is rewritten at each destination by design.Verifier round 1 — head
41849549INDEPENDENT VERIFICATION of
8aa6f92ereturned PASS TO LAND with three BLOCKING corrections owed to § 5.2–5.4 (comment5610458343), plus five should-fixes and six open bot threads. All of it is now answered in one commit, and every open review thread is replied to and resolved. Nothing has moved: no destination repository holds one carved byte.The three blocking corrections — the part an operator pastes. Each reproduced against
git-filter-repo ed61b405on a scratch repository of two commits and three files with one listed, and the corrected sequence then proved end to end against the landed manifest.--paths-from-filereads a plain line as a path SELECTOR and asource==>destinationline as a RENAME; the generator emitted renames only, so the run renamed what it named and kept everything else — all three scratch files where one was listed, and 5,404 openxFactory files on the realopendox_specleg. Against a PUBLIC destination that is the difference between publishing 56 files and publishing the repository, and the arrival verifier would not have caught it: its walk is scoped to the declared roots, soopenspec/,contracts/and.github/would have ridden in silently. § 5.3 now emits both lines per row.--refs "$CARVE_COMMIT"retargeted NOTHING. A raw object id is not a ref: the rewrite was written and no ref pointed at it,refs/heads/mainkept the unfiltered tree, and § 5.5's merge would have taken unfiltered history. § 5.4 now createscarve-srcat the carve commit and rewrites that ref; § 5.5 fetches it by explicit refspec, because partial mode leaves the mirror's other refs unfiltered and a baregit fetch carvedputs them within reach of a mistyped merge. The neighbouring claim that filter-repo removesoriginwhen it finishes did not hold in any run made for this document and is withdrawn.git clonethengit checkout "$CARVE_COMMIT"leaves two HEAD reflog entries and filter-repo refuses a clone that is not fresh. § 5.2 now takes a--mirrorclone, which needs no--force, and states--forceas the fallback with the reason the check exists.A fourth defect, found while proving those three: § 5.2's CONTROL validated nothing and reported success.
validate-carve-manifest.pyholds a seat when its default<repo>/docs/…path is not a file — and a mirror has no working tree, and the manifest does not exist atb075fd91in any case, having landed at17167481. Both § 5.2 and § 5.5 now name the manifest absolutely; unlike the manifest validator, the arrival verifier is fail-closed about it and refusesarrival-unreadable.§ 5.2–5.5 PROVED END TO END, 2026-09-09. From a fresh mirror of openxFactory at
b075fd91: theopendox_specleg's 112-line path file carvedcarve-srcto exactly its 56 files undercontracts/,docs/andexamples/and nothing else; single-refspec fetch;--allow-unrelated-historiesmerge onto a scaffold branch; phase A: 56 rows arrived, 56 digests verified, 57 files walked, none undeclared (1 scaffold). The same three steps as § 5 printed them before this round produced, in order: a refusal to start, a rewrite no ref pointed at, and a tree still holding all 5,404 files.Five holes in the verifier, each pinned by a test proven to fail against
8aa6f92e.destination_path:escapedmain()as aKeyErrortraceback, against a docstring that says exit 0 or 2 only (Copilot thread, reproduced on the real manifest)main()owns the contract: every unnamedExceptionrenders asarrival-unreadableand exit 2;KeyboardInterrupt/SystemExitleft alone. Theast.literal_evalguard also namesSyntaxError(Copilot's second thread)os.walkputs them indirnames, never descends, never reads: a tree of undeclared content behind one name returned OK (Codex P2)120000blob, so it is pulled out ofdirnamesand answered as any other entry isfixtures/empty/*/.gitkeep, so the empty digest admitted any empty created file.gitkeep-by-name rule already refused. An empty replica is admitted by--replica-at, the stronger claim anyway--destination openxdox_rootwas unreachable (Codex P1) —destinations:maps the places rows GO and openXdox's assembly root receives none, so RULED OQ-I's second provenance record could not be checked by the tool that checks the first--assembly-root <owner>/<name>addresses a root by the repository it is, runs thecarved_from:check, and reports thedestinations:key where there is one. § 6 and § 7 both invoke itSECRET CARVE PAYLOADatdocs/branch-protection.mdreturned OK; a.gitkeepwith content was admitted anywhere; andREQUIRED_FILESwas read from the destination's working tree, so an arrival commit adding a path to its owntests/test_leg_shape.pyadmitted that path--dest-base(defaultorigin/main) and every scaffold admission's bytes must equal the destination's own copy there. Without a baseline the run still passes and saysscaffold admissions by NAME ONLY, so the weaker claim never passes for the strongerThe admission itself is kept, for the author's stated reason:
--allow-createdwould record that the destination ASSEMBLED a document whose whole subject is provenance.--jsonwith no--destinationnow carriesdestinationsas a list plusdestinations_unreadable, rather than a comma-joined sentence that was sometimes an apology (Copilot thread).Three further corrections after the first push, from re-review of the new head.
pythonsecurity:S8705(2a08d512→d4cc2bf3), and right about the shape even though the exploit is narrow:--dest-baseis the ONE value this tool hands to git that comes from the COMMAND LINE rather than from the manifest.subprocessis called with an argument list and never a shell, so there is no shell injection — butf"{ref}^{{commit}}"with a ref beginning--is read bygit rev-parseas an option and not a revision. It is now validated at the boundary against a conservative allowlist (never a leading dash, ≤ 256 chars), and--end-of-optionsis passed as well, so the two defences are independent. Pinned over--dest-base=--upload-pack=/bin/sh,=-x,=origin/main; rm -rf /and=$(id)— the=form matters, because argparse itself rejects a separate dash-leading argument and would have hidden the case.--replica-atand--allow-createdcould name a path outside--dest-root(two Copilot threads, one defect on two flags;d4cc2bf3→dad5cb97).Path("/dest") / "/etc/passwd"is/etc/passwd— an absolute right-hand operand REPLACES the root — so--replica-at …=/etc/passwdread a file the run was not about and reported the answer as the destination's; an out-of-root--allow-createdvalue could never match and passed as a silent admission the operator believed they had made.dest_relative()now guards both onscripts/proposal-support.py's own requirement. Non-canonical forms refuse rather than being normalised, because the value has to EQUAL a path the walk produced.dest_relative()did not catch a Windows-style backslash on POSIX (two Copilot threads, one point;dad5cb97→6c4876ff).value.replace(os.sep, "/")is a no-op whereos.sepis already/, sosrc\pkg\x.pypassed the canonicality test as one long filename and matched nothing under a walk that joins with/— the same silent admission the guard exists to prevent. The replacement still runs first, so a Windows host converts as intended; what refuses is a backslash that survives it. Both regression cases are platform-guarded, because on Windows the value is legitimate.C:drive or//server/shareUNC prefix slipped pastposixpath.isabs(Copilot;6c4876ff→41849549).ntpath.splitdrivenames both on every platform, so that case is asserted everywhere rather than platform-guarded.test_the_real_manifest_declares_the_roots_the_runbook_names— the table is checked rather than described.Round-1 evidence.
pytest -q tests/carve_arrival tests/carve_manifest— 159 passed (71 + 88), 0 skipped. 14 of the first 17 new tests fail againstgit show 8aa6f92e:scripts/verify-carve-arrival.py; the other three are regression guards (a file symlink still refuses; a declared empty replica still verifies; the landed manifest still gives openXdox's root no key).proposal-support verify→ ok. doc-health--single-repo .run in ONE checkout, this round's three files against8aa6f92e: 76 findings, BYTE-IDENTICAL — same 10 critical / 6 error / 47 warning / 13 info, no line changed. All fourteen review threads answered and resolved; 0 unresolved. SonarCloud green.Still NOT DONE, unchanged: no file has moved; no scaffold levelling beyond what landed separately;
docs/opendox-carve-manifest.yaml,scripts/validate-carve-manifest.py,openspec/**,contracts/**and.github/**untouched.Status: draft, and § 5's own text says why. Asking for Brett Heap's separate word to land this.Evidence
pytest -q tests/carve_arrival tests/carve_manifest— 139 passed (51 + 88), 0 skipped. Collection overtests/clean: 11,105 collected, 0 errors. The whole suite exceeds 15 minutes locally (killed at ~34%); the requiredpytest-suitejob owns it.b075fd91, the proof the approach is sound: 56opendox_specrows placed byte-identical verify at phase A; the one declared-edit row rewritten on exactly its six declared lines verifies at phase B; phase A over the commit-B tree refusesarrival-digest-mismatch, naming the file and both digests; a declared replica verifies, refusesarrival-digest-mismatchwhen drifted andarrival-missingwhen absent.python3 scripts/proposal-support.py . verify→proposal support verification ok.--single-repo .vs base17167481: 10 critical / 6 error / 47 warning / 14 info, identical, 77 findings both sides. The finding sets are byte-identical but for ONE line:staged-candidate-agingn=70→n=71, the newStatus: draftrunbook joining the draft population. Canon share 39.8% → 39.6% because governance words grew by 5,173 with canon words unchanged — the documented behaviour of the ratio when a draft lands, not a regression. The runbook'sStatus:header adds no new finding class.NOT DONE
docs/opendox-carve-manifest.yamlandscripts/validate-carve-manifest.pyare untouched; so areopenspec/**,contracts/**and.github/**.Status: draftand the document says why: § 3 of the ratifying change carries no task naming this file — OQ-J created the obligation, and the change's own text is amended by a later act, not by this runbook. No gate refuses a carve step that skips it.Asking for Brett Heap's separate word to land this.
🤖 Generated with Claude Code
Summary by Sourcery
Establish the openDox CARVE cutover procedure and add destination-side verification before any carved files are moved.
New Features:
Enhancements:
Documentation:
Tests: