Repository navigation
feat: one CI-verdict script for every merge path (M4.6, #628) - #629
Merged
Merged
Conversation
`pyauto-brain ci-verdict <owner/repo>#<n> [--json]` (bin/ci_verdict.py) is
the one CI judgement. It takes the REST head sha (an empty sha is refused
before any run query), reads every check-run, commit status, workflow run and
job on it (paginated) and the PR's mergeability, and prints GREEN, PENDING or
RED with reasons (exit 0 / 2 / 1).
- GREEN: at least one completed check, every completed check success (or a
named skip/neutral), mergeable_state clean.
- PENDING: a check or run not completed; mergeability not computed yet
(re-read once); unstable while every check read has completed.
- RED: failed / cancelled / timed-out / unrecognised conclusion; zero checks
or only skipped ones; conflicting, behind, draft, closed unmerged; blocked
or another non-clean state once every check has completed; unreadable gh.
The three merge paths now use it:
- /prm step 2 runs `ci-verdict` and obeys it (reference.md and mcp.md point
at it; the hand recipe stays for surfaces where it cannot run);
- the shift close-out template gains step 4, `{ci_verdict_cmd}`, for every
repo — only GREEN passes;
- the watcher's pr_health keeps its `gh pr checks` read (its approved network
surface) and delegates the judgement to `ci_verdict.judge`; its words and
tests are unchanged.
Tests (offline, fake gh): all green, one red leg, cancelled/timed out,
skipped-only, zero checks, pending, queued run with no jobs, startup_failure,
empty head sha refused, behind/conflicting/blocked/draft, mergeability
retry, merged and closed PRs, third-party check-runs and commit statuses,
pagination, CLI exit codes and the dispatcher.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`test_a_full_brief_run_spawns_only_heart_readiness_and_git` dated its fake local readiness at a fixed NOW (2026-11-13 20:00Z) minus 0.5 h, but ran `brief --new` on the wall clock. From 2026-11-14 01:30Z the snapshot read over the 6 h age rule, so `read_heart` correctly fell through to the published feed and the urlopen guard fired, on main 4ae2c42 too. Pass `--at NOW` like the file's other brief runs; the assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Programme M4.6, part 1. Closes #628. The re-check is on the issue: FB-4 partly holds; FB-5, REL-6 and FLOW-3 hold.
pyauto-brain ci-verdict <owner/repo>#<n>judges every check-run, workflow run and job, and every commit status, for the PR's REST head sha. Exit codes:clean./prmstep 2 and the watcher close-out template now run it, andpr_healthdelegates its judgement to it.pr_healthkeeps its singlegh pr checksread, so the watcher's network surface is unchanged.Test plan
Tier: glance. Merge mode: auto-merge on green with the Witness passed (Heart dev-ship gate).
🤖 Generated with Claude Code