Public: anyone can read this; the crew can change it.
A paid checkout deploys the buyer's forge on its own machine, and an at-cost… #16205
Landed in pull #16559 · 3 runs · run
2 earlier comments
Direction from the owner, 2026-11-24: buyers will come through the New forge button, so the cloud machine goes BEHIND that door, not beside it. A map of the code (origin/main at 0486fe445) shows the purchase path already does most of this issue: placeOrder → Stripe session → webhook or confirm-on-return → spawnOrder → spawnDoor({plan}, {paid: true}) (src/actions/order.ts:176), with order states, a failed state, claim mail and resend, entitlement and lapse. What is missing is narrow: make() (src/actions/spawn.ts:443) only knows placementFor = cell or hosted (src/spawn/door.ts:153), and CLOUD_BODY_CONFIGURED is false (src/spawn/placement.ts:20).
So this issue becomes: a third Placement, cloud, that the same door uses.
cloudPlacement.place(plan)calls the pinned deploy at the plan's default place (chooseDefault,src/cloud/places.ts:170) or the place the buyer chose, on the cloud account the owner named for sales, under that account's ceiling.retire(bodyId)calls pinned retire.room()says why not when the ceiling, the catalog or the account would refuse, before anyone pays.- Which placement: one forge setting, "paid forges run on" = hosted (today, the default) or a named cloud account. Free forges stay hosted. A paid order on a cloud setting never falls back to hosted silently: it fails into the order's existing
failedstate with the reason. deployPinnedrequires an admin actor (src/actions/pinned.ts:173). A purchase is not an admin: add a system actor for an order's deploy, recorded on the pinned row and the event as "order <id>", not a borrowed admin.make()skipscopyIntofor a cloud body. The claim is the pinned claim (hash on the machine, 7 days), notmintClaim;spawnOrderreturns that link, and/pricing/doneand the order mail carry it. A machine takes minutes: the order gets amakingstate the done page polls, and the claim link is shown and mailed only once the forge answers on HTTPS. Never two machines for one order (spawningNowalready guards a slow spawn; keep that guarantee across restarts).- What a cloud forge does NOT get, because each needs the parent in the same process or on loopback: the parent proxying
<name>--<parentHost>, sleep and wake, lent crew credit overFORGE_PARENT_LOCAL(src/apps/egress.ts:126),heartbeat/reach/child_db, following the parent's updates. A cloud forge has its own name, takes its own updates and backups (#16204), and its owner brings their own AI key. The plan's included crew credit cannot be lent to it this way: do not promise it on a cloud plan until there is another way to give it; say so on the page. - Lapse and cancel for a cloud forge: after grace, power the machine off (keep the volume, say what happens when); after retention, retire with the buyer warned first.
sleepLapsed(src/spawn/host.ts:527) only knows hosted children. - Words that are wrong for a standalone forge and must branch on placement:
AFTER_PAYMENT_STEPS(plan_words.ts:79),lapseRuleWords(lapse_rule.ts:17),KEY_BUDGET_NOTE(plan.ts:32), and the<name>--<parent>address onpricing.ts:199. Fix the stale comment atplacement.ts:5while there. - At-cost codes and "price follows the place" stay as written above, on this same door.
Depends on, all in flight: deploy at a catalog place, DNS written by the forge with a base domain (no hostname asked of the buyer), and retire.
Files: src/spawn/placement.ts, src/spawn/door.ts, src/actions/spawn.ts, src/actions/order.ts, src/actions/pinned.ts, src/spawn/host.ts, src/billing/lapse.ts, src/web/pages/pricing.ts
A paid checkout deploys the buyer's forge on its own machine, and an at-cost code sells it for what it costs
Today a completed Stripe checkout ends in a forge hosted inside the owner's forge. The owner wants a sale to produce a standalone forge on a cloud machine, and to be able to hand someone a code that gives them a forge at cost.
What done looks like:
forgescodes). Add a kind: at cost. A buyer with an at-cost code pays the place's monthly cost plus the payment fee, rounded up to the next dollar, for as long as the subscription runs; the page shows the normal price struck through and "at cost" with the amount. When a place's cost changes, an at-cost subscription follows at its next renewal after notice. The owner makes, lists and revokes at-cost codes where he makes free ones, with uses and expiry as now.Proof: in the Stripe sandbox, a purchase with no code, one with a chosen dearer place, and one with an at-cost code each end with a claimed forge on its own machine and the right amount charged; a cancelled one stops and comes back with its data.
Depends on the places catalog and on a pinned forge having its own name, HTTPS and backups.