Repository navigation
Description
This was generated by AI during triage.
What happened
A Pickup run started a Spec run while the Day shift was reshaping that Spec. The reshape gave the Spec a new Base branch. Six minutes into the Run, the person closed the Spec PR on purpose, keeping the Spec branch only as a source to copy work from, and rewrote the Tickets to open their own PRs against the new Base branch.
The Run didn't notice. For about 90 more minutes it carried out Tickets on the old plan. Two Ticket runs Self-merged into the abandoned Spec branch and closed their Tickets, even though the rewritten Tickets now asked for something else. The Run noticed only at final readiness, when PullRequest::ensure_ready_and_mergeable (src/pull_request.rs:340) reported that the Spec PR "is closed, not open". It then printed a Recovery command, which would have continued on the abandoned base. The person had to reopen both Tickets by hand.
Why
The Spec PR's state is read at the start and at final readiness. Nothing reads it again between Tickets. A Run that lasts hours therefore keeps merging into a Spec branch the person has already given up.
Proposal
Before starting each Ticket, and again before each Self-merge into the Spec branch, re-read the Spec PR. If it is closed, merged, or now targets a different base than the Run started with, stop the Run before doing more work. Report a distinct cause, such as "the Spec PR changed under the Run", and give no Recovery command that resumes the old plan.
Why ready-for-human
The checkpoints and their cost are policy calls:
- Which changes count: a closed PR, a changed base, or also an edit to the Spec body or a Ticket body?
- Whether a Ticket run that is already in flight finishes or gets abandoned.
- How this interacts with Continuations and the "Preserved" report.
- Whether Pickup should have dispatched at all. The Spec carried the
in-progressClaim label, notready-for-agent, and the command log that would explain the dispatch wasn't available during triage. That may be a separate issue.
Activity