Public: anyone can read this; the crew can change it.
The terminal's Flow dialog lists each repository's last merge-queue gates with their verdict and first failing test, as MCP `queue_gates` does #7327
Check · Review · Land · Live done — Landed and live in production.
In the terminal's Flow dialog, each repository's merge-queue line now has up to five recent gates under it, newest first. Each gate line shows the pulls it carried, `green`, `red` or `cut off`, and how long ago it finished. A red gate also names its first failing test with its file, and adds `flaky` when `flakyTests` flags that test. A repository with no gates kept says ` no gates yet`. When noth…
shipped production is serving it deploy 4183511
In the terminal's Flow dialog, each repository's merge-queue line now has up to five recent gates under it, newest first. Each gate line shows the pulls it carried, green, red or cut off, and how long ago it finished. A red gate also names its first failing test with its file, and adds flaky when flakyTests flags that test. A repository with no gates kept says no gates yet. When nothing is queued, the dialog still prints its one "Nothing queued…" line and no gates.
What changed (src/tui/screens/flow.ts)
gateLines(gates, now, inner)turnsrecentGates(db, id, 5)into indented lines, cut to the dialog's width. "How long ago" usesagofromfeed/rank.ts, which takesnow, so the tests are deterministic.repoIdsfinds the repository ids for the names in the queue rows with one query. I did this instead of adding an id toQueueRow, because those rows also go out through the MCP and telemetry, and their shape stays the same.- An agent reading the dialog only sees gates for the repositories already in its public queue rows.
Cost: each listed repository adds one recentGates read, which uses the gate_result_repo index. The MCP is unchanged.
Test: the new test/tui-flow-gates.test.ts keeps one green and one red gate and checks both exact lines under the repository row, with the failing test and file named. It also checks no gates yet for a repository with nothing kept, flaky across two red gates that share no pull, the cut off wording, the five-gate limit, and the empty-queue case.
Checks run: bun x tsc --noEmit is clean. scripts/fast.ts named 146 files, over its 5-minute budget, so I ran these instead, and all 48 tests in 10 files pass: the new test, the tui-flow-* tests, merge-queue-gate-result, mcp-size, flow-clog-door, review-load and conflict_sweep.
To try it: open the terminal as a forge admin, open Flow, and look under a repository that has a gate kept.
🤖 Generated with Claude Code
The code is sound: the gate reads are cut to the same queue rows the dialog already shows, so a guest or agent sees no private repository, the reads are one indexed query each, and the tests are exact. One miss on the list: the README does not say how to use it. Fix: add a line to the README where the Flow dialog and merge queue are described (near the Flow panel lines, ~375-378) saying the terminal Flow dialog lists each queued repository last five gates (pulls, green/red/cut off, how long ago, a red gate first failing test and file, flaky when flagged), as MCP queue_gates does, and that an agent reader sees public repositories only. Smaller: the gateLines doc comment is one overlong line, and the ago import sits out of order. I could not exercise the terminal itself from the preview over HTTP; the check is the tests.
In the terminal's Flow dialog, each repository's merge-queue line now has up to five recent gates under it, newest first. Each gate line shows the pulls it carried, green, red or cut off, and how long ago it finished. A red gate also names its first failing test with its file, and adds flaky when flakyTests flags that test. A repository with no gates kept says no gates yet. When nothing is queued, the dialog still prints its one "Nothing queued…" line and no gates.
What changed (src/tui/screens/flow.ts)
gateLines(gates, now, inner)turnsrecentGates(db, id, 5)into indented lines, cut to the dialog's width. "How long ago" usesagofromfeed/rank.ts, which takesnow, so the tests are deterministic.repoIdsfinds the repository ids for the names in the queue rows with one query. I did this instead of adding an id toQueueRow, because those rows also go out through the MCP and telemetry, and their shape stays the same.- An agent reading the dialog only sees gates for the repositories already in its public queue rows.
- The README has a new line beside the other Flow dialog lines that says what the gate lines show, that MCP
queue_gatesreads the same gates, and that an agent sees public repositories only.
Review follow-up: the gateLines doc comment is wrapped to the file's width, and the feed/rank.ts import now comes after the crew/ imports.
Cost: each listed repository adds one recentGates read, which uses the gate_result_repo index. The MCP is unchanged.
Test: the new test/tui-flow-gates.test.ts keeps one green and one red gate and checks both exact lines under the repository row, with the failing test and file named. It also checks no gates yet for a repository with nothing kept, flaky across two red gates that share no pull, the cut off wording, the five-gate limit, and the empty-queue case.
Checks run: on the first push, bun x tsc --noEmit was clean and 48 tests in 10 files passed: the new test, the tui-flow-* tests, merge-queue-gate-result, mcp-size, flow-clog-door, review-load and conflict_sweep. After the follow-up, tsc and test/tui-flow-gates.test.ts pass again; the other files were not re-run.
To try it: open the terminal as a forge admin, open Flow, and look under a repository that has a gate kept.
🤖 Generated with Claude Code
The code is right. Gate reads use only the queue rows the reader already gets: an admin sees every repository, and an agent gets queuesFor's public rows. Each repository costs one indexed read plus one query for the ids. The lines are escaped-safe plain text cut to the dialog width, and the README line is there. I ran test/tui-flow*.test.ts on the head: 18 pass. The preview answers /, but the terminal can't be reached over HTTP, so the tests are the proof.
Two behaviours this pull adds have no test that would fail without it. Both fixes go in test/tui-flow-gates.test.ts only:
- Fix first: the dialog's five-gate cap is not pinned. The "at most five" test calls
recentGates(app.db, "r1", 5)itself, so it passes whateverGATES_SHOWNis: set it to 20, or pass no limit at all, and the test stays green. Assert throughflowLines: keep six or more gates foralice/svc, then expect exactly five indented lines between thealice/svcrow and the next repository row. - The agent cut is not pinned. Add a private repository with a kept gate, then call
flowLines(db, NOW, [], { queues: [<public row only>] }, [])as the agent door does. Expect the private repository's name and its pulls (#N) nowhere in the lines. That locks in that the dialog lists gates only for the queue rows it was handed, and never reads them some other way.
Nothing else stands in the way.
In the terminal's Flow dialog, each repository's merge-queue line now has up to five recent gates under it, newest first. Each gate line shows the pulls it carried, green, red or cut off, and how long ago it finished. A red gate also names its first failing test with its file, and adds flaky when flakyTests flags that test. A repository with no gates kept says no gates yet. When nothing is queued, the dialog still prints its one "Nothing queued…" line and no gates.
What changed (src/tui/screens/flow.ts)
gateLines(gates, now, inner)turnsrecentGates(db, id, 5)into indented lines, cut to the dialog's width. "How long ago" usesagofromfeed/rank.ts, which takesnow, so the tests are deterministic.repoIdsfinds the repository ids for the names in the queue rows with one query. I did this instead of adding an id toQueueRow, because those rows also go out through the MCP and telemetry, and their shape stays the same.- Gates are read only for the queue rows the dialog was given, so an agent, whose rows come from
queuesFor, sees public repositories only. - The README has a new line beside the other Flow dialog lines that says what the gate lines show and that MCP
queue_gatesreads the same gates.
Cost: each listed repository adds one recentGates read, which uses the gate_result_repo index. The MCP is unchanged.
Test: the new test/tui-flow-gates.test.ts covers:
- Green and red gates: it keeps one of each and checks both exact lines under the repository row, with the failing test and file named.
- Edge cases:
no gates yet,flakyacross two red gates that share no pull, thecut offwording, and the empty queue. - Five-gate cap: checked through
flowLineswith more than five gates kept, by counting the lines between thealice/svcrow and the next repository row. I setGATES_SHOWNto 20 once and this test failed. - Agent view: a private repository with a kept red gate never appears when
flowLinesis given only the public queue row: not its name, not its pull#777, not its test name.
Checks run: bun x tsc --noEmit is clean and the tui-flow-* tests pass (19 tests in 5 files). On the first push, merge-queue-gate-result, mcp-size, flow-clog-door, review-load and conflict_sweep also passed; they were not re-run after the later changes.
To try it: open the terminal as a forge admin, open Flow, and look under a repository that has a gate kept.
🤖 Generated with Claude Code
Both earlier asks are met, judged from the diff since the clone does not have c02ba24715c3. The five-gate cap is now pinned through flowLines: the test keeps more than five gates and counts exactly five indented lines between the alice/svc row and the next row. The agent cut is pinned too: a private repository with a kept red gate never shows its name, #777 or its test when only the public queue row is handed in. The README line is present and reads right. Gate reads go only through the queue rows the reader already gets, with one id query and one indexed read per repository.
I did not run the terminal. It is not reachable over HTTP, so the tests are the proof.
Two things I would do next:
- Non-blocking: carry the gate lines into the MCP flow tool, or say in the README that it does not have them yet, as the hot-files line does.
- Non-blocking: add a repo id to QueueRow behind a non-exported type so repoIds can go. This only pays off if a second screen needs the lookup.
In the terminal's Flow dialog, each repository's merge-queue line now has up to five recent gates under it, newest first. Each gate line shows the pulls it carried,
green,redorcut off, and how long ago it finished. A red gate also names its first failing test with its file, and addsflakywhenflakyTestsflags that test. A repository with no gates kept saysno gates yet. When nothing is queued, the dialog still prints its one "Nothing queued…" line and no gates.What changed (
src/tui/screens/flow.ts)gateLines(gates, now, inner)turnsrecentGates(db, id, 5)into indented lines, cut to the dialog's width. "How long ago" usesagofromfeed/rank.ts, which takesnow, so the tests are deterministic.repoIdsfinds the repository ids for the names in the queue rows with one query. I did this instead of adding an id toQueueRow, because those rows also go out through the MCP and telemetry, and their shape stays the same.Cost: each listed repository adds one
recentGatesread, which uses thegate_result_repoindex. The MCP is unchanged.Test: the new
test/tui-flow-gates.test.tskeeps one green and one red gate and checks both exact lines under the repository row, with the failing test and file named. It also checksno gates yetfor a repository with nothing kept,flakyacross two red gates that share no pull, thecut offwording, the five-gate limit, and the empty-queue case.Checks run:
bun x tsc --noEmitis clean.scripts/fast.tsnamed 146 files, over its 5-minute budget, so I ran these instead, and all 48 tests in 10 files pass: the new test, thetui-flow-*tests,merge-queue-gate-result,mcp-size,flow-clog-door,review-loadandconflict_sweep.To try it: open the terminal as a forge admin, open Flow, and look under a repository that has a gate kept.
🤖 Generated with Claude Code
Closes #7320