Skip to content

carve manifest: a manifest-declared post-shed phase (RULED (a) on #656, split-opendox § 5.2) - #928

Merged
brettheap merged 3 commits into
mainfrom
change/carve-manifest-post-shed-mode
Sep 10, 2026
Merged

brettheap merged 3 commits into
mainfrom
change/carve-manifest-post-shed-mode

Conversation

@brettheap

@brettheap brettheap commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Refs #656 — split-opendox-two-layer-product § 5.2, FLOOR PART 1.

The ruling this realizes

RULED 2026-09-10, Brett Heap, verbatim: "rule (a) post-shed mode, merge 924 when green" — recorded at #656 comment 5625573095:

Shed exit = (a) POST-SHED MODE. The carve-manifest validator learns a manifest-declared phase (phase: carve | post-shed): under post-shed, moved rows are expected ABSENT at the source and remain verified at their destinations by the arrival verifier; a moved row still present refuses (carve-shed-incomplete), so the flip and the deletions are one act. Carve digests stay frozen at b075fd91 / opendox-carve-0; zero rows change disposition.

This is PR-1, the capability only. The shed itself — the 319 deletions and the flip to phase: post-shed — is PR-2, and is not startable until the ruling's three open sub-questions (2), (6) and (7) have words. The manifest here stays in its carve phase and the validator answers OK … phase carve over the current tree.

The problem

docs/opendox-carve-manifest.yaml outlives the tree it describes by exactly one act. Runbook § 5.2's shed deletes every MOVED row's source path and the one deleted_at_carve row — 319 of the 456 — and from that commit onward checks 3 and 4 refuse carve-path-absent by construction. Measured on a throwaway shed tree with the unmodified validator: 1 failed, 197 passed, reproducing PR #924's probe exactly. That refusal is right until the shed is ruled and useless the moment it is.

What changes

phase: is an OPTIONAL top-level key closed to carve (what an absent key means) and post-shed, validated by check 1 — a document-level const in the same family as digest_algorithm, so a mistyped phase cannot reach check 3 and refuse there under a code naming a file.

In the manifest, and there is deliberately no --phase flag. The § 8.2 required-suite seat runs the tool with no arguments, so a flag could never reach the floor at all; a tree that verified or refused according to which job invoked the tool is the one property a floor may not have; and declaring it in the document makes the flip and the deletions one reviewable diff. test_the_phase_is_the_manifests_and_not_a_command_line_flag asserts --phase is absent from --help.

Exactly two arms change semantics:

carve post-shed
check 3 pass 2, MOVED row (318) present + blob/mode match required absent EXPECTED; present → carve-shed-incomplete
check 4 vanished, incl. deleted_at_carve (1) absence refuses shed set excluded; a mirror arm refuses a deleted_at_carve row still present

The shed set is derived from the rows themselves (MOVED_DISPOSITIONS, or reason == "deleted_at_carve"), never from a second list, in the validator and in every test alike — so nothing has to be kept in step by hand.

The declaration is symmetric, which is what makes it a floor and not a mute. A post-shed manifest over a tree still carrying a moved row refuses, so the phase cannot be flipped ahead of the deletions to buy silence for 319 rows at once, and the deletions cannot land ahead of the phase. Runbook § 8's "no ordering of two commits leaves a green intermediate" stops being a discipline the lane is asked to remember and becomes the thing this file checks.

What does NOT change

  • Check 2 (ANCESTOR) is untouched — the shed deletes files from a tree, not a commit from a history.
  • Check 3 PASS 1 is untouched — all 318 digests still recomputed from the referent's real bytes on every run, all 794 declared lines still bounded.
  • Check 4's referent walk and its appeared guard are untouched — a file appearing under the surface still refuses carve-file-undeclared in both phases.
  • stays_openxfactory_adapter (103), stays_openxfactory_governance (14) and replicated_at_destination (20) are still required PRESENT in both phases.
  • Checks 1, 5 and 6 never read the tree.
  • No digest, no disposition, no carve_commit, no carve_tag moves. post-shed is not a re-cut and cuts no tag.

Zero lines in the five surfaces the ruling fenced off: scripts/verify-carve-arrival.py, scripts/carve_lines.py, tests/carve_arrival/, .github/ (including pytest-suite.yml) and openspec/changes/. No file is deleted. pytest-suite.yml needs no edit: the 11 added tests raise SELECTED and PASSED, which are floors that may only rise, and add no skip.

What post-shed gives up, stated plainly: for the 318 moved rows only, it stops asking "has this file drifted on main since the carve". That cannot be asked of a deleted file under any exit, and the answer it was buying is discharged once and elsewhere — at the four destinations, by verify-carve-arrival.py, against blobs read at carve_commit from this repository's own history, which the shed does not touch. The 137 rows that stay keep every guarantee they had.

Lane defaults taken

  • (3) --at <carve_commit> corrected in both places it stops answering. At the carve commit every source path IS present, which is exactly what a post-shed manifest refuses — so from the shed commit onward that invocation returns carve-shed-incomplete. The manifest's own header block and runbook § 0.4 now say so and name the two remaining ways to ask about the carve's own line: check out a pre-shed revision, or read the digests straight out of git. Deliberately not special-cased — a phase that could be satisfied two ways is a phase that says less. Pinned by test_the_carve_commits_own_line_refuses_under_a_post_shed_manifest.
  • (4) the new refusal code joins the tuple, and the "FIXED, COMPLETE" note is amended. carve-shed-incomplete is inserted before carve-unreadable, and the note now records that the extension is a ruled, diff-visible act; that "FIXED, COMPLETE" states what the vocabulary owes a caller (every code a check can raise is in it, and nothing raises a code outside it) rather than promising never to extend it; and that RATIFIED_CODES restates the tuple as a literal so no member moves in silence. REMEDIATION gains the opposite remedy, because "re-cut the manifest" is wrong for this code.
  • (5) the frozen-surface appeared guard stays as-is under post-shed. Pinned by test_a_file_appearing_under_the_surface_still_refuses_post_shed.
  • (8) runbook § 8's shed test count corrected, 3,426 → 3,404, with the measuring command beside it so the next reader re-derives rather than carries it. Measured at this branch's base 554536f6: 319 shed paths, 3404 def test_.

The OK line reports the phase, on every run

In both phases, not only the new one: a reader of a CI log must be able to tell which semantics answered without opening the manifest, and a line silent under the default would make the default the one state no log records. It is also what lets the § 8.2 seat assert the run took the branch the document declares. --json gains phase and shed_rows.

Tests: 198 → 209

The eleven added cases are subprocess-driven against real throwaway git trees, on the file's own discipline. tests/carve_arrival is unchanged at 91.

The § 8.2 seat test_the_real_repository_answers_at_the_ruled_path additionally reads the declared phase out of the YAML and requires it to equal the phase the run reports, plus the phase-specific sentence — so a phase-blind run, or one that silently fell back to the default, fails there rather than reading as green.

Verification, verbatim

Over this branch (pre-shed, phase: carve):

$ python3 scripts/validate-carve-manifest.py
OK …/docs/opendox-carve-manifest.yaml: phase carve, 456 row(s) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0), verified at f86dd6d8ff07 — 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
OK …: phase carve, 456 row(s) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0) — … 318 digest(s) recomputed; 456 file(s) in the declared surface with none undeclared
exit=0

$ python3 -m pytest tests/carve_manifest tests/carve_arrival -q
209 passed in 57.80s

$ python3 -m pytest tests/doc-health -q -k "header or lifecycle or index"
71 passed, 1618 deselected, 1 warning in 49.14s

Synthetic post-shed check — a throwaway copy of this branch with the 319 rows' source paths deleted (derived from the manifest, never listed) and phase: post-shed, since discarded:

$ python3 scripts/validate-carve-manifest.py
OK …: phase post-shed, 456 row(s) at opensoft/openxFactory@b075fd91dc8f (opendox-carve-0), verified at 74f640efa1c1 — 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; 319 shed row(s) absent at source as declared
exit=0

$ python3 -m pytest tests/carve_manifest tests/carve_arrival -q
209 passed in 55.10s

Both directions of the symmetry, on the real repository — restore one shed file under a post-shed manifest, and flip the phase over the unshed tree:

FAIL …: carve-shed-incomplete — contracts/schemas/gate-action-record.schema.yaml: STILL PRESENT UNDER A POST-SHED MANIFEST — rows[0] declares it `moved_verbatim` at b075fd91dc8f, the manifest declares `phase: post-shed`, and 4000ae547bf7 still carries it as a file. …

Governance

No openspec/changes/ path — this is a plain gate and lands on the lane's word. The change packet's design.md amendment for the post-shed mode is owed to PR-2 (the shed), not to this PR. Rule 6's landing window does not apply.

Measured source: the exit-(a) spike's design note (721 lines, Status: brainstorm), which this lane is filing into ideation/brainstorm/ separately. Two numbers were re-measured at this branch's base and both held: 3,404 def test_ across the 319 shed paths, and 209 passing carve tests.

One correction to the ruling's own text, for the record: it calls carve-shed-incomplete "the seventh refusal code", which is the design note's Q4 wording. The tuple as landed carries twelve members, and the new one is the eleventh by position (inserted before carve-unreadable). Nothing in the ruling's substance turns on the ordinal.

Reviewers welcome — Copilot and Sourcery on the usual lane terms.

🤖 Generated with Claude Code

Summary by Sourcery

Add a manifest-declared post-shed validation phase that makes the carve shed and phase transition an atomic, fail-closed operation.

New Features:

  • Add a manifest-declared carve/post-shed phase that allows validation to continue after the ruled source-file shed while preserving all unaffected checks.
  • Report the active phase and post-shed shed-row evidence in human-readable and JSON validation results.

Bug Fixes:

  • Prevent post-shed validation from treating intentionally removed moved and deleted_at_carve source rows as ordinary missing-path failures.
  • Introduce carve-shed-incomplete for trees whose files and declared post-shed phase are out of sync.

Enhancements:

  • Keep phase semantics self-describing in the manifest, symmetric between the declaration and deletions, and derived from manifest rows rather than a separate path list.
  • Document post-shed behavior, the changed --at expectation, and the corrected shed-related test count in the cutover runbook.

Documentation:

  • Update the carve manifest and cutover runbook with post-shed lifecycle guidance and validation expectations.

Tests:

  • Expand carve-manifest coverage with real-tree tests for post-shed success, incomplete sheds, invalid phases, backward-compatible defaults, reporting, and command-line flag absence.

Chores:

  • Extend the ratified refusal-code vocabulary and remediation guidance for post-shed validation failures.

brettheap and others added 2 commits September 10, 2026 17:27
FLOOR PART 1 outlives the tree it describes by exactly one act. Runbook
§ 5.2's shed deletes every MOVED row's source path and the one
`deleted_at_carve` row — 319 of the 456 — and from that commit onward
checks 3 and 4 refuse `carve-path-absent` by construction, which is
right until the shed is ruled and useless the moment it is.

RULED (a) POST-SHED MODE, Brett Heap 2026-09-10, verbatim "rule (a)
post-shed mode" (`#656` comment `5625573095`). This is the capability
only: the shed itself and the flip to `post-shed` are PR-2's, and this
commit leaves the manifest in its `carve` phase over the current tree.

`phase:` is an OPTIONAL top-level key closed to `carve` (what an absent
key means) and `post-shed`, validated by check 1 — a document-level
const in the same family as `digest_algorithm`, so a mistyped phase
cannot reach check 3 and refuse there under a code naming a file. It is
declared IN the manifest and there is deliberately no `--phase` flag:
the § 8.2 required-suite seat runs the tool with no arguments, so a flag
could never reach the floor at all, and a tree that verified or refused
according to which job invoked the tool is the one property a floor may
not have. It also makes the flip and the deletions one reviewable diff.

Exactly two arms change. Check 3 pass 2, for a MOVED row, reads in the
mirror: absence is the declared outcome and PRESENCE is the finding.
Check 4 excludes the shed set — derived from the rows themselves, never
from a second list — from `vanished`, and gains a mirror arm for the
`deleted_at_carve` row that the digest loop never reads.

Everything else is untouched in both phases. Check 2's ANCESTOR test
stands (the shed deletes files from a tree, not a commit from a
history), so check 3 PASS 1 still recomputes all 318 digests from the
referent's real bytes and still bounds all 794 declared lines; check 4
still walks the referent, still refuses a file that has APPEARED under
the surface, and still requires every `stays_*` and
`replicated_at_destination` row PRESENT; checks 1, 5 and 6 never read
the tree. No digest, disposition, `carve_commit` or `carve_tag` moves:
`post-shed` is not a re-cut.

The declaration is SYMMETRIC, which is what makes it a floor and not a
mute: a `post-shed` manifest over a tree still carrying a moved row
refuses the new `carve-shed-incomplete`, so the phase cannot be flipped
ahead of the deletions to buy silence for 319 rows at once, and the
deletions cannot land ahead of the phase. Runbook § 8's "no ordering of
two commits leaves a green intermediate" stops being a discipline the
lane is asked to keep and becomes the thing this file checks.

Lane default (4): `carve-shed-incomplete` joins `REFUSAL_CODES` and its
"FIXED, COMPLETE" note is amended to record that the extension is a
ruled, diff-visible act, and that `RATIFIED_CODES` in the test restates
the tuple so no member moves in silence. `REMEDIATION` gains the
opposite remedy, because "re-cut the manifest" is wrong for this code.

Lane default (5): check 4's `appeared` guard is unchanged under
`post-shed`. The surface stays frozen.

The `OK` line now names the phase on EVERY run, in both phases: a reader
of a CI log must be able to tell which semantics answered without
opening the manifest, and a line silent under the default would make the
default the one state no log records. `--json` gains `phase` and
`shed_rows`.

Eleven tests, all subprocess-driven against real throwaway git trees on
the file's own discipline, with each fixture's shed set derived from its
own rows. The § 8.2 seat additionally asserts that the phase the run
REPORTS equals the phase the file DECLARES, and the phase-specific
sentence with it — so a phase-blind run, or one that silently fell back
to the default, fails there rather than reading as green.

Refs #656

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The document half of RULED (a) (Brett Heap, 2026-09-10, `#656` comment
`5625573095`). No behaviour: the validator's semantics landed in the
previous commit and the manifest stays in its `carve` phase, which is
where it belongs until runbook § 5.2 runs.

`docs/opendox-carve-manifest.yaml` carries `phase: carve` explicitly
rather than by omission, with a header block giving the grammar (two
values, absent means `carve`), what each phase requires of the tree,
what `post-shed` does NOT move (`carve_commit`, `carve_tag`, every
`sha256`, every disposition — it is not a re-cut), and the symmetry that
makes the flip and the deletions one act. Written from the carve side,
because that is the side a reader is on today.

Lane default (3): the two places documenting `--at <carve_commit>` are
corrected where they stop answering. At the carve commit every source
path IS present, which is exactly what a `post-shed` manifest refuses,
so from the shed commit onward that invocation returns
`carve-shed-incomplete`. Both the manifest's own header block and
runbook § 0.4 now say so and name the two remaining ways to ask about
the carve's own line — check out a pre-shed revision, or read the
digests straight out of git. It is deliberately not special-cased: a
phase that could be satisfied two ways is a phase that says less.

Runbook § 8 gains the post-shed paragraph — the flip rides in the same
commit as the deletions, it is not a re-cut, and the floor CHECKS the
atomicity rather than asking the lane to remember it — and § 11 records
that a `carve-shed-incomplete` is not a re-cut trigger: it says the
declared phase and the tree disagree, and its remedy is inside § 5.2.

Lane default (8): § 8's shed test count was 3,426 and is MEASURED at
3,404, over the 319 paths the manifest's own rows derive, at `main`
554536f. The measuring command sits beside the number so the next
reader re-derives it instead of carrying it:

    319 shed paths, 3404 def test_

Refs #656

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 21:33
@brettheap
brettheap marked this pull request as ready for review September 10, 2026 21:33

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

@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR adds the capability for the carve-manifest validator to recognize a manifest-declared post-shed phase while retaining carve as the default. It narrowly changes MOVED and deleted_at_carve source-path semantics, enforces that the phase declaration and shed are an atomic transition through symmetric refusal behavior, documents the lifecycle implications, and adds comprehensive subprocess and real-repository tests.

Sequence diagram for phase-aware carve manifest validation

sequenceDiagram
    participant Caller
    participant Validator
    participant Manifest
    participant GitTree

    Caller->>Validator: validate(manifest_path, repo)
    Validator->>Manifest: read_manifest(manifest_path)
    Validator->>Validator: check_shape(doc)
    Validator->>Manifest: read phase
    Validator->>GitTree: check_revision(repo, doc, at)
    Validator->>GitTree: tree_at(carve_commit)
    Validator->>GitTree: tree_at(verified_at)
    Validator->>Validator: check_digests(..., phase)
    alt phase is post-shed and MOVED source is present
        Validator-->>Caller: carve-shed-incomplete
    else phase is post-shed and shed sources are absent
        Validator->>Validator: check_surface(..., phase)
        Validator-->>Caller: OK phase post-shed
    else phase is carve
        Validator->>Validator: check_surface(..., phase)
        Validator-->>Caller: OK phase carve
    end
Loading

State diagram for the carve manifest lifecycle

stateDiagram-v2
    [*] --> carve
    carve --> post_shed: same commit: delete shed rows + phase: post-shed
    post_shed --> [*]

    state carve {
        [*] --> SourcePathsPresent
        SourcePathsPresent --> SourcePathsPresent: MOVED paths present and verified
    }

    state post_shed {
        [*] --> ShedPathsAbsent
        ShedPathsAbsent --> ShedPathsAbsent: MOVED and deleted_at_carve paths absent
    }
Loading

Flow diagram for post-shed source-path checks

flowchart TD
    A[Read manifest phase] --> B{phase is post-shed?}
    B -- No: carve --> C[MOVED source must be present]
    C --> D{Source absent?}
    D -- Yes --> E[Refuse carve-path-absent]
    D -- No --> F[Verify blob and mode]
    B -- Yes --> G[Derive shed set from MOVED and deleted_at_carve rows]
    G --> H{MOVED source still present?}
    H -- Yes --> I[Refuse carve-shed-incomplete]
    H -- No --> J[Expected absence passes]
    J --> K{Non-shed source absent?}
    K -- Yes --> L[Refuse carve-path-absent]
    K -- No --> M[Post-shed validation passes]
Loading

File-Level Changes

Change Details Files
Add manifest-declared phase semantics for validating the repository before and after the carve shed.
  • Add optional `phase: carve
post-shed, defaulting to carve, and reject unknown values during shape validation.</li><li>In post-shed, accept absence for all MOVED and deleted_at_carvesource rows while rejecting any shed row that remains present withcarve-shed-incomplete.</li><li>Derive the shed set from manifest row dispositions/reasons and preserve all other digest, surface, ancestry, and presence checks.</li><li>Expose phaseandshed_rowsin JSON and report the phase in every successful human-readable result.</li><li>Document that the phase flip and 319 source deletions must land together, including the changed--at` behavior and corrected shed test count.
Expand manifest validation coverage for phase behavior and enforce the manifest as the sole phase authority.
  • Add subprocess tests for default carve behavior, successful post-shed validation, both symmetry failure directions, preserved checks for staying/appeared files, and --at refusal after the phase flip.
  • Test unknown and absent phases, JSON phase metadata, the absence of a --phase CLI option, and real-repository phase reporting.
  • Register carve-shed-incomplete in the expected refusal-code vocabulary.
tests/carve_manifest/test_carve_manifest.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

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

A moderate remediation issue and several documentation/test nits remain unresolved.

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

Pull request overview

Adds manifest-declared carve and post-shed validation phases for the OpenDox lifecycle.

Changes:

  • Enforces post-shed source absence and reports phase metadata.
  • Adds subprocess and JSON coverage for both phases.
  • Updates manifest and cutover documentation.
File summaries
File Review findings
tests/carve_manifest/test_carve_manifest.py Rename the_manifests test for readability (nit, 1 vote).
scripts/validate-carve-manifest.py Update grammar comments, clarify phase validation documentation (nits, 2 and 1 votes), and provide phase-specific remediation for retained rows (moderate, 1 vote).
docs/opendox-cutover-runbook.md Clarify post-shed --at behavior, retained-row remediation, and derive measurements from the shared predicate (nits, 1 vote each).
docs/opendox-carve-manifest.yaml Qualify the statement about invocation validity after the phase transition (nit, 1 vote).
Review details

Suppressed comments (6)

docs/opendox-carve-manifest.yaml:20

  • The header still says that “either invocation answers” from any descendant, but this new caveat makes the --at <carve_commit> invocation refuse after phase: post-shed. The primary verification instructions are therefore self-contradictory; qualify the earlier claim as pre-shed or state which invocation remains valid after the flip.
# THE SECOND ONE STOPS ANSWERING THE DAY `phase:` BELOW FLIPS TO `post-shed`:
# at the carve commit every source path is PRESENT, which is exactly what a
# post-shed manifest refuses (`carve-shed-incomplete`). From that commit on,
# ask about the carve's own line by checking out a pre-shed revision, or read
# the digests straight out of git

docs/opendox-cutover-runbook.md:1048

  • This §11 rule still treats every carve-path-absent as a re-cut trigger, but post-shed check 4 intentionally emits that code when a retained stays_* or replica row is deleted. Re-cutting cannot restore a source that is already absent at the new referent and would weaken the retention guarantee; scope this rule to carve/moved-row drift and document the retained-row remedy separately.
`carve-digest-mismatch`, `carve-file-undeclared` or `carve-path-absent`
(a `carve-shed-incomplete` is NOT this: it says the manifest's declared phase
and the tree disagree, and its remedy is inside § 5.2, never a re-cut) — the

docs/opendox-cutover-runbook.md:951

  • This measurement snippet hard-codes a second moved-disposition list instead of reusing the validator's MOVED_DISPOSITIONS predicate. If the disposition vocabulary changes, the documented 3,404 count can silently diverge from the actual shed set, despite this section saying the count is derived and not carried by hand; reuse the same source predicate here.
  shed = [r["source_path"] for r in doc["rows"]
          if r["disposition"] in ("moved_verbatim", "moved_with_declared_edit")
          or r.get("reason") == "deleted_at_carve"]

scripts/validate-carve-manifest.py:29

  • This says the other four checks are phase-blind, but check 1 now reads and validates phase at lines 751-761 before any Git call. Please distinguish check 1's document-level phase validation from checks 3/4's revision semantics; otherwise the ordered-check documentation contradicts the implementation.
Two of them read the revision under test and therefore read `phase:` — see
"THE TWO PHASES" below; the other four are phase-blind.

scripts/validate-carve-manifest.py:1506

  • Under post-shed, deleting a retained stays_* or replicated_at_destination row still raises carve-path-absent in this branch, but CarveRefusal.render() appends the global remediation telling the caller to re-cut the manifest. A new carve commit cannot contain that missing source and re-cutting would incorrectly widen the shed; this path needs a phase-specific remediation (restore the retained row or correct the shed/manifest) instead of the re-cut guidance.
            + (". Under `phase: post-shed` a MOVED row and the "
               "`deleted_at_carve` row are EXPECTED to be gone and are not "
               "counted here — every row named above is a row that STAYS, and "
               "the shed does not reach it"
               if phase == PHASE_POST_SHED else ""))

tests/carve_manifest/test_carve_manifest.py:1830

  • The new test name has a grammatical typo: the_manifests should be singular the_manifest. Renaming it keeps the test node readable and consistent with the manifest terminology used throughout this file.
def test_the_phase_is_the_manifests_and_not_a_command_line_flag() -> None:
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread scripts/validate-carve-manifest.py Resolved
Copilot (PRRT_kwDOTAvnrs6hQVzN): now that `phase` is accepted as
another optional top-level key, the grammar comments still said
`header:` is the only optional key and that every other key is
required — the same wording repeated in check_shape's stray-key
refusal message — so the documented grammar contradicted what check 1
actually accepts.

Both spots corrected, comment/string text only, no behaviour change:

* the TOP_LEVEL_KEYS comment now names `header:` and `phase:` as the
  two optional keys, states what each means (header is RULED OQ-E's
  convention-break prose; phase absent means `carve`), and points back
  at "THE TWO PHASES" for the full grammar.
* the carve-shape-invalid message for an unknown top-level key now
  says "`header:` and `phase:` are its two optional keys; every other
  key is required" instead of naming `header:` alone.

209 carve_manifest + carve_arrival tests still pass; no test asserted
the old wording verbatim.

Refs #656

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 22:12

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

Add the missing carve-commit test and address the documented follow-up issues.

Review details

Suppressed comments (5)

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

tests/carve_manifest/test_carve_manifest.py:1830

  • The new test name is grammatically incorrect (manifests is plural). Rename it to test_the_phase_is_the_manifest_and_not_a_command_line_flag so the test name clearly describes the invariant it checks.

docs/opendox-carve-manifest.yaml:20

  • This caveat is added to the manifest and runbook, but the public README entry at README.md:80 still says --at b075fd91dc8fced8e1373825ba80220c33536bae asks about that revision without qualification. Once the manifest flips to post-shed, that invocation intentionally returns carve-shed-incomplete, so please update the README in the same change to avoid advertising a command that no longer answers the carve revision.
