feat: short-circuit post_commit_reminder when all reviews passed#361
Merged
feat: short-circuit post_commit_reminder when all reviews passed#361
Conversation
Move the post-commit reminder hook from bash into a Python hook that checks whether all non-catch-all review rules matching the committed files already have .passed markers. When they do (or no applicable rules exist), emit "No re-review needed" instead of nagging the agent. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
6a219fa to
3da81dd
Compare
- Add per-test traceability comments for PLUG-REQ-001.7.2/3/4 - Fix 3 pre-existing misplaced traceability comments in TestRunReviewDiscoveryWarnings - Type _rule_is_catch_all parameter as ReviewRule (removes type: ignore) - Update doc/architecture.md and src/deepwork/hooks/README.md - Add changelog entry Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
git show --no-patch and --name-only are mutually exclusive, causing _committed_files to always fail and fall back to the nag reminder. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Prevents regression of the incompatible --no-patch + --name-only flags. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The instruction file's "After Review" section now covers all three cases: no findings, findings fixed, or findings explicitly dismissed. The MCP tool description is updated to match. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Add Bash(make:*) to project allow list - Sync mark_review_as_passed description in doc/mcp_interface.md Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
nhorton
added a commit
that referenced
this pull request
Apr 16, 2026
End-user installs launch the MCP server via `uvx deepwork serve`, so the bare `deepwork` binary is not on PATH when hooks fire. Three plugin hooks (`post_commit_reminder.sh`, `deepschema_write.sh`, `post_compact.sh`) were calling `deepwork ...` directly and failing with exit 127 on every Bash tool use — Claude Code reports them as failed PostToolUse hooks. This regression was introduced in PR #361 when the bash-only commit reminder was rewritten to delegate to a Python hook via the deepwork CLI. The dev workflow masked the bug because direnv/Nix puts `.venv/bin` on PATH. Fix: each hook now probes `command -v deepwork` and falls back to `uvx deepwork ...` when missing. Adds a `.deepreview` rule (`claude_plugin_hook_deepwork_invocation` in plugins/claude/.deepreview) that flags any plugin hook script with an unguarded `deepwork` invocation, to prevent future regressions. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
4 tasks
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 16, 2026
…ATH (#386) End-user installs launch the MCP server via `uvx deepwork serve`, so the bare `deepwork` binary is not on PATH when hooks fire. Three plugin hooks (`post_commit_reminder.sh`, `deepschema_write.sh`, `post_compact.sh`) were calling `deepwork ...` directly and failing with exit 127 on every Bash tool use — Claude Code reports them as failed PostToolUse hooks. This regression was introduced in PR #361 when the bash-only commit reminder was rewritten to delegate to a Python hook via the deepwork CLI. The dev workflow masked the bug because direnv/Nix puts `.venv/bin` on PATH. Fix: each hook now probes `command -v deepwork` and falls back to `uvx deepwork ...` when missing. Adds a `.deepreview` rule (`claude_plugin_hook_deepwork_invocation` in plugins/claude/.deepreview) that flags any plugin hook script with an unguarded `deepwork` invocation, to prevent future regressions. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.
Summary
src/deepwork/hooks/post_commit_reminder.py) that checks whether all non-catch-all review rules matching the committed files already have.passedmarkers/reviewall_reviews_passed_for_files()helper tosrc/deepwork/review/mcp.py— pure, no side effectsTest plan
all_reviews_passed_for_files(empty files, no rules, catch-all only, non-matching, with/without markers, mixed)post_commit_reminder_hook(early returns, review-aware paths, git failure fallback, exception fallback,_committed_fileshelper,main()entry point)test_hook_script_detects_git_committo validate Python hook source🤖 Generated with Claude Code