Repository navigation
feat(controlplane): fence and record CI repair rounds (CI repair, U2) - #14
Merged
Merged
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>
|
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
U2 of the CI repair plan: the control plane's ledger of repair rounds. A round is a fix pushed to the attempt's own branch after CI went red. Like every publish side effect, it is authorized before the push and recorded after it, both under the lease token.
Rounds get their own table (migration
005_publish_ci_repairs.sql).publish_recordskeeps one row per step by design, and a second push is a new fact, not a replay.Rules the ledger enforces
publish.ci.on_failci_repair_not_declaredproofmust be recorded firstpublish_step_out_of_orderci_repair_after_greenci_repair_out_of_orderci_repair_budget_exhaustedhead_afterafter that), so a person's push in between is refused, not built onci_repair_head_mismatchinvalid_ci_repair_*ci_repair_conflictlease_not_owner,publish_branch_mismatchR6, when a job counts as
accepted: CI may not be recorded green on any head a round found red. This is refused when thecirow is written, withpublish_ci_on_repaired_head, andCompleteAttemptrepeats the check as a backstop. The green head does not have to be the last one jig pushed, so a person's fix after the rounds run out is still accepted by the publish retry.Other changes:
AuthorizeCIRepair,RecordCIRepairandAttemptCIRepairs.attemptWaitsForCIbecomesattemptDefinition, which returns the parsed spec, because both rules read it.Nothing in the worker calls the new endpoints until the round loop lands (U5). Behaviour on
mainis unchanged: red CI ends the attemptaccepted_unpublished.Verification
just checkis green: format, vet, package boundary, definitions, full tests, build.cirow is written and in the backstop.Completed, over-budget refusal over the wire, and listing rounds.1c695fd: with R6 checked only atCompleteAttempt, a badcirow could leave a job permanently unable to be accepted, because the row can't be replaced and no further rounds are allowed. It also found two test gaps, both fixed. Checked and clean:_txlock=immediateserializes the read-then-insert, and the primary key catches races.Plan updates
cirow check when the row is written; KTD7 notes the control plane enforces the head chain.AttemptCIRepairs, becauseRetryPublishdoesn't return rounds; and an authorization markedCompleteddoes not comparehead_before.🤖 Generated with Claude Code