Repository navigation
Commit d3b753c
INT27 (vi): the engine's merge-gate hook entry runs for MCP tool calls too, and blocks when it cannot start
pineforge-workflow's docs/VERIFY.md ("Open decisions") records two gaps in
the product repos' .claude/settings.json: the entry ran pr-gate.mjs for Bash
only, so an MCP merge tool in an engine session met no hook, and without
`|| exit 2` a hook that could not start (the file missing, a syntax error,
node's own exit 1) let the call through, since Claude Code blocks only on
exit 2. campaign/README.md's wiring closes both.
The entry's matcher `Bash` becomes `Bash|mcp__.*`, and its pr-gate command
gets `"timeout": 120` and a trailing `|| exit 2`, as the workflow repo's own
entry has them. pr-gate.mjs reads only `tool_input.command`, so an MCP
payload reaches it as an empty command and it answers "no opinion"; the
same entry therefore also runs campaign/hooks/merge-gate.mjs (the file
campaign/README.md wires for `mcp__.*`, with the same timeout and
`|| exit 2`), which reads `tool_name` and `tool_input` and judges an MCP
merge of an engine PR. On a Bash call it repeats the merge gate pr-gate.mjs
runs first; both are deny-only.
Checked through `sh -c` with the payload on stdin, as Claude Code runs a
command hook: a benign Bash call and a benign MCP call exit 0 for both
commands; with the hook file missing each exits 2.
This is the last commit before the final lab remote: a session loads its
project hooks at start, so the session that wrote this commit keeps running
the previous entry.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>1 parent 6a04d2b commit d3b753c
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
0 commit comments