Repository navigation
Wait for green CI before a job is accepted (publish.ci) - #12
Conversation
A definition can now opt into `publish: {ci: {wait: true, timeout: 30m}}`.
After push, pull request, and proof, publish runs a fourth fenced step: it
polls the check runs and commit statuses on the branch's current remote
head via `gh api`, and records `ci` on the ledger only when every signal is
green. Red fails fast, pending past the timeout fails, a head with no checks
passes after a two-minute registration grace, three consecutive read errors
end the wait, and a cancel stops it. Every failure ends the job
accepted_unpublished with the branch and pull request in place and the red
checks named in the result.
The control plane enforces the rule itself: CompleteAttempt refuses
`accepted` without a ci record when the run's frozen definition waits for
CI (publish_ci_required), mirroring the proof requirement. The publish-only
retry now carries the run snapshot, so it re-applies the same policy and
judges whatever the branch head is by then, which lets a person's fix count.
Migration 004 rebuilds publish_records to widen its step CHECK with 'ci'.
factory.yaml opts in; definitions without `ci` are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwarQhEaL1ygzyMLvaXvZH
|
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 (15)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughPublishing can optionally wait for pull request CI. The worker polls checks on the current branch head and records the CI result. The control plane requires that result before accepting runs whose frozen definition enables CI waiting. ChangesCI-gated publishing
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Worker
participant GitHubCLIGateway
participant GitHubAPI
Worker->>GitHubCLIGateway: Request checks for current branch head
GitHubCLIGateway->>GitHubAPI: Read check runs and commit statuses through gh api
GitHubAPI-->>GitHubCLIGateway: Return check runs and statuses
GitHubCLIGateway-->>Worker: Return normalized check verdicts
Worker->>GitHubCLIGateway: Poll again while checks are pending
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The one-minute timeout behaves as a hard limit, and no merge-blocking issue remains after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The optional CI gate adds a useful acceptance control, but a job can be accepted after checks pass on a head that is no longer current, or after no checks appear during the registration grace period. Exposure depends on who can change the attempt branch and how its CI is configured. 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 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 11 files. (4 skipped: 4 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 |
What
Opt-in CI babysitting, part A of two. This part watches CI and makes green CI a condition of
accepted. The auto-fix loop comes in a follow-up PR.ci, runs after push → pull_request → proof.gh api --paginate --jq.ciis recorded and the job isaccepted.ci_failed, naming the failing checks.ci_timeout.ci_unavailable.ci_wait_cancelled.accepted_unpublished. The branch and PR stay in place, andci_ref/ci_failuresare in the result.CompleteAttemptreturnspublish_ci_requiredwhen the run's frozen definition waits and the ledger has nocirecord. It mirrors the proof rule and does not rely on what the worker reports.publish_recordsto add'ci'to the step CHECK. Rows are copied across, and a test covers that.factory.yamlopts in. Definitions withoutcibehave as before.Trade-offs
proofrecord keeps jig's own commit, so worktree cleanup is unchanged.Tests
ci, theacceptedgate with and without opt-in, and the retry carrying the snapshot.accepted;acceptedon the new head;gh apioutput.format-check,vet,boundary,definitions,build,testand-raceare all green. The exceptions are twoTestAManifestWriteFailure…tests that fail only as root in the cloud container: they fail the same way on unchanged main and pass as a non-root user.🤖 Generated with Claude Code
https://claude.ai/code/session_01LwarQhEaL1ygzyMLvaXvZH
Generated by Claude Code
Summary by CodeRabbit