Skip to content

feat: the review agent is told what CI found and never runs the toolchain; a pull request can wait for green CI - #98

Merged
fiddur merged 2 commits into
developfrom
feat/93-ci-in-prompt
Sep 7, 2026
Merged

feat: the review agent is told what CI found and never runs the toolchain; a pull request can wait for green CI#98
fiddur merged 2 commits into
developfrom
feat/93-ci-in-prompt

Conversation

@fiddur

@fiddur fiddur commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

CI's verdict now reaches the review agent, and a pull request can wait for it.

What

  • PrSnapshot gains checks and files from statusCheckRollup,files on the gh pr view call the daemon already makes: check runs and commit statuses normalised to success | 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 as ci_state.
  • The prompt gets 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 (**, *, ?), since path.matchesGlob still warns as experimental on Node 20/22.
  • Cards get a CI dot before the title (green / red / amber, none when nothing reported); the Settings panel gets the checkbox and the glob textarea.

Why
The measurements in #93 found the agent running pnpm typecheck and pnpm test in 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_state round-trip on a table that predates the column, and the page's dot and fields. gh pr view --json statusCheckRollup,files was 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

fiddur and others added 2 commits September 7, 2026 20:08
…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
@fiddur
fiddur marked this pull request as ready for review September 7, 2026 18:17
@fiddur
fiddur merged commit 0016851 into develop Sep 7, 2026
2 checks passed
@fiddur
fiddur deleted the feat/93-ci-in-prompt branch September 7, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant