feat: add PR stop hooks and watch baselines - #40
Conversation
commit: |
There was a problem hiding this comment.
Pull request overview
Adds Stop-event hook support to prevent agents from stopping on non–merge-ready PR branches, and refines check --watch to wait for new actionable changes (with an inactivity-based timeout) rather than timing out during healthy CI cycles.
Changes:
- Extend
hooks checkto handleStopevents by resolving the current branch PR and runningbellwether check <pr> --format jsonnon-interactively. - Update hook installer to install both
PostToolUseandStophooks for Claude Code and Codex without duplicating entries. - Adjust
check --watchto track a baseline and reset inactivity timeouts on meaningful state changes (e.g., new head SHA / CI progress / new actionable reviews).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/commands/hook-check.test.ts | Adds mocking + test cases for Stop hook behavior and non-interactive bellwether check execution. |
| test/commands/hook-add.test.ts | Adds installer test coverage to ensure hooks are installed/cleaned properly for Claude and Codex. |
| test/commands/check.test.ts | Adds a regression test ensuring watch inactivity timeout resets on new CI cycle (new head SHA). |
| src/commands/hook-check.ts | Implements Stop hook handling via PR resolution + spawnSync check; expands output schema. |
| src/commands/hook-add.ts | Installs Stop hooks, de-duplicates bellwether entries, and refactors hook group construction. |
| src/commands/check.ts | Introduces baseline/snapshot tracking for watch mode and redefines “actionable reviews” behavior. |
| hooks/hooks.json | Bundles a default Stop hook config entry. |
| README.md | Documents new Stop hook behavior and updated check --watch semantics. |
| .agents/skills/para-memory-files | Adds a local absolute-path skill reference (likely unintended for repo). |
| .agents/skills/paperclip-create-plugin | Adds a local absolute-path skill reference (likely unintended for repo). |
| .agents/skills/paperclip-create-agent | Adds a local absolute-path skill reference (likely unintended for repo). |
| .agents/skills/paperclip | Adds a local absolute-path skill reference (likely unintended for repo). |
| .agents/skills/bellwether-hook-add--2d3a0cd890 | Adds a local absolute-path skill reference (likely unintended for repo). |
Comments suppressed due to low confidence (1)
.agents/skills/para-memory-files:1
- These newly added
.agents/skills/*files contain machine-specific absolute paths (including a username/home directory). This will break for other developers/CI and may leak local environment details. Recommend removing these files from the repo (and adding an ignore rule for.agents/skills/*if they’re generated), or replacing contents with repo-relative/configurable paths.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
.agents/skills/para-memory-files:1
- This commits an absolute, machine-specific local path (including username/home directory and transient npx cache folder). That’s both non-portable and potentially sensitive metadata leakage. These
.agents/skills/*path-pointer files should generally be removed from the repo and added to.gitignore(or replaced with repository-relative, reproducible references if they are intended to be shared).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Why
How
Stophooks for Claude Code and Codex and teachhooks checkto runbellwether check <pr>non-interactively for the current branch PRstop_hook_active, preserve the existing PostToolUse reminder flow, and update the bundled hook config/docsTests
npm test -- test/commands/hook-check.test.ts test/commands/hook-add.test.ts test/commands/check.test.ts✅npm run check✅npm run build✅