Uh oh!
There was an error while loading. Please reload this page.
feat(scripts): farm-wide detector for the #8435 ratchet-remedy authority convention - #8575
Conversation
…ity convention A gate whose second remedy edits a shrink-only ratchet/ledger/baseline must either mark that path `⛔ MAINTAINER-ONLY` or turn it down outright. Six gates do (PR #8517, #8539, #8549); nothing stopped the seventh from not. Enforces the DISJUNCTION, per the #8540 triage ruling: the two ⛔ tokens stay distinct (authority vs ratchet direction), and the refusal shape is never a violation — it satisfies the convention more strongly than marking does. Sweeps `scripts/*.{mjs,mts}` — never `*.mjs`, the blind spot behind #8538. Three stages: an offer grammar over author-facing text only, the gate's own testimony that the target is a ratchet rather than a declaration registry, and a refusal grammar that negates the act rather than merely discouraging it. Ships with its hand-classified control corpus, set-equality audited both ways. The direction that matters is STALE: a detector that quietly stopped matching would otherwise report a clean farm while reading nothing — the exact failure the convention it enforces is about. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jqe56GnYFddggeAyfkZFVz
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jqe56GnYFddggeAyfkZFVz
…uard Mutation-testing found the assertion false-secure: its fixture stopped before any target followed the verb, so the offer failed for want of a target and the guard was never consulted. Deleting the guard left the assertion green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jqe56GnYFddggeAyfkZFVz
…mentary Reverse verification found the hole: stripping the authority token from a real gate left the detector green, because that gate's own header mentions the token in a comment. A source-wide search reads a gate's commentary as compliance, so the gate could go silent for every author who trips it while the farm reported clean — the exact failure the convention exists to prevent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jqe56GnYFddggeAyfkZFVz
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
qq9340100
commented
Aug 13, 2026
ACCEPTed on substance by the Four things earn the accept beyond the diff. ① Assumption A came back half-confirmed, and the correction is the useful half. I asked for the corpus to be re-measured rather than inherited, expecting it to have grown. It hadn't: 79 both times, membership unchanged from the card's ② Two real defects found by the dev's own verification, not by CI.
③ The mutation harness institutionalises today's lesson instead of just obeying it. This lane learned a few hours ago that a mutation can silently no-op and return green, indistinguishable from an assertion correctly not firing. Rather than promising to check by hand, the harness refuses any anchor that does not match exactly once and echoes the mutated line from The five prediction mismatches across 17 mutations are accepted without reservation — all are under-predicted overlaps in the safe direction (an extra assertion also fired, each with an accurate label), and M8/M12/M15's predictions were written before assertions 18/19 existed. A prediction that was honest when written and is superseded by later work is not a miss. ④ Assumption C answered YES with a qualifier that matters more than the answer. Refusal is mechanically detectable — but only one gate ( Also noted: Two review points
Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#8540
A farm-wide detector for the #8435 ratchet-remedy authority convention, shipped with its hand-classified control corpus and a positive-control assertion at corpus scale.
What it enforces
The disjunction triage ruled, not the marking shape alone: a gate offering a ratchet/ledger/baseline-expanding remedy must either carry
⛔ MAINTAINER-ONLYor refuse the remedy outright. The refusal shape is never a violation — it satisfies the convention more strongly than marking does, and the detector never pushes a refusing gate onto the weaker shape. The two ⛔ tokens stay distinct: authority vs ratchet direction, read as compliance token and as evidence-about-the-registry respectively, never interchanged.Sweeps
scripts/*.{mjs,mts}— never*.mjs, which is the blind spot that made #8538 necessary.Measurements
Corpus re-measured 2026-08-13T22:31:35Z: 79 pre-existing scripts (77
.mjs+ 2.mts), 80 with this file. Membership is unchanged from the card'sf1da948d8, but four members changed content since — includingcheck-driver-conformance.mjs, which gained the authority token in PR #8539 after the card's prototype was measured.Final result: 6 marked, 1 refused, 0 unmarked, 73 excluded — precision 100%, recall 6/6 on the known instances.
Both known misses are fixed, neither carried as an exception:
add a TEST_DEBT entry in …andadd … to … REGISTRYare equally reachable.check-driver-conformance.mjs's differently-worded authority evidence) — a second anchor limb keyed on governance vocabulary. That wording predates the convention in that file, so it is independent evidence about the ledger rather than a restatement of compliance.Three false positives an earlier cut produced were each traced to a mechanism and fixed structurally: messages are bounded by concatenation rather than a character window; a descriptive-modal guard separates "regenerating it can widen it" from an offer; and path/noun targets are anchored in their own message only.
The control corpus is part of the deliverable
18 hand-classified scripts, set-equality audited in both directions. The direction that matters is STALE: a detector that quietly stopped matching would otherwise report a clean farm while reading nothing — the exact failure the convention it enforces is about.
Reverse verification found a real hole
Stripping the authority token from a real gate left the detector green, because that gate's own header mentions the token in a comment and compliance was read from raw source. A gate could have gone silent for every author who trips it while the farm reported clean. Compliance is now read from author-facing text only, with paired assertions pinning both directions.
17 mutations, each direction predicted in writing first and each mutant verified to have actually mutated; every one flips the suite red. Four control-audit cases likewise, including an end-to-end case that strips a real gate's token and confirms the gate fires.
Wiring
pnpm check:ratchet-remedy-authority(self-test first, house pattern), run in lint.yml beside the other farm-wide gates. No changeset: tooling only, nothing published changes —skip-changesetapplies.Related: #8435 established the convention; PR #8517, PR #8539 and PR #8549 built the six instances this detector classifies. #8519 and #8538 are not addressed here and remain open on their own terms.
Generated by Claude Code