Repository navigation
fix(init): PostToolUse matcher omitted ReportFindings, so review evidence was never recorded (item 610) - #788
Conversation
…ence was never recorded (#610) The installed matcher for 'hook post-tool-use' did not name ReportFindings, so the harness never ran the hook for it and last_review stayed unset -- 'item done' was unsatisfiable. Build the matcher from the same constants the hook branches on (adding ReportFindings and the ctx_shell/gateway names), have add_hook_entry rewrite a stale matcher on an already-wired install, and pin matcher-vs-hook coverage with a test. Agentflare-Agent: claude-code Agentflare-Branch: task/610-completion-gate-s-review-evidence-can-ne Agentflare-Item: 610 Agentflare-Session: 0cc647e2-235a-450f-aabb-4e8fd8c75259
|
Tracking this PR for automated review ( |
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: getappz/agentflare/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (3)
Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe change shares tool identifiers, centralizes the Claude PostToolUse matcher, refreshes stale matching hook entries, and adds tests for coverage and preservation of unrelated hooks. ChangesClaude hook matcher synchronization
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
What
Fixes agentflare item 610 (a tracker item, not a GitHub issue): the completion gate's review evidence could never be recorded, so
item done/check_mergewas unsatisfiable for every caller.Root cause
The
PostToolUsematcher written forhook post-tool-usedid not nameReportFindings, so the harness never ran the hook for that tool.hook_completion_gate::post_tool_usealready handlesis_review_completion, but it was never invoked, solast_reviewstayed unset andcompletion_gate_reasonalways failed its review check. The review half of the gate landed with tests that callpost_tool_usedirectly, which bypasses the matcher, so nothing caught it.Changes
src/init.rs: build the matcher in one place (post_tool_use_matcher()) from the same constants the hook branches on. It now includesReportFindings, plus the ctx_shell and gateway tool names the hook also handles.add_hook_entrynow rewrites a stalematcheron an already-wired entry instead of skipping it, so existing installs pick up the widened matcher.wire_claude_code_post_tool_use_matcher_covers_every_tool_the_hook_handlespins the matcher to the hook's tool names so the two cannot drift again.src/hook_redirect.rs:GATEWAY_TOOL_NAMEmadepub(crate)so the matcher can reuse it.src/optimize/runtime.rs: small supporting change (8 lines).Notes for review
agentflare initruns; until then their~/.claude/settings.jsonkeeps the old one.Opened by
claude-codefor item #610 (pushed from a PM session because the agent's own job was orphaned by a daemon restart).Summary by CodeRabbit