Repository navigation
Description
Problem. In next.ts handleBuildVerify, when REQUEST_CHANGES persists up to max_iterations (3 in the SPIR skeleton), porch records state.force_advanced, commits chore(porch): <id> <phase> force-advance … and then calls handleVerifyApproved, exactly as if all reviewers had approved. The builder's last fix commit is never reviewed, and the next phase builds on it. The only signal is a notice prepended to the builder's next task text. Nothing waits on a human, although porch's output states that "the architect has already been notified". No code path does that.
Evidence from one fleet, one day (2026-10-10).
- One project force-advanced 7 of its first 8 implementation phases. A manual review of each unreviewed last fix found 1 blocker and 5 new majors; only 2 of 7 phases were clean. Each round's fix produced the next round's finding, mostly in concurrency and crash windows.
- Two more projects force-advanced 6 phases and 1 phase on the same day.
- Earlier: one security-critical project had a force-advance in every implement phase. Independent re-reviews of those fixes found 2× high, 1× medium, and 3× high (false-green) + 1× medium.
Proposal.
- On force-advance, porch requests a gate (e.g.
force-advance-review, scoped to the phase) instead of callinghandleVerifyApproved.porch nextrefuses until that gate is approved, like every other human gate. - The gate request names the last fix commit (the commit before the force-advance record) and the rebuttal file.
- Optional:
porch consult --diff <sha>(or equivalent) runs one single-lane consultation limited to that commit's diff, and its verdict is recorded with the gate. - Keep
max_iterationsas the runaway guard. Only "continue as approved" changes. - Per-project / per-phase
max_iterationsoverride in the project config (some projects need more rounds than the skeleton default of 3; some fewer). - Keep a history of force-advances (
force_advancedas a list, orforce_advance_history), not only the latest one, which a later force-advance overwrites today. - An unambiguous force-advance commit: include the plan phase id and the
force_advanced.attimestamp in the commit subject or trailer. Today the subject carries the protocol phase (e.g.implement), so several force-advances of one project share the same subject. Rebases change the committer date, and squash merges drop the commit frommain, so matching by subject and date is fragile. - A first-class lane skip: when one consultation lane fails (rate limit, outage), allow completing the phase on the remaining lanes with a recorded skip reason, instead of requiring config edits.
Why upstream. Downstream we guard from outside: a PreToolUse hook on porch next/done/approve reading status.yaml, plus a cron that escalates unreviewed force-advances. It works, but it duplicates porch's gate machinery, depends on every harness wiring the hook, and has to work around 6 and 7 (history and commit matching).
Compatibility. Projects that relied on silent force-advance get a gate instead, which is a visible change. A protocol flag (force_advance: "gate" | "continue", default gate) would keep the old behaviour available.
Related. #960 proposes a per-phase safety_ceiling (risk-calibrated iteration limit); that overlaps with point 5 here. This issue is about what happens at the ceiling (gate instead of continuing as approved) and the surrounding traceability (points 1–4, 6–8).
Activity