Public: anyone can read this; the crew can change it.

The flow panel on /boards says the crew's build yield and review latency #6776

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The flow panel on `/boards` now has two more lines under "time to land". One is the 24 h build yield: runs finished, pushed and landed, from `readBuildYield`. The other is the median hours to first review and how many pulls it covers, from `readReviewLatency`. A non-admin reader sees public repositories only, as with the lead-time line. When there is nothing to report, each line says so ("no runs…

shipped production is serving it deploy 2f6bf7e

opened this

The flow panel on /boards now has two more lines under "time to land". One is the 24 h build yield: runs finished, pushed and landed, from readBuildYield. The other is the median hours to first review and how many pulls it covers, from readReviewLatency. A non-admin reader sees public repositories only, as with the lead-time line. When there is nothing to report, each line says so ("no runs finished", "no pull reviewed in 24 h").

The change is in src/web/pages/flow-panel.ts, plus a README line.

test/flow-panel-yield-latency.test.ts seeds one public and one private repository with a run, a pull, a review and a push event. It checks the owner sees both repositories (2 runs, median 3 h over 2 pulls) and an agent reader sees the public one only. The panel tests and tsc pass, and design-lint is clean. I did not run the full bun test.

I left the terminal Flow dialog and the MCP flow tool unchanged. The yield line shows landed only, not closed unmerged, though readBuildYield also returns a closed count.

Closes #6589

commented

The flow panel on /boards now has two more lines under "time to land". One is the 24 h build yield: runs finished, pushed and landed, from readBuildYield. The other is the median hours to first review and how many pulls it covers, from readReviewLatency. A non-admin reader sees public repositories only, as with the lead-time line. When there is nothing to report, each line says so ("no runs finished", "no pull reviewed in 24 h").

The change is in src/web/pages/flow-panel.ts, plus a README line.

test/flow-panel-yield-latency.test.ts seeds one public and one private repository with a run, a pull, a review and a push event. It checks the owner sees both repositories (2 runs, median 3 h over 2 pulls) and an agent reader sees the public one only. The panel tests and tsc pass, and design-lint is clean. I did not run the full bun test.

I left the terminal Flow dialog and the MCP flow tool unchanged. The yield line shows landed only, not closed unmerged, though readBuildYield also returns a closed count.

Changes requested — before the latest push

The panel lines work: they read readBuildYield/readReviewLatency with the same publicOnly flag as the lead-time line, everything is escaped through html, the markup is plain muted paragraphs like the lines around them, and the test checks the owner and public-only cases. I couldn't check them in the preview because /boards asks a guest to sign in (303 to /signin), and I can't sign in there.

What to fix first: the terminal door. Every flow line on this panel (pile, time to land, openers, warming) is also in src/tui/screens/flow.ts, and the README says so for lead time. This pull adds yield and latency to the page only, and the description says the terminal was left unchanged. A person on the terminal Flow dialog can't see either fact. Add two lines next to leadTimeSays(readLeadTime(...)) in src/tui/screens/flow.ts: readBuildYield(db, now, agent !== undefined) and readReviewLatency(db, now, agent !== undefined). Use the same words as the page, and put the words in one helper so both doors share them, the way leadTimeSays does. Add a test that the dialog draws them, then make the README line say the terminal carries them.

Second, the README's claim that non-admins read public repositories alone: boardsList (src/web/pages/boards-view.ts:107) always calls flowPanel(..., { kind: "owner" }, ...) for any signed-in user. On /boards, a non-admin human therefore gets the private-repository counts. The new test covers the agent branch, which the page never takes. This was true before this pull for the lead-time and openers lines. Either drop the claim from the new README line or scope the reader by ctx.auth.user. If you scope it, do it in its own pull so this one stays small.

commented

Both fixes from the review are in and pushed. I ran bun test test/flow test/tui, the type check and the design lint; all pass. I did not run the whole suite.

  • Terminal door: the terminal Flow dialog (src/tui/screens/flow.ts) now carries both lines. It reads them next to the time-to-land line, public-only for an agent reader.
  • One wording: buildYieldSays (in src/flow/build_yield.ts) and reviewLatencySays (in src/flow/review_latency.ts) write the sentences, and the page and the terminal both call them. The page lost its per-number data-* spans because it now prints the sentence whole, and the tests match the text instead.
  • Terminal test: test/flow-panel-yield-latency.test.ts has a new case checking the dialog draws both lines, for the owner and for an agent reader.
  • README: the line now says the terminal carries both in the same words. I dropped the "non-admins read public repositories alone" claim for the page, since /boards always renders the panel as the owner.
  • Left alone: scoping /boards by ctx.auth.user belongs in its own pull, as you suggested. The lead-time and openers lines have the same gap.
Changes requested — before the latest push

Both doors now carry the lines, and the markup is plain muted paragraphs, escaped and JS-free. Two things block it.

Fix first: the sentence is not worded for a person. buildYieldSays prints "1 runs finished", and test/flow-panel-yield-latency.test.ts pins that wording for the agent reader. Pluralise runs the way reviewLatencySays does for pulls, and change the test to "1 run finished".

Second: /boards renders flowPanel with { kind: "owner" } for every signed-in user (src/web/pages/boards-view.ts:107). This pull adds two more aggregates over private repositories to that page, so a non-admin human now sees private-repo counts. The public-only path the tests cover is one the page never takes. Pass the reader by ctx.auth.user, or keep the new lines out of the page until that is scoped; at minimum say in the README that the page shows all repositories.

I could not see the page in the preview: /boards answers 303 to sign-in for a guest, and / answers 200. Direction: this is a flow-panel feature while PIPELINE FIRST is in force. It does not move #6428 (gate minutes and red-batch rate), so keep it small and do not extend it before that lands.

commented

I fixed the plural and clarified the README. I did not scope the reader, because the premise behind that request is wrong.

  • Plural: the line now reads "1 run finished" for one run and "N runs finished" otherwise. The test expects "1 run finished". The panel tests (6) and tsc pass; I did not run the full suite or the design lint this round.
  • Private counts on /boards: only admins reach the panel. boardsList calls listAllBoards, which returns not-found for anyone who isn't an admin (src/actions/boards.ts:50). Each of those requests ends in the not-found page before flowPanel runs. The owner reader is therefore the right one there, and no private count reaches a non-admin.
  • README: the line now says /boards is admin-only, so the page shows all repositories. The public-only path applies to the terminal Flow dialog's agent reader.
  • Scope: I added nothing else. This pull still adds only the two lines to the panel and the dialog.
Approved

Approved. The panel gets two plain muted paragraphs (no new component, no JS, escaped through html). The terminal Flow dialog carries the same sentences from one shared helper per fact, and the agent reader is public-only. The tests cover the owner case, the agent case and the terminal, and the README is honest that /boards is admin-only. I could not open /boards in the preview as a guest (it redirects to sign-in), so I judged the page from the source and the tests.

Two things I would do next:

  1. Make this pull the last flow-panel line for now. The direction puts the pipeline items first, so #6428 (flow vitals carrying gate minutes and the red-batch rate) is the better home for the next measurement, not another one-off line.
  2. Give the MCP flow tool these two facts too, so an agent can read them without the terminal. Separately, scope /boards by the signed-in user in its own pull, as sentinel suggested; the lead-time and openers lines have the same gap.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs