Public: anyone can read this; the crew can change it.
A wrong link or a removed deal lands on a deal-clock page that says what happened and links back to the clock, not a bare "not found" #72
Check · Review · Land · Live done — Landed and live in production.
A wrong link or a removed deal now shows a deal-clock page headed "Nothing here" instead of the plain text "not found". I ran src/server.test.ts, src/audit.test.ts and src/mcp.test.ts and they pass. The full suite is left to the forge's check, and bun x tsc --noEmit didn't run because the repo has no tsconfig.json.
shipped production is serving it deploy d2eada7
A wrong link or a removed deal now shows a deal-clock page headed "Nothing here" instead of the plain text "not found". I ran src/server.test.ts, src/audit.test.ts and src/mcp.test.ts and they pass. The full suite is left to the forge's check, and bun x tsc --noEmit didn't run because the repo has no tsconfig.json. bun scripts/lint-design.ts printed nothing. The brief says scripts/design-lint.ts, which doesn't exist; the repo's script is scripts/lint-design.ts. I didn't try the page against a running app.
What changed
- New
src/pages/missing.ts:missingPagerenders the 404 in the normal layout, with the header and styles. It says "There is no page at this address." for an unknown path and "This deal is not here; it may have been removed." for a deal. It links "Back to the clock" when signed in, or "Sign in" when signed out. src/routes.ts: a newnotFound(request, url, who)answers an unmatched path with{"error":"not_found"}when the path is/apior under it, or whenacceptincludesapplication/json. Otherwise it returns the HTML page with status 404.src/routes.ts, deal routes: a missing or invalid id on/deals/:id,/deals/:id/timelineand/deals/:id/sheetsnow returns the same deal 404 page. It replaces the old "No such deal" refusal page and the plain-text sheets answer.src/server.ts: the no-route case now callsnotFound. The security headers stay on the response.src/server.test.ts: new tests for an unknown path (HTML, security headers, sign-in link when signed out, "Back to the clock" link when signed in), a removed deal's page, timeline and sheets, a signed-out request for a missing deal, and API andaccept: application/jsonmisses.
Signed-out visitors: for a deal id the existing permission check still answers 401 "sign in" before any existence check. A signed-out visitor gets the same answer for an id that exists and one that doesn't. The test asserts this.
Not done: /deals/:id/ics, /openapi.json, /static/* and the security.txt redirect still answer plain-text 404s, because the issue named only pages, timeline and sheet. The clock's sheet fetcher falls back to opening the deal page when the fragment request fails, so a stale tap now ends on the new page.
I changed no contract.json permission.
Clean. Unknown paths and removed deals get the in-frame 404 page with security headers. API and accept:json misses stay JSON. Signed-out visitors get the same 401 for any deal id. Output is static or escaped, no contract cell changed, and the tests cover each case.
A wrong link or a removed deal now shows a deal-clock page headed "Nothing here" instead of the plain text "not found". I ran
src/server.test.ts,src/audit.test.tsandsrc/mcp.test.tsand they pass. The full suite is left to the forge's check, andbun x tsc --noEmitdidn't run because the repo has notsconfig.json.bun scripts/lint-design.tsprinted nothing. The brief saysscripts/design-lint.ts, which doesn't exist; the repo's script isscripts/lint-design.ts. I didn't try the page against a running app.What changed
src/pages/missing.ts:missingPagerenders the 404 in the normal layout, with the header and styles. It says "There is no page at this address." for an unknown path and "This deal is not here; it may have been removed." for a deal. It links "Back to the clock" when signed in, or "Sign in" when signed out.src/routes.ts: a newnotFound(request, url, who)answers an unmatched path with{"error":"not_found"}when the path is/apior under it, or whenacceptincludesapplication/json. Otherwise it returns the HTML page with status 404.src/routes.ts, deal routes: a missing or invalid id on/deals/:id,/deals/:id/timelineand/deals/:id/sheetsnow returns the same deal 404 page. It replaces the old "No such deal" refusal page and the plain-text sheets answer.src/server.ts: the no-route case now callsnotFound. The security headers stay on the response.src/server.test.ts: new tests for an unknown path (HTML, security headers, sign-in link when signed out, "Back to the clock" link when signed in), a removed deal's page, timeline and sheets, a signed-out request for a missing deal, and API andaccept: application/jsonmisses.Signed-out visitors: for a deal id the existing permission check still answers 401 "sign in" before any existence check. A signed-out visitor gets the same answer for an id that exists and one that doesn't. The test asserts this.
Not done:
/deals/:id/ics,/openapi.json,/static/*and the security.txt redirect still answer plain-text 404s, because the issue named only pages, timeline and sheet. The clock's sheet fetcher falls back to opening the deal page when the fragment request fails, so a stale tap now ends on the new page.I changed no
contract.jsonpermission.Closes #69