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

small: the 404 page for a signed-out visitor offers home and search as its two links, with before and after looks #16006

Merged opened this

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

Merged

A signed-out visitor's 404 is now one sentence, "That page is not here.", with two links: Home (/) and Search (/search). The screenshots the issue asks for are not on this pull: I couldn't take them in this sandbox. bun scripts/design-lint.ts passes.

Notes

shipped production is serving it deploy 3fede26

opened this

A signed-out visitor's 404 is now one sentence, "That page is not here.", with two links: Home (/) and Search (/search). The screenshots the issue asks for are not on this pull: I couldn't take them in this sandbox. bun scripts/design-lint.ts passes.

  • What's gone for them: the echoed path, the Sign in button, the search form, "Did you mean", and the request-id disclosure. The id still comes back in the x-request-id header. Because the path is no longer echoed, a private page and a missing one now read identically.
  • Who sees it: the signed-out 404 is built in notFoundPage in src/web/chrome.ts, with a signedOut option for the no-route fallback. That fallback in src/http/server.ts reads no session, by design. It now counts a request as signed out when it carries no forge_session cookie, Authorization header, x-forge-identity header, or edge identity, which costs no database read. Anyone else, including a signed-in person, keeps the full 404 with the search form and suggestions.
  • Tests: I rewrote the existing 404 tests that asserted the old signed-out page in not-found-page, not-found-search, not-found-way-on, web and web-ui, because they were testing the behaviour this issue replaces. Signed-in variants keep the old coverage. A new test checks that the signed-out page has exactly the links / and /search, no form, no Sign in, no path, answers in under 50 ms, and carries the security headers.
  • What I ran: tsc is clean, and the tests that mention the 404 page pass. scripts/fast.ts named about 2,800 test files, so I did not run the full suite; the forge's check does.
  • What I left out: screenshots at 390 and 1280 px, light and dark, before and after. Please take them from the preview.
  • Push hook: the repo's pre-push check wanted a "how to try it" commit. I added an empty Try: commit for it.
[
  {"go": "/no-such-page (signed out)", "look": "the page body", "expect": "One sentence, 'That page is not here.', and two buttons: Home and Search. There is no path echo, no Sign in and no search form."},
  {"go": "Click Search", "look": "the address", "expect": "It lands on /search."},
  {"go": "/no-such-page (signed in)", "look": "the page body", "expect": "The fuller 404 is unchanged: search form, suggestions and the request id."},
  {"go": "/alice/some-private-repo (signed out)", "look": "compare with /alice/nothere", "expect": "The two pages are identical."}
]

🤖 Generated with Claude Code

Closes #15978

19 earlier comments · 3 events
commented

A signed-out visitor's 404 is now one sentence, "That page is not here.", with two links: Home (/) and Search (/search). The screenshots the issue asks for are not on this pull: I couldn't take them in this sandbox. bun scripts/design-lint.ts passes.

  • What's gone for them: the echoed path, the Sign in button, the search form, "Did you mean", and the request-id disclosure. The id still comes back in the x-request-id header. Because the path is no longer echoed, a private page and a missing one now read identically.
  • Who sees it: the signed-out 404 is built in notFoundPage in src/web/chrome.ts, with a signedOut option for the no-route fallback. That fallback in src/http/server.ts reads no session, by design. It now counts a request as signed out when it carries no forge_session cookie, Authorization header, x-forge-identity header, or edge identity, which costs no database read. Anyone else, including a signed-in person, keeps the full 404 with the search form and suggestions.
  • Tests: I rewrote the existing 404 tests that asserted the old signed-out page in not-found-page, not-found-search, not-found-way-on, web and web-ui, because they were testing the behaviour this issue replaces. Signed-in variants keep the old coverage. A new test checks that the signed-out page has exactly the links / and /search, no form, no Sign in, no path, answers in under 50 ms, and carries the security headers.
  • What I ran: tsc is clean, and the tests that mention the 404 page pass. scripts/fast.ts named about 2,800 test files, so I did not run the full suite; the forge's check does.
  • What I left out: screenshots at 390 and 1280 px, light and dark, before and after. Please take them from the preview.
  • Push hook: the repo's pre-push check wanted a "how to try it" commit. I added an empty Try: commit for it.
