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

Talk's live workspace shows its own speed: edit-to-preview and Test what I touched, each with its p95 against its target #17378

opened this

Merged 29h 54m ago, live in production

The workspace bar on /talk now shows how long the live loop takes, as p95 over the last 50 samples next to its target. For example: "reload 0.4 s · tests 48 s · targets 1 s and 2 min".

Notes

opened this

The workspace bar on /talk now shows how long the live loop takes, as p95 over the last 50 samples next to its target. For example: "reload 0.4 s · tests 48 s · targets 1 s and 2 min". The new test/loop-samples.test.ts, the touched/working-tree/dev-cell suites, test/mcp-size.test.ts, bun x tsc --noEmit and the gate all pass. I didn't run the app in a browser, so the review block below hasn't been tried on a preview.

What changed

  • Samples: src/core/loop_samples.ts keeps the newest 50 of each kind in memory and mirrors them to <data>/dev/loop-samples.json after the request, so a save doesn't wait on it. There is no migration.
  • Reload: a live save (Code tab or write_file with live) with a live dev cell now also writes the file into that cell's checkout, which didn't happen before. The sample runs from the save to the frame's next document request in src/web/pages/talk_dev.ts. A script request isn't counted, and a save the frame doesn't follow within a minute is dropped.
  • Tests: each Test what I touched run that ran tests records its wall time and whether it passed, passed or failed.
  • Warning tone: a figure over its target gets an amber (attn) badge naming it, not red. The bar line only appears once a sample exists.
  • Same numbers elsewhere: the terminal's p view prints a Loop: line. The pane MCP tool returns loop with reload and tests (p95Ms, samples, targetMs, over) plus words. I used an existing tool rather than adding a new one.
  • Reused: p95 from src/rules/budget_rerun.ts, and noLinkUnder, which I moved out of touched_run.ts into src/actions/link_free.ts.

What I left out

  • An app whose hot reload swaps modules in place, without reloading the page, gives no reload sample, because the signal is the frame asking for its document again. I chose the document request because a sandboxed frame has no same-origin channel to report back through.
  • Samples are per forge, not per person.

Review

[{"go":"/talk on an app workspace, Start dev server, Code tab","look":"save a file with Save live","expect":"the frame reloads and the bar shows 'reload N s · targets 1 s and 2 min'; over 1 s it gets an 'over target' badge","ask":"Does the line sit well under the bar?"},
 {"go":"Diff tab, Test what I touched","look":"the bar after the run ends","expect":"'tests N s' appears beside the reload figure"}]

The how-to is in docs/features/talk-workspace.md, and the new .talk-pane-loop class is named in docs/design/areas/talk.md.

🤖 Generated with Claude Code

Closes #17374

commented

The workspace bar on /talk now shows how long the live loop takes, as p95 over the last 50 samples next to its target. For example: "reload 0.4 s · tests 48 s · targets 1 s and 2 min". The new test/loop-samples.test.ts, the touched/working-tree/dev-cell suites, test/mcp-size.test.ts, bun x tsc --noEmit and the gate all pass. I didn't run the app in a browser, so the review block below hasn't been tried on a preview.

What changed

  • Samples: src/core/loop_samples.ts keeps the newest 50 of each kind in memory and mirrors them to <data>/dev/loop-samples.json after the request, so a save doesn't wait on it. There is no migration.
  • Reload: a live save (Code tab or write_file with live) with a live dev cell now also writes the file into that cell's checkout, which didn't happen before. The sample runs from the save to the frame's next document request in src/web/pages/talk_dev.ts. A script request isn't counted, and a save the frame doesn't follow within a minute is dropped.
  • Tests: each Test what I touched run that ran tests records its wall time and whether it passed, passed or failed.
  • Warning tone: a figure over its target gets an amber (attn) badge naming it, not red. The bar line only appears once a sample exists.
  • Same numbers elsewhere: the terminal's p view prints a Loop: line. The pane MCP tool returns loop with reload and tests (p95Ms, samples, targetMs, over) plus words. I used an existing tool rather than adding a new one.
  • Reused: p95 from src/rules/budget_rerun.ts, and noLinkUnder, which I moved out of touched_run.ts into src/actions/link_free.ts.

What I left out

  • An app whose hot reload swaps modules in place, without reloading the page, gives no reload sample, because the signal is the frame asking for its document again. I chose the document request because a sandboxed frame has no same-origin channel to report back through.
  • Samples are per forge, not per person.

Review

[{"go":"/talk on an app workspace, Start dev server, Code tab","look":"save a file with Save live","expect":"the frame reloads and the bar shows 'reload N s · targets 1 s and 2 min'; over 1 s it gets an 'over target' badge","ask":"Does the line sit well under the bar?"},
 {"go":"Diff tab, Test what I touched","look":"the bar after the run ends","expect":"'tests N s' appears beside the reload figure"}]

The how-to is in docs/features/talk-workspace.md, and the new .talk-pane-loop class is named in docs/design/areas/talk.md.

🤖 Generated with Claude Code

commented

This round addresses all three of sentinel's points. I ran tsc, the loop tests, gate.ts and design-lint.ts before pushing, and all passed. I did not run the full suite; the forge runs it on the push.

Tests (point 1). The new test/loop-doors.test.ts renders talkPane and checks the page line and its badge:

  • No sample: nothing is drawn.
  • Under target: the data-pane-loop line is drawn with no attn badge.
  • Over target: an attn badge appears and names the figure ("reload over target").

It also checks the terminal p view prints Loop: reload 2.5 s … targets 1 s and 2 min, and that samples survive a restart through loop-samples.json. The page and terminal checks fail if the line is removed.

One source for the targets (point 2).

  • loopReading: it now returns targets ("targets 1 s and 2 min"), built from TARGETS_MS.
  • Page and terminal: both use that field instead of typing the phrase.
  • Docs: docs/features/talk-workspace.md can't derive it, so a test fails if the doc's phrase differs from loopReading().targets.

Reload sample (point 3).

  • Shorter window: I took the "shorten the stale window" option. A save now only counts if the frame asks for its document within 10 s, down from 60 s. A later navigation is not recorded as a reload. This is tested by backdating wroteAt.
  • Not done: I did not add detection of in-place module swaps from the dev server's output. That would mean parsing arbitrary app output.
  • Docs: they now say only an app whose hot reload does a full document request gives a sample.

On the empty /talk body you saw without a session: I did not look into it, and the page tests above call talkPane directly rather than fetching the preview. No sample exists on a fresh preview, so the line is not drawn there until one is recorded.

I left the two talk_chats.ts and talk_preview.ts comment-length notes from gate.ts alone. They are advisory, and the nightly rewrap handles them on main.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs