Repository navigation
Conversation
… and contract-v2.6 declares it
Realizes `declare-spent-bundle-state` § 2 (2.1–2.9), ratified 2026-09-02.
2.1 FIRST: the ONE reserved declaration line, inside the EXISTING
`### contract-v2.6 disposition` subsection of `## contract-v3.0`. Nothing
else in the changelog moves; the manifest, the `contract-v2.6` entry and
`contracts/releases/contract-v2.6.digests.yaml` are untouched.
2.2 the reader: one pure function from changelog BYTES to
`{bundle: SpentDeclaration}`, parsing the reserved opener, the four elements
and the containing `## contract-vX.Y` entry. It REJECTS rather than skips —
a line beginning with the reserved opener that does not complete the form is
a MALFORMED declaration, never prose to be ignored.
2.3 the ladder in `check_repo`, in the ABSENT arm only and AFTER the
ok/lightweight/misplaced branches, so the scope rule holds by construction.
2.4 the emits land on `contracts/releases/<bundle>.digests.yaml`, the one
path unique to a bundle by construction (OD-5 as amended on Codex's P1); the
accepted `info` is classed `contested`; the orphan-subject `warning` keeps
the changelog path, having no per-bundle inventory. Four new action
constants beside the module's existing four.
2.5 the changelog read joins the manifest read in the SAME `blobs_at` call
at the SAME commit and carries the SAME guard: a blob it cannot read is a
SKIP naming that read, never "no declaration" (the #338 conflation, one
document over).
2.6/2.7 the thirteen new scenarios as tests over the file's real-git
fixtures, each with its positive control; the RED-FIRST proof (the same
fixture with the declaration removed returns the `error`); OQ-3 proved
rather than inherited; and the Codex repair proved with TWO bundles, two
`info`s, two different match keys, one withdrawal raising one
uncited-resolution.
2.8 `docs/doc-health.md` gains the third state. This change adds NO family
and moves no count, so the family-count sentences are untouched and
`family-enumeration` stays silent.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…2 boxes ticked with evidence The Spec Kit feature the ratified packet asked for by name — "Group 2 is ONE Spec Kit feature" — with the artifact set `specs/026-unplaced-finding-drift` established: spec (16 FRs, four user stories), plan (six design decisions and the routing), research (six questions answered by reading the code), data-model (the reserved form, the declaration entity, the four action constants, the path rule and the three outcomes as control flow), tasks (T001-T035), quickstart, evidence and the PR body. Boxes 2.1-2.9 of `declare-spent-bundle-state` are ticked here, each citing the evidence that measures it. The preamble is corrected a SECOND time rather than left to contradict them: OD-8 asked for TWO PRs, not for an unticked list, and the separate realization PR it called for is this one. 3.1 IS LEFT OPEN WITH A DATED ROUTING NOTE AND IS NOT TICKED. `docs/contract-versioning-policy.md` is untouched: the repository owner ruled 2026-09-02 that #577's existing drift on that file carries to the next cut and that this realization's scope is "editorial member; no drift". OD-6's zero-incremental-cost arithmetic is accepted as arithmetic and declined as authority — it says the edit would cost nothing, not that this realization was authorized to make it. The red log records the ORDER AS TAKEN rather than as prescribed: the module and tests were authored in one pass, module first, and the red was demonstrated by reverting the module against the landed tests (where not one of the 28 new tests can even be collected). Weaker than a true test-first order, and disclosed rather than smoothed over. Co-Authored-By: Claude Fable 5.1 <[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.
🟡 Changes recommended
A newly added test intended to validate handling of invalid UTF-8 bytes currently encodes valid UTF-8, so it does not actually exercise the decode-with-replacement behavior it claims to cover.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Implements the ratified declare-spent-bundle-state change by adding a third “SPENT” state to the release-tag-publication doc-health family, including the reserved declaration form in contracts/CHANGELOG.md, the parsing/validation ladder, updated documentation, and expanded real-git fixture test coverage.
Changes:
- Add SPENT-declaration parsing and enforcement logic to
scripts/doc_health/release_tag_publication.py, including per-bundle finding identity (contracts/releases/<bundle>.digests.yaml) and new action constants. - Expand
tests/doc-health/test_release_tag_publication.pywith SPENT reader/ladder/report-integration tests and fixture support for changelog blobs. - Add/refresh supporting documentation and Spec Kit feature artifacts (spec/plan/tasks/evidence) describing and measuring the behavior.
File summaries
| File | Description |
|---|---|
| tests/doc-health/test_release_tag_publication.py | Adds extensive SPENT-state unit/integration coverage over real git fixtures and report integration. |
| scripts/doc_health/release_tag_publication.py | Implements SPENT-state parsing, refusal ladder, and updated finding emission/identity rules in the release-tag-publication family. |
| docs/doc-health.md | Documents the SPENT third-state, reserved declaration form, outcomes, and action semantics for doc-health readers. |
| contracts/CHANGELOG.md | Adds the reserved SPENT declaration line for contract-v2.6 under the contract-v3.0 entry. |
| openspec/changes/declare-spent-bundle-state/tasks.md | Updates packet task status/preamble to reflect realization completion and routing notes. |
| specs/027-spent-bundle-state/tasks.md | New Spec Kit feature task breakdown and evidence pointers for the realization. |
| specs/027-spent-bundle-state/spec.md | New feature specification capturing scenarios, requirements, and success criteria for SPENT-state behavior. |
| specs/027-spent-bundle-state/research.md | New design/research notes documenting the code-read answers that drove key decisions. |
| specs/027-spent-bundle-state/quickstart.md | New quickstart for manually exercising the reader/ladder/tests and understanding pre-/post-merge behavior. |
| specs/027-spent-bundle-state/pr-body.md | New captured PR narrative/evidence summary for the realization. |
| specs/027-spent-bundle-state/plan.md | New implementation plan describing file-level changes and rationale for key design constraints. |
| specs/027-spent-bundle-state/evidence/red-log.md | New evidence log documenting the “retro-red” proof and baseline retake. |
| specs/027-spent-bundle-state/evidence/post-merge-proof.md | New evidence transcript demonstrating the post-merge green state and the declaration-removal control. |
| specs/027-spent-bundle-state/evidence/gates.md | New evidence transcript of gates/commands and their outputs for this change set. |
| specs/027-spent-bundle-state/evidence/doc-health-rows-head.txt | New captured ranked-plan rows for head-state doc-health measurement. |
| specs/027-spent-bundle-state/evidence/doc-health-rows-base.txt | New captured ranked-plan rows for base-state doc-health measurement. |
| specs/027-spent-bundle-state/evidence/doc-health-delta.md | New doc-health before/after delta explanation asserting only the intended row change. |
| specs/027-spent-bundle-state/data-model.md | New data model description for SPENT declarations, outcomes, paths, and actions as implemented. |
Review details
- Files reviewed: 18/18 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ests Found by reading the diff rather than by a reviewer, and fixed with a test each so none can come back silently. 1. AN EMPTY BACKTICK PAIR PRINTED THE WORD "None" INTO A FINDING. A subject of `` parsed to `subject=None` with `defect=None`, and the ladder's no-subject arm INTERPOLATES the defect string — so a human would have been handed "...names no bundle: None". Every None-keyed declaration now carries a defect saying which of the two ways it names no subject. 2. A MISSPELT KEYWORD WAS READ AS THE KEYWORD. `RULED BYE 2026-01-01` matched the prefix `RULED BY` on a bare `startswith` and yielded the value `E 2026-01-01`, so a typo would have been accepted as a ruling. The two keywords ending in a letter rather than a colon now require a word boundary; the colon already is one for the other two. 3. OUT-OF-ORDER ELEMENTS WOULD HAVE BEEN REPORTED AS MISSING. A line whose CAUSE precedes its SUPERSEDED BY leaves the cause segment unrecognized AND the cause missing. `spent_refusal` reads the defect first, so the finding says MALFORMED — which is true — rather than "omits the cause", which would send a reader looking for text the line already carries. The behaviour was already right; it is now pinned, and the reason is written down where the unrecognized segments are collected. Plus one readability change with no behaviour: the superseded `error` is built inside the arm that emits it, with a note saying why the two emit sites must share one string. Family file 19 -> 51 tests (50 passed, 1 failed — the self-gate, which reads remote main). Counts corrected across the feature's artifacts. Co-Authored-By: Claude Fable 5.1 <[email protected]>
COPILOT WAS EXACTLY RIGHT AND THE FINDING IS TAKEN IN FULL.
`test_a_mis_encoded_byte_elsewhere_does_not_crash_the_read` built a `str`
containing "\xff\xfe" and UTF-8 ENCODED it, which yields
b"\xc3\xbf\xc3\xbe" — four perfectly valid UTF-8 bytes for `yth`. So the
bytes decoded cleanly, the `errors="replace"` path the test named was never
reached, and the test asserted the reader survives something that was never
wrong. Measured before fixing:
'\xff\xfe'.encode('utf-8') -> b'\xc3\xbf\xc3\xbe'
b'\xc3\xbf\xc3\xbe'.decode('utf-8') -> 'yth' (no error)
b'\xff\xfe'.decode('utf-8') -> UnicodeDecodeError: invalid start byte
The fixture is now a BYTES LITERAL, which is genuinely undecodable, and the
test PROVES it rather than claiming it: `pytest.raises(UnicodeDecodeError)`
on a strict decode of the same bytes comes FIRST, so the fixture can never
silently become valid again. It also now asserts the entry heading survives
the mis-encoded line, since the containment rule depends on it.
And the doc-health directory count is filled in from its own run rather than
computed: 1415 passed, 1 failed (0:07:42), the failure being the self-gate.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
@codex review |
There was a problem hiding this comment.
🔵 Needs a closer look
Merge readiness depends on a deliberately post-merge-observable CI outcome (a remote-main-reading self-gate), which warrants explicit human confirmation of the intended merge/run procedure.
Review details
- Files reviewed: 19/19 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
It changes core doc-health enforcement logic and report identity semantics for releases, so it warrants final human review despite strong test coverage.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/doc_health/release_tag_publication.py:648
- The Skip reason when
CHANGELOGisNoneimplies the commit may not be present locally, butRealGit.blobs_atreturnsNonefor a per-path<commit>:<path>lookup when the path is absent at that commit or the object is missing. The current message omits the common/intentional case (repository has nocontracts/CHANGELOG.mdat that tip), which makes the Skip harder to interpret and debug.
- Files reviewed: 19/19 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09e28b3dde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| heading = _ENTRY_HEADING.match(line) | ||
| if heading is not None: | ||
| entry = heading.group(1) |
There was a problem hiding this comment.
Reset the containing entry at every level-two heading
When a SPENT line appears under a non-release ## section following a release entry—for example, ## contract-v3.0, then ## Notes, then the declaration—entry incorrectly remains contract-v3.0 because only matching release headings update it. spent_refusal() can consequently accept a declaration that is outside its successor's entry, replacing the genuine superseded-bundle error with an info or provisional warning. Clear entry whenever any level-two heading begins, then set it only when that heading matches the release-entry pattern.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Taken in full. This is the containment guard itself, not a detail of it — measured before fixing:
## contract-v3.0 — a release entry
## Notes
**SPENT BUNDLE:** `contract-v2.6` — SUPERSEDED BY `contract-v3.0` — …
entry read as: contract-v3.0 <-- wrong
refusal : None <-- ACCEPTED
So a declaration sitting in no release entry at all would have replaced the genuine superseded-bundle error with an info, which is precisely the "who may declare a bundle spent" question the ratified requirement answers with "the superseding bundle's OWN changelog entry".
Fixed exactly as you prescribed, in 184a18a5: every level-two heading CLOSES the open entry; only one naming a bundle OPENS a new one.
_LEVEL_TWO_HEADING = re.compile(r"^##(?!#)\s")
_ENTRY_HEADING = re.compile(r"^##(?!#)\s+(contract-v\d+\.\d+)\b")
...
if _LEVEL_TWO_HEADING.match(line):
heading = _ENTRY_HEADING.match(line)
entry = heading.group(1) if heading is not None else None
continueOne thing your suggestion did not have to know, and it is load-bearing: the (?!#) is not cosmetic. This repository's own declaration is written inside the ### `contract-v2.6` disposition subsection of the v3.0 entry, so a heading rule that closed on ### would have refused the real record. Both halves are now pinned, each with a positive control:
test_a_NON_RELEASE_level_two_heading_CLOSES_the_open_entry— your case; assertsentry is None, asserts the refusal says "no release entry at all", and asserts the same line WITHOUT## Notesis still accepted.test_a_level_THREE_subsection_does_NOT_close_the_entry— the converse.test_THIS_repository_s_own_declaration_is_contained_by_the_v3_0_entry— readscontracts/CHANGELOG.mdfrom disk, so if a future edit inserts a level-two heading above the reserved line, a test says so instead of the family quietly goinginfo→erroron the next nightly.
This repository is unaffected today: it carries no non-release level-two heading anywhere, which was measured rather than assumed.
…inment is sound again CODEX FOUND THE CONTAINMENT GUARD ITSELF, NOT A DETAIL OF IT, AND THE FINDING IS TAKEN IN FULL. Only headings NAMING a bundle updated `entry`, so a non-release level-two section between a release entry and a declaration left the declaration inheriting that release's authority: ## contract-v3.0 — a release entry ## Notes **SPENT BUNDLE:** `contract-v2.6` — SUPERSEDED BY `contract-v3.0` — … Measured before fixing: `entry` read `contract-v3.0` and `spent_refusal` returned None — ACCEPTED. So a declaration sitting in no release entry at all would have replaced the genuine superseded-bundle `error` with an `info`, which is exactly the "who may declare a bundle spent" question the ratified requirement answers with "the superseding bundle's OWN changelog entry". Every level-two heading now CLOSES the open entry; only one naming a bundle OPENS a new one. `(?!#)` keeps a `###` subsection from closing the entry it lives inside — which is load-bearing rather than incidental, because this repository's own declaration is written inside the `### contract-v2.6 disposition` subsection of the v3.0 entry, and a rule that closed on `###` would have refused the real record. Both halves are pinned, each with the positive control that shows the refusal is the heading's doing. AND A THIRD TEST READS THE LIVE RECORD FROM DISK: if a future edit inserts a level-two heading between `## contract-v3.0` and the reserved line, a test says so instead of the family quietly going from `info` to `error` on the next nightly. This repository's declaration is unaffected today — it carries no non-release level-two heading at all, which was measured rather than assumed. ALSO TAKEN — Copilot's suppressed finding on the changelog skip reason. It named only "the commit may not be present locally", while `blobs_at` answers None per path both for that AND for a repository that simply has no contracts/CHANGELOG.md at that tip — the common case, and the consequence this feature discloses in plan.md D5. The reason now names both and says the question is declined rather than answered. 53 passed, 1 deselected (the self-gate, which reads remote main). Co-Authored-By: Claude Fable 5.1 <[email protected]>
Bot round 1 → round 2, and both findings on the code were TAKENCodex P1 — "reset the containing entry at every level-two heading" — TAKEN, and it was the containment guard itself. Measured before fixing: with Copilot round 1 — the invalid-UTF-8 test — TAKEN. The fixture built a Copilot's suppressed finding on the changelog skip reason — TAKEN. It named only "the commit may not be present locally", while Copilot's two "needs a closer look" verdicts are noted and are not code findings: both ask for human confirmation of the merge procedure given a deliberately post-merge-observable self-gate. That is exactly right, and it is the ratified position rather than an oversight — see the top of this body, and
|
There was a problem hiding this comment.
🔵 Needs a closer look
It materially changes a core doc-health family’s decision ladder and report identities, so it warrants final human review despite strong test coverage and documentation.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
tests/doc-health/test_release_tag_publication.py:827
- The test docstring starts with four quote characters (
""""), which makes the docstring content begin with an extra literal"and looks like an accidental typo.
- Files reviewed: 19/19 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 184a18a599
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # `(?!#)` keeps a `### subsection` from closing the entry it lives inside, | ||
| # which matters because the reserved line is written INSIDE one. | ||
| _LEVEL_TWO_HEADING = re.compile(r"^##(?!#)\s") | ||
| _ENTRY_HEADING = re.compile(r"^##(?!#)\s+(contract-v\d+\.\d+)\b") |
There was a problem hiding this comment.
Require a complete bundle token in entry headings
Fresh containment case after the prior fix: \b also matches punctuation, so a non-entry heading such as ## contract-v3.0.1 or ## contract-v3.0-notes opens entry as contract-v3.0. A declaration below it naming contract-v3.0 then passes spent_refusal() and can replace the genuine superseded-bundle error with an info, despite not residing in the required ## contract-vX.Y entry. Require the version token to be followed by whitespace or end-of-line rather than any word boundary.
AGENTS.md reference: AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Taken. And this is the useful kind of second look — you found it on the fix for your own round-1 P1. Measured before fixing:
'## contract-v3.0.1' -> entry = contract-v3.0 (wrong)
'## contract-v3.0-notes' -> entry = contract-v3.0 (wrong)
So the containment guard was still walkable one step over from where round 1 closed it: a declaration below either heading would have been contained by an entry that is not the one it names.
Fixed in 95c11696 exactly as prescribed — whitespace or end-of-line rather than any word boundary:
_ENTRY_HEADING = re.compile(r"^##(?!#)\s+(contract-v\d+\.\d+)(?=\s|$)")test_a_LONGER_version_token_does_not_open_the_shorter_bundle_s_entry pins both of your cases and carries the positive control (the real heading shape, ## contract-v3.0 — 2026-09-02 (BREAKING), and the bare ## contract-v3.0, both still open the entry).
One case from your list is NOT a defect, and it is now pinned as such so a later reader does not "fix" it: ## contract-v3.01 is a well-formed bundle name — major 3, minor 01 — so it legitimately opens an entry. It is refused for the right reason, which is that the entry names a different bundle:
entry = contract-v3.01
refusal = "... sits in the contract-v3.01 entry while naming contract-v3.0 as the superseding bundle ..."
This repository's own declaration re-verified against the tightened pattern: entry: contract-v3.0, refusal: None.
| f"{MANIFEST} DECLARES at the published tip: a repository " | ||
| f"cannot declare a bundle and call it spent, and this bundle " | ||
| f"continues to be graded by distance", | ||
| _SPENT_REFUSED_ACTION, path=inventory_path(bundle))) |
There was a problem hiding this comment.
Use an action that matches current-bundle refusals
When a SPENT declaration names the currently declared bundle, this branch reuses _SPENT_REFUSED_ACTION, whose text says the superseded-and-never-published finding “stands beside this one.” This branch never creates that finding and merely continues into distance grading, which can emit nothing when the declaring commit is still the tip; the resulting ranked-plan item therefore directs the operator to a nonexistent companion error. Use current-bundle-specific action text or make the shared wording conditional.
AGENTS.md reference: AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Taken. It is a real misdirection rather than a wording nicety, and the case that proves it is the quiet one you identified.
_SPENT_REFUSED_ACTION tells the reader that the superseded-and-never-published finding "stands beside this one". That is true of every other refusal and false in this arm: it creates no such finding, it falls through to the distance grading, and where the declaring commit is still the published tip that grading emits nothing — so the refusal is the only row in the report and the operator was pointed at an error that exists nowhere.
Fixed in 95c11696 with a fifth action constant rather than conditional wording, which keeps every action a module-level constant the way this family's other four are:
_SPENT_CURRENT_ACTION = (
f"withdraw the SPENT declaration in {CHANGELOG} — it names the bundle "
f"{MANIFEST} still DECLARES, which asserts two incompatible things about "
f"one number; this bundle's own tag obligation is unchanged and is graded "
f"by landing distance exactly as it was before the declaration was written")test_the_current_bundle_refusal_promises_no_companion_finding builds precisely your zero-distance case — the declaration lands in the declaring commit, so the distance arm is silent — and asserts the refusal is the only finding, that its action is the new constant, and that "stands beside this one" does not appear in it. The pre-existing current-bundle test now also asserts the action, so the two cannot drift apart.
…not promise a companion Both findings TAKEN, and the first was found on the fix for the first round's P1 — which is the useful kind of second look. CODEX P1 — `\b` IS NOT A COMPLETE-TOKEN TEST. It matches between `0` and `.`, so the entry-heading pattern accepted a PREFIX of a longer name. Measured before fixing: '## contract-v3.0.1' -> entry = contract-v3.0 (wrong) '## contract-v3.0-notes' -> entry = contract-v3.0 (wrong) A declaration below either would have been contained by an entry that is not the one it names, so the containment guard was still walkable one step over from where round 1 closed it. The pattern now demands whitespace or end-of-line after the version token, so the capture is the WHOLE bundle name. AND THE NEAR MISS THAT IS NOT A DEFECT IS PINNED TOO, so a later reader does not "fix" it: `## contract-v3.01` is a well-formed bundle name — major 3, minor 01 — and legitimately opens an entry. It is refused for the right reason, which is that the entry names a DIFFERENT bundle. CODEX P2 — THE CURRENT-BUNDLE REFUSAL PROMISED A COMPANION FINDING THAT DOES NOT EXIST. It reused `_SPENT_REFUSED_ACTION`, whose text tells the reader the superseded-and-never-published finding "stands beside this one". True of every other refusal; false in this arm, which creates no such finding and falls through to distance grading — and where the declaring commit is still the tip that grading emits NOTHING, so the refusal is the only row in the report and the operator was directed at a nonexistent error. A fifth action constant, `_SPENT_CURRENT_ACTION`, says withdraw the declaration and says the bundle's own obligation is unchanged. The test that proves it uses exactly the quiet case: the declaration lands IN the declaring commit, distance is zero, and the refusal is asserted to be the only finding. COPILOT — a docstring opening `""` immediately after its own three quotes read like a typo. It was legal Python and it did read like one; the requirement's quoted sentence is paraphrased instead of reproduced. 55 passed, 1 deselected. This repository's own declaration re-verified against the tightened pattern: entry contract-v3.0, no refusal. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Round 3 — both of Codex's round-2 findings TAKEN, on head
|
There was a problem hiding this comment.
🟡 Changes recommended
check_repo() now hard-requires reading contracts/CHANGELOG.md even for legacy declared bundles below the enforcement floor, which can introduce new Skip outcomes and unnecessary blob reads for out-of-scope repositories.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 19/19 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95c1169649
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # outside its successor's entry — which is the guard, not a detail of it. | ||
| # `(?!#)` keeps a `### subsection` from closing the entry it lives inside, | ||
| # which matters because the reserved line is written INSIDE one. | ||
| _LEVEL_TWO_HEADING = re.compile(r"^##(?!#)\s") |
There was a problem hiding this comment.
Close entries when a level-one heading starts
Fresh containment case after the level-two fix: with ## contract-v3.0, then # Notes, then an otherwise valid declaration, read_spent_declarations() still returns entry == "contract-v3.0" because this matcher notices only ##. A level-one heading closes the preceding level-two section, so spent_refusal() accepts a declaration that is outside the successor entry; once the successor tag is valid, this replaces the genuine superseded error with a spent info. Reset the entry on every Markdown heading that structurally closes an H2 while preserving H3+ subsections.
AGENTS.md reference: AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Taken. Third round on the same guard, and each round closed it one step further out — that progression is worth recording, not just the fix. Measured before fixing:
## contract-v3.0 — a release entry
# Notes
**SPENT BUNDLE:** `contract-v2.6` — SUPERSEDED BY `contract-v3.0` — …
entry read as: contract-v3.0
refusal : None <-- ACCEPTED
Fixed in 4d90ff76, exactly as you framed it — reset on every heading that structurally closes an H2, while preserving H3+:
_CLOSES_ENTRY = re.compile(r"^#{1,2}(?!#)\s")The H3+ exclusion is load-bearing in the other direction: this repository's reserved line lives inside the ### `contract-v2.6` disposition subsection of the v3.0 entry, so a rule that closed on ### would refuse the real record.
And the whole rule is now one table, because it has moved three times and every move was a defect:
heading after ## contract-v2.9 |
entry reads |
|---|---|
# Notes |
None |
## Notes |
None |
## contract-v3.0 — x |
contract-v3.0 |
## contract-v3.0 |
contract-v3.0 |
## contract-v3.0.1 |
None |
### `contract-v2.6` disposition |
contract-v2.9 |
#### deeper |
contract-v2.9 |
#hashtag |
contract-v2.9 |
The base entry is contract-v2.9 rather than contract-v3.0 on purpose: with one name for both, "closed" and "closed and reopened as a different bundle" are indistinguishable — which is how the first two escapes survived their own tests. Live declaration re-verified: entry: contract-v3.0, refusal: None.
… entry, and a legacy repo stays silent CODEX P1 (THIRD ROUND, AND THE THIRD TIME ON THE SAME GUARD — each round closed the hole one step further out, which is the pattern worth recording). An H1 structurally ends the H2 section above it, and a matcher watching only `##` does not notice. Measured before fixing, with `## contract-v3.0` then `# Notes` then a valid declaration: entry read as: contract-v3.0 refusal : None -> ACCEPTED so a declaration outside its successor's entry would have replaced the genuine superseded error with an `info`. `_CLOSES_ENTRY` now matches H1 AND H2 and excludes H3+, which is load-bearing in both directions: the reserved line lives inside a `###` disposition subsection of its entry, so a rule closing on `###` would refuse the real record. AND THE WHOLE RULE IS NOW ONE TABLE, because it has moved three times and every move was a defect. The table's base entry is `contract-v2.9` so that "closed" and "closed and reopened as a different bundle" are distinguishable — a table using one name for both could not tell them apart, which is how the first two escapes survived their own tests. COPILOT (ROUND 3) — A REAL BEHAVIOUR REGRESSION, TAKEN, THOUGH NOT BY THE ROUTE PROPOSED. The changelog guard sat before the bundle loop, so a repository declaring `contract-v1.5` — which this family emits NOTHING about, by the enforcement-floor rule — began returning a SKIP merely because it keeps no changelog: silent to "not checked" over a record that could not have borne on its answer. The suggested short-circuit was "return early when `declared` is below the floor". Declined, with a reason: `cut_bundles` can hold a bundle ABOVE the floor while the manifest declares one below it, and an early return would then stop checking a bundle that IS in scope. Instead the GUARD is deferred to the ABSENT arm — exactly where a declaration changes what is emitted. A below-floor bundle never reaches it, so the legacy repo is silent again; an in-scope untagged bundle still skips rather than being accused of owing a tag it may have been legitimately relieved of. Both sides are pinned. 59 passed, 1 deselected. Live declaration re-verified: entry contract-v3.0, no refusal. doc-health delta unchanged at exactly one row. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
| gate | result |
|---|---|
openspec validate --all --strict |
84 passed, 0 failed — one fewer than before, because main archived a change; not this PR's doing |
proposal-support verify declare-spent-bundle-state |
ok |
validate-sequenced-after.py . |
passed — 31 active (was 32; the archive removed one), 1 declaring |
pytest tests/sequenced_after |
118 passed — the pin main moved is taken as-is; this PR still moves none |
pytest tests/doc-health/test_release_tag_publication.py |
64 passed, 1 failed — the self-gate, and nothing else |
verify-commit --commit HEAD |
exactly two members, unchanged: contracts/CHANGELOG.md (this PR, editorial) and docs/contract-versioning-policy.md (inherited from #577) |
verify-tag --remote origin --tag contract-v3.0 |
pass — the published bundle still verifies at ff9ed815; this PR does not touch it |
The --single-repo doc-health before/after is being re-measured against the new base and will be posted with the final numbers.
|
@codex review |
There was a problem hiding this comment.
🔵 Needs a closer look
It changes core doc-health release governance logic and relies on a merge-time published-tip effect (including an expected pre-merge failing self-gate), which warrants final human verification.
Review details
- Files reviewed: 19/19 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 422def1a06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # excluded because the reserved line is written INSIDE a `###` disposition | ||
| # subsection of its release entry, which is where this repository's own | ||
| # declaration lives. | ||
| _CLOSES_ENTRY = re.compile(r"^ {0,3}#{1,2}(?!#)\s") |
There was a problem hiding this comment.
Treat empty ATX headings as entry boundaries
When ## contract-v3.0 is followed by an empty # or ## heading and then a SPENT declaration, the empty ATX heading legally closes the release section, but this regex requires trailing whitespace and leaves entry set to contract-v3.0. spent_refusal() therefore accepts a declaration outside its successor's entry, allowing it to suppress the genuine superseded-bundle error. Match end-of-line as well as whitespace after the heading markers.
AGENTS.md reference: AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
| findings.append(_finding( | ||
| WARNING, repo, |
There was a problem hiding this comment.
Exclude below-floor subjects from the orphan sweep
When a repository contains a SPENT declaration for a never-cut bundle below contract-v1.7 (for example, contract-v1.4), this unconditional orphan arm emits a warning even if every bundle in the repository is below the enforcement floor. That contradicts the documented requirement that the family emit nothing for below-floor bundles; the existing floor check applies only to the main bundle loop and never filters declarations here.
AGENTS.md reference: AGENTS.md:L9-L10
Useful? React with 👍 / 👎.
… a FALSE GREEN main advanced to 3bcde7e under this branch, so every measurement that named f4fddf7 as its base was re-taken against the new one rather than carried forward. The doc-health delta is IDENTICAL: exactly one new ranked-plan row, the release-inventory-drift `info` on contracts/CHANGELOG.md labelled "editorial member — expected between cuts". family-enumeration silent; modified-block-currency's gate arms unmoved at 0 and 8. AND ONE RUN IS RECORDED AS A FALSE GREEN, BECAUSE IT WAS ONE. A `pytest tests/doc-health` at 32c215e read 1430 passed with ZERO failures, including the self-gate. That was not the declaration working: origin/main had moved and this checkout had not fetched it, so `blobs_at` could not read contracts/manifest.yaml at that tip and the family returned the SKIP the self-gate explicitly tolerates as "an environment fact, not a corpus fact". With the tip fetched the self-gate fails again, correctly. Banking that green would have been the #338 conflation wearing the other hat — this family's whole guard vocabulary exists because "I could not read it" and "there is nothing there" arrive identically — so it is written down as a near miss rather than deleted. It is also the reason the post-merge claim is proved against a bare repository whose main really does carry the declaration, instead of against a checkout whose origin happens not to have moved. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces a new state machine and parsing/validation path into a core doc-health family and should receive final human review despite strong test coverage.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/doc_health/release_tag_publication.py:320
- Avoid using an explicit line-continuation backslash in this conditional expression; it’s the only backslash continuation in the module and is easy to break/format inconsistently. Wrap the conditional in parentheses instead (or put it on one line) to keep formatting stable and clearer.
- Files reviewed: 19/19 changed files
- Comments generated: 0 new
- Review effort level: Lite
The body is the deliverable a reader meets first, so its committed copy is kept in step rather than left at the shape it had before the last two rounds: the five-round review table, the one refusal with its measurement, the fence extension flagged as a judgment, the catch-up merge, and the false green. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
check_repo()’s Skip message for a failed combined blobs_at read is now misleading (it references only the manifest even though the changelog is also part of the read).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 19/19 changed files
- Comments generated: 1
- Review effort level: Lite
The combined `blobs_at(tip, [MANIFEST, CHANGELOG])` failing as a whole reported "version control could not be consulted for contracts/manifest.yaml" — naming one member of a two-member read. `blobs_at` collapses to None ONLY when git itself failed, which fails the whole batch rather than one path, so the message sent an operator to look at one file when neither had been obtained. It now names both and says the batch failed as a whole. The distinction that makes this precise, and it is why the message is worth getting right: a PER-PATH failure is the other return shape entirely — None for that key with the call succeeding — and each key already has its own guard with its own words. Conflating the two is the #338 class in miniature, one layer below where this family usually meets it. 65 passed, 1 deselected. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Round 5 closed — Copilot's finding taken, head
|
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
🔵 Needs a closer look
It makes substantial logic changes to a critical doc-health family’s published-tip evaluation behavior, and should receive final human review despite strong test coverage.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/doc_health/release_tag_publication.py:378
- In
_parse_spent_line, theif subject is None: missing.append("spent bundle")branch is unreachable because allsubject is Nonecases return earlier (no subject match / empty backticks). Leaving dead code here makes the missing-element logic harder to reason about and can mislead future edits into thinkingsubjectmay still be None at this point.
- Files reviewed: 19/19 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
HELD FOR THE OWNER'S DISPOSITION — DO NOT CLOSE OR MERGE. (lane openxfactory-1d, 2026-09-02 ~17:00Z) The same ratified change was realized and admin-merged as PR #587 (squash A read-only comparison of |
Measured:
|
| # | finding (source) | on main? |
effect there |
|---|---|---|---|
| F1 | non-release ## heading does not close the entry (Codex R1 P1) |
YES | declaration wrongly ACCEPTED |
| F2 | no complete-token test: ## contract-v3.0.1 opens v3.0's entry (Codex R2 P1) |
YES | wrongly ACCEPTED |
| F7 | level-one heading does not close the entry (Codex R3 P1) | YES | wrongly ACCEPTED |
| F9a | heading inside a code fence reopens an entry (Codex R4 P1) | YES — main documents "NO FENCE TRACKING, deliberately" | wrongly ACCEPTED |
| F9b | indented ATX heading missed (Codex R4 P1) | YES | wrongly ACCEPTED |
| L2 | Setext headings do not close (Codex, late) | YES — and also on this PR's head | wrongly ACCEPTED |
| L3 | empty ATX heading not a boundary (Codex, late) | YES — and also on this PR's head | wrongly ACCEPTED |
| F8 | below-floor repo with no changelog now SKIPS (Copilot R3) | YES — guard sits above parse_bundle |
silent "not checked" |
| F11 | batch-read skip names only the manifest (Copilot R5) | YES | misleading skip |
| L4 | below-floor subject raises an orphan warning (Codex, late) | YES — and also on this PR's head | spurious warning |
| F3 | current-bundle refusal promises a nonexistent companion (Codex R2 P2) | no | main phrases it conditionally |
| F10 | orphan sweep loses the read-failure skip (Codex R4 P1) | no | main's guard is unconditional and early |
| F12/F13 | empty-backtick None; RULED BYE read as a ruling (self-review) |
no | main computes the reason in _declaration_state |
Seven measured escapes let a declaration be ACCEPTED from outside its superseding bundle's entry on main — each accept suppresses the superseded-and-never-published error, the finding the family exists to raise. This PR fixes F1/F2/F7/F9a/F9b/F8/F11; L2/L3/L4 are unfixed in both. This PR also carries the Speckit specs/027-spent-bundle-state/ feature (the packet required one) and 66 vs 46 family tests.
Two corrections to this PR's own record: Codex gave NO verdict on 8106f204 — its 16:29Z reply was a provider non-review — so the round-5 comment's "no provider refusal occurred" is wrong. And the family-file test count is 66 (65 passed + 1 deselected), not the 69/70 published in test-counts.md and the round-5 comment.
Recommendation to the owner (not acted on): re-scope this PR into a HARDENING PR on top of main — one commit that resets the entry on every structural boundary (ATX H1/H2 with ≤3 leading spaces, complete version token, Setext, empty headings), decides the fence question explicitly, moves the changelog guard to in-scope-ness, and excludes below-floor subjects from the orphan sweep — rather than close it and discard measured repairs to a fail-closed check. Brett Heap decides.
|
Lane: openxfactory-1d |
|
Lane: openxfactory-1d CLOSED AS RE-SCOPED, on Brett Heap's word of 2026-09-02 ("harden 584") — the successor is #589Its realization half landed as #587 (squash Its review half lives on in #589 — #589 — as a hardening PR on top of
The branch For the record of what the rounds were worth: five Codex P1s on one guard, each found on the fix for the last. That is the shape of a rule scattered across one regex and one |
…loses
Codex P1 — a fence-shaped line inside a RAW HTML BLOCK is HTML content, and
treating it as a delimiter put the reader one fence out of phase for the third
time by a third route. Measured ACCEPTED for all eight CommonMark kinds that can
hold such a line: <pre>, <script>, <!--, <?, <!DOCTYPE, <![CDATA[, <div>, and
any complete tag alone on its line.
ONE STATE MACHINE decides both regions, not two side by side, and that is
load-bearing: a fenced block and a raw HTML block are mutually exclusive in
CommonMark — a fence-shaped line inside an HTML block is content, an HTML opener
inside a fence is code — so two machines would each be wrong about the other's
region. Both directions are pinned.
OVER-APPROXIMATION IS ITS OWN ESCAPE, in the same silent direction, and that is
the hole this fix could open: prose read as HTML content would make a region
opaque, swallow a real `## Notes` boundary, and leave a declaration holding an
entry it is not inside. So kind 6 is CommonMark's own tag list and nothing
wider, kind 7 demands a complete tag and may not interrupt a paragraph, and
`<not a tag` opens nothing. Five rows pin that direction, plus the kind-6/7
asymmetry, plus the case where over-closing would refuse a correctly contained
declaration.
AND THE CLASS TERMINATES HERE. A phase error needs a line the reader calls a
fence delimiter and CommonMark does not, at column 0-3. Every construct that can
hold one is now accounted for: another fence (this machine's state), a raw HTML
block (these eight kinds), an indented code block (content at column 4+, which
every `^ {0,3}` here excludes), and a block quote or list item (content carries
its marker, and a fence cannot be lazily continued). The reverse error — missing
a real fence at column 0-3 — cannot happen either, because `_fence_opener` now
rejects exactly what CommonMark rejects there.
Copilot — the carried evidence transcripts published PR #584's gate counts
unmarked, so the evidence set read as internally inconsistent (85 vs 84 openspec
items, 32 vs 31 active changes). Each carried transcript now names its BASE in a
provenance banner, with a table of the three readings that differ by base rather
than by disagreement, and points at this branch's own gates. Kept unedited
otherwise, because a transcript that gets rewritten stops being one.
Family file 94 -> 110; `tests/doc-health` 1459 -> 1475 passed, zero failures.
Lane: openxfactory-1d
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Codex P2 — a below-floor SUBJECT left only the orphan branch of the refusal sweep and then continued through the rest of the ladder. Measured: a legacy repository declaring `contract-v1.6` and naming it spent emitted a `live-bundle` error, and malformed and wrong-entry below-floor declarations emitted theirs — each on an inventory path for a bundle this family does not grade. The enforcement floor says the family reports NOTHING about a bundle under contract-v1.7, so such a declaration disposes nothing whatever its shape and now leaves the whole sweep. This also makes the floor rule ONE rule with F8's: a repository with nothing in scope is answered exactly as it always was. THE HOLE THE EXCLUSION COULD OPEN IS PINNED IN BOTH DIRECTIONS. `_below_floor` is false for a name of the wrong SHAPE and for no name at all, and that gap is the distinction: `contract-v1.3` is an out-of-scope NAME and leaves the sweep, while `not-a-bundle` and a line carrying the reserved opener and nothing else are DEFECTS and stay in it. Copilot — the carried quickstart could not run. It was written against PR #584's reader (`read_spent_declarations`, `spent_refusal`, `SpentDeclaration.ruling`/ `defect`/`count`), none of which exists in the implementation that landed. A quickstart that cannot run is worse than none because it looks like a reference, so it is rewritten against the real module with EVERY BLOCK RUN AND ITS OUTPUT PASTED, and it gains a fifth block showing the containment rule as a table of seven placements. Two stale claims go with it: the declaration is at changelog line 389, not 374, and this branch carries no declared red. Family file 117 -> 121. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]>
…loses an entry, fences are opaque, and the floor holds (#589) * Harden the SPENT-state containment guard: every structural boundary closes an entry, fences are opaque, and the floor holds The containment rule is the guard `declare-spent-bundle-state` leans on hardest — a declaration is accepted only where the changelog entry CONTAINING it is the entry of the bundle it names as superseding — and every way of closing an entry the reader does not know about is an ACCEPT: the declaration keeps the previous release entry's authority and quiets the superseded-and-never-published `error` the family exists to raise. Ten escapes were measured against main's reader before a line was written, each probed through main's own functions rather than inferred (F1 a non-release `##` heading; F2 an incomplete version token; F7 a level-one heading; F9a a heading inside a code fence; F9b an indented ATX heading; L2 Setext headings; L3 an empty ATX heading; F8 a below-floor repository with no changelog now skipped entirely; F11 a batch-read skip naming one of two members; L4 a spurious orphan warning on a below-floor subject). Seven of the ten let a declaration be accepted from outside its superseding bundle's entry. The rule now passes through ONE structural-boundary function rather than one regex a reader has to re-derive, and is pinned as ONE parametrized table carrying the stays-open rows beside the closes rows — so the next shape of heading somebody invents is a row rather than a round. Fenced blocks are declared OPAQUE to headings and to the reserved opener alike, which is fail-closed both ways: an example inside a fence cannot spend a bundle, and a declaration hidden in one does not count, leaving the `error` standing. The changelog guard moves below `parse_bundle` and is gated on in-scope-ness, so a repository with no bundle at or above the enforcement floor is answered as it always was. Over-closing is the fail-closed error and under-closing is not, which picks every judgment here — but a rule tightened past the live document would refuse the declaration that makes main green, so the live read is a test: it reads `contracts/CHANGELOG.md` from disk, pins `entry == contract-v3.0`, and carries a spliced-heading control over the same bytes. Family file 46 -> 73 tests; `tests/doc-health` 1411 -> 1438 passed, zero failures on both sides. doc-health `--single-repo` over the live corpus: 54 findings before and after, the two finding lists BYTE-IDENTICAL. Re-scopes #584, whose realization half landed as #587 (`3fa222f3`); its Speckit feature `specs/027-spent-bundle-state/` is carried and re-framed, with `evidence/hardening-red-first.md` measuring each escape before and after. `contracts/CHANGELOG.md`, `contracts/manifest.yaml`, `contracts/releases/*`, `docs/contract-versioning-policy.md` and `health/dispositions.yaml` are untouched. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Record the containment hardening under the packet's § 2.3, ticking nothing The ladder is #587's and its box stays as #587 left it. One dated line names PR #589, the ten escapes it measured against main's reader, and the seven that let a declaration be accepted from outside its superseding bundle's entry — so the packet's record says what was hardened over it rather than leaving the repair discoverable only from a PR conversation. Group 5's archive is not this PR's. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take round 1: a fence opener out of phase is worse than no fence tracking Codex P1 — a backtick fence whose info string carries a backtick opens no CommonMark fence, so the reader ran ONE FENCE OUT OF PHASE with the document: the next bare fence closed its fictitious block while opening a real one, every boundary between them was swallowed as code, and a declaration inside the real block was read as a record. Measured: read AND accepted, from under a `## Notes` heading, inside a code block — both halves of the containment rule defeated by one line. The opener splits in two because the rule is not shared: a backtick fence's info string may not contain a backtick, a tilde fence's may. The test carries controls on both sides, a one-sided fix stopping tilde fences from opening at all. Codex P2 — a run of dashes below a thematic break was read as a Setext underline, refusing a correctly contained declaration. Taken for that shape, which CommonMark is unambiguous about, plus a Setext underline as the preceding line. The broader ask is refused with a measurement: every block form added to the exclusion list moves the reader toward UNDER-closing, whose failure is silence about the finding this family exists to raise, where over-closing's failure is one error standing beside the superseded error and quieting nothing — and indented code is the case against a blanket exclusion, since an indented line cannot interrupt a paragraph and the dashes below it genuinely are an underline. The residue is stated in `_setext_content`'s docstring. Copilot — the live-read test's `len(read) == 1` reds for the wrong reason the day a second number is spent. The declaration is looked up by subject now, and the anti-over-read half the count was standing in for is stated properly: the reserved form spliced INSIDE the live document's own fenced block must add no declaration. Neither shape exists in the live changelog — zero thematic breaks, zero backtick fence lines CommonMark would decline to open — so both were latent, and are recorded as latent rather than banked as harmless. Family file 73 -> 76; `tests/doc-health` 1438 -> 1441 passed, zero failures. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take round 2: ask what the previous line DID, not what it looks like Codex P1 — a hole round 1's own fix opened, and the third time on this guard that a fix has been the next finding's cause. That fix excluded any line MATCHING the underline pattern; in `## contract-v3.0` / `===` / `---` the `===` matches while acting as nothing — no paragraph precedes it, so CommonMark makes it paragraph text and the `---` below it a real Setext H2. Excluding it by syntax lost the boundary and the entry stayed open. Measured: ACCEPTED. The repair is structural rather than another exclusion. `_setext_content` is gone; `_paragraph_line(line, closes, opaque)` takes the boundary decision the caller already made, and the loop carries a boolean forward instead of the previous line's text — so `_entry_boundary(line, after_paragraph, in_fence)` cannot be handed a syntax question in place of a state one. An underline that really underlined sets `closes` and ends the paragraph; one that only looked like an underline does not. All five Setext-family shapes are now measured together rather than one at a time, which is what the previous two rounds each failed to do. Copilot — the live-corpus anti-over-read guard was VACUOUS. It spliced at a byte offset into the fence opener line, so the reserved opener landed after ```y and was unreadable for a reason that had nothing to do with fences; the assertion passed whatever the fence rule did. Spliced as a real line at the start of the fenced content now, and the non-vacuity is itself asserted: the same line with the fence opener removed MUST be read. That assertion is the one that would have caught this, and it fails loudly for any future splice landing somewhere unreadable. Family file 76 -> 78; `tests/doc-health` 1441 -> 1443 passed, zero failures. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take round 3: an ATX marker is followed by a space or a tab, not by \s Codex P1 — Python's `\s` matches U+00A0 and the other Unicode spaces, while CommonMark's ATX opening sequence admits only a space, a tab or end of line. A `##<U+00A0>contract-v3.0` line is paragraph text to every renderer and opened a FICTITIOUS entry here; measured with a base entry of contract-v2.9 so that "opened a fictitious entry" and "closed the real one" are distinguishable, a declaration below it was ACCEPTED under a heading that does not exist. Fixed in all three patterns and in both space classes of the entry heading — the separator after `##`, and the one after the version token so a name followed by U+00A0 is not read as a complete token. THE REGRESSION TESTS AIM AT THE HOLE THIS FIX COULD OPEN, not only at the one it closes. Narrowing `\s` invites narrowing it too far, so a TAB separator is a row of its own and must still OPEN, and a tab-separated H1 must still CLOSE. And one hole the fix opened in the TEST rather than the code, closed with it: three rows turn on a literal U+00A0, which an editor or a formatter can normalise to an ordinary space — after which they would pass for the wrong reason, exercising a plain heading and proving nothing. Written against a named NBSP constant now, because an escape cannot be normalised silently. Latent, not live: the changelog carries zero ATX lines using non-space/tab whitespace. Family file 78 -> 83; `tests/doc-health` 1443 -> 1448 passed, zero failures. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take round 4: split on CommonMark's line endings, not on Python's Codex P1 — round 1's class one layer down, in the line splitter rather than in the opener pattern. `str.splitlines()` breaks on eight separators CommonMark does not, so an INVALID backtick opener like ```bad<U+2028>`info — one line to CommonMark, its info string carrying a backtick — reached the reader as a VALID opener plus content. One fence out of phase again: the `## Notes` boundary swallowed as code, the next bare fence closing the fictitious block while opening a real one, and the declaration inside the real block read under the earlier entry. Measured ACCEPTED for all eight of U+2028, U+2029, U+0085, VT, FF, FS, GS and RS. Now split on `\r\n|\r|\n` and nothing else. THE CONTROL IS AIMED AT THE HOLE THIS FIX OPENS, which on this guard is not hypothetical: narrowing the splitter invites narrowing it to `\n` alone, and a CRLF document would carry a stray `\r` at the end of every line — defeating the fence closer's `[ \t]*$`, the ATX lookahead's `[ \t]|$` and the Setext underline's anchor all at once and silently. LF, CRLF and lone CR are each pinned in BOTH directions, because a splitter that broke only the reading half would look correct from the accepting half. `_lines` drops a single trailing empty element so a document ending in a newline keeps the line count a human repairing a declaration would count. The eight separators are named in a table rather than typed as literals, for the reason NBSP was named in round 3; the test file now carries zero literal exotic characters, checked. Latent, not live: the changelog carries none of the eight. Family file 83 -> 94; `tests/doc-health` 1448 -> 1459 passed, zero failures. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take round 5: one opaque-region machine, and the out-of-phase class closes Codex P1 — a fence-shaped line inside a RAW HTML BLOCK is HTML content, and treating it as a delimiter put the reader one fence out of phase for the third time by a third route. Measured ACCEPTED for all eight CommonMark kinds that can hold such a line: <pre>, <script>, <!--, <?, <!DOCTYPE, <![CDATA[, <div>, and any complete tag alone on its line. ONE STATE MACHINE decides both regions, not two side by side, and that is load-bearing: a fenced block and a raw HTML block are mutually exclusive in CommonMark — a fence-shaped line inside an HTML block is content, an HTML opener inside a fence is code — so two machines would each be wrong about the other's region. Both directions are pinned. OVER-APPROXIMATION IS ITS OWN ESCAPE, in the same silent direction, and that is the hole this fix could open: prose read as HTML content would make a region opaque, swallow a real `## Notes` boundary, and leave a declaration holding an entry it is not inside. So kind 6 is CommonMark's own tag list and nothing wider, kind 7 demands a complete tag and may not interrupt a paragraph, and `<not a tag` opens nothing. Five rows pin that direction, plus the kind-6/7 asymmetry, plus the case where over-closing would refuse a correctly contained declaration. AND THE CLASS TERMINATES HERE. A phase error needs a line the reader calls a fence delimiter and CommonMark does not, at column 0-3. Every construct that can hold one is now accounted for: another fence (this machine's state), a raw HTML block (these eight kinds), an indented code block (content at column 4+, which every `^ {0,3}` here excludes), and a block quote or list item (content carries its marker, and a fence cannot be lazily continued). The reverse error — missing a real fence at column 0-3 — cannot happen either, because `_fence_opener` now rejects exactly what CommonMark rejects there. Copilot — the carried evidence transcripts published PR #584's gate counts unmarked, so the evidence set read as internally inconsistent (85 vs 84 openspec items, 32 vs 31 active changes). Each carried transcript now names its BASE in a provenance banner, with a table of the three readings that differ by base rather than by disagreement, and points at this branch's own gates. Kept unedited otherwise, because a transcript that gets rewritten stops being one. Family file 94 -> 110; `tests/doc-health` 1459 -> 1475 passed, zero failures. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take round 6: an HTML block ends on its own line and on its own tag Both findings are holes ROUND 5's fix opened, and both bots found both independently within twenty-five minutes — two reviewers agreeing on a precise mechanism being a much stronger signal than either alone. A kind 1 to 5 block may open AND close on ONE line. Returning the new state without testing that line kept the block open past its own close: measured, `<!-- first -->` stayed open THROUGH a real `## Notes` heading and used `<!-- second -->` as its delayed close, so the declaration kept the earlier entry and was ACCEPTED. Reproduced for comment, declaration, processing instruction, CDATA and <pre>. The opening line is now tested against its own end condition. And a kind-1 block ends on ITS OWN tag, not on any of the four. A shared closer let </script> end a <pre> block, after which lines CommonMark still reads as <pre> content stopped being opaque — a fence-shaped line there put the reader back out of phase and a declaration was ACCEPTED. The state carries the tag that opened the block. Both fixes ship with the control for the hole THEY could open: an unclosed <pre> runs to end of document, pinned along with why that is acceptable (every boundary after it is lost, but so is every declaration, so the superseded error stands rather than being quieted); and a boundary after a MISMATCHED closer is still content, so a declaration below the real </pre> is still inside the entry — over-closing there would refuse a correctly contained declaration. Family file 110 -> 117; `tests/doc-health` 1475 -> 1482 passed, zero failures. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take round 7's floor finding and Copilot's quickstart finding Codex P2 — a below-floor SUBJECT left only the orphan branch of the refusal sweep and then continued through the rest of the ladder. Measured: a legacy repository declaring `contract-v1.6` and naming it spent emitted a `live-bundle` error, and malformed and wrong-entry below-floor declarations emitted theirs — each on an inventory path for a bundle this family does not grade. The enforcement floor says the family reports NOTHING about a bundle under contract-v1.7, so such a declaration disposes nothing whatever its shape and now leaves the whole sweep. This also makes the floor rule ONE rule with F8's: a repository with nothing in scope is answered exactly as it always was. THE HOLE THE EXCLUSION COULD OPEN IS PINNED IN BOTH DIRECTIONS. `_below_floor` is false for a name of the wrong SHAPE and for no name at all, and that gap is the distinction: `contract-v1.3` is an out-of-scope NAME and leaves the sweep, while `not-a-bundle` and a line carrying the reserved opener and nothing else are DEFECTS and stay in it. Copilot — the carried quickstart could not run. It was written against PR #584's reader (`read_spent_declarations`, `spent_refusal`, `SpentDeclaration.ruling`/ `defect`/`count`), none of which exists in the implementation that landed. A quickstart that cannot run is worse than none because it looks like a reference, so it is rewritten against the real module with EVERY BLOCK RUN AND ITS OUTPUT PASTED, and it gains a fifth block showing the containment rule as a table of seven placements. Two stale claims go with it: the declaration is at changelog line 389, not 374, and this branch carries no declared red. Family file 117 -> 121. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * VARIANT A (DRAFT, unpushed): round 7's two HTML-pattern findings Codex round 7, taken in part and refused in part, both with measurements. TAKEN — CommonMark's whitespace class after a kind-1 tag name is space, tab, VT and FF, and `[ \t>]` missed the last two. That gap became reachable only when ROUND 4 stopped splitting lines on VT and FF, so it is round 4's own tail: `<pre<VT>x>` is an opener CommonMark recognizes, the fence-shaped line inside the block opened a fictitious fence, and the declaration below was ACCEPTED. Measured for both characters. The same class is widened in the kind-6 and kind-7 patterns for consistency. TAKEN — a kind-4 declaration needs an UPPERCASE letter. GFM (CommonMark 0.29, which is what renders this document on GitHub) says `<!` followed by an uppercase ASCII letter; CommonMark 0.30 later relaxed it. Accepting `<!doctype` made this reader MORE OPAQUE than the renderer, so a real `## Notes` was swallowed and the declaration below kept an entry it is not inside. The control for the hole this narrowing could open ships with it: uppercase must still open. REFUSED, with the measurement — U+00A0 is NOT CommonMark whitespace (the spec's whitespace character is space, tab, newline, VT, FF or CR), so `<pre<U+00A0>x>` is not a kind-1 opener and the lines below it are ordinary prose. A reader that treated it as one would be MORE OPAQUE THAN ANY RENDERER, which is the under-closing direction this guard exists to close. The reader's current answer for that line is already the CommonMark-correct one, and it is now pinned as such rather than left to be re-found. Family file 121 -> 127. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Revert round 6's matching-closer rule: it was an escape, not a fix CommonMark's end condition for a kind-1 HTML block reads, in words: "line contains an end tag </script>, </pre>, </style>, or </textarea> (case-insensitive; IT NEED NOT MATCH THE START TAG)". Round 6 shipped the opposite. Codex and Copilot INDEPENDENTLY asked for a matching closer, twenty-five minutes apart, and their agreement was recorded as corroboration. Both were wrong on the specification, and the fix they asked for INTRODUCED the escape class it claimed to close: requiring </pre> made this reader MORE OPAQUE than CommonMark, so a real `## Notes` heading after a `</script>` was swallowed and the declaration below it was ACCEPTED under an entry it is not inside. Measured at the pushed head: entry='contract-v3.0'. After this revert: entry=None, refused, and the superseded error stands. It surfaced under a DIFFERENTIAL against a reference CommonMark implementation over the 31 constructs this branch has touched — not from a bot round. Both bots had reviewed the wrong fix on two later heads and neither retracted it. Bot agreement is not evidence about a specification. The differential's other two disagreements are not defects: `###` not closing an entry is deliberate and load-bearing (the live declaration sits inside one), and `<pre<U+00A0>x>` is a case where markdown-it and cmark-gfm disagree with each other — this reader follows the spec letter and GitHub's renderer, and the direction is over-closing rather than an accept. The instrument itself needed fixing first, and that is recorded: the first harness invented five of the six disagreements it reported, and two probe files had literal U+00A0 and U+2028 normalised to plain spaces on write — the round-3 lesson arriving again, in the probes rather than the tests. Family file 127 (net: one test replaced by one that asserts the spec's rule over all sixteen opener/closer pairs). Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take Copilot's naming nit: commonmark, not commonmarks The neighbouring test reads `..._commonmark_does_recognise_still_work`, and one possessive out of step makes grep and failure output inconsistent for no reason. Rename only; no behaviour. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Rule B: the reader refuses raw HTML instead of parsing it — one contested error, nothing read below the opener RULED BY BRETT HEAP, 2026-09-03, on PR #589: *"VARIANT B — fail closed on raw HTML. The reader parses NO raw-HTML blocks. Fenced code stays the ONLY opaque region. A top-level raw-HTML block opener in `contracts/CHANGELOG.md` (any CommonMark kind 1-7 start condition, at <=3 leading spaces, outside a fence) makes the family emit ONE `contested` `error` on the changelog naming the line, read NO declaration below that line, and leave declarations ABOVE it standing; the superseded-and-never-published `error` for any bundle whose declaration was below the opener stands beside it."* WHAT IT DECIDES BETWEEN. Rounds 5 to 8 tried to MODEL CommonMark's raw HTML blocks, because a ```-shaped line inside one is HTML content and a reader that calls it a fence delimiter runs one fence out of phase with the document. Each fix produced the next finding — the single-line block, the mismatched kind-1 closer, the opener's whitespace class, the case of the kind-4 letter — and then a differential against a reference CommonMark implementation found that round 6's fix, which BOTH bots had asked for independently and neither retracted, had itself introduced a live containment escape. Fidelity here means a Markdown block parser inside a doc-health family, which is a change with a proposal and not a line in a review round. WHY REFUSING IS STRONGER THAN PARSING. A construct the reader cannot parse can never quiet the superseded-and-never-published `error`, whatever a renderer makes of the lines below it — fail-closed BY CONSTRUCTION rather than by fidelity, needing no oracle outside the review loop to stay true. The error direction inverts with it: under the fidelity reading a line of prose mistaken for HTML swallowed a boundary SILENTLY; here an over-recognized line produces a VISIBLE error an author repairs by moving one line. SO TWO NARROWINGS THIS BRANCH HAD ALREADY MADE ARE REVERSED, deliberately and on the record. Kind 4 admits any ASCII letter again (CommonMark 0.30's rule, a superset of GFM 0.29's uppercase-only, written as an explicit class rather than left to the `re.I` flag), and kind 7 is no longer gated on whether a paragraph is open. Both were right while over-opacity was the danger; both are the unsafe direction now, because an opener this reader fails to recognize is one it reads PAST. The patterns stay CommonMark's wherever CommonMark is unambiguous — a finding a reader cannot predict is its own defect. AND THE COST IS STATED RATHER THAN HIDDEN: three of the seven probe documents are ones a renderer reads as containing a valid, correctly contained declaration, and the family now declines to read them. `contracts/CHANGELOG.md` has never carried raw HTML and a live test asserts it, so the rule costs this estate nothing today and reds the day that changes. REMOVED — 11 test functions, 29 parametrized cases, of raw-HTML-fidelity behaviour, with the code they covered (`_HTML_TYPE1_OPEN`, `_HTML_OPENERS`, `_HTML_CLOSERS`, `_HTML_TYPE7`, `_html_opener`, `_html_closed`, `_opaque_state`): the eight-kind opacity table, the over-approximation table, the kind-6/kind-7 asymmetry, the declaration-inside-`<pre>` rule, the fence/HTML mutual exclusion, the single-line-block table, the sixteen-pair kind-1 closer rule, the unclosed-block-to-EOF trade, and round 7's three whitespace-and-case tests. `_fence_state` is restored, because fences are again the only region there is. ADDED — 7 test functions, 22 cases: a twelve-row opener table each row carrying its own control (the identical declaration WITHOUT the opener is accepted), a five-row not-an-opener table, the fenced-example rule, declarations-above-the- opener, the kind-7 widening, the reported `error` asserted in the ruling's own words with the superseded `error` beside it and no `info` anywhere, and a live check that this estate's changelog carries no raw HTML at all. Docs: plan.md gains decision record D7; evidence/hardening-red-first.md gains section L with the ruling verbatim, the seven-document before/after probe and the two reversed narrowings (lettered L because the differential took K); docs/doc-health.md gains one paragraph stating the fail-closed rule; the quickstart gains section 5 for the refusal, with every block re-run — and a rendering defect fixed in its own section 3, where a literal triple-backtick inside a fenced block closed that block early on GitHub. Family file 127 -> 120; `tests/doc-health` 1492 -> 1485 collected, 1485 passed, zero failures — 1411 (`main`) - 46 + 120. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take both of Copilot's round-10 findings: the ruling's date, and a doubled word in a user-facing skip BOTH TAKEN, and both are exactly the class of finding a bot is better at than the author of the diff. THE RULING DATE — the raw-HTML block comment in the reader, and the matching header in the test file, both carried 2026-09-02, which is the date of the `declare-spent-bundle-state` ratification and of the SPENT declaration's own `RULED BY` line, not of the variant-B ruling. The ruling is 2026-09-03. The comment is the justification a future reader will find first — plan.md § D7, evidence § L and the quickstart all say 2026-09-03, so this was the one place the archaeology would have gone wrong. THE DOUBLED "for" — this branch's own, not `main`'s. `main` reads *"a SPENT declaration could not be looked for — which is not the same fact as there being none"*; the batch-read repair added the bundles it declined to answer for and produced *"could not be looked for for contract-v2.0"*. It is USER-FACING skip text, so it reads as a typo rather than as a fact about a read. Rewritten to put the bundles where the sentence already had a slot: *"so a SPENT declaration for contract-v2.0 could not be looked for — which is not the same fact as there being none"*. The two existing assertions on this message are on the parts that carry meaning (the tip read, "not the same fact as there being none", and the bundle name), so the rule is unchanged and still pinned. `tests/doc-health` 1485 passed, zero failures; family file 120. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> * Take Copilot's round-11 finding: a blank line is spaces and tabs, not str.strip() `_paragraph_line` used `not line.strip()` to detect a blank line. `str.strip()` is Python's and strips every Unicode space; CommonMark's blank line is "a line containing no characters, or a line containing only spaces (U+0020) or tabs (U+0009)". MEASURED: a line holding only U+00A0 (also U+2028, VT, FF) is PARAGRAPH CONTENT to CommonMark, so a run of `=` below it is a Setext underline that CLOSES the entry; read as blank, the underline was not recognized, the entry never closed, and a declaration below it was ACCEPTED under an entry it is outside of — an UNDER-CLOSING escape, the direction this guard exists to close. New `_blank()` = `not line.strip(" \t")`; positive tests for U+00A0, U+2028, VT, FF alone and inside a paragraph; control that spaces/tabs are still blank. Evidence § M; quickstart block re-run. Gates at this commit: family 128 passed; tests/doc-health 1493 passed; sequenced_after 118 (33 active, no pin moved); openspec --all --strict 86/86; proposal-support verify ok; live declaration reads entry contract-v3.0. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LAWoydPqwc9TxqDb8bWcWy * Take Copilot's round-12 comments: the attribute token uses CommonMark's whitespace class, and the splice test uses the parser's line splitter The kind-7 unquoted attribute-value token in `_HTML_ATTR` was still `[^\s"'=<>` `]+`, Python's whitespace class, even though every other whitespace slot in the same pattern (the separator before an attribute name, and around `=`) had already been narrowed to CommonMark's `[ \t\v\f]` in an earlier round, and the comment above the pattern already claimed that class for the whole thing. Measured on head `c1b6eb3e` with a kind-7-only tag name (`div` is a kind-6 tag and matches on the name alone regardless, so it cannot exercise this): before: _HTML_OPENER.match('<mytag class=a\xa0b>') -> None after: _HTML_OPENER.match('<mytag class=a\xa0b>') -> a Match Direction, stated honestly against Copilot's "unsafe direction" framing: a missed opener does not make the reader ACCEPT anything. It just keeps reading the lines that follow as ordinary prose instead of stopping; if one of those lines is heading-shaped, the reader closes an entry on it the way it would for any other heading-shaped line, which can only move a real declaration OUT of the entry it belongs in — an over-closed FALSE REFUSAL, never an accept. So this is a consistency defect against the module's own stated whitespace rule, not a containment escape, and it is fixed for that reason regardless of which direction it fails in. Also switched the live-changelog splice test off `text.splitlines()` (which breaks on the same eight separators round 4 removed from the parser's own `_lines`) onto `rtp._lines(text)`, so the splice lands on a line boundary the parser actually recognizes. Added one parametrized test (7 cases) pinning the fixed token class: U+00A0 and U+2028 stay inside an unquoted value (kind-7 opener, recognized); a plain letter run is the control; a real space, tab, VT or FF splits the token, and a bare digit right after the split can never open a new attribute name, so the opener is refused. Gates: family file 135 passed (128 -> 135), tests/doc-health 1500 passed 0 failed (1493 -> 1500), tests/sequenced_after 118 passed. Catch-up merge of origin/main (3c237cd, update-standards-body-current- publications) included; family file re-run clean after the merge. Lane: openxfactory-1d Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LAWoydPqwc9TxqDb8bWcWy --------- Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: openRepoShape CI <[email protected]>
Realize
declare-spent-bundle-stateRealizes
openspec/changes/declare-spent-bundle-state§ 2 (boxes 2.1–2.9),ratified 2026-09-02 by Brett Heap in two acts over OD-3 and OD-4; record
review/ratification-2026-09-02.md; packet merged as PR #578, squashf4fddf7c, which is this branch's base. Spec Kit featurespecs/027-spent-bundle-state/— thepacket says group 2 is ONE Spec Kit feature and this is it.
Realizes #575's disposition. The issue stays open until the orchestrator
closes it with the green run id.
THE ONE THING TO READ FIRST:
pytest-suitereports exactly 1 failed, and it goes green at the squashpytest-suitereports exactly 1 failed —tests/doc-health/test_release_tag_publication.py::test_this_repository_reads_zero_and_the_probe_can_fire,which reads remote
main'scontracts/CHANGELOG.mdviagit ls-remote origin refs/heads/mainand cannot see this branch's declaration; every other testgreen; the failure set is byte-identical to
main's sinceff9ed815; itgoes green at the squash.
Measured on
09e28b3d, run 33641746085:main's own run atf4fddf7creads1 failed, 8620 passed, 21 skipped, 338 deselected— the same single failure,skippedidentical at theexactly-pinned 21, and
passed+32 for the tests this PR adds. The gate pinsSKIPPED exactly and SELECTED/PASSED as floors, so the additions raise the
floors and red nothing. The other three checks —
merge-master-approval,wallet-validation,signed-execution-chain-gate— pass. The run id onthe FINAL head is cited in the PR conversation.
That test is not edited — the packet requires it go green "as a
CONSEQUENCE" (2.9) — and the post-merge state is measured, not predicted:
a bare repository whose
mainIS this branch, cloned, with the uneditedself-gate run against it →
and the declaration then removed from that origin's
main→Full transcript:
evidence/post-merge-proof.md.maingoes green becausecontract-v2.6is EXPLICITLY DECLARED spent, andnever because an undeclared bundle started passing — which is what task 2.1
requires be verified rather than asserted.
The declaration, exactly as committed (2.1)
ONE line, into the EXISTING
### \contract-v2.6` disposition — DECLARED,NEVER VERIFIABLE, NEVER PUBLISHED, SUPERSEDED HERE
subsection under## contract-v3.0.contracts/CHANGELOG.md: **+2 insertions, −0 deletions**.contracts/manifest.yaml,contracts/releases/contract-v2.6.digests.yamland the## contract-v2.6` entry are untouched.contract-v3.0's tag was checked, not assumed:git ls-remote origin refs/tags/contract-v3.0→59f4f51f…peeling toff9ed815…, so the declaration lands in theinfoband and not OD-4'swarningband.The finding this buys, and its key
inforelease-tag-publicationcontracts/releases/contract-v2.6.digests.yaml('release-tag-publication', 'openxFactory', 'contracts/releases/contract-v2.6.digests.yaml')contestedRule text, as emitted over the real repository at the simulated post-merge tip:
The
errorit replaces held('release-tag-publication', 'openxFactory', 'contracts/manifest.yaml')andwas
auto-fixable, so its disappearance raises no uncited-resolution; the keythat replaces it is
contested, so its disappearance would.What landed, per box
read_spent_declarations(bytes) -> {bundle: SpentDeclaration}: one pure function, bytes in (the module's existing rule,because
blobs_atanswers raw blob bytes), parsing the reserved opener, thefour elements, and the containing
## contract-vX.Yentry. It REJECTSrather than skips: a line beginning with
**SPENT BUNDLE:**is adeclaration by construction, and one that does not complete the form comes
back carrying
missingordefect. Duplicates are counted, notcollapsed.
check_repo, in the ABSENT arm only andafter the
ok/lightweight/misplacedbranches, each of whichcontinues — so "the SPENT state reaches the ABSENT-tag arm and nothingelse" holds by construction rather than by care. Seven pure refusals in
order (duplicate, malformed, missing element, self-declaration, wrong
containing entry, successor never cut, successor not STRICTLY LATER) in
spent_refusal, then the one git question (is the successor published) incheck_repo, which is also the only place that can turn an unlistable refinto a
Skip.contracts/releases/<bundle>.digests.yaml(OD-5 as amended on Codex's P1:Finding.match_key()ignores rule text, so the manifest would share oneidentity with everything and the changelog would share one identity between
two spent bundles); the accepted
infoiscontested; the orphan-subjectwarningkeeps the changelog path, having no per-bundle inventory. Fournew action constants beside the module's existing four.
_findinggainedpath=MANIFESTas a default, so every pre-existing finding keeps itsidentity byte for byte.
in the SAME
blobs_atcall at the SAME tip; a blob it cannot read is aSKIP naming that read, never "no declaration" — the verify-tag conflates "not fetched locally" with "tag unreachable from main" #338 conflation one
document over, which this family has already been caught by once.
reader tests with no repository, ladder scenarios over real git fixtures, and
report-integration proofs). All 13 new scenarios covered, each with the
positive control the file's convention requires.
docs/doc-health.mdgains the third state, the reserved form, thethree outcomes, the path rule, the three action lines and the no-retrofit
rule. The family-count sentences are untouched — this change adds no
family — and
family-enumerationreportsNo findings.pytest tests/doc-health: 1420 passed, 1 failed at95c11696, the failurebeing the self-gate above and nothing else.
The red-first proof (2.1, 2.6)
Not a one-off measurement but the second half of a permanent test
(
test_a_superseded_bundle_declared_SPENT_with_a_published_successor_is_an_info):the same fixture, declaration removed, must return the superseded
erroroncontracts/manifest.yaml. Re-taken over the REAL repository inevidence/post-merge-proof.md§ B.And the order is recorded as taken, not as prescribed. The module and the
tests were authored in one pass, module first; the red was then demonstrated by
reverting the module against the landed tests, where not one of the 32 new
tests can even be COLLECTED (
AttributeError: module 'doc_health.release_tag_publication' has no attribute 'CHANGELOG'). That isweaker than a true test-first order and is disclosed rather than smoothed over:
evidence/red-log.md.The packet's § 4.1 baseline was re-taken rather than quoted in the same
worktree: 18 passed, 1 failed, the same test.
OQ-3 — PROVED, not inherited. It behaves as OD-5 assumed.
report.plan_linewritesclass="{resolution}"for every finding andrenderwrites a ranked-plan row for every severity;parse_previousadds tocontestedon the class alone, with no severity test (the severity testgates only the regression
keysset). So a contestedinfojoinsprevious_contestedand its disappearance raises anuncited-resolutionERROR. Measured:
OD-5's class choice stands and does NOT return to the owner as a question.
The complement is pinned too — a CITED disposition silences it — so the proof
cannot be read as "a spent state can never be retired".
The two-bundle proof — Codex's other P1
Two accepted declarations → two
infos, two DIFFERENT match keys, oncontract-v2.6's andcontract-v2.8's own inventories. Withdrawing ONEdeclaration raises exactly one uncited-resolution, for that bundle alone,
and that bundle is reported again by the superseded arm while the other's
infostands. A single-bundle test cannot see the defect Codex found, which iswhy this one is written with two.
verify-commit — exactly two members, and they are different kinds of fact
contracts/CHANGELOG.mdrelease-inventory-driftreports it atinfo, editorial member — expected between cutsdocs/contract-versioning-policy.md2898b104, already red onmainerrorThe same command at
origin/mainreports the second one alone, exit 1 — sothis PR adds exactly one mismatch, on an editorial member, and inherits the
other. The TAG is unaffected:
verify-tag --remote origin --tag contract-v3.0→release verify-tag: pass, exit 0, because the tag verifiesthe bundle at
ff9ed815where nothing moved. That distinction is the whole ofwhat OD-6 turns on and it is measured here rather than argued.
evidence/gates.mddoc-health before/after — exactly ONE new row
--single-repo, same clock, BASE a detached worktree atf4fddf7c, HEAD thisbranch committed:
Ranked-plan rows diffed row by row with the repo-identity string normalized, 53
→ 54 rows, one addition and nothing else:
> - severity=info family=release-inventory-drift path=contracts/CHANGELOG.md rule="bytes differ from the digest 'contract-v3.0' records (editorial member — expected between cuts)" …family-enumeration:No findings.modified-block-currency:scenario-title completeness
0, carriage ledger8— both unmoved.release-tag-publicationat head still reports theerror, and that iscorrect: the family reads the published tip, which is
f4fddf7c. Theerror→infoconversion is a merge-time event, measured post-merge.evidence/doc-health-delta.mdOther gates
OPENSPEC_TELEMETRY=0 openspec validate --all --strict→ 85 passed, 0failed. The packet keeps
Status: ratifiedand is not archived —§ 5 follows the merge.
proposal-support.py . verify declare-spent-bundle-state→ ok.validate-sequenced-after.py .→ passed (32 active, 1 declaring);pytest tests/sequenced_after→ 118 passed. No pin moved, andstructurally so: this PR adds no OpenSpec change directory, moves none, and
authors no MODIFIED block (the block it realizes was authored by Ratify declare-spent-bundle-state: the release-tag family has no third state, and contract-v2.6 is that state (DO NOT MERGE) #578 and is
already counted on
main). The32against the packet's31is Propose add-clearing-dispatch-boundary: one door to the governed host, and the machinery that keeps it one (draft) #555'slanding, already accounted for by whoever landed it.
One consequence stated rather than hidden
A repository that declares a contract bundle and holds no
contracts/CHANGELOG.mdnow SKIPS where it previously reported. That isthe ratified fail-closed rule ("not fetched is not an answer, in either
direction") and it is why the test file's
_declarenow seeds a changeloginto every fixture: a fixture with no changelog is one the family declines to
judge, which would have made every other assertion in that file vacuous. Two
smaller residues are named in
plan.md§ D6.OpenSpec § 3.1 — ROUTED, not discharged, and left unticked
docs/contract-versioning-policy.mdis NOT edited by this PR. It is anon-editorial member of
contracts/releases/contract-v3.0.digests.yaml, andthe repository owner ruled on 2026-09-02 that #577's existing drift on that
file CARRIES TO THE NEXT CUT and that this realization's pre-authorized scope
is "editorial member; no drift." The obligation-side paragraph — the
versioning policy naming SPENT as a state and its reserved declaration form, so
a consumer reading the pinned policy can find the state without reading
doc-health — stays owed at the next contract cut. Box 3.1 is left open with
a dated one-sentence note recording that routing.
OD-6's zero-incremental-cost arithmetic is accepted as arithmetic and
declined as authority: it says the edit would cost nothing, not that this
realization was authorized to make it. What #577 already discharges — a
consumer of the pinned policy learns
contract-v2.6is superseded and notdischargeable — is not re-authored here: "two records of one measurement
is how they drift apart."
Nothing else relaxed
Threshold still five. Floor still
contract-v1.7. MISPLACED andLIGHTWEIGHT untouched and explicitly beyond the state's reach (two tests).
The declared bundle's distance grading untouched (and a declaration naming it
is an
errorthat does not stop the grading). The five bundles under§ Untagged Bundles After Enforcement Began not retrofitted, nor any bundle
below the floor (one test asserting
findings == []). No new family, no changeto
Finding,report.render, the finding or ranked-plan grammars,health/dispositions.yamlor its readers,release-inventory-drift,verify_tag, or any other family.Review convergence — five rounds, 11 findings on the code, 10 taken, 1 route refused
##heading did not close the entry\baccepted a prefix of a longer bundle token; P2 the current-bundle refusal promised a companion finding that does not existFour of the five Codex P1s were on ONE guard — containment — each found on the
fix for the last. That is the guard the requirement leans on hardest ("the act
that spends a number is the LATER CUT that allocates its replacement"), so the
iteration went where it should have. The rule is now pinned as a single table
plus the fence and indentation cases, rather than as a regex a reader must
re-derive.
The one refusal, with its measurement. Copilot proposed fixing the
below-floor regression by returning early when
declaredis below theenforcement floor. Declined:
cut_bundlesenumerates fromcontracts/releases/, not from the manifest, so a repository can hold aninventory for a bundle above the floor while declaring one below it — an
early return keyed on
declaredwould stop checking a bundle that is inscope, trading a regression for a coverage hole. The finding itself was taken,
by gating the guard on in-scope-ness instead; both sides are pinned by test.
One extension beyond what was asked, flagged as a judgment: the fence
suppression was applied to the reserved opener as well as to headings. It is
fail-closed in both directions — a fenced example cannot spend a bundle, and a
declaration hidden in a fence does not count, which leaves the
errorstanding— and it is what lets the changelog document the form without performing it.
mainmoved under this branch, and a catch-up MERGE was takenorigin/mainadvancedf4fddf7c→3bcde7e2during review (#585, and thearchive of
govern-sibling-added-modified-deltas), touchingdocs/doc-health.mdandtests/sequenced_after/test_sweep.py— two files thisPR also touches. Taken as a MERGE, never a rebase, clean in both files, and
every measurement re-taken against the new base rather than carried forward.
openspec validatereads 84 rather than 85 becausemainarchived achange; the sequenced-after population reads 31 active rather than 32 for
the same reason. Neither is this PR's doing and this PR still moves no pin.
And it caught a false green, which is recorded rather than banked. A
tests/doc-healthrun at32c215e1read1430 passed, zero failures —including the self-gate. That was not the declaration working:
mainhad moved,the checkout had not fetched it, and the family returned the SKIP the self-gate
explicitly tolerates as "an environment fact, not a corpus fact". With the tip
fetched the self-gate fails again, correctly. Banking it would have been the
#338 conflation wearing the other hat — which is exactly why the post-merge
claim is proved against a bare repository whose
mainreally does carry thedeclaration.
Files:
contracts/CHANGELOG.md(+2/−0),scripts/doc_health/release_tag_publication.py,tests/doc-health/test_release_tag_publication.py,docs/doc-health.md,openspec/changes/declare-spent-bundle-state/tasks.md(boxes 2.1–2.9 ticked;3.1 left open with its routing note), and the Spec Kit feature under
specs/027-spent-bundle-state/.