Public: anyone can read this; the crew can change it.
/pricing sells a forge: pick a plan and a name, pay, and the claim link appears #11306
/pricing now sells a forge: pick a paid plan, name it, give an email, pay, and /pricing/done shows the claim link once. I couldn't run the full suite or the first-view budget check. The new test and about 700 related tests pass, along with tsc, scripts/gate.ts and design-lint.
stopped parked by the crew deploy d7e61b5
5 earlier comments
/pricing now sells a forge: pick a paid plan, name it, give an email, pay, and /pricing/done shows the claim link once. I couldn't run the full suite or the first-view budget check. The new test and about 700 related tests pass, along with tsc, scripts/gate.ts and design-lint. scripts/fast.ts said the diff was too broad to name, so I ran the spawn, Stripe, billing and alarm suites. The forge's check runs the rest on push.
What changed
/pricing(public). It lists the plans from the setting, each with its size in plain words, price and crew credit. A paid plan asks for the forge's name and an email, checks the name is free, and writes aforge_orderrow that holds the name for 30 minutes (migration and pin added). It then redirects to the provider's checkout, and the buyer's cookie is HttpOnly.- Paid exactly once. The webhook and the return page both settle the order through one conditional update, so only the first delivery spawns. The forge is made through
spawnDooron that plan and the entitlement is written.spawnDoorandspawnForgetake apaidoption so a buyer needs neither an account nor admin rights. - Claim link. The return page waits for the spawn, then shows a fresh link once. If mail is configured the link is also mailed.
/pricing/resendsends a new link only to the order's own email and gives the same answer whether or not an order matched. - Failed spawns. A paid order that can't be spawned is marked failed and tells the buyer plainly. It raises a
paid_orderflow alarm that stays until an admin retries it. Settings → Billing gets a "Paid, not made" section with Retry and a link to the provider's dashboard to refund. - Edge cases.
- Free plan: the button goes to
/forges/new. - Provider
none: paid plans show their size and "Ask the operator", and posting an order returns 409. - Agents: refused as buyers.
- Webhook events: a session id that isn't the order's own settles nothing.
- Free plan: the button goes to
- Tests and docs.
test/pricing-order.test.tsuses a fake provider and covers order → paid → spawned → claim link, duplicate delivery making one forge, return-page reconcile, and the failed-spawn alarm, retry and no-provider case.docs/SPAWN.mdnow describes the paid path and no longer says "admin only" for paid plans. - Dependencies. None added.
Left out
- Refund is a link to the provider's dashboard, as the issue allowed.
- Only Stripe is wired; any other provider would need its own adapter behind
CheckoutProvider. - Orders that stay unpaid are not swept; the hold simply lapses after 30 minutes.
Try it
Connect Stripe under Settings → Billing, then open /pricing, pick Small, and pay. The fake provider in the test exercises the same path without a Stripe account: bun test test/pricing-order.test.ts.
I merged main into the branch and pushed; the gate and tsc are clean on the merged tree. The 202 tests I ran pass: the pricing end-to-end test, the Stripe hook and billing tests, and the spawn-anon, start-forge and subscription suites. I did not run the full suite; the forge's check does that on the push.
Conflicts. There were two, in src/http/server.ts and src/http/stripe_hook.ts. Both are resolved by keeping both sides.
server.ts: thepricing.tsimport and main'sstartForgeSubmitimport now sit side by side.stripe_hook.ts:- On
checkout.session.completed, the order path runs first:settleSession, thenbindCheckoutonce the forge is spawned. - Main's
syncSubscriptionhandling forcustomer.subscription.andinvoice.runs after it, unchanged.
- On
New gate rule from main. It requires a terminal screen or how-to for any new page.
- How-to: I added
docs/features/pricing.md. - Terminal screen: none. A commit message carries a
No door:line instead, because buying ends at the provider's hosted checkout in a browser. Say if you want a TUI screen anyway.
I've fixed the five failures caused by /pricing and pushed. The check is still to run on this push. The sixth, "Enter opens the parked issue", passed when I ran it here without any change to it, so I assume it was a flake.
- Reserved name:
pricingis now inSYSTEM_NAMES, so nobody can register it as a username. - Audit:
docs/design/audit.mdhas entries for/pricing,/pricing/doneand/pricing/resend. - Server-Timing:
/pricing/doneand/pricing/resendnow namesessionandrender. On/pricing/donethe render phase also covers the early 404 path, since the timing sweep hits it without an order. - Looks:
/pricingis listed inNOT_A_PAGEintest/forge-looks.test.ts, with the reason that the 24-look cap is spent. - Hollow check: The footer now links to
/pricing. The pricing page also gets a "Paid already? Open your order" link to/pricing/done. I did not add anything toALLOWED.
Locally I ran these seven test files: reserved-names, design-audit, server-timing-sweep, forge-looks, hollow, pricing-order, and the crew hand-over test. I also ran the 438 tests in files that mention the footer, plus tsc, scripts/gate.ts and design-lint. All pass.
I did not run the full suite here. scripts/fast.ts named 2302 of 2781 test files, too many to run. The forge's own check runs the whole suite on every push.
The type error is fixed and pushed. The check hasn't run on this push yet.
Main had changed claimLinkBody to take an isAdmin argument, so src/web/pages/pricing.ts now calls claimLinkBody(given.claimUrl, false), since a buyer is not an admin. I merged current main into the branch first.
tsc --noEmit and scripts/gate.ts are clean here. The five test files I re-ran pass: pricing-order, hollow, server-timing-sweep, design-audit and reserved-names. I did not run the full suite.
I merged main into the branch and pushed it. Two files conflicted, src/http/stripe_hook.ts and /pricing itself.
stripe_hook.ts: the conflict was only imports. I keptsettleSessionfrom the order flow, which this pull uses. I droppedlistChildrenNow, whichmainhad removed and nothing else in the file uses.- Two
/pricingpages:mainhad added its own read-only plans page (src/web/pricing.ts) at the same route, so the build failed on a duplicatepricingPageimport. I kept the sale page from this pull, since it already lists the plans and lets you buy one. I deleted themainpage and its route.main's test only needsid="pricing"on the page, so I put that id on the sale page's wrapper. - Loose ends: I removed the duplicate
pricingentry inSYSTEM_NAMES, the duplicate looks exemption and the duplicate audit line. I merged the audit text into one entry and pointeddocs/features/home-plans.mdat the new file. - Behaviour change: the old "Get a forge" button on
main's page is gone. The no-credit line on the first screen still links to/pricing, which now leads to the buy form.
tsc, scripts/gate.ts and design-lint are clean. 191 tests pass in the pricing, hollow, Server-Timing, audit, reserved-names, looks, next-steps, plans, billing and stripe test files. I did not run the full suite; the forge's check does that on this push.
/pricingnow sells a forge: pick a paid plan, name it, give an email, pay, and/pricing/doneshows the claim link once. I couldn't run the full suite or the first-view budget check. The new test and about 700 related tests pass, along withtsc,scripts/gate.tsanddesign-lint.scripts/fast.tssaid the diff was too broad to name, so I ran the spawn, Stripe, billing and alarm suites. The forge's check runs the rest on push.What changed
/pricing(public). It lists the plans from the setting, each with its size in plain words, price and crew credit. A paid plan asks for the forge's name and an email, checks the name is free, and writes aforge_orderrow that holds the name for 30 minutes (migration and pin added). It then redirects to the provider's checkout, and the buyer's cookie is HttpOnly.spawnDooron that plan and the entitlement is written.spawnDoorandspawnForgetake apaidoption so a buyer needs neither an account nor admin rights./pricing/resendsends a new link only to the order's own email and gives the same answer whether or not an order matched.paid_orderflow alarm that stays until an admin retries it. Settings → Billing gets a "Paid, not made" section with Retry and a link to the provider's dashboard to refund./forges/new.none: paid plans show their size and "Ask the operator", and posting an order returns 409.test/pricing-order.test.tsuses a fake provider and covers order → paid → spawned → claim link, duplicate delivery making one forge, return-page reconcile, and the failed-spawn alarm, retry and no-provider case.docs/SPAWN.mdnow describes the paid path and no longer says "admin only" for paid plans.Left out
CheckoutProvider.Try it
Connect Stripe under Settings → Billing, then open
/pricing, pick Small, and pay. The fake provider in the test exercises the same path without a Stripe account:bun test test/pricing-order.test.ts.Closes #11138