✨ feat(pr-signals): pr-signals says when no CI has run, as on a conflicted pull request (#585)
Merged
AT
3d ago+108+108+012345678901234567890123456789-22-22-01234567890123456789
Slice: #585
Part of https://github.com/veda-hq/niyam/issues/394 (spec v1). The lesson is pr-green-needs-ci-runs: veda docs/lessons/github-actions.md, "A conflicted PR runs no CI." (read 2026-11-24 at baa73ff).
What it does
niyam pr-signals <pr>now says when no CI has run on a pull request, so an empty list of failures is not read as green. Before this, a conflicted pull request printedsignals: []with nothing to say that CI never ran.- Its JSON gains
ci: { mergeable, checkRuns, actionsRuns },--ci-onlyincluded:mergeableis the pull request'smergeable_state, from the tworeadPullreads it already makes. It takes the later read, unless GitHub still saysunknownthere, in which case it takes the first. It isnullwhen GitHub gives neither.checkRunsandactionsRunscount the head's check runs, all of them and GitHub Actions' alone. Both come from the listciSignalsalready reads, so no request is added.
- It prints one warning line on standard error:
dirty:⚠ #N has merge conflicts, so GitHub runs no pull_request workflows on it: merge the base and push before reading it as clear. This one wins, since merging the base fixes both cases.- no GitHub Actions check run on the head:
⚠ no CI has run on <sha> yet: no GitHub Actions check run is on it, so no failure listed is not a pass.
signalsis unchanged. The README'spr-signalssection describesciand the warning.
Out of scope: the lesson's "two consecutive settled polls" is for a CI watcher, which niyam does not have, so it stays a doc.
Evidence
- New tests in
src/pr-signals.test.ts:- a dirty pull request with no check runs gives
ci{dirty, 0, 0},signals: []and the conflict line; - a head where only Cubic ran gives
actionsRuns: 0and the no-CI line; - the later read's
mergeable_statestands unless it isunknownor missing; ciSignalsreturns its counts (5 check runs, 4 from Actions).
- a dirty pull request with no check runs gives
- The
session()fixture now has one passing Actions run, so the other tests still print no warning. - Full gate on
e92d37b:pnpm provenance && pnpm typecheck && pnpm lint && pnpm test && pnpm test:scripts && pnpm pins && pnpm pariksha && pnpm hooks:check && pnpm build && pnpm smokeexited 0.pnpm test: 2192 of 2192 pass.pr-signals.tscoverage is 100% lines, 96.68% branches and 100% functions.pnpm test:scripts: 138 of 138 pass.
🤖 Generated with Claude Code
Summary by cubic
pr-signals now reports when no CI has run on a pull request, so an empty list of failures is not read as green. Before, a conflicted pull request printed signals: []; it now prints a warning and carries ci in its JSON.
What changed
ciholds the pull request'smergeable_state, its check-run count, and the GitHub Actions run count, with no extra request.- The later read's
mergeable_statestands only when the head is unchanged and GitHub does not still sayunknown; otherwise the first read's stands. - A dirty pull request's warning wins over the no-GitHub-Actions one, since merging the base fixes both.
signalsis unchanged, and the README describesciand the warning.