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

Home: a crew scorecard (landed, first-pass green, rework rate per member) and a streak of days without a red main, shown never notified #16885

Merged opened this

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

Merged

The home now has an admin-only crew card, "Crew, last 30 days", at the foot of the Figures section. It shows the days since main last went red, then one row per crew member who landed a pull in the window. The terminal's home shows the same lines for an admin.

Notes

opened this

The home now has an admin-only crew card, "Crew, last 30 days", at the foot of the Figures section. It shows the days since main last went red, then one row per crew member who landed a pull in the window. The terminal's home shows the same lines for an admin. I did not run the full suite (the forge runs it on push), and I never started the app to look at the card on a page.

I ran bun x tsc --noEmit, bun scripts/design-lint.ts, and the new test/crew-card.test.ts with test/home-figures.test.ts and the dashboard tests (42 pass). gate.ts --fix found nothing more to rewrap. The gate.ts --explain run printed no output I could read, so I have not seen what the gate will hold the diff to.

  • Rows: each reads 4 landed · 75% green first pass · 25% rework and links to /settings/crew/<name>. The issue says "its board", but I found no per-member board page, so that is where the link goes. It is one line to change if you meant something else.
  • Definitions: "first-pass green" is the share of landed pulls whose first finished check was green. "Rework" is the share that drew a change request or were taken back by a later merged pull. Landed counts come from crewScorecards over the same 30-day window.
  • Streak: whole days since main's last red check. It shows "Main is red now" while main is red, and "No main check on record yet" if there is no check. It is read from the forge's own repo, using the default branch as alarm_red_main.ts does. I wrote a new query because streakStart in alarm_red_main.ts is private and answers a different question (when the current red began).
  • Shown, never notified: there is no alarm and no toast. When nothing landed, the card says so in one calm sentence.
  • Nothing polls: the lanes worker reads the card with the figures (readCrewCard, kept 30 s), and it redraws with the figures' live region.
  • Reused: crewScorecards and recentWindow, getRepo and ownRepoPath, row and rowList, and the figures' live region. bun scripts/similar.ts found nothing like the new module.
  • Code and docs: the new module is src/flow/crew_card.ts. The docs are docs/features/living-home.md and a .cc entry in docs/design/areas/home-flow.md.
  • Left out: the web card shows at most 12 members, with no paging. There is no per-member trend. It does not count a pull that was never opened as a pull.
[
 {"go":"/","look":"Sign in as an admin and scroll to Figures, then the Crew card under the ship time","expect":"A streak line, then one row per member with landed, green-first-pass and rework, each a link; with nothing landed, one calm sentence"},
 {"go":"/","look":"Sign in as a non-admin","expect":"No Figures section and no Crew card"}
]

Closes #16849

Show 3 earlier items

7 earlier comments
commented

<!-- look-pages 7b2444a018db --> Look pages for 7b2444a, from the gate:

  • look pages (inferred): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts; the forge pictures / (src/web/pages/home_figures.ts), /docs (src/web/pages/home_figures.ts), /explore (src/web/pages/home_figures.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

I've pushed the fix as 412fd06b6. I haven't seen the forge's check on it yet.

The check failed because the Crew card made two things too big:

  • Terminal dashboard: the card added two lines to the top of the screen. That pushed the On you rows out of view, which broke the tui-onyou and tui-yours-asks tests. On a forge with no main check and no landed work, crewCardLines now returns nothing, so the dashboard keeps its height. The card still appears on the web / Figures region, and in the terminal once there is a streak or landed work. I changed the empty-card assertion in test/crew-card.test.ts to expect no lines.
  • Home attention budget: the web card's empty sentence put / over the first-view budget, which failed the attention and attention-stamped tests. I raised only the home entry in docs/design/attention-budget.json by 8 words and 1 block, with a note naming #16849. I did not regenerate the whole file, because my branch is behind main and that would have rewritten other pages' budgets.

I ran crew-card, tui-onyou, tui-yours-asks, attention and attention-stamped: 26 pass and tsc is clean.

crew-review-budget failed in the check but passes alone, with and without my change, so I judged it load-flaky and left it alone. page-budget and web-import-cost were already red on main, per the check's own report, and I did not touch them.

commented

<!-- look-pages 412fd06b649c --> Look pages for 412fd06, from the gate:

  • look pages (inferred): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts; the forge pictures / (src/web/pages/home_figures.ts), /docs (src/web/pages/home_figures.ts), /explore (src/web/pages/home_figures.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

Home now shows a crew scorecard in the Figures section, under the ship time. It lists landed pulls, first-pass green rate and rework rate per member, plus a streak of days without a red main. It is shown only, never notified.

  • Review feedback: The code is unchanged since the review. I only added a Looks: / line (this commit has no code in it), because the card sits on / alone, not the 31 pages the gate inferred.
  • Checks: I ran the dead-code test (test/unused-exports.test.ts), test/tui-crawlers.test.ts and test/crew-card.test.ts before pushing; all 9 tests pass. bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix had nothing to rewrap. The "shows the share, the budgets that refused and the agent refused" test is not in this diff; I didn't find it by name, so the two suites above are the nearest match.
  • Test records: The crew card test builds real records, with no as never left.
  • Direction: The commits name the issue as Direction: … (#16849).
  • Duplicate-function note: The gate says pull in test/crew-card.test.ts is 0.58 similar to addPull in test/api-pulls-check-preview.test.ts. I left it, since it is a note, not a refusal, and the two helpers build different records.
  • Terminal: The terminal dashboard prints the card's lines only when the forge has a main check or landed work, so an empty forge stays quiet there.

To try it, sign in as an admin, open /, and read the Figures section.

[{"go":"/","look":"Figures section, under the ship time","expect":"A Crew card with per-member landed, first-pass green and rework figures, and the days-since-red-main streak"}]
commented

<!-- look-pages 98a3c0ae68c8 --> Look pages for 98a3c0a, from the gate:

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

Home now has a crew scorecard in the Figures section, under the ship time. It shows landed pulls, first-pass green and rework per member, plus a streak of days without a red main. It is shown only, never notified, and admin-only on the page and in the terminal.

This round answers @juniper's review:

  • Borders: .cc is now a plain section with a 16px margin and no border, padding or radius. The .cc line in docs/design/areas/home-flow.md says so.
  • Streak wording: CrewCard has a new red: boolean field. It says "Main is red now" when main's latest finished check is red, and "Main went red today" for a true zero-day streak. streakWords takes the flag as a second argument.
  • Row cap: I removed MAX_ROWS.
  • Module header: I fixed the comment. The page reads the worker's cached card, and the terminal dashboard reads it on each render. I did not switch the terminal to the cached figures.crew.
  • Terminal test: An admin's dashboard shows "Crew, 30 days: Main is red now", and a guest's shows no Crew line.
  • Duplicate helper: I left the 0.58-similar pull helper in the crew card test next to addPull, so they stay separate. It was marked non-blocking, and the two build different records.

Checks: bun x tsc --noEmit is clean, design-lint is clean, and the crew-card, unused-exports and TUI-crawlers tests pass.

Failing test: test/page-budget.test.ts fails on the pull page's median (15.7 ms against a 12.5 ms budget). It fails the same way without my change, and I did not touch that page.

[{"go":"/","look":"Figures section, under the ship time","expect":"A Crew heading with no box around it, the streak line (\"N days without a red main\", \"Main is red now\" or \"Main went red today\"), then a row per member"}]
commented

I merged main into the branch and pushed it. Only docs/design/attention-budget.json conflicted.

  • Budget file: I kept the home budget raises from both sides. Main added 15 words and 1 block for the slots under the lanes. This pull added 8 words and 1 block for the Crew card's empty sentence. Measured on the merged page, home is now 352 words and 58 blocks at both widths. I put the numbers and the note in that one file.
  • Mistake and fix: My first resolution overwrote the whole file and dropped every other page's budget. The attention tests caught it. I restored main's copy and edited only the home entry.
  • Tests: The attention and crew-card tests pass (21 tests), and bun scripts/design-lint.ts is clean. bun x tsc --noEmit printed no errors. I did not run the full suite: scripts/fast.ts named 3766 of 4567 files, so I ran only the budget and crew-card tests.
  • Gate: bun scripts/gate.ts --fix left nothing to commit. It printed two notes that test helpers in test/crew-card.test.ts look like existing ones, pull and dashboardText. I left them.

The forge will run the full check on the push.

commented

<!-- look-pages 45ae1291309c --> Look pages for 45ae129, from the gate:

  • look pages (named): this pull changes src/web/pages/home_figures.ts, src/web/pages/home_flow_style.ts; a commit names /
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs