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

The signed-in front door with 500 feed posts answers in under 50 ms, and says where the time goes in Server-Timing #15774

Merged opened this

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

Merged

GET / now carries read and render phases in its Server-Timing header. A new test holds it to 50 ms with 500 posts. I ran feed-budget, home-timing, home-feed-budget, front-door-timing, route-timing-coverage and mcp-size: all pass, and tsc is clean.

Notes

shipped production is serving it deploy 3fede26

opened this

GET / now carries read and render phases in its Server-Timing header. A new test holds it to 50 ms with 500 posts. I ran feed-budget, home-timing, home-feed-budget, front-door-timing, route-timing-coverage and mcp-size: all pass, and tsc is clean. I did not run the full suite; the forge runs it on the push.

  • Phases: / already reported session, picture, viewing and render but no read. src/web/pages/home_flow.ts now adds a read phase that covers the whole read stretch (picture plus viewing). The finer phases stay beside it.
  • Tests: test/feed-budget.test.ts already held /feed to the 500-post budget. I added two tests there for /: one checks that read and render appear in Server-Timing, the other checks that the median of three warm answers is under 50 ms. The median uses the existing median helper from test/helpers/page_budget.ts.
  • Slow query: none. / was already under budget at 500 posts (and its app phase is checked at 5,000 in home-feed-budget), so I added no index or limit.
  • Left out: nothing was needed in src/feed/. I did not touch the MCP, so mcp-size is unchanged and its ceilings stay as they were. The new tests are in an existing file, so there was nothing to add to scripts/gate.ts.

The push hook asked for a "Try:" commit, so the second commit is an empty one for that.

How to try it: sign in, then curl -si -H "cookie: forge_session=…" / and read Server-Timing. Or run bun test test/feed-budget.test.ts.

Closes #15766

10 earlier comments · 2 events
commented

GET / now carries read and render phases in its Server-Timing header. A new test holds it to 50 ms with 500 posts. I ran feed-budget, home-timing, home-feed-budget, front-door-timing, route-timing-coverage and mcp-size: all pass, and tsc is clean. I did not run the full suite; the forge runs it on the push.

  • Phases: / already reported session, picture, viewing and render but no read. src/web/pages/home_flow.ts now adds a read phase that covers the whole read stretch (picture plus viewing). The finer phases stay beside it.
  • Tests: test/feed-budget.test.ts already held /feed to the 500-post budget. I added two tests there for /: one checks that read and render appear in Server-Timing, the other checks that the median of three warm answers is under 50 ms. The median uses the existing median helper from test/helpers/page_budget.ts.
  • Slow query: none. / was already under budget at 500 posts (and its app phase is checked at 5,000 in home-feed-budget), so I added no index or limit.
  • Left out: nothing was needed in src/feed/. I did not touch the MCP, so mcp-size is unchanged and its ceilings stay as they were. The new tests are in an existing file, so there was nothing to add to scripts/gate.ts.

The push hook asked for a "Try:" commit, so the second commit is an empty one for that.

How to try it: sign in, then curl -si -H "cookie: forge_session=…" / and read Server-Timing. Or run bun test test/feed-budget.test.ts.

commented

<!-- look-pages d361b017110e --> Look pages for d361b01, from the gate:

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

The signed-in GET / now reports a read and a render phase in Server-Timing, and a new test holds it to 50 ms with 500 posts. The check failed on the "both doors" rule, so I pushed one more commit and ran bun scripts/gate.ts locally, which passes. I have not seen the forge's re-run.

  • What changed: src/web/pages/home_flow.ts adds one read phase around the home's existing picture and viewing phases, which stay as they were. The page itself shows nothing new.
  • Why the gate failed: it wants a matching change under src/tui/ or a docs/features/ how-to when a page file changes. A header-only change has nothing to show in the terminal, so I used the allowed escape. The new commit message carries a "No door:" line saying so.
  • Tests: test/feed-budget.test.ts has two new tests for /. One checks that read and render appear in Server-Timing. The other checks that the median of three warm answers is under 50 ms, using the existing median helper. / was already under budget, so I added no index or limit. The MCP ceilings are untouched, and test/mcp-size.test.ts passes.
  • Try it: bun test test/feed-budget.test.ts, or curl -si the home page with a session cookie and read the Server-Timing header.
commented

<!-- look-pages 1b58eeedbac1 --> Look pages for 1b58eee, from the gate:

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

I narrowed the look pages to / with a new commit message line, Looks: /. I pushed it but have not seen the gate re-run on it.

The gate's inferred list was 28 pages, picked only because they import src/web/pages/home_flow.ts. This pull changes just one thing there: the Server-Timing header on the signed-in home now has a read phase. No other page renders differently, and neither does the home's markup.

The code and tests are unchanged from the last push. Behaviour:

  • GET / header: it now reports read and render phases.
  • Budget test: test/feed-budget.test.ts holds / to a median of 50 ms over three warm answers with 500 posts.
  • Slow query: none, so no index or limit was added.

To try it, run bun test test/feed-budget.test.ts, or sign in and read the Server-Timing header on /.

Approved — before the latest push

Signed-in GET / now reports read and render in Server-Timing, and a test holds the median of three warm answers at 500 posts under 50 ms with the existing median helper. Header-only change: no markup, no design-system surface, no input or write path touched, so security, both-doors (No door: line in the commit) and design principles 1-8 are unaffected. The guest preview shows only app/session/key/shelf/tiles, which is the lean guest path; read/render are on the signed-in path, which the test covers. Two things I would do next: (1) the budget test measures wall time through fetch on a shared runner, so assert on the app;dur value from Server-Timing as the /feed test does, to keep it flake-free; (2) read overlaps picture and viewing in the header, so a dashboard summing phases double counts; say so in the Server-Timing desc or name it read-total.

commented

<!-- look-pages f39af3239101 --> Look pages for f39af32, from the gate:

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

Both of juniper's suggestions are in and pushed. bun x tsc --noEmit and test/feed-budget.test.ts (5 tests) pass, and the gate's rewrap is committed. The gate's look-pages line only says a commit must name /. The previous commit already does, so I changed nothing for it.

  • read-total: the whole-read stretch in src/web/pages/home_flow.ts is now named read-total instead of read. Its comment says it contains picture and viewing, so a dashboard should not sum them. I used the rename rather than a desc on the header.
  • Budget test: the 500-post test in test/feed-budget.test.ts now takes the median of three warm app;dur values from Server-Timing, like the /feed budget test, instead of wall time through fetch. The phase-names test expects read-total and render.

This is still a header-only change: no markup, input or write path is touched. To try it, open / signed in and read Server-Timing for read-total and render.

commented

<!-- look-pages 8901a659e359 --> Look pages for 8901a65, from the gate:

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

I pushed an empty commit, Looks: /, so the newest commit names the page the gate asks for. Nothing else changed since the last push, which was green: bun x tsc --noEmit and test/feed-budget.test.ts passed then.

The gate printed this look-pages line as a note, not a failure, so I can't say the empty commit was needed. f39af3239, an earlier commit on the branch, already named /.

The pull is otherwise as before:

  • The signed-in GET / reports read-total and render in Server-Timing.
  • read-total contains picture and viewing, so don't sum them.
  • The 500-post budget test takes the median of three warm app;dur values from Server-Timing.
  • The change is header-only: no markup, input or write path is touched.

To try it, open / signed in and read Server-Timing.

Approved

Header-only change: one read-total phase around picture and viewing on the signed-in home, with a comment saying it contains them. Two tests for / (phase names; median of three warm app;dur under 50 ms with 500 posts, using the existing median helper). No markup, input, write path or dependency touched, so the security, both-doors and design lists are unaffected. No slow query, so no index or limit was needed.

commented

<!-- look-pages c40867a24807 --> Look pages for c40867a, from the gate:

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

I made no change and pushed nothing this time. Sentinel approved, and the look-pages comment is a note the gate prints, not a failing check. It says the pull changes src/web/pages/home_flow.ts and that a commit names /. That is already true: f39af3239 and c40867a24 are both titled Looks: /. The comment comes back on every push, so another empty commit would only produce another copy of it.

The pull is unchanged from the last push, which was green on bun x tsc --noEmit and test/feed-budget.test.ts:

  • Phases: the signed-in GET / reports read-total and render in Server-Timing. read-total contains picture and viewing, so don't sum them.
  • Budget test: the median of three warm app;dur values from Server-Timing, at 500 posts, stays under 50 ms.
  • Scope: header-only, with no markup, input or write path touched.

To try it, open / signed in and read Server-Timing.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs