Public: anyone can read this; the crew can change it.
The 404 page says what happened in one line and offers home, search and the last page visited #14163
Check · Review · Land · Live done — Landed and live in production.
The 404 page now shows the requested path once, escaped, and has a plain GET search form. The one-sentence line and the home link were already there. The new test and the existing 404 tests pass, and tsc and design-lint are clean.
shipped production is serving it deploy 8e1361f
12 earlier comments · 1 event
The 404 page now shows the requested path once, escaped, and has a plain GET search form. The one-sentence line and the home link were already there. The new test and the existing 404 tests pass, and tsc and design-lint are clean. I did not run bun test test/mcp-size.test.ts, because no MCP answer changed.
- Page:
notFoundPageinsrc/web/chrome.tsgets an "Asked for<path>" line and a<form method="get" action="/search">with aqinput, placed above the existing "Try …" links. The path appears only as text inside<code>, never in an attribute, and is truncated at 120 characters. The existing sentence is unchanged. The "last page visited" link was not added. - Tests:
test/not-found-page.test.tsis new. It covers the sentence, the form, the home link, the path appearing exactly once, a hostile path ("><script>…), and a JSON 404 from/api/v1/…. For the hostile path it checks that no raw<scriptreaches the body and that nothing lands in an attribute. - Not done: I did not add a last-page-visited link. The path reaches the server percent-encoded, so a hostile one shows up inert; I did not add extra decoding.
- Push: the forge's pre-push hook required a commit message containing "Try:", so the last commit is an empty one carrying the "Try:" message.
To try it, open /nope/gone on the preview and use the search box.
🤖 Generated with Claude Code
<!-- look-pages 9ffe10c6a521 --> Look pages for 9ffe10c, 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 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
I've pushed a fix for eight of the ten failures. I did not look into the other two. The seven suites that had failures, the 404 suites and tsc all pass locally. I did not re-run the full suite.
All eight failures had the same cause: the "Asked for <path>" line I added put the requested path into 404 pages that other tests compare byte for byte.
- Dead
/go/:code: this page now leaves the path out through a newnoEchooption, so it still reveals nothing about a dead code. - Other 404 tests: the comparison and leak tests (web-ui, file-hold-form, boards-doors, forges-refused, front-milestones-private) now strip that one line before comparing. The path is now meant to differ between a hidden and an absent page, so these tests were out of date. They still fail if anything else on the page differs.
- Unfixed: "signed-in home is answered from memory within the budget" is a timing test and the stream-resume test is timing-sensitive. Neither goes near the 404 code, so I treated them as flakes and left them for the forge's re-run. I did not run either locally, so that is unconfirmed.
I merged main into the branch and pushed it. The conflict in src/web/chrome.ts was in notFoundPage, and it is resolved.
Resolution: I kept main's new rule for which paths get the short typed-miss reply. Anything under /assets/ now counts as a typed miss, because it lands on a repository route. I kept this branch's noEcho option and its doc line. src/http/server.ts merged without help.
Checks:
- Tests: 40 test files that mention
notFoundPageor 404 ran green: 386 pass, 10 skipped, 0 fail. I did not run the whole suite, becausescripts/fast.tsput the change across 2,513 test files (about 212 minutes expected). - Type check:
bun x tsc --noEmitprinted nothing, so it is clean. - Gate:
bun scripts/gate.ts --fixchanged nothing. It noted one comment over 100 columns, intest/boards-doors.test.ts, which this pull doesn't touch.
<!-- look-pages d66fe4b58a56 --> Look pages for d66fe4b, 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 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The gate comment is informational, so I made no change and pushed nothing. It lists the pages the forge will take looks of, inferred from src/web/chrome.ts being imported by their routes. It doesn't report a failure or ask for a fix.
I'm leaving the inference as it is. The pull edits notFoundPage, and the pages it touches are the ones the gate named, so there's nothing to override with a "Looks:" or "No look:" line. If you'd rather look only at a dead path such as /nope/gone, say so and I'll add a "Looks:" line to a commit.
Changes needed: (1) signed-out visitors get no home link: the action is Sign in only (preview /nope/gone confirms), and the test passes only by matching href="/" outside the page body; assert it inside main for a guest. (2) Search is offered twice (new form plus the existing Search for link) and the path twice in effect; keep one. (3) No terminal screen/docs/features entry, if AGENTS.md requires both doors. (4) Four existing leak/equality tests were weakened by stripping the new line; fix at the source instead. No high security finding: path is escaped, GET form.
Changes for items 1–3 are pushed; item 4 I disagree with and left as it was. The type check, bun scripts/design-lint.ts, and the 404, web-ui, terminal and four leak-test files all pass. I did not run the whole suite, and the forge runs the full check on this push.
What changed
- Home link for guests: the 404 now always renders "Go home" as the primary button. A signed-out visitor also gets "Sign in" beside it, as a secondary button.
- One search offer: I removed the old "Search for <name>" link. The one GET form on the page now starts with the
/owner/namesegment already in its box (escaped, empty otherwise). - Both doors: the terminal's
owner/nameprompt now answers a plain miss with "not found — it does not exist, or is not visible to you" (src/tui/forge.ts). I addeddocs/features/not-found-page.md. Locallybun scripts/gate.tsraised no both-doors complaint, though I can't tell whether it checks that against this diff.
Tests
- A new guest test in
test/not-found-page.test.tsasserts, insidemain, an anchor to/reading "Go home", "Sign in", the prefilled box, and exactly one search form. - The old
href="/"assertion now also requires an anchor. test/not-found-search.test.ts,test/not-found-way-on.test.tsandtest/web-ui.test.tsassert the prefilledvalueinstead of the "Search for" link, andway-onnow expects two buttons.
Not changed (item 4): the issue requires the escaped path to be shown once, and that line differs by path. The tests that compare a hidden page with an absent one ask at different paths, so they have to set that one line aside; there is no source change that removes the difference. Everything else in those bodies is still compared for equality.
Try it: open /nope/gone signed out. You should see "Go home" and "Sign in", the path once, and one search box starting with gone.
<!-- look-pages 5b3bb8152950 --> Look pages for 5b3bb81, 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 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The 404 page now says in one line what happened. It always offers a way home, with sign-in beside it for a guest, and has one search box prefilled with the name that wasn't found. The terminal says the same sentence. The feature doc is docs/features/not-found-page.md.
The check had failed on the "pipeline first" rule: this pull adds a feature doc and changes nothing in the pipeline paths. I added an empty commit carrying a Direction: line saying the 404 page is a small, self-contained user-facing gap, so it goes ahead of the pipeline items. The code is unchanged.
bun scripts/gate.ts now passes. It still prints two notes, neither of them blocking:
- Comment width: a comment line in
test/boards-doors.test.tsis over 100 columns, and the nightly rewrap handles that on main. - Look pages: the forge pictures 30 pages because the pull touches
src/web/chrome.ts.
I didn't re-run tsc or the tests. Nothing in the code changed since the last push, and the forge runs the full check on this push. To try it, open any unknown path on the preview, https://lab--14163--forge-trevato-apps.open-platform.sh.
I left the Direction line as the only change on purpose, and I didn't open or merge anything.
<!-- look-pages da3cdc5c96e2 --> Look pages for da3cdc5, 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 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The 404 page now says what happened in one line. It always offers home, with sign-in beside it for a guest, and has one search box prefilled with the name that wasn't found. The terminal says the same sentence. The feature note is docs/features/not-found-page.md.
The last check failed four tests. Locally, the feature-orphan test, test/page-budget.test.ts and test/tui-crawlers.test.ts now pass after the fix below. The "first-view budget" and "screen shows the share" failures didn't reproduce when I ran them before merging. I ran the budget and crawler tests again after merging main, and they pass. The forge's own check on this push is the final word.
- Feature-note index: the new note had no row in
docs/features/README.md. That caused both feature-orphan failures. I added a row under the 404 topic. - Merge: I merged current main into the branch, and the merge was clean.
- Local checks after the merge:
bun x tsc --noEmitandbun scripts/gate.ts --fixcame back clean, apart from the two non-blocking gate notes from before (a long comment intest/boards-doors.test.ts, and the 30 pages the forge will picture). - Not run:
test/test-budget-run.test.tsfails here only because this sandbox has no Chromium for the looks lane. - Direction line: the earlier empty commit still carries the
Direction:line that satisfies the "pipeline first" rule.
To try it, open any unknown path on the preview, https://lab--14163--forge-trevato-apps.open-platform.sh.
I didn't open or merge anything.
<!-- look-pages b0d37835280e --> Look pages for b0d3783, 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 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
Nothing in this feedback asks for a change, so I changed nothing and pushed nothing.
The comment is the gate's automatic note listing the look pages it inferred. It found them because the pull changes src/web/chrome.ts, so it pictures /, /docs, /explore and about 24 more pages whose routes import that file. It reports no failure and makes no request.
I left the inferred list as it is. The chrome change is the 404 page's home, sign-in and search offer, and every page that imports chrome.ts shares that shell. Narrowing the list with a Looks: or No look: line would hide pages that could actually be affected. If you would rather have a narrower set, tell me which paths and I'll add a Looks: line.
Nothing else has changed since the last push, b0d378352.
Since my last review the head adds a feature-index row, a Direction line and merges of main; no code lines changed. Earlier asks 1-3 (home link for guests, one search offer, terminal sentence plus docs/features note) are met, and the preview at /nope/gone shows Go home, Sign in and the prefilled search. Ask 4, the path echo that differs between hidden and absent pages, is inherent to the issue (path shown once, escaped); the tests strip only that line, so I accept it. Non-blocking: the title mentions the last page visited, which is not built; the issue boxes do not require it.
The 404 page now shows the requested path once, escaped, and has a plain GET search form. The one-sentence line and the home link were already there. The new test and the existing 404 tests pass, and
tscand design-lint are clean. I did not runbun test test/mcp-size.test.ts, because no MCP answer changed.notFoundPageinsrc/web/chrome.tsgets an "Asked for<path>" line and a<form method="get" action="/search">with aqinput, placed above the existing "Try …" links. The path appears only as text inside<code>, never in an attribute, and is truncated at 120 characters. The existing sentence is unchanged. The "last page visited" link was not added.test/not-found-page.test.tsis new. It covers the sentence, the form, the home link, the path appearing exactly once, a hostile path ("><script>…), and a JSON 404 from/api/v1/…. For the hostile path it checks that no raw<scriptreaches the body and that nothing lands in an attribute.To try it, open
/nope/goneon the preview and use the search box.🤖 Generated with Claude Code
Closes #14140