Skip to content

feat(serendipity): bake the agents page at deploy - #933

Merged
oddharsh merged 2 commits into
mainfrom
claude/serendipity-mcp-info-bake
Sep 25, 2026
Merged

oddharsh merged 2 commits into
mainfrom
claude/serendipity-mcp-info-bake

Conversation

@oddharsh

Copy link
Copy Markdown
Owner

What changes

/serendipity/mcp-info ("For agents") is a fixed tool list and an endpoint URL, with nothing read per request. It still rendered per request, and serendipity's html() helper stamps no-store on every page. So it went out at the edge's q4 brotli with no ETag and no dcz delta, and it minted a uid cookie on a page that never uses one.

Build step 5b now bakes it as a plain document. It needs no island, since nothing on it is live, and the build asserts two renders agree. routeSerendipity's static branch serves it the way it serves the dashboard (#929): serendipity's own policy with the build's hash in place of 'unsafe-inline', and headers passed through serveStaticPage, so the precompressed body is never rebuilt (gotcha 13).

today (production) after (built Worker)
wire 7,587 B, no-store 4,976 B q11 twin
return visit 7,587 B again 304 with no body
after a deploy 7,587 B 3,489 B family delta
script-src 'unsafe-inline' one hash (the shared speculation rules)
uid cookie minted none

Coverage

It isn't a registered surface, so the per-request ratchet from #930 doesn't see it. The contract test pins the bake and the live render to the same bytes instead, so the live arm local dev uses can't drift from what ships.

Verification

  • bun run build, bun run lint, bun run typecheck: clean.
  • bun run test: 934 pass. bun run test:node: 924 pass, 10 skipped (HTMLRewriter-only), 0 fail.
  • bun run routes:check: 190 routes, 0 failures, with a new fullPage row for the page. /serendipity still serves the dashboard's built shell next to the new serendipity/ staging directory.
  • Against the built Worker: content-encoding: br, an ETag, serendipity's policy carrying the hash, no set-cookie, and a body that decodes once to the minified page.

/serendipity/mcp-info is a fixed tool list and an endpoint URL, with
nothing read per request, yet it rendered per request with no-store
(serendipity's html() helper sets it on every page), so it went out at
the edge's q4 brotli with no ETag and no dcz delta, and minted a uid
cookie on a page that never uses one. Production today: 7,587 B.

build.ts step 5b now bakes it as a plain document, no island, and
asserts two renders agree. routeSerendipity's static branch serves it
the way it serves the dashboard: serendipity's own policy with the
build's hash in place of 'unsafe-inline', headers passed through
serveStaticPage so the precompressed body is never rebuilt. The shell
is 4,976 B at q11 with a 3,489 B family delta, so -34% on a first
visit and a 304 with no body on a return.

The page is not a registered surface, so the per-request ratchet does
not see it; the contract test pins the bake and the live render to the
same bytes instead.
@github-actions github-actions Bot added area: serendipity The /serendipity event dashboard area: tools Developer tooling and the contract suite area: worker The site Worker: routing, rendering, bindings type: feat New capability or surface labels Sep 25, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
aadhar-sh ac29ea3 Sep 25 2026, 08:46 PM

@oddharsh
oddharsh enabled auto-merge (squash) September 25, 2026 20:45
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Wire-size diff vs merge base

000a18b03a7495bea60a28076223e1cca1cfeb64 → 24f9ecd43a73ea9250b11343fe8ea62131c915f4

Brotli q11, the quality the edge serves. Every number here is deterministic:
an unchanged file produces no row. Advisory — this check fails on nothing.

Client assets

No change. 27 files, 91.60 KiB Brotli total.

Pages

Total Brotli: 631.36 KiB → 636.22 KiB (+4.86 KiB, +0.8%) across 66 files, 1 changed.

file base head Δ
serendipity/mcp-info.html — 4.86 KiB new

Worker bundle

259.53 KiB → 259.54 KiB gzip (+0.01 KiB, +0.0%)

Largest module deltas (raw bytes in bundle):

file base head Δ
.build/src/worker/lib/csp-hashes.ts 7.43 KiB 7.50 KiB +0.07 KiB (+1.0%)
.build/serendipity/serendipity.ts 91.28 KiB 91.30 KiB +0.02 KiB (+0.0%)
.build/src/worker/index.ts 14.07 KiB 14.08 KiB +0.02 KiB (+0.1%)

Dictionary transport

Family dictionary acquisition: no change, 14.41 KiB q11.

pd/: 177 → 178 deltas, 525.14 KiB → 528.55 KiB (+3.41 KiB).

@oddharsh
oddharsh merged commit 2c44cea into main Sep 25, 2026
14 checks passed
@oddharsh
oddharsh deleted the claude/serendipity-mcp-info-bake branch September 25, 2026 20:49
oddharsh added a commit that referenced this pull request Sep 26, 2026
…#934)

#933 shipped /serendipity/mcp-info as a plain bake, so /garage/wire's
table gains its row, measured in production the same day: 7,587 B per
request (it went out no-store) against a 4,976 B built page, -34% on a
first visit, a 304 with no body on return, and a 3,489 B family delta.

It has no fragment, so the lede counts eight pages, seven of them with
one, and a sentence says why this page needed none. The quiz's
"seven pages with a fragment" stays true and is unchanged.

Co-authored-by: Aadharsh Pannirselvam <19518661+oddharsh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: serendipity The /serendipity event dashboard area: tools Developer tooling and the contract suite area: worker The site Worker: routing, rendering, bindings type: feat New capability or surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant