Repository navigation
Land CI repair U2 + U3 on main (merged into stacked bases by #14/#15) - #16
Conversation
A definition with publish.ci.on_fail may push fixes to its own branch after CI goes red. Each fix is a round, authorized before the push and recorded after it under the lease token, in a new publish_ci_repairs table (migration 005): publish_records keeps one row per step by design, and a second push is a new fact, not a replay. The ledger enforces what makes a round trustworthy: the frozen definition must declare on_fail, proof must be recorded, CI must not yet be green, rounds are numbered in order within the frozen budget, and a round repairs exactly the head jig last pushed, so a person's push in between is refused rather than built on. Identical replays return the stored round; different values conflict. CompleteAttempt now refuses accepted when the green ci record names a head any round found red. It does not require the last pushed head, so a person's fix after the rounds run out stays acceptable on retry. The worker client gains the three calls; nothing in the worker calls them until the round loop (U5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rded A ci record is permanent, and no round is allowed once it exists, so a green record naming a head a repair round found red left the job unable ever to be accepted: CompleteAttempt refused it, and neither the ci row nor the rounds could move. RecordPublishStep now refuses that record, and CompleteAttempt keeps the rule as a backstop. Tests now cover two rounds and a replay that changes only head_before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (18)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds CI repair rounds for accepted, unpublished attempts. The control plane authorizes and records bounded rounds, the engine runs repair phases and resumes later phases, and worker continuations manage scratch and trace cleanup. ChangesCI repair rounds
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~60 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CIFailure as worker.CIFailure
participant Continuation as ciContinuation
participant RepairPhase as configured repair phase
participant Chain as Runner.runChain
participant Home as ephemeral HOME
CIFailure->>Continuation: RepairCI with CI failure
Continuation->>RepairPhase: run with bounded failure envelope
Continuation->>Chain: resume after repair phase
Continuation->>Home: wipe after round
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change adds CI repair-round records and engine continuations. They stay inactive until a later unit wires them in, so current behavior is unchanged. No blocking issues were found, and the change appears ready to merge. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The new controls constrain repair rounds to an active attempt and limit when a repaired run can be accepted. Recovery after an interrupted or overlapping repair is less certain, and the eventual exposure of CI-supplied data to a repair agent needs scrutiny before the repair loop is enabled. No security exploit was verified. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 76.79% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 56 functions across 16 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Why this PR exists
#14 (U2) and #15 (U3) were approved and merged, but they never reached
main. They were merged seconds after #13, before GitHub retargeted them, so each merged into its stacked base branch (feat/ci-watch,feat/ci-repair-ledger) instead.maintoday has U1 only.This PR carries exactly the reviewed commits of #14 and #15 to
main. There is no new code:feat/ci-repair-enginehas a tree identical tofeat/ci-repair-ledgerafter feat(engine): keep an accepted chain alive to repair red CI (CI repair, U3) #15's merge (git diffis empty).main.The 9 commits are U2's 5 and U3's 4; see #14 and #15 for the full descriptions and verification.
acceptedBoth units stay inert until U5: behaviour on
maindoesn't change.Note for review: CodeRabbit skipped #14 and #15 because their base wasn't
main. This is its first pass over U2 and U3.🤖 Generated with Claude Code
Summary by CodeRabbit