refactor-review-gate
The Ship Review Gate — refactor-chain · review
Bundle: refactor-chain (self-diagnosing, self-healing fix-it pipeline).
Phase: review (the gate) · Prerequisite: the lane finished and refactor-code-principles ran; a baseline is green (refactor-safety-net / refactor-verify) · Next: docs → ship (only once the gate passes).
Adaptivity / conditional: repo-agnostic, read-only, always-runs. The harness appends it as the final kind:"gate" step of every lane; the Stop hook blocks the "done" narrative until it passes.
Purpose
This is the last checkpoint before a refactor is called done. It reads the whole accumulated diff (every lane step, plus the refactor-code-principles consolidation) and answers one question in plain words: is this safe to ship, and if not, what are the few things to fix first? It does this by coordinating the three specialist reviewers already in the bundle — refactor-security (is it safe?), refactor-performance (did it get slower?), and refactor-red-team (did behavior actually stay the same?) — plus a correctness read of its own. Then it does the job none of them can do alone: it de-dupes, ranks, and calms their findings into a single ordered list, "here are the N things worth your attention, most important first." It changes no code. Its output is a go / fix-these-first / no-go decision the human (or the harness) acts on.
When to use
- A refactor lane just finished and it's time to decide whether to ship. Triggers: "is this ready to ship", "final review", "go/no-go", "run the ship gate".
- The harness reached the
gatephase —orchestrate.mjs statusshows the current step isrefactor-review-gate. Run this; the Stop hook will not let the run be declared done until the gate passes. - Someone wants the whole change reviewed at once instead of file-by-file. Triggers: "review the whole diff", "look at everything we changed".
- Precondition: there is a diff (
git diffagainst the lane's base) and a green baseline exists. With no diff, say so and pass trivially.