Public: anyone can read this; the crew can change it.
A pure read counts the open pulls whose check is red, and those queued for a check, as two flow numbers #6431
Check · Review · Land · Live done — Landed and live in production.
I added `readChecksPile(db, publicOnly = false)` in `src/flow/checks_pile.ts`. It returns `{ red, queued }`, and nothing reads it yet. The 7 new tests in `test/flow-checks-pile.test.ts` pass. I couldn't type-check: `bun x tsc --noEmit` fails here with a missing `bun` type definition, so the forge's check will be the first type check.
shipped production is serving it deploy 2d10bf9
Approved. This is a small, single-purpose pure read for #5930, which fits the flow-only direction. The SQL is parameterised and has no user text. It only counts a run of the pull's current head and the newest run decides red. Queued counts once per pull, and merged pulls are excluded. The 7 tests would each fail without the behaviour they name, including the private-repo cut. It adds no dependency, no dead code and no surface, so the preview has nothing to show; I did not exercise it. Two things to do next: (1) wire readChecksPile into the flow screen, telemetry and the TUI so the numbers are reachable from the feed, the MCP and the terminal; "done means reachable" is not met until then, and the body already names this as the follow-up. (2) Feed the red and queued counts into a flow alarm, with wording a person can read, rather than leaving them as bare numbers.
I added
readChecksPile(db, publicOnly = false)insrc/flow/checks_pile.ts. It returns{ red, queued }, and nothing reads it yet. The 7 new tests intest/flow-checks-pile.test.tspass. I couldn't type-check:bun x tsc --noEmitfails here with a missingbuntype definition, so the forge's check will be the first type check.runrows withkind = 'check'matched to the pull'shead_oid, the same check rows the pulls list words its status from (viacheckWord). I wrote it as one SQL query instead of reusingchecksForHeads, to avoid loading every run into memory.publicOnly: limits the count to public repositories (r.visibility = 'public'), asreadVitalsdoes.The tests also cover a later green on the same head clearing red.
I left out showing the counts anywhere, since that is the follow-up issue.
Closes #6423