Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix(scripts): refuse a verification claim on a doc fragment the gate never compiles - #7831

Merged
os-sam merged 1 commit into
mainfrom
claude/issue-7505-declared-fragment-verification-claim
Sep 6, 2026
Merged

os-sam merged 1 commit into
mainfrom
claude/issue-7505-declared-fragment-verification-claim

Conversation

@claude

@claude claude Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #7505

What changed

check-doc-snippet-types.mjs now refuses one combination: a declared
fragment whose written reason claims the block was checked against something.

A declared fragment is the single block this gate never compiles. A reason
asserting the block agrees with a shipped artifact is therefore an assertion the
gate structurally cannot re-verify — it goes silently false the day the thing it
names changes, and a reader cannot tell the two apart because both arrive in the
same marker.

⭐ The exemption is not the defect and is untouched. Exempting a fragment
from compilation stays legitimate; a verification claim stays legitimate on a
block the gate actually compiles. Only the two together are refused, and the
author has two ways out, both named in the failure text: say why the block
cannot compile without asserting it was checked, or move the block into the
compiled tier where the claim becomes one this gate re-verifies on every commit.

⛔ No exemption list. An exemption here would be a second unverifiable assertion
about an unverifiable assertion.

The census, which is what chose the route

The card asked for this before any gate change, and it decided the shape:

declared fragments in the corpus 158
carrying a verification claim 2
where both on content/docs/utilities/data-objectstack.mdx, the page the card sampled
how they were spelled verified · hand-checked

⇒ The card's stated precondition for this route — "needs the marker vocabulary
to be enumerable; if 'checked against' is free prose, this becomes a phrase hunt
with false positives"
— tests positive. The vocabulary is a closed list, and
the check reads only the marker's reason field (a small structured field this
gate already validates for length), never the page's prose.

Two corpus reasons deliberately stay legal, and both are pinned as tests:

  • plugin-calendar.mdx names the same authority to say the opposite — its
    block "cannot compile against the SHIPPED prop type". Anchoring the match on
    "against the shipped" would have flagged it; anchoring on a verb does not.
  • component-registry.md says its literal is "type-checked on the complete
    example at the end of the page, which does compile"
    . type-check names this
    gate's own action, so that is a claim backed by a check that re-runs every
    commit — the shape the rule wants, not the shape it refuses.

⚠️ Stated limit, in the header too: this matches verbs, it does not parse
meaning. type-checked by hand would pass it. It closes the spelling that has
actually been written here and turns a silent gap into a red build on the commit
that reintroduces it.

Ablation — the proof, not "I added a check and CI is green"

The falsified marker's own historical wording, put back on the same declared
fragment. Mutation proven on disk before the run; restoration proven by state.

HEAD blob        : ab9e86d56a1c369052cefd9e86c3e2d31d504d9a
PRE  : claim=0 anchor=2
POST : claim=1 anchor=1          <- anchor-count flip, so the edit landed
mutated hash     : c704938b04d381b4a7dc5bfe4fe3311688200396

GATE EXIT (mutated) = 1          <- ran and found errors
  content/docs/utilities/data-objectstack.mdx:117  [verification-claim-on-fragment]
  a DECLARED fragment is never compiled, so this gate cannot re-verify "Checked"
  on any later commit ...

RESTORED: claim=0 anchor=2
restored hash    : ab9e86d56a1c369052cefd9e86c3e2d31d504d9a
hash == HEAD blob: YES
git diff HEAD    : empty (clean)
GATE EXIT (restored) = 0         findings after restore: 0

The gate names itself in the finding ([verification-claim-on-fragment]) and
leaves through exit 1 — a verdict about the document — not exit 2, which
would say it never judged anything. A test pins that distinction.

The page repair that ships with it

