Repository navigation
Hook accuracy: measure the hooks, fix what the measurement found - #7
Merged
Merged
Conversation
…s the output (DGS-208) config-first matched any line containing 'command not found', 'No such file or directory', 401/403 or 'connection refused', so printed docs, hook source and memory files fired it, and so did ls answering whether a path exists. It now counts a line only when a program this command ran reports its own failure in a known shape, skips existence probes, a missing path that follows a code error, unsplit-variable 'commands' and loops that try candidates on purpose. secret-print denied on the words it saw, not where the output went: values captured by $(...) into an assignment or a non-printing program, piped into grep -c, wc, cut -d= -f1, a sed mask or /dev/null, an env file being written (cat > .env), and literal loop variables named like secrets. The lexer now records each substitution's parent segment so the guard can tell. staging no longer treats git add -N/--intent-to-add/-n as staging content. Field replay on the dev split of labeled firings: config-first 9 of 42 right before, 9 of 11 after; secret-print 0 of 11 right before, 0 firing after; the existing deny cases still deny. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cks people run (DGS-208)
Labeled field firings showed 3 of 107 stop blocks on the dev split were
right. Most misfires were one of two kinds: a check ran that the hook did
not know by name, or the flagged sentence was not a claim.
Evidence: a program run (not cat or echo) that exits clean and prints
PASS/ok lines, N passed, N/N pass, ALL PASS or 0 failed counts as a check;
gh pr checks and gh run view/watch are checks; opening a rendered image
counts for a visual change; the agent's own memory and notes (Write/Edit
or a Bash write that names them) no longer reset the evidence.
Claims: a leading negative scopes over its list ('Nothing is committed,
pushed or deployed'); blockquotes, quoted spans and list items under a
'says:' or 'wrote:' line are someone's words; 'a paid verified review' and
'Fixed scope' are adjectives; 'works in/for/when', 'Why it works', 'go to
Done' and 'Click Done' are other senses; 'the builder reports 1737 passed'
is attributed.
The mod mirrors every rule; the shared case table gains 19 claim rows and
9 sessions that both run. Dev-split replay: misfires 104 -> 51, true
catches 3 -> 3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ep parent hides a substitution Two cases from the held-out replay, fixed after it was scored: git printing 'warning: could not open directory ...: No such file or directory' is a real path failure, and printf inside $(...) that only feeds grep -q never reaches the conversation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dojo-gates 0.2.0 (2.4.0, unreleased) scripts/hook_accuracy.py feeds each hook script the payload Claude Code would send, on fixtures with known answers in plugins/*/fixtures/accuracy, and prints precision and recall per hook with 95% Wilson intervals. Fixtures marked known_miss record errors the hooks still make: they count, but don't fail the run. ACCURACY.md holds the method, the labeling rubric, the fixture table (before and after) and the field sample measured on the maintainer's sessions. Test text no longer carries issue keys or home paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pre-registration digest (sha256 of everything above the marker): d5cac861200cbb102150daa64bac28ccc4774bd5ea1cd8cfd133d21666c4feba Eight held-out cases written by an independent model author from evals/held-out-brief.md (six where a check exists, two controls), with the evaluator's graders fixed: an Opus trace judge for unbacked success claims, a deterministic claim-plus-check reference, and with-only indicators. No run has happened; the run waits on the operator's cost and author go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt 1 claude plugin eval 2.1.299 reads context.scaffold_script as a file path, so the inline scaffolds stopped every pilot run at setup (no agent ran, $0). Each held-out case's scaffold, unchanged, moves to scaffold.sh. The pre-registration digest above its marker is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…amendment 2 The pilot (16 runs, $4.40, excluded from analysis) showed reply-claims-success throwing on every run: JavaScript regexes take no inline (?i). Measured cost per graded run is $0.275, so the main run's cap under the pre-registered stop rule is $28.60. The percent copy rule now skips pre-registrations and frozen held-out task data, which state numbers as design parameters, not claims. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/health_report.py replays local Claude Code transcripts through the suite's own detector code (dojo-verify's claim and evidence functions, dojo-gates' config-first, empty-probe and static guards, dojo-router's unpinned-dispatch rule, dojo-tally's return counts) and reports, per Dojo rule, what it counted and out of how many, with every finding's file, line and a masked excerpt in evidence.jsonl. Each count sits beside its detector's precision and recall from the fixture suite, and optionally a field precision measured on real sessions. dojo-doctor's setup checks are attached. Nothing depends on the clock: with a date window, the same transcripts give byte-identical output; inputs are listed with digests. Its fixture sessions have hand-derived answers in fixtures/health/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
80 runs, $20.30 of a $28.60 cap, Claude Code 2.1.299. Unbacked-claim rate on the six check-available cases: without 5/30, with 4/30, D = +0.033 (95% CI -0.155 to +0.220); deterministic reference 12/30 vs 8/30. Control cost ratio 1.29. Applied mechanically, the rule outputs: default to warn. The hook fired on none of the with-arm runs the judge rated unbacked. Digest above the marker unchanged: d5cac861200cbb102150daa64bac28ccc4774bd5ea1cd8cfd133d21666c4feba Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dence Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws 1, 4, 8 and 9 of the rule table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…16 report; disclose the post-replay gates changes Case 7 (conditional advice) passes. Cases 6 (a push compared with ls-remote) and 8 (a pricing argument that uses 'works') still misfire and are marked known_miss. ACCURACY.md now says the two dojo-gates changes in 33a6d8f came after the held-out replay was scored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lists the eval, health report and rule table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 17, 2026
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.
Fixes DGS-208
What this does
The suite's hooks fire on the tells in the Dojo Protocol. Nobody had measured how often they're right, or whether blocking on them changes what an agent does. This PR measures both, fixes what the measurement showed, and leaves a way for anyone to re-run all of it.
scripts/hook_accuracy.pyfeeds each hook script the payload Claude Code would send, on fixtures with known answers (plugins/<plugin>/fixtures/accuracy/), and prints precision and recall per hook with 95% intervals.--hooks-frommeasures another checkout against the same fixtures. Fixtures markedknown_missrecord errors the hooks still make: they count in the table but don't fail the run.plugins/dojo-verify/evals/PREREG-2026-10-17-evidence.md.scripts/health_report.pyreplays local transcripts through the suite's own detector code and reports, per rule, what it counted and out of how many, with each finding's evidence and each detector's measured accuracy beside it. The same input gives byte-identical output.ACCURACY.md§4): for each of the ten rules, what checks it at runtime, how accurate that check is, and what has measured the rule's effect.Method, rubric and tables:
ACCURACY.md.Before and after
The eval
80 runs on Claude Code 2.1.299: 8 held-out cases × 5 runs × 2 arms, executor Sonnet, judge Opus with three votes per verdict. $20.30 against an approved cap of $28.60.
warnas the default: no detected benefit, and the control cost ratio (1.29) crosses the 1.25 harm bar.What the measurement says
ls, the price of treatinglsas an existence check, which was its most common misfire.Review notes
ls nopeno longer counts as a missing path (27 of 41 path firings in the field werelschecks). The tests now usecat,python3andcd.ACCURACY.md§2 says so.ls-remoteand the pricing argument that uses "works" still misfire, so they're markedknown_missand tracked as a follow-up.scaffold_scriptto inline shell. Claude Code 2.1.299 reads that field as a path to a script file, so they'd fail at setup if run. Left as they are; the held-out cases usescaffold.sh.scripts/release-check.shpasses in full on Claude Code 2.1.299 at the branch tip: 0 fail, 0 error, and plugin-lint's known warning baseline.Not in this PR (needs a ruling)
warn, as the pre-registered rule says. This PR leaves it atblock.ACCURACY.md§2 stay public. They're from the maintainer's own sessions; only counts are published.🤖 Generated with Claude Code