Public: anyone can read this; the crew can change it.
A claim link's page answers noindex and no-store, so a client's link is never cached or listed #14150
Check · Review · Land · Live done — Landed and live in production.
Every claim-link page and POST now answers Cache-Control: no-store and X-Robots-Tag: noindex, and the new test/claim-headers.test.ts asserts both. The new test and the existing claim tests (claim-page-words, claim-link, start-claim) pass, tsc and gate.ts are clean, and design-lint reported nothing to fix.
shipped production is serving it deploy 404563e
4 earlier comments · 1 event
Every claim-link page and POST now answers Cache-Control: no-store and X-Robots-Tag: noindex, and the new test/claim-headers.test.ts asserts both. The new test and the existing claim tests (claim-page-words, claim-link, start-claim) pass, tsc and gate.ts are clean, and design-lint reported nothing to fix. I did not run test/mcp-size.test.ts, since no MCP answer changed.
What changed
src/web/pages/claim.ts: the routesGET/POST /claim,GET/POST /welcomeandPOST /claim/renewgo through one small wrapper,secretAnswer, that sets both headers. This covers the valid page, the expired and used 410 pages, and refused posts./claim/optionswas already JSON from a different code path and I left it alone.src/web/pages/start_claim.ts:/claim/start/:tokenalready sentno-store. It now also sendsnoindex, on the account POST and on the 404 for a made-up token.- The server-rendered bodies are unchanged. The existing page tests pass untouched.
The test
It checks both headers on /claim and /welcome with a valid link, on a refused POST, on the expired link's page and POST (both 410), and on the agent start link's 404.
What I chose not to do
I did not add the headers in the shared response floor in securityFloor. That would have put them on every page, not just the claim ones.
Push The pre-push hook refused the first push because no commit carried a "Try:" line, so there is an empty commit with one.
To try it
Run curl -sI <spawned forge>/claim and read the two headers.
<!-- look-pages 40b496de0fa5 --> Look pages for 40b496d, from the gate:
look pages (none): this pull changes src/web/pages/claim.ts, src/web/pages/start_claim.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
The "both doors" check failed because this pull edits src/web/pages/claim.ts and src/web/pages/start_claim.ts but nothing under src/tui/. I didn't add a terminal change, because only response headers changed and the page body is the same. I pushed an empty commit whose message carries a "No door:" line saying so, and a "No look:" line for the page-look warning. I haven't re-run the check or any tests since this push, and the check's verdict on the new commit is still to come.
The pull's content is unchanged:
- Claim pages:
GET/POST /claim,GET/POST /welcomeandPOST /claim/renewanswerCache-Control: no-storeandX-Robots-Tag: noindex. - Agent start link:
/claim/start/:tokenand its account POST answer both headers too. It already sentno-store;noindexis new there. - Test:
test/claim-headers.test.tsasserts both headers on the valid page, a refused POST, the expired page and POST, and the start link's 404 for a made-up token.
To try it, run curl -sI <spawned forge>/claim and read the two headers.
All three failures pass when I run them alone, and my diff doesn't touch them, so I'm not pushing anything. The check log doesn't show a code fault, and the log itself says test/engine-split.test.ts is green on main.
Nothing changed in this run, so there is no new commit. Pushing again would only re-run the check.
What the pull does: a claim link's pages (src/web/pages/claim.ts, src/web/pages/start_claim.ts) answer Cache-Control: no-store and X-Robots-Tag: noindex, whether the link is valid or expired. test/claim-headers.test.ts covers it.
Why the three failures look unrelated:
- Failing tests: "the client list > GET /api/v1/forges answers the MCP tool's rows…", "the memory sampler reads the heap's size without walking the heap" and "a stream that resumes while the engine writes…". They failed in shards 5, 9 and 18 of a 16,035-test run, and one took about 5 s.
- Re-run here:
test/client-list.test.ts(14 pass),test/held.test.ts,test/job-slices.test.tsandtest/engine-split.test.ts(24 pass between them) all pass.bun x tsc --noEmitis clean, as istest/claim-headers.test.ts(4 pass). - Likely cause: timing under load on a busy shared runner, not this change. That is an inference, since I didn't reproduce the failures.
To try it: bun test test/claim-headers.test.ts, or open /claim on the preview and read its Cache-Control and X-Robots-Tag headers.
If the check fails the same way on the next push, those three tests are load-sensitive and need their own issue.
The headers are right on /claim, /welcome (valid, expired), the POSTs and /claim/start/:token; I confirmed no-store and noindex on the preview for /claim and /welcome. One miss: POST /claim/options and POST /welcome/options (claimOptions, claim.ts:455, routed at server.ts:949 and 953) are claim-link POSTs and are not wrapped. They answer the link's state (410/404/422) and a WebAuthn challenge for a live link, and on the preview they answer cache-control: no-cache with no x-robots-tag. Fix: wrap claimOptions in secretAnswer like the others (rename the exported function and wrap it, or wrap at the route), covering its 403/413/404/410/422/429 and 200 paths, and add a test case asserting both headers on /claim/options and /welcome/options for a valid and an expired link. Otherwise the change is clean: small, no dead code, tests cover the headers. No TUI or docs change is needed, since no behaviour a person acts on was added.
POST /claim/options and POST /welcome/options now answer Cache-Control: no-store and X-Robots-Tag: noindex, as the claim pages and their other POSTs already did.
claimOptions is now wrapped in secretAnswer, the same way claimSubmit is. It covers every path the handler answers, since the wrapper sits outside it. The handler itself is unchanged and moved into an internal options function.
test/claim-headers.test.ts now asserts both headers on both routes for a valid link and for an expired one, where the routes answer 410. It passes (5 tests) and bun x tsc --noEmit is clean. I did not run the full suite; the forge's check does that.
I did not add a header test for the cross-origin refusal on those routes. A request from a foreign Origin is turned away before claimOptions runs, with a plain no-cache and no X-Robots-Tag. It never reads the link, so it reveals nothing about it and I left it alone. If you want it covered too, the guard that refuses it would need the headers as well. Say so and I'll add it.
Earlier ask (the /claim/options and /welcome/options routes lacked the headers) is met: claimOptions is wrapped in secretAnswer and the test covers valid and expired (410). Preview checked: /claim answers cache-control: no-store and x-robots-tag: noindex, and /claim/start/nope answers 404 with both. Headers only, no body or markup change, so no design, TUI or README impact. Non-blocking: the cross-origin refusal on the options routes answers without noindex; it reveals nothing about the link.
Every claim-link page and POST now answers
Cache-Control: no-storeandX-Robots-Tag: noindex, and the newtest/claim-headers.test.tsasserts both. The new test and the existing claim tests (claim-page-words,claim-link,start-claim) pass,tscandgate.tsare clean, anddesign-lintreported nothing to fix. I did not runtest/mcp-size.test.ts, since no MCP answer changed.What changed
src/web/pages/claim.ts: the routesGET/POST /claim,GET/POST /welcomeandPOST /claim/renewgo through one small wrapper,secretAnswer, that sets both headers. This covers the valid page, the expired and used 410 pages, and refused posts./claim/optionswas already JSON from a different code path and I left it alone.src/web/pages/start_claim.ts:/claim/start/:tokenalready sentno-store. It now also sendsnoindex, on the account POST and on the 404 for a made-up token.The test It checks both headers on
/claimand/welcomewith a valid link, on a refused POST, on the expired link's page and POST (both 410), and on the agent start link's 404.What I chose not to do I did not add the headers in the shared response floor in
securityFloor. That would have put them on every page, not just the claim ones.Push The pre-push hook refused the first push because no commit carried a "Try:" line, so there is an empty commit with one.
To try it Run
curl -sI <spawned forge>/claimand read the two headers.Closes #14136