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

opened this in answer to

Check · Review · Land · Live — Its check is red. Next: builder, its check is red.

Ready to land

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.

Notes · 22 files · +713 −71

stopped failed before it answered — 27323 passed, 3 failed: /forges/new: where it runs > an admin's cloud forge at a chosen place is a $0 order with no checkout, and goes to its making page with the claim link, two processes on one data directory start each run once > the crew is queued on each issue once, whichever process asks, fetch timeouts > every fetch in src carries a signal or a reason deploy a5890e7

Check failed: /forges/new: where it runs > an admin's cloud forge at a chosen place is a $0 o…Check of a5890e7checked against main at 0cd2497fast tier: red in 24m08s

Website spec: 25 findings (report only)
opened this

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 provision and replace in src/cloud/machine.ts, with findVolume/findMachine in 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, a pinned.retired event) was already there on the tool, route and page. I added strays on the pinned_forge tool, backed by strayCloud in src/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 use 203.0.113.9.
  • Bun. The boot no longer pipes bun.sh/install into 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 in src/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-version moves 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_SOURCE is 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 bar and handOut in src/cloud/gate.ts give a run a cloud token, and only when cloud.json declares the vendor. The account named by "paid forges run on", and any account a pinned row records, is now refused whatever cloud.json says (audited as hand-out:selling). Every other resolveSecrets caller 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 lost fault. Existing sequence assertions in the pinned, Hetzner, recovery and harden tests gained the lookup calls.
  • order-cloud and one-door now set FORGE_SALE_SOURCES and FORGE_SALE_SOURCE.

Not done

  • Source reachability. trevato/forge is private, so an anonymous clone returns 404, and ownCode already refuses a private source. A sale therefore needs the owner to publish a mirror and set FORGE_SALE_SOURCE and FORGE_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.ts was not run. I extended retire, replace, provision and the Driver interface in place instead of adding a parallel path.

Try it

  • Set FORGE_SALE_SOURCES=<host> and FORGE_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_forge tool 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

Closes #16219

3 earlier comments
commented

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 provision and replace in src/cloud/machine.ts, with findVolume/findMachine in 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, a pinned.retired event) was already there on the tool, route and page. I added strays on the pinned_forge tool, backed by strayCloud in src/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 use 203.0.113.9.
  • Bun. The boot no longer pipes bun.sh/install into 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 in src/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-version moves 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_SOURCE is 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 bar and handOut in src/cloud/gate.ts give a run a cloud token, and only when cloud.json declares the vendor. The account named by "paid forges run on", and any account a pinned row records, is now refused whatever cloud.json says (audited as hand-out:selling). Every other resolveSecrets caller 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 lost fault. Existing sequence assertions in the pinned, Hetzner, recovery and harden tests gained the lookup calls.
  • order-cloud and one-door now set FORGE_SALE_SOURCES and FORGE_SALE_SOURCE.

Not done

  • Source reachability. trevato/forge is private, so an anonymous clone returns 404, and ownCode already refuses a private source. A sale therefore needs the owner to publish a mirror and set FORGE_SALE_SOURCE and FORGE_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.ts was not run. I extended retire, replace, provision and the Driver interface in place instead of adding a parallel path.

Try it

  • Set FORGE_SALE_SOURCES=<host> and FORGE_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_forge tool 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

commented

I merged main into the branch, resolved the one conflict, and pushed. The cloud and machine tests pass (404 across 42 files) and bun x tsc --noEmit is clean. I did not run the full suite or the gate's rule checks; the forge's check runs them on this push.

  • src/cloud/machine.ts: main's early boot commands and this branch's BUN_INSTALLER step now both stay in bootConfig. The early commands run first, then the installer.
  • OVHcloud driver: main added OVHcloud, which had no findMachine, findVolume or listForges, so type-checking failed. src/cloud/ovh.ts now implements all three, and a deploy there looks for an existing instance and volume before creating one.
  • listForges on OVHcloud: it scans both US regions and matches instances named forge-* and volumes whose description starts forge:. No test exercises it; the fake in test/pinned-ovh.test.ts returns empty lists.
  • test/pinned-ovh.test.ts:
    • The recorded OVHcloud fake now answers the new volume and instance list calls.
    • The expected call sequences include the two new GET calls.
    • The mkfs-before-install check now looks for the installer command, because the boot config no longer contains the curl line.

bun scripts/gate.ts still reports "both doors", "name the issue" and env-restore findings on this branch. I did not look into whether they predate the merge.

commented

<!-- look-pages 0a5730d13a7a --> Look pages for 0a5730d, from the gate:

  • look pages (inferred): this pull changes src/web/chrome.ts, src/web/comments.ts, src/web/diff-view.ts and 2 more; the forge pictures / (src/web/chrome.ts), /docs (src/web/chrome.ts), /explore (src/web/chrome.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

This push only clears the three gate refusals that failed pull #16558. The one-machine change itself is untouched. bun scripts/gate.ts --explain now shows no failures; the remaining notes are over-wide comments and two similar-function warnings, which it says need no action. bun x tsc --noEmit printed nothing, which I read as clean. I ran four test files, which pass: one-door, order-cloud, pinned-ceiling and pinned-one-machine. scripts/fast.ts said the diff reaches 3,629 test files, so I picked those four myself rather than run the whole suite. The forge runs the full check on this push.

  • Rewrap noise: an earlier gate.ts --fix had rewrapped comments this pull did not write. I restored 16 files to main's version, since their only differences were rewrapped comments. test/pinned-ceiling.test.ts keeps its real change (strays allowed as a bare driverOf use, count 7 → 8), and I undid only its rewrap.
  • Environment restores: the FORGE_SALE_SOURCES and FORGE_SALE_SOURCE lines in test/one-door.test.ts and test/order-cloud.test.ts are already undone in afterAll. I marked each set and delete with // env-restored: for the gate.
  • Both doors: I chose a No door: line in the commit message over a new terminal screen or feature page. bun_install.ts and sale_source.ts are deploy-time guards with no screen of their own, and docs/features/pinned-forge.md already covers the pinned forge. This is a judgement call if a reviewer wants a how-to page instead.

I did not touch the two similar-function notes (isPublic and answer).

No page changes, so there is no review block.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs