Repository navigation
feat(worker): repair red CI in rounds inside the attempt (CI repair, U5) - #18
Merged
Merged
Conversation
When publish ends ci_failed, the engine kept its chain alive, and the frozen definition declares publish.ci.on_fail, the publishing runner now repairs in rounds until CI is green or the budget runs out. Each round reads the head jig last pushed from the ledger, refuses to build on a head someone else pushed, authorizes the round under a freshened lease, and hands the red checks and their log tails to the engine's RepairCI. Only a round that ends accepted, unheld, and changed goes further: it is fenced again right before the push (a round can outlive its lease), its own commits may carry only paths it changed, and then its paths are committed and pushed non-force, the remote head is proven, the round is recorded, remote_ref moves to it, and CI is awaited again. Every stop short of green leaves the attempt accepted_unpublished with the pull request at the last pushed head and every round's heads, changed paths, acceptance, and outcome in the publish summary; a cancelled round says so. The publish-only retry never repairs. cmd/jig/ci_repair_test.go runs a round through the real jig worker wiring and fails if the continuation's scratch or trace do not outlive Execute, the bug the U3 review found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 14 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What
U5 of the CI repair plan: the round loop. With this PR, a definition that declares
publish.ci.on_failactually repairs red CI inside the attempt. Single PR againstmain.When publish ends
ci_failed, the engine kept the chain alive (U3), and the frozen definition declares a repair budget,PublishingRunnerruns rounds until CI is green or the budget runs out:ci_repair_head_moved).RepairCI. The repair phase and every phase after it run again, judged by acceptance and the publish hold.remote_refmoves to the new head.ci_repair_exhaustedci_repair_head_movedci_repair_cancelled/_round_failed/_held/_no_changepublish_staging_escapepublish_push_failedEvery stop leaves the attempt
accepted_unpublishedwith the PR at the last pushed head.PublishSummary.ci_repairslists every round with its heads, failed checks, changed paths, acceptance evidence and outcome. The publish-only retry never repairs (R11).This is the first PR where an agent pushes to a PR after CI goes red. It happens only for definitions that declare
publish.ci.on_fail, and no stock definition does yet:factory.yamlopts in with U6. Definitions withouton_failbehave exactly as before; a test confirms it even when the engine hands back a continuation.Verification
just checkis green.on_fail; the retry never repairs.cmd/jig/ci_repair_test.go), as the plan required: one round through a livejig serveand the realjig workerwiring. It plants a handoff note while CI is red and asserts that it survives the round, that the round's trace events reach the control plane, and that the scratch is gone afterwards. Reintroducing the U3 wiring bug fails it.on_fail; and a broken mutant, redone.Adversarial review: four findings, all fixed
remote_reffollows the push.git add -Ain a round could commit the chain's test artifacts unchecked. Now refused.Known untested (defensive, stated rather than hidden)
freshenafter sleep. It mirrorspublishStep's existing pattern, and needs a clock the lease doesn't expose.Completed-conflict guard, which is only reachable in a real race.🤖 Generated with Claude Code