Public: anyone can read this; the crew can change it.
/flow lists the pulls closed unmerged because a check was stopped for CPU, so a person can re-queue them #11908
Check · Review · Land · Live — Its check is queued.
/flow now lists the pulls that were closed without merging after a check was stopped for CPU, so the steward can queue them again. The `flow` tool returns the same rows when called with `{ kind: cpu }`.
6 files · +214 −4
working queued to check deploy 33a3ef4
Check queued 36mCheck of 33a3ef4fast tier: queued · full gate runs on land
Website spec: 23 findings (report only)
- / <a href="/admin-ada0/admin/app/production/open"> has no accessible name — names
- / <a href="/bad-name-12dd/bad-name/app/production/open"> has no accessible name — names
- /front <a href="/admin-ada0/admin/app/production/open"> has no accessible name — names
- /front <a href="/bad-name-12dd/bad-name/app/production/open"> has no accessible name — names
- /board http://127.0.0.1:35389/board answered 303 — https://specification.website/
- /notes http://127.0.0.1:35389/notes answered 303 — https://specification.website/
- /feed http://127.0.0.1:35389/feed answered 303 — https://specification.website/
- /review http://127.0.0.1:35389/review answered 303 — https://specification.website/
- /releases http://127.0.0.1:35389/releases answered 303 — https://specification.website/
- /repos http://127.0.0.1:35389/repos answered 303 — https://specification.website/
- /map http://127.0.0.1:35389/map answered 303 — https://specification.website/
- /system http://127.0.0.1:35389/system answered 303 — https://specification.website/
- /talk http://127.0.0.1:35389/talk answered 303 — https://specification.website/
- /flow http://127.0.0.1:35389/flow answered 303 — https://specification.website/
- /resilience http://127.0.0.1:35389/resilience answered 303 — https://specification.website/
- /boards?help http://127.0.0.1:35389/boards?help answered 303 — https://specification.website/
- /settings/crew http://127.0.0.1:35389/settings/crew answered 303 — https://specification.website/
- /settings/crew?help http://127.0.0.1:35389/settings/crew?help answered 303 — https://specification.website/
- /preview-admin/sample expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/next expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/bets expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/waves expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/milestones expected exactly one <h1>, found 2 — headings
/flow now lists the pulls that were closed without merging after a check was stopped for CPU, so the steward can queue them again. The flow tool returns the same rows when called with { kind: cpu }.
What changed
src/flow/cpu_closed.ts(new):cpuClosedPulls(db, now, { cap?, publicOnly? })returns pulls that are closed, not merged, and whose last check was a CPU stop that ended in the last 7 days. The list is newest close first and capped at 20.
- "Last check" ignores the retry that the close itself cancelled (summary pull closed / pull landed). Without that, every stopped-then-closed pull would end on that cancelled retry instead of the CPU stop.
- It is one query. It starts from checks finished in the window, using the run_kind_finished index, rather than scanning closed issues.
src/flow/cpu_stops.ts: the test for "was this check stopped for CPU" now lives in one exported function,isCpuStop. It counts both a stop that was queued again (CPU_STOP_SUMMARY) and a second stop that was reported red. The hour's count and the new list both use it, and the count's behaviour is unchanged.src/web/pages/flow-cpu.ts(new) andsrc/web/pages/flow.ts: below the clog block, admins see one paragraph: the hour's CPU-stop count, then the pulls as links. Nothing is drawn when both are empty.src/http/mcp/tools/flow.ts: a newcpuvalue for the existingkindargument returns{ stopped, closed: [{ repo, number, closedAt }] }, with no new tool. As withkind: bugs, an admin sees every repository and anyone else sees public ones;stoppedis reported to admins only.test/flow-cpu-closed.test.ts(new): seeds five closed pulls:
- stopped for CPU, then closed; - stopped for CPU, then merged; - red for its own reason, then closed; - stopped, then red for its own reason; - stopped twice, reported red, then closed, in a private repository.
Only the first and last are listed. The test also covers the public-only view, the cap, the clock in both directions, the /flow block's links and empty state, and the MCP rows per viewer. It fails without cpu_closed.ts.
Not done
- /flow is not in
src/perf/page_budget.ts, so there was no statement budget to update; the block adds two bounded queries to the page. - The list carries no re-queue button; the links lead to each pull.
Checks run: bun scripts/gate.ts, bun x tsc --noEmit, bun test test/mcp-size.test.ts and bun scripts/design-lint.ts pass. The flow, MCP-flow and CPU-stop test files ran 85 pass, 0 fail. scripts/fast.ts named 1755 files for this diff, so I picked those covering test files myself instead of running the whole suite.
The plan was not kept on the issue: keep_plan could not be reached from this sandbox (POST $FORGE_URL/mcp answered 404).
To try it: as an admin, open /flow after a pull whose check was stopped for CPU has been closed unmerged, or call the flow tool with { kind: "cpu" }.
🤖 Generated with Claude Code
/flow now lists the pulls that were closed without merging after a check was stopped for CPU, so the steward can queue them again. The
flowtool returns the same rows when called with{ kind: cpu }.What changed
src/flow/cpu_closed.ts(new):cpuClosedPulls(db, now, { cap?, publicOnly? })returns pulls that are closed, not merged, and whose last check was a CPU stop that ended in the last 7 days. The list is newest close first and capped at 20.- "Last check" ignores the retry that the close itself cancelled (summary
pull closed/pull landed). Without that, every stopped-then-closed pull would end on that cancelled retry instead of the CPU stop. - It is one query. It starts from checks finished in the window, using therun_kind_finishedindex, rather than scanning closed issues.src/flow/cpu_stops.ts: the test for "was this check stopped for CPU" now lives in one exported function,isCpuStop. It counts both a stop that was queued again (CPU_STOP_SUMMARY) and a second stop that was reported red. The hour's count and the new list both use it, and the count's behaviour is unchanged.src/web/pages/flow-cpu.ts(new) andsrc/web/pages/flow.ts: below the clog block, admins see one paragraph: the hour's CPU-stop count, then the pulls as links. Nothing is drawn when both are empty.src/http/mcp/tools/flow.ts: a newcpuvalue for the existingkindargument returns{ stopped, closed: [{ repo, number, closedAt }] }, with no new tool. As withkind: bugs, an admin sees every repository and anyone else sees public ones;stoppedis reported to admins only.test/flow-cpu-closed.test.ts(new): seeds five closed pulls:- stopped for CPU, then closed; - stopped for CPU, then merged; - red for its own reason, then closed; - stopped, then red for its own reason; - stopped twice, reported red, then closed, in a private repository.
Only the first and last are listed. The test also covers the public-only view, the cap, the clock in both directions, the /flow block's links and empty state, and the MCP rows per viewer. It fails without
cpu_closed.ts.Not done
src/perf/page_budget.ts, so there was no statement budget to update; the block adds two bounded queries to the page.Checks run:
bun scripts/gate.ts,bun x tsc --noEmit,bun test test/mcp-size.test.tsandbun scripts/design-lint.tspass. The flow, MCP-flow and CPU-stop test files ran 85 pass, 0 fail.scripts/fast.tsnamed 1755 files for this diff, so I picked those covering test files myself instead of running the whole suite.The plan was not kept on the issue:
keep_plancould not be reached from this sandbox (POST $FORGE_URL/mcpanswered 404).To try it: as an admin, open /flow after a pull whose check was stopped for CPU has been closed unmerged, or call the
flowtool with{ kind: "cpu" }.🤖 Generated with Claude Code
Closes #11904