Skip to content

Four headers the sweep missed, and a remedy nobody could perform - #465

Merged
brettheap merged 6 commits into
mainfrom
change/clean-doc-health-floor
Aug 28, 2026
Merged

brettheap merged 6 commits into
mainfrom
change/clean-doc-health-floor

Conversation

@brettheap

@brettheap brettheap commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ Rulings recorded — 2026-08-28

Brett ruled by a multi-choice put to him by the orchestrating session and relayed the same day (mechanism + selections recorded; no wording reached this session, so none is quoted):

  • OD-5 — KEEP ratified plus the derived citation. The measured deviation from the ruled draft is APPROVED as taken. He took the packet's own recommendation, so nothing moved — not one byte of the archived record's header changed.
  • Both PRs merge on green, which confirms OD-1's split in the form that matters.
  • The aggregation disposition entry is REASSIGNED to the orchestrating session as part of the merge sequence — still owed, only the performer changes.
  • OD-2, OD-3 and OD-4 were not put to him and are NOT covered — they stand as authored and remain flagged.

The flagged text is kept as marked history rather than rewritten: the next session backfilling an archived header needs the measurement, not the verdict.

Not covered by the ruling: this proposal's own header stays Status: draft. "Merge on green" is an authorization to land, not a ratification act this session will spell on Brett's behalf. It must move before archive — PRE_RATIFICATION would discount this packet's own doc-health MODIFIED block, the exact defect W1 measured. Named as tasks.md 6.3.


Two of the errors standing on this repository's doc-health floor were not reports of anything wrong with the repository. This packet carries two of the three workstreams Brett commissioned on 2026-08-28 ("lets do all 3 in order"); the third ships separately as declare-generated-projection-status (OD-1).

W1 — four status backfills

status-validity reported exactly four errors. Three are the documents govern-openspec-corpus-membership explicitly named as outside its own scope (the two contracts/domain-ontology/examples/pilots/ READMEs and docs/notebooklm-sync-open-item.md); the fourth is the only archived proposal in the corpus with no header at all, archived 2026-08-25 — one day after that campaign's sweep closed.

The three live documents take draft. The free-form open (operational) maps into the controlled vocabulary rather than the vocabulary widening to admit it.

✅ OD-5 — the archived proposal departs from the ruled draft — RULED 2026-08-28: KEEP, approved as taken

The commission ruled draft, on the stated ground that "ruling 5C.3 backfilled 46 archived proposals with exactly this edit", and instructed this session to verify that precedent at the archive before editing an archive path. Verified, it is wrong in three ways: 5C.3 is the stop-and-report guard rail rather than the authorization (OQ-6 authorized); the count is 44, not 46; and 43 of those took ratified plus a citation while exactly ONE took draft.

All three candidate values were then run before any was written:

Header status-validity ratified-provenance promotion-fidelity
draft (as ruled) clears 0 NEW ERROR
ratified, uncited clears NEW CRITICAL 0
ratified + citation clears 0 0

promotion_fidelity.PRE_RATIFICATION is {brainstorm, staged, draft}, so draft discounts this packet's ideation-dashboard delta as archived design evidence; the family falls back to 2026-08-01-add-workbench-branch-sessions and reports that innocent packet as having failed to promote 1 of its 7 ratified scenarios. Isolated by reverting the single edit: promotion-fidelity reads 1 with the draft backfill and 0 without.

The citation written is derived, not invented — the promoted rule names "its origin declaration" as the first derivation source, and the packet's .openspec.yaml carries approved_by: Brett Heap / approved_on: 2026-08-25. It clears the record-citing spelling's three-way floor on all three axes. Brett's own ruling of 2026-08-26 (4dc57a4d) corrected a different archived packet in exactly this direction.

This was the decision to veto if the reading was wrong — and it was not vetoed. Brett approved it on 2026-08-28; the one-line-revert remedy stands unused.

W3 — location-conformance stops demanding impossible acts

The family told operators to "move selected material into the proposal supporting-docs folder" for proposals that had archived — closed, immutable, so the move names an act nobody can perform. The staged-exit arm read corpus.change_ids, which unions active and archived ids because ratified-provenance needs that union and must keep it. A new sibling corpus.active_change_ids answers the different question this arm asks, derived from the tree the family already walks rather than threaded through Context (OD-3).

The number worth reading is the one that did not move. The forcing document cites BOTH implement-avatar-client-lab (archived) and qualify-avatar-live-voice (active); _staged_exit_changes sorts and reports cited[0], so the archived id won on alphabetical order and hid the performable remedy behind the impossible one. The row is re-pointed, not cleared, and stays an error — correctly. That corrects the commission's stated expectation, and it is the fix working. Regression proof therefore lives in the fixtures, which is what the two added tests are for.

The other two rows (openxwallet-neutral-home, worker-enrollment-broker) both cite ACTIVE changes and are byte-identical before and after. The openxwallet row is another session's in-flight work and was not touched.

Canon

One MODIFIED requirement on doc-health — Proposal supporting-document integrity checks — whose promoted text pinned the defect twice in the phrase "active or archived". An ADDED clarification would have left canon contradicting the code.

Gates

before after
doc-health floor 5 critical / 11 error / 41 warning / 11 info 5 critical / 7 error / 41 warning / 12 info
pytest tests/doc-health 1249 passed / 0 failed 1251 passed / 0 failed (EXIT=0 under pipefail)
openspec validate --all --strict 76 passed / 0 failed 77 passed / 0 failed

Four errors cleared, none introduced. The one added INFO is modified-block-currency naming this packet's own MODIFIED block; that self-gate compares its named subject set with == and so falls due for any new MODIFIED block by design — one ledger row, in this commit, discharges it.

  • Contract bundle: none owed, measured against all 48 contracts/releases/*.digests.yaml inventories.
  • Disposition: none owed — Finding.match_key() is (family, repo, path) and no finding loses its key, so no uncited-resolution is manufactured.
  • Collision check: the three active changes touching doc-health/document-lifecycle are all ADDED-only on unrelated requirement names.

Open questions Q1 (report every active cited change, not just cited[0]) and Q2 (who reports a fragment whose every exit has archived) carry recommendations and are named as follow-ups.

🤖 Generated with Claude Code

brettheap and others added 2 commits August 28, 2026 04:10
Two of the errors on this repository's doc-health floor were not reports of
anything wrong with it.

W1 — four documents failed `status-validity`. The two
`contracts/domain-ontology/examples/pilots/` READMEs and
`docs/notebooklm-sync-open-item.md` are the three
`govern-openspec-corpus-membership` named as outside its own scope; the fourth
is the one archived proposal in the corpus carrying no header at all, archived
2026-08-25, a day after that campaign's sweep closed. The three live documents
take `draft` — the free-form `open (operational)` maps INTO the controlled
vocabulary rather than the vocabulary widening to admit it.

The archived one takes `ratified` plus a citation derived from its own origin
declaration, DEPARTING from the ruled `draft`, flagged as OD-5, and measured
three ways before anything was written. `draft` puts the packet in
`promotion_fidelity.PRE_RATIFICATION`, which discounts its `ideation-dashboard`
delta and makes an innocent third packet report as having failed to promote one
of its seven scenarios — four errors cleared and one false error created.
Isolated by reverting the single edit: promotion-fidelity reads 1 with the
`draft` backfill and 0 without. The commission's cited precedent was verified at
the archive as it instructed, and is wrong in three ways: 5C.3 is the
stop-and-report guard rail, not the authorization; the count is 44, not 46; and
43 of those took `ratified` plus a citation while exactly one took `draft`.

W3 — `location-conformance` demanded that staged material "move into the
proposal supporting-docs folder" of packets that had ARCHIVED. The folder is
closed; the remedy named an act nobody can perform. The staged-exit arm read
`corpus.change_ids`, which unions active and archived ids because
`ratified-provenance` needs the union and must keep it. A new sibling
`corpus.active_change_ids` answers the different question this arm asks, derived
from the tree the family already walks rather than threaded through `Context`.

The number worth reading is the one that did not move. The forcing document
cites BOTH an archived and an active change, `_staged_exit_changes` sorts and
reports `cited[0]`, so the archived id won on alphabetical order and hid the
performable remedy behind the impossible one. The row is re-pointed, not
cleared, and stays an error — correctly. That corrects the commission's stated
expectation, and it is the fix working.

Floor: 5 critical / 11 error / 41 warning / 11 info -> 5 critical / 7 error /
41 warning / 12 info. Four errors cleared, none introduced. The added info is
`modified-block-currency` naming this packet's own MODIFIED block, whose
self-gate compares with `==` and fell due by design; one ledger row discharges
it. pytest tests/doc-health 1249 -> 1251 passed, 0 failed. openspec validate
--all --strict 77 passed, 0 failed. No contract bundle owed, measured against
all 48 inventories. No disposition owed — no finding loses its match key.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 28, 2026 08:11

@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.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

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.

Pull request overview

This PR reduces the doc-health error floor by (1) backfilling missing/invalid Status: headers in a small set of governed documents and (2) narrowing location-conformance’s staged-exit check to only consider active OpenSpec changes so it no longer prescribes “move into supporting-docs” remedies for archived (immutable) proposals.

Changes:

  • Add corpus.active_change_ids() and update fam_location_conformance to use active-only change IDs for staged-exit citations.
  • Add regression tests covering archived-only citations (silent) and mixed archived+active citations (finding re-points to the active change).
  • Backfill status headers and record the archived-proposal header correction in the archive discrepancy register; add an index entry for the new change packet.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/doc-health/test_modified_block_currency_self_gate.py Adds the new packet’s MODIFIED subject to the self-gate ledger (audit trail remains INFO until promotion/archive).
tests/doc-health/test_families.py Adds two regression tests that pin the staged-exit behavior change in location-conformance.
scripts/doc_health/families.py Switches the staged-exit arm of fam_location_conformance to active-only change IDs.
scripts/doc_health/corpus.py Introduces active_change_ids() as an active-only sibling of change_ids().
README.md Adds the active-change index entry describing the packet’s scope and measurements.
openspec/changes/clean-doc-health-floor/tasks.md Records the measured before/after floor, decisions, and gates for this packet.
openspec/changes/clean-doc-health-floor/specs/doc-health/spec.md Updates canon (MODIFIED requirement) to match the new staged-exit semantics.
openspec/changes/clean-doc-health-floor/proposal.md Full proposal packet documenting W1/W3 motivations, measurements, and OD decisions.
openspec/changes/clean-doc-health-floor/.openspec.yaml Adds the change’s origin declaration and commission narrative (contains a wording inconsistency noted in review).
openspec/changes/archive/2026-08-25-fix-abandoned-session-cleanup-terminal-states/proposal.md Backfills Status: ratified and a derived Ratified: citation for the archived proposal.
docs/notebooklm-sync-open-item.md Replaces free-form status with Status: draft.
docs/archive-record-discrepancies.md Appends a new addendum registering the archived-proposal header backfill.
contracts/domain-ontology/examples/pilots/medx/README.md Adds Status: draft header.
contracts/domain-ontology/examples/pilots/codex/README.md Adds Status: draft header.

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

Comment on lines +46 to +47
three workstreams are packaged, that `draft` rather than `ratified` is the
value the archived record supports, where W3's active/archived predicate
Copilot's one finding on PR #465, and it was right: `.openspec.yaml`'s
`approved_by` narrative still listed "that `draft` rather than `ratified` is the
value the archived record supports" among the decisions flagged for veto — text
written before the three-way measurement moved that decision, and left behind
when it did. The origin record contradicted the packet's own implementation and
its OD-5.

The line now names the decision actually taken: `ratified` plus a derived
citation, a DEPARTURE from the ruled `draft`, taken because all three candidates
were measured and `draft` manufactures a `promotion-fidelity` error against an
innocent third packet. Still flagged for veto, which was always the point of the
sentence.

No other line moves. `openspec validate clean-doc-health-floor --strict` valid;
`proposal-origin` 0 findings.

Co-Authored-By: Claude Fable 5 <[email protected]>

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

brettheap and others added 2 commits August 28, 2026 05:27
Brett ruled on 2026-08-28, by a multi-choice put to him by the orchestrating
session and relayed the same day. The selections reaching this packet: OD-5 KEEP
`ratified` plus the derived citation — the measured deviation from the ruled
`draft` APPROVED as taken — and both pull requests merge on green, which
confirms OD-1's split in the form that matters.

He took the packet's own recommendation on OD-5, so THE CLEARANCE MOVES NOTHING:
not one byte of the archived record's header changes, and the three-way
measurement stands as the reason rather than as a case now closed. The flagged
text is KEPT as marked history, because the next session backfilling an archived
header needs the measurement, not the verdict.

One clause of OD-1 is REASSIGNED rather than discharged: the aggregation
disposition entry the split turned on is now the orchestrating session's to
write as part of the merge sequence. Still owed, still in another repository —
only the performer changes.

OD-2, OD-3 and OD-4 were NOT put to him and are NOT covered. They stand as
authored and remain flagged. No verbatim wording reached this session, so none
is quoted; approver, date, mechanism and selections are recorded instead.

Task 6.3 names what the ruling did NOT do: this proposal's own header stays
`Status: draft`, because "merge on green" is not a ratification act this session
will spell on Brett's behalf — the same refusal task 1.4 makes about somebody
else's archived record. But it cannot stay `draft` through archiving, and the
reason is this packet's own finding: PRE_RATIFICATION would discount its
doc-health MODIFIED block exactly as it would have discounted an innocent third
packet's. 110 of 112 archived proposals read `ratified`. Named now rather than
discovered at the archive gate.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 28, 2026 09:32
Re-measured after origin/main was merged a second time: main landed #463 (the
measured-latents filing), #466/#469 (add-unclassified-finding-class realized and
archived) and a nightly token fix, adding twenty-one tests between them.
tests/doc-health reads 1272 passed / 0 failed on the merged head against 1251
before it — grown by main's twenty-one and by none of this packet's. validate
--all --strict moved 77 to 78 for the same reason. The floor is UNMOVED at 5
critical / 7 error / 41 warning / 12 info.

Task 4.2b records the conflict and its resolution: #463 added two active-change
entries at the head of the OpenSpec Records block where this packet had added
one — a pure both-sides-inserted-at-the-head conflict in README.md alone, the
self-gate ledger auto-merging cleanly around this packet's row. Resolved by
keeping BOTH sides, this entry at the head as the newest arrival and main's two
blocks verbatim beneath it. Nothing of main's was dropped, reworded or
reordered, and each of the three entries appears exactly once.

Co-Authored-By: Claude Fable 5 <[email protected]>

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 28, 2026 09:35

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

@brettheap
brettheap merged commit c79d6e5 into main Aug 28, 2026
4 checks passed
@brettheap
brettheap deleted the change/clean-doc-health-floor branch August 28, 2026 10:48
brettheap pushed a commit that referenced this pull request Aug 28, 2026
Merged origin/main a third time, after clean-doc-health-floor merged as #465
(c79d6e5). Two conflicts, both both-sides-added, neither semantic:

README.md, the OpenSpec Records block again — resolved keeping BOTH, this
packet's entry at the head and MAIN'S version of the clean-doc-health-floor
entry taken verbatim, since that entry now reflects the landed state main holds.
Verified byte-identical to origin/main:README.md by diff rather than by eye.

test_modified_block_currency_self_gate.py, where the sibling's ledger row and
this packet's landed at the same spot — resolved keeping BOTH rows.
clean-doc-health-floor is merged but still ACTIVE, so its MODIFIED block is
still in the set that arm reads, and dropping its row would have failed the gate
that compares the set with ==. The ledger now carries nine subjects.

Every other file merged clean; the `projection` value was re-checked present at
all seven of its sites afterwards, and no status-consumer this packet touches
moved in the merge (diffed against the merge's first parent).

Re-verified on the merged head: validate --all --strict 79 passed / 0 failed;
pytest tests/doc-health 1279 passed / 0 failed, EXIT=0 under pipefail; census
still projection 1 / record 29; cross-reference.md still absent from
record-immutability's four criticals.

THE FLOOR NOW SHOWS BOTH PACKETS AT ONCE — 4 critical / 7 error / 41 warning /
13 info, against the 5 critical / 11 error this session started from.

Co-Authored-By: Claude Fable 5 <[email protected]>
brettheap pushed a commit that referenced this pull request Aug 28, 2026
Catch-up before re-measuring: main landed #465 (clean-doc-health-floor), which
rewrote `fam_location_conformance`'s staged-exit arm to read ACTIVE change ids
instead of `ctx.change_ids`. The first byte-identity run of this branch was
taken against a tree that already carried that and a families.py that did not,
so it showed a phantom one-row diff. Re-measured after this merge.

Co-Authored-By: Claude Opus 5 <[email protected]>
brettheap pushed a commit that referenced this pull request Aug 28, 2026
…arpenings

B1 (BLOCKER). `plan_line`'s unconditional `raise` was DATA-reachable, and the
review is right that this is not a theoretical shape. `corpus.iter_doc_paths`
rglobs every `.md` in the checkout, so a governance file named
`docs/Meeting Notes 2026.md` makes status-validity report on it and the raise
aborts `render()` BEFORE `--report-out` is written. The nightly's `Run
doc-health suite` step carries no `continue-on-error`: no report, no artifact,
until a human renames the file — and the next run then baselines against a
stale report, so a real regression lands unnoticed. Reproduced against the
previous commit: exit 1, no file.

THE CITATION WAS ALSO WRONG, and that is the deeper error. The docstring
justified failing closed by pointing at `recorded_rel`, which does the
OPPOSITE: it REPAIRS the spelling of a recorded path and carries on, precisely
so a reader is never stopped by an alphabet it did not choose. The docstring
now says what the precedent actually does and follows it.

SO THE DEFAULT NORMALIZES: each whitespace run becomes `_`, the row is written
and READABLE, and one line goes to stderr behind `[ranked-plan] sanitized
path: <family> <repo> <original> -> <sanitized>`. The repair is deterministic,
so the repaired key is stable run to run and the finding PARTICIPATES in the
regression comparison instead of vanishing from it. Measured three ways on the
same tree, with `docs/Meeting Notes 2026.md` planted in it:

  origin/main  exit 0, report written, row `path=docs/Meeting Notes 2026.md`
               -> unparsed_plan_rows=1, the finding is ABSENT from the key set
               (this is #474 itself)
  prev commit  exit 1, NO report written (the blocker)
  this commit  exit 0, report written, row `path=docs/Meeting_Notes_2026.md`
               -> unparsed_plan_rows=0, key ('status-validity', 'openxFactory',
               'docs/Meeting_Notes_2026.md') present, one stderr line

`plan_line(..., strict=True)` raises exactly as before and is what the tests
assert the rule with. Nothing in production passes it. The authoring-time nets
stay where they were — the static AST check for a family that SPELLS a bad
path, and the runtime value pin in `test_notebook_projection_drift` — because
those catch CODE; the sanitizer catches DATA, which no test can forbid since
the corpus is not ours to name.

New tests: `test_plan_line_refuses_*_under_strict` (three, renamed),
`test_a_whitespace_path_from_the_corpus_still_renders_a_readable_row`,
`test_the_nightly_still_gets_a_report_when_the_corpus_names_a_bad_path`
(the `render()`-does-not-raise assertion),
`test_sanitizing_is_deterministic_so_the_repaired_key_is_stable`,
`test_a_clean_path_is_never_announced_as_sanitized`.

N1. `parse_previous` re-implemented `unparsed_plan_rows`'s predicate inline —
two readers of one grammar that can disagree, which is the exact defect class
this change exists to close. It now CALLS it.
`test_parse_previous_and_unparsed_plan_rows_are_one_rule` pins the call.

N2. The summary line reused the row marker, so `grep -c` for the row marker
returned N+1 and the diagnostic misreported its own subject. The summary is now
`[ranked-plan] unparsed-row total`, which is not a superstring of
`[ranked-plan] unparsed row`; over the two live rejects `grep -c` now gives 2
and 1. `test_the_two_unparsed_markers_are_countable_apart` pins the
disjointness, not just the strings.

N3. The AST reader failed OPEN under `ast.AnnAssign` — annotate the offending
constant and the rule stops seeing it — so it now reads `NAME: str = "..."`
too, and the self-test carries an annotated case. It ALSO cannot follow a
constant moved to a sibling module, which no reader of one file can; instead
the check now asserts a FLOOR on how many literals it resolved (7 today), so
going blind reds as a floor violation before it can pass over an empty list.
The docstring says plainly that the runtime value pin in
`test_notebook_projection_drift` is the real net for the path this change
repaired.

MERGED origin/main (c79d6e5, #465 clean-doc-health-floor) first: main had
rewritten `fam_location_conformance`'s staged-exit arm to read ACTIVE change
ids, and the first byte-identity measurement of this branch overlaid a
families.py that predated it, which showed a phantom one-row diff. Re-measured
after the merge, both trees from c79d6e5:

  A/B render sha256 d0697bb2d6fc6c9565c0f187205547997362a21e2ce7d33130415d84e169cf1a,
  BYTE-IDENTICAL, all 54 ranked-plan rows, ZERO sanitized-path stderr lines and
  zero stderr bytes on the real render — the sanitizer touches nothing that
  exists today.
  Real worktree: 65 rows, `--previous-report` round trip 0 new regressions,
  0 uncited, output identical to input, stderr silent both runs.
  Historical: 27 files, 20,999 rows, 20,997 accepted by both parsers, the same
  2 rejected, per-file key and contested sets IDENTICAL.

`pytest tests/doc-health -q`: 1296 passed (baseline 1278 on c79d6e5).
`openspec validate --all --strict`: 78 passed, 0 failed (77 + #465's change).

Co-Authored-By: Claude Opus 5 <[email protected]>
brettheap added a commit that referenced this pull request Aug 28, 2026
…d at emit), the notebook-projection label becomes a real path, and unparseable plan rows are reported instead of dropped (#477)

* doc-health report: a ranked-plan path may not contain whitespace, and an unreadable row is reported

Sibling of #472 and the same shape. `plan_line` EMITS `path=<value>` UNQUOTED
and `PLAN_RE` READS it back as `path=(\S+)`, so a path carrying a space is
written into the report and matched by no parser, old or new. The row is then
silently absent from every `--previous-report` comparison: invisible to
`regressions()` (the finding reads as NEW on the next run) and absent from the
contested set (so `uncited_resolutions` cannot notice it vanish, and the
citation requirement stops applying to it).

THE LIVE INSTANCE IS A SYNTHETIC LABEL, NOT A FILE. `health/reports/
2026-07-09.md:188` reads `path=(lifecycle notebooks)` — the
notebook-projection-drift family put a prose label in the path slot. Harmless
in that instance (WARNING, never contested) and not harmless as a mechanism.

OPTION (b): NO GRAMMAR CHANGE. Quoting `path=` the way #472 quoted `rule=` and
`action=` would reshape all 20,999 ranked-plan rows written to date and buy
nothing — no legitimate value for this field contains whitespace. Measured
before choosing: ZERO of the tracked files in any of the twelve checkouts in
the workspace has a space in its name. So the repair is at the emit side and
at the one misuse, in three parts.

1. `plan_line` REFUSES a path the grammar cannot read back — `_PATH = r"\S+"`
   is now interpolated into `PLAN_RE` and fullmatched by the guard, one pattern
   so the two cannot drift — and the ValueError names the family, the repo, the
   offending path, and what to write instead. `plan_line` is the choke point
   rather than `Finding.__init__` because the invariant belongs to the
   ranked-plan GRAMMAR, not to the value object: every finding that reaches a
   report reaches `plan_line` (`render`, and the readiness/neutrality lanes
   that fold rows in afterwards all call it), while `Finding` is also built by
   `uncited_resolutions` from rows PARSED BACK OUT of an archived report, which
   must stay representable. Failing the run is the deliberate trade — the same
   one `recorded_rel` states for a skipped check: a row that silently does not
   participate cannot be seen to have missed anything.

2. THE MISUSE IS FIXED AT ITS SOURCE. `fam_notebook_projection_drift`'s
   `(lifecycle notebooks)` becomes `openxFactory/docs/
   lifecycle-notebook-projection.md` — a REAL artifact rather than a
   whitespace-free slug (`lifecycle-notebooks`), because the path slot already
   means "the artifact to open", every other family fills it that way, and here
   such an artifact exists: the `Status: standard` document that owns lifecycle
   notebook projection and carries the runbook this finding's action asks the
   reader to run. Spelled relative to the AGGREGATION root because this
   finding's repo is `xFactory`, matching `runner.SYNC_SCRIPT`
   (`openxFactory/scripts/sync-notebooklm-books.py`) and every other
   `repo=xFactory` path in the reports (`openxFactory`, `installs/agenttower`).

   NO DISPOSITION MOVES WITH IT. A disposition matches (family, repo, path);
   the aggregation checkout's `health/dispositions.yaml` carries no
   `notebook-projection-drift` entry at all (its eleven entries are
   location-conformance, record-immutability, semantic-contradiction,
   semantic-normative-prose, uncited-resolution). The family is WARNING-only,
   so the key change cannot manufacture an uncited-resolution either.

   EVERY OTHER CONSTRUCTION SITE WAS CHECKED, by AST over every `Finding(...)`
   call in `scripts/doc_health/` and `scripts/ideation_dashboard/` (which
   builds none). One other literal is a synthetic label — `(drafts)`, the
   staged-candidate-aging distribution row — and it is LEFT ALONE: it carries
   no whitespace, so it round-trips today, and rewriting it would change a key
   and the bytes of a row for no defect. `test_no_family_writes_a_whitespace_
   bearing_path_literal` makes that grep permanent, statically — the family
   that DID violate the rule only runs against an authenticated `nlm`, so it
   renders no row in any fixture run, in the self-gate, or in CI, and no
   dynamic test could ever have caught it. The check reads THREE spellings
   (inline literal, f-string literal parts, and a module-level constant named
   in the slot), because the first draft read only the first and went green on
   a reverted label — the very mutation it exists to catch.

3. `parse_previous` REPORTS the rows it cannot read instead of dropping them.
   It used to `continue` past every unmatched line, which is right for the
   200-odd prose lines of a report and catastrophic for a ranked-plan row:
   both grammar defects found so far were found by READING the regex, not by
   running it. A line that starts with `- severity=` and matches no parser is
   now printed to stderr with its line number behind a fixed, greppable marker
   (the convention `ideation_readiness.ROOT_FALLBACK_MARKER` already sets), and
   `unparsed_plan_rows()` returns the same list to a caller that wants it. The
   RETURN SHAPE IS UNCHANGED — still `(keys, contested)`, still the same key
   sets for every row that parses — because six callers unpack it as a pair.
   Run over the two live rejects it prints:

     [ranked-plan] unparsed row: line 188: - severity=warning
       family=notebook-projection-drift repo=xFactory path=(lifecycle notebooks) ...
     [ranked-plan] unparsed row: 1 ranked-plan row(s) in the previous report
       matched no parser and therefore took no part in the regression or
       uncited-resolution comparison

   which also surfaces #472's unfixable 2026-07-14 raw-quote row for the first
   time — the contested semantic-contradiction finding that vanished uncited.

CANON PERMITS THE FIX WITHOUT A DELTA, on the same reading #472's review
confirmed: the `doc-health` "Health report contract" requirement fixes the
ranked plan's CONTENT ("a ready-to-stage work item stating severity, repo,
path, and suggested action") and pins no lexical grammar for the row. What
changes here is which STRING a family puts in the path slot and a defect
repair in the implementation — not what the contract asks for.

BYTE-IDENTICAL ON THE REAL TREE, proven rather than asserted. Both codes run
against the SAME `git archive origin/main` extraction (only report.py and
families.py differ between them): `doc-health.py --single-repo . --as-of
2026-08-28` produces reports with the same sha256
(a0ac61eb98cdbde1fe5665a5064a6723d20a1b3f9d1ad5f832bb615fa7c5ac8b), all 57
ranked-plan rows byte for byte. The changed label does NOT appear, and that is
expected, not luck: `--single-repo` leaves `agg_root` None, so
`notebook_dryrun()` returns None and the family SKIPS ("nlm unauthenticated or
sync unavailable"). Feeding that report back as `--previous-report`: 0 new
regressions, 0 uncited resolutions, output identical to its input, stderr
silent.

HISTORICAL REPORTS UNAFFECTED. Old parser vs new over all 27 `health/reports/
*.md`: 20,999 ranked-plan rows, 20,997 accepted by both, the SAME 2 rejected
(2026-07-09.md:188 and 2026-07-14.md:267), and per-file key and contested sets
IDENTICAL. The 07-09 row stays a reject — it is a historical artifact no
forward-only repair can retroactively make readable — but it is now REPORTED
rather than silently skipped, which is the whole of the parser-side change.

MUTATIONS, each run and each restored.
- Remove the emit guard -> the 3 refusal tests red ("DID NOT RAISE ValueError").
- Revert the label to `(lifecycle notebooks)` -> `test_notebook_projection_
  drift` red on the path, and `test_no_family_writes_a_whitespace_bearing_
  path_literal` red naming `families.py:942`.
- Remove the unparsed-row report (both the `parse_previous` collection and
  `unparsed_plan_rows`) -> 2 red. The other 2 tests in that group stay green
  ON PURPOSE and are named so no reader mistakes it for weak coverage: they
  pin the NEGATIVE space (a clean report prints nothing; a per-family bullet
  is not judged as a ranked-plan row), which an absent feature also satisfies.

`pytest tests/doc-health -q`: 1288 passed (1278 before; RED first at 9 failed).
`openspec validate --all --strict`: 77 passed, 0 failed.

Closes #474.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Review of #477: the emit guard normalizes and continues, and three sharpenings

B1 (BLOCKER). `plan_line`'s unconditional `raise` was DATA-reachable, and the
review is right that this is not a theoretical shape. `corpus.iter_doc_paths`
rglobs every `.md` in the checkout, so a governance file named
`docs/Meeting Notes 2026.md` makes status-validity report on it and the raise
aborts `render()` BEFORE `--report-out` is written. The nightly's `Run
doc-health suite` step carries no `continue-on-error`: no report, no artifact,
until a human renames the file — and the next run then baselines against a
stale report, so a real regression lands unnoticed. Reproduced against the
previous commit: exit 1, no file.

THE CITATION WAS ALSO WRONG, and that is the deeper error. The docstring
justified failing closed by pointing at `recorded_rel`, which does the
OPPOSITE: it REPAIRS the spelling of a recorded path and carries on, precisely
so a reader is never stopped by an alphabet it did not choose. The docstring
now says what the precedent actually does and follows it.

SO THE DEFAULT NORMALIZES: each whitespace run becomes `_`, the row is written
and READABLE, and one line goes to stderr behind `[ranked-plan] sanitized
path: <family> <repo> <original> -> <sanitized>`. The repair is deterministic,
so the repaired key is stable run to run and the finding PARTICIPATES in the
regression comparison instead of vanishing from it. Measured three ways on the
same tree, with `docs/Meeting Notes 2026.md` planted in it:

  origin/main  exit 0, report written, row `path=docs/Meeting Notes 2026.md`
               -> unparsed_plan_rows=1, the finding is ABSENT from the key set
               (this is #474 itself)
  prev commit  exit 1, NO report written (the blocker)
  this commit  exit 0, report written, row `path=docs/Meeting_Notes_2026.md`
               -> unparsed_plan_rows=0, key ('status-validity', 'openxFactory',
               'docs/Meeting_Notes_2026.md') present, one stderr line

`plan_line(..., strict=True)` raises exactly as before and is what the tests
assert the rule with. Nothing in production passes it. The authoring-time nets
stay where they were — the static AST check for a family that SPELLS a bad
path, and the runtime value pin in `test_notebook_projection_drift` — because
those catch CODE; the sanitizer catches DATA, which no test can forbid since
the corpus is not ours to name.

New tests: `test_plan_line_refuses_*_under_strict` (three, renamed),
`test_a_whitespace_path_from_the_corpus_still_renders_a_readable_row`,
`test_the_nightly_still_gets_a_report_when_the_corpus_names_a_bad_path`
(the `render()`-does-not-raise assertion),
`test_sanitizing_is_deterministic_so_the_repaired_key_is_stable`,
`test_a_clean_path_is_never_announced_as_sanitized`.

N1. `parse_previous` re-implemented `unparsed_plan_rows`'s predicate inline —
two readers of one grammar that can disagree, which is the exact defect class
this change exists to close. It now CALLS it.
`test_parse_previous_and_unparsed_plan_rows_are_one_rule` pins the call.

N2. The summary line reused the row marker, so `grep -c` for the row marker
returned N+1 and the diagnostic misreported its own subject. The summary is now
`[ranked-plan] unparsed-row total`, which is not a superstring of
`[ranked-plan] unparsed row`; over the two live rejects `grep -c` now gives 2
and 1. `test_the_two_unparsed_markers_are_countable_apart` pins the
disjointness, not just the strings.

N3. The AST reader failed OPEN under `ast.AnnAssign` — annotate the offending
constant and the rule stops seeing it — so it now reads `NAME: str = "..."`
too, and the self-test carries an annotated case. It ALSO cannot follow a
constant moved to a sibling module, which no reader of one file can; instead
the check now asserts a FLOOR on how many literals it resolved (7 today), so
going blind reds as a floor violation before it can pass over an empty list.
The docstring says plainly that the runtime value pin in
`test_notebook_projection_drift` is the real net for the path this change
repaired.

MERGED origin/main (c79d6e5, #465 clean-doc-health-floor) first: main had
rewritten `fam_location_conformance`'s staged-exit arm to read ACTIVE change
ids, and the first byte-identity measurement of this branch overlaid a
families.py that predated it, which showed a phantom one-row diff. Re-measured
after the merge, both trees from c79d6e5:

  A/B render sha256 d0697bb2d6fc6c9565c0f187205547997362a21e2ce7d33130415d84e169cf1a,
  BYTE-IDENTICAL, all 54 ranked-plan rows, ZERO sanitized-path stderr lines and
  zero stderr bytes on the real render — the sanitizer touches nothing that
  exists today.
  Real worktree: 65 rows, `--previous-report` round trip 0 new regressions,
  0 uncited, output identical to input, stderr silent both runs.
  Historical: 27 files, 20,999 rows, 20,997 accepted by both parsers, the same
  2 rejected, per-file key and contested sets IDENTICAL.

`pytest tests/doc-health -q`: 1296 passed (baseline 1278 on c79d6e5).
`openspec validate --all --strict`: 78 passed, 0 failed (77 + #465's change).

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: brettheap <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
brettheap added a commit that referenced this pull request Aug 29, 2026
Archive both doc-health floor packets: two blocks reach canon by digest, and the one act still owed is named (realized by #465 and #468)
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