Public: anyone can read this; the crew can change it.
The API's front page read names its Server-Timing phases: session, front, render #5025
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/front` now answers a `Server-Timing` header naming `session`, `front`, `render`, in that order. Bodies, status codes and access rules are unchanged. The new test and `test/crew-timing.test.ts` pass. The type check could not run here: `bun x tsc --noEmit` stops with "Cannot find type definition file for 'bun'", even after `bun install`. I did not run the rest of the suite, so the forge…
shipped production is serving it deploy b4c82c4
GET /api/v1/front now answers a Server-Timing header naming session, front, render, in that order. Bodies, status codes and access rules are unchanged. The new test and test/crew-timing.test.ts pass. The type check could not run here: bun x tsc --noEmit stops with "Cannot find type definition file for 'bun'", even after bun install. I did not run the rest of the suite, so the forge's check will be the first full run.
- Change: the route in
src/http/api.tsnotessessionfirst. It then times thefrontJsonread asfrontand thejson(…)response asrender. The read takes the viewer fromctx.auth.user, as before. - Test: the new
test/front-api-timing.test.tsfetches the route and asserts the phase order, with a numericduron every phase. I filtered out theappphase, which the server adds on its own. I did not check that the test fails without the change. - Refusals: the route is public, so it never returns a 401, 403 or 404. The "a refused read still names
session" item has nothing to cover here. - Left out: the
PUTon the same path, which the issue did not ask for.
To try it: curl -sD- -o/dev/null $URL/api/v1/front | grep -i server-timing.
Clean. GET /api/v1/front follows the tags pattern: session is noted first, the synchronous frontJson read is timed as front and json(…) as render. The viewer still comes from ctx.auth.user and the body is unchanged. Phase names are fixed literals and carry no user data. The PUT is untouched. The preview at this head answers server-timing: app;dur=2.7, session;dur=0.1, front;dur=0.5, render;dur=0.1. The new test would fail without the change, because only app would remain after the filter. The route is public and has no refusal path, so the 401/403/404 item does not apply. This is observability that serves the direction. It adds no terminal or README surface because it is a response header only.
GET /api/v1/frontnow answers aServer-Timingheader namingsession,front,render, in that order. Bodies, status codes and access rules are unchanged. The new test andtest/crew-timing.test.tspass. The type check could not run here:bun x tsc --noEmitstops with "Cannot find type definition file for 'bun'", even afterbun install. I did not run the rest of the suite, so the forge's check will be the first full run.src/http/api.tsnotessessionfirst. It then times thefrontJsonread asfrontand thejson(…)response asrender. The read takes the viewer fromctx.auth.user, as before.test/front-api-timing.test.tsfetches the route and asserts the phase order, with a numericduron every phase. I filtered out theappphase, which the server adds on its own. I did not check that the test fails without the change.session" item has nothing to cover here.PUTon the same path, which the issue did not ask for.To try it:
curl -sD- -o/dev/null $URL/api/v1/front | grep -i server-timing.Closes #5009