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

An app's studio page names its Server-Timing phases: session, each read, render #3642

Merged opened this

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

Merged

An app's studio page (`studioApp`) now reports its `Server-Timing` phases instead of one opaque number. The new test and the 199 tests under `test/studio` pass. I couldn't run `tsc --noEmit` here: bun couldn't write to its temp directory, so `bun install` and the type check both failed. The forge's check will be the first type check of this change.

shipped production is serving it deploy fc82d1a

opened this

An app's studio page (studioApp) now reports its Server-Timing phases instead of one opaque number. The new test and the 199 tests under test/studio pass. I couldn't run tsc --noEmit here: bun couldn't write to its temp directory, so bun install and the type check both failed. The forge's check will be the first type check of this change.

What changed

  • src/web/studio/app.ts calls notePhase and timePhase from src/core/route_timing.ts, the way releases.ts and explore.ts do.
  • The phases are session (from takeSessionTime), then one per read, then render.

- Reads: opened, crew, pulls, shipped, spend, decisions, latency, history, autonomy, panels, now, following and policy. - spend, decisions, latency and autonomy only appear for a viewer who can see the owner's facts, because the page skips those reads for everyone else.

  • The page renders exactly as before. The only reordering is that policyLine is now awaited just before the body is built, so it can be timed on its own.
  • test/studio-app-timing.test.ts signs in, GETs /alice/vault/app, and checks that every phase above is in Server-Timing as name;dur=N.N. It fails without the change.

Left out

  • No caching.
  • I added no phase for autonomy to the test, since the repo in the test has autonomy off.

To try it, GET any app's studio page and read the Server-Timing header.

🤖 Generated with Claude Code

Closes #3631

commented

An app's studio page (studioApp) now reports its Server-Timing phases instead of one opaque number. The new test and the 199 tests under test/studio pass. I couldn't run tsc --noEmit here: bun couldn't write to its temp directory, so bun install and the type check both failed. The forge's check will be the first type check of this change.

What changed

  • src/web/studio/app.ts calls notePhase and timePhase from src/core/route_timing.ts, the way releases.ts and explore.ts do.
  • The phases are session (from takeSessionTime), then one per read, then render.

- Reads: opened, crew, pulls, shipped, spend, decisions, latency, history, autonomy, panels, now, following and policy. - spend, decisions, latency and autonomy only appear for a viewer who can see the owner's facts, because the page skips those reads for everyone else.

  • The page renders exactly as before. The only reordering is that policyLine is now awaited just before the body is built, so it can be timed on its own.
  • test/studio-app-timing.test.ts signs in, GETs /alice/vault/app, and checks that every phase above is in Server-Timing as name;dur=N.N. It fails without the change.

Left out

  • No caching.
  • I added no phase for autonomy to the test, since the repo in the test has autonomy off.

To try it, GET any app's studio page and read the Server-Timing header.

🤖 Generated with Claude Code

Approved

Follows the Server-Timing pattern of the sibling pages (notePhase/takeSessionTime, timePhase/timePhaseAsync). Page output is unchanged, owner-only reads are timed only when run, and the test fails without the change. No markup or design-system surface touched. Next: (1) add a test for the guest view, where spend/decisions/latency/autonomy must be absent; (2) cover the autonomy phase with an autonomy-on repo.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs