Public: anyone can read this; the crew can change it.
A deploy never makes two machines for one forge, a forge can be retired, and… #16558
Check · Review · Land · Live — Its check is red.
A deploy now adopts a machine or volume that already exists instead of making a second one, and sold forges boot only a pinned commit with a checksum-verified Bun. I added a read-only way to list what bills with no row, and a selling account is now refused to runs.
stopped failed before it answered deploy aa7d939
Check failed: check failed: gate: refused by 3 rules: both doors, name the issue, added lines…Check of aa7d939checked against main at d1589b0fast tier: red in 36s
Website spec: 25 findings (report only)
- /board http://127.0.0.1:39999/board answered 303 — https://specification.website/
- /notes http://127.0.0.1:39999/notes answered 303 — https://specification.website/
- /review http://127.0.0.1:39999/review answered 303 — https://specification.website/
- /system http://127.0.0.1:39999/system answered 303 — https://specification.website/
- /admin/limits http://127.0.0.1:39999/admin/limits answered 404 — https://specification.website/
- /maintenance http://127.0.0.1:39999/maintenance answered 303 — https://specification.website/
- /talk http://127.0.0.1:39999/talk answered 303 — https://specification.website/
- /flow http://127.0.0.1:39999/flow answered 303 — https://specification.website/
- /resilience http://127.0.0.1:39999/resilience answered 303 — https://specification.website/
- /boards?help http://127.0.0.1:39999/boards?help answered 303 — https://specification.website/
- /settings/crew http://127.0.0.1:39999/settings/crew answered 303 — https://specification.website/
- /settings/crew?help http://127.0.0.1:39999/settings/crew?help answered 303 — https://specification.website/
- /settings/security/controls http://127.0.0.1:39999/settings/security/controls answered 303 — https://specification.website/
- /settings/grants http://127.0.0.1:39999/settings/grants answered 303 — https://specification.website/
- /preview-admin/sample expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/drop http://127.0.0.1:39999/preview-admin/sample/drop answered 303 — https://specification.website/
- /preview-admin/sample/data-move http://127.0.0.1:39999/preview-admin/sample/data-move answered 303 — https://specification.website/
- /preview-admin/sample/cut-over http://127.0.0.1:39999/preview-admin/sample/cut-over answered 303 — https://specification.website/
- /preview-admin/sample/next?pick expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/bets expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/waves expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/space the first focusable element is not a skip link (an in-page #target link) — skip-link
- /looks/missing http://127.0.0.1:39999/looks/missing answered 404 — https://specification.website/
- /looks/failed http://127.0.0.1:39999/looks/failed answered 500 — https://specification.website/
- /nope/nothing http://127.0.0.1:39999/nope/nothing answered 404 — https://specification.website/
A deploy now adopts a machine or volume that already exists instead of making a second one, and sold forges boot only a pinned commit with a checksum-verified Bun. I added a read-only way to list what bills with no row, and a selling account is now refused to runs. Not done: a keep period for retire, a retire for strays, and a check that a sold forge can actually clone from its source.
Tests pass: the 28 related test files plus the new test/pinned-one-machine.test.ts (337 tests), tsc --noEmit, scripts/gate.ts --fix and design-lint. The forge's full check runs on this push. I did not run a real boot or deploy: the sandbox reaches no provider, so every cloud call is against a recorded fetch.
What changed
- One machine per forge. Before creating, the driver looks the volume and machine up by name (Hetzner by name and label, DigitalOcean by name and tag, volumes also by datacenter) and adopts what it finds. This is in
provisionandreplaceinsrc/cloud/machine.ts, withfindVolume/findMachinein both drivers. An answer with no usable id now throws; before, it recorded a machine id of"". - Retire (machine first, volume only on a second
withData, apinned.retiredevent) was already there on the tool, route and page. I addedstrayson thepinned_forgetool, backed bystrayCloudinsrc/actions/pinned.ts. It lists machines and volumes at the provider that carry the forge's label and belong to no row, and deletes nothing. It is tool-only, so it needs no new openapi route. - Ids and addresses. Hetzner ids go through
numericId, so an empty string is no longer 0.ipv4()now keeps only a public address: private, loopback, link-local, carrier-grade, benchmarking, multicast, reserved and leading-zero forms are refused. I kept TEST-NET addresses valid because the existing fixtures use203.0.113.9. - Bun. The boot no longer pipes
bun.sh/installinto a shell. It runs a script that downloads@oven/bun-linux-<arch>from the npm registry and installs it only if its sha512 matches a pin insrc/cloud/bun_install.ts. I took the 1.4.4 hashes from registry metadata and did not download the 107 MB packages to hash them myself. A test fails if.bun-versionmoves without matching pins. - Sales. A paid order takes a 40-hex commit only, from a host in
FORGE_SALE_SOURCES, and never from the selling forge's own host.FORGE_SALE_SOURCEis the git address a sold forge boots from and follows for updates. An empty list means no sale deploys. An admin's own deploy keeps the wider rule. This applies at checkout (room) and at deploy (deployForOrder). - Selling account. Only
barandhandOutinsrc/cloud/gate.tsgive a run a cloud token, and only whencloud.jsondeclares the vendor. The account named by "paid forges run on", and any account a pinned row records, is now refused whatevercloud.jsonsays (audited ashand-out:selling). Every otherresolveSecretscaller is a forge-side action, not a run. That covers places refresh, DNS, the cloud watch and snapshots, and none of them reaches a hosted forge's run.
Tests
- New tests cover:
- a lost machine-create response then a retry (one machine, both clouds), and the same for a lost volume;
- retire;
- strays;
- private addresses and digit-only ids;
- tag and unlisted-host refusal for a sale;
- the selling account refused to a run;
- the Bun pin.
- The recorded-cloud helper is now stateful and has a
lostfault. Existing sequence assertions in the pinned, Hetzner, recovery and harden tests gained the lookup calls. order-cloudandone-doornow setFORGE_SALE_SOURCESandFORGE_SALE_SOURCE.
Not done
- Source reachability.
trevato/forgeis private, so an anonymous clone returns 404, andownCodealready refuses a private source. A sale therefore needs the owner to publish a mirror and setFORGE_SALE_SOURCEandFORGE_SALE_SOURCES. Until they do, sold forges are refused at checkout with a sentence saying so. I could not check that any mirror is cloneable by a fresh machine. - Retire. No keep period; the second-word rule covers it.
- Strays. Each list reads one page of up to 50 (Hetzner) or 200 (DigitalOcean) items.
- Reuse.
bun scripts/similar.tswas not run. I extendedretire,replace,provisionand theDriverinterface in place instead of adding a parallel path.
Try it
- Set
FORGE_SALE_SOURCES=<host>andFORGE_SALE_SOURCE=https://<host>/<owner>/<repo>.git. - Set "paid forges run on" to a cloud account, then buy a forge.
- As an admin, call the
pinned_forgetool with{verb:"strays", target, account}to list what bills with no row.
[
{"go":"MCP tool pinned_forge {verb:\"strays\", target:\"hetzner\", account:\"main\"}","look":"the says line","expect":"names machines and volumes at the provider that carry a forge's label and belong to no row, or says none"},
{"go":"MCP tool pinned_forge {verb:\"deploy\", ...} with a deploy that times out after the provider made the machine, then deploy again","look":"the provider's machine list","expect":"one machine for the forge, and the row names it"}
]
🤖 Generated with Claude Code
A deploy now adopts a machine or volume that already exists instead of making a second one, and sold forges boot only a pinned commit with a checksum-verified Bun. I added a read-only way to list what bills with no row, and a selling account is now refused to runs. Not done: a keep period for retire, a retire for strays, and a check that a sold forge can actually clone from its source.
Tests pass: the 28 related test files plus the new
test/pinned-one-machine.test.ts(337 tests),tsc --noEmit,scripts/gate.ts --fixanddesign-lint. The forge's full check runs on this push. I did not run a real boot or deploy: the sandbox reaches no provider, so every cloud call is against a recorded fetch.What changed
provisionandreplaceinsrc/cloud/machine.ts, withfindVolume/findMachinein both drivers. An answer with no usable id now throws; before, it recorded a machine id of"".withData, apinned.retiredevent) was already there on the tool, route and page. I addedstrayson thepinned_forgetool, backed bystrayCloudinsrc/actions/pinned.ts. It lists machines and volumes at the provider that carry the forge's label and belong to no row, and deletes nothing. It is tool-only, so it needs no new openapi route.numericId, so an empty string is no longer 0.ipv4()now keeps only a public address: private, loopback, link-local, carrier-grade, benchmarking, multicast, reserved and leading-zero forms are refused. I kept TEST-NET addresses valid because the existing fixtures use203.0.113.9.bun.sh/installinto a shell. It runs a script that downloads@oven/bun-linux-<arch>from the npm registry and installs it only if its sha512 matches a pin insrc/cloud/bun_install.ts. I took the 1.4.4 hashes from registry metadata and did not download the 107 MB packages to hash them myself. A test fails if.bun-versionmoves without matching pins.FORGE_SALE_SOURCES, and never from the selling forge's own host.FORGE_SALE_SOURCEis the git address a sold forge boots from and follows for updates. An empty list means no sale deploys. An admin's own deploy keeps the wider rule. This applies at checkout (room) and at deploy (deployForOrder).barandhandOutinsrc/cloud/gate.tsgive a run a cloud token, and only whencloud.jsondeclares the vendor. The account named by "paid forges run on", and any account a pinned row records, is now refused whatevercloud.jsonsays (audited ashand-out:selling). Every otherresolveSecretscaller is a forge-side action, not a run. That covers places refresh, DNS, the cloud watch and snapshots, and none of them reaches a hosted forge's run.Tests
lostfault. Existing sequence assertions in the pinned, Hetzner, recovery and harden tests gained the lookup calls.order-cloudandone-doornow setFORGE_SALE_SOURCESandFORGE_SALE_SOURCE.Not done
trevato/forgeis private, so an anonymous clone returns 404, andownCodealready refuses a private source. A sale therefore needs the owner to publish a mirror and setFORGE_SALE_SOURCEandFORGE_SALE_SOURCES. Until they do, sold forges are refused at checkout with a sentence saying so. I could not check that any mirror is cloneable by a fresh machine.bun scripts/similar.tswas not run. I extendedretire,replace,provisionand theDriverinterface in place instead of adding a parallel path.Try it
FORGE_SALE_SOURCES=<host>andFORGE_SALE_SOURCE=https://<host>/<owner>/<repo>.git.pinned_forgetool with{verb:"strays", target, account}to list what bills with no row.🤖 Generated with Claude Code
Closes #16219