Skip to content

porch: force-advance at the review ceiling should request a gate instead of continuing as approved #1793

Open

Description

@iqasf

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.

  1. On force-advance, porch requests a gate (e.g. force-advance-review, scoped to the phase) instead of calling handleVerifyApproved. porch next refuses until that gate is approved, like every other human gate.
  2. The gate request names the last fix commit (the commit before the force-advance record) and the rebuttal file.
  3. 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.
  4. Keep max_iterations as the runaway guard. Only "continue as approved" changes.
  5. Per-project / per-phase max_iterations override in the project config (some projects need more rounds than the skeleton default of 3; some fewer).
  6. Keep a history of force-advances (force_advanced as a list, or force_advance_history), not only the latest one, which a later force-advance overwrites today.
  7. An unambiguous force-advance commit: include the plan phase id and the force_advanced.at timestamp 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 from main, so matching by subject and date is fragile.
  8. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions