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

Each flow lane shows how long its cards wait: now and typical, and the slowest lane is named #14886

Merged opened this in answer to

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

Merged

Each home flow lane now shows two time lines, the slowest lane is marked, and each card shows its age in its lane. Tests I ran pass, except test/pages-budget.test.ts, which fails on two maintenance routes.

Notes

shipped production is serving it deploy cfe12e4

opened this

Each home flow lane now shows two time lines, the slowest lane is marked, and each card shows its age in its lane. Tests I ran pass, except test/pages-budget.test.ts, which fails on two maintenance routes. Those routes, /maintenance and /api/v1/maintenance/duties, are outside this change; I didn't check whether it fails on main too.

What changed

  • Typical times: src/flow/lane_times.ts reads the last 24 hours of records, in the worker with the lane picture and never on a request, into a new typicals field on the picture. Building and checks are run created → finished. Review is a pull's last green check → its first verdict. Landing is last approval → merged. Live is merged → first production deploy serving.
  • Now times: nowTimes takes the median and oldest card age from the lane's cards at render time, so it is never older than the page. Landing counts approved cards waiting to merge. A merged card waiting for its deploy counts toward Live, and Live counts deploys going out, not served ones.
  • Bottleneck: bottleneck picks the lane whose now median is furthest above its typical. It names no lane when none is above its typical, or when a typical is based on fewer than 3 cards. A typical under a minute is treated as a minute.
  • Page:
    • Each lane has a fixed two-line .lane-times under its health, e.g. "now 18m · oldest 54m" / "typical 9m · p90 31m", and "—" where there is nothing to say.
    • The bottleneck lane gets a "Bottleneck" word in its header and data-bottleneck.
    • Tiles read "in checks 23m" (Asked reads "asked 2d").
    • The lines are always rendered at a fixed height, including in the "reading…" state, so nothing shifts.
    • CSS and docs/design/areas/home-flow.md are updated, and bun scripts/design-lint.ts is clean.
  • MCP now: when there is a bottleneck, the answer ends with one extra row, why: "bottleneck", naming the lane with both times in says. No tool was added and the tool description is unchanged, so test/mcp-size.test.ts passes. docs/MCP.md is updated.

What I chose not to do

  • Asked has no typical and is never the bottleneck: how long an ask waits depends on when you put it there.
  • Now and the bottleneck are computed over the whole picture, not the viewer's filter. They are numbers only and name no card, but under the app filter they are forge-wide, not per-app.
  • I didn't add a new MCP tool or an extra field on the array answer, to avoid changing its shape. The bottleneck is one extra row, and only when there is one.
  • Typicals sample at most the newest 500 rows per lane.
  • I added no index. The review query scans reviews from the last 24 hours in the worker, every 30 seconds.

Tests: test/lane-times.test.ts seeds runs, reviews, a merged pull and a deploy, and checks each lane's typical. It also checks the now medians, that the bottleneck mark moves to whichever lane the test slows (checks, then building, then review), the page header, tile text, and the MCP row. I also ran test/home-flow.test.ts, test/picture-keep.test.ts, test/mcp-size.test.ts and test/mcp-doc-matches-tools.test.ts, and tsc is clean. The first-view budget in test/pages-budget.test.ts did not flag /. I did not run the full suite.

To try: open / and read the two lines under each lane's name; now over MCP ends with the bottleneck row once a lane is slower than its typical.

🤖 Generated with Claude Code

Closes #14882

Show 18 earlier items

7 earlier comments · 1 event
commented

Each home flow lane says how long its cards wait (now 18m · typical 9m), and the lane furthest above its typical is marked Slowest. The terminal's Flow screen now shows the same times.

Who sees what. "Now" is the middle wait of the cards the viewer can see, so a private repository's cards never count for someone who can't read it. "Typical" is read across every repository, so it and the Slowest mark only appear for a forge admin who is a person. Anyone else sees "now" alone.

Terminal. The Flow command now ends with a Lane times block, built by src/tui/screens/lane_times.ts. It shows one line per lane: now, the oldest card, typical and p90, with the slowest lane marked. It is shown under the same gate as the page.

  • It reads the last lane picture already in memory, through the new keptPicture in src/flow/lanes.ts. So the command stays synchronous, like the page. Before the first reading it says "reading…".
  • laneLines is back in src/flow/lane_times.ts, now with a caller. The Flow command checks access with telemetryReader, not isAdmin, so per AGENTS.md its entry stays in forgeCommands in src/tui/forge.ts, not in ENTRIES.

MCP. flow {kind: "lanes"} gives the same numbers to a forge admin who is a person and refuses anyone else. now still answers with runs only, and src/http/mcp/tools/now.ts is back to its plain sync run.

Review fixes. timesFor now sits above laneRegion's docblock, so each function keeps its own. docs/features/lane-times.md describes the terminal door instead of saying "none".

Checks.

  • test/lane-times.test.ts covers the page, MCP and terminal. The terminal test checks the lane lines for an admin person, and an empty block for a stranger, an agent and no user.
  • These all pass: bun x tsc --noEmit, bun scripts/design-lint.ts, and the tests for lane times, doorless pages, unused exports, home flow and the terminal flow screens.
  • I did not run the full set scripts/fast.ts named (2530 files, about 3.5 hours); the forge's check runs it.
  • test/openapi-coverage.test.ts and test/openapi-drift.test.ts fail on main as well; that is not from this pull.

Look pages. A commit names /. The gate's automatic list had 28 pages because they all import home_flow.ts, but only / draws the lane times.

[
  {"go": "/", "look": "each flow lane's header: one 'now … · typical …' line under the health words", "expect": "an admin sees both times and one lane marked Slowest; an empty lane's line is blank; no layout shift on first paint"},
  {"go": "/", "look": "the lanes signed out, or as a person who is not a forge admin", "expect": "now times only from cards they can read; no typical, no Slowest"},
  {"go": "/", "look": "in the terminal, open the palette and run Flow", "expect": "the screen ends with a Lane times block, one line a lane, the slowest marked; it opens at once", "ask": "Do the terminal's times match the page's?"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 188f282d009b --> Look pages for 188f282, from the gate:

  • look pages (named): this pull changes src/web/pages/home_flow.ts, src/web/pages/home_flow_style.ts; a commit names /
commented

Each Flow lane now shows how long its cards have been sitting in it. The times appear on the home Flow page (src/web/pages/home_flow.ts), on the terminal's Flow screen (src/tui/screens/lane_times.ts) and through the MCP flow tool. They are worked out in src/flow/lane_times.ts and only count cards the viewer is allowed to read. The Flow dialog stays synchronous and shows no lane times. llms.txt stays the same size.

This push merges main and fixes a flaky test that came in with it, test/fork-tree-chip.test.ts ("a parent that moved on leaves the fork N behind", from #15117). It set the fork to tell-me so it wouldn't follow its parent. But src/core/following.ts still fast-forwards a tell-me fork that has no work of its own, in the background, after each parent push. So the "2 behind" count depended on whether that job had finished, and the last check saw "1 behind". The test now uses dont-follow, the mode that doesn't move the fork. It passed six runs in a row here. The test was wrong, not the code.

Other reds in the last check:

  • OpenAPI coverage and drift tests: the check found them red on main at fe4d51f too, so they were not counted against this pull. Left alone.
  • Backups test in test/snapshot-repositories.test.ts: passes here (13 of 13) and shares no files with this pull. Left alone.

Ran before pushing: bun scripts/gate.ts --fix (nothing to commit), bun x tsc --noEmit and bun scripts/design-lint.ts, all clean; test/lane-times.test.ts and test/fork-tree-chip.test.ts, 16 pass, 0 fail.

[{"go":"/","look":"the Flow lanes on the home page","expect":"each lane shows how long its cards have been in it, with no layout shift as the page loads"},{"go":"/","look":"a lane holding a card the viewer cannot read","expect":"that card's time is not counted in the lane","ask":"Do the lane times read as plain, short words?"}]

🤖 Generated with Claude Code

commented

<!-- look-pages 1c49ce493b97 --> Look pages for 1c49ce4, from the gate:

  • look pages (named): this pull changes src/web/pages/home_flow.ts, src/web/pages/home_flow_style.ts; a commit names /
commented

On the home Flow page, each lane now says how long its cards wait, as "now" and "typical" (now 18m · typical 9m). The lane furthest above its typical wait is marked Slowest. The terminal's Flow screen shows the same times, and the MCP flow tool returns them.

  • Who sees what: "now" is the middle wait of the cards the viewer may read, so a private repository's cards never count for someone who can't read it. "Typical" is read across every repository.
  • Where it lives: the times are worked out in src/flow/lane_times.ts. The page change is in src/web/pages/home_flow.ts and src/web/pages/home_flow_style.ts, with the new style noted in docs/design/areas/home-flow.md. The terminal screen is src/tui/screens/lane_times.ts.
  • Left as it was: the Flow dialog stays synchronous and shows no lane times, and llms.txt stays the same size.

The latest look-pages note needed no code change, so nothing new was pushed. It names / as the page to look at because this pull changes home_flow.ts and home_flow_style.ts, and commit 381a01acc ("Looks: /") already names it. The desk's release hold doesn't touch this pull, which goes to its preview, not production.

The merge from main brought in a flaky test, test/fork-tree-chip.test.ts, which is now fixed. It set the fork to tell-me, but a fork with no work of its own still gets fast-forwarded in the background after each parent push (src/core/following.ts). So "2 behind" sometimes read "1 behind". The test now uses dont-follow. The test was wrong, not the code. It passed six runs in a row.

Of the other reds in the previous check, the two OpenAPI test files were red on main too, and the backups test passes locally (13 of 13) and shares no files with this pull.

Before the last push, bun scripts/gate.ts --fix had nothing to rewrap, and bun x tsc --noEmit and bun scripts/design-lint.ts were clean. test/lane-times.test.ts and test/fork-tree-chip.test.ts gave 16 pass, 0 fail.

[{"go":"/","look":"the Flow lanes on the home page","expect":"each lane reads `now … · typical …`, one lane is marked Slowest, and nothing shifts as the page loads"},{"go":"/","look":"a lane holding a card from a repository the viewer cannot read","expect":"that card does not count towards the lane's now time","ask":"Do the lane times read as plain, short words?"}]

🤖 Generated with Claude Code

Approved — before the latest push

Earlier asks are met. The private-repo leak is closed: now comes from the viewer's own cards, and typical and Slowest are shown only to a forge admin who is a person, on the page, the lane fragment, MCP flow {kind:"lanes"} and the terminal. The terminal door and docs/features/lane-times.md exist, README is untouched, and the design doc is updated. The tile clock is only an age, and the Slowest word is at --fg. Tests cover each gate. Non-blocking: the header comment in test/lane-times.test.ts still says the MCP now says the slowest lane; it no longer does. The ms helper in src/http/mcp/tools/flow.ts actually returns seconds; rename it. I could not diff against 381a01a (not in the clone), so I judged the whole change as given.

commented

On the home Flow page, each lane now says how long its cards wait, as "now" and "typical" (now 18m · typical 9m). The lane furthest above its typical wait is marked Slowest. The terminal's Flow screen shows the same times, and the MCP flow tool returns them.

  • Who sees what: "now" is the middle wait of the cards the viewer may read, so a private repository's cards never count for someone who can't read it. "Typical" is read across every repository.
  • Where it lives: the times are worked out in src/flow/lane_times.ts. The page change is in src/web/pages/home_flow.ts and src/web/pages/home_flow_style.ts, with the new style noted in docs/design/areas/home-flow.md. The terminal screen is src/tui/screens/lane_times.ts.
  • Left as it was: the Flow dialog stays synchronous and shows no lane times, and llms.txt stays the same size.

This push merges main again. The conflict was in src/tui/forge.ts, in the call that builds the terminal's Flow screen. main added a publicOrigin(...) argument there, and this pull adds .concat(laneTimeLines(...)) to its result. The merge keeps both.

An earlier merge from main brought in a flaky test, test/fork-tree-chip.test.ts, which is fixed here. It set the fork to tell-me, but a fork with no work of its own still gets fast-forwarded in the background after each parent push (src/core/following.ts). So "2 behind" sometimes read "1 behind". The test now uses dont-follow. The test was wrong, not the code.

After the merge:

  • bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix had nothing to rewrap.
  • 114 tests pass and none fail, across test/lane-times.test.ts, test/fork-tree-chip.test.ts and 15 terminal test files that reach src/tui/forge.ts.
  • test/flow-alarm-stuck-action.test.ts, new from main, passes 8 of 8.
[{"go":"/","look":"the Flow lanes on the home page","expect":"each lane reads `now … · typical …`, one lane is marked Slowest, and nothing shifts as the page loads"},{"go":"/","look":"a lane holding a card from a repository the viewer cannot read","expect":"that card does not count towards the lane's now time","ask":"Do the lane times read as plain, short words?"}]

🤖 Generated with Claude Code

commented

<!-- look-pages 6a740f8e6c32 --> Look pages for 6a740f8, from the gate:

  • look pages (named): this pull changes src/web/pages/home_flow.ts, src/web/pages/home_flow_style.ts; a commit names /
commented

Nothing in the code needs to change, so I made no commit and pushed nothing. trevato's comment is the gate's look pages (named) line, and src/kernel/look_rule.ts says that line is "one note, never a failure". It means commit 381a01acc already has Looks: /, so the forge will take pictures of / on the preview. The last check on this pull was green, but it is stale, so the forge needs to run it again on the current head. The desk also holds trevato/forge while production rolls out, which is one more reason not to push an empty commit. The description below is rewritten to match what the branch does now: the old one still described two lines per lane, a "Bottleneck" word and an extra row on MCP now, all of which later commits replaced.

---

Each home flow lane now says how long its cards wait, as one short line under its health such as now 18m · typical 9m. The lane furthest above its typical gets the word Slowest and data-bottleneck. A tile's clock is now its age in that lane.

What changed

  • Typical times: src/flow/lane_times.ts reads the last 24 hours of records into a new typicals field on the lane picture. It runs in the worker that builds the picture, never on a request. Each lane is timed from one event to another:
    • Building and checks: run created → finished.
    • Review: a pull's last green check → its first verdict.
    • Landing: last approval → merged.
    • Live: merged → first production deploy serving.
  • Now times: worked out at render time from the cards the viewer can see (viewFor), so a private repository's cards never count for someone who can't read it.
  • Slowest: the lane whose now median is furthest above its typical. No lane is named when none is above its typical, or when a typical comes from fewer than 3 cards.
  • Who sees typicals: they are read across every repository, so only a forge admin who is a person sees them and the Slowest mark. Anyone else sees typical —.
  • Page: the lane-times line is always one line tall and is empty when there is nothing to say, so nothing shifts and / stays inside its first-view budget. The style is in home_flow_style.ts, and docs/design/areas/home-flow.md describes .lane-times and .lane-bottleneck.
  • Terminal: the Flow screen ends with a "Lane times" block, one line per lane with now, oldest, typical and p90, and the slowest lane marked. It is for an admin person only (src/tui/screens/lane_times.ts). It reads the saved lane picture, so the command stays synchronous.
  • MCP: flow {kind: "lanes"} is for an admin person only and returns { slowest, lanes: [{ lane, cards, nowSeconds, oldestSeconds, typicalSeconds, p90Seconds }] }. now is unchanged. This is documented in docs/MCP.md and docs/features/lane-times.md.

What I chose not to do

  • Asked has no typical and is never Slowest, because how long an ask waits depends on when it was asked.
  • Typicals use at most the newest 500 rows per lane.
  • I added no index: the worker scans the last 24 hours of reviews every 30 seconds.

Tests: test/lane-times.test.ts seeds runs, reviews, a merged pull and a deploy, then checks:

  • each lane's typical and the now medians;
  • that the Slowest mark moves to whichever lane the test slows;
  • that typicals are hidden from anyone who is not an admin person;
  • the tile clock, the MCP lanes answer and the terminal block.

test/fork-tree-chip.test.ts was a flaky test, not a fault in the code: the parent's push could fast-forward the fork in the middle of its count. It now sets the fork not to follow its parent.

To try: sign in as a forge admin, open / and read the line under each lane's name. In the terminal, open Flow and scroll to Lane times.

[{"go":"/","look":"the line under each lane's health","expect":"'now …' and 'typical …', or nothing at all; no lane changes height between reading… and loaded"},{"go":"/","look":"lane heads","expect":"at most one lane shows the word Slowest, and only when its now is above its typical"},{"go":"/","look":"a tile's clock","expect":"its age in the lane it is in now","ask":"Does the clock read naturally next to the lane line?"}]

🤖 Generated with Claude Code

Closes #14882

Approved

Earlier asks are met: now is drawn from the viewer's own cards (no private leak), typical and Slowest are shown only to an admin person, the terminal Flow screen has a Lane times block, the how-to is in docs/features/lane-times.md (not README), and the tile clock and Slowest styling follow DESIGN.md (--fg, one line, no layout shift). The only change since my last head is the merge of main, whose conflict in src/tui/forge.ts keeps both the publicOrigin argument and the laneTimeLines concat. MCP flow {kind: lanes} is gated to admin persons and tested. Non-blocking: the callFlow test helper duplicates one in mcp-archive-card.test.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs