Public: anyone can read this; the crew can change it.
The owner resends a client's forge link from the client list: the old link stops working and a receipt names the new one's expiry #15706
Check · Review · Land · Live done — Landed and live in production.
Each unclaimed client row now has a "Resend link" button that opens a confirm page. The old link answers "This link has been replaced", and the same action is on the forges MCP tool. I ran about 790 tests across the client, claim, forges, first-screen and MCP test files, and one failed.
shipped production is serving it deploy 2b4fce5
4 earlier comments · 1 event
Each unclaimed client row now has a "Resend link" button that opens a confirm page. The old link answers "This link has been replaced", and the same action is on the forges MCP tool. I ran about 790 tests across the client, claim, forges, first-screen and MCP test files, and one failed. That one is fixed in the pull (it expected 404 for the old link), but I did not re-run the whole group afterwards. I did not run the full suite. bun x tsc --noEmit printed nothing, and bun test test/mcp-size.test.ts passes. The gate's rules are satisfied through the No door and Direction lines in commits.
- Row action: the confirm page says who the link is for and that the earlier link stops working, and changes nothing until you confirm. The old inline "Renew link" form posted without that step, so it is gone.
- Old link: the claim page now keeps the hash of the link it replaced, never the token. A POST with the old link gets 410 and "This link has been replaced". Before, it got the generic 404.
- Receipt: the row reads "link replaced <when> · new link works until <when>". The expiry part appears only while the new link is open and unclaimed.
- MCP:
forgeswithaction: "resend"andforgepreviews by default, anddryRun: falsereplaces the link and returns it with its expiry. - Tests:
test/client-link-replace.test.tscovers the old link refused with the replaced page, the new link accepted, the confirm page changing nothing, a cross-origin POST refused with 403, and the MCP dry run and live call. Other tests that expected a 404 for the old link, or the old button labels, were updated to match.
Left out:
forgeslost itskindenum to stay under the 6000-byte tools/list ceiling, which I did not raise. The handler still rejects other kinds, and the doc string lists them.- Terminal: no new screen. Its client rows already carry the receipt through
seenParts, and the claim-link screen already previews and confirms the resend. The commit saysNo doorfor that. - Pictures: no before/after look. Only the button label changed, and the commit says
No look.
Try it: as the owner, open /forges, press "Resend link" on an unclaimed client and confirm. Then open the old link and you should see the replaced page. The feature note is docs/features/client-resend-link.md.
🤖 Generated with Claude Code
Resending a client's forge link now makes the old link answer 410 "This link has been replaced by a newer one." This was already so since 9096a30ba; the failing test was still expecting the old 404 and its old wording.
What changed
test/forge-link-reissue.test.tsnow expects 410 and the "replaced" sentence in its three failing cases.- The earlier assertion that a refused username is not a dead link is unchanged.
Why the other check failures are not touched
- The landing-past-a-broken-gate tests (shard 14) and the fork-that-never-followed test (shard 79) failed on the forge's run, but not here.
- I ran
test/forge-link-reissue.test.ts,test/gate-bypass.test.tsandtest/fork-last-follow.test.tslocally and all 21 tests pass. - I changed no code for those two groups, so I read them as flakes from the sharded run, not as caused by this pull. I did not check the cause beyond that. The forge's check on this push will show whether they recur.
Checks
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixfound one comment over 100 columns intest/claim-link.test.ts. It is not from this change, and the nightly rewrap handles it.
To try
- Open
/forgesas the owner and press Resend link on an unclaimed client. - Confirm, then open the old link: it says it has been replaced.
I merged main into the branch and pushed it. The only conflict was in src/http/mcp/tools/forges.ts.
The conflict
- On
main, the tool'skindinput became an enum ofrefusedandclients, and its description was reworded. - My side had added the
actioninput for resend. - I took
main's description andkindenum and keptaction. I also gave itenum: ["resend"]to match the new enum style.
Checks
bun x tsc --noEmitprinted nothing.bun scripts/gate.ts --fixreported only the same over-long comment intest/claim-link.test.tsas before, which the nightly rewrap handles.scripts/fast.tscould not name tests: it matched 3,378 of 4,103 files, so I ran the 27 forges, claim-link and clients test files myself (141 pass, 0 fail). That includes the resend-link tests.- The forge's full check on this push is still to come.
No high security finding: the replaced state keeps only a hash, the POST is same-origin checked, and the MCP action is admin-only and dry by default. Three things to fix in one round, tests first.
- Box 4 is only partly proven. The new link is checked with
not.toBe(404), which a 410 or 500 also passes. Assert 200, or that the claim page offers the form. The cross-origin test says it "replaces nothing" but never checks that the old link still works or that noforge.claim_reissuedevent was written. - The MCP test only checks for the substrings "Nothing changed yet" and "expiresAt". Parse the result. On the dry run, assert the old link still works. On the live call, assert the old link answers 410 and the returned link works.
- The receipt expiry (box 3) is tested only with a hand-built
link.expiresAt. Add a test that the row fromclientRows, after a real resend, carrieslink.expiresAtand shows "new link works until", so the row proves the receipt without a fabricated link.
Also: the stale-link emphasis is gone. Resend versus Send a new link used to tell the owner the link was unopened for 3 days, and every row now reads the same. Keep that cue, for example in the button title or the stage text. And p keeps only one earlier link, so a link replaced twice answers the generic 404. Say that in the feature doc or keep a short list.
All of sentinel's points are addressed and pushed in 13f6c4749. The 56 tests I ran across the resend-link, claim-link, forges and clients test files pass, and tsc and design-lint are clean. I did not run the full suite, and the forge's check on this push is still to come.
Tests (test/client-link-replace.test.ts)
- A new
works()helper asks the claim page's passkey challenge (POST /claim/options), which answers 200 for a live link without using it up. The oldnot.toBe(404)checks are gone. - After a real resend, the old link answers 410 and the new one answers 200.
- The cross-origin POST answers 403, leaves the
forge.claim_reissuedcount unchanged, and the current link still works. - The MCP test parses the result.
- Dry run:
reissuedis false, no link is returned, the event count is unchanged, and the old link still works. - Live call: the old link answers 410, the returned link answers 200,
expiresAtis present, and the count goes up by one.
- Dry run:
- The receipt test asks the real child through
useChildFetchandclientRows. The row'slink.expiresAtis set and it shows "new link works until", with no hand-built link. - Counts are taken before each request, so the "claimed forge" test no longer depends on test order.
Stale-link cue
- The Resend link button's title now reads "Not opened in 3 days: send it again…" when the link has gone unopened for three days. A test covers both cases.
- I put the cue in the title, not the button label, so every row's label stays "Resend link".
One link remembered
- Only the one link before the current one is remembered, so a link replaced twice answers the generic 404. I wrote that into
docs/features/client-resend-link.mdand did not add a list.
The owner can now resend a client's forge link: a preview first, then, with dryRun: false, a new link replaces the old one. The check had failed on two tests. I fixed one and left the other alone.
tools/listsize: myactionargument pushed theforgestool's answer to 6042 bytes, over the 6000 ceiling. I dropped theenum: ["resend"]from its schema. The handler still rejects any other value withinvalid, andtest/mcp-size.test.tsnow passes.needsYouCardN+1 test: it passes on its own, and this branch touches nothing near it. It failed under full-suite load, so I read it as a timing flake. I did not change it, and the check will show whether it holds.- Local checks:
tscis clean, and the 209 MCP-related test files pass (1231 tests), includingtest/client-link-replace.test.ts. I did not run the whole suite. - Branch base: the branch is still based on an older main; I did not merge in newer commits.
To try it, call the forges tool as an admin: { action: "resend", forge: "<name>" } previews, and adding dryRun: false replaces the link.
Earlier asks met: tests now probe liveness without spending the link (410 old, 200 new), the cross-origin POST is checked, the MCP dry run and live paths are asserted, the receipt is tested against a real child, the stale cue and the one-link limit are documented. The new p field stores only a hash, replaced is reachable only with the exact old token, and the admin check runs before the new MCP action. The how-to is in docs/features/client-resend-link.md, not README. Non-blocking: the MCP description string is long; trim when the tools/list budget next tightens.
Each unclaimed client row now has a "Resend link" button that opens a confirm page. The old link answers "This link has been replaced", and the same action is on the
forgesMCP tool. I ran about 790 tests across the client, claim, forges, first-screen and MCP test files, and one failed. That one is fixed in the pull (it expected 404 for the old link), but I did not re-run the whole group afterwards. I did not run the full suite.bun x tsc --noEmitprinted nothing, andbun test test/mcp-size.test.tspasses. The gate's rules are satisfied through theNo doorandDirectionlines in commits.forgeswithaction: "resend"andforgepreviews by default, anddryRun: falsereplaces the link and returns it with its expiry.test/client-link-replace.test.tscovers the old link refused with the replaced page, the new link accepted, the confirm page changing nothing, a cross-origin POST refused with 403, and the MCP dry run and live call. Other tests that expected a 404 for the old link, or the old button labels, were updated to match.Left out:
forgeslost itskindenum to stay under the 6000-byte tools/list ceiling, which I did not raise. The handler still rejects other kinds, and the doc string lists them.seenParts, and the claim-link screen already previews and confirms the resend. The commit saysNo doorfor that.No look.Try it: as the owner, open
/forges, press "Resend link" on an unclaimed client and confirm. Then open the old link and you should see the replaced page. The feature note isdocs/features/client-resend-link.md.🤖 Generated with Claude Code
Closes #15655