feat: the review agent is told what CI found and never runs the toolchain; a pull request can wait for green CI - #98
Merged
Merged
Conversation
…hain; a pull request can wait for green CI The inbox's `gh pr view` call now asks for `statusCheckRollup` and `files`, so every snapshot carries the head's checks (normalised, duplicates collapsed to the worst report) and its changed paths. The preparing agent's prompt names each check that reported with its verdict, counts the ones a workflow skipped, and tells it not to install, build, typecheck, lint or test — CI has done that, and the checkout is the author's code. Two settings follow from having the data: `waitForCi` holds a pull request in the queue while its checks run and sets one aside when they fail, re-decided at every poll so passing checks bring it back on their own; `alertPaths` marks a review as needing the reviewer now when a changed file matches one of their globs, whatever the agent made of `alertWhen`. Each card gets a CI dot, and the store keeps `ci_state` per row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
…and an all-skipped CI line reads CANCELLED and STALE conclusions decided nothing, so they map to `neutral` rather than `failure`: the re-run's success now outranks the attempt that was cancelled, instead of a head whose CI passed showing a red dot, a "CI failed:" skip that never lifts, and a prompt telling the agent a check failed. TIMED_OUT, ACTION_REQUIRED, FAILURE, ERROR and STARTUP_FAILURE stay failures. `ciState` calls a head passing only when something actually passed: a set of nothing but skipped and undecided checks is `none`, so no dot claims green for a head where nothing ran. And the prompt's CI line says "19 checks skipped, none ran" instead of "19 more skipped" when there is nothing to put before "more". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w
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.
CI's verdict now reaches the review agent, and a pull request can wait for it.
What
PrSnapshotgainschecksandfilesfromstatusCheckRollup,fileson thegh pr viewcall the daemon already makes: check runs and commit statuses normalised tosuccess | failure | pending | skipped | neutral, duplicate names collapsed to their worst report, files capped at 300, malformed or missing fields → empty arrays.ciState(checks)→passing | failing | running | none, persisted asci_state.CI at this head: check-job SUCCESS · e2e PENDING · 11 more skipped(or "CI has not reported for this head.") and, always, the instruction not to install, build, typecheck, lint or test — CI has done that, and the checkout is the author's code. Check names are held to one line and 80 characters, like the title and author above them.waitForCi(default false): a transition that would spend an agent waits while checks run ("waiting: CI running (3 checks)") and is set aside when they fail ("CI failed: check-job, pr-mgmt-job"). Re-decided every poll, so passing checks return it to the queue on their own — unlike a filter skip at the same head. ↑ prepares regardless, and a review prepared for an older head stays openable while its refresh waits.alertPaths(default []): a changed file matching one of the reviewer's globs marks the review as needing them now, standing in when the agent raised no ALERT. Own small glob→RegExp (**,*,?), sincepath.matchesGlobstill warns as experimental on Node 20/22.Why
The measurements in #93 found the agent running
pnpm typecheckandpnpm testin 20 of 22 preparations — 13 minutes of work CI had already done, one field away on a call the daemon was making anyway. Holding a failing pull request keeps a run from being spent on a diff the author is still fixing.Verified
npm run build,npm run typecheck,npm test— 1141 tests green (github 45, cli 524 + 433). New cases: snapshot parsing (mixed runs and statuses, duplicates, malformed fields, the 300 cap),ciState, prompt lines with and without checks and with a hostile check name, config/settings for both keys, the reconcile CI rules (running, failing, passing, none, bumped override, stale/prepared refresh, a CI skip re-queued when checks pass),alertForPaths, the tick storing the path alert only when the agent gave none,ci_stateround-trip on a table that predates the column, and the page's dot and fields.gh pr view --json statusCheckRollup,fileswas run against a real NCBackend3 pull request on the installed gh 2.46 to confirm the shapes.Part of #93. Version 0.10.24.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Bwp5QefjsjMFeq6CK6cT6w