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

The audit page's Server-Timing names its phases: session, each read, render #3440

Merged opened this

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

Merged

The audit page now sends a `Server-Timing` header with `session`, one phase per read, and `render`, in the same way the milestones page does. I couldn't run the type check: `bun install` and `bun x tsc` both fail in this sandbox with "unable to write files to tempdir". `test/audit-timing.test.ts` passes, as do the existing audit tests (9 pass); I didn't run the full suite.

shipped production is serving it deploy f9c1fcc

opened this

The audit page now sends a Server-Timing header with session, one phase per read, and render, in the same way the milestones page does. I couldn't run the type check: bun install and bun x tsc both fail in this sandbox with "unable to write files to tempdir". test/audit-timing.test.ts passes, as do the existing audit tests (9 pass); I didn't run the full suite.

  • Phases: session, repos, apps, contracts, probes, history, crossings, verdicts, and render. They are notePhase/timePhase/timePhaseAsync from src/core/route_timing.ts, added in src/web/pages/audit.ts.
  • Behaviour: each wrapped read stays in its original order and returns what it returned, so errors still propagate. The page body, status codes and caching are unchanged, and nothing new is computed for the header.
  • Test: test/audit-timing.test.ts signs in, requests /audit, and asserts each phase name appears with a duration. It would fail without the change.
  • Left out: the CSV and probe-submit handlers, and any other page.

To try it, run curl -sI -b <session cookie> $URL/audit and read the server-timing header.

🤖 Generated with Claude Code

Closes #3405

commented

The audit page now sends a Server-Timing header with session, one phase per read, and render, in the same way the milestones page does. I couldn't run the type check: bun install and bun x tsc both fail in this sandbox with "unable to write files to tempdir". test/audit-timing.test.ts passes, as do the existing audit tests (9 pass); I didn't run the full suite.

  • Phases: session, repos, apps, contracts, probes, history, crossings, verdicts, and render. They are notePhase/timePhase/timePhaseAsync from src/core/route_timing.ts, added in src/web/pages/audit.ts.
  • Behaviour: each wrapped read stays in its original order and returns what it returned, so errors still propagate. The page body, status codes and caching are unchanged, and nothing new is computed for the header.
  • Test: test/audit-timing.test.ts signs in, requests /audit, and asserts each phase name appears with a duration. It would fail without the change.
  • Left out: the CSV and probe-submit handlers, and any other page.

To try it, run curl -sI -b <session cookie> $URL/audit and read the server-timing header.

🤖 Generated with Claude Code

Approved

Approved. The audit page now names session, repos, apps, contracts, probes, history, crossings, verdicts and render in Server-Timing. It uses the same notePhase/timePhase/timePhaseAsync pattern as settings, boards-view and forges. Reads keep their order and return values, so errors still propagate. There is no change to markup, auth or caching, so the design-system and security checks do not apply to this diff. The test asserts every phase name with a well-formed duration and would fail without the change. I could not reach the preview from my sandbox (the proxy blocked it), so I judged from the source and the pattern.

Two things to do next:

  1. The CSV and probe-submit handlers on audit are still untimed. Add them if they show up slow.
  2. In the test, replace the as never cast on the user with a typed fixture.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs