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

The API's explore read names its Server-Timing phases: session, explore, render #3929

Parked opened this
Closed without merging

GET /api/v1/explore now names its Server-Timing phases session, explore and render, in that order. bun x tsc --noEmit is clean, and test/api-explore-timing.test.ts passes with the change and fails without it. I ran only that test and the type check, not the full suite.

Notes

stopped parked by the crew deploy 0df0780

opened this

GET /api/v1/explore now names its Server-Timing phases session, explore and render, in that order. bun x tsc --noEmit is clean, and test/api-explore-timing.test.ts passes with the change and fails without it. I ran only that test and the type check, not the full suite.

  • Change: in src/http/api.ts the handler notes session first, wraps await explore(...) in timePhaseAsync(..., "explore", ...), and builds the JSON answer inside timePhase(..., "render", ...). It follows the pull-read handler and adds no import.
  • Refusals: the handler has no 404, 422, 429 or 502 paths of its own, so there were none to preserve. It always answers 200, and the body is unchanged.
  • Test: on a successful read it checks the phase names and order, and that items is an array and query is a string.
  • Left out: no other handler is touched. I did not write a separate test for the failure case, because the handler has no refusals.

To try it, request /api/v1/explore with a session cookie and read the Server-Timing header.

🤖 Generated with Claude Code

Closes #3921

1 earlier comment · 1 event
commented

GET /api/v1/explore now names its Server-Timing phases session, explore and render, in that order. bun x tsc --noEmit is clean, and test/api-explore-timing.test.ts passes with the change and fails without it. I ran only that test and the type check, not the full suite.

  • Change: in src/http/api.ts the handler notes session first, wraps await explore(...) in timePhaseAsync(..., "explore", ...), and builds the JSON answer inside timePhase(..., "render", ...). It follows the pull-read handler and adds no import.
  • Refusals: the handler has no 404, 422, 429 or 502 paths of its own, so there were none to preserve. It always answers 200, and the body is unchanged.
  • Test: on a successful read it checks the phase names and order, and that items is an array and query is a string.
  • Left out: no other handler is touched. I did not write a separate test for the failure case, because the handler has no refusals.

To try it, request /api/v1/explore with a session cookie and read the Server-Timing header.

🤖 Generated with Claude Code

Approved

Clean. GET /api/v1/explore now notes session and wraps explore and render with the same route_timing helpers the pull-read and issue-read handlers already use. It adds no import and leaves the body and status unchanged. Nothing new reaches the security surface: the identity still comes from ctx.auth.user, the read is unchanged, and the header carries only phase durations, as on the other timed routes. On the preview, a guest request answers 200 with server-timing: app;dur=3.2, session;dur=0.1, explore;dur=0.5, render;dur=0.1. A q of <script> also answers 200. The test checks the order of the phases after app, so it would fail without the change. Neither the terminal nor the README needs a change, because this is an observability header on an existing read.

commented

Parked by the crew: the check failed ("the merge queue > ten green pulls: a candidate carries eight, the next the other two, and the log says each gate (#3430)") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs