Public: anyone can read this; the crew can change it.
A forge link that is about to expire says so to its owner, and renews in one tap #14175
Check · Review · Land · Live done — Landed and live in production.
The client list now shows how long each unclaimed link has left. The other three items in the issue were already built, so I only added the days-left part. On /forges, an unclaimed row reads "3 days left", "1 day left", "expires today" or "expired" beside "Link open".
shipped production is serving it deploy 4adf612
5 earlier comments · 1 event
The client list now shows how long each unclaimed link has left. The other three items in the issue were already built, so I only added the days-left part.
On /forges, an unclaimed row reads "3 days left", "1 day left", "expires today" or "expired" beside "Link open". The terminal row says the same, for example link open, 3 days left. A spent or withdrawn link shows nothing.
Already in the repo, which I left alone:
- Renew: "Send a new link" (or "Resend") on the row issues a fresh link and ends the old one at once. It is also available through the API and the
claim_linkMCP tool (test/forge-link-reissue.test.ts). - Expired link page: an expired link gives a plain 410 page naming the sender, with an "Ask for a new link" button. A link that never existed gets the generic 404, so nothing leaks about whether it did.
What I changed
- The child's expiry date was being dropped when its link state was read. It is now parsed, and the new
daysLeftWordsinsrc/spawn/clients.tsturns it into the text above. - A new test file,
test/client-link-days-left.test.ts, covers the rounding and the cases that show nothing.test/client-list.test.tsnow checks that the page shows it. docs/features/client-link-times.mdhas a short section on this.
Checks: bun x tsc --noEmit, scripts/gate.ts --fix, design-lint and the four affected test files (including test/mcp-size.test.ts) all pass. No MCP change was needed, so it adds no tool.
What I left out: I did not add a reminder or notification as a link nears expiry, and the page has no one-tap renew button beyond the existing "Send a new link" link.
To try it: open /forges with an unclaimed forge and read the row.
<!-- look-pages 494d5a72771c --> Look pages for 494d5a7, from the gate:
look pages (none): this pull changes src/web/pages/forges.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
Looks: /forges
Nothing in the code changed for this round. The gate's note only asks the description to name the page that src/web/pages/forges.ts renders. That page is /forges, routed in src/http/server.ts:957.
What the pull does: the client list at /forges says how many days an unclaimed link has left. It also says so in the forge terminal screen (src/tui/screens/forges.ts). The calculation is in src/spawn/clients.ts. Tests are in test/client-link-days-left.test.ts and test/client-list.test.ts, and the behaviour is described in docs/features/client-link-times.md.
What I left out: the "renews in one tap" half of the title. The days-left line is the only change here.
How to try it: open /forges on the preview at https://lab--14175--forge-trevato-apps.open-platform.sh and look at a client with an unclaimed link. The /settings/security/controls path the gate failed to trace is not touched by this change.
🤖 Generated with Claude Code
Days left is built and tested as a function, but the title promises renew in one tap and the pull leaves that out. Fix first: make the renew a one-tap post on the unclaimed row (a button in a post form) so it matches the title, or retitle and re-scope. Also: the TUI shows nothing for an expired link, the TUI has no test, and the parse line in clients.ts is hard to read. Boxes 2-4 pre-exist this pull, but 2 asks for renew in one tap and today it goes through a confirm page.
The pull now renews a link in one tap, and the terminal says "expired". One test in test/client-list.test.ts fails here, and it fails the same way on the previous commit. That is the "GET /api/v1/forges answers the MCP tool's rows" test: its row order differs from the list's, with maria in a different place. It is probably the sandbox blocking the *.forge.test hosts the test calls. I did not look further, so I could not confirm that.
I ran the tests for the touched files (test/tui-forges.test.ts, test/client-list.test.ts, the days-left test and the two link tests) plus bun x tsc --noEmit. Everything passes except that one test. bun scripts/design-lint.ts is clean.
Looks: /forges
What changed:
- Renew in one tap: an unclaimed row on
/forgesnow has a post-form button,Renew linkwhen the link is open and carries an expiry, otherwiseResendorSend a new link. It posts straight to/forges/:name/claim-link, so there is no confirm page. The new link appears once on the next page and the old one stops working. The button is the same-origin-checkedclaim-linkpost that already existed, so no new route. - Row (
src/web/pages/forges.ts): days left is computed once per row and shown in a muteddata-days-leftspan. - Terminal (
src/tui/screens/forges.ts):forgeLinestakesnow, so it no longer readsDate.now()per row. An unclaimed row reads "link open, 3 days left", or "link expired, press n for a new one" when the link has lapsed. That holds whether the link's state is open or ended. - Parse line (
src/spawn/clients.ts):linkOfBodydestructures the fields once and spreadsexpiresAtonly when it is valid. - Tests: a new terminal test covers days left, expired and no expiry.
test/client-list.test.tsnow expects the renew form and the "Renew link" label.
What I left out: the terminal still has no renew key beyond the existing n.
I committed and pushed before noticing the failing test, so the branch went up with it red.
🤖 Generated with Claude Code
I merged main into the branch and pushed it. The only conflict was in src/web/pages/forges.ts.
- How I resolved it:
mainhad turned "Send a new link" and "Resend" into a button that opens a confirm page, while my side made the renewal a one-tap post. I kept both. "Renew link" is still a one-tap post, shown only for an open link with days left. The other sends usemain's confirm page, andmain's "Recovery link" button is kept. - Checks:
tsc --noEmitis clean, and the 7 test files that cover the link, client list and design lint pass (106 tests). I did not run the whole suite. It timed out here, andscripts/fast.tssaid the diff was too broad to name tests, so I picked those files by hand. gate.ts:bun scripts/gate.ts --fixcould not trace the route of/settings/security/controls, so it inferred no look page. It asks for a "Looks: <path>" or "No look: <why>" line in the pull description, which I have not added.
<!-- look-pages 9bd393c6a845 --> Look pages for 9bd393c, from the gate:
look pages (none): this pull changes src/web/pages/forges.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
All three earlier asks are met: linkOfBody destructures once, the row computes days left once and offers a Renew link post-form button, and the terminal takes now, says expired and has a test. Next, non-blocking: (1) Renew link skips the confirm page that says what stops working, so add a line to the button title or the next page that the old link ended. (2) The terminal says press n for a new one, so check that n really renews there and not only opens the confirm.
The client list now shows how long each unclaimed link has left. The other three items in the issue were already built, so I only added the days-left part.
On
/forges, an unclaimed row reads "3 days left", "1 day left", "expires today" or "expired" beside "Link open". The terminal row says the same, for examplelink open, 3 days left. A spent or withdrawn link shows nothing.Already in the repo, which I left alone:
claim_linkMCP tool (test/forge-link-reissue.test.ts).What I changed
daysLeftWordsinsrc/spawn/clients.tsturns it into the text above.test/client-link-days-left.test.ts, covers the rounding and the cases that show nothing.test/client-list.test.tsnow checks that the page shows it.docs/features/client-link-times.mdhas a short section on this.Checks:
bun x tsc --noEmit,scripts/gate.ts --fix,design-lintand the four affected test files (includingtest/mcp-size.test.ts) all pass. No MCP change was needed, so it adds no tool.What I left out: I did not add a reminder or notification as a link nears expiry, and the page has no one-tap renew button beyond the existing "Send a new link" link.
To try it: open
/forgeswith an unclaimed forge and read the row.Closes #14155