Uh oh!
There was an error while loading. Please reload this page.
ci(hook-selftests): drop the hard-coded case counts from the two step names - #6101
Conversation
… names `.github/workflows/hook-selftests.yml` wrote each self-test matrix's case count into its step name — `guard-main-checkout-bash self-test (100 cases)` and `guard-shared-stash self-test (32 cases)`. Nothing derived those numbers and nothing re-checked them, and a step name has no runtime behaviour, so a stale count can never turn a check red: it only shows a wrong number on the checks page, which is the one place a reviewer actually looks. Each run's own tail already prints `N passed, N failed`, produced by the matrix being counted, and `guard-shared-stash.sh`'s header carries its count together with the recipe to re-derive it. Removing the duplicate beats documenting it — one authoritative copy, not two synchronised ones. The `Cost` note keeps its counts, restated as a dated measurement (2026-08-24 @ 53dc89d): a measurement is history and stays true as a record of what was measured then, while a step label is a live claim. A new header section states that distinction and tells the next editor not to put the counts back. What the workflow runs is unchanged: same job, same steps, same `run:` commands, no step added or removed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
yinlianghui-tw
commented
Aug 24, 2026
PM: ACCEPTRuling executed exactly: counts removed, not updated to 41/121 — which would have re-armed the same drift one cycle later. The Cost note keeps its numbers as a dated measurement, and the new header section makes the measurement-vs-live-claim distinction visible in the file, so the next editor knows why one kept its number and the other did not. That is the part that makes this stick rather than just being undone. The invariance proof is better than what I asked forI said to compare step ids before and after. No step in this workflow declares an That is a stronger claim than the one requested, and it settles "did anything else move" by evidence. You verified the pin question instead of assuming it
The order flagged this because a stale line number and an assumed absence have each cost this lane a round today. Checking it was the right call. A card fact corrected against #6100 is a good catch, and correctly not folded inA fourth hand-copied copy of the same two counts lives at Right to file rather than fold: this card's ruling was scoped to the workflow, the fix form for a docs page is a different call, and that page is one of the repo's hottest merge-conflict files. After this lands it is the only remaining copy. No ablation, stated plainly
Correct, and saying it beats inventing a ceremony that would prove nothing. The honest verification here is the structural diff plus the grep, and that is what you produced.
Landing⏳ CI converging on Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#6089
.github/workflows/hook-selftests.ymlwrote each self-test matrix's case count into its step name:Nothing derived those numbers and nothing re-checked them. A step name has no runtime behaviour, so a stale count can never turn a check red — it only shows a wrong number on the checks page, which is the one place a reviewer actually looks. That is the declared≠actual shape, in the worst possible location for it.
Both counts are removed, not updated. Updating them to 41/121 (the values PR #6087 and PR #6046 move the matrices to) would re-arm exactly the same drift one cycle later. The number is already published by the only thing that cannot get it wrong: each run's own tail prints
N passed, N failed, produced by the matrix being counted. And where a count belongs beside prose,.claude/hooks/guard-shared-stash.sh's header already carries it with the recipe to re-derive it and the instruction to keep it equal to the run's tail. One authoritative copy beats two synchronised ones.The cost note keeps its numbers — restated as a dated measurement
Line ~44 keeps
(100 cases)and(32 cases), now stated as measured 2026-08-24 onorigin/main@53dc89db8. The distinction is the point, and it is now written into the file so the next editor knows why one copy kept its number and the other did not:A new header section, "Why the step names carry no case counts", states that, tells the next editor not to put the counts back, and records why the drift was structural rather than careless: this file is a RUNNER, so the matrices it calls are meant to grow in
.claude/**without this file being touched — which is exactly what PR #6087 and PR #6046 correctly do.Disclosure: this defect is this lane's own
hook-selftests.ymllanded via PR #6022 (card #5754), accepted by this same seat today. The hazard was written here, and found by a dev on a later card. Stating it plainly rather than letting it read as inherited debt.Timing
PR #6087 takes
guard-shared-stash32 → 41 and PR #6046 takesguard-main-checkout-bash100 → 121; neither touches this workflow (both correctly port-scoped). Landing this first makes both of those merges non-events instead of two moments where a step name silently becomes wrong.Verification
Stated honestly: a step name has no runtime behaviour, so there is no assertion to add and no gate would have caught this. What can be verified is that the change is inert with respect to what runs, and that nothing pinned the old names.
1. The workflow still parses, and only the two name strings changed. No step in this workflow declares an
id:, so the identity compared is the fullyaml.safe_loadstructure — job keys, step order,uses:/run:values.python3 -c "yaml.safe_load(...)"exits 0 before and after;diff -uof the two dumps is exactly:Nothing else. Same job, same three steps in the same order, same
run:commands, same triggers, samepathsfilter.2. Nothing pinned these step names — verified, not assumed. Two independent lines of evidence:
git grepfor the literal strings (self-test (,100 cases,32 cases, both step names) across the whole repo returns the workflow itself,.claude/hooks/guard-shared-stash.sh's own header, andcontent/docs/guide/ci-cd-pipeline.md— no test file.scripts/__tests__/ci-cd-pipeline-doc.test.tsand its siblings pin workflow filenames,ci.yml's job keys/names, and (inwhat each job runs)ci.ymlrun:values — all scoped toci.yml, none reading this workflow's step names.scripts/__tests__/suite is green after the change (below), which includes every workflow-reading test in the repo.3. Both self-tests, so the PR records what the tails print — the number the labels were duplicating, from the only source that cannot lie (run on this branch; the hooks are untouched by this PR):
4. Gates, run from the repo root at
241cbe413(final commit, clean tree), each quoting its own verdict line:pnpm vitest run scripts/__tests__ --maxWorkers=2Test Files 66 passed (66)/Tests 1822 passed (1822)node scripts/check-control-bytes.mjs✅ check-control-bytes: OK (scanned 5043 tracked text file(s); skipped 85 binary).node scripts/check-changeset-presence.mjs✅ No source of a released package changed in this range, so no changeset is owed.node scripts/check-changeset-fixed.mjs✅ All workspace packages are in the changeset fixed group.node scripts/check-changeset-no-major.mjspnpm lint(eslint .) was narrowed to the diff, and the narrowing is measured rather than assumed: everyfiles:entry ineslint.config.jsis**/*.{ts,tsx}or narrower, this diff contains one.ymland one.mdand no TypeScript at all, andeslint --format jsonover exactly the two changed paths reports 2 entries with 0 errors. With no TypeScript in the diff, no untouched file's verdict can move. CI runs the full farm regardless.A changeset with empty frontmatter is included: CI-only change, no published package's
src/touched (the presence gate above confirms 0 published-source files in range).Out of scope
The hooks, their self-test matrices, and PRs #6087 / #6046 are untouched — this PR does not change what the workflow runs.
One finding recorded separately, unassigned, rather than folded in: #6100 —
content/docs/guide/ci-cd-pipeline.mdcarries a fourth hand-copied copy of the same two counts (100 cases/32 cases), unpinned by the doc test. Same class, different file and gate family; that page is a hot merge-conflict file and #6100 remains open for a PM/maintainer call on which of its options to take.Generated by Claude Code