Repository navigation
Carve arrival: declared per-destination admissions file replaces the hand-typed --allow-created list (RULED, #656) - #979
Conversation
…hand-typed --allow-created list RULED — the arrival-admission repair, Brett Heap, 2026-09-11 18:37Z, `#656` comment 5639058687: the runbook's `openxdox_code` arrival-admission list was stale (two files openXdox-code#7 added had no declared admission anywhere). Shape ruled: each leg destination carries a small declared admissions file in openxFactory that `scripts/verify-carve-arrival.py` reads, so a new admission is a reviewed one-line diff in the pin-bump PR — governed like the manifest, not typed on a command line. - docs/opendox-carve-admissions.yaml: new, one `created:` block per destination the manifest names, seeded with the two openXdox-code#7 files (src/openxdox/consumer_reach.py, tests/test_dependency_direction.py, both since bfd95063b2a71be097a04bb6a3a99c4c131dd322). - scripts/verify-carve-arrival.py: reads the admissions file by default (path derived from the manifest's location, `--admissions` overrides), applies each destination's `created:` list exactly as `--allow-created` does, refuses a file naming an unknown destination id or carrying a duplicate or unsorted `created:` list, and reports which admissions were used and which declared ones were not needed. `--allow-created` keeps working for ad-hoc runs and now prints a one-line notice that the declared form is governed. - tests/carve_arrival/: default-path resolution, exact-file admission, the three input guards, the stale-admission report, the ad-hoc notice, and the real committed file's two seeded entries. - docs/opendox-cutover-runbook.md, README.md: point the arrival section and doc index at the new file as the governed form. Lane: openxfactory-4-opendox-extraction Refs #656 (stays OPEN). Co-Authored-By: Claude Sonnet 5 <[email protected]>
Reviewer's GuideReplaces hand-typed arrival admissions as the governed workflow with a reviewed YAML file keyed by manifest destinations, while retaining Sequence diagram for declared carve arrival admissionssequenceDiagram
participant Operator
participant Verifier as verify-carve-arrival.py
participant Manifest as carve manifest
participant Admissions as opendox-carve-admissions.yaml
participant Destination as Destination tree
Operator->>Verifier: main(--destination, --phase)
Verifier->>Manifest: read_manifest()
Verifier->>Admissions: read_admissions()
alt Admissions file absent
Verifier->>Verifier: use empty declared_created
else Admissions file present
Verifier->>Verifier: validate destination, path, reason, since, ordering
alt malformed admissions
Verifier-->>Operator: arrival-unreadable
else valid admissions
Verifier->>Destination: check_undeclared_files()
Verifier->>Verifier: apply declared created paths
Verifier-->>Operator: OK with declared_admissions_used/unused
end
end
opt --allow-created supplied
Verifier-->>Operator: stderr notice for ad-hoc admission
end
Flow diagram for validating declared arrival admissionsflowchart TD
Start["Run arrival verification"] --> Load["Load manifest and admissions file"]
Load --> Present{"Admissions file present?"}
Present -->|No| Empty["Use no declared admissions"]
Present -->|Yes| Validate["Validate schema, destinations, fields, paths, duplicates, ordering"]
Validate --> Valid{"Valid?"}
Valid -->|No| Refuse["Refuse: arrival-unreadable"]
Valid -->|Yes| Apply["Apply declared created paths exactly"]
Empty --> Apply
Apply --> Walk["Walk destination files"]
Walk --> Report["Report used and stale declared admissions"]
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
Three moderate review findings remain unresolved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This pull request adds governed per-destination admissions for carve arrivals while preserving ad-hoc verification support.
Changes:
- Adds and seeds the admissions YAML file.
- Extends arrival verification with validation and stale-admission reporting.
- Updates tests, documentation, and the README index.
File summaries
| File | Summary |
|---|---|
tests/carve_arrival/test_verify_carve_arrival.py |
Adds admissions coverage; the committed-seed test should assert required files exist. |
scripts/verify-carve-arrival.py |
Implements admissions handling; read-error handling and strict since: validation need correction. |
README.md |
Adds the admissions document to the index. |
docs/opendox-cutover-runbook.md |
Documents the governed admissions workflow. |
docs/opendox-carve-admissions.yaml |
Declares the two openxdox_code admissions. |
Review details
Suppressed comments (3)
scripts/verify-carve-arrival.py:729
- An empty, present admissions file parses as
Noneand is accepted as if the optional file were absent. This contradicts the documented absent-versus-present distinction and allows a truncated governance file to silently turn off all declared admissions; a present non-mapping document should be refused asarrival-unreadable.
if raw is None:
return {}
scripts/verify-carve-arrival.py:740
- The header validation checks only types, so
schema_version: 999orkind: some-other-documentis still accepted and itsdestinations.createdentries are applied as admissions. Since this reader is the owner of the admissions format and has no support for alternate versions/kinds, it should requireschema_version: 1andkind: opendox-carve-admissionsbefore consuming the file.
for key, kind in (("schema_version", int), ("kind", str),
("destinations", dict)):
if not isinstance(raw.get(key), kind):
raise ArrivalRefusal(
"arrival-unreadable",
f"the admissions file at {path} carries no usable `{key}:`")
tests/carve_arrival/test_verify_carve_arrival.py:2348
- The test only asserts the
openxdox_codepaths; an unintendedcreated:admission underopendox_code,opendox_spec, or another destination would still pass, contradicting the docstring's “nothing else declared” claim and the PR's exact two-file seed. Assert the committed file has exactly the manifest's destination keys and that every non-openxdox_codelist is empty.
assert set(admissions) <= set(manifest_doc["destinations"])
- Files reviewed: 5/5 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.
Copilot review (PR #979, thread on scripts/verify-carve-arrival.py:712): `except OSError: return {}` in read_admissions() treated every OSError — permission failures, I/O errors, a path that is a directory — as if the admissions file were simply absent. That silently disables the governed admissions and can let the verifier fall through to report an unrelated undeclared-file result instead of naming the real cause. Only FileNotFoundError now means ABSENT (return {}); any other OSError raises ArrivalRefusal("arrival-unreadable"), on read_manifest's own idiom for a document this tool cannot trust. Added test_an_unreadable_admissions_file_refuses_rather_than_reads_as_absent (a directory sitting where the admissions file would be) — fails without the fix (treated as absent, run reports the destination's own undeclared files instead), passes with it (arrival-unreadable, "could not be read"). pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q -> 260 passed. Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot review (PR #979, thread on scripts/verify-carve-arrival.py:782): `COMMIT_RE.match(value)` uses `^[0-9a-f]{40}$`, and `$` matches just before a trailing newline as well as at the true end of the string. A `since:` value of 40 hex characters plus a trailing "\n" therefore passed as a clean 40-hex commit under .match, silently admitting a value that is not one. .fullmatch requires the match to cover the ENTIRE string, so the trailing newline can no longer ride along unchecked; changed to `COMMIT_RE.fullmatch(value)`. Added test_a_since_value_with_a_trailing_newline_refuses, proved to distinguish the two: COMMIT_RE.match("a"*40 + "\n") is True (would have passed), COMMIT_RE.fullmatch(...) is False (correctly refuses). pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q -> 260 passed. Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot review (PR #979, thread on tests/carve_arrival/test_verify_carve_arrival.py:2345): test_the_committed_admissions_file_seeds_exactly_the_two_ruled_files carried an inherited skip-guard (`if not …is_file(): assert True; return`) copied from an older test written for a period before the manifest existed. That period is over: this admissions file is committed BY THIS SAME PR, so the guard's only live effect is to make the regression test pass silently if the committed manifest or admissions file is ever deleted or renamed out from under it — exactly the failure this test exists to catch. Replaced the guard with two hard assertions that the manifest and the admissions file are both present, each with a message naming the missing path and why the test cares. pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q -> 260 passed. Working tree now matches the fully-fixed state exactly (git diff is empty after this commit). Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Sonnet 5 <[email protected]>
…clared-admissions
There was a problem hiding this comment.
🟡 Changes recommended
Admissions validation must reject empty or unsupported documents and explicit missing overrides; the seed regression also needs complete-set assertions.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (2)
scripts/verify-carve-arrival.py:711
- Because every
FileNotFoundErroris treated as optional absence, a typo in an explicit--admissions missing.yamlsilently disables the governed admissions and can yield a green run or an unrelated arrival finding. The default path may remain optional, but an explicitly named override should fail closed, matching the repository's--manifestbehavior.
except FileNotFoundError:
tests/carve_arrival/test_verify_carve_arrival.py:2400
- The regression assertion only checks paths under
openxdox_codeand allows any additional admissions under other destinations (and even missing destination blocks), so the claimed "exactly the two" seed is not protected. Assert the declared destination keys match the manifest and compare the full(destination, path)set to the two ruled entries.
assert set(admissions) <= set(manifest_doc["destinations"])
openxdox_code = {entry["path"]
for entry in admissions.get("openxdox_code", [])}
assert openxdox_code == {"src/openxdox/consumer_reach.py",
"tests/test_dependency_direction.py"}
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
Copilot review (PR #979, re-review after 5c4d082, thread on scripts/verify-carve-arrival.py:740): read_admissions()'s `if raw is None: return {}` treated an EXISTING file that parses to nothing -- empty, or comments-only -- the same as a file that does not exist at all. That contradicts the module's own stated fail-closed rule (PRESENT AND MALFORMED is arrival-unreadable) and can silently disable every governed admission while the summary still reports the file as present (admissions_file names the path). Removed the special case: `isinstance(None, dict)` is False, so an empty file now falls straight into the existing "is not a mapping" check, whose message already names NoneType -- no new branch needed. Added test_an_empty_admissions_file_refuses_rather_than_reads_as_absent (a file containing only a comment line, which yaml.safe_load parses as None). pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q -> 261 passed. Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot review (PR #979, re-review after 5c4d082, thread on scripts/verify-carve-arrival.py:751): the envelope check validated only Python TYPES (isinstance(…, int), isinstance(…, str)), so `schema_version: 999` and any string `kind:` were accepted and their `created:` entries applied as trusted admissions. Because this function owns the admissions document's shape (no second validator exists for it) and the committed format declares exact envelope values, this reader must check those exact values, not merely their type. Added ADMISSIONS_SCHEMA_VERSION = 1 and ADMISSIONS_KIND = "opendox-carve-admissions" (the values the committed docs/opendox-carve-admissions.yaml itself declares). schema_version is now checked against validate-carve-manifest.py's own idiom -- int, not bool, and equal to the constant, so `schema_version: true` cannot pass as version 1 (isinstance(True, int) is True in Python). kind is checked by equality against the constant. Added three tests: wrong schema_version (999), schema_version: true (the bool trap), and the wrong kind string. pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q -> 264 passed. Working tree now matches the fully-fixed state exactly (git diff is empty after this commit). Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Sonnet 5 <[email protected]>
…clared-admissions
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate verifier findings remain, along with documentation and test nits.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (6)
README.md:81
- Adding this document makes the unchanged claim on the preceding line that the manifest is the “FIRST machine-validated YAML under
docs/” false:read_admissions()validates this YAML's envelope and entries before applying it. Revise that claim (and the manifest's matching header) to say “first manifest” or otherwise account for this second machine-validated document.
- [The openDox carve admissions](docs/opendox-carve-admissions.yaml) (RULED — the arrival-admission repair, Brett Heap, 2026-09-11, `#656` comment 5639058687: the DECLARED per-destination `created:` list `scripts/verify-carve-arrival.py` reads beside the manifest by default, applied exactly as `--allow-created` admits, so a file a leg legitimately assembles is a reviewed one-line diff in the pin-bump pull request rather than a flag typed on a command line and recorded nowhere; seeded with the two `opensoft/openXdox-code#7` files; `--allow-created` remains the ad-hoc fallback)
scripts/verify-carve-arrival.py:724
read_text()also raisesFileNotFoundErrorfor a dangling symlink at this path. Treating that as an absent admissions file silently disables the governed declarations even though a path entry is present, contrary to the fail-closed rule described above. Distinguish a missing path from a broken symlink before returning{}.
except FileNotFoundError:
return {}
scripts/verify-carve-arrival.py:815
- The reader claims each entry is exactly
{path, reason, since}, but this loop validates only those required fields and silently ignores any extra keys. That leaves the governed document's schema open-ended, unlike the manifest's closed maps (scripts/validate-carve-manifest.py:788-797,:883-890,:955-960), so an unsupported or misspelled field can be committed without anarrival-unreadablefinding. Reject stray entry fields before consuming them.
for field in ADMISSIONS_ENTRY_FIELDS:
value = item.get(field)
if not isinstance(value, str) or not value:
scripts/verify-carve-arrival.py:176
- The module docstring now presents two conflicting sources of truth: it still says each created file is named with the command-line
--allow-created, while the following text makes the YAMLcreated:entry the governed form and the committed seed uses it. Update the first statement so--allow-createdis clearly only the ad-hoc fallback; otherwise users reading this public verifier's documentation may keep using the superseded form.
Heap, 2026-09-11, comment 5639058687) the GOVERNED form of that admission is
a `created:` entry in the destination's own block of
`docs/opendox-carve-admissions.yaml`, read automatically by
`read_admissions()` and applied exactly as `--allow-created` admits — so a
scripts/verify-carve-arrival.py:1754
- When a path is present in both
declared_createdandcli_created,check_undeclared_files()receives their union and records onlycreated_paths, so this intersection reports it as a declared admission used even though the ad-hoc flag alone would have admitted it. That makesdeclared_admissions_used/unusedinaccurate during migration runs that retain an old--allow-created; track provenance (or reject overlap) before computing these fields.
used_created: set[str] = admitted["created_paths"]
declared_admissions_used = sorted(declared_created & used_created)
declared_admissions_unused = sorted(declared_created - used_created)
scripts/verify-carve-arrival.py:827
- The parser rejects embedded newlines in
reason, but no arrival test exercises this promised validation; the new malformed-entry tests cover missing fields andsinceinstead. Add a fixture with a multi-line reason and assertarrival-unreadable, so YAML serialization and this branch remain protected.
if field == "reason" and "\n" in value:
raise ArrivalRefusal(
"arrival-unreadable",
f"the admissions file at {path} has a "
f"`destinations.{dest_id}.created[{index}].reason` "
"carrying a newline; the ruling asks for a ONE-LINE "
"reason")
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
…sions form Copilot review (PR #979, re-review after 06aa0ae, thread on docs/opendox-cutover-runbook.md, comment text citing lines 753-756): the runbook's own prose now calls the declared admissions file "the current source of truth" for a destination's created-file admissions, but § 5.5's executable Phase B example for opendox_code still passes `--allow-created pytest.ini --allow-created conftest.py` on the command line with no note — an operator copying it verbatim could read that as the file drifting from its own stated mechanism. Verified against the committed data before touching the doc: RULED #656's first seeding (docs/opendox-carve-admissions.yaml) declares only openxdox_code's two openXdox-code #7 files; opendox_code's own block is `created: []` -- nothing seeded for pytest.ini or conftest.py there. So the example is not stale; it is legitimately using the ad-hoc form § 5.6 and the admissions file's own header both say `--allow-created` still provides for a destination with nothing declared yet. Rewriting the example to reference declared entries would mean ADDING those two files to opendox_code's admissions block -- which is the "regenerating admissions mechanically" / expanding-the-ruled-seeding shape the ruling itself did not ask for and this PR does not own. Took Copilot's second offered option instead: added a paragraph directly under the example's code block explaining why the ad-hoc flag is correct here today, and naming the condition under which it should change (once a future PR declares pytest.ini/conftest.py under opendox_code). No code path touched; docs-only change. Re-ran the full proof afterward: pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q -> 267 passed (unchanged); python3 scripts/validate-carve-manifest.py -> OK; the live arrival check against all five destinations plus both assembly roots, with the committed admissions file and no --allow-created on any of those commands, reproduced byte-for-byte identical to the prior round's output -- the RULED defect stays repaired (openxdox_code: 2 declared admissions used, 0 --allow-created) and the two pre-existing, disclosed FAILs (opendox_code's consumer_reach.py, opendox_spec's stale-citations-erratum, both out of this PR's scope) are unchanged. Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot review (PR #979, re-review after 06aa0ae, thread on tests/carve_arrival/test_verify_carve_arrival.py:2462): test_the_committed_admissions_file_seeds_exactly_the_two_ruled_files only ever inspected admissions.get("openxdox_code", []) -- its one `assert set(admissions) <= set(manifest_doc["destinations"])` is a subset check, so it neither requires every destination to have a block nor looks at what any block OTHER than openxdox_code's contains. An accidental `created:` entry landing under opendox_code, opendox_root, opendox_spec, or openxdox_spec would still pass this test. Verified against the real reader before editing: read_admissions() returns one key per destination the FILE's own `destinations:` map declares (confirmed in scripts/verify-carve-arrival.py, `result[dest_id] = parsed` runs unconditionally in the raw-destinations loop, so an empty `created: []` block still yields a key mapping to `[]`), and the committed docs/opendox-carve-admissions.yaml declares a block for all five manifest destinations today -- confirmed directly with a one-off `yaml.safe_load` comparing both files' destination-key sets, which are equal. Changed the loose `<=` to `==` (the admissions file's own header: "EVERY id the manifest's `destinations:` map carries"), and added a loop asserting `admissions[dest_id] == []` for every destination other than openxdox_code, with a message naming the destination and what was found in it. pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q -> 267 passed (this test strengthens existing assertions rather than adding a new test function, so the total count is unchanged). Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Sonnet 5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical findings and additional admissions-validation gaps remain.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/verify-carve-arrival.py:724
- Catching
FileNotFoundErroras absence also treats a dangling symlink at this path as an absent admissions file. That lets a present-but-unreadable governance entry disable all declared admissions, contrary to the fail-closed rule and the handling of other unreadable paths; distinguish a truly missing path from a symlink (for example withpath.is_symlink()/lstat()) before returning{}.
scripts/verify-carve-arrival.py:821
- The new one-line
reasoninvariant is enforced here, but the added suite has no case that writes a reason containing a newline and assertsarrival-unreadable. Since this parser is the sole guard for the admissions document's shape, add coverage for that branch so a later loader or validation change cannot silently accept multi-line reasons.
if field == "reason" and "\n" in value:
scripts/verify-carve-arrival.py:821
- The one-line
reasonguard rejects\nbut not a YAML-escaped\r;reason: "added\rby..."is decoded with a carriage return and passes despite not being a single-line reason. Reject both line terminators and add a regression case so the admissions metadata cannot carry hidden line breaks.
if field == "reason" and "\n" in value:
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
…de durable Step 3 of the lockstep — `scripts/verify-carve-arrival.py` against every destination AT THE NEW PINNED COMMITS. The legs gained files since the old pins and a created file has no manifest row (RULED OQ-C), so each one is DECLARED in `docs/opendox-carve-admissions.yaml` — the governed form RULED 2026-09-11 (`#656` comment `5639058687`), one reviewed line per admission naming the leg pull request that created the file and the 40-hex leg commit that introduced it, alphabetical by path. #979 is not merged yet, so its branch is merged into this one and the admissions are added to its file; a later merge of main dedupes it. FIVE OF SIX DESTINATIONS COME BACK OK with no `--allow-created` on the command line (`--replica-at` stays a flag by the file's own design): `opendox_root`, `opendox_spec` (1 admission), `openxdox_spec` (2), `opendox_code` (6) and the `--assembly-root opensoft/openXdox` mode, plus 13 new admissions at `openxdox_code`. THE SIXTH, `openxdox_code`, STILL REFUSES, AND NOT FOR A MISSING ADMISSION. `arrival-undeclared-edit` on TWO moved rows, both from openXdox-code #14's RULING C2 de-hardcoding (`3840c167`, which the old root pin `84056415` did not carry and this bump does): * `src/openxdox/gate_console.py` — edited at carve lines [64, 65, 167-171, 826, 903, 968, 1012, 1135, 1150, 1151, 1154, 1155, 1157, 1339, 1351, 1374, 1487, 1550, 1551, 1569, 1651, 2241]; the row declares [63, 67, 567, 689, 700, 1195, 2047, 2093]; * `src/openxdox/generator.py` — edited at [326, 327, 348, 366, 891, 892, 893]; the row declares [66, 67, 68, 70]. THAT IS REPORTED AND NOT REPAIRED HERE, deliberately. Both remedies the refusal names are governance acts this half may not take on its own word: `edit_classes:` is a RULED CLOSED LIST of three asserted equal verbatim (`scripts/validate-carve-manifest.py`:334, :904) and the § 4.4 edits are in none of them — they are a late profile lookup, not an adapter call, an import rewrite or a path constant — so declaring them needs either a fourth class or a re-cut of two rows' declared lines, and "fix the DESTINATION, never the manifest" is the refusal's own first instruction. The underlying question is more general than these two rows: phase B diffs a leg's CURRENT tree against the carve blobs, so every post-carve edit to a moved file will surface here, and the post-shed-mode amendment (2026-09-10) settled the SOURCE side while leaving arrival "undisturbed by the phase". Owed to a ruling on `#656`. `tests/carve_arrival/…::test_the_committed_admissions_file_seeds_exactly_the_ two_ruled_files` asserted the openxdox_code set EQUALS the two seeded files and every other destination is empty. True of the seeding commit; false of every bump after it BY CONSTRUCTION — the file exists to accumulate one line per bump, so an equality over the whole file would break the first time the governed form was used. It is rewritten to assert what is durable: the two RULED seed entries still declared with their own `since`, no destination outside the manifest's vocabulary, every `since` 40-hex, every `reason` non-empty, and every destination's list alphabetical — the file's own stated invariants, over whatever it has accumulated. Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot review (PR #979, re-review after bcf0fb9, thread on scripts/verify-carve-arrival.py:743): read_admissions() parsed the admissions file with plain yaml.safe_load, which applies last-duplicate-key-wins SILENTLY. A malformed or adversarially-edited file repeating a destination id under `destinations:`, or repeating a `path:`/`reason:`/`since:` field inside one `created[]` entry, would show a reviewer reading the diff the FIRST value while this reader resolved and trusted the LAST -- bypassing every fail-closed shape check this function's own docstring claims to own, since none of them ever see the discarded first value. Verified directly before writing any fix: a throwaway yaml.safe_load over a two-block `destinations: {opendox_code: ..., opendox_code: ...}` document silently kept only the second block, dropping the first with no error -- reproducing exactly the silent-resolution Copilot named. Added a small duplicate-key-refusing loader scoped to this file alone (_AdmissionsLoader / _admissions_construct_mapping / _DuplicateAdmissionsKeyError): a `yaml.SafeLoader` subclass whose construct_mapping tracks keys seen at each mapping level and raises a ConstructorError subclass -- itself a YAMLError -- on a repeat, caught by name ahead of the existing generic `except yaml.YAMLError` so the refusal is worded precisely ("declares a duplicate mapping key ...") rather than falling into the generic "is not parseable YAML" message. read_admissions() now calls yaml.load(text, Loader=_AdmissionsLoader) instead of yaml.safe_load(text). Deliberately NOT reused: scripts/frontmatter_strict.py's StrictLoader, which Copilot's comment named as a model. That module is the loader for a DIFFERENT ratified requirement (the realization-axis front-matter block -- fenced prose with a byte ceiling and its own refused set of anchors/aliases/merge keys/directives/multi-document), not a general-purpose YAML utility, and importing it here would couple this tool to a requirement it has nothing to do with. Mirrored just the duplicate-key idiom (SafeLoader subclass, per-level `seen` set, construct_mapping override) at the narrower scope this reader actually needs -- anchors and aliases still resolve, because every VALUE read_admissions() reads is already re-validated to an exact shape a few lines below; only a silently-overwritten KEY could escape those checks, and that is the one gap this closes. Added two regression tests, written as raw YAML text rather than through the write_admissions() dict helper (a Python dict cannot itself hold a duplicate key, so only hand-written text can produce the document this must refuse): a duplicate `scratch_code` block under `destinations:`, and a duplicate `reason:` inside one `created[]` entry. Verified both FAIL against the pre-fix loader (git stash of this file alone) -- returncode 0 / result "ok" instead of the expected refusal -- confirming they exercise the real defect before confirming they pass against the fix. Re-ran the full proof: pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q -> 269 passed (267 + 2 new tests); validate-carve-manifest.py -> OK; validate-manifest-digests.py -> OK. Also re-ran the live arrival check across all five destinations and both assembly roots (human AND --json mode) with the committed admissions file and no --allow-created anywhere: unchanged from the prior round -- the RULED defect stays repaired (openxdox_code: 2 declared admissions used) and the two pre-existing, disclosed FAILs (opendox_code's consumer_reach.py, opendox_spec's stale-citations-erratum) are unaffected. The real committed docs/opendox-carve-admissions.yaml still parses identically under the new loader (no duplicate keys in it). Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
There was a problem hiding this comment.
🔵 Needs a closer look
The admissions parser has unresolved schema-validation gaps.
Review details
Suppressed comments (5)
scripts/verify-carve-arrival.py:858
- Although
read_admissions()claims to own and fail closed on this document's shape, it never rejects unknown top-level keys. A file with valid required fields plus a typo or unsupported field is accepted, unlike the manifest's closed top-level grammar, so schema mistakes can be silently ignored. Add an explicit closed-key check before consuming the values and cover it with a regression test.
if raw.get("kind") != ADMISSIONS_KIND:
raise ArrivalRefusal(
"arrival-unreadable",
f"the admissions file at {path} carries `kind: "
f"{raw.get('kind')!r}`, not {ADMISSIONS_KIND!r}")
scripts/verify-carve-arrival.py:879
- The destination mapping is only checked for a
createdlist; extra keys indestinations.<id>are silently ignored. That violates the documented exact admissions shape and lets a typo or unsupported field pass as trusted governance. Reject stray keys in this mapping (and the entry mapping below) instead of accepting them silently.
if not isinstance(entry, dict) or not isinstance(
entry.get("created"), list):
raise ArrivalRefusal(
"arrival-unreadable",
f"the admissions file at {path} carries no usable "
scripts/verify-carve-arrival.py:894
- Each
createditem is validated only for the three required fields, so arbitrary extra fields are ignored. This means the reader does not enforce the documented exact{path, reason, since}entry shape; a misspelled or unsupported field can be committed without any refusal. Rejectset(item) - set(ADMISSIONS_ENTRY_FIELDS)before applying the entry and add a regression test.
for field in ADMISSIONS_ENTRY_FIELDS:
value = item.get(field)
if not isinstance(value, str) or not value:
raise ArrivalRefusal(
"arrival-unreadable",
scripts/verify-carve-arrival.py:899
- Checking only
"\n"does not enforce the promised one-line reason: YAML can decode\r, U+2028, or U+2029 into the string, and this repository's line definition treats those as line separators (scripts/carve_lines.py:13-16). Such a value passes while rendering as multiple lines to a reviewer. Reject the full set of line-separator characters and add a regression fixture.
if field == "reason" and "\n" in value:
raise ArrivalRefusal(
scripts/verify-carve-arrival.py:943
- The parser rejects unknown destination IDs but never rejects omitted manifest IDs. A present admissions file containing only one block is therefore accepted and every omitted leg silently behaves like
created: [], despite the documented/committed contract of one block per manifest destination; a pin-bump could drop a leg's governed admissions without anarrival-unreadablefinding. After parsing, require the declared IDs to equalknown(while preserving{}only for a genuinely absent file).
result[dest_id] = parsed
return result
- Files reviewed: 5/5 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 4 days and 6 hours by commenting @sourcery-ai review. Upgrade to get a review now.
#979's carve-arrival admissions act. It touches nothing this packet cites — no `scripts/doc_health/`, no `openspec/specs/doc-health/spec.md`, no `health/` — and the README `## OpenSpec Records` block auto-merged with main's row and this packet's ACTIVE row both present. The promoted `doc-health` spec is byte-identical across the merge, so the sliced block's sha256 and every scenario line this packet cites still hold at `972b484a`. It does add a new test tree (`tests/carve_arrival/`), which is outside this packet's gate selection and is disclosed here rather than discovered in a diff of the gate numbers. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…apply this branch's two deltas `#979` (the declared per-destination admissions file) merged as a SQUASH at 22:39Z, minutes after this branch merged its head, so main's single commit and this branch's merge of its branch are an add/add conflict over three files. GitHub could not build the merge ref while they conflicted, which is why no `pull_request` gate started at all. RESOLVED BY TAKING MAIN'S TEXT AND RE-APPLYING ONLY THIS BRANCH'S OWN EDITS — main carries #979's whole fix round (the duplicate-mapping-key loader, the hard-assert seed guard, `since:` by `.fullmatch`, absence only from `FileNotFoundError`, the "empty file is malformed, not absent" refusal), and none of it is this branch's to re-decide: * `scripts/verify-carve-arrival.py` — MAIN'S VERSION VERBATIM. This branch never edited the file; it only carried it in through the stacked merge. * `docs/opendox-carve-admissions.yaml` — main's seeded file plus this branch's 22 declared admissions, unchanged in wording. * `tests/carve_arrival/test_verify_carve_arrival.py` — main's version, with the seed test rewritten as before. The rewrite now also stands in for the review's second frozen assertion (every non-`openxdox_code` destination is `[]`), which the first real pin bump falsifies for the same reason as the first: this file exists to ACCUMULATE. What is NOT relaxed is the equality the review actually asked for — one block for EVERY manifest destination and no id the manifest does not carry — because that one is about the file's SHAPE, not its contents, and it is kept verbatim. Re-verified after the merge: `tests/carve_arrival` 110 passed; arrival OK at `opendox_root`, `opendox_spec`, `opendox_code`, `openxdox_spec` and the openXdox assembly root; `openxdox_code`'s `arrival-undeclared-edit` finding is unchanged and still owed a ruling; both pins still name `8ec3036c` / `eca0b597`; `OK contracts/manifest.yaml: 189 per-file digest(s) verify`. Lane: openxfactory-4-opendox-extraction Refs #656 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ing history, and re-measure the leg figures
FOUR findings, all measured FACT before they were taken.
1. THE ORDINALS (Copilot review `5239585507` @ `d3d28269`, suppressed;
RULED A FACT FINDING by the holder after the previous actor answered it by
measurement on comment `5719043676`). The previous answer was right that an
ordinal cannot be read off a block's POSITION — the assertion blocks in
`tests/carve_arrival/test_verify_carve_arrival.py` are not in ordinal order
and never were — and wrong that the ordinals therefore stood. Measured
against the document itself they did not:
git log --first-parent origin/main -- docs/opendox-carve-admissions.yaml
diffing each commit's PARSED `created:` sets gives ELEVEN amendments over
the seed (#979 `972b484a`) — PR #984, #1002, #1001, #1009, #1010, #1023,
#1030, #1025, #1067, #1068 and this act — of which TEN bump `opendox_code`.
Slice S5's amendment (#1023 @ `ee251d6c`, eight created files across both
legs and the first admission-level re-homing) was recorded with NO ordinal,
so every ordinal after it was ONE LOW: slice S7's three read SIXTH and are
the SEVENTH, slice S8's one read SEVENTH and is the EIGHTH, the runtime ten
read EIGHTH and are the NINTH — and that block's "of which this is the
sixth" is the EIGHTH `opendox_code` bump. RULED Q7's five and this act's one
carried none at all, and the docstring's narrated history stopped at SEVENTH
while the code below it named an EIGHTH: a file that cannot be read in one
direction without contradicting the other.
Every ordinal now agrees, and the rule is stated with the ONE COMMAND THAT
DERIVES IT, so the next amendment reads its ordinal off the history instead
of off a neighbour. The three amendments the docstring never narrated (#1067,
#1068 and this act) are narrated. The durable-assertions list, which had
stopped enumerating what the block below actually asserts, gains slice S5's
eight, slice S8's one and the ten runtime entries.
THE REUSED RATIONALE IS DISTINGUISHED FROM THE BUMP NUMBER, which is what
made this drift invisible: this act's block pins to its introducing commit
"for the reason the DISPLAY-facet block states" and NAMES that block, whose
ordinal moved with the renumbering while its argument did not. The runtime
block's ordinal paragraph now records BOTH corrections — it read SEVENTH,
collided, was moved to EIGHTH, and was still one low — because both are the
same defect. Its stale "line ~3993" pointer is gone with them.
Copilot's own arithmetic was wrong in the other direction (it called this
act's admission the eighth amendment and the seventh `opendox_code` bump;
measured they are the ELEVENTH and the TENTH). The finding was still right
that the history had stopped agreeing with itself.
2. THE ADMISSION REASON (Copilot review `5246578877` @ `30a63ebe`, thread on
`docs/opendox-carve-admissions.yaml:146`). MEASURED in a pristine `0b4e8bbf`
worktree of openDox-code with the leg's file copied in:
pytest -q tests/test_display_facet_leaves.py --noconftest
-> 11 failed, 2 passed in 0.61s (node v24.21.0 present)
The reason said `10 failed / 2 passed` and a three-versus-nine split. The
file carries THIRTEEN tests at the leg's landing head `b51a1ca1`: FIVE
node-gated, over FOUR modules (`display.js`, `explorer.js`,
`outline-model.js` and now `docs.js`), and EIGHT reading the source. The old
"three" named the three MODULES and miscounted the tests even at the
introducing commit, where it is four and eight over twelve. The reason now
states the measurement, says it is taken AT THE LANDING HEAD and not at
`since:` — which stays the introducing commit `338143a3` — and names what
moved it: openDox-code#28's own Copilot round added the thirteenth test.
The two that pass at the pristine base are the return-value guard beside
`applyTokens` and the behavioural probe that only bites once `runAddSection`
forwards its argument, so all SEVEN leaves are failed by at least one of the
eleven.
3. THE FOUR MANIFEST ROW NOTES (same review, thread on
`docs/opendox-carve-manifest.yaml:2498`): `10 of 12` on all four synchronized
copies -> `11 of 13`. "Each failure its own leaf" is replaced by what is
true of eleven failures over seven leaves: every leaf failed by at least one
of them, with the two passers named.
4. THE RUNBOOK'S PROVENANCE PARAGRAPH (same review, suppressed;
`docs/opendox-cutover-runbook.md:379-383`): it still read "CURRENT TO RULED
Q7's CSS EXTRACTION" and called Q7 "THIS act" while the tables above it are
this act's 2717 and its `opendox_code` cell is 1763 — and a second, older
"THIS ACT CARRIES" in the same paragraph named slice S7. Two acts called
"this act" in one paragraph, neither of them the act the totals belong to.
Re-headed to the § 3.4 SLICE-S7 RESIDUE annotation with its own window
(2710 + 7 = 2717), Q7 restated as the act behind it, and the inner claim
given slice S7's PR and sha. Swept with it: § 5's `--allow-created` note,
whose "THIS act adds three more entries" meant PR #1030 and has had seven
amendments since.
GATE at this head:
scripts/validate-carve-manifest.py OK
456 rows, 143/175/138, 318 digests, none undeclared, 4 re-destined, 2 retired
pytest -q tests/carve_arrival tests/carve_manifest 408 passed
No absolute moves: 2717 / 176 / 1745 / 1763 / 2715 stand as measured at the
merge. No assertion changes — every ordinal lives in a comment or a docstring,
grepped repo-wide, and nothing reads them.
Lane: openxfactory-4
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…the thirteenth amendment This answers Copilot's review of openxFactory#1153 at 580e468. That review found that nothing pinned the two admissions to their introducing commit. The generic admissions checks bound only the 40-hex shape and the alphabetical order, so a dropped, swapped or re-provenanced entry stayed green. tests/carve_manifest/test_carve_manifest.py: the § 8.9 window test now compares a path-to-since mapping for both suites against SNAPSHOT_VALIDATOR_RESIDUE_SINCE, 45825ff7. That is the leg PR's first commit, and a later review round on that PR does not move it. tests/carve_arrival/test_verify_carve_arrival.py: the committed-admissions test gains a THIRTEENTH BUMP block. It pins each suite's path and since, the way the corpus-adapter and RULED Q7 blocks pin theirs. It also requires the set of entries carrying that since, across every destination, to equal exactly the two. A third admission riding in on this act's commit therefore fails. The docstring's ordinal sequence was stale. It read "#1085 and THIS act, twelve amendments", where "THIS act" was #1091. It now names #1091 and #1153: thirteen amendments, ten of which bump opendox_code. That count was recomputed from history the way the docstring says it is. The walk diffs each first-parent commit's parsed created sets. It finds 13 amendments after the seed #979, ten touching opendox_code, and #1043 changing no created set. Both new pins were made to fail by moving one since to the later leg tip 0a1963f8, which gave 2 failed. They pass on the committed file: tests/carve_manifest plus tests/carve_arrival, 409 passed. Lane: openxfactory-4 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>



Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
Refs #656 (stays OPEN).
The ruling this realizes
RULED — the arrival-admission repair, Brett Heap, 2026-09-11 18:37Z, session
openXfactory-4 (5), by interactive multi-choice → "Declared per-leg admissions file." (#656comment 5639058687). The runbook'sopenxdox_codearrival-admission list was stale (two--allow-createdadmissions owed for the files openXdox-code#7 added). Shape ruled: each leg destination carries a small declared admissions file in openxFactory thatscripts/verify-carve-arrival.pyreads, so a new admission is a reviewed one-line diff in the pin-bump PR — governed like the manifest, not typed on a command line. Rejected alternatives (not built): regenerating admissions mechanically at each pin bump; folding the fix into the § 4.3/§ 4.4 openxFactory halves PR.No
openspec/changes/path is touched by this PR.What/why
scripts/verify-carve-arrival.py --destination openxdox_code --phase Brefuses two files openXdox-code#7 added, with no admission recorded anywhere:src/openxdox/consumer_reach.pytests/test_dependency_direction.py(both from commit
bfd95063b2a71be097a04bb6a3a99c4c131dd322, found by running the check myself against the leg's pinned commit — not from memory).This PR adds
docs/opendox-carve-admissions.yaml, a declared per-destination admissions file beside the manifest, with onecreated:block per destination the manifest names (opendox_code,opendox_root,opendox_spec,openxdox_code,openxdox_spec— all five; empty lists where nothing is declared). It is seeded with exactly the two ruled files underopenxdox_code:scripts/verify-carve-arrival.pyreads this file by default (path derived from the manifest's location;--admissionsoverrides it), applies each destination'screated:list exactly as--allow-createdadmits today, and:--allow-createdworking for ad-hoc runs, printing a one-line notice (stderr;--jsoncarries the same fact asad_hoc_allow_createdinstead, so the JSON contract of "one object on stdout" holds);arrival-unreadable) an admissions file naming a destination id the manifest does not carry, repeating apath:under one destination, listing a destination'screated:out of alphabetical order, or carrying a malformed entry (missing field, non-string, asince:that is not 40 lowercase hex, a multi-linereason:) — the check guards its own input;declared_admissions_used/declared_admissions_unused, both in--jsonand as aSTALEclause on the humanOKline) — a stale declared admission is a finding, not silence.docs/opendox-cutover-runbook.md§ 2.1 and § 5.6 now name the admissions file as the governed form, show the one-line diff a pin-bump PR adds, and keep the existing per-category prose as historical/example context rather than the current source of truth.README.md's doc index gets a sibling entry beside the manifest's.Tests added (
tests/carve_arrival/test_verify_carve_arrival.py)test_admissions_file_default_path_resolves_and_admitstest_a_declared_admission_admits_exactly_the_file_it_namestest_an_admissions_file_naming_an_unknown_destination_refusestest_an_admissions_file_with_a_duplicate_path_refusestest_an_admissions_file_with_an_unsorted_created_list_refusestest_an_admissions_entry_missing_a_required_field_refusestest_an_admissions_entry_with_a_non_hex_since_refusestest_a_stale_declared_admission_is_reported_not_silenttest_ad_hoc_allow_created_still_works_and_notes_the_governed_formtest_an_absent_admissions_file_is_not_a_refusaltest_the_committed_admissions_file_seeds_exactly_the_two_ruled_files(reads the real committed file against the real manifest)python3 -m pytest tests/carve_arrival tests/carve_manifest tests/carve_conformance -q→ 258 passed.python3 scripts/validate-carve-manifest.pyandpython3 scripts/validate-manifest-digests.pybothOK.Live proof: the defect is repaired
Every destination the manifest names, run against its own pinned commit (openXdox
5da58ee2, openDox-codeda8aae96, openDox-spec1a216ea4, openXdox-spec481a07f9; each pin verified equal to its owncontracts/*-pin.yaml), with the new admissions file in place and--allow-createdabsent from every command line:Two destinations do NOT come back clean, and this is disclosed rather than hidden:
Both are pre-existing and unrelated to the ruled defect:
src/opendox/consumer_reach.pyis fromopensoft/openDox-code#9("BUILD § 3.5/3.6: openDox stops requiring its consumer at import time"), and its own docstring already states verbatim that it is "A CREATED FILE… told about explicitly with--allow-created src/opendox/consumer_reach.py".docs/stale-citations-erratum-2026-09-10.mdis fromopensoft/openDox-spec#6("BUILD § 3.6: record 10 stale citations…"). Neither file is openXdox-code#7's, neither destination is named in the ruling or the CLAIMED realization ("seeded with the two openXdox-code #7 admissions"), and both are self-documented well enough that a follow-up amendment todocs/opendox-carve-admissions.yamlwould be a two-line diff once ruled. I did not seed them here because the ruling specifically scoped this slice to the two openXdox-code#7 files underopenxdox_code; expanding the declared seed to other destinations' in-flight leg work is outside what was interactively ruled. Flagged as owed below.Owed
A follow-up ruling/comment on #656 to seed
docs/opendox-carve-admissions.yaml'sopendox_codeandopendox_specblocks for the two files above (each destination's own PR — or a small governance follow-up — can then add them as the one-line diffs the mechanism is built for). Noopenspec/changes/packet amendment is needed for the admissions-file mechanism itself.🤖 Generated with Claude Code
Summary by Sourcery
Govern destination-created carve admissions through a validated per-destination file and use it to repair the openxdox_code arrival verification.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: