Skip to content

Realize declare-spent-bundle-state: a spent bundle is a declared third state, and contract-v2.6 is declared - #584

Closed
brettheap wants to merge 12 commits into
mainfrom
027-spent-bundle-state
Closed

brettheap wants to merge 12 commits into
mainfrom
027-spent-bundle-state

Conversation

@brettheap

@brettheap brettheap commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Realize declare-spent-bundle-state

Realizes 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, squash
f4fddf7c, which is this branch's base. Spec Kit feature
specs/027-spent-bundle-state/ — the
packet 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-suite reports exactly 1 failed, and it goes green at the squash

pytest-suite reports 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's contracts/CHANGELOG.md via git ls-remote origin refs/heads/main and cannot see this branch's declaration; every other test
green; the failure set is byte-identical to main's since ff9ed815; it
goes green at the squash.

Measured on 09e28b3d, run 33641746085:

FAILED tests/doc-health/test_release_tag_publication.py::test_this_repository_reads_zero_and_the_probe_can_fire
1 failed, 8652 passed, 21 skipped, 338 deselected, 9 warnings, 46 subtests passed in 1211.49s (0:20:11)

main's own run at f4fddf7c reads 1 failed, 8620 passed, 21 skipped, 338 deselected — the same single failure, skipped identical at the
exactly-pinned 21, and passed +32 for the tests this PR adds. The gate pins
SKIPPED 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 on
the 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 main IS this branch, cloned, with the unedited
self-gate run against it →

1 passed in 2.02s

and the declaration then removed from that origin's main →

FAILED …::test_this_repository_reads_zero_and_the_probe_can_fire
1 failed in 1.67s

Full transcript:
evidence/post-merge-proof.md.
main goes green because contract-v2.6 is EXPLICITLY DECLARED spent, and
never 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 HEREsubsection 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.

**SPENT BUNDLE:** `contract-v2.6` — SUPERSEDED BY `contract-v3.0` — CAUSE: it declares change class ADDITIVE (minor) over a tree that refuses three shapes `contract-v2.5` accepted, which no completion commit and no rebuilt inventory can cure, and it is never verifiable at `bbbbeda9`, its one declaring commit — RULED BY Brett Heap, 2026-09-02 — MEASUREMENT: PR #565 comment `5502452624`

contract-v3.0's tag was checked, not assumed:
git ls-remote origin refs/tags/contract-v3.0 → 59f4f51f… peeling to
ff9ed815…, so the declaration lands in the info band and not OD-4's
warning band.

The finding this buys, and its key

severity info
family release-tag-publication
path contracts/releases/contract-v2.6.digests.yaml
match key ('release-tag-publication', 'openxFactory', 'contracts/releases/contract-v2.6.digests.yaml')
class contested
action no action is owed on this bundle — the obligation was not MET but EXTINGUISHED, by an owner act, at the cost of a version number, and the record is the reserved SPENT declaration in contracts/CHANGELOG.md; NEVER delete that declaration or this inventory to stop this finding being reported

Rule text, as emitted over the real repository at the simulated post-merge tip:

contract-v2.6 is SPENT: it was cut, was never publishable, and is declared
spent by the reserved SPENT declaration at contracts/CHANGELOG.md line 374,
inside the contract-v3.0 entry — contract-v3.0 superseded it and carries a
published annotated tag on a commit that declares it. Ruled by Brett Heap,
2026-09-02; cause: …; measurement of record: … . This is NOT the tag
obligation having been MET — it was EXTINGUISHED, by an owner act, at the
cost of a version number

The error it replaces held
('release-tag-publication', 'openxFactory', 'contracts/manifest.yaml') and
was auto-fixable, so its disappearance raises no uncited-resolution; the key
that replaces it is contested, so its disappearance would.

What landed, per box

  • 2.2 — the reader. read_spent_declarations(bytes) -> {bundle: SpentDeclaration}: one pure function, bytes in (the module's existing rule,
    because blobs_at answers raw blob bytes), parsing the reserved opener, the
    four elements, and the containing ## contract-vX.Y entry. It REJECTS
    rather than skips
    : a line beginning with **SPENT BUNDLE:** is a
    declaration by construction, and one that does not complete the form comes
    back carrying missing or defect. Duplicates are counted, not
    collapsed
    .
  • 2.3 — the ladder, in check_repo, in the ABSENT arm only and
    after the ok/lightweight/misplaced branches, each of which
    continues — so "the SPENT state reaches the ABSENT-tag arm and nothing
    else"
    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) in
    check_repo, which is also the only place that can turn an unlistable ref
    into a Skip.
  • 2.4 — the emits. Every finding of the state lands on
    contracts/releases/<bundle>.digests.yaml (OD-5 as amended on Codex's P1:
    Finding.match_key() ignores rule text, so the manifest would share one
    identity with everything and the changelog would share one identity between
    two spent bundles); the accepted info is contested; the orphan-subject
    warning keeps the changelog path, having no per-bundle inventory. Four
    new action constants
    beside the module's existing four. _finding gained
    path=MANIFEST as a default, so every pre-existing finding keeps its
    identity byte for byte.
  • 2.5 — one read, one commit, one guard. The changelog joins the manifest
    in the SAME blobs_at call at the SAME tip; a blob it cannot read is a
    SKIP 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.
  • 2.6 / 2.7 — tests. 19 → 69 in the family's file (+50 across five review rounds:
    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.
  • 2.8 — docs/doc-health.md gains the third state, the reserved form, the
    three 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-enumeration reports No findings.
  • 2.9 — pytest tests/doc-health: 1420 passed, 1 failed at 95c11696, the failure
    being 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 error on
contracts/manifest.yaml. Re-taken over the REAL repository in
evidence/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 is
weaker 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_line writes class="{resolution}" for every finding and
render writes a ranked-plan row for every severity; parse_previous adds to
contested on the class alone, with no severity test (the severity test
gates only the regression keys set). So a contested info joins
previous_contested and its disappearance raises an uncited-resolution
ERROR. Measured:

contested == {('release-tag-publication','alphaFactory',
               'contracts/releases/contract-v2.6.digests.yaml')}
uncited_resolutions([], contested, dispositions=set())
    -> ['uncited-resolution'] on contracts/releases/contract-v2.6.digests.yaml

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, on
contract-v2.6's and contract-v2.8's own inventories. Withdrawing ONE
declaration raises exactly one uncited-resolution, for that bundle alone,
and that bundle is reported again by the superseded arm while the other's
info stands. A single-bundle test cannot see the defect Codex found, which is
why this one is written with two.

verify-commit — exactly two members, and they are different kinds of fact

$ python3 scripts/validate-contract-release.py verify-commit --commit HEAD
HGR-RELEASE-DIGEST-MISMATCH error path=contracts/CHANGELOG.md: …
HGR-RELEASE-DIGEST-MISMATCH error path=docs/contract-versioning-policy.md: …
exit=1
member whose class
contracts/CHANGELOG.md THIS PR EDITORIAL — one of the three members the versioning policy allows to move between cuts, so release-inventory-drift reports it at info, editorial member — expected between cuts
docs/contract-versioning-policy.md INHERITED — PR #577, 2898b104, already red on main NON-editorial: an unconditional error

The same command at origin/main reports the second one alone, exit 1 — so
this 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 verifies
the bundle at ff9ed815 where nothing moved. That distinction is the whole of
what OD-6 turns on and it is measured here rather than argued.
evidence/gates.md

doc-health before/after — exactly ONE new row

--single-repo, same clock, BASE a detached worktree at f4fddf7c, HEAD this
branch committed:

critical error warning info
base 6 6 29 12
head 6 6 29 13

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 ledger 8 — both unmoved.
release-tag-publication at head still reports the error, and that is
correct
: the family reads the published tip, which is f4fddf7c. The
error → info conversion is a merge-time event, measured post-merge.
evidence/doc-health-delta.md

Other gates

One consequence stated rather than hidden

A repository that declares a contract bundle and holds no
contracts/CHANGELOG.md now SKIPS where it previously reported. That is
the ratified fail-closed rule ("not fetched is not an answer, in either
direction"
) and it is why the test file's _declare now seeds a changelog
into 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.md is NOT edited by this PR. It is a
non-editorial member of contracts/releases/contract-v3.0.digests.yaml, and
the 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.6 is superseded and not
dischargeable — 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 and
LIGHTWEIGHT untouched and explicitly beyond the state's reach (two tests).
The declared bundle's distance grading untouched (and a declaration naming it
is an error that 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 change
to Finding, report.render, the finding or ranked-plan grammars,
health/dispositions.yaml or 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

round Codex Copilot
1 P1 containment: a non-release ## heading did not close the entry inline: the invalid-UTF-8 test encoded valid UTF-8; suppressed: the changelog skip reason omitted its commonest cause
2 P1 \b accepted a prefix of a longer bundle token; P2 the current-bundle refusal promised a companion finding that does not exist inline: a docstring opened with a fourth quote character
3 P1 a level-one heading also closes an entry inline: a below-floor repository with no changelog newly skipped — finding taken, proposed route declined with a measurement
4 P1 the heading patterns were applied to raw lines, so a heading inside a code fence reopened an entry (and an indented ATX heading was missed); P1 the orphan sweep lost the read-failure skip —
5 requested on the final head two "needs a closer look" verdicts, no code findings

Four 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 declared is below the
enforcement floor. Declined: cut_bundles enumerates from
contracts/releases/, not from the manifest, so a repository can hold an
inventory for a bundle above the floor while declaring one below it — an
early return keyed on declared would stop checking a bundle that is in
scope, 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 error standing
— and it is what lets the changelog document the form without performing it.

main moved under this branch, and a catch-up MERGE was taken

origin/main advanced f4fddf7c → 3bcde7e2 during review (#585, and the
archive of govern-sibling-added-modified-deltas), touching
docs/doc-health.md and tests/sequenced_after/test_sweep.py — two files this
PR 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 validate reads 84 rather than 85 because main archived a
change; 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-health run at 32c215e1 read 1430 passed, zero failures —
including the self-gate. That was not the declaration working: main had 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 main really does carry the
declaration.


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

brettheap and others added 2 commits September 2, 2026 09:54
… 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]>
Copilot AI lite review requested due to automatic review settings September 2, 2026 14:11

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.py with 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 AI review requested due to automatic review settings September 2, 2026 14:20
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]>
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

Copilot AI review requested due to automatic review settings September 2, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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 CHANGELOG is None implies the commit may not be present locally, but RealGit.blobs_at returns None for 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 no contracts/CHANGELOG.md at 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +374 to +376
heading = _ENTRY_HEADING.match(line)
if heading is not None:
entry = heading.group(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
    continue

One 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; asserts entry is None, asserts the refusal says "no release entry at all", and asserts the same line WITHOUT ## Notes is 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 — reads contracts/CHANGELOG.md from disk, so if a future edit inserts a level-two heading above the reserved line, a test says so instead of the family quietly going info → error on 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]>
Copilot AI review requested due to automatic review settings September 2, 2026 14:47
@brettheap

Copy link
Copy Markdown
Contributor Author

Bot round 1 → round 2, and both findings on the code were TAKEN

Codex P1 — "reset the containing entry at every level-two heading" — TAKEN, and it was the containment guard itself. Measured before fixing: with ## contract-v3.0 … ## Notes … declaration, entry read contract-v3.0 and spent_refusal returned None, i.e. ACCEPTED. A declaration sitting in no release entry at all would have replaced the genuine superseded-bundle error with an info. Fixed in 184a18a5; three tests, including one that reads this repository's live contracts/CHANGELOG.md from disk so a future heading insertion reds a test instead of silently flipping the family from info to error. Full reply in the thread.

Copilot round 1 — the invalid-UTF-8 test — TAKEN. The fixture built a str of "\xff\xfe" and UTF-8 encoded it, producing valid UTF-8, so the errors="replace" path it named was never reached. Now a bytes literal, with pytest.raises(UnicodeDecodeError) on a strict decode of the same bytes proving the fixture cannot silently become valid again. Fixed in 09e28b3d.

Copilot's suppressed finding on the changelog skip reason — TAKEN. It named only "the commit may not be present locally", while blobs_at answers None per path 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.

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 evidence/post-merge-proof.md for the measurement that stands in for it. The merge is the repository owner's, on a red he has already dispositioned.

pytest-suite on 09e28b3d — run 33641746085

FAILED tests/doc-health/test_release_tag_publication.py::test_this_repository_reads_zero_and_the_probe_can_fire
1 failed, 8652 passed, 21 skipped, 338 deselected, 9 warnings, 46 subtests passed in 1211.49s (0:20:11)

Exactly one FAILED line, and it is the expected one. main's own run at f4fddf7c reads 1 failed, 8620 passed, 21 skipped, 338 deselected — the same single failure, skipped identical at the exactly-pinned 21, and passed +32 for the tests this PR adds. The other three checks pass. A fresh run is now in flight on 184a18a5.

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
Copilot AI review requested due to automatic review settings September 2, 2026 15:00
@brettheap

Copy link
Copy Markdown
Contributor Author

Round 3 — both of Codex's round-2 findings TAKEN, on head 95c11696

Codex P1 (a second containment escape, found on the fix for the first) — TAKEN. \b matches between 0 and ., so the entry-heading pattern accepted a prefix of a longer name. Measured before fixing: ## contract-v3.0.1 and ## contract-v3.0-notes both opened entry as contract-v3.0. The pattern now demands whitespace or end-of-line after the version token. One case from the list is deliberately not treated as a defect and is pinned as such: ## contract-v3.01 is a well-formed bundle name (major 3, minor 01) and legitimately opens an entry — it is refused because that entry names a different bundle.

Codex P2 (the current-bundle refusal promised a companion finding that does not exist) — TAKEN. A fifth action constant, _SPENT_CURRENT_ACTION. The test uses the zero-distance case, where the distance arm is silent and the refusal is the only row — which is exactly when the old wording misdirected.

Copilot (docstring opening with a fourth quote character) — TAKEN, paraphrased rather than quoted.

Family file 19 → 57 tests; 55 passed, 1 deselected locally (the deselected one is the self-gate, which reads remote main). This repository's own declaration re-verified against the tightened pattern: entry: contract-v3.0, refusal: None.

Running total across three rounds: 6 findings on the code, 6 taken, 0 refused — 2 Codex P1, 1 Codex P2, 2 Copilot inline, 1 Copilot suppressed. Two Copilot "needs a closer look" verdicts are not code findings; both ask for human confirmation of the merge given a deliberately post-merge-observable self-gate, which is the ratified position and the owner's call.

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
Copilot AI review requested due to automatic review settings September 2, 2026 15:18
@brettheap

Copy link
Copy Markdown
Contributor Author

main moved under this branch — catch-up MERGE taken, head is now 422def1a

origin/main advanced from f4fddf7c to 3bcde7e2 while this PR was in review: #585 (staging) and the archive of govern-sibling-added-modified-deltas (#558/#571), which promoted a doc-health delta and touched docs/doc-health.md and tests/sequenced_after/test_sweep.py's corpus pin — two files this PR also touches. Taken as a MERGE, never a rebase, per this estate's practice. The merge was clean; no conflict in either file.

And it caught a measurement that would otherwise have been reported as a green. The local tests/doc-health run immediately before the merge read 1430 passed, zero failures — including the self-gate. That was not the declaration working: the checkout had not fetched the advanced tip, so blobs_at could not read contracts/manifest.yaml at 3bcde7e2 and the family returned the SKIP that the self-gate explicitly tolerates ("a skip is not a defect and is not asserted away … an environment fact, not a corpus fact"). With the tip fetched, the family reads the real changelog again and the self-gate fails exactly as it should. Recorded rather than banked: a green that came from an unfetched commit is the #338 conflation wearing the other hat, and this family's own guards exist because of it.

Gates re-run over the merged tree (422def1a)

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.

@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +923 to +924
findings.append(_finding(
WARNING, repo,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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]>
Copilot AI review requested due to automatic review settings September 2, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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]>
Copilot AI review requested due to automatic review settings September 2, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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]>
Copilot AI review requested due to automatic review settings September 2, 2026 16:29
@brettheap

