Repository navigation
fix(ci): run the drift check where .claude-only PRs can see it, and stop it passing silently - #279
Merged
Merged
Conversation
…top it passing silently Two defects, the second of my own making an hour ago. ## The drift check did not run on the PRs that change skills `detect` skips every compile job for a PR touching nothing but `.claude/**`, and the drift check rode the cargo `lint` job — so it did not run on exactly those PRs. That was sound while every generator derived from code OUTSIDE `.claude/`, because a code change always ran the full gate. `gen_skill_inventory` broke it. It derives from SKILL.md descriptions, so a one-line description edit makes the inventory tables in docs/agent-skills.md and CLAUDE.md stale. Demonstrated: changing landing-page's first clause to "the PROBE route group" leaves both tables stale, and a PR carrying only that change reports three green checks, none of which looks at staleness. It merges green and turns main red on the push-to-main run. The `skills` job now runs `all` rather than `lint`. It still needs no toolchain — verified by running the whole script in a bare ubuntu container with no cargo, node, pnpm, docker, terraform or aws. The check stays in the cargo job as well, because `skills` is not a required status check and so cannot block a merge on its own; promoting it would make the pair redundant, and both halves have now been observed failing. The job is renamed to `agent skills (lint + drift)`, which is safe because it is not among the eight required contexts. ## The drift check passed silently when git was unavailable Introduced in #271. The per-file comparison skips anything it cannot read out of HEAD (`git cat-file -e … || continue`), which is right for a newly added file — but outside a git repository EVERY file is skipped, the stale list comes back empty, and the check reports "generated references are current" and exits 0 having compared nothing. That is the failure this repo keeps a rule about: success and never-ran are indistinguishable from outside. Two guards now, mirroring `lint`'s zero-skills exit and check-bff-authz.mjs's zero-routes exit — HEAD must resolve, and the comparison must have examined at least one file. Verified: outside a repo the check now exits 1 with a named reason. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
Two defects. The second is mine, from #271, about an hour old.
1. The drift check did not run on the PRs that change skills
detectskips every compile job for a PR touching nothing but.claude/**, and the drift check rode the cargolintjob — so it did not run on exactly those PRs.That reasoning was sound when it was written: every generator derived from code outside
.claude/, and a code change always runs the full gate.gen_skill_inventorybroke it. That generator derives fromSKILL.mddescriptions, so a one-line description edit makes the inventory tables stale.Demonstrated — changing
landing-page's first clause to "the PROBE route group":A PR carrying only that change reports three green checks, none of which looks at staleness. It merges green, and the push-to-main run turns
mainred. That exact sequence is already in this repo's history from 2026-10-21.Fix: the
skillsjob runsallinstead oflint. It still needs no toolchain — verified by running the whole script in a bareubuntu:24.04with no cargo, node, pnpm, docker, terraform or aws. Every generator is grep/awk/sed over checked-in files.The check stays in the cargo job as well, deliberately:
skillsis not a required context, so on its own it cannot block a merge. Promoting it would make the pair redundant — worth doing now that both halves have been observed failing, but that's a branch-protection change and yours to make.Renamed to
agent skills (lint + drift), safe because it is not among the eight required contexts. The generatedrequired-checks.mdpicked the rename up by itself.2. The drift check passed silently when git was unavailable
I introduced this in #271. The per-file comparison skips anything it cannot read out of
HEAD(git cat-file -e … || continue) — correct for a newly added file, but outside a git repository every file is skipped, the stale list comes back empty, and the check reports "generated references are current" and exits 0 having compared nothing.That is the failure this repo keeps a rule about: success and never-ran are indistinguishable from outside. It is the same shape as the
pipefail-killed-the-script and semgrep-parse-error cases already indocs/frontend-testing.md.Fix: two liveness guards, mirroring
lint's zero-skills exit andcheck-bff-authz.mjs's zero-routes exit —HEADmust resolve, and the comparison must have examined at least one file.ok, exit 0FAIL … cannot resolve HEAD, exit 1generated_filespath wrong🤖 Generated with Claude Code