Repository navigation
End the Repair loop when a CI-fix Repair leaves the head unchanged - #104
Merged
Merged
Conversation
A CI-fix Repair that makes no commit leaves CI red on the same head, so going round again only re-reads the same failure. The Run now fails at once with a Declined CI fix instead of spending its remaining Repairs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Base branch move that lands while the Repair runs can fix CI on its own, so the head is compared once the Base branch is merged in again, not straight after the Repair. Share the short-sha rule with ci::watch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a CI-fix Repair leaves the head unchanged, the Repair loop now ends the Run as a Failed run. It no longer watches the same red commit again until all 5 Repairs are spent. The new ending is called Declined CI fix in CONTEXT.md.
RepairLoop::run loop take in Foreign commits (Merge run) merge origin/<base> # conflict → conflict Repair, go round push; head = HEAD + if head == the head last handed to a CI-fix Repair + fail "CI red on <short sha> and the Repair found nothing to fix on the branch" watch CI on head green/absent → return (or go round on an upstream move) - red → CI-fix Repair, go round + red → CI-fix Repair, remember head, go roundThe check runs after the Base branch has been merged in again. If the Base branch moved while the Repair ran, the head changes, so the Run goes round as before. A Repair that commits also goes round as before. The usual Failed-run handling still applies: a failure commit is pushed, the PR goes back to draft, and the session log printed is the declining Repair's.
The short-sha rule used in
ci::watchis now a shared function,ci::short.Evidence
209580e, thenrepairs exhausted: CI red.After: new tests in
tests/ci.rs:a_ci_fix_repair_that_makes_no_commit_is_a_failed_run: CI is red and Repair 1 commits nothing. The Run starts exactly 1 Repair and fails withCI red on <sha> and the Repair found nothing to fix on the branch, neverrepairs exhausted. The session log isrepair-1and the PR is a draft.a_second_ci_fix_repair_that_makes_no_commit_is_a_failed_run: Repair 1 commits, CI is still red, Repair 2 commits nothing. The Run fails after Repair 2, with logrepair-2.a_ci_fix_repair_that_makes_no_commit_goes_round_if_the_base_branch_moved: the Repair commits nothing but main moves on. CI is watched on the merge commit and the Run succeeds.red_ci_is_handed_to_a_ci_fix_repair_whose_fix_turns_it_greenandred_ci_after_the_last_repair_is_a_failed_run(repairs exhausted: CI redwhen every Repair commits).cargo testpasses in full, andcargo clippy --all-targetsandcargo fmt --checkare clean.Merge Danger
Door: two-way
A Run can now fail sooner. Reverting brings back the old retry-until-exhausted behavior.
Blast Radius: narrow
Only CI-fix Repairs that leave the head unchanged are affected. A Repair that only adds a "CI notes" entry to the PR body now ends the Run straight after it, with the PR in draft.
Unaddressed findings
Standards
src/run.rs): skipped. It is a single call site, and failed-run handling is the usual path.PolicyRefusalhas a marker type only because it changes that handling.declined_ci_fixintests/ci.rsandsrc/run.rs: skipped. The repo's tests assert user-visible text literally, for examplerepairs exhausted: CI red.Spec
Closes #102
🤖 Generated with Claude Code