Skip to content

fix(skills): regen must not print a verdict it did not earn - #819

Merged
athvin merged 2 commits into
mainfrom
issue/818-regen-verdict
Nov 7, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/818-regen-verdict

Conversation

@athvin

@athvin athvin commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Closes #818

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

skills-check.sh printed one unconditional skills-check: ok from every
subcommand — including regen, which rewrites generated blocks and asserts
nothing. 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: regen said ok over a SKILL.md eight
lines past the 500-line body cap, which is a lint error regen never looks
for. generated-artifact-healer's allow-list also includes
skills-check.sh regen, so the false verdict was being served to an autonomous
agent 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 the
load-bearing one. scripts-home-check, workflow-shell-check and
pr-contract-check green.

Risk & rollback

Output-only: no caller parses skills-check: ok — checked across the workflows,
the Makefile and scripts/. The one structural change is a checked=() array
read under set -u on bash 3.2, guarded by a length test rather than a default
expansion. Rollback: revert.

Post-merge ledger

Closed by: agent · session 4bc5a8d3-968f-421f-97af-274d64ddb944 on brians-MacBook-Pro · 2026-11-07T23:10:41Z

  • main is green with this change on it — merge abdccb89, rust run
    42423190356: success, 23 jobs, no failed jobs. infra,
    devcontainer and frontend on the same SHA also success, and
    origin/main is abdccb89 with no failures on its head.
  • images — n/a, 0 runs on abdccb89: nothing that goes into an
    image changed (scripts/, .claude/).
  • deploy — n/a, 0 runs. No image build means no workflow_run,
    and nothing under infra/k8s/** changed for deploy's own push door.
    (Contrast feat(ci): a deferred ledger annotation, enforced so it cannot retire work #812, which produced a skipped deploy run; zero runs and a
    skipped run both mean "not deployed", and both are correct here.)
  • the push-only surface no pull request can pre-test — deploy n/a as
    above; drift green 2026-11-07T06:01; kind's scheduled leg green
    2026-11-07T06:44. Neither reads anything this diff touches.
  • the board card — Done, by the automation, confirmed from the issue's
    own 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 / COMPLETED with
    closer.__typename = PullRequest, #819. Never touched by hand.
  • follow-ups — 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.
  • what was learned is written down — in the two places it will be read:
    regen's own output now names the gate instead of printing a verdict, and
    the 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

  • confirmed the shipped script prints the new verdict on main — not
    just in the worktree. Against a real checkout of main at abdccb89:
    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 the
    script extracted to a temp directory failed on its own path resolution and
    proved nothing, which is why this was redone in a real checkout.
  • the healer's next run reads the honest line — blocked — not observable. Generated artifact healer reads back disabled_manually,
    and it fails closed on a missing COPILOT_GITHUB_TOKEN the repository
    does 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

  1. Each dispatch arm declares the stages that assert something; regen
    declares none.
  2. The final verdict prints ok (<stages>), or — when nothing was checked — a
    message naming the real gate.
  3. Self-test both directions, with the 113s stage stubbed rather than skipped.
  4. Say it where an author meets the cap, in the authoring standard.

Discoveries

  • The misleading line was skills-check: ok, not the one my ticket named.
    I had filed this against generated references are current; the actual false
    verdict was the unconditional ok at the end of the script, which regen
    reached having checked nothing. Reading the dispatcher changed the fix.
  • regen takes 113 seconds (18 generators), measured — which is why the
    self-test stubs run_regen instead of calling it. A minute added to every
    make skills-check would have been the price of a behavioural test.
  • A hand-built mutant proved nothing. My first mutation test rewrote the
    conditional and passed, because the mutant died on set -u expanding an
    empty array before it ever printed a verdict. Using the real pre-fix file
    from origin/main is what made the mutation test meaningful — and it fails
    3 assertions.
  • My first assertion was wrong in this file's own documented way.
    … | grep -cFx '…' | grep -qx 0 reported failure against correct output:
    grep -c exits 1 on a zero count and pipefail promotes it, plus grep -q
    behind a pipe. The file exists to document exactly that trap.
  • Nothing parses the verdict line — checked across .github/workflows, the
    Makefile and scripts/. rust.yml runs all and check; the healer runs
    regen and check; none inspect stdout.

Measurements

regen wall time 113s (why the stub exists)
self-test wall time 0.59s, 14 assertions
suite vs. the pre-fix file from main 3 failures
make skills-check exit 0, ok (drift, lint, overrides, generators)

Files

File Role
scripts/skills-check.sh per-arm checked stages; the verdict that names them
scripts/ci/skills-check-test.sh 3 new assertions + the stub-insertion guard
.claude/skills/skill-writer/references/agent-skills.md said beside the body cap, where an author meets it

`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
athvin marked this pull request as ready for review November 7, 2026 22:50
@athvin
athvin merged commit abdccb8 into main Nov 7, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skills-check: 'regen' prints a reassuring line and does not lint — say so where it is read

2 participants