Skip to content

docs(ci): drop the two hand-copied self-test case counts from ci-cd-pipeline.md - #6118

Merged
yinlianghui-tw merged 1 commit into
mainfrom
claude/issue-6100-ci-doc-selftest-counts
Aug 24, 2026
Merged

docs(ci): drop the two hand-copied self-test case counts from ci-cd-pipeline.md#6118
yinlianghui-tw merged 1 commit into
mainfrom
claude/issue-6100-ci-doc-selftest-counts

Conversation

@yinlianghui-tw

Copy link
Copy Markdown
Collaborator

Fixes#6100

What changed

Two lines of prose in content/docs/guide/ci-cd-pipeline.md, in the Hook Self-Tests
(hook-selftests.yml)
section. The sentence named a case count for each of the two
PreToolUse guard matrices; both counts are gone:

-Runs `.claude/hooks/guard-main-checkout-bash.selftest.sh` (100 cases) and-`.claude/hooks/guard-shared-stash.selftest.sh` (32 cases) — the hermetic self-test matrices for+Runs `.claude/hooks/guard-main-checkout-bash.selftest.sh` and+`.claude/hooks/guard-shared-stash.selftest.sh` — the hermetic self-test matrices for

Nothing else on the page is touched — not the ci.yml job table, not the workflow
inventory, not the hooks or their matrices. The remaining half of the sentence is
grammatical as-is; no further rewording was needed.

Why removal, not an update

This is option 1 of the three the card laid out, per the dispatch ruling on the issue.

  1. It mirrors the ruling already made on [finding] hook-selftests.yml hard-codes both self-test case counts in its step names, with no derivation recipe and nothing that re-checks them #6089 one file over. That PR removed the
    workflow's three copies, so this page was the only remaining hand-copied copy —
    and the one a contributor actually reads.
  2. The page already enforces this exact principle on itself.
    scripts/__tests__/ci-cd-pipeline-doc.test.ts carries a test named "states no job
    count, so the number cannot drift away from the table"
    , whose comment reads: "a
    hand-maintained count drifts by construction and a stale one still reads as
    authoritative. 'Seven jobs, all parallel' outlived the seventh job by three months."

    That decision (ci-cd-pipeline.md 的 ci.yml job 表格漂移:写「Seven jobs」并列了一个不存在的 dev-server job(实际 6 个) #3451, Docs:ci-cd-pipeline.md 的工作流清单与 ci.yml 一节仍与实际不符(11 vs 12、两个工作流没被记录、五个任务名里三个不存在) #3212) was made for the ci.yml job count on this same page.
    These two case counts were the identical construction one section down.

The numbers remain available twice, correctly: each run's own tail prints
N passed, N failed, and guard-shared-stash.sh's header carries its count with the
recipe to re-derive it
.

Deliberately not updated to 41 / 121. Two drafts move them (#6042 and #5789 are the
cards behind those), and re-typing the new numbers re-arms the same drift.

The pin check, done rather than inherited

The card's reading was that every pin on this page is scoped to ci.yml or to workflow
filenames, leaving these two numbers unpinned. Verified independently, and wider than
one file:

  • ci-cd-pipeline-doc.test.ts matches zero times on selftest, Self-Test, cases,
    guard-main-checkout, guard-shared-stash.
  • Repo-wide, no .ts/.tsx/.mjs file contains the literals 100 cases or 32 cases.
  • Every other file that reads this page — lint-workflow.test.ts,
    merge-queue-reporting.test.ts, dependabot-merge-gate.test.ts,
    doc-version-claims.test.ts, check-action-forward-parity.test.ts,
    quick-reference-current-release-4143.test.ts, scripts-type-check.test.ts — was
    checked for a read of this sentence. None has one. (doc-version-claims.test.ts does
    hold a registry entry for this page, but for the Node 22.x claim, not a case count.)

So no pin was part of this diff.

Verification — at 80dcab88d

CheckVerdict line it printed
vitest run scripts/__tests__/ci-cd-pipeline-doc.test.tsTest Files 1 passed (1) / Tests 32 passed (32)
vitest run scripts/ (all 67 script suites, incl. every reader of this page)Test Files 67 passed (67) / Tests 1848 passed (1848)
docs:check-linksLinks are valid across 15 scan roots.
check:doc-typesEvery documented component type is registered. (183 doc files, 1054 code blocks)
check:control-bytescheck-control-bytes: OK (scanned 5062 tracked text file(s); skipped 85 binary).
check-changeset-presence.mjsNo source of a released package changed in this range, so no changeset is owed.

Control-byte scan over the diff's own file, beyond the gate:
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]' content/docs/guide/ci-cd-pipeline.md — no
match. Run from the repo root throughout; vitest reported root
/home/user/objectui-6100, so neither invocation trap applies.

Docs build — a declared narrowing. Rather than a full next build of apps/site
(which pulls in a build of every workspace package), the docs compile was run directly:
fumadocs-mdx in apps/site, exit 0, [MDX] generated files. The narrowing is a
measurement, not a skip: the population is every file under content/docs, which is what
fumadocs-mdx compiles wholesale (the same 183-file docs set check:doc-types reports
scanning); and the diff is prose inside one paragraph — no link, no code fence, no
frontmatter, no new component type — so it cannot move any other file's compile. CI runs
the full build regardless.

Reverse verification — and the honest limit

Predicted direction: stays green, because the claim under test is that these numbers
were unpinned. Re-inserted a deliberately false count (9999 cases) on top of the
committed fix, confirmed on disk by an anchored grep -c returning 1, then ran the doc
suite and check-doc-links again: Tests 32 passed (32) and Links are valid across 15 scan roots. Both stayed green. The restore leg was a trap ... EXITgit checkout, also
confirmed on disk: grep -c '9999 cases' returns 0, the corrected text greps back at 1,
git status --porcelain empty, suite re-run green.

That is the honest limit, and it is the argument for this fix rather than against it: no
gate caught the stale numbers, and no gate will keep the corrected text true.
A pin that
derived them (option 2) was rejected in the dispatch ruling — it would have a docs test
reach into .claude/**, a governed surface, creating a coupling that itself needs
maintaining, in exchange for two numbers a reader does not need. Deleting the duplicated
number is the version of this that cannot go stale.

Scope

Prose only, one file, two lines. Out of scope and untouched: the ci.yml job table, the
workflow inventory, the hooks and their self-test matrices, and the two drafts that change
the counts. No changeset — nothing under a released package's source changed, confirmed by
the gate above.


Generated by Claude Code

The Hook Self-Tests section named a case count for each of the two
PreToolUse guard matrices (100 / 32). Both were hand-copied, had no
derivation recipe, and nothing re-checked them.
The page already enforces the opposite principle on itself: a pin in
scripts/__tests__/ci-cd-pipeline-doc.test.ts requires the ci.yml
paragraph to state no job count, "so the number cannot drift away from
the table". Same construction, one section down.
Each run's own tail prints N passed, N failed, and guard-shared-stash.sh's
header carries its count with the recipe to re-derive it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
@yinlianghui-twClaude

Copy link
Copy Markdown
CollaboratorAuthor

PM: ACCEPT

Ruling executed exactly: both counts removed, ⛔ not updated to 41/121 — which would have re-armed the same drift the moment #6087 or #6046 lands. Diff is the two named lines, +2/-2, one file; the surviving sentence is grammatical as-is, so nothing else was touched on a page that is one of the repo's hottest merge-conflict files.

The reverse verification is the right shape for a negative claim

The claim under test here is "nothing pins these numbers" — and a claim of absence cannot be verified by a green run, because green is also what a broken instrument produces. You inverted it: re-inserted a deliberately false count (9999 cases) on top of the committed fix, confirmed the mutation on disk with an anchored grep -c returning 1 (not an editor's exit code), re-ran the doc suite and the link check, and got 32 passed / links valid — green, as predicted, because nothing reads that number.

Predicting "stays green" and then proving it is a real result. Most reverse-verification legs test that something reddens; this one had to demonstrate that nothing does, which is harder to do honestly.

You checked the pin question wider than the order asked

I told you to verify the card's unpinned reading rather than inherit it. You went past the one suite:

  • ci-cd-pipeline-doc.test.ts → zero matches on selftest / Self-Test / cases / guard-main-checkout / guard-shared-stash;
  • repo-wide, no.ts/.tsx/.mjs file contains the literals 100 cases or 32 cases;
  • each of the seven other test files that read this page checked individually — and you caught the one that looks like a hit and isn't: doc-version-claims does hold a registry entry for this page, but for the Node 22.x claim, not a case count.

That last distinction is exactly the kind of thing a coarser grep would have turned into either a false alarm or a missed pin.

Narrowing declared with an argument, not a shrug

Running fumadocs-mdx's docs compile instead of a full apps/site build is justified rather than asserted: the population is every file under content/docs, which is what fumadocs-mdx compiles wholesale (the same 183-file set check:doc-types reports), and the diff is prose inside one paragraph with no link, no code fence, no frontmatter, no new component type — so it cannot move any other file's compile. CI runs the full build regardless.

The honest limit, and why it argues for this fix

No gate caught the stale numbers and none will keep the corrected text true — this is prose.

Right, and you drew the correct conclusion from it rather than treating it as a weakness: that is precisely why deleting the duplicated number beats documenting or pinning it. Option 2's derived pin was rejected because it would have a docs test reach into .claude/**; the version that cannot go stale is the one where the number isn't there.

With this landed, the page stops carrying a claim about the hooks that the hooks themselves already state correctly — with a re-derivation recipe, in guard-shared-stash.sh's own header.

Landing

⏳ CI converging on 80dcab88d. The self check-in verifies every-check-green and lands it.


Generated by Claude Code

@yinlianghui-tw
yinlianghui-tw marked this pull request as ready for review August 24, 2026 18:44
@yinlianghui-tw
yinlianghui-tw added this pull request to the merge queueAug 24, 2026
Merged via the queue into main with commit c83f502Aug 24, 2026
20 checks passed
@yinlianghui-tw
yinlianghui-tw deleted the claude/issue-6100-ci-doc-selftest-counts branch August 24, 2026 18:56
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants

@yinlianghui-tw@claude