Skip to content

porch: a force-advance at the review ceiling tells the builder 'All reviewers approved!' and reports the wrong iteration #1996

Backlog

Description

@waleedkadous

Problem

When a reviewed phase hits its review ceiling (max_iterations, 3 in SPIR) with reviewers still asking for changes, porch next hands the builder this task text (observed 2026-11-26, codev 3.3.8, SPIR specify, third round, both reviewers at REQUEST_CHANGES):

Request human approval: spec-approval :: ⚠️ FORCE-ADVANCE: REQUEST_CHANGES persisted for 1 iterations (safety ceiling = 3). Latest rebuttal preserved as audit trail: 1647-specify-iter3-rebuttals.md. Reviewer verdicts on iter 1:
  codex: REQUEST_CHANGES
  claude: REQUEST_CHANGES

---

All reviewers approved!

Reviewer verdicts:
  codex: REQUEST_CHANGES
  claude: REQUEST_CHANGES

STOP and wait for human approval.

Three things in it are false:

  1. "All reviewers approved!" sits above two REQUEST_CHANGES verdicts.
  2. "persisted for 1 iterations": it was the third.
  3. "Reviewer verdicts on iter 1": the verdicts shown are round 3's.

status.yaml afterwards has top-level iteration: 1 beside force_advanced.iteration: 3.

The builder in this case noticed and told its architect. A builder that takes the text at its word reports "all reviewers approved" to the human at the gate.

Root cause

packages/codev/src/commands/porch/next.ts, the safety-ceiling branch of handleBuildVerify:

  • it calls handleVerifyApproved(...), whose gate task description is the fixed string All reviewers approved!…, written for the path where they did;
  • handleVerifyApproved sets state.iteration = 1 on the same state object, and the notice is built after that call from state.iteration, so both counters in the notice read 1.

Fix (prescribed)

  • Capture the iteration before calling handleVerifyApproved, and build the notice from the captured value.
  • handleVerifyApproved takes the reason it was called (all approved, or ceiling reached). At the ceiling the description says so in its own words, for example: "Review ceiling reached (3 rounds). Reviewers did NOT all approve; the fixes from the last round have not been reviewed." followed by the verdicts and the rebuttal file. The words "All reviewers approved" appear only when allApprove(reviews) is true.
  • The same applies when the force-advance moves to a next phase instead of a gate: no text on that path may say the reviewers approved.

This is about what porch says at the ceiling. What porch should do at the ceiling (request a gate instead of continuing as approved) is the open issue #1793 and is not changed here.

Testing

  • A unit test drives a gated phase to the ceiling with REQUEST_CHANGES and asserts the task text does not contain "All reviewers approved", names iteration 3 in both places, and lists the verdicts.
  • The existing all-approve path keeps its text.
  • The same for a phase without a 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