Public: anyone can read this; the crew can change it.
A client's forge link can be revoked and re-issued from the client list, each a receipted action #14743
Check · Review · Land · Live done — Landed and live in production.
Most of this already existed on main: revoke and undo, "Send a new link" on the row, the claimlink MCP tool with action, and the same-origin checks. This pull adds what was missing: a confirm step before Revoke, and a 410 page for revoked links.
shipped production is serving it deploy 7be111a
4 earlier comments · 1 event
Most of this already existed on main: revoke and undo, "Send a new link" on the row, the claim_link MCP tool with action, and the same-origin checks. This pull adds what was missing: a confirm step before Revoke, and a 410 page for revoked links.
I ran the tests for the changed files (the revoke, claim, landing, terminal forges and MCP size suites) and they pass. tsc is clean and the gate is clean after the last commit. I did not run the full suite.
What changed
- Revoke is confirmed. On
/forges, Revoke now opens/forges/:name/revoke-link, a page with one line saying what it does and a Revoke button that posts. Nothing changes until that button is pressed. The terminal'slasks with the same line. - A revoked link answers 410. The page and the passkey JSON say "This link was turned off. Ask the person who sent it for a new one." They name no sender and no forge. The starter's own
/welcomepage says "You turned this link off." An unknown token is still 404. - MCP gets the same words.
claim_linkwithaction: "revoke", dryRun: truereturns the same one line and changes nothing. No new tool was added, andtest/mcp-size.test.tspasses. - Tests. The new
test/client-link-revoke.test.tscovers: Revoke asks first, a cross-origin POST changes nothing, a revoked link is 410, the new link works, and the old token stays dead. It also checks a cross-origin "Send a new link" is refused, and that the new token is not on the list page afterwards. - Docs. I updated
docs/features/forge-link-revoke.mdandforge-link-dead.md. - Edited existing tests.
claim-revokeandforge-link-landingasserted the old 404 and "withdrew" wording. Those assertions were wrong for the new behaviour, so I changed them.
What I left alone
- The one-minute Undo stays. Revoke is still reversible after the confirm.
- The
claim_linkMCPrevokestill acts withoutdryRun(the other tools'revealflag is not mirrored here), because existing callers andagent-owns-forgerely on it. - The token storage and checks were left alone. Constant-time comparison and hash-only storage are not something I changed or verified here.
- No
Looks:page./forgesis not inapp.looks, so the commit says "No look".
Try it: on /forges, press Revoke on an unclaimed forge and read the line. Confirm, then open its claim link to see the 410. Press Send a new link and check the new link works and the old one doesn't. In the terminal, open Forges you sent and press l.
🤖 Generated with Claude Code
A revoked forge link now answers 410, so I changed test/stranger-words.test.ts to expect that instead of 404. That test was the wrong one: 410 is what this pull intends, and the change is pushed. After the edit, stranger-words, llms-budget and docs-index pass locally. The gate.ts and tsc checks printed no errors.
- Docs index test:
test/docs-link.test.ts("the index is four sections…") fails on main too, with the same failure with my changes stashed, so I left it alone. The forge's check also marked it as red on main and not counted against this pull. - Linear-time scan test: "a large malformed numeric array is scanned in linear time" passes when run alone. It looks like a timing flake under load in the full run, so I made no change.
/llms.txtbudget test: It passes locally and I changed nothing for it. The earlier failure in the full run may have been the same load effect, but I haven't confirmed that.
I didn't re-run the full suite.
I made no code change this round, because every failure that isn't red on main also passes here. I didn't push, since nothing new exists to push.
I re-ran the tests that fail in this pull's check:
test/take-expect.test.ts(the fast-forward test): passes.test/invalid-json-readers.test.ts(the linear-time scan): passes.test/llms-budget.test.ts(the/llms.txtbyte budget): passes.
The remaining failures:
- Live previews test: it died with an
ENOENTon a runner temp file (.../production/data/app.db-journal) while a deploy ran, after 420 s. The file vanished from under the runner, so this reads as runner trouble rather than anything in this pull. I can't run that suite in this sandbox. - Docs index and fetch-timeout tests:
docs-linkandfetch-timeoutare red on main at 03b38cb too, and the check says so. - Timing tests: the linear-time scan and the fast-forward test are timing-sensitive, and this check run was very slow (742 s against 285 s last time).
/llms.txtbudget: the check calls it this pull's red. It passes here, so I can't tell whether it only fails under load or whether the pull sits close to the budget.
The pull's actual change is unchanged since the last push. The base has moved on by 22 commits.
I merged main into the branch and pushed the merge commit (c45e29714). The two conflicts were both in import lines, and I kept both sides' imports.
src/http/server.ts: the import now has this pull'sforgeRevokeConfirmandmain'sforgesCsv.src/web/pages/forges.ts: it imports bothrevokePreviewfromspawn/manage.tsandclientsCsvfromspawn/clients_csv.ts.
bun x tsc --noEmit printed no errors. I ran four test files: client-link-revoke, claim-revoke, stranger-words and forge-link-landing. All 24 tests pass. I did not run the broader set scripts/fast.ts would pick, because it named 2519 files, so that part is left to the forge's check.
scripts/gate.ts exits 0 but prints a note that forgeRevokeConfirm is 0.57 similar to forgeRemoveConfirm ("one implementation?"). The note looks advisory since the exit code is 0. I left the two functions separate.
Mostly right: confirm page, 410 words, TUI confirm and docs are in place. Fix first: dryRun must never be followed by a write. Then the rest in one round: (1) the stray doc comment in manage.ts detaches changeLink's own JSDoc; (2) the MCP preview does not check the forge exists; (3) the cross-origin tests assert too little to fail if the same-origin check were removed.
All three review points are fixed and pushed (aee422452). bun x tsc --noEmit is clean, and the tests covering this change pass: claim-revoke, client-link-revoke, mcp-doc-names-every-argument, claim-link, mcp, forge-link-reissue and agent-owns-forge.
dryRunnever writes: insrc/http/mcp/tools/claim_link.ts,dryRun: truenow only previews, forrevoke,undo,revealand no action alike. A non-admin gets the sameforbiddenrefusal as the real call. The forge must exist, checked withchildNamed, or the answer isnot_foundwith "no child forge named …". The tool's doc line now saysdryRunnever writes.- Tests for the above: a new test in
test/claim-revoke.test.tscoversdryRunwithundo,dryRunby a non-admin,dryRunwithreveal, and a missing forge. After each of these it checks the link state is unchanged. - Detached JSDoc:
revokePreviewinsrc/spawn/manage.tsnow sits abovechangeLink's comment, so that comment documentschangeLinkagain. - Cross-origin tests: in
test/client-link-revoke.test.tsthe revoke check now asserts exactly 403 and that the link is stillopen. The new-link check asserts exactly 403, that the link is stillended, and that the settings row count is unchanged. I didn't remove the same-origin check to confirm these fail without it, and I didn't re-run the old token against the old link in that test. - Unchanged:
scripts/gate.tsstill prints its advisory note thatforgeRevokeConfirmandforgeRemoveConfirmlook alike. It exits 0, and I kept the two separate.
All three earlier asks are met. dryRun now only previews for revoke, undo and reveal, refuses a non-admin with the real call's words, and returns not_found for a missing forge, with a test that fails without it. The revokePreview JSDoc no longer sits detached above changeLink. The cross-origin tests assert exactly 403 and that the link state is unchanged. The confirm page uses the existing components, posts in a form, works without JavaScript, and has a terminal twin. The preview answers 200. Non-blocking: scripts/gate.ts notes that forgeRevokeConfirm and forgeRemoveConfirm look alike; fold them later if a third confirm appears.
Most of this already existed on main: revoke and undo, "Send a new link" on the row, the
claim_linkMCP tool withaction, and the same-origin checks. This pull adds what was missing: a confirm step before Revoke, and a 410 page for revoked links.I ran the tests for the changed files (the revoke, claim, landing, terminal forges and MCP size suites) and they pass.
tscis clean and the gate is clean after the last commit. I did not run the full suite.What changed
/forges, Revoke now opens/forges/:name/revoke-link, a page with one line saying what it does and a Revoke button that posts. Nothing changes until that button is pressed. The terminal'slasks with the same line./welcomepage says "You turned this link off." An unknown token is still 404.claim_linkwithaction: "revoke", dryRun: truereturns the same one line and changes nothing. No new tool was added, andtest/mcp-size.test.tspasses.test/client-link-revoke.test.tscovers: Revoke asks first, a cross-origin POST changes nothing, a revoked link is 410, the new link works, and the old token stays dead. It also checks a cross-origin "Send a new link" is refused, and that the new token is not on the list page afterwards.docs/features/forge-link-revoke.mdandforge-link-dead.md.claim-revokeandforge-link-landingasserted the old 404 and "withdrew" wording. Those assertions were wrong for the new behaviour, so I changed them.What I left alone
claim_linkMCPrevokestill acts withoutdryRun(the other tools'revealflag is not mirrored here), because existing callers andagent-owns-forgerely on it.Looks:page./forgesis not inapp.looks, so the commit says "No look".Try it: on
/forges, press Revoke on an unclaimed forge and read the line. Confirm, then open its claim link to see the 410. Press Send a new link and check the new link works and the old one doesn't. In the terminal, open Forges you sent and pressl.🤖 Generated with Claude Code
Closes #14518