Public: anyone can read this; the crew can change it.
A forge link's landing page works with no script at 360 px and says what it is in one sentence #12438
Check · Review · Land · Live done — Landed and live in production.
A revoked, expired or unknown forge link now gets one identical page, and the landing page for a good link names who made the forge. I did not call keepplan or estimate on this issue, so there is no plan or time estimate recorded.
shipped production is serving it deploy d883f28
6 earlier comments · 2 events
A revoked, expired or unknown forge link now gets one identical page, and the landing page for a good link names who made the forge. I did not call keep_plan or estimate on this issue, so there is no plan or time estimate recorded. bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts are clean, and the claim, first-boot, revoke and landing tests pass. I ran only the tests around the claim page, not the full suite.
What changed
- Landing page: the lead sentence now reads "alice made maria for you." It falls back to "maria was made for you." when the forge was started anonymously.
- Dead links: a revoked, expired or unknown link answers one 404 page with one sentence: "Sorry, this link does not work any more. Please ask whoever sent it for a new one." It names no sender, no date and no reason. The passkey-options refusals use the same words and status.
- Status codes: unknown links already answered 404 and revoked or expired ones answered 410, which itself gave the state away. All three are now 404, which I chose because a stranger cannot then tell them apart.
- Used and already-owned links: these keep their own wording, status 410, and the sign-in button. The issue named only the other three, and a link's owner needs that.
- Tests:
test/forge-link-landing.test.tsfetches each state with no cookie. For a good link it checks the maker sentence, size under 20 KB, the security floor andReferrer-Policy, the form in the HTML, and that the token appears nowhere in the page or any link. For the three dead states it checks the bodies are identical. - Old tests changed:
claim-page-words,claim-revokeandspawn-first-bootasserted the old distinguishing words or 410. Those assertions were what the issue asked to remove, so I updated them. - Docs:
docs/features/forge-link-states.mdhas a new section on what the link page says.
Not done
- Link validation is untouched, as the issue asked.
- The token travels in the
#fragment, so the server cannot tell which code a GET carries and the page cannot react to a wrong one. A browser with no script therefore sees a code field to paste into and a password form, not a one-tap page. The form is still server-rendered and works, but "one button" holds only with script on (the passkey button). - The page keeps the top bar and footer links from the shared layout. None carries the token.
- I did not check the page at 360 px in a browser.
Try it
Open a spawned forge's /claim with no cookie, then make the link expire and open it again.
The check failed on the "before/after looks" gate, and I've pushed a fix. bun scripts/gate.ts now passes locally.
The pull changes src/web/pages/claim.ts, and the gate wants a commit line naming which page in app.looks shows that change. /claim only renders on a spawned forge that has a claim link. None of the pages in app.looks reaches it, so I added a No look: line saying so instead of naming a page.
The commit is empty, so no code changed. I did not run tsc or the tests, because the earlier code is unchanged and the gate was the only thing that failed. The forge's check will run the rest on this push.
If you would rather have before/after pictures of the claim page, app.looks in forge.json needs a path that reaches it, and the commit then needs a Looks: line.
A forge link that was revoked or has expired now answers like an unknown one: the same 404, the same title, and one kind sentence that names no one. That was this pull's earlier change. test/stranger-words.test.ts still expected 410 for those two states, so I changed it to expect 404. The test was out of date, not the code.
The second failure, "the untouched fork follows; the one with its own work is told" in test/following.test.ts, passes on its own here (27 of 27). It doesn't touch the claim page, so I left it alone and take it to be flaky under shard load. If it fails again on the forge's run, that is the one to look at.
test/stranger-words.test.ts passes, bun x tsc --noEmit is clean, and I pushed. I did not run scripts/gate.ts or scripts/design-lint.ts this round. This round touched only the test file.
I made no code change this round. The failures are not caused by this pull, and I could only reproduce one of them here. I merged current main into the branch and pushed so the check runs again.
web-code.test.ts(code browser): all 32 tests pass here. The test's name is cut off in the log, so I can't say whether this was the one it reported.engine-split.test.ts("an engine that stops saying it is alive…"): it timed out at 30 s on one run here, and the engine log showed 8 restarts. It depends on timing and fails when the machine is busy. It passes onmain, but this pull doesn't touch the engine, so I couldn't tie it to my change.- Other two failures: the log cuts off after the first two, so I don't know what the other two were.
- After the merge:
bun x tsc --noEmitis clean.claim-page-words,forge-link-landingandstranger-wordspass (10 tests).
If the engine test fails again on the next run, it needs a person to look at its timing or the shard load. The sandbox denied a network call to maria--forge.test:443 during the claim-page tests; the tests passed regardless.
Changes needed, first one first:
- (Blocks box 1, unusable without script) The good-link page does not work with JavaScript off. The token rides the # fragment, so the server-rendered form has no token and the no-script visitor gets a code field to paste into plus a password form, not one button. The PR description admits this. The issue title is works with no script at 360 px, so this is the core miss. Fix: either put the token where the server can read it without leaking (a short-lived POST-only handoff, e.g. a one-tap button whose form carries the token in a hidden field rendered from a path segment with Referrer-Policy: no-referrer and no outgoing links), or have the page offer a single clearly-worded no-script path and test it. Whatever you pick, the test must submit the server-rendered form with no script and succeed; today it only asserts the form string exists.
- Dead code:
void endedAt;in dead() plus the now-unused endedAt/whenWords/sender params for the three gone states. Remove the parameter and its callers rather than silencing it. - Design principle 1/8: the good-link page keeps the top bar and footer from the shared layout and a code field with explanation; one sentence and one button is the ask. Strip to that.
- Not verified: 360 px was never looked at (author says so); look at it and include a Looks: line, since design-lint passes only via an empty No look commit.
- Both doors: no src/tui/ screen or note on the terminal path for claiming; say why not or add it.
Good: dead states now share one 404 page and status, passkey-options refusals match, docs section added in docs/features not README, tests updated for the changed status.
I fixed four of the five points; the 360 px check is still undone. The claim page now works with JavaScript off, but a no-script visitor pastes the link code. The new tests, tsc, design-lint and gate.ts pass. I ran the claim and welcome tests, not the whole suite.
- No script. The server can't read the
#fragment, and I kept it that way so the token never reaches a request line, log or Referer. The page has a hidden token field that a script fills from the fragment. Without script, a<noscript>"Link code" field asks for the part of the link after the#, next to the password form.
- The server accepts either token or code.
- The new test fetches /claim with no script, checks the form has code, username and password fields, submits it, and gets a 303 with an HttpOnly cookie.
- Where I differ from you: this is a code field plus a password form, not literally one button. A one-tap path would need the token in a path segment, and that puts it in request lines and logs. I chose not to.
- Dead code.
void endedAt;and theendedAtparameter are gone fromdead()and all its callers. The error re-render keeps the token in a hidden field. - Layout. Both claim pages use the
barelayout, so there is no top bar and no footer, and the passkey-or-password logic is unchanged. I kept the disclosure paragraphs for link expiry, who keeps access, and account takeover. They are security statements and existing tests assert them, so removing them is your call. - 360 px. I couldn't look at it: the sandbox has no browser, so I can't capture it. I haven't added a
Looks:line, and the earlier "No look" commit stands. Someone needs to check the page at 360 px. - Terminal. The terminal has no claim screen, because claim links are for a client in a browser. I wrote that in
docs/features/forge-link-states.md.
I updated test/welcome.test.ts for the new field markup.
The claim page now works with no script. A paste field for the link code sits inside <noscript>, and the page script fills a hidden #claim-token field from the # in the link. The new end-to-end test is in test/forge-link-landing.test.ts.
The check's failing test "the claim page's own elements are present" (in test/console-clean.test.ts) still looked for the old #claim-token-field id. I changed it to #claim-token, which is the right fix because that field was removed on purpose.
I could not reproduce the other two failures, "the ping is signed and goes through deliverDue…" (test/hook-ping.test.ts) and "delete a repository in the terminal > an admin lands…" (test/tui-delete-repo.test.ts). Both pass here. The check log says both are green on main, so I treated them as flaky, but that is a guess. If they fail again on this push, the log will show it.
Locally the 5 affected test files pass (37 tests) and bun x tsc --noEmit is clean. I did not run the full suite. I did not run scripts/gate.ts or scripts/design-lint.ts (the latter matters because the change touches src/web/), so the forge's check is the first to run them. The pushed commit is c748c7e8f.
I left the claim page's visible look unchanged and did not touch the /welcome flow beyond the shared form.
To try it, open a claim link with scripting off: the code field appears, and with scripting on it stays hidden and the # is dropped from the address bar.
Earlier asks: the dead endedAt parameter and void endedAt; are gone (met); the page now works with script off through a noscript code field, tested end to end (met); bare layout drops the top bar and footer (met); the terminal absence is documented (met). Revoked, expired and unknown answer one identical 404, tested byte for byte. Two things I would do next, non-blocking: 1) look at /claim at 360 px with a real spawned link and add a Looks line, since nobody has seen it narrow; 2) with no script the visitor must paste the part after the # because the server cannot see a fragment, so it is a code field plus a password form, not one button. Consider a one-time short code shown beside the link instead of the long secret.
Left #12416 open: 1 unticked item remain (The landing page for a valid link is server-rendered: one sentence naming who made the forge for them, one button, no layout shift, under 20 KB; it sends the security floor and no Referrer leak of the link token (the token is not in any outgoing link).).
A revoked, expired or unknown forge link now gets one identical page, and the landing page for a good link names who made the forge. I did not call
keep_planorestimateon this issue, so there is no plan or time estimate recorded.bun x tsc --noEmit,bun scripts/gate.tsandbun scripts/design-lint.tsare clean, and the claim, first-boot, revoke and landing tests pass. I ran only the tests around the claim page, not the full suite.What changed
test/forge-link-landing.test.tsfetches each state with no cookie. For a good link it checks the maker sentence, size under 20 KB, the security floor andReferrer-Policy, the form in the HTML, and that the token appears nowhere in the page or any link. For the three dead states it checks the bodies are identical.claim-page-words,claim-revokeandspawn-first-bootasserted the old distinguishing words or 410. Those assertions were what the issue asked to remove, so I updated them.docs/features/forge-link-states.mdhas a new section on what the link page says.Not done
#fragment, so the server cannot tell which code a GET carries and the page cannot react to a wrong one. A browser with no script therefore sees a code field to paste into and a password form, not a one-tap page. The form is still server-rendered and works, but "one button" holds only with script on (the passkey button).Try it Open a spawned forge's
/claimwith no cookie, then make the link expire and open it again.Closes #12416