content/docs/utilities/data-objectstack.mdx, read against today's shipped
packages/data-objectstack/dist/index.d.ts rather than against the card's text.
Two things, not one:

  1. Both marker reasons rewritten to state the gap instead of claiming a check.
  2. ⚠️ A second falsehood, found by doing exactly that reading. The card's
    named defect — the return type — was already repaired on main by fix(data-objectstack): createObjectStackAdapter declares the adapter it returns #7503, so
    that premise arrived stale. But the config excerpt was still missing a member
    the shipped declaration carries: systemCapabilities?: string[] (ADR-0066).
    Added, with the shipped doc comment's own wording. The marker's old claim that
    "every config member declared there with the same type" had been checked was
    false again, in a second way, at the moment it was read.

⇒ That is the card's thesis reproducing itself inside its own sampling point.

Tests

scripts/__tests__/check-doc-snippet-types.test.ts: 70 → 78 passing.

The 8 new pins cover the refusal and its edges, because a suite that only
proved "the claim turns it red" would not notice the check growing into a phrase
hunt: the measured spelling turns red and names itself · it is a document verdict
not a precondition · the same words on a compiled block are untouched · a
reason naming the same authority to say the opposite stays legal · type-checked
stays legal while hand-checked still trips · every verb in the closed list
trips it, so the list cannot rot in silence · this repository's own 158 declared
fragments carry no claim (guarded against going vacuous) · the header states the
rule so it cannot drift out of the source.

Gates run, all at e16a473a8

gate exit
check:doc-snippets (this gate) 0
check:doc-types · check:doc-fences · docs:check-links · check:doc-example-readers 0
doc-gate vitest suites (snippet + component + fence), 156 tests 0
type-check:scripts 0
lint:root (the scope that covers scripts/), full run 0 errors
lint:coverage · type-check:coverage 0
check-control-bytes 0

node scripts/check-changeset-presence.mjs verdict, verbatim:

✅ No source or published contract of a released package changed in this
range, so no changeset is owed.

⇒ No changeset added, and ⛔ no skip-changeset label applied — in this repo
that label is read by nothing and exempts nothing; the gate's verdict line is the
authority.

Not run: the full turbo run lint / turbo run type-check package fan-out
(no package source changed — the root scope is what covers scripts/); any
browser or runtime verification (nothing here runs in a browser); CI itself.

Scope

Exactly the three files the dispatch named. UNGATED_DOCS is byte-identical
to HEAD — verified, not assumed — so there is no collision with #7417, which is
editing that ledger's README.md entry. The scan population is unchanged at 158
declared fragments and 456 compiled blocks, confirming this did not quietly move
any fragment into the compiled tier.


Generated by Claude Code

…never compiles (#7505)

A `declared` fragment is the one block `check-doc-snippet-types` does not
compile, so a marker reason asserting the block agrees with a shipped artifact
is an assertion the gate structurally cannot re-verify. It goes silently false
the day the thing it names changes, and it is worse than no marker: it converts
a reader's correct instinct — go check this against the source — into a step
they skip.

Measured: `content/docs/utilities/data-objectstack.mdx` declared a signature
excerpt "checked against the shipped dist/index.d.ts ... with the same type".
True when written; false from #7503, which widened the factory's return from
`DataSource<T>` to `ObjectStackAdapter<T>`. Three independent readers hunting
for exactly that falsehood missed it.

The gate now refuses the COMBINATION, never the exemption: exempting a fragment
from compilation stays legitimate, and a verification claim stays legitimate on
a block the gate actually compiles. Only the two together are refused, and the
author has two ways out — say why the block cannot compile without asserting it
was checked, or move the block into the compiled tier where the claim becomes
one this gate re-verifies on every commit. No exemption list: an exemption here
would be a second unverifiable assertion about an unverifiable assertion.

Census before the change, which is what decided the route: 2 of 158 declared
fragments carried a claim, spelled `verified` and `hand-checked`, both on the
page the card sampled. So the marker vocabulary IS enumerable — the card's own
stated precondition for this route — and the verb list is closed. `type-check`
is excluded because it names this gate's own action, a claim that does re-run
on every commit.

Both instances are repaired here, and so is a second falsehood found by reading
today's shipped `dist/index.d.ts` as the card directs: the config excerpt was
missing `systemCapabilities?: string[]`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

1 participant