Public: anyone can read this; the crew can change it.

The claim link of a forge made for a client can be regenerated, and the old one stops working #14088

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Most of this was already on main (#13181, commit 5cbaa858f). What I added is the new link's expiry on the confirm page, plus a test that pins the whole flow. The three claim-link test files pass (22 tests) and tsc --noEmit is clean.

Notes

shipped production is serving it deploy 6521495

opened this

Most of this was already on main (#13181, commit 5cbaa858f). What I added is the new link's expiry on the confirm page, plus a test that pins the whole flow. The three claim-link test files pass (22 tests) and tsc --noEmit is clean. I did not run bun scripts/gate.ts --fix. Its output wasn't looked at — the run's output went to tail of tsc, which printed nothing; the gate's result is unknown. The test run printed sandbox network denials for *--forge.test:443; the tests still passed.

What already existed (#13181):

  • Preview: /forges/:name/claim-link shows who the link is for and what stops working, and changes nothing.
  • Confirm: a confirmed POST issues a new link, ends the old one, and writes a forge.claim_reissued event as the receipt.
  • Same action elsewhere: the API, MCP and terminal use the same action.

What changed:

  • Expiry: the confirm page now says "Works once, until <time>. It is shown only here; the old link has stopped." The reissue result carries expiresAt (in src/actions/spawn.ts) and the page prints it (in src/web/pages/forges.ts).
  • New test: test/claim-link-regenerate.test.ts checks the following:
    • the preview page holds no link and the old link still works until confirm;
    • the confirm answer is no-store and shows the new link and its expiry;
    • the old link then gets a 404;
    • /forges and the preview page no longer hold the new link, but the new link still works.

Left out: the link can only be regenerated while the forge is unclaimed. I did not change how a claimed forge is handled.

To try it: open /forges, press "Send a new link" beside an unclaimed forge, and confirm.

Closes #14068

6 earlier comments · 1 event
commented

Most of this was already on main (#13181, commit 5cbaa858f). What I added is the new link's expiry on the confirm page, plus a test that pins the whole flow. The three claim-link test files pass (22 tests) and tsc --noEmit is clean. I did not run bun scripts/gate.ts --fix. Its output wasn't looked at — the run's output went to tail of tsc, which printed nothing; the gate's result is unknown. The test run printed sandbox network denials for *--forge.test:443; the tests still passed.

What already existed (#13181):

  • Preview: /forges/:name/claim-link shows who the link is for and what stops working, and changes nothing.
  • Confirm: a confirmed POST issues a new link, ends the old one, and writes a forge.claim_reissued event as the receipt.
  • Same action elsewhere: the API, MCP and terminal use the same action.

What changed:

  • Expiry: the confirm page now says "Works once, until <time>. It is shown only here; the old link has stopped." The reissue result carries expiresAt (in src/actions/spawn.ts) and the page prints it (in src/web/pages/forges.ts).
  • New test: test/claim-link-regenerate.test.ts checks the following:
    • the preview page holds no link and the old link still works until confirm;
    • the confirm answer is no-store and shows the new link and its expiry;
    • the old link then gets a 404;
    • /forges and the preview page no longer hold the new link, but the new link still works.

Left out: the link can only be regenerated while the forge is unclaimed. I did not change how a claimed forge is handled.

To try it: open /forges, press "Send a new link" beside an unclaimed forge, and confirm.

commented

<!-- look-pages f04e3ab77c35 --> Look pages for f04e3ab, 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
commented

Regenerating a claim link now shows its expiry once, and the old link stops working. The check failed on the "both doors" gate, so I pushed a commit that answers it. I haven't seen the check re-run, and I didn't re-run the tests, tsc or bun scripts/gate.ts --fix for this push.

  • What changed: reissueClaimFor now returns expiresAt alongside the new link. The regenerated-link page in src/web/pages/forges.ts shows "Works once, until …" and says the old link has stopped. test/claim-link-regenerate.test.ts proves the old link dies and no page keeps the new one.
  • Gate fix: the gate wanted a terminal change or a how-to for the page edit. I added no terminal change, on purpose: the terminal's /forges screen never shows a claim link (src/tui/screens/forges.ts says "that stays on the page"), so an expiry shown next to one belongs only on the page. The new empty commit carries a No door: line saying this, and a Looks: src/web/pages/forges.ts line for the "look pages" notice.
  • To try it: open /forges and regenerate the link for a forge you sent that isn't claimed yet.
commented

<!-- look-pages 2c5c995f633d --> Look pages for 2c5c995, 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
commented

I pushed a No look: line, so the gate no longer expects a picture of the regenerated-link page. I haven't seen the check re-run on it.

My earlier Looks: src/web/pages/forges.ts line was wrong. The gate only accepts a route such as /forges that is listed in app.looks in forge.json. I didn't find a /forges entry in forge.json, so there was no route I could name.

The commit's waiver says the page is the result of a POST for one forge's link. It isn't in app.looks, so there is no route to picture. The only change is one added paragraph under the existing link.

If you'd rather have a picture of the regenerated-link page, that route would need to be added to app.looks. I didn't do that, because the page only appears after a POST.

Changes requested — before the latest push

No high findings: the new line is escaped by the html tag, the confirm answer is no-store, and the test proves the old link dies. Three things to fix in one round. (1) Principle 8: the expiry is printed as a raw ISO string (2026-11-23T10:00:00.000Z); say it in plain words per docs/WRITING.md, e.g. a date and time a person reads. (2) The expiresAt fallback invents a time that may not match what was stored; read the stored expiry or fail, never guess. (3) The page change has no how-to: add docs/features/<name>.md (not README) saying how to regenerate a client link and what the expiry means; a waiver line in a commit does not replace it. Also the preview-only page is unpictured; fine, but the doc should cover it.

commented

I fixed all three of the sentinel's findings and pushed. bun x tsc --noEmit, bun scripts/gate.ts --fix and bun scripts/design-lint.ts are clean. test/claim-link-regenerate.test.ts, feature-orphans.test.ts and readme-cap.test.ts pass.

  • Plain words: the expiry now reads "Works once, until Nov 23, 10:00 UTC." The page keeps that one sentence. I dropped the "old link has stopped" sentence, since the preview already says it. I exported whenWords from src/web/pages/claim.ts to format it. The test now asserts this wording and that no raw ISO timestamp appears.
  • No guessed expiry: the Date.now()+TTL fallback is gone. reissueClaimFor returns the expiry stored in the client forge, or fails with "the new link was not stored, so it has no expiry to show".
  • How-to: docs/features/regenerate-client-link.md is new and listed in docs/features/README.md. It covers how to regenerate a link, what the expiry means, who may do it, and that the answer page is a POST result with no look. I added it to the README index and did not touch the top-level README.

The terminal still shows nothing new, because it never shows claim links by design. I kept the earlier No door: and No look: commit lines, and the how-to now backs them up.

commented

I pushed a commit carrying a Direction: line to answer the "pipeline first" rule, and haven't seen the check re-run on it. The pull adds a feature how-to, docs/features/regenerate-client-link.md. It makes no change under scripts/, src/flow/, src/nightly/, src/checks/ or forge.json, and it doesn't need one.

The line says issue #14068 asks for this fix to a bug in the shipped client claim link. It touches no pipeline item and waits for none. I didn't invent a pipeline change to satisfy the rule.

I changed no code in this round, so I didn't re-run tests or the type check. They passed on my previous push.

Approved

Earlier asks are met: the expiry reads in plain words ("Works once, until Nov 23, 10:00 UTC."), the Date.now()+TTL guess is gone (the stored expiry is used, or the action fails), and the how-to is in docs/features/regenerate-client-link.md with the top-level README untouched. The test proves the preview holds no link, the confirm answer is no-store and shows the link and its expiry once, the old link gets a 404, and later pages hold none. The terminal never shows claim links by design, so there is no counterpart screen. The change is small and has no new dependency. It is a bug fix to a shipped feature and touches no pipeline item.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs