You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
porch: a force-advance at the review ceiling tells the builder 'All reviewers approved!' and reports the wrong iteration #1996
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:
"All reviewers approved!" sits above two REQUEST_CHANGES verdicts.
"persisted for 1 iterations": it was the third.
"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.
Activity