Repository navigation
doc-health: ratified-provenance reads a ratification record's subject; the corpus enumerator reaches the root-level governed products (#878, #869) - #890
Conversation
…, not only its Status value (#878) `fam_ratified_provenance` scoped itself on `doc.status != "ratified": continue` — the header's VALUE. The scenario it enforces, `document-lifecycle`'s *A review record records a ratification*, binds on the document's SUBJECT: "WHEN a `review/` document under a change packet records that the change was ratified, THEN it MUST carry `Status: ratified` and one ratification citation in a sanctioned spelling". A ratification record filed `Status: record` is therefore exactly the document the scenario governs and exactly the document a value-scoped family never opened. Measured consequence: fourteen archived ratification records out of contract with zero findings (#877), and PR #870's first encode (`d0ddb126`) reproduced the drift while doc-health reported clean — a reviewer, not the family, caught it. The subject arm recognizes a `review/` record under a change packet whose file name opens `ratification-` OR whose H1 opens `# Proposal Ratification:`, and reports it at the family's existing CRITICAL severity with a rule that quotes the scenario. Two recognizers because the corpus writes the subject two ways: five of the records #877 measured open `# Ratification — <date>` or `# Ratification record — <change>`, so a title-only test would miss a third of the standing population. The neighbouring scenario *A review record is not about a ratification* is what keeps the arm narrow: a `record`-status review whose subject is a finding, a disposition or a captured review round stays silent, and seventy-odd of those sit in this corpus. The existing status-value logic — the citation count, the change-id resolution, the three-way floor — is untouched. This finding FIRES on the standing population by design. The remedy for the archived records is a governed act (`record-immutability`, `govern-archived-record-edits`) and belongs to #877, not to a lowered severity or an archive exclusion here. Refs #877, #870. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ducts (#869) `corpus.discover_repos` enumerated `openxFactory` plus `xFactories/*` and nothing else. `ROOT_LEVEL_GOVERNED_PRODUCTS` (`corpus.py:64`) has named `openAvatar` and `openXwallet` as governed repositories since `split-openxwallet-repo` § 11.2, and two widened sites read it — this enumerator, the one that decides which repositories an aggregation-rooted sweep actually MEASURES, was not one of them. Measured on the 2026-09-09 estate runs (#765, #731, #859): `doc-health.py --repo-root <aggregation>` reached neither product, and both had to be measured by separate `--single-repo` invocations to be measured at all. Today that costs little; openXwallet is the only repository in the estate besides openxFactory with a contract-bundle surface, so the day it adopts the graded bundle shape is the day the nightly would grade every repository except the one that changed. `discover_repos` now yields each allowlisted product present under the aggregation root, under the SAME materialization check the `xFactories/*` children get (`_is_materialized_repo`, extracted so the two sources cannot drift apart); an absent or unmaterialized one is skipped silently. The id is the BARE NAME, never `xFactories/<name>`: `ideation_routing._governed_repo_ids` anticipated this widening and tolerates an allowlisted name in `repo_paths` unprefixed for exactly this reason, and the new suite pins the round trip through it so the two sites agree by construction. `openxFactory` keeps its laxer `is_dir()` admission, pinned as a deliberate asymmetry: it is the aggregation's anchor, and every fixture aggregation in this suite is a plain directory tree with no `.git` anywhere. No canon change: the products list already exists and is the declared source. Refs #765, #731, #859. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…opulation, and the widened-enumerator prose stops claiming the widening cannot happen Two defects in the two commits this branch adopted, both in the tests, both of a kind that reds a REQUIRED check on somebody else's pull request. FIRST, `test_the_subject_arm_reaches_active_packets_as_well_as_archived_ones` asserted that the real tree still carries at least one UNREPAIRED ACTIVE ratification record. Six do today, so it passed — and it would go red the day that population is discharged, which is the outcome the whole change exists to provoke. `pytest-suite` is a required check on every pull request in this repository (ruleset 21538893) and it runs `pytest tests/`, so the failure would land on whichever lane happened to repair the last active record, with a message telling them their green change had "served its purpose". That is precisely the trap `ISSUE_877_FOURTEEN`'s biconditional was written to avoid, sprung by the test standing beside it. The claim is now pinned SYNTHETICALLY — one record's exact text at an active packet path and at an archived one, both reported — where no merge can move it, and the docstring says why the population is not the claim. The real-tree measurement is generalized instead of narrowed: the independent walk and the equality it feeds now cover ACTIVE PACKETS AND THE ARCHIVE TOGETHER, so the active reach is measured rather than merely sampled, and the assertion follows the corpus wherever it goes. It reproduces exactly the 21 records the family reports on this tree (6 active, 15 archived: #877's fourteen plus `2026-09-10-adopt-codexfactory-repository-identity`, archived twelve minutes after #877's 00:26Z measurement). The walk mirrors the family's fifteen-line header window rather than scanning whole documents for a title. The window is part of the RULE, not an implementation detail an oracle may honestly vary — `_h1`'s docstring binds it to `align-status-reader-to-real-lines`' wide ruling that every reader of a header splits lines the same way — so the oracle restates the SUBJECT logic independently and shares the window deliberately. SECOND, the enumerator widening (`9e513816`) cited three prose sites as having "anticipated this widening" and left them asserting the widening cannot happen. Two are in this surface and are corrected here: `test_governed_repo_ids_admit_root_products_with_no_checkout_in_scope` justified a still-correct assertion with "`discover_repos` can never place a root-level product in `repo_paths`", now false; and `test_governed_repo_ids_never_prefix_a_root_product_with_xfactories` described as hypothetical ("if `discover_repos` is ever widened") the thing the commit beside it had just done. Both keep their assertions untouched — the assertions were right, and right for a reason that survives: the allowlist is a claim about the aggregation's TOPOLOGY, which a single-repo self-gate and an unmaterialized pin both need and neither can derive from `repo_paths`. The third site, `scripts/doc_health/ideation_routing.py`'s `_governed_repo_ids` docstring ("`discover_repos` enumerates `openxFactory` plus `xFactories/*` and nothing else, so a root-level product can never appear in `repo_paths`"), carries the same stale claim and is DELIBERATELY NOT touched here: it is outside this pull request's declared surface. It is named on the pull request so the correction is not lost. Refs #877, #878, #869. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Lane: openxfactory-1 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 21 hours and 2 minutes by commenting @sourcery-ai review. Upgrade to get a review now.
|
Lane: openxfactory-1 (openXfactory-1) @codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Reviewer's GuideThis PR fixes two doc-health blind spots: ratification provenance now scopes records by their review subject rather than only by Status, and aggregation sweeps now discover materialized allowlisted products at the repository root. The implementation preserves existing validation and repository enumeration semantics, with targeted tests covering active/archive records, parser boundaries, false-positive exclusions, materialization rules, and repository ID integration. Flow diagram for subject-aware ratification provenance checksflowchart TD
A[Lifecycle-scoped document] --> B{Review record under openspec/changes/**/review/?}
B -- No --> Z[Existing checks]
B -- Yes --> C{Filename starts ratification- or header starts Proposal Ratification?}
C -- No --> Z
C -- Yes --> D{Status is ratified?}
D -- Yes --> E[Run existing citation and change-id validation]
D -- No --> F[Emit critical ratified-provenance finding]
F --> G[Set Status: ratified and add sanctioned citation]
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
🟡 Changes recommended
New/modified tests embed host-absolute path literals (e.g., Path("/nonexistent")), which conflicts with the repository constitution’s “no host-absolute paths in committed files” rule.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes two doc-health coverage gaps: (1) ratified-provenance now flags ratification records based on their subject (even when Status: is wrong/missing), and (2) aggregation-root repo discovery now includes materialized root-level governed products (e.g., openXwallet, openAvatar) in addition to openxFactory and xFactories/*.
Changes:
- Extend
fam_ratified_provenancewith a subject-based recognizer for ratification review records and emit a dedicated critical finding when those records are notStatus: ratified. - Teach
corpus.discover_reposto enumerate materialized root-level governed products usingROOT_LEVEL_GOVERNED_PRODUCTSand a shared materialization predicate. - Add/adjust tests to pin the new family arm and the expanded discovery behavior.
File summaries
| File | Description |
|---|---|
| scripts/doc_health/families.py | Adds subject detection for ratification review records and emits a new finding/action when status is not ratified. |
| scripts/doc_health/corpus.py | Expands aggregation repo discovery to include materialized root-level governed products and centralizes the materialization check. |
| tests/doc-health/test_ratification_record_subject.py | New test suite covering subject-based ratification record detection (active + archived) and preserving existing value-scoped behavior. |
| tests/doc-health/test_corpus_discovery.py | New tests ensuring discover_repos includes root-level governed products only when materialized and keeps existing ordering/behavior. |
| tests/doc-health/test_families.py | Updates pinned action-string coverage to include the new subject-arm action. |
| tests/doc-health/test_ideation_routing.py | Updates commentary/docs in tests to reflect the widened discovery semantics and preserve allowlist-vs-materialization distinctions. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ory root resolved at runtime, not an absolute literal Taking both of Copilot's findings on PR #890. The constitution's § IV is explicit — "Committed files MUST NOT contain host-absolute paths; use repo-relative paths or runtime resolution" (`.specify/memory/constitution.md`) — and `Path("/nonexistent")` is an absolute literal however deliberate its non-existence. One definition in `tests/doc-health/conftest.py`, which both callers already import from, rather than a copy per file: a second copy is a second thing that can quietly become a real directory, and the sentinel only works while nothing of that name exists. NON-EXISTENCE IS THE POINT AND SURVIVES THE FIX. These cases build a `Context` by hand because what is under test is exact header content; the families they run may not reach the filesystem at all — `fam_ratified_provenance` reads `doc.text` and `ctx.change_ids` and nothing else — so a root that cannot resolve is how that is ASSERTED rather than assumed. `tmp_path` would be the wrong instrument for the same reason: it exists. The second finding is on a line this branch did not author (`test_families.py`'s `run()` helper, which predates it and which this branch touched only to widen the signature). Taken anyway: it was the estate's ONLY other occurrence, so the two together leave `grep -rn 'Path("/'` over `tests/doc-health/` with nothing to report. No assertion moves. 126 tests across the four files this branch touches pass unchanged. Refs #878, #869. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
_is_change_review_record’s path-shape predicate is currently broader than its stated intent and can misclassify nested .../review/... paths, risking future false positives.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/doc_health/families.py:288
_is_change_review_recordclaims to match onlyopenspec/changes/<packet>/review/<file>(active) andopenspec/changes/archive/<dated-packet>/review/<file>(archived), but the current predicate (parts[-2] == "review") would also treat deeper nested paths likeopenspec/changes/<packet>/specs/review/<file>as in-scope. Tightening the shape check to the two intended layouts avoids future false positives and makes the implementation match the docstring.
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
|
Lane: openxfactory-1 (openXfactory-1) Frozen at The required
|
|
You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard. |
|
Lane: openxfactory-1 (openXfactory-1) FROZEN + LANDING PROVENANCE — 2026-09-10T04:43:14Z. Head |
… newly-promoted rule; add the exit-code and merge addendum PR #890 landed on main (804a917, 2026-09-10T04:43:17Z) while review/ratification-2026-09-10.md was being written: document-lifecycle's "A review record records a ratification" is now promoted and requires a review/ record whose SUBJECT is a ratification to carry Status: ratified plus one citation, not Status: record. Caught by re-running `doc-health --family ratified-provenance` after merging main (previous commit): it named exactly this file, critical, "a review record that records a ratification must carry Status: ratified and one citation." Fixed in the same shape a sibling packet's ratification record was independently corrected into a few hours earlier the same morning (archive/2026-09-10-amend-neutral-product-pin-interim-copy-vocabulary/ review/ratification-2026-09-09.md, re-derived on Brett Heap's own ruling of the identical defect): H1 "# Proposal Ratification: <change>", Status: ratified, Kind: report, Decision date:, Ratifier:, and a Ratified: citation line carrying the actual word. Nothing normative moves — the ratifier, the verbatim word, the head, and everything ratified by this record are unchanged; only this record's own standing metadata is corrected. Also folds in two other corrections found while re-verifying, both already named in the file's own Addendum: the ratification commit's message mis-stated `openspec validate --all --strict`'s exit code as 0 (a piping bug in the verifying command swallowed the real code; it is 1, this repository's standing baseline, unchanged by this diff — 98 passed/3 failed post-merge vs 97 passed/3 failed on origin/main alone, same three pre-existing unrelated failures); and the prior commit's merge-from-main to resolve a README.md adjacency conflict with the newly-archived amend-neutral-product-pin-interim-copy-vocabulary row. Re-verified: doc-health --family ratified-provenance no longer names anything in this packet (28 pre-existing/unrelated critical findings remain elsewhere, down from 29 with this file's own fixed); --family status-validity unchanged (1 pre-existing/unrelated, not this packet); openspec validate accept-sequenced-after-header-line --strict exit 0. Lane: codexfactory-1 Co-Authored-By: Claude Sonnet 5 <[email protected]>
origin/main moved 804a917 -> b91af6e while the ratification encode was being written and verified, and the pull request went CONFLICTING. Taken here so the re-measure is owed at THIS act and not at landing. ONE CONFLICT, IN THE README OpenSpec Records BLOCK, AND IT IS PURE ADJACENCY. main archived amend-neutral-product-pin-interim-copy-vocabulary (removing its row) and added accept-sequenced-after-header-line's row at the top of Active changes; this branch had replaced the amend-modified-block-currency-standing row's content in the same region. RESOLVED BY KEEPING BOTH ROWS -- main's new row first, byte-for-byte as main states it, then this branch's ratified row byte-for-byte as the ratification commit c95b9e5 wrote it. Neither row's text is edited by this merge, and the archived packet's row stays removed as main removed it. tests/sequenced_after/corpus-ledger.yaml auto-merged: both sides added one row and both rows are present (accept-sequenced-after-header-line moved_by #886, amend-modified-block-currency-standing moved_by #887). WHAT main BRINGS THAT THIS BRANCH DID NOT HAVE, and why the re-measure matters: #890's doc-health change (the ratified-provenance SUBJECT arm, issue #878) and #886's realization of scripts/proposal-support.py, scripts/sequenced_after.py and scripts/frontmatter_strict.py. Every gate figure in review/verification-2026-09-10.md was taken against the pre-merge versions of those, so all of them are re-run on this merged tree and the result is recorded as an ADDENDUM to that capture rather than as an edit to its figures -- the same shape f8b3b79 used on main earlier today for a same-day re-measure of a dated one-shot record. NOTHING OF THIS PACKET MOVES IN THIS COMMIT: no delta byte, no promoted specification, no record body, no .openspec.yaml field, no task box. Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…own path (#887) origin/main moved 804a917 -> b91af6e while the ratification encode c95b9e5 was being written and verified, and the pull request went CONFLICTING. The merge was taken at 2e84325; this commit records what the gates say on the merged tree. A SECOND RUN WRITES A DIFFERENT PATH. Both runs fall on 2026-09-10, so the paths are distinguished by suffix rather than by date: review/verification-2026-09-10.md is PRESERVED BYTE-FOR-BYTE as c95b9e5 wrote it -- it is the record of the pre-merge tree, keeps Status: record, and is neither superseded nor deleted -- and the current measurement is review/verification-2026-09-10-post-merge.md. The first capture gains an ADDENDUM that only POINTS at the second and answers its own forward-looking "merge from main: NONE OWED" row; not one measured figure in it is edited. That is document-lifecycle's one-shot-capture rule (#870 bench T7/T9) applied literally. THE RE-MEASURE WAS NOT A FORMALITY: main moved three of the gates themselves. #890 (804a917) added ratified-provenance's SUBJECT arm (#878), which reads a review/ratification-* record whatever status it carries -- the pre-merge tree's doc_health predated it, so the first capture's ratified-provenance figures were taken WITHOUT the arm that scores this packet's own new ratification record. #886 rewrote scripts/proposal-support.py (+657 lines), scripts/sequenced_after.py and scripts/frontmatter_strict.py, and added one sweep-ledger row. RE-RUN FROM ZERO ON 2e84325: openspec validate amend-modified-block-currency-standing --strict valid, exit 0; --all --strict exit 1 with 99 passed / 3 failed (102 items) and the failure SET IDENTICAL to origin/main b91af6e's 98 passed / 3 failed (101) -- same three pre-existing items, this change the one extra and it PASSES; proposal-support verify ok against main's NEW implementation; validate-sequenced-after passed (40 active, 10 declaring) with the ledger consistent at 193 rows and both sides' rows present; --ledger-diff clean; validate-scope-globs passed; doc-health --single-repo exit 0, 32 critical / 5 error / 47 warning / 14 info, 0 new regressions, this change named 0 times; ratified-provenance 28 critical, NONE this change, of which 21 are the #878 subject arm on OTHER packets' records -- this packet's ratification record enters that population and CLEARS it, having carried Status: ratified plus exactly one citation from its first commit; record-immutability 4 critical (all docs/), status-validity 1 error, neither this change; modified-block-currency all seven classes 0 on this block with marker defects: 0; pytest tests/sequenced_after tests/scope_globs tests/doc-health 2036 passed, and tests/proposal-support 128 passed / 67 subtests, run because main rewrote the gate that suite covers. THE CONTROL THAT CARRIES THE ATTRIBUTION. The critical count rose 11 -> 32 between the two captures and NONE of the rise is this packet's: it is main's own standing population, newly VISIBLE rather than newly created (#877 measured fourteen archived records out of contract with zero findings). Proven by running doc-health on d5d8a2f3 -- ab8247f with b91af6e merged in and the README resolved identically, i.e. the DRAFT packet on the SAME main -- and diffing the finding lines: IDENTICAL, 98 lines on both sides. The encode adds zero findings and removes zero. NOTHING OF THE PACKET MOVES IN THIS COMMIT EITHER: no delta byte, no .openspec.yaml field, no citation line, no task box's state. tasks.md gains 4.9 naming the second capture, the README row's records list cites both, and no box opens or closes. tasks.md section 5 and 6.1-6.2 stay OPEN. Refs #857, refs #858 Lane: openxfactory-1 Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Lane: openxfactory-1 (openXfactory-1) The out-of-surface residue named in this PR's landing provenance ( |



Lane: openxfactory-1 (openXfactory-1)
Two doc-health defects, one branch. Both were found the same way — a reviewer, not the checker, caught the drift the checker exists to catch — and both are single-site fixes with the tests that pin them.
Surface:
scripts/doc_health/families.py,scripts/doc_health/corpus.py, and four files undertests/doc-health/. Nothing underopenspec/, no canon document, no archived record.1.
ratified-provenancereads a review record's SUBJECT, not only itsStatus:value (#878)What was wrong.
fam_ratified_provenancescoped its whole loop ondoc.status != "ratified": continue— the header's VALUE. The scenario it enforces,document-lifecycle's A review record records a ratification, binds on the document's SUBJECT: "WHEN areview/document under a change packet records that the change was ratified, THEN it MUST carryStatus: ratifiedand one ratification citation in a sanctioned spelling". A ratification record filedStatus: recordis therefore exactly the document the scenario governs and exactly the document a value-scoped family never opened.What it cost, measured. Fourteen archived ratification records out of contract with zero findings (#877), and PR #870's first encode (
d0ddb126) reproduced the drift while doc-health reported clean.The fix.
scripts/doc_health/families.py:254-255— the two recognizers,ratification-(file name) and# Proposal Ratification:(H1).scripts/doc_health/families.py:258_h1— the document's first#real line WITHIN the fifteen-line header window, split on the same real-line rulecorpus.parse_statususes (align-status-reader-to-real-lines: a title read on a different splitting rule than the status beside it is the divergence that ruling exists to prevent). Bounded on purpose — a# Proposal Ratification:line quoted in prose far below the header is not this document's title, and a family that read it as one would fire on a record ABOUT ratification records.scripts/doc_health/families.py:277_is_change_review_record—openspec/changes/**/review/<file>and nothing else._lifecycle_scopeconcatenates the scan set with the GOVERNED CORPUS, so adocs/ratification-policy.mdis in this family's scope too; the scenario reachesreview/documents under a change packet, so the path SHAPE is checked, not the file name alone.scripts/doc_health/families.py:291_records_a_ratification— the subject test, disjunctive over the two recognizers.scripts/doc_health/families.py:308-317— the rule and action strings. The rule QUOTES the scenario it enforces, because the remedy is a governance act and a reader who cannot find the rule cannot perform it.scripts/doc_health/families.py:639— the arm itself, inside thedoc.status != "ratified"branch, at the family's existing CRITICAL severity.Why two recognizers and not one. The corpus writes the subject two ways. Every record follows the packet template's
review/ratification-<date>.mdnaming, which is the load-bearing arm; the H1 arm catches a record whose author named the file something else. A title-ONLY test would miss a third of the standing population — five of the records #877 measured open# Ratification — <date>or# Ratification record — <change>instead.What keeps it narrow. The neighbouring scenario, A review record is not about a ratification, exempts a
review/record whose subject is a finding, a disposition or a captured review round. Seventy-odd of those sit in this corpus and every one stays silent. The existing status-value logic — the citation count, the change-id resolution, the three-way floor — is untouched, andtest_the_existing_status_value_logic_is_untouchedpins that.A missing header reaches the arm too, deliberately:
doc.status is Noneis not"ratified", and the scenario's THEN is "MUST carryStatus: ratified", which an absent header fails as squarely as a wrong value. Such a document also draws astatus-validityfinding; the two say different things — that family asks for A taxonomy value, this one names WHICH. This corpus holds exactly one (disposition-codexfactory-declared-renames/review/ratification-2026-09-05.md).Severity and the archive are deliberately not touched. This arm FIRES on the standing population by design. The remedy for the archived records is a governed act (
record-immutability,govern-archived-record-edits) and belongs to #877 — not to a lowered severity and not to an archive exclusion here. The finding keeps the family's defaultauto-fixableclass, as every otherratified-provenancefinding does including the ones already landing on archived records onmain; the shared action string names BOTH repair routes so an archived record is never sent down the wrong one.2. The corpus enumerator reaches the root-level governed products (#869)
What was wrong.
corpus.discover_reposenumeratedopenxFactoryplusxFactories/*and nothing else.ROOT_LEVEL_GOVERNED_PRODUCTS(scripts/doc_health/corpus.py:64) has namedopenAvatarandopenXwalletas governed repositories sincesplit-openxwallet-repo§ 11.2, and two widened sites read it — this enumerator, the one that decides which repositories an aggregation-rooted sweep actually MEASURES, was not one of them.What it cost, measured. On the 2026-09-09 estate runs (refs #765, #731, #859)
doc-health.py --repo-root <aggregation>reached neither product, and both had to be measured by separate--single-repoinvocations to be measured at all. Today that costs little; openXwallet is the only repository in the estate besides openxFactory with a contract-bundle surface, so the day it adopts the graded bundle shape is the day the nightly would grade every repository except the one that changed.The fix.
scripts/doc_health/corpus.py:127_is_materialized_repo— thexFactories/*materialization check, extracted so the two sources cannot drift apart..gitis a FILE in a submodule worktree and a directory in a plain clone, henceexists().scripts/doc_health/corpus.py:178—discover_reposyields each allowlisted product present under the aggregation root, under that SAME check. Absent or unmaterialized is skipped silently: admitting an empty directory would put a repository intorepo_paths,capabilitiesand the report that contributes no document — a repository the run claims to have measured and did not.The id is the BARE NAME, never
xFactories/<name>.ideation_routing._governed_repo_idsanticipated this widening and tolerates an allowlisted name inrepo_pathsunprefixed for exactly this reason — "a silentxFactories/openXwalletwould be a repository that exists nowhere" — andtest_corpus_discovery.pypins the round trip through it so the two sites agree by construction rather than by coincidence.openxFactorykeeps its laxeris_dir()admission, pinned as a deliberate asymmetry: it is the aggregation's anchor rather than one repository among many, and every fixture aggregation in this suite is a plain directory tree with no.gitanywhere.No canon change. The products list already exists and is the declared source.
xFactories/*behaviour is unchanged and pinned unchanged.3. Two test defects in the two commits above, fixed here
The one that mattered.
test_the_subject_arm_reaches_active_packets_as_well_as_archived_onesasserted that the real tree still carries at least one UNREPAIRED ACTIVE ratification record. Six do today, so it passed — and it would go red the day that population is discharged, which is the outcome the change exists to provoke.pytest-suiteis a REQUIRED check here and runspytest tests/, so the failure would have landed on whichever lane repaired the last active record. That is the trapISSUE_877_FOURTEEN's biconditional was written to avoid, sprung by the test standing beside it.The claim is now pinned SYNTHETICALLY (
test_the_subject_arm_draws_no_line_at_the_archive_boundary) — one record's exact text at an active packet path and at an archived one, both reported — where no merge can move it. The real-tree measurement is GENERALIZED rather than narrowed: the independent walk and the equality it feeds now cover active packets and the archive together, so the active reach is measured rather than sampled, and the assertion follows the corpus wherever it goes.The prose one. Commit
9e513816cited three sites as having "anticipated this widening" and left them asserting the widening cannot happen. The two inside this surface are corrected, assertions untouched:test_governed_repo_ids_admit_root_products_with_no_checkout_in_scopejustified a still-correct assertion with "discover_reposcan never place a root-level product inrepo_paths" (now false), andtest_governed_repo_ids_never_prefix_a_root_product_with_xfactoriesdescribed as hypothetical the thing the commit beside it had just done. Both assertions were right and stay right for a reason that survives the widening: the allowlist is a claim about the aggregation's TOPOLOGY, which a single-repo self-gate and an unmaterialized pin both need and neither can derive fromrepo_paths.Named, not fixed — deliberately out of surface.
scripts/doc_health/ideation_routing.py:240-242(_governed_repo_ids' docstring) carries the same stale claim: "discover_reposenumeratesopenxFactoryplusxFactories/*and nothing else, so a root-level product can never appear inrepo_paths". That sentence is false as of commit9e513816. It is a comment-only correction outside this pull request's declared surface, recorded here so it is not lost.Evidence
Tests
python3 -m pytest tests/doc-health -qorigin/main@9784e38a(baseline, in a detached worktree of this clone)1954b0b1+21 tests, 0 failures, 0 skips added. Twelve in
tests/doc-health/test_ratification_record_subject.py(new), nine intests/doc-health/test_corpus_discovery.py(new);tests/doc-health/test_families.pygains the fifthratified-provenanceaction string to its verbatim pin.On the full
python3 -m pytest tests/ -q -m "not postgres"that the requiredpytest-suitecheck runs, this change is additive in the only two directions that check measures:MIN_SELECTED: 7090andMIN_PASSED: 7070are FLOORS, and +21 passing tests raises both margins;EXPECT_SKIPPED: 21is an EXACT pin, and no test added here can skip (there is nopytest.skip, noskipif, and no conditional fixture in either new file — the one assertion in the adopted suite that could have degraded into "retire me" was the corpus-population assertion §3 replaces). The run in CI on this pull request is the authority for that check and is reported in the comments; a local full run was started and abandoned whenmainadvanced under its worktree mid-run, which would have made its counts unreadable.The single-repo delta
python3 scripts/doc-health.py --single-repo . --skip-family notebook-projection-drift, run on both trees and diffed with the repo-name field normalized:+21 critical and NOTHING else. Not one error, warning or info finding moved; no path left the report; every added line carries the same new rule string.
The normalized diff carries exactly two other lines, and they are the same
release-tag-publicationSKIP NOTICE naming a different unresolvable version (contract-v1.47on one side,contract-v1.45on the other). It is an artifact of resolving published refs offline in this sandbox, not a property of either tree: nothing in this branch touchescontracts/or that family, and two further runs of the IDENTICAL branch tree emitted no such notice at all. It is a skip notice, not a finding — the finding counts above are unaffected by it.The rule and action, quoted once verbatim (identical on all 21):
Twenty-one, not fourteen — and every one a true positive of the same defect class. #877's list is a measurement of the ARCHIVED population at a moment in time, not of the whole population. The three groups:
(a) #877's fourteen archived records — the list on refs #877, reproduced exactly:
(b) one archived record that did not exist when #877 measured — #877 measured
mainat 2026-09-10T00:26Z; this record landed at62935437on 2026-09-10T00:38Z, twelve minutes later, carrying# Proposal Ratification:andStatus: record:(c) six ACTIVE change packets, which #877 never enumerated — its measurement was "of 32 archived
review/ratification-*.mdrecords", so the active population was outside its frame, not absent from the corpus. Each is areview/record under a change packet whose subject is the ratification and whose Status isrecord(or, in the last case, absent entirely):These six are the CHEAP half of the remedy: an active packet's record is repaired by editing it, no archived-record edit route required. They are reported here and repaired by their own lanes; nothing in this pull request edits them.
The count is derived, not typed: an independent walk of
openspec/changes/**/review/*.mdrestating the subject rule in its own code finds exactly the same 21 (6 active, 15 archived), andtest_the_subject_arm_reports_exactly_the_packet_population_this_tree_carriesasserts the two agree on every run.#869, end to end
A synthetic aggregation root (
openxFactory/,openXwallet/with a.gitfile,xFactories/MedxFactory/), swept with--repo-root:and on the branch the product's own document is actually graded:
The runner integrates the new repository cleanly — validator entrypoint reported as
(none), families that need an OpenSpec archive skip with their usual notice.The CI gate reading
doc-health is NOT a required pull-request check in this repository, and the 21 new findings turn nothing red.
.github/workflows/doc-health-reusable.ymlison: workflow_callONLY. No workflow inopenxFactory/.github/workflows/runs doc-health onpull_requestorpush.fail-oninput (doc-health-reusable.yml:21, "Optional gate severity (critical or error); empty = report-only") defaults to"", and is consumed at:2091/:2141.xFactory/.github/workflows/doc-health-nightly.yml(on: schedule+workflow_dispatch), which does not passfail-onat all — so the nightly runs REPORT-ONLY and delivers through a rolling PR.maincome from four active rulesets and are:signed-execution-chain-gate,lane-line(21957695),openspec-cli-pin(22551797),wallet-validation,pytest-suite,release-tag-gate(21538893). None runs doc-health.pytest-suiteIS required and runspython3 -m pytest tests/ -q -m "not postgres"— which is why §3 above matters, and why the counts are reported against its floors.The findings therefore land in the nightly report, where #877's disposition can be applied to them, and nowhere else.
Refs #877, #870, #765, #731, #859.
Closes #878
Closes #869
🤖 Generated with Claude Code
Summary by Sourcery
Make doc-health enforce ratification-record status requirements and measure materialized root-level governed products during aggregation sweeps.
New Features:
Bug Fixes:
Tests: