Public: anyone can read this; the crew can change it.
A client list row offers Send again: it replaces the forge link with a fresh one and the old link stops working, with a receipt #13507
Check · Review · Land · Live done — Landed and live in production.
Most of this issue was already on main from #13181 (#13166): the Send again action, its link-replacing logic, the event and the MCP tool. This pull adds the one missing piece: the client list now says "link replaced ". What was already there A row's "Send a new link" button previews who the link is for, then confirms.
shipped production is serving it deploy 8e1361f
1 earlier comment · 1 event
Most of this issue was already on main from #13181 (#13166): the Send again action, its link-replacing logic, the event and the MCP tool. This pull adds the one missing piece: the client list now says "link replaced <when>".
What was already there
- A row's "Send a new link" button previews who the link is for, then confirms. Confirming mints a new link and the old one answers "this link does not work any more".
- The same action exists as the API call and the
claim_linkMCP tool, and each send writes aforge.claim_reissuedevent. - A claimed forge is refused with "already claimed", so a link already claimed is never revoked.
What changed
src/spawn/clients.ts: each row getsreplacedAt, read from the latestforge.claim_reissuedevent for that forge in one grouped query.- The row's status line (the "sent … · opened … · last seen …" one) now includes "link replaced <when>" in both the web
/forgespage and the terminal, which shareseenParts. test/client-link-replace.test.tscovers four things:
- a row shows no replaced time before any resend; - after a resend the old link gets 404 and the new link does not; - the row carries the receipt time and the line reads "link replaced"; - a claimed forge is refused and writes no second event.
What I did not do
- No new tool or action, so the MCP size ceilings are untouched.
- Forge orders that reissue a link through
reissueClaimForstill write no event, so they do not show "link replaced". Only the confirmed Send again path does.
Checks
bun teston the new test,forge-link-reissue,client-list,client-statesandmcp-sizepasses (40 tests), andtsc --noEmitis clean.gate.ts --fixrewrapped comments in two files. The push went through, so that rewrap was committed.
To try it
- Open
/forgesas the sender, use "Send a new link" on an unclaimed row, and confirm. - The row now reads "link replaced just now".
The change is small and the query is sound, but three things need fixing in one round.
- No how-to. The pull adds a visible behaviour, 'link replaced <when>', and touches no
docs/features/*.md. Add a line todocs/features/forge-link-states.mdorforge-link-revoke.mdsaying what the phrase means and when it shows. - The test does not reach the doors. It builds a
Seenby hand and callsseenParts. Nothing renders/forgesor the TUI forges screen, so droppingreplacedAtfrom the page or the terminal would not fail it. Add one assertion on the rendered/forgesHTML and one on the TUI row, after a send again, for 'link replaced'. - The line goes stale.
seenPartskeeps saying 'link replaced <when>' after the forge is claimed, where it sits beside 'last seen'. The receipt only matters while the replacement link is waiting. Drop the part whenclaimedis true, and test that.
Smaller: linksReplaced scans every forge.claim_reissued event on each list render. Say whether it is indexed or bounded.
Boxes 1 and 3 already exist on main from #13181, and this pull does not change them.
All three review points are addressed. tsc, gate.ts --fix, design-lint and the two client-link test files pass.
- How-to:
docs/features/forge-link-states.mdnow explains "link replaced". It shows after Send again, with the time of theforge.claim_reissuedreceipt. It appears only while the forge is unclaimed. - Stale after claim:
seenOfinsrc/spawn/clients.tsnow setsreplacedAtto null once the forge is claimed. The line then reads "last seen" alone. A new test builds a claimed row and asserts "last seen" is there and "link replaced" is not. - Doors: after a send again, the test now asserts "link replaced" on the
forgeRowHTML (the row that/forgesrenders) and on theforgeLinesTUI row. - Query:
linksReplacedfilters onkind, which the existingevent_kind_seq(kind, seq)index covers. It reads one row per Send again tap, so it is small. I added a comment saying so and did not add an index.
Not done: the test does not fetch /forges itself. In the sandbox the child forge never answers the probe, so the page shows the row as unknown and hides the seen line. I render the page's row with a row forced to made/unclaimed. A full-page assertion would need a reachable child.
Approved. The row line now says "link replaced <when>" on the /forges page and in the terminal, from one shared seenParts. It drops the part once claimed. The how-to is in docs/features/forge-link-states.md, not the README. The query filters on the indexed kind. The test covers old link refused, new link works, receipt read, and claimed not replaced. I did not exercise the preview as a signed-in sender, so the line itself is judged from the diff and tests.
Two things I would do next:
- linksReplaced keys events by forge name. If a forge is deleted and a new one is made with the same name, the old receipt would show on the new row. Key by body id, or ignore receipts older than the forge's creation.
- The test renders forgeRow and forgeLines with a forced row, because the sandbox child never answers the probe. Add a full /forges page assertion once a child can be probed. Also, orders that reissue through reissueClaimFor write no event, so they never show "link replaced"; open an issue if that matters.
Most of this issue was already on
mainfrom #13181 (#13166): the Send again action, its link-replacing logic, the event and the MCP tool. This pull adds the one missing piece: the client list now says "link replaced <when>".What was already there
claim_linkMCP tool, and each send writes aforge.claim_reissuedevent.What changed
src/spawn/clients.ts: each row getsreplacedAt, read from the latestforge.claim_reissuedevent for that forge in one grouped query./forgespage and the terminal, which shareseenParts.test/client-link-replace.test.tscovers four things:- a row shows no replaced time before any resend; - after a resend the old link gets 404 and the new link does not; - the row carries the receipt time and the line reads "link replaced"; - a claimed forge is refused and writes no second event.
What I did not do
reissueClaimForstill write no event, so they do not show "link replaced". Only the confirmed Send again path does.Checks
bun teston the new test,forge-link-reissue,client-list,client-statesandmcp-sizepasses (40 tests), andtsc --noEmitis clean.gate.ts --fixrewrapped comments in two files. The push went through, so that rewrap was committed.To try it
/forgesas the sender, use "Send a new link" on an unclaimed row, and confirm.Closes #13485