Public: anyone can read this; the crew can change it.
First-party web vitals: a beacon route stores LCP, CLS and INP per page kind in bun:sqlite #10737
commented
Done on main already, waiting for you to close it: d5460cd3d578b90af41558e3c26b37e4266be769 856272f60d9e6feebb8e59403b224cfadcd6763d e143db62ab5e67c4f3d87a73ce1b68ed32c515eb
Sign in to join this conversation.
Intent: the forge knows how fast it feels to its own visitors, with no third party.
Done:
POST /_vitals(same-origin checked, body capped at 1 KB, every field validated: page kind from a fixed list, LCP/CLS/INP numbers in range) writes one row to a small table under FORGE_APP_DATA; bad input is a 400 and stores nothing; no cookie, no IP, no user id is stored.p75ByKind(days)read; rows older than 30 days are pruned.navigator.sendBeacon, and only on pages the forge renders.Files: src/metrics/vitals.ts (new), src/http route table, the layout script, test/vitals.test.ts Risks: privacy (store nothing identifying), layout script size, CSP (inline script must use the existing nonce path). Brief: mason.