# THE SECOND ONE STOPS ANSWERING THE DAY `phase:` BELOW FLIPS TO `post-shed`:
# at the carve commit every source path is PRESENT, which is exactly what a
# post-shed manifest refuses (`carve-shed-incomplete`). From that commit on,
# ask about the carve's own line by checking out a pre-shed revision, or read
# the digests straight out of git

scripts/validate-carve-manifest.py:1154

  • Adding phase changes pass 2's behavior, but this docstring still describes pass 2 as always checking that the tested tree is unchanged from the carve. In post-shed, moved sources are intentionally absent, so the function contract should document the phase-specific presence/absence rule.
                  phase: str = PHASE_CARVE) -> int:

scripts/validate-carve-manifest.py:1357

  • The new phase parameter makes this function intentionally allow the manifest-derived shed set to be absent, but the docstring still promises that every surface file appears at the tested revision. Please update the contract to mention the post-shed exception so future callers do not read the old guarantee as still universal.
                  phase: str = PHASE_CARVE) -> int:

tests/carve_manifest/test_carve_manifest.py:1788

  • This test is documented as exercising --at <carve_commit>, but after shed() scratch.head is the post-shed commit, so it only covers the normal HEAD tree. The actual carve commit (doc["carve_commit"]), where all moved rows are present and must trigger carve-shed-incomplete, is not tested.
    done = run(scratch, "--at", scratch.head)
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@sonarqubecloud

Copy link
Copy Markdown

@brettheap
brettheap merged commit 0e76e78 into main Sep 10, 2026
13 checks passed
brettheap added a commit that referenced this pull request Sep 10, 2026
…endox; brainstorm) (#929)

Files the § 5.2 shed-exit design note (the measurement agent's spike report of 2026-09-10) into `ideation/brainstorm/` and indexes it in `ideation/README.md`, so the measurement behind Brett Heap's RULING (a) POST-SHED MODE survives scratchpad loss. What it measured: exit (a) works — the carve-manifest validator answers OK over the full 319-row shed tree, both carve suites green at 209 passed, zero disposition changes, a 482-added / 17-removed diff across 4 files (realized as #928). The shed also exposes an unbudgeted adapter re-point — 104 import sites across 32 files naming 32 shed modules, 17 of them unreachable without an openDox mount (→ RULED Q7, the second submodule), the retained `tests/ideation-dashboard/conftest.py:106` import that aborts collection (→ RULED Q6), and a six-schema `contracts/schemas/` family still named by 127 tracked files (→ RULED Q2) — and costs exits (b) RE-CUT and (c) RETIREMENT. Provenance: #656 comments 5624521801 (ruling request), 5625144570 (measured addendum), 5625573095 (RULING (a)). The measurement text is verbatim from the lane's scratchpad note; the header and `## Provenance` are adapted to the brainstorm-doc format; three dated editor's notes (`> **Editor's note (filing, 2026-09-10):**`) correct a `verified_at` sha inconsistency (88caf62e vs b27f0555 — two distinct commits on the spike chain), date the since-superseded "CI inits only openXwallet" claim (#917 → edf0e24 widened the init), and pin the Appendix's reproduction clone — all added beside the original text without rewriting it, as the brainstorm stage allows. No `openspec/changes/` path. Independent check (sonnet fix round, 2026-09-10): 6 Copilot threads all resolved with real edits or notes; 0 closing references in body and commits; pytest-suite run 34538910209 success; six required checks green.

Refs #656 (stays OPEN).

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Sep 10, 2026
… 5 review threads

Mirrors PR #917 file-for-file for the remaining pieces task 5.1's extension
owes (docs/opendox-cutover-runbook.md § 7; RULED Q7, #656 comment
5626248666):

- scripts/doc_health/pin_class.py: two new PinMember entries beside the
  openxdox-pin-* pair (opendox-pin-carve-commit REPO_LOCAL,
  opendox-pin-product-commit CROSS_REPOSITORY), both keyed on
  contracts/opendox-pin.yaml. Measured with pin_class.verify(): standing
  census 73,26 -> 75,28 (81 results / 29 members on this tree; 79 / 27 on
  origin/main at 85fb856), uncovered/vanished/arrived all untouched.
- tests/doc-health/test_sentinel_vocabulary.py: the census step recorded and
  the frozen-pair assertion moved to (75, 28), measured the same way against
  main, never by arithmetic.
- .github/workflows/pytest-suite.yml: the init step now also initializes
  openDox, so tests/opendox_pin/'s positive case (and its lockstep check,
  which reads openXdox's own derived pin) run against the real checkout in
  CI. openDox/code is not initialized and is not needed here.
- docs/opendox-cutover-runbook.md § 7: a dated amendment recording that
  RULED Q7 supersedes RULING F for openDox alone, quoting the ruling, naming
  the lockstep invariant, and noting design.md's matching sentence is
  amended by PR-2's packet patch rather than here.
- contracts/README.md: a doc-index row for contracts/opendox-pin.yaml in the
  Native openxFactory contracts table, alongside openxwallet-pin.yaml's and
  openspec-cli-pin.yaml's own rows (openxdox-pin.yaml has no row of its own
  to sit beside; the row says so rather than papering over it).

Addresses all 5 open review threads on the first commit:

1/2. tests/openxdox_pin/test_openxdox_pin_verifier.py's
   test_ruling_f_is_checkable_no_opendox_pin_and_no_second_gitlink asserted
   RULING F (no second pin, no second gitlink), which RULED Q7 supersedes for
   openDox. Renamed to test_ruling_q7_two_direct_upstreams_in_lockstep: it
   now asserts exactly two product gitlinks (openDox, openXdox) and the
   LOCKSTEP equality between contracts/opendox-pin.yaml's commit and the
   commit openXdox/contracts/opendox-pin.yaml names, read as a git blob at
   the openXdox gitlink's own commit rather than through the working tree.
   The docstring carries the supersession (ruling ids, date).
3. scripts/verify-opendox-pin.py's _openxdox_derived_commit read
   openXdox/contracts/opendox-pin.yaml from the mutable working tree, so an
   edit there that never moved the openXdox gitlink could satisfy or defeat
   the lockstep check regardless of what is actually pinned. Rewritten to
   resolve the openXdox gitlink (_recorded_gitlink, HEAD then the index,
   exactly as check 2 does for openDox) and read the blob at that commit
   with `git show <oid>:contracts/opendox-pin.yaml` against the openXdox
   submodule's own object store. Every failure to locate the gitlink or read
   or parse the blob refuses pin-unreadable (an environment fact, not one of
   the six governed codes) naming the init command.
4. load_pin()'s `except (OSError, yaml.YAMLError)` did not catch
   UnicodeDecodeError, so a non-UTF-8 pin file would crash main() with a
   traceback instead of the documented fail-closed refusal. Added
   UnicodeDecodeError to that clause; the rewritten _openxdox_derived_commit
   decodes the git-show blob by hand and catches the same error there.
5. Added tests/opendox_pin/test_opendox_pin_verifier.py, a hermetic suite of
   the same shape as tests/openxdox_pin/'s own: every one of the six
   opendox-pin-* refusal codes exercised (the five mirrored from
   openxdox-pin-*, plus the new lockstep-mismatch), a scratch fixture with
   TWO nested repositories (openDox, with its own nested leg gitlink, and
   openXdox, holding only the derived pin file check 5 reads), and the
   regression test the fix above exists to pass:
   test_editing_the_openxdox_working_tree_pin_does_not_fool_lockstep edits
   that file on disk, without moving the openXdox gitlink or committing, and
   asserts verify() is unmoved because it never reads that file.

Verified locally: both submodules initialized (git submodule update --init
openDox openXdox); `python3 scripts/verify-opendox-pin.py` and
verify-openxdox-pin.py both OK; `pytest tests/opendox_pin tests/openxdox_pin
tests/doc-health/test_sentinel_vocabulary.py` 140 passed;
validate-carve-manifest.py OK (456 rows, unchanged); `pytest tests/carve_manifest
tests/carve_arrival` 209 passed (grown from PR #917's own measured 198 by
#928, landed on main after #917 and before this branch was rebased onto it;
neither directory is touched by this commit). openDox main sha bound live
via `gh api repos/opensoft/openDox/branches/main`, matches the pinned
49a99df2...; the sorted-ls-tree-r-v1 digest independently recomputed from a
separate fresh clone equals the pin's recorded 96655ad2...; openXdox's own
contracts/opendox-pin.yaml at db58fffa... names the same 49a99df2... commit
this pin does.

Refs #656 (stays OPEN). Refs #872.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants