Repository navigation
fix(skills): regen must not print a verdict it did not earn - #819
Merged
Merged
Conversation
`skills-check.sh` ended with one unconditional `echo "skills-check: ok"` that
every subcommand fell through to — including `regen`, which rewrites the
generated blocks and asserts **nothing**. So the output of a run that checked
nothing was indistinguishable from the gate passing:
$ bash scripts/skills-check.sh regen
skills-check: regen
regenerated 18 generated files
skills-check: ok <- checked nothing
Measured cost: a red `agent skills (lint + drift)` on #812. I ran `regen`, read
that line, and pushed a SKILL.md eight lines past the 500-line body cap — a
`lint` error `regen` never looks for. There is a second reader too:
`generated-artifact-healer`'s allow-list includes `skills-check.sh regen`, so
the false verdict was being served to an autonomous agent as well as to me.
The fix is a verdict that cannot over-claim, because it enumerates what it
covered:
skills-check: ok (drift, lint, overrides, generators) # all
skills-check: ok (overrides) # overrides
skills-check: regen done — NOTHING WAS CHECKED. The gate is 'make skills-check'.
Each dispatch arm declares the stages that actually assert something; `regen`
declares none, and the empty list is what selects the second message. Nothing
in the tree parses the old line — checked across workflows, the Makefile and
the scripts — so this is output-only.
The self-test covers both directions, and the slow half is **stubbed rather
than skipped**: `regen` was measured at 113s on this repo, so the suite copies
the real script with only `run_regen` replaced, leaving the dispatcher and the
verdict — the logic under test — intact. The insertion is asserted to have
happened exactly once, because an anchor that stopped matching would silently
run the real 113s regen and pass having proved nothing. Runs in 0.59s.
Mutation-tested against the real pre-fix file from `origin/main` rather than a
hand-built mutant: that file fails three of the new assertions, including the
load-bearing one. My first hand-built mutant passed it, which was the test
being inconclusive rather than the code being right — it died on `set -u`
before reaching the verdict.
My first draft of that assertion was itself wrong in this file's own documented
way: `… | grep -cFx '…' | grep -qx 0` reported a failure against correct
output, because `grep -c` exits 1 when it counts zero and `pipefail` promotes
that to the pipeline's status — with `grep -q` behind a pipe on top of it. It
now counts into a variable with `|| true` and compares numerically, which is
the idiom the rest of the file already uses.
athvin
marked this pull request as ready for review
November 7, 2026 22:50
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.
Closes #818
What
skills-check.shprinted one unconditionalskills-check: okfrom everysubcommand — including
regen, which rewrites generated blocks and assertsnothing. The verdict now enumerates the stages that actually checked something,
and a run that checked nothing says so.
Why
That line cost a red CI job on #812:
regensaidokover a SKILL.md eightlines past the 500-line body cap, which is a
linterrorregennever looksfor.
generated-artifact-healer's allow-list also includesskills-check.sh regen, so the false verdict was being served to an autonomousagent too.
Proof
make skills-check→skills-check: ok (drift, lint, overrides, generators),exit 0. Self-test 14/0 in 0.59s. Mutation-tested against the real pre-fix
file from
origin/main: it fails 3 of the new assertions, including theload-bearing one.
scripts-home-check,workflow-shell-checkandpr-contract-checkgreen.Risk & rollback
Output-only: no caller parses
skills-check: ok— checked across the workflows,the Makefile and
scripts/. The one structural change is achecked=()arrayread under
set -uon bash 3.2, guarded by a length test rather than a defaultexpansion. Rollback: revert.
Post-merge ledger
Closed by: agent · session
4bc5a8d3-968f-421f-97af-274d64ddb944onbrians-MacBook-Pro· 2026-11-07T23:10:41Zmainis green with this change on it — mergeabdccb89,rustrun42423190356: success, 23 jobs, no failed jobs.infra,devcontainerandfrontendon the same SHA also success, andorigin/mainisabdccb89with no failures on its head.images—n/a, 0 runs onabdccb89: nothing that goes into animage changed (
scripts/,.claude/).deploy—n/a, 0 runs. No image build means noworkflow_run,and nothing under
infra/k8s/**changed for deploy's own push door.(Contrast feat(ci): a
deferredledger annotation, enforced so it cannot retire work #812, which produced askippeddeploy run; zero runs and askipped run both mean "not deployed", and both are correct here.)
deployn/aasabove;
driftgreen 2026-11-07T06:01;kind's scheduled leg green2026-11-07T06:44. Neither reads anything this diff touches.
Done, by the automation, confirmed from the issue'sown timeline rather than the card: skills-check: 'regen' prints a reassuring line and does not lint — say so where it is read #818 is
CLOSED / COMPLETEDwithcloser.__typename = PullRequest,#819. Never touched by hand.n/a, none owed. skills-check: 'regen' prints a reassuring line and does not lint — say so where it is read #818 is fully closed by this change,and nothing was deferred out of it.
regen's own output now names the gate instead of printing a verdict, andthe authoring standard says so beside the 500-line body cap, which is the
rule an author is most likely to trip mid-edit. The deeper lesson —
running a stage of a gate is not running the gate — is now structural
rather than documented: the verdict enumerates its coverage, so it cannot
claim more than it did.
Specific to this change
main— notjust in the worktree. Against a real checkout of
mainatabdccb89:bash scripts/skills-check.sh overrides→skills-check: ok (overrides),and the stubbed no-check arm →
skills-check: regen done — NOTHING WAS CHECKED. The gate is 'make skills-check'.An earlier attempt to run thescript extracted to a temp directory failed on its own path resolution and
proved nothing, which is why this was redone in a real checkout.
blocked — not observable.Generated artifact healerreads backdisabled_manually,and it fails closed on a missing
COPILOT_GITHUB_TOKENthe repositorydoes not have, so there is no run in which to observe it. The claim that
the fix helps that caller rests on its allow-list containing
skills-check.sh regen— real, but unexercised. Left EMPTY deliberately:ticking it would assert a verification nobody performed, and an empty box
means exactly one thing.
Context — plan, discoveries, measurements, files
Plan
regendeclares none.
ok (<stages>), or — when nothing was checked — amessage naming the real gate.
Discoveries
skills-check: ok, not the one my ticket named.I had filed this against
generated references are current; the actual falseverdict was the unconditional
okat the end of the script, whichregenreached having checked nothing. Reading the dispatcher changed the fix.
regentakes 113 seconds (18 generators), measured — which is why theself-test stubs
run_regeninstead of calling it. A minute added to everymake skills-checkwould have been the price of a behavioural test.conditional and passed, because the mutant died on
set -uexpanding anempty array before it ever printed a verdict. Using the real pre-fix file
from
origin/mainis what made the mutation test meaningful — and it fails3 assertions.
… | grep -cFx '…' | grep -qx 0reported failure against correct output:grep -cexits 1 on a zero count andpipefailpromotes it, plusgrep -qbehind a pipe. The file exists to document exactly that trap.
.github/workflows, theMakefileandscripts/.rust.ymlrunsallandcheck; the healer runsregenandcheck; none inspect stdout.Measurements
regenwall timemainmake skills-checkok (drift, lint, overrides, generators)Files
scripts/skills-check.shcheckedstages; the verdict that names themscripts/ci/skills-check-test.sh.claude/skills/skill-writer/references/agent-skills.md