feat(hooks): the merge question says how the run was tested and how it is undone

This commit is contained in:
Kjell Tore Guttormsen 2026-11-02 21:23:24 +01:00
commit ec5b6483ec
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
10 changed files with 1371 additions and 6 deletions

View file

@ -2665,7 +2665,18 @@ git worktree list --porcelain
commits are already on main. Emit `main-merge-approved` and say in the
report that the review ran after the commits landed on main and could not
hold them back: run on a branch when the review should gate the merge.
- **Another branch:** merge it into main in ONE Bash call, with the values
- **Another branch:** first, before the merge call, write the run evidence
the guard's question reads, in a Bash call of its own:
```bash
node ${CLAUDE_PLUGIN_ROOT}/lib/review/merge-evidence.mjs write --repo . --branch "{run branch}" --project "{project_dir}" --json
```
It derives every field from the run's artifacts (the branch head, the
plan's `End-to-end:` command and `progress.json`, the verdict gate on
`review.md`, the plan's or the CHANGELOG's door) and writes
`<git common dir>/voyage/merge-evidence/<branch head sha>.json`, internal
and never tracked; the guard reads it into a "Tested by" and an "Undone by"
line of its merge question, and its answer stays "ask". On `"written": false` (exit 1), print its `reason` in one line and continue: the question then says "no run evidence".
Then merge it into main in ONE Bash call, with the values
written out as literals (the guard reads the command; it cannot follow a
shell variable). When `git worktree list` shows main checked out in a
worktree, merge there: