test(ratchet): pin the two declined re-anchorings beside the header-table pin - #1532
Merged
Merged
Conversation
`scripts/check-source-token-ratchet.mjs`'s header records two re-anchorings declined as raises on the 2026-08-26 run — `anchor( 82,489) = 87,000 > ceiling 85,000` and `anchor(133,840) = 141,000 > ceiling 140,000`. Both were correct and neither was pinned, so either could rot into a false claim in silence. The pin goes beside the existing header-table pin, reusing its `source()`, `num()`, `rows()` and `runs()` helpers rather than standing up a second parser for the same artefact. It asserts the claim rather than the digits: the stated figure is `anchor(reading)`, the ceiling is the committed constant, the figure is GREATER than that ceiling (the "declined as a RAISE" claim itself), and the reading is the one that run recorded. Non-vacuity is derived, not listed — the declined labels must equal the ceilings whose table row predates the latest run. The gate is not modified; `stripComments` is untouched, so the term guard that imports it scans exactly what it scanned before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019hUuCQStzXGMFSX4dzww5t
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Sep 3, 2026
os-sales
marked this pull request as ready for review
September 3, 2026 09:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1344
What was unpinned
scripts/check-source-token-ratchet.mjs's header records two re-anchorings that were declined as raises on the 2026-08-26 run:Both are correct on
mainatd9fad90— and both were unpinned. A grep for those figures acrosstest/,src/,content/anddocs/returned nothing, so either could rot into a false claim in silence. PR #1341 reflowed them out of a wrapped sentence into worked rows shaped like the table above them precisely so they could be pinned by content; this is the follow-through.Where the pin lands, and where it deliberately does not
Inside the existing
the header table is derived from the ceilings, not transcribed beside themblock intest/source-token-ratchet.test.ts, reusing that block'ssource(),num(),rows()andruns()helpers. A second file parsing the same artefact is the defect class this card exists to remove, not a way to remove it — sotest/docs-readme-token-figures.test.tsis untouched.The gate itself is not modified.
scripts/check-source-token-ratchet.mjsis read by the pin, never edited. In particularstripCommentsis byte-identical, so the Chinese-term guard that imports it (test/docs-object-term-consistency.test.ts:8, from #802) scans exactly the surface it scanned before this PR. Two files change: the test suite and a changeset.The rows are located by content, never by line number — that is exactly what #1341's reflow bought, and a positional match would have thrown it away.
The assertions are the claim, not the digits
A pin that only checks the figures still appear is weak: a reflow can keep every digit while destroying the claim. So for each declined row the suite asserts, with the row's own text as the failure label:
anchor(reading)ceilingOf(label)Non-vacuity is derived, not hand-listed: a layer that re-anchored carries that run's own date in the table above, so the declined labels must equal exactly those committed ceilings whose table row is not dated the latest run. A header whose sentence stops parsing therefore goes red instead of passing on an empty set, and a legitimate future re-anchoring retires its own row without anyone editing a literal list.
Evidence — the pin was observed failing, three ways
CEILINGS85000 to 90000 and the row'sceilingto match)f227f137to3a80d728; removed text count 0, injected 1, at both sitesbusiness semantics anchor( 82,489) = 87,000 > ceiling 90,000 2026-08-26: expected 87000 to be greater than 90000= 87,000to= 88,000)f227f137to73205e09; removed 0, injected 1anchor()assertion alone (1 failed, 20 passed), naming its row:expected 87000 to be 88000> ceilingtoover ceiling)f227f137tof6d9e740; removed 0, injected 1expected [ 'authored total' ] to deeply equal [ 'business semantics', …(1) ]Each mutation's hash was checked to have moved before any verdict was read, and each restore was proved by blob-hash equality against the HEAD blob (
f227f137) plus an emptygit diff HEAD— never by an editor's exit code. The harness restored throughgit checkout HEAD -- PATHunder atraponEXIT INT TERM, with absolute paths resolved fromgit rev-parse --show-toplevel.Gates
pnpm verifyis green onbac49603(the commit in this PR), exit 0 —validate,typecheck,lint,lint:i18n-gate,hygiene,hygiene:tokens,build,test. Its own verdict lines:The ratchet suite itself goes 19 to 21 tests.
Changeset
Empty frontmatter — the sanctioned "releases nothing" declaration that
.github/workflows/changeset-check.ymldocuments, on par with theskip-changesetlabel. This PR is test-only: nosrc/metadata changed and the app bundle is unaffected, so there is nothing for a version bump to describe. The in-repo form was preferred over the label because it is reviewable in the diff and cannot be removed by label churn.🤖 Generated with Claude Code
https://claude.ai/code/session_019hUuCQStzXGMFSX4dzww5t
Generated by Claude Code