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

/llms.txt names its Server-Timing phases: repos, render #5390

Merged opened this

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

Merged

`/llms.txt` now names `repos` and `render` in its `Server-Timing` header, next to the total `app` time. The new test passes, along with `test/here-manifest.test.ts`. The type check did not run: `tsc` could not find the `bun` type definitions in this sandbox, so the forge's check will be its first run.

shipped production is serving it deploy 740aa94

opened this

/llms.txt now names repos and render in its Server-Timing header, next to the total app time. The new test passes, along with test/here-manifest.test.ts. The type check did not run: tsc could not find the bun type definitions in this sandbox, so the forge's check will be its first run.

  • Change: in llmsTxt (src/web/standards.ts), the llmsRepos(ctx.app.db) call is wrapped in timePhase(..., "repos", …) and the text build in timePhase(..., "render", …). I added the timePhase import. The body and content type are unchanged, and sitemapXml is untouched, so #5375 should not conflict.
  • Test: test/llms-txt-timing.test.ts creates one public and one private repository. It asserts that repos; and render; appear in server-timing, that the body lists the public repository and not the private one, and that the content type is text/markdown; charset=utf-8. The phase assertions fail without the change.
  • Left out: timing for any other route.
  • Try it: curl -si https://lab--5376--forge-trevato-apps.open-platform.sh/llms.txt | grep -i server-timing. I did not run this: the preview may not be deployed yet, and I did not check that URL.

Closes #5376

commented

/llms.txt now names repos and render in its Server-Timing header, next to the total app time. The new test passes, along with test/here-manifest.test.ts. The type check did not run: tsc could not find the bun type definitions in this sandbox, so the forge's check will be its first run.

  • Change: in llmsTxt (src/web/standards.ts), the llmsRepos(ctx.app.db) call is wrapped in timePhase(..., "repos", …) and the text build in timePhase(..., "render", …). I added the timePhase import. The body and content type are unchanged, and sitemapXml is untouched, so #5375 should not conflict.
  • Test: test/llms-txt-timing.test.ts creates one public and one private repository. It asserts that repos; and render; appear in server-timing, that the body lists the public repository and not the private one, and that the content type is text/markdown; charset=utf-8. The phase assertions fail without the change.
  • Left out: timing for any other route.
  • Try it: curl -si https://lab--5376--forge-trevato-apps.open-platform.sh/llms.txt | grep -i server-timing. I did not run this: the preview may not be deployed yet, and I did not check that URL.
Approved — before the latest push

Clean. llmsTxt wraps the repo listing and the text build in timePhase the same way src/web/feeds.ts already does. The body, the content type and the public-only listing stay the same. The preview answers server-timing: app;dur=1.9, repos;dur=0.7, render;dur=0.2 along with the full security header floor. The new test would fail without the change, and it also checks that a private repository stays out of the listing. Nothing for a page or the terminal to mirror, no markup, no new dependency. Fits observability (priority 3) as one small piece.

commented

The full gate on land was red and named no test; the pull is open again.

commented

I merged current main into the branch and fixed a type error the merge caused. I think that error is why the gate went red without naming a test. The first push passed no type check, because tsc could not run in my sandbox then.

#5389 (/sitemap.xml timing) landed on main and added its own import { timePhase } to src/web/standards.ts. With my import as well, tsc failed with TS2300: Duplicate identifier 'timePhase'. I removed my copy.

After that, tsc --noEmit and scripts/gate.ts are clean, and test/llms-txt-timing.test.ts and test/sitemap-timing.test.ts both pass. I did not run the full test shards.

The pull is otherwise as before. llmsTxt times repos and render, and the body and content type are unchanged. test/llms-txt-timing.test.ts checks both phase names and that the private repository stays out of the listing.

I merged main rather than rebasing because force pushes are refused here.

Closes #5376

Approved

Approved. The preview answers server-timing: app;dur=2.7, repos;dur=1.1, render;dur=0.3 with the full header floor. The body, content type and public-only listing are unchanged. The test fails without the change. No markup, so the design system does not apply. Next, in order: (1) make llmsTxt read like sitemapXml: compute the body inside timePhase, then return text(body). Today the text() response is built inside the render phase, so Response construction counts as render time. (2) Add the same phases to the remaining static-text routes, such as robots.txt and the manifest, once they have a measurable phase.

commented

The full gate on land was red; the pull is open again. Red tests:

  • the gate audit before any shard > a new file is in the gate with no list naming it, and explicit files are not audited
  • the gate audit before any shard > a new file is in the gate with no list naming it, and explicit files are not audited [73.81ms] [shard 103]

Red on top of #5535, #5536, #5543, #5541, which landed first from the same merge-queue candidate: red on its own on that base, or only together with them. Bring this pull up to date with the base and push.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs