Skip to content

porch done requests the human gate on a reviewed phase without reading the verdicts, so the review loop is skipped #1997

Backlog

Description

@waleedkadous

Problem

porch done, run on a reviewed (build_verify) phase whose build is already marked complete, requests the phase's human gate as soon as one review file exists for each reviewer. It never reads the verdicts. So a builder reaches the human gate after one review round in which every reviewer said REQUEST_CHANGES, and the re-review loop in porch next never runs.

Observed 2026-11-26, codev 3.3.8, SPIR specify, strict mode:

  • reviews: …-specify-iter1-codex.txt REQUEST_CHANGES, …-specify-iter1-claude.txt REQUEST_CHANGES;
  • the builder fixed the spec and ran porch done;
  • porch committed chore(porch): <id> spec-approval gate-requested; status.yaml shows iteration: 1, build_complete: true, the gate pending with a requested_at, and no force_advanced record and no history;
  • the fixes were never re-reviewed.

On the same day, another builder on the same issue text called porch next after each round instead. Porch took it through three rounds to the ceiling. Which command the builder happens to run decides whether the review loop exists.

Root cause

packages/codev/src/commands/porch/index.ts, done():

  • for a build_verify phase with build_complete already true, the only verification is that a file matching <id>-<phase>-iter*-<model>.txt exists for each lane ("VERIFICATION REQUIRED" otherwise). Any iteration's file satisfies it, and its verdict is not parsed;
  • it then auto-requests the gate.

The verdict logic (all approve → advance; any REQUEST_CHANGES → rebuttal, re-iterate, ceiling) lives only in next.ts handleBuildVerify.

By reading the code, not by running it: for a build_verify phase without a gate that is not the phased implement phase (ASPIR's specify and plan), the same call falls through to advanceProtocolPhase, so it would advance the protocol phase with reviewers at REQUEST_CHANGES. Please confirm or refute this with a test as part of the fix.

Fix (prescribed)

One place decides on verdicts. In done(), a build_verify phase in normal consultation mode whose build is already complete does not request a gate and does not advance. It prints that verification is decided by porch next <id> and exits non-zero without changing state, as it already does for an unfinished plan phase. handleBuildVerify in next.ts stays the only code that requests a gate or advances after a review.

Unchanged: once phases (BUGFIX and AIR pr), the none and parent consultation modes, and the first porch done that marks the build complete.

Check the strict-mode prompts and the porch skill in both trees for any text that tells a builder to run porch done after its reviews, and correct it to porch next.

Testing

  • done() on a gated build_verify phase with all lanes at REQUEST_CHANGES: no gate requested, state unchanged, the message names porch next.
  • The same on an ungated build_verify phase (ASPIR specify): the phase does not advance.
  • porch next on the same states still behaves as today (rebuttal task, re-iteration, ceiling).
  • BUGFIX and AIR porch done still auto-request the pr gate.

Activity

  1. added
    area/porch
    on Nov 26, 2026
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

    area/porch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions