docs(check-links): state the scan populations instead of copying their counts - #7885
Merged
Merged
Conversation
…r counts `check-links.yml`'s header stated two document counts as literals — the repo-root tree "holds 15 INTERNAL documents" and "the 183 files the published site is built from live in `content/docs/**`". Both had drifted (17 and 184 today) and nothing went red over the whole distance, because nothing fails on a stale number written in a comment. The same two counts were duplicated word for word in the header of the test file that pins this workflow. Changing 15 to 17 and 183 to 184 reloads the same trap, so instead the header now names its populations — which trees, which extensions — and points at the two live readings (a `find` in any checkout, and Lychee's own run summary). The historical half is rewritten as explicit past tense, PR-numbered, and carries no live numeral. A third copy of #7448's pin lands in the workflow's own test file and reds on the next numeral that qualifies a document population. It reads the test file's own header as well as the workflow's, and it allows an adjective between the numeral and the noun: run verbatim over the pre-fix header, #7448's regex reported only one of the two live counts — "15 INTERNAL documents" scored as clean because a word sits between the numeral and the noun it counts. A fixture table demonstrates both directions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
os-sam
marked this pull request as ready for review
September 6, 2026 01:39
This was referenced Sep 6, 2026
os-sam
pushed a commit
that referenced
this pull request
Sep 6, 2026
…n numeral and noun objectui#7448 landed the same document-count pin in two gate test files and stated the rule in both docstrings as "a numeral DIRECTLY qualifying a document-population noun". Both implemented it as strict adjacency, so a single adjective inside the noun phrase defeated them. Measured, not inferred. #7448's regex run verbatim over `check-links.yml`'s header as it stood on origin/main at 83fe6e7 — a header carrying two live drifted counts — reports one of the two: twin regex => ["183 files"] third regex => ["15 INTERNAL documents","183 files"] The count it scores clean is the one that had drifted furthest (15 against a measured 17), because an adjective sits between the numeral and the noun. This carries the third copy's pattern (objectui#7825, PR #7885, `check-links-workflow.test.ts`) to both twins verbatim: up to two intervening words, issue references excluded at the pattern level by a negative lookbehind rather than by luck, noun set unchanged. No fourth spelling is invented. The docstrings drop "DIRECTLY" — keeping it would only have inverted the same gap between what the pin claims and what it does. Latent, not live: both twin workflow headers are clean under both patterns on today's tree, so this closes a proven hole rather than a live violation. Part of objectui#7888 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
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 #7825
check-links.yml's header stated two document counts as literals, and both haddrifted with nothing red over the whole distance. Per the ruling on the card, the
numbers are not re-aligned — they are removed, and the header states its
populations and points at the readings instead, so the drift becomes structurally
impossible rather than merely correct today.
Fresh readings, re-measured on current main (
83fe6e741, this branch's base)The card measured 17 / 184 at
900f8d995. Today, with the same walk theworkflow's own
argsblock declares:83fe6e741find docs -type f \( -name '*.md' -o -name '*.mdx' \) | wc -lfind content/docs -type f \( -name '*.md' -o -name '*.mdx' \) | wc -lSplit, for the record:
content/docsis 144.mdx+ 40.md; the repo-rootdocs/tree is all.md. Independently corroborated in the same session bycheck:shell-escape-residue's own verdict line, which walks the same tree andreports
content/docs: 184 file(s).Both figures are unchanged from the card's, so the surrounding prose still
describes the same scan scope — the scope statement was accurate, only its two
sizes were not. That is what made the rewrite a prose fix and not a scope change.
What changed
1.
.github/workflows/check-links.yml— the header. Both sentences the cardflagged are rewritten, per ruling ②, because both read present tense:
and the
apps/site/source.config.tsdeclaration the content tree comes from —and points at the two readings that produce the live figures (a
findin anycheckout, and Lychee's own run summary). No numeral qualifies a document
population anywhere in the header any more.
carries no live numeral: "Until PR check-links.yml(Lychee)扫的是 docs/**(15 个文件),不是站点文档 content/docs/**(183 个文件) #3449 the
argslist named only therepo-root
docs/**, so not one published page had ever been scanned".2.
scripts/__tests__/check-links-workflow.test.ts— the third copy of#7448's pin, in the home the card named, plus a fixture-backed control.
3. The same two counts, in the pin's own file header (in surface). The test
file's header carried the drifted counts word for word — "
docs/is 15 files ofINTERNAL material" and "the 183 files under
content/docs/**". Both are in thisPR's binding file surface, both are the same defect class, and leaving one of the
two copies guarded while the stale twin sat in the file that guards it is how the
guarded one gets "corrected" back from the twin later. Both sentences are
rewritten to name the trees without sizing them, and the pin reads that header as
a second surface.
The pin, and why it is not a verbatim copy of its twins
The two #7448 twins (
check-doc-fence-languages.test.ts,check-doc-component-types.test.ts) match a numeral immediately adjacent to apopulation noun. Run verbatim over this header before the fix, that pattern
reports one of the two live counts:
"holds 15 INTERNAL documents" is a document count by any reading, and the
adjective between the numeral and the noun is all it took to score clean. The
twins' own docstrings state the intent as "a numeral DIRECTLY qualifying a
document-population noun", so the third copy implements that stated intent rather
than a new rule: up to two intervening words are allowed, and an issue reference
is excluded at the pattern level instead of by luck. The noun set is unchanged
from the twins.
Both twin workflow headers are clean today under both patterns, so this is a
latent gap in those two instruments, not a live falsehood on their headers. Filed
separately rather than fixed here — see below.
Positive control — the pin fails, then passes, on both surfaces
Ruling ③: a pin that cannot fail is not a pin. Four legs, one script, mutation
proved on disk before each reading and the restore proved against the
HEADblob(script: an
EXIT INT TERMtrap restoring both files by absolute path).check-links.yml's headerLeg A, the pin naming itself:
Leg B, the second surface:
Restore legs, proved rather than assumed:
The pin's fixture table asserts the same power without a mutation: the two
pre-fix sentences of this header and the two the #7448 twins' headers carried are
fixtured as positives; the negatives are every number a workflow header
legitimately keeps — an issue reference,
04:17 UTC,one 502,node-version: 22,timeout-minutes: 10, "the third instance of the same shape", and~297 site-absolute links, which is the near miss that decides how far thepattern may reach past the numeral.
Confirmations the ruling asked for, quoted verbatim
Governed surface (⑤).
.github/workflows/is not governed; run anyway:#3653's by-command doc pin (⑤). Confirmed, not assumed. The pin in
ci-cd-pipeline-doc.test.tscompares the first-party commands inci.yml'srun:steps against the page's job table.check-links.ymlis a separateworkflow that runs no command at all — its single step is
uses: lycheeverse/lychee-action@v2— and this PR adds and removes no cicommand, so no doc row is owed.
ci-cd-pipeline-doc.test.tsis green in the runbelow.
Changeset (⑥). Its verdict, obeyed verbatim, measured on this branch's final
tree:
Nothing owed, so nothing added — and per this repo's rule the
skip-changesetlabel is NOT applied here: it reads as a mechanism and is not one in objectui.
Clause-② stays
no(⑦). Prose and tests only. The scan scope is decided bythe
argsglob list, which is byte-identical toorigin/main; the threepre-existing scope assertions are untouched and still green.
Verification
Run after the final commit
a5b52c4fa, withgit diff HEADempty.scripts/__tests__/is the union that owns every workflow and prose pin in thisrepo, so it is the union this diff can move; the per-package
turbo run lint/turbo run type-checkfarm is untouched by a comment and a script test, and CIruns it regardless.
Filed separately, not fixed here
content/docs/guide/ci-cd-pipeline.mdsays Lychee sweeps "content/docs/(the183 pages the site publishes) and the repo-root
docs/(15 files of internalmaterial)". Outside this PR's binding file surface, and editing a published
page pulls in the whole doc-gate family.
Generated by Claude Code