Repository navigation
CI watching, CI-fix Repair and the Repair cap - #22
Merged
Merged
Conversation
After the PR checks, thirdshift now loops: merge the Base branch, push, wait up to the grace period for checks or statuses on the head commit, and watch them. Red CI starts a CI-fix Repair listing the failed checks, then goes round again. Conflict and CI-fix Repairs share a cap of 3; needing a 4th is a Failed run. Before exiting 0 the PR must still be open, ready and mergeable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Waiting now lives in a poll module (until / within the grace period) that both CI watching and the final mergeability check use. Check runs and statuses are read across every page. Mergeability is an enum, the open-PR check is shared, and an UNKNOWN mergeable state is tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 25, 2026
Closed
JacobStephens2
added a commit
that referenced
this pull request
Sep 30, 2026
Parallel Tickets (#143) and the Spec PR's Repair loop and Self-merge landed on main. The Tickets checklist now follows the parallel loop: it is written once per batch of Tickets started and whenever one ends, and the Spec PR opens after the first Ticket lands. Tests that need #21 to land before #22 starts run with parallel 1, and the Spec PR is found by its head rather than by its index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 2026
This was referenced Oct 20, 2026
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
After the PR check, the Run now goes through the spec's full Repair loop:
Tested seams
thirdshiftCLI (the spec's only seam): tests run the binary against real git and the fakegh/claude. The fakeghnow serves check runs, commit statuses and mergeability, and it has a test-onlygh fake …subcommand the scripted agents use to set CI on their HEAD.Evidence
tests/ci.rsdid not exist (its first test,no_checks_within_the_grace_period_means_no_ci_and_success, failed on this code).After:
cargo test: all suites pass, including 11 new scenarios intests/ci.rs:Merge Danger
Door: two-way
A single revert undoes it. Nothing is persisted beyond what a Run already pushes.
Blast Radius: Runs
Every Run now waits at least 60 seconds after its last push when a repo has no CI, and polls GitHub every 10 seconds while checks run. A Run that used to exit 0 with red CI or an unmergeable PR now ends as a Failed run with its PR back in draft. Red CI or a conflict can now cost up to 3 extra agent sessions per Run.
Unaddressed findings
Standards
poll.rsrather than injected: the tests drive only the binary, so env vars are the injection point the spec chose ("overridable through an environment variable for tests").(issue, base, branch, pr_url): this predates the change (the conflict Repair prompt already took it). Bundling it is a separate refactor acrossprompt.rsandrun.rs.enum Ciis a Mysterious Name: at the call sites (Ci::Absent | Ci::Passed,Ci::Failed(checks)) it reads as the state of CI, and a longer name adds nothing there.ci::sleep's interrupt check repeatssession.rs's wait loop: the session loop also polls the child process and stops it, so the shared part is two lines.Spec
repairs exhausted: CI red: this follows the spec's pseudo-code as written. Changing it (e.g. accepting noted failures) needs a spec decision.mergeableignores branch protection (mergeStateStatuswould be stricter): the spec asks for "mergeable". Required reviews would block every unreviewed PR anyway.staleandaction_requiredcheck runs count as failed: exit 0 requires passing CI, and neither is a pass. Treating them as red is the conservative reading.UNKNOWNis a failure reason the spec doesn't list: without a limit the final check could hang forever. Failing matches "exit 0 only when … mergeable".Closes #9
🤖 Generated with Claude Code