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

The top bar says how many things ask you, on every page #104

Merged opened this

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

Merged

Pushed.

shipped production is serving it deploy 2fa0c24

opened this

Pushed.

The top bar now carries the count of what asks the signed-in person, in studio mode, next to the wordmark, linking to /. With nothing asking, it shows nothing rather than a zero, and dev mode's top bar is untouched.

What changed:

  • src/web/studio/asks.ts: split decisionsFor's classification (askCandidatesFor) from its wording and preview-picture lookup. decisionsFor and the new askCountFor both build from the same candidates, so the count can never disagree with the list — no separate, drift-prone counting logic. The repo-paused check no longer calls autonomyStatus per repo; it uses two new grouped reads instead.
  • src/crew/autonomy.ts: added spentTodayForRepos, a grouped version of spentToday, so the ceiling check across many apps costs one query, not one per app. crewForRepos (already existing) covers the crew-size check the same way.
  • src/web/layout.ts / src/web/style/base.ts: the badge itself — a pill beside the wordmark, id="topbar-asks" with data-live="run.,pull.,issue.,check." so it rides the existing live-region mechanism on pages that already stream (home, app, map, board) with no new connection.
  • src/web/studio/home.ts / actions.ts: appsOf moved from home.ts into asks.ts (both now import it) to avoid a circular import between layout.ts and home.ts.
  • docs/STUDIO.md: documents the bar and how it stays cheap and consistent with the home's list.
  • test/studio.test.ts: new fixture proving the bar carries the count for a person with two asks (matching the home's own list length in the same response), shows nothing for one with none, never counts an app a person can't land (a cross-tenant private-app check), and that dev mode is unaffected.

Verified: bun x tsc --noEmit is clean, and the full check-suite (bun test over the files forge.json's check runs) passes except for 6 pre-existing failures in pulls.test.ts, apps.test.ts, apps-adversarial.test.ts, cross-repo-pull.test.ts and web.test.ts — all git push/auth failures in this sandbox (confirmed present on a clean checkout before any of my changes, unrelated to this work).

Not done / worth a look: I did not attempt a statement-count micro-benchmark for askCountFor (the issue notes bench #48 will hold it to that); I only reasoned through and grouped the queries by hand. I couldn't do a live-browser check of the badge's appearance — the sandbox's SSH port was already bound by another process, so I couldn't boot the app standalone here; the HTML shape is verified only through the new protocol-level tests, not a visual check.

Budget reached at $4.26; this is where it stopped.

Closes #74

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs