Skip to content

A ready-for-review Delivery re-runs full CI every time the Base branch moves, even when CI is green #906

Closed

Description

@JacobStephens2

This was generated by AI during triage.

When a pull request will only be left ready for review, Delivery still throws away green CI whenever the Base branch moved while CI ran. It merges the Base branch in again, pushes, and watches a full CI run on the new head. On a busy main that costs about an hour per round in today's macOS queue, and after 5 such moves the Delivery fails with "origin/main kept moving: merged it again 5 times", even though no one was going to merge the PR without the Day shift.

Evidence

Spec run #776 on stephens, delivering Spec PR #842 with the goal of leaving it ready for review, 2026-10-20 (UTC):

The green result on b34d144 would have left #842 ready for review about two hours earlier. The PR merged cleanly into main throughout.

Where

RepairLoop::rounds in Delivery's Repair loop: on Ci::Absent | Ci::Passed it checks base_branch_moved() first and goes round again with count_base_move("while CI ran"). The early return for Goal::ReadyForReview is only reached when the Base branch did not move.

Related

Activity

  1. JacobStephens2 commented on Oct 20, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: bug
    Summary: With the goal of leaving the pull request ready for review, green CI on a mergeable head ends Delivery's Repair loop, even if the Base branch moved while CI ran

    Current behavior:
    In Delivery's Repair loop, when CI on the pushed head is green or absent, the loop first asks whether the Base branch moved while CI ran. If it did, it counts an upstream move, merges the Base branch in again, pushes and watches CI on the new head, whatever the goal. Only when the Base branch did not move does a ready-for-review Delivery return. A ready-for-review Delivery on a busy Base branch can spend hours re-running full CI and then fail on the upstream-move budget (5).

    Desired behavior:

    • For Goal::ReadyForReview (a Spec PR left for review, a Run that does not Self-merge): green or absent CI on the head ends the rounds, whether or not the Base branch moved while CI ran, provided the pull request is mergeable with the Base branch as GitHub reports it. The existing readiness and mergeability check after the rounds stays.
    • If GitHub reports the PR not mergeable (a conflict with the moved Base branch), behave as today: merge the Base branch in, start a conflict Repair if needed, and go round again, counting the upstream move.
    • A Base move that is not acted on is not counted against the upstream-move budget, and the Command log says so in one line, e.g. origin/main moved while CI ran; leaving the PR for review on <short head>, which merges cleanly.
    • Goal::Merged (Self-merge) is unchanged by this issue.
    • The glossary entry for the Repair loop and the comments on the loop and on the upstream-move budget say which goal goes round again on a Base move and which does not.

    Key interfaces:

    • RepairLoop::rounds and its Ci::Absent | Ci::Passed arm.
    • The Outside seam's base_branch_moved() and whatever it uses to read the PR's mergeability (the post-rounds readiness check already reads it).
    • Budgets::count_base_move and MAX_UPSTREAM_MOVES.

    Acceptance criteria:

    • An in-process Repair loop test: goal ready-for-review, CI green, Base branch moved while CI ran, PR mergeable. The loop returns that head, with no further merge, push or watch and no upstream move counted.
    • Same, but the PR is not mergeable: the loop merges the Base branch again and continues as today.
    • Goal merged, CI green, Base branch moved: behaviour unchanged (existing tests still pass).
    • The new Command log line appears in the first case.
    • cargo test, cargo clippy --all-targets -- -D warnings and cargo fmt --check pass.

    Out of scope:

  2. added
    ready-for-agentFully specified, ready for an AFK agent
    in-progressA Claim: thirdshift has taken this issue
    and removed
    ready-for-agentFully specified, ready for an AFK agent
    on Oct 20, 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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions