Repository navigation
feat(skills): skill-audit gains the drift lens, and the standard stops calling the gate advisory - #706
Conversation
End-to-end run of the new lens:
|
6698257 to
0a67d42
Compare
…indings were The first campaign over this collection audited twelve skills and landed a fix on each. Ten of those fixes corrected a claim the tree had outgrown — a deleted client, a renamed CI job, a signature that gained an argument, a section number, an absence that had filled in. Reproducible from `git log --oneline d72cda5~1..0862251`. None of the six lenses asked for that. Auditors filed the findings under `counts`, because the remedy matched — derive it — which left the lens doing someone else's job and the dominant failure class unnamed. Worse, the protocol framed opening a source file as a bounded *exception*, and listed "inventing a finding from a filename" as an anti-pattern, so the skill mildly discouraged the one pass that produced most of its value. So `drift` is now a lens of its own: - It is the only lens that opens the source, and the only one whose findings no gate can catch — nothing in `scripts/skills-check.sh` reads a skill's prose against the code it describes. - It carries a table of the six shapes that rot, each with the probe it wants. - An **absence** is called out as the dangerous shape: "the only X", "there is no Y". It reads as a convention rather than as inventory, so nobody re-checks it, and a skill stating one is telling a session not to look. - The subclass worth the most is a "not yet"/"cannot" claim whose blocker has since been removed, because it makes a session decline work that is routine. - A probe is mandatory. "Never reports a drift claim it did not probe" is now in the never-does list, the verification checklist asks whether the probe actually ran this session, and the challenger is told to re-run it rather than trust the draft's source citation. A confident false drift finding sends the author to correct a sentence that was right, which is worse than silence. The `counts` boundary is stated explicitly, because the two overlap on every number: `counts` asks where the fact lives (remedy: derive it) and fires even when the number is correct; `drift` asks whether it is true today (remedy: correct it, then consider deriving). Both wrong and un-derived is ONE card, filed under `drift`, generator named in the Fix. Two eval scenarios, one each way: 7 must probe a planted "there is no `<table>`" claim and report it HIGH with a real source citation, and 8 must WITHHOLD on a deliberate superseded-pattern warning, where the grep that appears to falsify the claim is the evidence the warning is needed. The description trades a wordier routing clause for "whether a claim about the tree has gone stale", so the trigger vocabulary carries it. Both clauses the inventory generators project were left byte-identical, so the generated tables do not move. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`agent skills (lint + drift)` became a required status check on `main` while this was being written, which made three passages in the standard false in the direction that matters — they tell a reader to distrust a green that is now trustworthy: - the drift check's duplication in the cargo `lint` job was justified by "`skills` is not a required status check, so on its own it cannot block a merge". The duplication is now belt-and-braces, and the sentence said the opposite of the current configuration. Kept the duplication, replaced the reason — it costs seconds and removing it buys nothing. - "**Do not read a `.claude`-only PR's green as proof the generated references are current** until it is promoted" — it is promoted, so that green now IS the proof. Being ungated it reports on every PR; being required it can refuse one. - "not yet a required status check. Per docs/frontend-testing.md's rule, promote it only after it has been observed failing." That last rule was honoured, and the observation is now recorded rather than dropped, because it demonstrates the stake: on throwaway PR #699 — a `.claude`-only diff with a one-line description edit and no regen — the skills job FAILED while every other required context reported `skipped`, since `detect` correctly skipped every compile job and protection accepts `skipped` as satisfied. The only job that noticed was the only job that could not block. Also adds the `post-merge-surface` row to the generator table, which a peer's generator had been left out of. Not a count — the table is the hand-written index of which generator owns which target, and the script had fourteen generators to its thirteen rows. Deliberately NOT changed: `ci-and-supply-chain/SKILL.md` says the `workflow pins (S9)` job is "not yet a required check". Probed the protection API — it is still not required, so that one is accurate. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
0a67d42 to
41566d9
Compare
…e gate could not see it #706 landed the missing `post-merge-surface` row while this branch was open carrying the same fix, so rebasing produced two rows for one generator with different "Derived from" prose. Kept the derivation-shaped wording, because the set-difference paragraph above the table now cites `post-merge-surface` by name and only that wording supports the claim. The rebase merged cleanly and `make skills-check` stayed green through it, which is the part worth fixing: `generator_table_ids` ran `sort -u` before the set comparison, so a duplicate row was deduplicated out of existence on its way to the diff. The gate this branch adds was built to catch a hand-maintained table disagreeing with the code, and a table that says two different things about one generator is that same defect — it just arrives by concurrent PR rather than by omission. So the ids are now extracted twice: deduplicated for the set comparison, and raw for a `uniq -d` pass. Observed failing before being trusted, per docs/frontend-testing.md — reintroducing the duplicate row fails `skills-check.sh generators` with exit 1 and names the id. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…t main The block this branch introduces is derived from every skill's `description`, so it goes stale whenever any of them changes — and three landed while the branch was open. #706 lengthened `skill-audit` to 1017 characters, which drops its headroom from 17 to 7 and moves it to the top of the table, and `land-pr` shortened, which moves it past `skill-writer`. Regenerated output only; no prose or threshold changed. Worth noting what the refreshed numbers say, since the block exists to be read: `skill-audit` now has 7 characters free against a 56-character median routing clause, so it is the next description that cannot take a tail without being trimmed first. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…dropped for want of 31 characters (#713) * fix(skills): the description budget, and the routing clause an audit dropped for want of 31 characters `description` is capped at 1,024 characters and is a shared append target: closing an overlap means appending a clause to a NEIGHBOUR's description, so unrelated audits all spend the same line. Fifteen of twenty-three descriptions had arrived within 34 characters of the cap with no single author having spent it, and six within nine. The cost was not hypothetical. The `sql-analysis` audit (#697) found that `entity-framework` and `sql-analysis` both carry the E0xx and oracle triggers while neither tail hands them over, decided the clause was needed, and then DROPPED it because `entity-framework` had 31 characters free. That is the one outcome the standard already forbids — docs/agent-skills.md:113 says to shorten that description rather than drop the routing, because an unclosed overlap costs a mis-selected skill at runtime, which is the failure the field exists to prevent. The clause is now in, and `entity-framework` has more headroom than it started with. Thirteen descriptions trimmed on the standard's own rule: cut the **what** clause, never the trigger vocabulary. Every noun, command, filename and error string a person would type is preserved; what went is explanation the body already carries — "and why each is pinned", "rather than by account", "and why it sits there", "the measurements a speed claim needs". Four skills are left alone because they are in open pull requests (#699, #702, #705); the generated table names them rather than leaving it to be rediscovered. The durable half is that generated table. The standard's remedy had been "read the headroom before adding a tail" plus a shell one-liner, which is a step an author can skip — and skipping it is exactly how #697 ended up choosing between a count and a correct routing graph. The threshold is DERIVED rather than chosen: the median routing clause in the collection, so "cannot take another clause" is measured against what a clause actually costs here instead of a number someone picked. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(skills): the derived threshold was measuring whole descriptions, not clauses The clause-length regex was unanchored, so `[^;]*\bfor .*see [a-z0-9-]+` matched from the start of each `;`-delimited segment and swallowed the what clause with it. Of 77 "routing clauses" it found, fifteen were 698-868 characters — entire description prefixes. The reported median was right anyway (59 vs 56 now), because a median ignores outliers. That is luck, not a design, and the whole claim of this block is that the threshold is DERIVED rather than picked — so an extraction that measures the wrong thing undermines the one property worth having, even while printing a plausible number. Anchored on `for`, split on sentence as well as clause boundaries: 76 clauses, 28 to 162 characters, median 56. The splitting moved to awk because BSD and GNU sed disagree about `\n` in a replacement, and this generator runs on both. Found by checking what the extraction actually returned instead of trusting a believable aggregate. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore(skills): regenerate the description-budget block against current main The block this branch introduces is derived from every skill's `description`, so it goes stale whenever any of them changes — and three landed while the branch was open. #706 lengthened `skill-audit` to 1017 characters, which drops its headroom from 17 to 7 and moves it to the top of the table, and `land-pr` shortened, which moves it past `skill-writer`. Regenerated output only; no prose or threshold changed. Worth noting what the refreshed numbers say, since the block exists to be read: `skill-audit` now has 7 characters free against a 56-character median routing clause, so it is the next description that cannot take a tail without being trimmed first. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…e that drifted while we were in there (#703) * docs(skills): the generator table never learned about post-merge-surface `run_regen` wires 13 generators; the table in the standard listed 12. `post-merge-surface` — the `land-pr` reference that set-differences every workflow's triggers down to the ones no pull request can pre-test — was added with that skill and never reached the table, and nothing noticed because the table is hand-maintained prose. The "three of these are set differences" sentence was wrong for the same reason: `post-merge-surface` is a fourth. Rephrased without the count, since a count in prose here is the defect this document spends a section warning about. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(skills): gate the generator table against the generators actually wired The previous commit fixed one missing row by hand, which leaves the mechanism that produced it intact: the generator table in docs/agent-skills.md is a hand-maintained list of something code owns, and this repo's whole answer to that shape is to derive it. `skills-check.sh generators` extracts the id set from the `splice` calls in `run_regen`, extracts it from the table, and set-differences both ways: - wired but unlisted — what `post-merge-surface` was - listed but unwired — a row left behind when a generator is retired, which reads as documentation of something that no longer runs The "Derived from" column stays prose deliberately. What a generator derives and *why* is the part worth reading and the part no script can write; only the id set is derivable, so only the id set is asserted. Observed failing before being trusted, in both directions: deleting the `post-merge-surface` row fails with that id named, and adding a `ghost-generator` row fails with the opposite message. Also proved the extractor cannot fail open — an empty wired set is its own error rather than a vacuous pass. Runs in `lint` and `all`, so it needs no toolchain and reports on a `.claude`-only PR, same as `overrides`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(skills): the eval still asserted a glob that matches nothing `entities/*.yaml` matches zero files — the layout is `entities/<name>/entity.yaml`, 49 of them. The body was rewritten to say `entities/` and the eval beside it was not, so scenario 1 asked a session to justify `entities-check` with a path that does not exist. Scoped deliberately to this file. The same shorthand sits in nine other tracked places (the design doc, CONTRIBUTING.md, rust.yml, the Makefile, an `er-entities/Cargo.toml` comment, the eslint config), where it reads as established shorthand for "the entity YAMLs" rather than a typo — rewriting those would put a comment-only change through the full Rust and frontend gates and is not this change's business. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(skills): the table gained a second post-merge-surface row, and the gate could not see it #706 landed the missing `post-merge-surface` row while this branch was open carrying the same fix, so rebasing produced two rows for one generator with different "Derived from" prose. Kept the derivation-shaped wording, because the set-difference paragraph above the table now cites `post-merge-surface` by name and only that wording supports the claim. The rebase merged cleanly and `make skills-check` stayed green through it, which is the part worth fixing: `generator_table_ids` ran `sort -u` before the set comparison, so a duplicate row was deduplicated out of existence on its way to the diff. The gate this branch adds was built to catch a hand-maintained table disagreeing with the code, and a table that says two different things about one generator is that same defect — it just arrives by concurrent PR rather than by omission. So the ids are now extracted twice: deduplicated for the set comparison, and raw for a `uniq -d` pass. Observed failing before being trusted, per docs/frontend-testing.md — reintroducing the duplicate row fails `skills-check.sh generators` with exit 1 and names the id. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
The two follow-ups flagged at the end of #689, plus a consistency sweep. One commit each.
1.
skill-auditgains adriftlens —9a0a26f9The first campaign over this collection audited twelve skills and landed a fix on each. Ten of those twelve corrected a claim the tree had outgrown — a deleted client, a renamed CI job, a signature that gained an argument, a cited section number, an absence that had filled in. Reproducible from
git log --oneline d72cda56~1..08622516. Since then #694 landed "the AWS skill asserted absences that had stopped being true", independently finding the same subclass.None of the six lenses asked for that pass. Auditors filed the findings under
countsbecause the remedy matched — derive it — which left the lens doing someone else's job and the dominant failure class unnamed. Worse,protocol.mdframed opening a source file as a bounded exception and listed "inventing a finding from a filename" as an anti-pattern, so the skill mildly discouraged the pass that produced most of its value.What the lens adds:
scripts/skills-check.shreads a skill's prose against the code it describes. That gap is now stated in the boundary table's own section.driftclaim it did not probe" is in the never-does list, the verification checklist asks whether the probe ran this session, and the challenger is told to re-run it rather than trust the draft's citation — a skill quoting a line that no longer exists will supply a convincing quote.countsboundary is explicit, since they overlap on every number:countsasks where the fact lives and fires even when it is correct;driftasks whether it is true today. Both wrong and un-derived is one card, filed underdrift, generator named in the Fix.Two eval scenarios, one each way — 7 must probe and report, 8 must withhold on a deliberate superseded-pattern warning, where the grep that appears to falsify the claim is the evidence the warning is needed.
2. The standard stops describing the gate as advisory —
66982576agent skills (lint + drift)became a required status check while this was being written — a peer promoted it, so the API change was not mine to make. That left three passages in the standard false in the direction that matters: they tell a reader to distrust a green that is now trustworthy.The observation the promotion rule demands is now recorded rather than dropped, because it shows the stake. On throwaway PR #699 — a
.claude-only diff with a one-line description edit and no regen — the skills job failed while every other required context reportedskipped:detecthad correctly skipped every compile job, and protection acceptsskippedas satisfied. The only job that noticed was, at that moment, the only job that could not block the merge.Also adds the
post-merge-surfacerow to the generator table — the script had fourteen generators to the table's thirteen rows.Verification
bash scripts/skills-check.sh all→ ok (regen + drift + lint + overrides, 23 skills), re-run after rebasing onto73e9da7c. Perland-pr's table, that is the gate for a.claude/+docs/change; no Rust, TypeScript or Terraform is touched, socargo/next build/terraform validatehave nothing to say about this diff.protocol.mdfromlenses.md, which the one-level reference rule bans. Fixed to a prose reference..claude/skills/security, a skill nobody has audited, following the new definition. It produced two verified findings and correctly withheld on two claims that look stale and are not. Details in the PR comments.Not done, deliberately
ci-and-supply-chain/SKILL.md:284says theworkflow pins (S9)job is "not yet a required check". I probed the protection API — it is still not required, so the claim is accurate and I left it.🤖 Generated with Claude Code