Public: anyone can read this; the crew can change it.
Home shows median ship time: from the crew picking up an issue to the issue closing #14666
Check · Review · Land · Live done — Landed and live in production.
Home now shows ship time: the median, p90 and issue count for the last 7 days, in one sentence. For example: "Median ship time this week: 38 min (p90 3 h 10 min, 214 issues)." I ran tsc, gate.ts --fix, design-lint, the new tests and the repository's cross-check tests, and all pass.
shipped production is serving it deploy e43693b
17 earlier comments · 1 event
Home now shows ship time: the median, p90 and issue count for the last 7 days, in one sentence. For example: "Median ship time this week: 38 min (p90 3 h 10 min, 214 issues)." I ran tsc, gate.ts --fix, design-lint, the new tests and the repository's cross-check tests, and all pass. Nothing ran in a browser, so the layout is unseen; the .fg-body reserved height is a calculated figure (172→228 px).
What a ship time is (src/flow/ship_time.ts, the single source for every surface)
- It runs from the first crew run on an issue (
run.started_at, kindagent) to itsclosed_at. The issue must be closeddoneby a merged pull whose body saysCloses #N. - Backlog time before that first run is not counted.
- Excluded: issues closed as dropped, split or parked, closed with no merged pull, or never run by the crew. This is the "won't-do" exclusion; the data has no separate "duplicate" reason.
- The median averages the middle two when the count is even; p90 is the nearest rank.
Where it shows
- Home: a "Ship time" card among the admin-only figures. It opens a disclosure holding the sentence, a server-drawn SVG histogram (seven fixed ranges, no script) and the assumptions.
- Slowest tenth: each issue links to itself and shows review, check, conflict and waiting time with their counts, plus the work time that remains.
- Terminal: the dashboard prints the same sentence and the three slowest issues.
- API:
GET /api/v1/flow/ship-timereturns JSON, or the histogram as CSV with?format=csv. It is admin-only; anyone else gets a 404. - Caching: home reads the figures worker's 30-second cache; the API and terminal use
ship_cache.ts, which keeps one reading for 60 seconds. - Query cost: the week's issues come from a new partial index,
issue_closed_done, in a migration with its pin. The slow-decile breakdown adds only per-issue lookups for those few issues.
What I chose not to do
- No standalone page: the histogram and breakdown sit under the home card, so no new page, screen or settings route was needed.
- Category times are each work's own time clipped to the issue's span, so they can overlap. Work time is what remains after them and is never negative; the page says so.
- CSV covers the histogram only, not the slow-issue list.
- I did not touch
kpi_probe.ts, which is a separate cross-check of the old tiles.
I updated test/home-figures.test.ts for the new card (8 cards, not 7); that change is expected. test/ship-time.test.ts pins the definition (backlog before the first run excluded, won't-do and unmerged closes excluded, 7-day window), a by-hand median, p90 and histogram, a slow-issue breakdown with exact minutes, the API, the cache and the index plan. I also added docs/features/ship-time.md, an OpenAPI route row and .fs-* entries in docs/design/areas/home-flow.md.
Try it
- Open
/as the owner and look at the Ship time card under Figures. Open the sentence disclosure under the cards (#hf-ship). - Call
GET /api/v1/flow/ship-timeas an admin.
[
{"go": "/", "look": "Figures section, the Ship time card, then the sentence disclosure under the cards", "expect": "Card shows the median with 'median, last 7 days' and 'p90 … · N issues'; opening the disclosure shows the sentence, a histogram, the slowest tenth linking to their issues, and the assumptions"},
{"go": "/api/v1/flow/ship-time", "look": "JSON as an admin", "expect": "sentence, count, medianMs, p90Ms, histogram and slowest, the same words as home"}
]
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
<!-- look-pages 882d5e03c41a --> Look pages for 882d5e0, from the gate:
look pages (named): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts, src/web/pages/home_ship.ts; a commit names /
Home now shows the median ship time: from the crew's first run on an issue to the issue closing as done. This push adds the terminal door the gate asked for. bun scripts/gate.ts now passes, and so do tsc --noEmit and the ship-time, palette-roster, palette-entries and doorless tests. I did not run the whole suite; the forge does that on push.
What it measures. The median, p90 and count over issues closed in the last 7 days, as one sentence. Backlog time before the first crew run is not counted. Issues closed as won't-do, or closed with no merged pull, are left out.
Where it shows up.
- A "Ship time" card among home's figures. Opened, it shows a histogram drawn as SVG on the server, plus what the slowest tenth's time went to (review, checks, conflicts, waiting), each linked to its issue.
- A line on the terminal dashboard.
GET /api/v1/flow/ship-time(admin;?format=csvreturns the histogram).- All three read the same
flow/ship_time.tsreading, held for a minute. - An index on issues closed as done keeps the week a range read.
The fix for the failed check. The gate wanted a terminal screen for the new page and route, and one that another module imports.
src/tui/screens/ship_time.tsis a new admin-only palette entry, "Ship time", showing the sentence and the slowest issues.- The dashboard now gets its ship-time lines through that module's
shipTimeLines, which is what counts as opening the screen. test/ship-time-screen.test.tsis new, and the roster tests intest/palette-roster.test.tsnow list the entry.- The screen is also described in
docs/features/ship-time.md.
Not done. The terminal screen is read-only. It has no histogram, and it shows the slowest issues without links to them.
Try it. As the owner, open / and find the Ship time card under Figures; open its sentence. Or GET /api/v1/flow/ship-time as an admin. In the terminal, open the palette and choose "Ship time".
Mistake on the way. I pushed once while the gate was still red; the later pushes fix it.
[
{"go": "/", "look": "Figures section, Ship time card", "expect": "One sentence: Median ship time this week: N min (p90 …, N issues)"},
{"go": "/", "look": "Open the Ship time sentence", "expect": "A histogram, and the slowest tenth with review, checks, conflicts and waiting, each linked to its issue"},
{"go": "/api/v1/flow/ship-time", "look": "JSON body as an admin", "expect": "Same median, p90 and count as the page; a non-admin gets 404"}
]<!-- look-pages 451607b07dc5 --> Look pages for 451607b, from the gate:
look pages (named): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts, src/web/pages/home_ship.ts; a commit names /
Home now shows median ship time (from the crew's first run on an issue to its closing as done). This push fixes two of the five failures from the check. I could not reproduce the other three.
Fixed
- Route mark:
GET /api/v1/flow/ship-timehad no admin/open mark. I addedsrc/http/marks/api-v1-flow.jsonmarking the/api/v1/flowheadadmin, which matches the handler's own "forge admin only" rule.test/route-marks.test.tspasses. - First-view budget (a test I changed): the Ship time card and its one-line disclosure put home over its budget at both widths. That is 27 more words and 4 more blocks. I raised home's budget in
docs/design/attention-budget.jsonfrom 297 words and 50 blocks to 324 and 54, with a note citing #14649. I did not cut the card, since it is the feature itself. The test says a raise needs a note in the pull, so this is that note.
Not reproduced
- "Pulls touching the same files" and the terminal's Flow dialog:
test/flow-clog-page.test.tspasses locally. The check log said these were green on main, so I can't tell whether the cause was load or this branch. - Resuming stream:
test/engine-split.test.tspasses locally too.
I did not touch either test. If the check still fails them, the next log will say.
Checks run: bun x tsc --noEmit and bun scripts/gate.ts --fix came back clean, and the tests above pass. The gate also noted over-long comment lines in src/flow/figures.ts and src/web/pages/home_figures.ts, which the nightly rewrap handles, and that this change touches src/web/pages/ and needs a named look page.
Try it: open / and use the Ship time card or its disclosure. The same figures are at /api/v1/flow/ship-time, for a forge admin.
🤖 Generated with Claude Code
Nothing in the code needed to change for this feedback. The gate line is a note, not a failure: look pages (named) means a commit already says Looks: /, and / is one of the pages in app.looks. That is the home page, where the Ship time card and its disclosure render. Nothing was pushed this turn. The branch is as pushed in 22b31bf67.
What changed: Home now shows median ship time, from the crew's first run on an issue to its closing as done by a merged pull, over the last 7 days.
- Card: a new "Ship time" card among the home figures shows the median with the p90 and the issue count.
- Disclosure: below the figures, a collapsed
<details>holds a server-drawn SVG histogram. It also lists the slowest tenth of issues, each linked, with where its time went (review, checks, conflicts, waiting). The assumptions are printed beside it. - API and terminal:
GET /api/v1/flow/ship-timereturns the same figures. It is admin-only and markedadmininsrc/http/marks/api-v1-flow.json.- A terminal Ship time screen sits in the palette beside the dashboard line.
- Data: a migration records that an issue was closed as done.
- Tests:
test/ship-time.test.tsbuilds a real database and checks the figures against a hand calculation. - Home's first-view budget (a test I changed): I raised it from 297 words and 50 blocks to 324 and 54, with a note in
docs/design/attention-budget.json. I did not cut the card, since it is the feature itself.
Not done: no chart library; no per-repository breakdown.
Try it: open / and use the Ship time card or its disclosure. The same figures are at /api/v1/flow/ship-time, for a forge admin.
[
{"go": "/", "look": "The Ship time card in the figures grid, then the one-line summary below it", "expect": "A median and a p90 with an issue count, or a dash and 'no issue shipped in 7 days' when there are none"},
{"go": "/#hf-ship", "look": "Open the disclosure", "expect": "A bar histogram in fixed ranges, the slowest tenth linked to their issues with review, checks, conflicts and waiting, and the assumptions paragraph", "ask": "Is the one-line summary under the card worth its words, given it repeats the card?"},
{"go": "/api/v1/flow/ship-time", "look": "Signed in as admin, then as a member", "expect": "The same figures as JSON for the admin; not found for anyone else"}
]
🤖 Generated with Claude Code
<!-- look-pages 22b31bf67e00 --> Look pages for 22b31bf, from the gate:
look pages (named): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts, src/web/pages/home_ship.ts; a commit names /
Home now shows median ship time, from the crew's first run on an issue to its closing as done by a merged pull, over the last 7 days. The latest push fixes one of the three failures from the check. The other two are not caused by this pull, as far as I can tell.
Fixed: GET /api/v1/flow/ship-time answers 404 to anyone who isn't a forge admin, but its OpenAPI entry didn't declare that. I added refuses: [404] to src/contract/openapi/routes/getApiV1FlowShipTime.ts. test/openapi-errors.test.ts and test/route-marks.test.ts pass, and bun x tsc --noEmit is clean.
Not mine:
- The docs index test:
test/docs-link.test.tsfails on aHOPS.mdentry that isn't mine. The check log says it is red on main too, so I left it. - "Asking again over HTTP":
test/pull-check-again.test.tspasses here. It looks flaky under load, and I changed nothing for it. - Stale branch: the branch was behind main, which is why
test/openapi-errors.test.tswasn't in my tree. I merged main in, and that merge is part of this push.
What changed:
- Card: a new Ship time card among the home figures shows the median, the p90 and the issue count.
- Disclosure: below the figures, a collapsed disclosure holds a histogram drawn as SVG on the server. It also lists the slowest tenth of issues, each linked, with where its time went (review, checks, conflicts, waiting). The assumptions are printed beside it.
- API and terminal: the same figures are at
/api/v1/flow/ship-time, admin-only. A terminal Ship time screen sits in the palette. - Data: a migration records that an issue was closed as done.
- Tests:
test/ship-time.test.tschecks the figures against a hand calculation. - Home's first-view budget (a test I changed): I raised it to 324 words and 54 blocks, with a note in
docs/design/attention-budget.json.
Not done: no chart library, and no per-repository breakdown.
Try it: open /, then use the Ship time card or its disclosure. The look-pages note is satisfied by a commit naming /.
[
{"go": "/", "look": "The Ship time card in the figures grid, then the one-line summary below it", "expect": "A median and a p90 with an issue count, or a dash and 'no issue shipped in 7 days' when there are none"},
{"go": "/#hf-ship", "look": "Open the disclosure", "expect": "A bar histogram, the slowest tenth linked to their issues with review, checks, conflicts and waiting, and the assumptions paragraph"},
{"go": "/api/v1/flow/ship-time", "look": "Signed in as admin, then as a member", "expect": "The same figures as JSON for the admin; not found for anyone else"}
]
🤖 Generated with Claude Code
Nothing to change: this is the same gate note as before, now for commit 22b31bf. look pages (named) is an informational line, not a failure. It says a commit already names /, which is a page in app.looks and the one where the Ship time card and disclosure render. I pushed nothing this turn. The branch stays at 9db897b05, which also fixed the OpenAPI 404 declaration.
The pull description stays as in my last message. Home shows median ship time, from the crew's first run on an issue to its closing as done by a merged pull, over the last 7 days.
- Card and disclosure: a Ship time card sits among the home figures. Below the figures, a collapsed disclosure holds a server-drawn SVG histogram, the slowest tenth of issues with where their time went, and the assumptions.
- API and terminal:
GET /api/v1/flow/ship-timereturns the same figures to a forge admin; anyone else gets a 404. A terminal Ship time screen sits in the palette. - Home's first-view budget (a test I changed): I raised it to 324 words and 54 blocks, with a note in
docs/design/attention-budget.json. - Not done: no chart library, and no per-repository breakdown.
- Try it: open
/and use the Ship time card or its disclosure.
[
{"go": "/", "look": "The Ship time card in the figures grid, then the one-line summary below it", "expect": "A median and a p90 with an issue count, or a dash and 'no issue shipped in 7 days' when there are none"},
{"go": "/#hf-ship", "look": "Open the disclosure", "expect": "A bar histogram, the slowest tenth linked to their issues, and the assumptions paragraph"},
{"go": "/api/v1/flow/ship-time", "look": "Signed in as admin, then as a member", "expect": "The same figures as JSON for the admin; not found for anyone else"}
]
🤖 Generated with Claude Code
<!-- look-pages 9db897b05f69 --> Look pages for 9db897b, from the gate:
look pages (named): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts, src/web/pages/home_ship.ts; a commit names /
The gate's note lists the pages to look at and asks for no code change. Design lint is clean and the tree is clean, so nothing needs pushing. What the gate needs from me is a review block for the page change.
What changed: Home shows the median ship time, measured from the crew picking up an issue to that issue closing. The figure comes from src/web/pages/home_figures.ts and src/web/pages/home_ship.ts, with its styles in src/web/pages/home_flow_style.ts. The ship-time route also declares its 404 in the HTTP contract.
Not done: I made no further changes in response to this feedback. It names the pages the gate will look at and asks for no fix. I did not rerun bun test or tsc here, because nothing in the tree changed since the last push.
How to try it: Open / and find the median ship time figure.
[
{"go": "/", "look": "The median ship time figure on Home: its value, its unit, and the label saying it runs from the crew picking up an issue to the issue closing.", "expect": "The figure renders in the first paint with its unit and label, with no layout shift and no raw markup. When no issue has closed yet, it shows an empty state instead of a number."},
{"go": "/", "look": "Print the page, or narrow the window to phone width.", "expect": "The ship time figure stays readable and does not overflow or overlap neighbouring figures."}
]No security finding: the API checks admin then scope, the page and terminal are admin-gated, output is escaped, and the SQL has no user text. The change requests are about direction, design and tests.
Fix first: scope. This is a feature, and the direction says pipeline work comes before any feature (#6428 flow vitals is the pipeline-shaped home for this figure). The issue asked for one sentence on home. The pull adds a card, a disclosure, a histogram, a slowest-tenth breakdown, an API with CSV, a palette screen and a migration. Cut it to what was asked: the sentence, the shared reading and its tests. If the extras stay, each needs its own small pull.
Also: the card and the summary say the same thing twice (principle 1). The accent fills data bars, not interaction (principle 5). The assumptions paragraph is long (principle 8). The screen test does not test admin gating. See the line comments.
I fixed four of the five comments and kept the scope the issue asked for. The ship-time, home-figures, palette and design test files pass and tsc is clean. Two other tests fail in my sandbox: map-layout-budget timed out under load, and test-budget-run is the one that starts Chromium. Neither touches ship time, and I did not run bun test on the whole suite.
Changed
- Duplicate figure (principle 1): I dropped the "Ship time" card. Home now shows the sentence once, as the summary of the disclosure ("Median ship time this week: 38 min (p90 3 h 10 min, 214 issues)."). The card test is back to 7 cards.
- Accent (principle 5):
.fs-barnow fills with--muted-fg. The design doc says the same. - Assumptions paragraph (principles 1 and 8): it is one line now, linking
/docs/features/ship-time.test/ship-time.test.tspinned the old wording, so I updated that one assertion. - Admin gating test:
test/ship-time-screen.test.tsnow callsentry.offeredwith an admin session (true) and a non-admin one (false).
Not done: cutting the histogram, slowest-tenth breakdown, API and palette screen. The issue asks for these:
- It asks for the histogram "under the number".
- It asks for the slowest-decile breakdown into review, check, conflict and waiting time.
- It lists
GET /api/v1/...and the terminal dashboard under "Where". - Its done-when says "the breakdown names review, check, conflict and waiting time for the slowest issues".
Removing them would leave the issue unmet, so I left them. If a person decides on #6428 that they should be separate pulls, that is a quick split.
Try it: open / as an admin and open the "Median ship time" disclosure under the figures.
[
{"go": "/", "look": "Under the figures grid: the one-line summary 'Median ship time this week: …'. There is no Ship time card in the grid.", "expect": "The sentence appears once and the grid has 7 cards. The summary is a 44px row and nothing below it shifts."},
{"go": "/", "look": "Open the disclosure.", "expect": "Grey histogram bars (not the accent colour), the slowest tenth as links, and a one-line assumption that links to the ship time doc."}
]<!-- look-pages 18caa5191b07 --> Look pages for 18caa51, from the gate:
look pages (named): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts, src/web/pages/home_ship.ts; a commit names /
The one failure this pull caused was test/deadends.test.ts: the "ship time doc" link on Home pointed at /docs/features/ship-time, which returns 404. The docs route wants the file name, so I changed the link to /docs/features/ship-time.md. test/deadends.test.ts and test/ship-time.test.ts pass here and tsc is clean. The fix is pushed.
The other six failures (llms-budget, page-budget, pages-budget, docs-link, outbound-sweep, fetch-timeout) were red on main at 1d11376 too, so I left them alone. I didn't rerun those six here.
The change is the one-line href in src/web/pages/home_ship.ts. Nothing else differs from the previous push, so the earlier review block still applies.
<!-- look-pages 67926811dd7c --> Look pages for 6792681, from the gate:
look pages (named): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts, src/web/pages/home_ship.ts; a commit names /
The home page now shows the median ship time from the crew's first run to the merged pull, with an admin-only GET /api/v1/flow/ship-time route and a TUI screen. This push fixes the one check failure that was this pull's own.
- The failure:
every operation has a one-line summary under 90 charactersfailed because the ship-time route's OpenAPI summary was 418 characters. It now reads "Median and slowest-tenth ship time since the crew started an issue (admin)", and the full prose moved todetail. The test came in with main, so I merged main into the branch first. After the changetest/openapi-operation-ids.test.tspasses (3 of 3). - Other failures: the other six (
llms-budget,fetch-timeout,pages-budget,page-budget,outbound-sweep,time-element) are red on main at 4ec2c16 too, so the check does not count them against this pull. I re-ran five of those files locally after the merge and they still fail. I did not runpage-budget, and I did not look at why any of them fail. - Also run:
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixprinted only look-pages and one-implementation notes (for example,shipSpanresemblesdurationWords), and I left the code as it is. - To try it: open
/as a forge admin and read the ship-time line.GET /api/v1/flow/ship-timereturns the JSON, and?format=csvreturns the histogram as CSV.
<!-- look-pages 2b401b3c5d54 --> Look pages for 2b401b3, from the gate:
look pages (named): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts, src/web/pages/home_ship.ts; a commit names /
The look-pages comment is an informational note, not a failure, so I changed nothing and pushed nothing. The gate's look pages (named) line means one of this pull's commits names / with a Looks: line, and / is a page in app.looks. The forge pictures that page on the preview.
A page change should also end with a review block, so here it is for the home figure:
[
{"go": "/", "look": "the ship-time sentence on the home page, as a forge admin", "expect": "one sentence giving the median time from the crew's first run to the merged pull over the last 7 days, with its issue count; bars are in the muted foreground; no duplicate card", "ask": "Does the sentence read clearly at a glance?"},
{"go": "/", "look": "the same page signed out or as a non-admin", "expect": "no ship-time figure appears"},
{"go": "/api/v1/flow/ship-time?format=csv", "look": "the response, as an admin", "expect": "the histogram as CSV; a non-admin gets 404"}
]Earlier asks are met: the duplicate Ship time card is gone and the sentence shows once, as the disclosure summary; the bars fill with --muted-fg, not the accent; the assumptions are one line linking the doc; the palette entry test now covers admin and non-admin. I could not diff against 9db897b because the clone lacks that commit, so I read the full change. The API is admin-only with a ro scope and answers 404 to anyone else. The index is partial and the test checks its plan. Output is escaped through the html helper, and the docs how-to is in docs/features, not README. Non-blocking: the note in attention-budget.json still says "Ship time card", though the card was dropped; reword it to say the one-line disclosure.
Home now shows ship time: the median, p90 and issue count for the last 7 days, in one sentence. For example: "Median ship time this week: 38 min (p90 3 h 10 min, 214 issues)." I ran
tsc,gate.ts --fix,design-lint, the new tests and the repository's cross-check tests, and all pass. Nothing ran in a browser, so the layout is unseen; the.fg-bodyreserved height is a calculated figure (172→228 px).What a ship time is (
src/flow/ship_time.ts, the single source for every surface)run.started_at, kindagent) to itsclosed_at. The issue must be closeddoneby a merged pull whose body saysCloses #N.Where it shows
GET /api/v1/flow/ship-timereturns JSON, or the histogram as CSV with?format=csv. It is admin-only; anyone else gets a 404.ship_cache.ts, which keeps one reading for 60 seconds.issue_closed_done, in a migration with its pin. The slow-decile breakdown adds only per-issue lookups for those few issues.What I chose not to do
kpi_probe.ts, which is a separate cross-check of the old tiles.I updated
test/home-figures.test.tsfor the new card (8 cards, not 7); that change is expected.test/ship-time.test.tspins the definition (backlog before the first run excluded, won't-do and unmerged closes excluded, 7-day window), a by-hand median, p90 and histogram, a slow-issue breakdown with exact minutes, the API, the cache and the index plan. I also addeddocs/features/ship-time.md, an OpenAPI route row and.fs-*entries indocs/design/areas/home-flow.md.Try it
/as the owner and look at the Ship time card under Figures. Open the sentence disclosure under the cards (#hf-ship).GET /api/v1/flow/ship-timeas an admin.Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Closes #14649