Skip to content

Fix rounds after the work follow the supervisor: on while they make progress, never waiting on a comment - #643

Merged
nambok merged 1 commit into
mainfrom
budget-rounds-follow-progress
Nov 12, 2026
Merged

nambok merged 1 commit into
mainfrom
budget-rounds-follow-progress

Conversation

@nambok

@nambok nambok commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two loops of fix rounds still stopped on their own budget after #635 moved every other ending onto the supervisor:

  • CI-only rounds on a finished run's pull request. At eight automatic pushes CoderHelm marked the pull request ready, completed the run with its checks red, and said a comment naming a change would start the next round, even while every round turned another red check green.
  • Self-review rounds on CoderHelm's own pull request. At two rounds it posted the same "a comment naming a change starts the next round" note and left the findings holding the draft, even while each round closed one. The run's own-review rounds stopped after two rounds without progress and waited on a person with the draft held.

Both loops now follow the supervisor's rule (supervisor::next_round):

  • Rounds go on while they make progress: checks that were red turn green, findings close, a round pushes changes. Past the cap they continue up to twice it, and only below the run's spend ceiling.
  • A round that makes no progress climbs the same ladder as the implement steps: one item only, a fresh context with small edits, a re-split, then the strongest model. A non-core item, such as a readme finding, is deferred first.
  • When the rounds end, the findings left move from "Open review findings" to "Deferred" with the reason. They stop holding the draft and the run finishes; the draft stays only while required checks are red.
  • Red checks go through Runs finish or hand back only for a listed reason: one supervisor for every ending #635's ending: the change is reverted to the last green head and deferred, and CI decides again. When nothing can be reverted, the run ends failed and names the failing checks, the error and what was tried.
  • No message asks for a comment to continue. The old phrases are on the ownership hand-off list, so the source scan fails if one comes back.

Changes

  • supervisor: next_round / RoundFacts / RoundStep (progress, ceiling = twice the cap, spend ceiling, ladder), ci_progress, findings_progress, round_instruction (each rung's approach for a round; ESCALATED marks the strongest-model rung), end_of_rounds (the ending through supervisor::end: finished with what is deferred, or failed while checks are red).
  • passes/mod.rs: claim_auto_fix_round claims a round with a compare-and-set on auto_fix_pushes and records the failing checks (auto_fix_failing) and the stall count (auto_fix_stalled). It returns Round(rung), End(why) or Busy. The pure decision is auto_fix_step. claim_auto_fix_slot_upto lets a caller that already decided by the rule claim up to the ceiling.
  • feedback: CI-only cycles, and CI fixing that rides along with a person's comment, claim rounds by the rule. The rung's instruction goes into the CI block, and the escalate rung uses the strongest model. fetch_ci_failures also returns the failing check names. end_auto_fix_rounds now calls resume::end_red_ci_rounds, once per head (auto_fix_end_head), instead of completing the run and posting the comment-to-continue note. run_ticket_message builds the run's ticket message, which was previously inlined.
  • resume: new end_red_ci_rounds (revert to green and await CI; else write the failing-checks section, run the ready decision, and fail the run with the cause). The own-review loop uses the new own_review::next. A Fix round carries the rung's instruction, and the escalate rung runs the fix on the complex model. The stop-judge licence no longer gates rounds that make progress. stop_on_own_findings is replaced by finish_on_own_findings: it defers the findings on the pull request, runs the ready decision, then ends through wait_for_review / wait_on_person as completed, or as failed while checks are red. Queued rounds for a finished run use the ceilings in their claim, and a run whose rounds are over returns OwnRound::Defer.
  • own_review: next(..., spent_usd) returns Ready, Fix { stalled, rung } or Finish { why }. New: finish_reason, defer_findings, rounds_over (progress from open_before / open_now on RoundBudget). stop_reason and cap_reason are removed.
  • ready: fix_own_findings defers the findings on the pull request when the run's rounds are over, instead of holding them for a person.
  • review_pr: claim_self_review_round is a compare-and-set by the rule (self_review_step). It records the rounds, the findings open at the last round and the stall count. A round's feedback carries the rung's instruction. When the rounds end, end_self_review_rounds defers the findings on the pull request, posts one note saying what was deferred and why, and asks the ready decision.
  • e2e: E2E failures sent back to a finished run use the same rounds. When the rounds end, the note lists what still fails and why the rounds ended, without a comment-to-continue line.
  • ownership: the comment-to-continue phrases ("comment to continue", "comment naming a change", "naming a change starts", "starts the next round/one right away", "stop(s) starting rounds") are added to HAND_OFF_PHRASES.
  • Incident case ae_budget_rounds, with a row in docs/incidents.md. k_own_review_findings, aa_promised_round and p_finished_work_loop are updated for the new endings and names.

Verification

  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test --workspace: common 2079 passed, gateway 902 passed, worker 1602 passed, 2 passed in a small binary; nothing failed.
  • New replays (incidents::ae_budget_rounds):
    • The CI-only budget runs out while rounds make progress: 12 red checks, one turning green per round. Rounds continue past 8 and finish green after 12, staying within the ceiling of 16. Under the old rule the rounds stopped at 8 with 4 checks red.
    • CI-only rounds without progress take the rungs Continue, Narrow, SwitchTools, Resplit, Escalate, then end. The revert takes the last green head; with nothing to revert, the ending is Failed, and the cause names the checks, the error and why the rounds ended, with no hand-off phrase. Past the cap a round without progress ends the rounds, and so does nearing the spend ceiling.
    • Self-review findings 4, 3, 2, 1, 0: four rounds, past the cap of 2, and the last review approves. The ceiling of 4 holds even while findings keep closing.
    • Self-review findings stuck at 2: Continue, then Narrow, then the rounds end. The findings are deferred, no longer hold the draft, and the note names them and the reason.
    • Source scans: each loop ends through the supervisor's endings and never by completing with red checks or waiting on a comment.
  • Proof on old code:
    • (a) A worktree of main with only the new phrase list and the source-scan test fails both ownership::no_prompt_or_message_hands_work_back (it flags the old notes in feedback.rs, review_pr.rs and e2e.rs) and ae_budget_rounds::neither_loop_ends_by_waiting_on_a_comment.
    • (b) This branch with auto_fix_step and self_review_step switched back to the old cap rule (a round only while under the cap) fails all four replays.

…rogress, deferred or failed with the cause, never waiting on a comment

The CI-only rounds on a finished run's pull request and the self-review
rounds on CoderHelm's own pull request stopped at their caps and asked
for a comment naming a change. Both now take each round by
supervisor::next_round: past the cap only while rounds make progress
(red checks turn green, findings close), up to twice it and below the
spend ceiling; a round without progress climbs the ladder; at the end
the findings are deferred on the pull request and the run finishes, or
red checks are reverted to green and deferred, or the run fails with
what fails. The old wording is on the hand-off phrase list.
@nambok
nambok merged commit e4d70aa into main Nov 12, 2026
10 checks passed
@nambok
nambok deleted the budget-rounds-follow-progress branch November 12, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant