fix(docs-audit): give the route:/client: lead one character class - #11558
Merged
Conversation
`declarationsIn` spelled the run between the colon and the value `[ \t]*` while the other seven scans in the file spelled it `\s*`. One character of difference -- a newline -- and a declaration whose value sits on the NEXT line was seen by BOTH scans, in two different buckets, so one declaration reached the denominator twice. The partition kept balancing while it happened (`rows + declined === routesDeclared`), which is why no count comparison could see it: what moved was the population, not the arithmetic. The reader was shown two entries for one line, the second reading `route: ` with an empty value. `\s*` wins because the ROW RECOGNIZER already spells it: a wrapped single-quoted value is read as a row and was then billed unread by the same file, raising a PARTIAL-read verdict with exit 1 on a wholly accurate ledger. Making `[ \t]*` win instead would have had to move the recognizer -- a change to the measured population -- and would have kept the empty-valued entry. `declLead` is now the one place the class is spelled, and all eight lead scans are built from it; the other seven regexes are byte-identical in source and flags. Priced free on today's tree: 268 of 268 route / 222 of 222 client / 177 UNREACHABLE, delta 0, `unreachableRows` byte-identical. The KEY part stays each call site's own -- `declarationsIn` anchors with `\b` and the other seven do not, so `subroute:` mints a silent phantom row. That moves the measured population, so it is filed separately. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. |
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 #11494
scripts/docs-audit/affected-docs.mjshad eight scans that ask "is aroute:/client:declaration written here?". Seven spelled the run between the colon and the value\s*;declarationsInspelled it[ \t]*. One character class, one character of difference — a newline — and a declaration whose value sits on the next line was seen by both, in two different buckets, so one declaration reached the denominator twice.Re-derived on this base, not quoted from the card
The card's numbers are from
951b025e. #11500 (2d1290ae) has since rewrittendeclinedInin this exact file, so "byte-identical onorigin/main" is a statement about a tree that no longer exists. Re-derived oncd932772:rows 1 · routesDeclared 3 · declined 2 · brokenScan 1rows 1 · routesDeclared 2 · declined 1 · brokenScan 1rows 1 · routesDeclared 2 · declined 1 · brokenScan 1rows 1 · routesDeclared 1 · declined 0 · brokenScan 0client:clientsDeclared 2 · declined 1 · brokenScan 1clientsDeclared 1 · declined 0 · brokenScan 0declined 1, namedroute:declined 1, namedroute: ROUTES.healthA reproduces the card exactly, second entry and all:
{ key: 'route', line: 2, text: 'route: ' }— an empty value, naming nothing a reader can act on.B is the louder half the card did not measure, and it is what settles which class wins. The row recognizer already spells
\s*, so a wrapped single-quoted value is read as a row — and was then billed unread by the same file, raising a PARTIAL-read verdict with exit 1 on a wholly accurate ledger. That is the false-red direction, which this file prices as costing the same trust a false green does. Making[ \t]*win instead would have had to move the recognizer too — a change to the measured population, which the header of--bridge-coverageattaches a before/after standard to — and would have kept the empty-valued entry as the surviving one.Note that
rows + declined === routesDeclaredkept balancing throughout (1 + 2 === 3). The partition is blind to this by construction: what moved was the population, not the arithmetic.Route taken: (2), not (3)
Route 3 (claim once by index) is the larger change and strictly weaker here. It suppresses the symptom at each site — the double bill in A is
declinedIn+unreadableIn, but in B and C it is the recognizer +unreadableIn, so three separate claim registrations would be needed — and it leaves the two scans still disagreeing about the character class. Route 2 removes the disagreement at the root and fixes all four shapes with one line.Written once
declLeadis now the only place the class is spelled, and all eight lead scans are built from it. The other seven are byte-identical insourceandflags— verified mechanically, 1 of 8 changed:Priced free on today's tree
Zero live instances re-checked here, not inherited: seven ledgers (unchanged), and
grep -nE '\b(route|client)[ \t]*:[ \t]*$'over all seven returns 0 hits (grep exit 1).--bridge-coveragedelta across the change:Non-vacuity — both directions, mutation proven on disk
--self-test: 366 → 381 cases. Two ablation legs, each with the mutation confirmed on disk by grepping for the removed and injected text (not an editor exit code), and each restored byte-identically bygit hash-object:declarationsInreverted to its inline[ \t]*): 8 checks fail, reproducing the card's numbers verbatim —got "1 row / 3 route / 2 declined"andgot "line 2: route: \"GET /api/v1/gone\", line 2: route: ". The partition check stays green throughout, which is the point.declLead(all eight scans at once): 8 checks fail, includingrow → got "undefined → undefined"— which proves every one of the eight call sites really does read the helper rather than keeping an inline copy.hash-objectbyte-identical to pristine,--self-testexit 0, 381 pass.Boundary deliberately not crossed
declLeadunifies what may sit between the colon and the value. The key part is still each call site's own:declarationsInanchors with\b, the other seven do not, sosubroute: 'GET /x'is a declaration to seven of eight and mints a silent phantom row (rows 2on a file declaring one,brokenScan 0). Unifying that moves the measured population, so it is filed as #11542 and pinned here — the card that closes it moves the pin instead of finding none.Gates
Derived with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(the script derived the change set itself from the merge base; provenance line asserted objectstack). Run ate8a9b04e:check:docs-audit-scope✓ affected-docs self-test: 381 cases pass./✓ docs-accuracy-audit scope is in synccheck:cross-package-test-inputsOK: 14 package(s) read outside themselves, all declaredcheck:entry-guard✓ check:entry-guard: 139 scripts/ file(s)check:parse-guardcheck:pm-governed-merges✓ check-governed-merges --self-test: 129 assertionscheck:pnpm-filter-targets✓ check-pnpm-filter-targets --self-test: 40 assertionscheck-ci-filter-parity.mjsOK: all 89 declared cross-package glob(s) (77 unique) are coveredcheck-affected-docs.mjscheck-nul-bytes.mjscheck-nul-bytes: OK (scanned 6460 text file(s) … no raw ASCII control bytes)Repo-wide
pnpm lint(eslint . --no-inline-config) was run in full, not narrowed:os-verify-lock: VERDICT command-exit 0 · held the lock 65s.pnpm exec eslint --format jsonon the changed file alone reports 1 file, 0 errors, 0 warnings.No changeset: this edits a CI-internal script and releases nothing — the textbook
skip-changesetcase, inlint.yml's own words. Label applied additively and read back.Generated by Claude Code