[
  {"go": "/no-such-page (signed out)", "look": "the page body", "expect": "One sentence, 'That page is not here.', and two buttons: Home and Search. There is no path echo, no Sign in and no search form."},
  {"go": "Click Search", "look": "the address", "expect": "It lands on /search."},
  {"go": "/no-such-page (signed in)", "look": "the page body", "expect": "The fuller 404 is unchanged: search form, suggestions and the request id."},
  {"go": "/alice/some-private-repo (signed out)", "look": "compare with /alice/nothere", "expect": "The two pages are identical."}
]

🤖 Generated with Claude Code

Changes requested — before the latest push

The behaviour works in the preview: one sentence, two links (/ and /search), no path echo, and a private page reads the same as a missing one. Two things block it.

  1. (Fix first.) The issue's box 3 asks for before and after screenshots at 390 and 1280 px, light and dark. They are not on the pull. Add them, or attach the preview looks.
  2. Principle 1 breaks: the page says it twice. See the comment on chrome.ts.

Smaller items:

  • The wall-clock < 50 ms assertion around a fetch in the test can flake. Assert the cheap path instead, for example that the response needs no database read, or loosen the bound.
  • A stray ; line is left in test/not-found-way-on.test.ts, where the .replace(...) was removed. Tidy it.
  • The empty Try: commit adds nothing. Keep the how-to in the description.

No security finding: the signed-out check reads only credential presence and trusts no client value.

commented

A signed-out visitor to a missing or private page now gets one sentence and two links. The sentence is the heading, "That page is not here.", and the links are Home (/) and Search (/search). The page carries no path echo, no sign-in and no request id in the body, and the id stays in the x-request-id header. A private page reads the same as a missing one.

The before and after screenshots at 390 and 1280 px, light and dark, are still missing. This sandbox can't take screenshots, so I couldn't produce them. The preview shows the after state; a reviewer needs to capture the before from main (https://lab--forge-trevato-apps.open-platform.sh/no-such-page).

Changed since review

  • Said once: the old <h1>Nothing here</h1> and the muted "That page is not here." paragraph are gone. The change is in src/web/chrome.ts.
  • Flaky timing bound: I dropped the wall-clock < 50 ms assertion from the fetch test. In its place the test asserts the body is under 3,000 bytes, alongside the existing checks that the page has no form and exactly two links.
  • Stray ;: it's removed from test/not-found-way-on.test.ts.
  • Empty Try: commit: it stays in the branch history, since I can't rewrite a pushed branch. The how-to below replaces it.

tsc is clean, both not-found test files pass (10 tests), and design-lint is clean. I didn't run scripts/gate.ts.

Left out: no sign-in link on this page, as the issue asks.

Try it: open /no-such-page or /alice/secret signed out, and you should see one sentence with Home and Search.

🤖 Generated with Claude Code

commented

<!-- look-pages 09006805e327 --> Look pages for 0900680, from the gate:

  • look pages (inferred): this pull changes src/web/chrome.ts; the forge pictures / (src/web/chrome.ts), /docs (src/web/chrome.ts), /explore (src/web/chrome.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

I pushed a commit that narrows the look pages to the one page this change alters, /no-such-page.

The gate had inferred 31 pages, /, /docs, /explore and the rest, because their routes import src/web/chrome.ts. The only code I changed there is the signed-out 404 branch of notFoundPage, so the other pages render as before. The commit message carries the override line Looks: /no-such-page. It is an empty commit, since only the message was needed. The earlier review asked me to drop the empty Try: commit, but this one has a purpose.

No code or tests changed since the last push. I didn't re-run tsc or the tests, and the previous run was green.

The before and after screenshots at 390 and 1280 px, light and dark, are still not attached. I can't take screenshots in this sandbox. The gate's look on /no-such-page should supply the after. The before can be captured from main at https://lab--forge-trevato-apps.open-platform.sh/no-such-page.

Try it: open /no-such-page or /alice/secret signed out. You should see one sentence, "That page is not here.", with Home and Search.

🤖 Generated with Claude Code

commented

Declined: I fixed the failing check, but I can't push the fix. Git rejects every push of this branch. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m8532y59phfm55bbt4y3s0gq Left open: someone has spoken on this pull.

commented

<!-- look-pages 54841ac620fa --> Look pages for 54841ac, from the gate:

  • look pages (inferred): "Looks: /no-such-page" is not a page of app.looks in forge.json; this pull changes src/web/chrome.ts; the forge pictures / (src/web/chrome.ts), /docs (src/web/chrome.ts), /explore (src/web/chrome.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

A signed-out visitor who hits a missing or private page now sees one sentence, "That page is not here.", with two links: Home (/) and Search (/search). The page has no path echo, no Sign in, no search form and no request id in the body. The id still comes back in the x-request-id header. A private page reads the same as a missing one.

Latest feedback: the gate said Looks: /no-such-page is not one of the pages in app.looks in forge.json, so it fell back to inferring 31 pages. I pushed an empty commit with Looks: /nope/nothing instead. That path is already in app.looks and is a signed-out 404 that the new page handles. I didn't add /no-such-page to forge.json, because /nope/nothing already covers it.

Earlier review points: the sentence is now the heading, so it is said once. The wall-clock bound in the test is gone, and the stray ; is removed. I made no code or test changes this round, and I didn't re-run tsc or the tests; the last run was green.

Who gets it: the no-route fallback in src/http/server.ts treats a request as signed out when it carries no forge_session cookie, Authorization header, x-forge-identity header or edge identity, so it costs no database read. Anyone else, including a signed-in person, keeps the full 404 with the search form and suggestions. The page itself is built in notFoundPage in src/web/chrome.ts.

Left out:

  • Screenshots: the before and after screenshots at 390 and 1280 px, light and dark, are still not attached. I can't take them in this sandbox. The gate's look of /nope/nothing should give the after, and the before can be captured from main at /nope/nothing.
  • Sign-in link: none on this page, as the issue asks.
  • Empty Try: commit: it stays in the history, since I can't rewrite a pushed branch.

Try it: open /nope/nothing, /no-such-page or /alice/secret signed out. You should see the one sentence with Home and Search.

[
  {"go": "/nope/nothing (signed out)", "look": "the page body", "expect": "One sentence, 'That page is not here.', as the heading, and two links: Home and Search. No path echo, no Sign in, no search form."},
  {"go": "Click Search", "look": "the address", "expect": "It lands on /search."},
  {"go": "/nope/nothing (signed in)", "look": "the page body", "expect": "The fuller 404 is unchanged: search form, suggestions and the request id."}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 4c3d2e8d724b --> Look pages for 4c3d2e8, from the gate:

  • look pages (named): this pull changes src/web/chrome.ts; a commit names /nope/nothing
commented

The gate's comment on 4c3d2e8 is a status note, not a request. It reports look pages (named): … a commit names /nope/nothing, so the override I pushed last round now works. I changed nothing and pushed nothing this round.

A signed-out visitor to a missing or private page sees one sentence, "That page is not here.", as the heading, with two links: Home (/) and Search (/search). The page has no path echo, no Sign in, no search form and no request id in the body. The id still comes back in the x-request-id header. A private page reads the same as a missing one. Signed-in people keep the full 404 with the search form and suggestions. The no-route fallback in src/http/server.ts decides this from the request's credentials alone, with no database read. The page is built in notFoundPage in src/web/chrome.ts.

I didn't re-run tsc or the tests this round, because nothing changed. The last run was green, and the forge's check runs the full suite on push.

Left out:

  • Screenshots: the before and after screenshots at 390 and 1280 px, light and dark, are not attached, because I can't take them in this sandbox. The gate's look of /nope/nothing should give the after. The before can be captured from main at /nope/nothing.
  • Sign-in link: none on this page, as the issue asks.
  • Empty commits: the empty Try: and Looks: commits stay in the history, since I can't rewrite a pushed branch.

Try it: open /nope/nothing or /no-such-page signed out. You should see the one sentence with Home and Search.

[
  {"go": "/nope/nothing (signed out)", "look": "the page body", "expect": "One sentence, 'That page is not here.', as the heading, and two links: Home and Search. No path echo, no Sign in, no search form."},
  {"go": "Click Search", "look": "the address", "expect": "It lands on /search."},
  {"go": "/nope/nothing (signed in)", "look": "the page body", "expect": "The fuller 404 is unchanged: search form, suggestions and the request id."}
]

🤖 Generated with Claude Code

commented

Still red on current main: apps, runs and the crew on the web > the app page says in a sentence that production is not running, and what to do. Fix it and push.

commented

The failing 404 tests are fixed and pushed. They were still asserting the old signed-out page. I didn't re-run the full suite.

  • 404 page tests: test/web.test.ts (3 tests) and test/docs-not-found.test.ts (2 tests) looked for "Nothing here". They now look for "That page is not here.".
  • test/near-pages.test.ts: its "Did you mean" check ran signed out. Suggestions are now a signed-in feature, so the test creates a user and session and sends the cookie. A signed-out request to /explroe must show no "Did you mean". The far-path and escaping checks also run signed in.
  • Not touched: two failures in the check log are in tests I didn't change.
    • web-apps.test.ts: "the app page says in a sentence that production is not running" passes when I run that file here, so I'm treating it as flaky.
    • crew-review-stall.test.ts: its stalled-review test didn't touch the 404 page, and I didn't run it.
    • If either fails again on the forge, it's unrelated to this change.
  • Checks run: tsc is clean. test/web.test.ts, test/near-pages.test.ts and test/docs-not-found.test.ts pass (52 tests), and test/web-apps.test.ts also passed. scripts/gate.ts --fix found nothing to change; it noted one comment line over 100 columns in test/web.test.ts, which the nightly rewrap handles.

The page itself is unchanged from the last round. A signed-out visitor to a missing or private page sees "That page is not here." with Home and Search. Signed-in people keep the full 404. The before and after screenshots are still not attached, because I can't take them in this sandbox.

Try it: open /nope/nothing signed out. You should see the sentence and two links.

[
  {"go": "/nope/nothing (signed out)", "look": "the page body", "expect": "One sentence, 'That page is not here.', as the heading, and two links: Home and Search. No path echo, no Sign in, no search form."},
  {"go": "/explroe (signed in)", "look": "the page body", "expect": "The full 404 with the search form and 'Did you mean /explore?'."}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 157962a0116f --> Look pages for 157962a, from the gate:

  • look pages (named): this pull changes src/web/chrome.ts; a commit names /nope/nothing
commented

The gate's comment is informational. It reports that the look pages are named (/nope/nothing) and flags nothing for me to fix. The branch is clean and already pushed, so there's nothing new to commit.

The pull is unchanged: a signed-out visitor's 404 is one sentence, "That page is not here.", with two links, Home (/) and Search (/search). It's built in notFoundPage in src/web/chrome.ts, and the no-route fallback in src/http/server.ts decides who counts as signed out. A signed-in person keeps the full 404.

  • Look pages: the "after" picture is /nope/nothing, which was already one of app.looks. The only page this change alters is the signed-out 404.
  • Screenshots: none are attached. I couldn't take them in this sandbox.
  • Checks: I ran nothing new on this turn.

Review block:

[
  {"go": "/no-such-page (signed out)", "look": "one sentence, 'That page is not here.', and two links", "expect": "Home goes to / and Search goes to /search; no echoed path, no Sign in button, no search form"},
  {"go": "/no-such-page (signed in)", "look": "the full 404", "expect": "search form and near-page suggestions still show"}
]
commented

Still red on current main: asking again over HTTP > a writer queues a check and gets the run. Fix it and push.

commented

I changed nothing, so there is nothing to push. The three failures are not caused by this pull.

  • test/web-apps.test.ts, "production is not running": it fails here too, and the check log says it is red on main at 829e08a with the same test. The failing text is the app strip ("Failed to start. Deploy main to try again."), which this pull doesn't touch.
  • test/pull-check-again.test.ts ("a writer queues a check", delete_failed) and test/render-csv.test.ts ("five million cells are counted fast"): both pass here, 50 of 50 together and again alongside web-apps. The check log did call them green on main. The first is a file-deletion error and the second a speed bound, and both ran in the same busy shard as the web-apps failure, so I read them as load flakes. My change doesn't reach either: it only touches the signed-out 404 in src/web/chrome.ts and src/http/server.ts.

I only ran those three files here, not the full suite. A re-run of the check should clear the two flakes. The web-apps failure will stay red until someone fixes it on main.

commented

Still red on current main: asking again over HTTP > a writer queues a check and gets the run. Fix it and push.

commented

I made no code fix this time. I merged current main (85 commits ahead) into the branch and pushed it (cc2fb5899), so the check reruns on a fresh base.

After the merge, tsc was clean and gate.ts --fix changed nothing. I ran the 404 tests, web.test.ts, web-ui.test.ts, pull-check-again.test.ts and render-csv.test.ts. Everything passed except the web-apps test below. scripts/fast.ts named 2,879 files, so I picked those files by hand instead.

  • render-csv "five million cells are counted fast": the bound is 250 ms and it took 271 ms in the shard. The test measures wall-clock time under a loaded shard, and it passes when run alone. I didn't loosen the bound.
  • pull-check-again "a writer queues a check" (delete_failed): this passes here and the forge's own check calls it green on main. The failure came from deleting files in a busy shard, and nothing in this pull touches repo deletion.
  • web-apps "production is not running": this test is red on main at 829e08a too, and the forge's check did not count it against this pull. It still fails here after the merge. It stops production and expects the app strip to read "Not running", but it read "Failed to start". Production can't start in this sandbox, which can't bind sockets. The diff doesn't touch app status.

If the check still fails after this push on the first two, I'd treat it as a flaky shard rather than something in this pull. The web-apps test needs a fix on main.

commented

<!-- look-pages cc2fb58996a1 --> Look pages for cc2fb58, from the gate:

  • look pages (named): this pull changes src/web/chrome.ts; a commit names /nope/nothing
commented

The gate's comment is informational again. It says the look pages are named (/nope/nothing) and asks for no change, so I changed nothing and pushed nothing.

The background task notification is from my earlier broad test run, which I had already abandoned. It shows no results.

The branch is at cc2fb5899, which is main merged into the pull. The pull is unchanged:

  • 404 page: a signed-out visitor's 404 is one sentence, "That page is not here.", with two links: Home (/) and Search (/search). A signed-in person keeps the full 404.
  • Look page: the "after" picture is /nope/nothing.
  • Check status: I haven't seen a verdict for this push. The web-apps "production is not running" test fails on main and failed again here after the merge. The other two earlier failures looked like flakes.
Approved

Signed-out 404 verified on the preview: 404, one h1 sentence, exactly Home and Search links, no path echo, security headers present, app;dur=9.4ms. Signed-out detection reads no DB (no cookie/authorization/identity/edge identity), so no leak and no new write path. Earlier asks (sentence said once, flaky timing bound removed, stray semicolon) are met; tests updated and signed-in coverage kept. Non-blocking: the before/after screenshots at 390/1280 light and dark are not attached to the pull; the gate looks of /nope/nothing give the after, the before needs capturing from main.

commented

Left #15978 open: 1 unticked item remain (before and after screenshots at 390 and 1280 px, light and dark, on the pull; bun scripts/design-lint.ts passes).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs