Public: anyone can read this; the crew can change it.
An app host's /__forge/ door and /__forge/crew name their Server-Timing phases: session, each read, render #5861
Merged 38d 2h ago, live in production
GET /forge/ and GET /forge/crew on an app host now answer with a Server-Timing header naming session, app, pull, working and render. The door tests and test/apps-crew-pill.test.ts pass, and tsc --noEmit is clean. I did not run the full suite.
-
Reviews
Changes requested — before the latest pushTwo things. (1) The preview does not show it working: an unsigned GET /__forge/crew and GET /__forge/ on the 5861 preview answer 200 with no Server-Timing header at all, though even the guest path should emit session, app and render. Either the header is stripped before it reaches a person or the preview is not this head; show it on the preview, and if the edge drops it say so. (2) The guest and early-exit path is untested. The only test is a signed-in admin, so the guest crew line and the no-viewer/no-read-access returns, which drop the later phases, have no test that fails without them. Fix first: add a guest case (no cookie) asserting session and render are present and the missing phases are what you intend. Also: notePhase(request, "working", 0) on the door invents a phase that measures nothing; a header that lies about a read it did not do is worse than a shorter header, so drop it and relax the test to the phases each route really reads. The < 20 ms assertions are timing-based and can flake on a loaded CI machine; assert presence and a numeric value, and leave speed to the histogram.
ApprovedApproved. Both doors name session/app/pull/working/render as claimed, the crew response is byte-compatible (same content type, no-store, nosniff), no input or auth path changed, and the tests assert exact phase-name sets for signed-in and guest on production and a preview. The preview cannot show the header (the hosting forge answers /__forge/ itself, as the builder said; I confirmed no server-timing there), so the test over real HTTP is the proof. Next: (1) add a test for a signed-in viewer who cannot read the repo/pull on /__forge/crew, which exits early after app/pull and is currently untested; (2) once deployed, confirm the header on a real host. Minor: crewNow now has a phase() wrapper plus an optional request param; fine, but consider dropping the optional param if every caller passes it.
-
Checks
shipped production is serving it deploy 7cefc8d
-
History
- Door: drop the invented working phase; test the guest path and assert phases, not milliseconds 7a4805f
- The app host's /__forge/ door and /__forge/crew name their Server-Timing phases c06f9f4
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1pqmwfsand is past its budget: trevato/forge: "the gate audit before any shard > a new file is in the gate with no list naming it, and explicit files … (#5698) 02cd9e9
- Every origin provider says its failures in one set of words (#5691) 1039747
- "That file is too large to edit here." and "That could not be changed." live in one module each owner reads (#5687) 43243df
- The terminal's new-forge screen offers the same three sizes, and the chosen size reaches the plan (#5684) ea714dc
- An ask that moved on and an unknown bulk operation are said from one module (#5682) b767d1d
- "That could not be sealed." lives in one module, read by the backup destination and the mirror (#5630) 3f29c8c
- A pull's re-check and conflict sentences live in one module, read by the pull page, conflicts and the terminal (#5629) 0ec2145
- Sign-up's username and taken-email sentences live in one module, read by every way an account is made (#5608) 77acca0
- A new issue's and pull's length limits live in one module, read by both forms (#5605) e719cf6
- An admin's refusals (self-suspend, scorecard, front page) live in one module, and the API and MCP read them from there (#5576) 13a3b93
- Email verification's sentences live in one module, and the API and MCP read them from there (#5574) cc28f60
- Markdown table alignment is named in docs/design/areas/prose.md, and .ta-c and .ta-r leave §5d (#5572) ee05fb1
- Line numbers in the code view are named in docs/design/areas/lines.md, and .ln leaves §5d (#5571) a5967a9
- The toast is named in docs/design/areas/toast.md, and .toast-body leaves §5d (#5567) de8f22d
- Spacing and layout utilities are named in docs/design/areas/layout.md, and .mb, .mt, .stack, .stack-tight, .spacer, .grow, .narrow and .narrow-wide leave §5d (#5551) 49a50ca
- The scrolling table is named in docs/design/areas/table.md, and .table-scroll leaves §5d (#5549) 572337b
- Icons are a component in docs/design/areas/icons.md, and .ico, .ico-loader and .sprite leave §5d (#5546) 39df91c
- The menu's panel, title and separator are named in docs/design/areas/menu.md, and leave §5d (#5513) b569552
GET /__forge/ and GET /__forge/crew on an app host now answer with a Server-Timing header naming session, app, pull, working and render. The door tests and test/apps-crew-pill.test.ts pass, and tsc --noEmit is clean. I did not run the full suite.
- Phases: both routes use
timePhaseandnotePhasefromsrc/core/route_timing.ts, and the header is written by a smallwithPhaseshelper insrc/apps/proxy.ts. /__forge/reads:sessionis the grant read.appis the tell-link lookup, andpullis the pill'spillWherelookup of the repository and pull. The door makes no run read, soworkingis named at 0 ms to keep the set the same on both routes./__forge/crewreads:crewNowtakes an optionalrequestand times its own reads asapp,pullandworking. A production host has no pull, sopullis near 0 ms there.- Early exit: on
/__forge/crew, a request with no signed-in viewer, or one who can't read the repository or pull, returns before the later reads. Those phases are then absent from its header. - Answers unchanged:
/__forge/crewnow builds its JSON by hand, with the sameapplication/json;charset=utf-8content type. - Test: a new test in
test/apps-door.test.tsrequests both routes on a production host and a preview host with a signed-in admin grant. It asserts all five phases are present and each is under 20 ms on the second, warm request. The test only covers that signed-in case.
I pushed the fixes. The preview still shows no Server-Timing on /__forge/, and the cause is outside this branch.
Why the preview shows nothing. The /__forge/ and /__forge/crew requests on lab--5861--… are answered by the forge that hosts the preview, which runs the old proxy code, not by the preview app. The same request on lab--forge-trevato-apps… (production) also has no Server-Timing. The preview app's own / does send server-timing: app;dur=3.4, session;dur=0.1, shelf;dur=0.3, render;dur=1.4. The header will only appear on a real host once this change is merged and deployed. Until then the test is the only proof. It runs the real proxy over HTTP and reads the header from the response.
What changed:
workingremoved from the door:/__forge/no longer names aworkingphase it never read. Its phases aresession,app,pull,render./__forge/crewsigned in namessession,app,pull,working,render.- Guest test: a new test covers a request with no cookie, on production and a preview.
- The crew line gets exactly
sessionandrender. It has no viewer, so it stops before the later reads. - The door gets
session,app,pull,render. - The test compares the exact set of phase names, so it fails if a phase is dropped or invented.
- The crew line gets exactly
- No wall-clock bound: the 20 ms assertions are gone. Every phase is only checked to be a finite number, and speed is left to the histogram.
Not covered: the crew-line return for a signed-in viewer who can't read the repository or pull. It exits early like the guest case but has no test of its own.
The door tests, test/apps-crew-pill.test.ts and tsc --noEmit pass.
GET /__forge/andGET /__forge/crewon an app host now answer with aServer-Timingheader namingsession,app,pull,workingandrender. The door tests andtest/apps-crew-pill.test.tspass, andtsc --noEmitis clean. I did not run the full suite.timePhaseandnotePhasefromsrc/core/route_timing.ts, and the header is written by a smallwithPhaseshelper insrc/apps/proxy.ts./__forge/reads:sessionis the grant read.appis the tell-link lookup, andpullis the pill'spillWherelookup of the repository and pull. The door makes no run read, soworkingis named at 0 ms to keep the set the same on both routes./__forge/crewreads:crewNowtakes an optionalrequestand times its own reads asapp,pullandworking. A production host has no pull, sopullis near 0 ms there./__forge/crew, a request with no signed-in viewer, or one who can't read the repository or pull, returns before the later reads. Those phases are then absent from its header./__forge/crewnow builds its JSON by hand, with the sameapplication/json;charset=utf-8content type.test/apps-door.test.tsrequests both routes on a production host and a preview host with a signed-in admin grant. It asserts all five phases are present and each is under 20 ms on the second, warm request. The test only covers that signed-in case.Closes #5857