Repository navigation
feat(session-flow): count guardrails hook blocks per arm in the resume-eval report - #17918
Conversation
…e-eval report A reader whose every permission denial matches, by tool use id, a plugin PreToolUse hook's refusal is now hook-blocked, named by the hook's plugin, event and refusal line, instead of a plain denial. Every reader run records the hooks that refused its calls. The report prints hook-blocked runs and runs with any hook refusal per group and per pair, apart from accuracy and the non-delivery rate. Closes #17874 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a88ecdf054
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Lane run report
Run 44893418079, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
A follow-up turn that a hook refused was classified hook-blocked while its refusal never reached `hook_blocks`, so the report could print "1 hook-blocked, a hook refused a call in 0 runs". The follow-up events now travel with the exclusion and count with the main turn's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
claude-security-review reviewed Security review (incremental, blocking only): no security issues foundScope: this review covers only what changed since
None of the three matches a trusted-path glob. This lane already reviewed an earlier head, so the review was blocking only: it would report only CRITICAL and IMPORTANT findings. What changed:
Why this raises no security concern:
Spend: nothing new beyond the eval's current usage. critical-findings: 0 |
|
claude-review reviewed Code review: PR #17918, incremental (a37fb83 → 6a8c8e5)This review covers only what changed since the last one: The earlier blocking finding is fixed. It said writer refusals were also being classed as
So a writer is now always a plain The doc change at
Inside the hook-blocked branch, the local Closing-issue criteria (#17874): all three are still met and tested, as in earlier rounds:
The owner's "239 harness tests pass" is their claim; I did not run the tests. Settled thread (follow-up refusals in Other notes:
Verifier dropped 0 of 0 candidates. |
`exclusion_reason` is shared by every stage, so a writer refused by a hook was also marked hook-blocked and left the non-delivery gate. Only the reader's main turn and follow-up are now hook-blocked; a writer refused this way stays a plain denial and still counts as non-delivery. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
claude-review finding (hook-blocked catches writer refusals): correct. Fixed in 6a8c8e5. Only the reader's main turn and follow-up can be hook-blocked now ( |
Closes #17874
Summary
Resume-eval readers keep the owner's guardrails hooks loaded (R5). Until now, a reader that a
guardrails hook refused (
block-cd-prefix.shin the #17677 smoke test) was graded as a plaindenied tool calls: ['Bash']non-delivery. This PR gives that case its own result and counts itper arm.
Fix
exclusion_reasonreturns the newhook-blockedkind when every permission denial'stool_use_idmatches a tool result carrying a PreToolUse hook refusal. Any denial leftunmatched keeps the run a plain
denied. Evidence that a hook refusal lands inpermission_denialsunder the same id: the smoke1-before run 1 reader events, whererefusal
toolu_01Rm2eWtM485WSWBgDjBvSwXappears in the first result'spermission_denials.<plugin> PreToolUse:<tool>: <refusal line>, for exampleguardrails@melodic-software PreToolUse:Bash: BLOCKED: Run \git -C ...`. Claude Code's refusal text names the plugin and the event, and its bracket lists every guard the hook ran, not only the one that refused. The refusal line is what identifies the guard, which isblock-cd-prefix.sh` here.hook_blockednext tonondelivery, so it scores no accuracy.Every reader row also records
hook_blocks, the hooks that refused any of its calls,whether or not the run delivered.
N hook-blocked, a hook refused a call in K runson each group line and ona new per-pair
hooksline.--nondelivery-margin, per the issue's "apart from the accuracy and non-delivery rates"(owner: keep the hook, count it). A format that pushes more readers into a hook now shows up
on the
hooksline instead of failing the non-delivery gate.Verification
uv run --no-project --with pytest python -m pytest -q plugins/session-flow/scripts/harness/:238 passed.
block-cd-prefix.shrefusal text ishook-blocked under the hook's name. Mixed and unmatched denials stay
denied. A refusal thereader recovered from still delivers. The report counts hook-blocked runs apart from
non-delivery.
hook_blocksrun over the two real refused after-arm transcripts from the smoke test returnsthe guardrails
block-cd-prefixrefusal for each.Related
🤖 Generated with Claude Code