Repository navigation
feat(engine): keep an accepted chain alive to repair red CI (CI repair, U3) - #15
Merged
Merged
Conversation
…r U3) An accepted, unheld attempt whose definition declares publish.ci.on_fail now returns a worker.Continuation with its outcome. RepairCI runs one round: the on_fail phase receives the CI failure as its input envelope, bounded and framed as data, then every phase after it runs again with guards, gates, and repair edges live, and the round is judged by the same acceptance and publish hold as the chain (run is split into run and conclude so both end through one door). A round carries the field view, results, gate reports, send count, and deadline, so it can never buy the attempt more budget, and reports only the paths it changed. It does not carry sessions or HOME: the HOME is wiped when the chain ends and when each round ends, roles are re-seeded on first use, and round sessions get their own key namespace. The handoff directory is kept. A round that does not end accepted and unheld spends the continuation. Release destroys the scratch and is idempotent. The worker's attempt loop and the direct run path release unconditionally; nothing uses a continuation until the publishing runner does in U5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d harden its HOME Review of U3 found that jig worker's runner removed the attempt's scratch and closed its trace stream as soon as Execute returned, before any repair round could use them: a round would have lost the handoff notes and emitted into a closed trace. worker.DeferToContinuation now moves a host's cleanup into the continuation's Release, once, after the engine's own Release, and cmd/jig/worker.go uses it. An unbound publishing runner now releases the continuation it would otherwise drop. Execute keeps a panic-safe defer that destroys the scratch unless a continuation took ownership. A HOME that cannot be wiped (an agent can make RemoveAll fail with a read-only directory) is never handed to a round: no continuation after the chain, a spent one after a round. An accepted round that changed nothing ends as ci_repair_no_change and spends the continuation. The CI head is capped like every other CI field, and the bounds, handoff survival, and panic path are now tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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
U3 of the CI repair plan: the engine keeps an accepted chain alive so a red CI run can be repaired inside the same attempt.
When a definition declares
publish.ci.on_fail, an accepted attempt that isn't held now comes back with aworker.Continuation. EachRepairCI(ctx, failure)call runs one round:on_failphase receives the CI failure as its input envelope, through the same door a failing test already uses. The CI data is bounded and framed as data, not instructions.if:guards, gates and repair edges all live. Phases before it do not re-run.runis split intorunandconclude, so both end through one door.<attempt>-ci<N>-<role>)A round spends the continuation if it isn't accepted, trips the hold, changes nothing (
ci_repair_no_change), or leaves a HOME that can't be wiped.Releasedestroys everything and can safely be called twice.Who releases: the worker's attempt loop and
jig runrelease unconditionally. Hosts that own resources a round still needs, such asjig worker's scratch removal and trace stream, hand that cleanup to the continuation viaworker.DeferToContinuation.Nothing calls
RepairCIuntil U5. Every continuation is released as soon as the attempt ends, so behaviour onmainis unchanged. The existing suite, including the exact event-sequence tests, passes untouched.Verification
just checkis green.runand later phases; a reviewer rejection loops the builder under its own edge; a high-risk fix trips the hold; the repair phase ignores its ownif:guard.DeferToContinuationruns cleanup once, after the innerRelease; an unbound publisher releases what it drops.Review
An independent review found a design-level bug, fixed in
69d2ede.jig worker's runner removed the scratch and closed the trace stream as soon asExecutereturned, so a U5 round would have started with no handoff notes and a dead trace. It also found five more problems, all fixed: a leak on the unbound publisher path, a panic skipping HOME cleanup, a failed HOME wipe being ignored, the missing no-change outcome, and the uncapped head.Not yet proven: the
cmd/jig/worker.gowiring itself. It can't be exercised until a round actually runs, so the plan now requires U5 to include an end-to-end round through the realjig workerharness.🤖 Generated with Claude Code