Repository navigation
doc-health report: a ranked-plan row whose rule or action contains a double quote now round-trips through parse_previous - #472
Merged
Conversation
…double quote now round-trips
`plan_line` EMITS a ranked-plan row and `PLAN_RE`/`parse_previous` READ one
back. They were not symmetric: `PLAN_RE` closed the `rule=` and `action=`
fields on the FIRST `"` (`([^"]*)`), while `plan_line` interpolated the field
text raw. A finding whose rule or action contains a double quote was therefore
emitted into the report and never parsed back out of it, so every
`--previous-report` comparison silently dropped it.
The live case is a modified-block-currency arm. Its rule templates write the
requirement title as `{title!r}`, and `repr()` switches to DOUBLE quotes when
the title contains an apostrophe — so a MODIFIED block for a requirement
titled `Brett's ruling` emits
- severity=error family=modified-block-currency repo=openxFactory
path=... rule="active MODIFIED block for "Brett's ruling" omits 1 of the
2 scenarios ..." action="..." class="contested"
which `PLAN_RE.match` returns None for. Measured before the fix: the arm
renders, the row is present in the report, and `parse_previous` returns an
empty key set — so on the next run the persistent finding reads as a NEW
regression, and a CONTESTED one that disappears is invisible to
`uncited_resolutions` (the citation requirement stops being enforced for it).
Pre-existing, and not specific to that family: it affects any family whose
rule or action text embeds a `"`.
CANON PERMITS THE FIX WITHOUT A DELTA. 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 nowhere pins
the row's lexical grammar; no spec or doc in the tree writes `rule="` as
normative text. This is a defect repair inside the implementation, not a
change to what the contract asks for.
THE FIX is the smallest symmetric pair: `escape_field` doubles `\` and escapes
`"` on emit, `_FIELD` (`((?:[^"\\]|\\.)*)`) admits the escapes on parse, and
`unescape_field` inverts it for consumers that read the field text.
BYTE-IDENTICAL FOR EVERY ROW THAT NEEDS NO ESCAPE, which is every row of every
report written to date. Proven on the real tree, not asserted: `doc-health.py
--single-repo .` before and after the change produced reports that diff clean
apart from the run date, all 68 ranked-plan rows byte for byte. Pinned going
forward by `test_plan_line_is_byte_identical_for_fields_with_no_quote_or_
backslash`, which compares against the pre-escape format literally, so a
future escaping scheme that reshapes ordinary rows reds instead of silently
rewriting the diff of every nightly report.
BACKWARD COMPATIBLE: `parse_previous` still reads rows written by the old
emitter — the new pattern is a strict superset over field text containing
neither `"` nor `\`, and no row in the real report contains a backslash.
Pinned by `test_parse_previous_still_reads_rows_from_the_pre_escape_emitter`.
RED FIRST, then mutated both ways. The four round-trip tests fail on the
unfixed tree (`assert ('modified-block-currency', ...) in set()`) and pass
after; reverting the PARSER half alone reds the same four, and reverting the
EMITTER half alone reds the same four — neither half carries the repair by
itself.
Gates: `pytest tests/doc-health` 1276 passed (was 1270; +6 new tests, no
skips, so the pytest-suite floors rise and the exact SKIPPED pin is unmoved).
`test_modified_block_currency_reporting.py`, `test_report`-adjacent files, and
every other PLAN_RE consumer green (201 passed across the six files that touch
it). `doc-health.py --single-repo .` renders; a real-tree `--previous-report`
round trip reports 0 new regressions and 0 uncited resolutions.
`openspec validate --all --strict`: 75 passed, 0 failed.
Co-Authored-By: Claude Opus 5 <[email protected]>
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
Pull request overview
Fixes an asymmetry between ranked-plan row emission (plan_line) and parsing (PLAN_RE / parse_previous) in doc-health reports so that findings whose rule/action contain double quotes can round-trip through --previous-report comparisons instead of being silently dropped.
Changes:
- Add escaping/unescaping for free-text ranked-plan fields and broaden the ranked-plan regex to accept escaped delimiters.
- Add targeted regression tests to ensure quoted and backslash-bearing fields round-trip, while ordinary rows remain byte-identical.
- Add backward-compat coverage to ensure older report rows still parse.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/doc_health/report.py | Makes ranked-plan emit/parse symmetric by escaping free-text fields and updating the parsing regex. |
| tests/doc-health/test_suite.py | Adds regression tests covering quote/backslash round-trips, byte-identity for unaffected rows, and pre-escape parsing compatibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+29
to
+35
| _FIELD = r'((?:[^"\\]|\\.)*)' | ||
|
|
||
| PLAN_RE = re.compile( | ||
| r"^- severity=(\w+) family=([\w-]+) repo=(\S+) path=(\S+) " | ||
| r'rule="([^"]*)" action="([^"]*)"(?: class="([\w-]+)")?' | ||
| r'(?: disposer="([^"]*)")?$') | ||
| r'rule="' + _FIELD + r'" action="' + _FIELD + r'"' | ||
| r'(?: class="([\w-]+)")?' | ||
| r'(?: disposer="' + _FIELD + r'")?$') |
Review of #472. Documentation only — the AST of both files, docstrings stripped, is identical before and after this commit. Four corrections. THE "LIVE CASE" NAMED IN THE PREVIOUS COMMIT WAS THE WRONG ONE. It cited a modified-block-currency arm's `{title!r}`. That family has emitted no ranked- plan row at all in the 27 dated reports written to date; the exposure is real but LATENT. The bug had already fired, from a different generator: `semantic.py:246` builds a contradiction rule as `f"[id={pid}] confidence={confidence} “{excerpt}”"`, and a raw `"` inside the corpus excerpt lands inside the field. `health/reports/2026-07-14.md:267` is one — a `contested` `semantic-contradiction` finding on `openxFactory:docs/xfactory-domain-factory-model.md` whose excerpt quotes `"In this domain, customer Hermes is Managed System or Tenant Hermes."`. On 2026-07-15 it vanished, and the 18 uncited-resolution errors that run raised did NOT include it: the 07-14 row had never parsed into the contested set, so the citation requirement never applied to it. That is the defect discharging in production, unobserved, and it is now what the comment cites. The modified-block-currency shape stays named as the latent sibling, and the test comment says why it is still the shape the tests exercise (narrowest reproduction; the round trip it pins is generator-independent). THE REPAIR IS FORWARD-ONLY, now stated. The 07-14 row carries a RAW `"`, and no parser can accept a raw `"` as field CONTENT while `"` is the delimiter — the grammar would be ambiguous. That row does not parse after this change either. What changes is that a row emitted from here on carries `\"` and does. Measured across `health/reports/*.md`: both parsers accept exactly the same 20,997 of 20,999 historical rows and agree on the key of every one. `escape_field` — the accepted, unavoidable edge. An OLD row whose field text ENDS with a literal `\` now reads as an escaped closing quote and is silently dropped. No parser can be compatible with both grammars there. Zero such rows exist across all 20,999; none contains a backslash at all. `unescape_field` — NEW-emitter output only. Over a legacy field it strips every undoubled backslash and corrupts rather than round-trips (`C:\temp\x` -> `C:tempx`). Harmless today because no production caller unescapes a field at all — `parse_previous` reads only severity, family, repo, path, and class — and that is why it is a separate function rather than something `parse_previous` applies for everyone. A future reader of archived field TEXT needs a version-aware parser, not this one. RECORDED, NOT FIXED: the second historical row neither parser accepts is a DIFFERENT defect in the same regex. `health/reports/2026-07-09.md:188` writes `path=(lifecycle notebooks)`, and `path=(\S+)` cannot match a path containing a space. Own cause, own repair; noted so this change is not read as having cleared the whole class. `pytest tests/doc-health/test_suite.py -q`: 20 passed. `openspec validate --all --strict`: 77 passed, 0 failed. 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
Sep 21, 2026
…ctory #472 -> 8fe054f9, two parents), and § 8.9's strict-validate red is asked of lane openxfactory-1 by name The routine half of the corrected R-5 split is done and the ceremony half is not: #472 moved exactly the three pin-sync things in one commit -- review-lane.yml, test_review_lane_workflow.py and the xFactories/codexFactory gitlink -- with MIGRATION_PIN untouched, and it landed by merge commit on the #455 precedent, which the commit proves by carrying two parents (73ab5076, 598f18d7). lockstep.status stays diverged truthfully, because the family that would converge it is the one that did not move. The fourth re-point ceremony stays a RULING NEEDED with Brett. Residue row (vi) now names its owner instead of calling it 'its owner': lane openxfactory-1, holder of add-chain-attestation per its 2026-09-02 handoff and #755/#760, asked at #656 comment 5767267092. A residue row whose owner is a pronoun is a row nobody answers. No marker moves; the ledger stays 65 [x] / 6 [ ] / 1 [~] of 72. All four validators exit 0. Refs #656 (stays OPEN). Lane: openxfactory-4 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
brettheap
added a commit
that referenced
this pull request
Sep 21, 2026
…d order at 8.7, and 8.9 (vii)'s disposition remedy LANDED ahead of the archive xFactory #474 -> f55149c5 is a merge commit (two parents 8fe054f9, e4d3956c) moving exactly two files -- the openxFactory gitlink and .github/clearing/openxfactory/PIN.yaml -- together, because the nightly runs scripts from the gitlink. MIGRATION_PIN and the codexFactory gitlink are untouched, so it is neither the ceremony of 5.6's R-5 correction nor #472's routine codexFactory sync. It is step 1 of a FORCED order, and the order is a test rather than a preference: xFactory's tests/test_opendox_openxdox_gitlink_parity.py requires, per leg, that the aggregation ROOT gitlink, openxFactory's NESTED gitlink and openxFactory's pin-file commit: read at the pinned gitlink all name ONE commit. Step 2 is openxFactory's nested leg-advance (openDox -> dc7aa08f, openXdox -> 2073e3a9, both pin files' commit: and digests: in the same landing) under its own claim; step 3 is the aggregation's three-pointer sync. CLAIMED 5767572080, narrowed by CORRECTION 5767621766. A clock correction this record owes its own source: the report gave 21:21:13Z. The two fields that exist read mergedAt 21:21:07Z and the merge commit's own author/committer date 21:21:06Z. The seconds matter to no gate; the FIELD does, which is why this packet now names the field beside every clock. 8.9 (vii)'s remedy LANDED ahead of the archive: xFactory #473 -> 0675ff56 (21:22:03Z, one file) sets the path-keyed promotion-fidelity row at health/dispositions.yaml:3337-3360, severity error, not narrowed by requirement:, with a cite that reproduces this row's arithmetic (115 writers, 102 superseded by title, 11 pre-existing, 2 this delta's own). The file's promotion-fidelity block goes 5 rows to 6 and the file 84 to 85, and the two-scope rule is now written in both places -- here and at dispositions.yaml:3332-3334. Landing the row BEFORE the archive is the right order: a disposition that arrives after the finding has reddened a gate is a repair, while one that arrives before it is a declared exception. No marker moves; the ledger stays 67 [x] / 4 [ ] / 1 [~] of 72. All four validators exit 0. Refs #656 (stays OPEN). Lane: openxfactory-4 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
brettheap
added a commit
that referenced
this pull request
Sep 21, 2026
…he archive forms are named at §§ 5.6/8.4/7.4, and the archive's own new exposure is registered (#1131) Lane: openxfactory-4 (openXfactory-4-openDox_extraction) Refs #656 (stays OPEN). **`split-opendox-two-layer-product` `tasks.md` AMENDMENT #10 — THREE ticks (§ 6.6, § 3.8, § 4.6), § 7.4 to the reserved `[~]` on Brett's word, and the archive pre-stage correcting this amendment's own framing.** Branched from the landed `main` at **`80c68da6`**. **Ledger 64 `[x]` / 7 `[ ]` / 1 `[~]` → 67 `[x]` / 3 `[ ]` / 2 `[~]` of 72.** One file, **four marker changes** — §§ 6.6, 3.8 and 4.6 to `[x]`, § 7.4 to `[~]`. The three still open are §§ **5.6, 8.4, 8.9**. Rule 6 applies. > **The archive is gated by boxes that are gated by the archive.** § 5.6 and § 8.4 cannot tick before it; their form at the archive is named here, and the archive amendment is what flips them. ## § 6.6 ticks — on opening dates, which is the instrument its own STATUS demanded The condition names changes **opened after ratification**, so the measure is each active change's own `created:` field plus the existence of a `specs/ideation-dashboard/` delta — *the falsifiable form of "a dashboard change"*, because a change that opens against a capability must carry a delta to say anything normative about it. | measured at `main` `80c68da6` | | | --- | --- | | active changes carrying a `created:` date | **44** | | opened **on or after 2026-09-05** (ratification day) | **20** | | of those twenty, carrying a `specs/ideation-dashboard/` delta | **0** | | active changes carrying such a delta at all | **1** — this packet, `created: 2026-09-04` | All twenty are **named in the box**, so the next reader tests the same set rather than re-deriving it. The STATUS's own 16-of-45 mention count is superseded as **the wrong instrument**, not as a wrong figure: it counted mentions in a corpus, and the condition is about openings. ## §§ 5.6 / 8.4 — the form at the archive, and why a tick is impossible `scripts/proposal-support.py:4632-4633` refuses any archive whose `tasks.md` still matches `^- \[ \]` at column zero (seven such lines today). Both boxes therefore take the house's reserved **`[~]` DEFERRED** sentence with an `Owner:` line **at the archive, flipped by the archive amendment and not by this one** — the form stated at `openspec/changes/archive/2026-09-10-accept-sequenced-after-header-line/tasks.md:254-263`, which also says why the alternative is worse: *"buying that refusal off with a false tick is the one thing an archive must not do."* R-B's RULED ORDER puts the archive **first**; Q-D1 (a) parks Phase 1 on it. **§ 8.4 additionally cannot tick on its own words at all** — *"de-floored BEFORE the removal"* is the order R-B inverted, on the measured ground that the written order and the machinery are jointly unsatisfiable for a removal. **Both directions are measured and they agree with R-B's arithmetic**: −1 capability (`ideation-dashboard`, **307,705 B / 104 requirements / 487 scenarios**), +2 (`corpus-adapter-seam` 4/11, `domain-mapping-declaration` 3/9), the § 5.2a successor **already promoted** at #1103 → `eb1880cb` — so 62 → 63 (Phase 0) → **64**, and capability directories go **63 → 64**. *In 178 archived directories this corpus has never removed a capability at an archive; this would be the first.* ## § 7.4 — the form is Brett's, and it is not the same question as the reading **§ 7.4 IS RULED — option (a), and it takes its marker here.** Brett Heap, 2026-09-21T21:31:25Z, verbatim ***"(a) for all four, (i) for the tag, keep going"*** (`#656` `5767804734`, item 1): the box is reclassified **non-gating** and carries *"DEFERRED 2026-09-21, AT THE ARCHIVE — OPEN, OWNED ELSEWHERE, AND NOT CLAIMED."* with **Owner: lane `opsXfactory-3` (CLAIMED `5638511222`), lane `opsXfactory-4`, and the install repositories.** **Clause (iii) is not satisfied by this and the box says so** — Reading B stands, the per-tenant install is still described nowhere, and `[~]` says exactly that. The box's own *"IN-SCOPE GATING PREREQUISITE"* sentence is superseded **by the ruling**, not by an argument, and is kept above it so the next reader sees which authority moved it. The three options below are left on the page as the record of what was put: (1) reclassify as open/owned-elsewhere/**non-gating** and take `[~]` — which contradicts the box's own *"IN-SCOPE GATING PREREQUISITE … where `[~]` is the reserved form for open, OWNED, NON-GATING successor work"*, and that is why it is a ruling and not bookkeeping; (2) accept **Reading A** and tick; (3) **hold** the archive until a committed tenant install exists. *A reading decides whether the box is satisfied; the form decides whether the packet may archive with it unsatisfied.* ## §§ 3.8 / 4.6 — release surfaces open as drafts, with no tag in them **Both surfaces have LANDED under RULED (a)** — Brett's word quoted verbatim, *"(a) for both, cut the tags when the drafts are green"* (`#656` `5767052465`; landing note `5767406030`): | leg | landing | manifest | release members | | --- | --- | --- | --- | | `opensoft/openDox` **#11 → `dc7aa08f`** | 20:55:35Z, squash, plain gate | `none → dox-v1.0`, **3** entries at `8fe8c4c7` | **2** (`:89`, `:98`) | | `opensoft/openXdox` **#13 → `2073e3a9`** | 20:56:19Z, same form | `none → xdox-v1.0`, **5** entries at `f088b097` | **1** (`:103`) | Two files each and nothing else. *Five entries with one release member is not a contradiction: `entries:` is the leg's whole declared surface and the tag selects `{ entry | entry.release_member == true }` — one rule applied twice.* **And both tags are CUT — measured at ~21:05Z rather than awaited**: `refs/tags/dox-v1.0` (**annotated**, `object.type: tag`, object `608236a1`) over `dc7aa08f`, and `refs/tags/xdox-v1.0` (object `2d2e9b85`) over `2073e3a9`. **BOTH BOXES NOW TICK, each on ITS OWN tag-evidence comment** — § 3.8 on `#656` **`5767450348`** (21:01:13Z) and § 4.6 on **`5767450638`** (21:01:14Z), *not* one on the other's: § 8.5 clause (b) and § 3.7's three candidate heads are this packet's own record of what happens when one leg's proof is allowed to stand for another's. | tag | annotated tag object | over commit | tagger, UTC | | --- | --- | --- | --- | | `dox-v1.0` | `608236a19ccd93fbfccf01b96035ff257b3c4b19` | `dc7aa08fe48c8d17b596b0daa1ce87cdc0472aca` | Brett Heap, **20:59:17Z** | | `xdox-v1.0` | `2d2e9b854eb97053af905beb0ae8902887935f3a` | `2073e3a92948b266d4e4d8063a6d4522b089cf3c` | Brett Heap, **20:59:28Z** | Each is **the first tag in its repository**, pushed once, third-clone verified (`cat-file -t` = `tag`; `validate-pins` at the tag ref exits 0), and each object quotes Brett's word whole on one line and carries the Lane trailer. Read from the forge, not from the report. > **Two readings of `object.type` are both true, and neither corrects the other** — recorded because a reader comparing two API calls will think they disagree. `git/ref/tags/dox-v1.0` reports `object.type: tag`: the **ref** points at a tag **object**, which is exactly what makes the tag annotated. `git/tags/608236a1` reports `object.type: commit`: the **tag object** points at the **commit**. Ref → tag → commit is one chain read at two levels, and the two endpoints agree on the sha at the joint. **Registered and NOT closed by these ticks**: `contracts/CHANGELOG.md` still reads `Status: draft` in both roots, held for Brett's separate word. The boxes asked for the tag and the bundle entries beside it; a CHANGELOG's lifecycle header is a different act. ## R-5 was mis-framed by amendment #9, and the correction sits at the same box Holder's correction `5767230200`: the three surfaces reading `1f131a23` are the **MIGRATION_PIN family** — `merge-master-approval.yml:152`, `council-convening-lane.yml:308`, `test_merge_master_workflows.py:66` — which moves **only at the recorded re-point ceremony** (last 2026-09-10, xFactory #423 → `67c0b159`), not on a routine pin-sync. The routine surfaces are different files at `22d44b09` (#455 → `5aa656c9`), and **that half has LANDED**: xFactory **#472 → `8fe054f9`** (20:50:48Z) moved exactly the three pin-sync things in one commit — `review-lane.yml`, `test_review_lane_workflow.py`, the `xFactories/codexFactory` gitlink — MIGRATION_PIN untouched, **by merge commit**, which the commit proves by carrying two parents (`73ab5076`, `598f18d7`). `lockstep.status` stays `diverged`, truthfully, because the family that would converge it is the one that did not move. **The fourth re-point ceremony is back with Brett.** > The mis-framed sentence is **kept** above its correction. The defect was in a framing both documents shared, and a correction that erases the framing also erases the evidence of how the mistake travelled. Also flagged once: **`R-5` names two different things in this ledger** — the R-1..R-6 ruling (`5690428146`) and the RULING-NEEDED item in `5738327369` — and every mention carries its comment id. Nothing is renamed. ## § 8.9 — two residue rows **(vi) The box's second command is RED, and the failure is another change's.** `openspec validate --all --strict` exits **1** at `80c68da6` (106 passed, 1 failed): `add-chain-attestation`'s `signed-execution-chain` MODIFIED block *"omits scenario(s) the current spec still has: 'a tranche-two link does not exist yet'"*. **The ask is on record and addressed by name**: lane **`openxfactory-1`**, holder of `add-chain-attestation` per its 2026-09-02 handoff and #755/#760, asked at `#656` comment **`5767267092`** (20:45:36Z) to fold the *"a tranche-two link does not exist yet"* scenario into that MODIFIED block. The box's **first** command is green at the same tree — `pytest tests/doc-health tests/sequenced_after -q` → **2183 passed**, 529.69s. **(vii) The archive's own new exposure, measured.** 115 authoritative ADDED/MODIFIED writers stand against `ideation-dashboard`; this packet's REMOVED delta supersedes **102** by title (that enumeration is the mechanism, not decoration); 11 are already findings; and **two are orphaned and satisfied today** — `archive/2026-09-16-retire-doxbench-chat-turn-v1/specs/ideation-dashboard/spec.md:5` and `:67`, both ADDED by **this packet's own § 6.2 re-home** at `90bf93c3`, twelve days after the delta was authored. Remedy: a path-keyed disposition row (`requirement:` optional, `promotion_fidelity.py:714-734`) — a helper's PR is in flight. Extending the ratified REMOVED delta is normative text after the word, so that route is Brett's. *Caveat the archive's doc-health record must carry: dispositions live at the aggregation root, so a `--single-repo` run sees none (`:736-740`).* ## Aggregation side — two xFactory landings folded in **xFactory #474 → `f55149c5`** (merge commit, two parents; `mergedAt` **21:21:07Z**) advances the `openxFactory` pointer `89d7975d → 80c68da` with `.github/clearing/openxfactory/PIN.yaml` **in the same commit** — exactly two files, MIGRATION_PIN and the codexFactory gitlink untouched. It is **step 1 of a forced order**, and the order is a test: `xFactory`'s `tests/test_opendox_openxdox_gitlink_parity.py` requires, per leg, that the aggregation ROOT gitlink, `openxFactory`'s NESTED gitlink and `openxFactory`'s pin-file `commit:` read at the pinned gitlink all name ONE commit. Step 2 is `openxFactory`'s nested leg-advance (`openDox → dc7aa08f`, `openXdox → 2073e3a9`, both pin files' `commit:` and `digests:`), step 3 the aggregation's three-pointer sync. *(Clock correction owed to my own source: the handed figure was 21:21:13Z; the two fields that exist read `mergedAt` 21:21:07Z and the merge commit's date 21:21:06Z.)* **xFactory #473 → `0675ff56`** (21:22:03Z, one file) lands **§ 8.9 (vii)'s remedy ahead of the archive**: the path-keyed `promotion-fidelity` row at `health/dispositions.yaml:3337-3360`, `severity: error`, not narrowed by `requirement:`, whose `cite` reproduces this packet's arithmetic (115 writers, 102 superseded, 11 pre-existing, 2 this delta's own). The file goes 84 → 85 rows, its promotion-fidelity block 5 → 6, and **the two-scope rule is now written in both places** — the § 8.9 box and `dispositions.yaml:3332-3334`. *A disposition that arrives after a finding has reddened a gate is a repair; one that arrives before it is a declared exception.* ## The archive pre-stage corrected THIS amendment — and the wrong paragraph is kept above the correction Actor `rehome-lander` pre-staged the archive and ran the pinned CLI over it (`brett-wip` **`46891cfc`**). **`ideation-dashboard` is NOT removed.** The applied delta is `+7 ~4 -102 → 0`, exit 0: the 102 REMOVED requirements all match canon and go, and **two survive** — the two `retire-doxbench-chat-turn-v1` titles this amendment had already identified at § 8.9 (vii). After: **15,457 B, 2 requirements, 12 scenarios, directory present**, CLI plan `ideation-dashboard: update`. So two figures this amendment wrote are corrected at the box that was wrong: this is **the largest `## REMOVED` block ever applied at an archive here (102 requirements, 215,683 B of delta) and NOT the first capability removal**, and **capability directories go 63 → 65**, not 63 → 64. *Two boxes of one amendment disagreed because each was written from a different measurement.* **The consequence reaches R-B's own arithmetic** (`entry_count 62 → 64, floor 70 → 72`) and is **registered, not rewritten**: if the `ideation-dashboard` path survives, the regeneration gains two entries and loses none. A ruling's figures are the ruling's, for the de-floor act to re-derive from the landed tree. **Archive-as-ratified is the default and, measured, the only runnable form today**: amending the delta to drop the survivors is **refused by the CLI** — *"Spec must have at least one requirement … refused while the spec holds content the merge cannot safely account for"* — because 65 blockquote lines including the 2026-09-16 ERRATUM survive with them (`#656` `5767829227`, raw reports `brett-wip` `2e739cd1`). **The surviving-two question is not ruled by word**, and the ledger says so in those words rather than implying a decision nobody made. **§ 8.9 gains three rows**: **(viii)** the BEFORE vectors *with their scope named* — `--single-repo` canon share **41.4 %** (402,636/972,921 B), **31/28/37/20**, 0 new regressions, 5 families skipped; aggregation mode **16/948/3294/33 → 16/950/3294/33**, the entire movement being two auto-fixable `document-catalog` findings on the two new specs; `--strict-archive-dates` **129 / 129**. **(ix)** the wrapper's dry run — seven column-0 boxes before this amendment's four marker moves; § 7.3's `[~]` is not a blocker. **(x)** **#473's row measured NEVER-LIVE** at the CLI-applied AFTER tree (row present 0/0/0/0, row removed 0/0/0/0, byte-identical finding sets; the titles it disposes are the two survivors, post-archive lines 28 and 156) — written on a simulation that deleted the spec wholesale, the same wrong premise § 8.4 carried. *A disposition that turned out unnecessary is not a mistake to erase; it is the cost of landing a declared exception before its act.* **Also recorded**: the MIGRATION_PIN **ceremony word is given** (item 2) while `lockstep.status` stays `diverged` until that PR lands; the CHANGELOG **`draft` → `standard` word is given** (item 3, two root PRs in flight); **`xdox-v1.0` stands as cut** (item 5) — a first bundle tag is the one artifact here a later landing cannot correct, so a ruling that leaves it alone is a decision and not a silence; `add-chain-attestation` **waits on lane `openxfactory-1`** (item 4); and archive-day items are registered: real `## Purpose` text into the two new promoted specs, the two-PR aggregation sync, and `README.md:83`'s stale *"so § 3.7 is not ticked"*. ## Four more landings folded, and one Copilot FACT finding taken | act | landing | what it is | | --- | --- | --- | | `openDox` **#12 → `36ded1cd`** · `openXdox` **#14 → `6df0a030`** | 21:38:52Z · 21:39:18Z | CHANGELOG `draft` → `standard`, item 3 of Brett's word; one file each | | `openXdox` **#15 → `646f1dc0`** | 21:51:39Z | the pin chain's first step: root pin of openDox `c4c5014d → dc7aa08f` (= `dox-v1.0`), digest re-derived, **migration sentinel filled** (`range "0001..0002"`, `reversible: false`, runbook = openDox-code `docs/runtime.md` §§ 5-6 at `d816cf06`) | | `xFactory` **#475 → `c88d1fdd`** | 21:55:36Z, merge commit | the **FOURTH MIGRATION_PIN re-point ceremony**, `1f131a23 → b21f0100` at exactly three surfaces; G1 37 passed, G2 envelope OK (vendored golden now byte-identical to live), G2a IDENTICAL=21 at both pins, guard plane 212, G3 live lane re-proved at the OLD pin (run `35658107765`), G4 validate 229; rollback target `1f131a23` | **The tags are not moved**, so each root reads `Status: draft` **at the tag** and `standard` at `main`, bundle values byte-identical — a document-header fact, not a release-content one. *Correction to the report I was given: "each tag is now `main~1`" holds for **openDox** (`main` `36ded1cd`, `main~1` `dc7aa08f`) and **not** for **openXdox**, where #15 landed after #14, so the tag's target `2073e3a9` is `main~2`.* **So the ceremony half of the corrected R-5 is DONE and the convergence is NOT**: `lockstep.status` flips `diverged → converged` in a follow-on `openxFactory` PR, in flight — recorded as **pending, not landed**. The aggregation's own leg pointers still read `c4c5014d` / `88a1047e` until the chain's STEP 3. *"STEP 1" now names two different acts (#474's parity-order pointer advance and this pin-chain step); each is cited to its own comment rather than renamed.* **Copilot's FACT-class finding is taken, not registered**: § 7.4's earlier STATUS said *"the marker does not move here"* and *"the box is `[ ]`"* while the marker already read `[~]`. A ledger that states its own marker wrongly is worse than one that states it vaguely — the fourth time in this amendment the fix was to bind a sentence to the round that wrote it. ## § 7.3 — locator corrected, non-normative `:4609-4610` → **`:4632-4633`**. The rule and its words have not moved; only its line numbers did, which is what a locator into live code does between amendments. `openspec validate … --strict` **valid** · `proposal-support.py verify` **ok** · `validate-sequenced-after.py --ledger-diff` **clean** (222 rows) · `verify-opendox-pin.py` **OK**. 🤖 Generated with [Claude Code](https://claude.com/claude-code) *(§ 7.4's form is now RULED and folded here; what remains open are §§ 5.6, 8.4 and 8.9 — the first two take their `[~]` at the archive amendment, and § 8.9 ticks on the archive's own BEFORE/AFTER record.)* Lane: openxfactory-4 Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect (pre-existing)
scripts/doc_health/report.pyemits a ranked-plan row withplan_lineand reads one back withPLAN_RE/parse_previous. The two were not symmetric: the pattern closed therule=andaction=fields on the first"(([^"]*)), whileplan_lineinterpolated the field text raw. A finding whose rule or action contains a double quote was therefore written into the report and never parsed back out of it, so every--previous-reportcomparison silently dropped it.It already fired, in production, unobserved
The generator is not the one you would guess.
scripts/doc_health/semantic.py:246builds a contradiction rule asso a raw
"inside the corpus excerpt lands inside the field.health/reports/2026-07-14.md:267is such a row — acontestedsemantic-contradictionfinding onopenxFactory:docs/xfactory-domain-factory-model.mdwhose excerpt quotes"In this domain, customer Hermes is Managed System or Tenant Hermes.":On 2026-07-15 that finding vanished, and the 18 uncited-resolution errors that run raised did not include it — the 07-14 row had never parsed into the contested set, so the citation requirement simply never applied to it. That is the defect discharging silently against a
contestedfinding, which is precisely the case the contract's "A contested finding is resolved" scenario exists to catch.The
modified-block-currencyarms are the other exposure ({title!r}switches to double quotes when a requirement title contains an apostrophe), but that one is latent: that family has emitted no ranked-plan row at all in the 27 dated reports to date. It is still the shape the tests exercise, because it is the narrowest reproduction of the emit/parse asymmetry and the round trip it pins is generator-independent.Canon permits this without a delta
The
doc-healthHealth report contract requirement fixes the ranked plan's content — "a ready-to-stage work item stating severity, repo, path, and suggested action" — and nowhere pins the row's lexical grammar.grep -rn 'rule="' openspec/ docs/finds exactly one hit, inside an archived change'stasks.mdprose. Defect repair inside the implementation, not a change to what the contract asks for.The fix
escape_field(v)— doubles\and escapes"on emit; applied torule,action,disposer(the three free-text fields;classis a[\w-]+vocabulary, left alone)._FIELD = r'((?:[^"\\]|\\.)*)'— admits the escapes on parse, substituted intoPLAN_REfor all three.unescape_field(v)— inverts it for consumers that read field text.Two limits, both stated in the code
Forward-only. The 07-14 row carries a raw
", and no parser can accept a raw"as field content while"is also the delimiter — the grammar would be ambiguous. That row does not parse after this change either. What changes is that a row emitted from here on carries\"and does.One accepted edge in reading old reports. An old row whose field text ends with a literal
\now reads as an escaped closing quote and is dropped. No parser can be compatible with both grammars there. Zero such rows exist across all 20,999 historical rows; none contains a backslash at all.Byte identity and historical compatibility — measured
Live tree,
doc-health.py --single-repo .before vs after:Whole historical corpus,
health/reports/*.md(27 reports, 20,999 ranked-plan rows):PLAN_REPLAN_REPinned by
test_plan_line_is_byte_identical_for_fields_with_no_quote_or_backslash(compares against the pre-escape format literally) andtest_parse_previous_still_reads_rows_from_the_pre_escape_emitter.Recorded, not fixed
The second historically unparsed row is a different defect in the same regex:
health/reports/2026-07-09.md:188writespath=(lifecycle notebooks), andpath=(\S+)cannot match a path containing a space. Own cause, own repair — noted in the code so this change is not read as having cleared the whole class.RED first, then mutated both ways
Six tests added to
tests/doc-health/test_suite.py. RED on the unfixed tree — 4 failed, 2 passed (the byte-identity and backward-compat pins are green against the old emitter by construction, which is the point):PLAN_REback to([^"]*))plan_linestops escaping)Gates
python3 -m pytest tests/doc-health -qpython3 -m pytest tests/doc-health/test_suite.py -qPLAN_REconsumer (test_modified_block_currency_reporting,test_semantic,test_organizer_dispatch,test_neutrality_dispatch,test_promotion_fidelity,test_readiness_report)test_suitepython3 scripts/doc-health.py --single-repo .--previous-reportround tripNew regressions vs previous report: 0; 0 uncited resolutions;--new-findings-out=[]OPENSPEC_TELEMETRY=0 openspec validate --all --strictThe
pytest-suiteCI gate pins SELECTED/PASSED as floors (+6 here) and SKIPPED exactly (unmoved), so no workflow pin needs touching.Commits
f9696c54— the fix, its tests, and the mutation-proven RED.2329dc2a— review fold: names the case that actually fired (semantic.py, not modified-block-currency), states the forward-only limit and the trailing-backslash edge, scopesunescape_fieldto new-emitter output, and records the separatepath=(\S+)defect. Documentation only — the AST of both files, docstrings stripped, is identical before and after.🤖 Generated with Claude Code