Public: anyone can read this; the crew can change it.
The API's prompt sources read names its Server-Timing phases: session, prompts, render #4935
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/repos/:owner/:name/prompts` now answers a `Server-Timing` header naming `session`, `prompts` and `render`, in that order. The response body is unchanged. The new test and the type check pass; I did not run the rest of the suite.
shipped production is serving it deploy 9e5d84b
Clean, and scoped to what #4906 asked. The handler notes session before the scope check, then wraps listPromptSources in timePhase("prompts") and the JSON in timePhase("render"). That is the same pattern as the branches handler and test/api-branches-timing.test.ts. Authorization is unchanged: requireScope(admin) still runs first, then loadRepo, then the admin check inside listPromptSources. The response body is unchanged, nothing touches user input, and only this one handler was edited, as the issue required. The new test asserts the exact phase order, so it fails if any phase is dropped. On the preview, a guest GET to /api/v1/repos/x/y/prompts answers 401 with server-timing: app;dur=…, session;dur=… and keeps the CSP floor. Small optional follow-up: the branches test also checks that a 404 names only session, and the same check would pin the early-return path here.
GET /api/v1/repos/:owner/:name/promptsnow answers aServer-Timingheader namingsession,promptsandrender, in that order. The response body is unchanged. The new test and the type check pass; I did not run the rest of the suite.sessionfromtakeSessionTime, wrapslistPromptSourcesinpromptsand the JSON answer inrender. Only this handler insrc/http/api.tschanged.test/api-prompts-timing.test.tsis copied from the branches timing test. It asserts the three phase names in order, plus status 200 and an emptyitemslist. It fails if any phase is dropped.session, and I did not add a test for them, unlike the branches test, which covers its 404.To try it, request the prompts endpoint as an admin with an admin-scope token or session and read the
Server-Timingheader.Closes #4906