Review hand-off: ready means proven
The deliverable is a readiness matrix plus a hand-off message. Not a plan, not "should be fine". Every cell is evidence you produced or read in this session.
Push policy. Audit freely. Before any push, retarget, comment or thread resolution, ask (when
conventions.outward_actions_need_approval is true). Never push anything not validated locally first.
Load the config
Find delivery.config.yaml (DELIVERY_CONFIG, else the current folder, else the nearest parent).
Use repos (base, rulebooks, checks), conventions.update_strategy, release (the target passed by
deliver, else release.default_target), and proof.<size> for the feature's size.
The gates (per PR)
| Gate | Done means | Evidence |
|---|---|---|
| G1 Validated | Every item in proof.<size> holds: for local_e2e, the feature ran end to end locally; for regression_test, the test fails with the fix reverted and passes with it. Every issue found was fixed and re-checked | Output or screenshots, dated after the last change to behaviour |
| G2 Rulebook | The change follows the repo's rulebooks | The repo's checks pass on the changed files |
| G3 Coverage | Each acceptance criterion is covered by exactly one test layer, the lowest that can express it | Criterion → test file table |
| G4 Hygiene | Based on the target, 0 commits behind, ticket-only diff; with update_strategy: rebase, no merge commits | Commands below |
| G5 Reviews | Every review thread answered and resolved, or left open as a question for the user | Thread list |
| G6 CI | Green, or each red check shown to fail on the base too | Check list plus the base run |
Stacked PRs are judged against their parent branch. A frontend PR that reads a new backend field says "merge after ".
Phase 0: find the PRs
From the brief's plan, the delivery log, or the user's list, map the feature to its PRs. Note who owns each one: audit everything, fix only what the user owns. Look for local work that was never pushed (a worktree whose head differs from the PR head) and report it separately.
Phase 1: audit (read-only)
For each PR, using the repo's path from the config:
git -C <repo> fetch origin <target> <branch> --quiet
git -C <repo> rev-list --count origin/<branch>..origin/<target> # behind: must be 0
git -C <repo> log --merges --oneline origin/<target>..origin/<branch> # merges: must be empty (rebase)
git -C <repo> diff --stat origin/<target>...origin/<branch> # files: ticket only
gh pr view <n> --json state,baseRefName,headRefOid,changedFiles,reviewDecision
gh pr checks <n>
Review threads are not in gh pr view; read them through the GraphQL API
(reviewThreads { isResolved path comments(first:1) { body } }).
Then the judgement gates:
- G1 freshness: evidence is stale only if behaviour changed after it. A lint-only commit does not need a re-test; a logic change does.
- G3: list the criteria from the brief, map each to a test. Missing ⇒ gap, with the layer it belongs in. Extra coverage at a higher layer is not a gap.
- G6: for each red check, prove it fails on the base too (a recent base run, or the same check on a clean worktree of the base), or count it as a real failure. A PR with conflicts, or a stacked PR that CI never ran on, is not green.
Show the matrix and the gap list before fixing anything.
Phase 2: fix, in this order
Each step can undo the ones after it, so keep the order.
- Hygiene. Bring the branch up to date by
update_strategy. For rebase: replay only the PR's own commits ontoorigin/<target>in a separate worktree; drop merge commits and commits that belong to other PRs. Back up the old head as a branch first. Compare the new diff with the old one per file. Exception: if the diff is already ticket-only and the PR has a fresh approval, leave the history alone; rewriting would dismiss the approval. - Reviews. Fix valid comments; reply to and resolve only threads you acted on; leave product decisions open and ask the user.
- CI. Fix real failures; prove the base-only ones.
- Coverage. Add the missing test at the lowest layer.
- Validation. Run each proof in
proof.<size>, and the repo'schecks. - Evidence. One comment per feature with the criteria, pass or fail, and screenshots or output. Ask before posting.
- Push, after a yes, with
--force-with-lease=refs/heads/<branch>:<exact old sha>.
After any push, run the audit again: CI restarts and approvals may be dismissed.
Phase 3: report
- The matrix, with a pass or a one-line reason per gate.
- The merge order.
- What only the reviewer can do now (re-approve, re-review).
- The hand-off message for the user to send, or to send on their yes: PR links, what each proves, where the evidence is, anything still open.