Skip to content

test(ratchet): pin the two declined re-anchorings beside the header-table pin - #1532

Merged
os-sales merged 1 commit into
mainfrom
claude/issue-1344-pin-the-declined-reanchorings
Sep 3, 2026
Merged

test(ratchet): pin the two declined re-anchorings beside the header-table pin#1532
os-sales merged 1 commit into
mainfrom
claude/issue-1344-pin-the-declined-reanchorings

Conversation

@os-sales

@os-sales os-sales commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

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:

business semantics  anchor( 82,489) =  87,000  > ceiling  85,000  2026-08-26
authored total      anchor(133,840) = 141,000  > ceiling 140,000  2026-08-26

Both are correct on main at d9fad90 — and both were unpinned. A grep for those figures across test/, src/, content/ and docs/ 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 them block in test/source-token-ratchet.test.ts, reusing that block's source(), num(), rows() and runs() helpers. A second file parsing the same artefact is the defect class this card exists to remove, not a way to remove it — so test/docs-readme-token-figures.test.ts is untouched.

The gate itself is not modified. scripts/check-source-token-ratchet.mjs is read by the pin, never edited. In particular stripComments is 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:

Assertion What it stops
the stated figure is exactly anchor(reading) a transcribed figure drifting off the exported arithmetic
the ceiling it is weighed against is ceilingOf(label) the row being measured against a constant no longer committed
that figure is greater than that ceiling the row silently ceasing to be a declined raise — this inequality is the claim
the reading is the one that dated run recorded a row being re-dated onto a run that never read it

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

Mutation Proved on disk What went red
ceiling raised so the decline becomes acceptable (CEILINGS 85000 to 90000 and the row's ceiling to match) blob f227f137 to 3a80d728; removed text count 0, injected 1, at both sites the inequality, naming its row: business semantics anchor( 82,489) = 87,000 > ceiling 90,000 2026-08-26: expected 87000 to be greater than 90000
a stated figure falsified (= 87,000 to = 88,000) blob f227f137 to 73205e09; removed 0, injected 1 the anchor() assertion alone (1 failed, 20 passed), naming its row: expected 87000 to be 88000
one row made unparseable (> ceiling to over ceiling) blob f227f137 to f6d9e740; removed 0, injected 1 the non-vacuity assertion: expected [ '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 empty git diff HEAD — never by an editor's exit code. The harness restored through git checkout HEAD -- PATH under a trap on EXIT INT TERM, with absolute paths resolved from git rev-parse --show-toplevel.

Gates

pnpm verify is green on bac49603 (the commit in this PR), exit 0 — validate, typecheck, lint, lint:i18n-gate, hygiene, hygiene:tokens, build, test. Its own verdict lines:

✓ i18n lint gate: 0 `i18n/missing-*` issues
✓ source hygiene clean
✓ source token ratchet clean
✓ Build complete (1975ms)
Test Files  158 passed (158)
     Tests  3332 passed | 1 skipped (3333)

The ratchet suite itself goes 19 to 21 tests.

Changeset

Empty frontmatter — the sanctioned "releases nothing" declaration that .github/workflows/changeset-check.yml documents, on par with the skip-changeset label. This PR is test-only: no src/ 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

`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
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Sep 3, 2026 9:07am UTC

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline

Projects

None yet

2 participants