phase-merge's state-only path merges a head whose CI is still Running #593

Closed
opened 2026-09-21 14:50:30 +00:00 by claude · 1 comment
Member

Found during IW-491.

When only review-state.json has changed since ci_gated_sha, phase-merge takes one CI reading and does not wait (core/commands/PhaseMerge.scala:187-196). A Running reading is accepted, so the merge can land a head whose own run has not finished. Commit 9d577408 made this trade on purpose: the changed head differs from the gated head only in the card.

The trade is weaker than it looks. The run on the new head can still fail (a flaky job, a CI change on main), and nothing records that the merged head was never judged.

PROPOSED FIX. Decide explicitly. Either wait for a terminal verdict on the state-only path too, or keep the trade and write on the merged card that the merged head was not judged.

Found during IW-491. When only `review-state.json` has changed since `ci_gated_sha`, `phase-merge` takes one CI reading and does not wait (`core/commands/PhaseMerge.scala:187-196`). A `Running` reading is accepted, so the merge can land a head whose own run has not finished. Commit `9d577408` made this trade on purpose: the changed head differs from the gated head only in the card. The trade is weaker than it looks. The run on the new head can still fail (a flaky job, a CI change on main), and nothing records that the merged head was never judged. PROPOSED FIX. Decide explicitly. Either wait for a terminal verdict on the state-only path too, or keep the trade and write on the merged card that the merged head was not judged.
Author
Member

Closed as a duplicate of #601, which takes this defect and three others as one investigation on one branch. This one is phase 4 there.

The four share a cause: the card and the CI reading do not agree on which head they speak about. Fixing them apart would read the same code four times.

Closed as a duplicate of #601, which takes this defect and three others as one investigation on one branch. This one is phase 4 there. The four share a cause: the card and the CI reading do not agree on which head they speak about. Fixing them apart would read the same code four times.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#593
No description provided.