Copy link
Copy Markdown
Contributor Author

Round 5 closed — Copilot's finding taken, head 8106f204

Copilot P5 (the combined batch-read skip named only the manifest) — TAKEN. blobs_at collapses to None only when git itself failed, which fails the whole two-member batch, so the message sent an operator to one file when neither had been obtained. It now names both. The distinction is not cosmetic: a per-path failure is the other return shape, and each key already has its own guard with its own words — conflating them is the #338 class one layer down.

Family file 19 → 70 tests; 65 passed, 1 deselected locally.

Final tally — five rounds, 12 findings on the code, 11 taken, 1 route refused

Codex: 5 P1 + 1 P2, all taken. Copilot: 4 inline + 1 suppressed, all taken; 1 proposed route declined with a measurement (the finding itself taken by a different route). Two Copilot "needs a closer look" verdicts are not code findings — both ask for human confirmation of the merge given a deliberately post-merge-observable self-gate, which is the ratified position and the repository owner's call.

This is the fifth and final round per the estate's bot doctrine. Every thread is answered; no thread is left unaddressed.

@codex has a verdict on every head it was asked about (rounds 1–4 produced findings; round 5 was requested on 32c215e1 and again on the merged head). No provider refusal occurred at any point.

The merge is not mine to perform. pytest-suite will report exactly one FAILED line — test_this_repository_reads_zero_and_the_probe_can_fire, which reads remote main and cannot see this branch's declaration — and it goes green at the squash. That red is declared rather than undiscovered: it is the red #575 exists to name, the repository owner has ruled the merge on it, and the run id plus the single failure line on the final head are cited above.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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, the if subject is None: missing.append("spent bundle") branch is unreachable because all subject is None cases 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 thinking subject may still be None at this point.
  • Files reviewed: 19/19 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

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 3fa222f3, 16:19Z) by a sibling session while this PR was in bot round 5, so this PR is now a duplicate on its realization half. It is NOT a duplicate on its review half: five bot rounds here took 12 findings, including five Codex P1s on the containment guard (a level-two and a level-one heading close the open entry; a complete bundle token so ## contract-v3.0-notes cannot open the v3.0 entry; fenced code is not prose; the orphan sweep keeps its skip), plus the Speckit specs/027-spent-bundle-state/ feature the packet's tasks.md required. Four late Codex findings (fence closers ending after whitespace; Setext headings; empty ATX headings; below-floor subjects in the orphan sweep) are not yet dispositioned in-thread, and Codex's 16:29Z reply on 8106f204 was a provider non-review, not a verdict.

A read-only comparison of main's reader against each finding is being measured. Brett Heap decides: close as superseded, or re-scope into a hardening PR on top of main. Until then this PR stays open and unchanged.

@brettheap

Copy link
Copy Markdown
Contributor Author

Measured: main@3fa222f3's reader vs the findings this PR's five bot rounds took (lane openxfactory-1d, 2026-09-02 ~17:05Z; each YES was PROBED against main's code, not inferred)

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

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1d
CLAIMED — lane openxfactory-1d, session 60342fd2, 2026-09-02T18:52:39Z, for: re-scoping #584 into a hardening PR on main (Brett Heap: "harden 584")

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-1d

CLOSED AS RE-SCOPED, on Brett Heap's word of 2026-09-02 ("harden 584") — the successor is #589

Its realization half landed as #587 (squash 3fa222f3), from a sibling session, while this PR was in bot round 5. On that half this PR is a duplicate and closing it is the honest bookkeeping.

Its review half lives on in #589 — #589 — as a hardening PR on top of main. Nothing measured here is discarded:

The branch 027-spent-bundle-state is left alone — not deleted, not force-pushed — so this PR's five rounds stay readable at their own heads.

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 startswith, and in #589 the rule passes through one structural-boundary function and is pinned as one table. The next shape of heading somebody invents is a row rather than a round.

@brettheap brettheap closed this Sep 2, 2026
brettheap added a commit that referenced this pull request Sep 2, 2026
…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]>
brettheap added a commit that referenced this pull request Sep 3, 2026
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]>
brettheap added a commit that referenced this pull request Sep 3, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants