A pinned forge (#8697)
A pinned forge is a forge the owner put on their own cloud. The forge that deployed it gives it no crew and no automatic release: on its machine it runs and updates its own code (see "Its own code"). Its recorded version and config change only through one explicit Update, recorded with who and when; Rollback is one action to the previous version. It is served on its own name over HTTPS, and its first admin is whoever holds the one-time claim link the deploy shows (#16217).
Doors (forge admin, admin-scope token)
- HTTP:
GET /api/v1/admin/pinned(forges, their changes, the targets),POST /api/v1/admin/pinned(deploy; the answer holdsclaim.link),POST /api/v1/admin/pinned/:name/update,POST /api/v1/admin/pinned/:name/rollback,POST /api/v1/admin/pinned/:name/claim(a new claim link). - Terminal: palette → Pinned forges (forge admin):
ddeploy,uupdate,rroll back,na new claim link (asked first); a deploy andnshow the link in a dialog to copy; it follows the bus, so a change made at any door shows at once (src/tui/screens/pinned.ts). - Web:
/deploy-to(forge admin; linked from Cloud accounts) is a server-rendered form for cloud account, app, source, version, name and hostname. Its answer is a page with the claim link, sentno-store, not a redirect. The link/deploy-to?app=owner/name&source=https://…&version=v1.2.3(deployToHrefinsrc/web/pinned.ts) lands on it with those filled in after one sign-in; nothing deploys until the button is pressed. The POST is same-origin checked and calls the samedeployPinned(src/http/pinned_routes.ts). - Web list:
/pinned(forge admin; 404 otherwise) is server-rendered, with actions; one block of plain rows per forge: name, app, version, address (a link), health (the state), when the last check ran (the newestpinned.checkevent;never checkedbefore the first), and the last change with who and when, from the samepinnedForgesread as the API (src/web/pages/pinned.ts). The intro links/deploy-to; an empty list says so. A person can update, roll back and check a forge from/pinned, as the terminal'su,randcdo: each row has four buttons (Update, Roll back, Check, New claim link), and each goes through the confirm page before it runs (Update also asks for the version). The row also shows the DNS record and when the claim link runs out. They post toPOST /pinned/:name/:act(actisupdate,rollback,checkorclaim; admin only, same-origin, 404 for non-admins and unknown acts); the result, or the sentence that refuses it, is shown as a flash on/pinned(src/http/pinned_routes.ts). - MCP:
pinned_forgewithverblist,deploy,claim,update,rollback(andcheck) — the same words and the same checks (src/actions/pinned.ts).
A deploy names a cloud account (Settings → Cloud accounts, writes allowed), the app (owner/name), a git source (https), a version (a 40-character commit id or a tag like v1.2.3 — never a branch, so nothing moves under it) and a host: the DNS name the forge is served on. Left empty, source is this forge's own repository at its public address (<FORGE_URL>/<forgeRepo>.git, which must be public) and version the commit this forge runs (FORGE_COMMIT); either refusal says which is missing (ownCode in src/actions/pinned.ts).
Its own code (#16361)
The machine boots the source at the version from /opt/forge, and from then on runs its own repository. Its boot sets FORGE_REPO=forge/forge, FORGE_UPSTREAM (the source), FORGE_COMMIT (the version, when it is a commit), FORGE_RELEASE_KEEPER=swap and FORGE_SELF_SWAP=1; none of them is a setting a deploy may name. At first boot, before any claim, the checkout's history and tags become forge/forge (a reserved organisation with nobody in it yet), its main at the commit the machine runs. That repository is the forge's source, its crew is seated on it, and it follows FORGE_UPSTREAM's main with take-updates (src/spawn/own_forge.ts). A restart finds it and changes nothing.
At the claim the repository moves to the new admin's own account (<admin>/forge, the old path a redirect), and the forge's source names it there. The release keeper swaps in what lands on its main, so a merge there, or an update taken from the forge it was deployed from, updates the forge on its machine. A forge deployed from that one follows it in turn. The boot also installs Claude Code (npm install -g @anthropic-ai/claude-code) for the owner's crew; when that fails the forge starts without it.
An update that conflicts with a change made here opens one issue naming the files, and a builder takes it only when Crew resolves upstream conflicts is on. That is a setting of every repository that follows an address (crew_resolves on repo_upstream), off by default whatever the repository's autonomy, on its Follow upstream card with the words: "When an update from <upstream> and a change made here touch the same lines, the crew merges them for you. Off: the update waits, and an issue names the files for you to decide in the code." On the forks screen an admin presses r to turn it on or off (setCrewResolving in src/actions/upstream_follow.ts).
On /deploy-to, Source and Version are optional; left empty, they are this forge's own code.
Not yet: a launcher on the machine that brings back the last good tree when a swap fails at boot, a release that waits for a green check, and a private source (the machine reads it without a credential).
The name and HTTPS (#16217)
A forge is served at https://<host>/ and nowhere else. host is a full lowercase DNS name you control (forge.example.com): no address, port, wildcard or trailing dot, checked by one pattern (validHost in src/core/pinned.ts) before it is written anywhere, and one forge a name.
- The certificate is the machine's own. The forge has no ACME client. Caddy is one of the machine's packages, from Ubuntu's repository, running as its own service under its own user (never inside the forge's unit), with a config that is the name,
reverse_proxy 127.0.0.1:<PORT or 3000>and where certificates are kept (proxyConfiginsrc/cloud/machine.ts). Caddy gets a certificate for that name from Let's Encrypt, renews it, redirects port 80 to 443 and answers no other name. The config is written to/etc/caddy/Caddyfilebefore the package is installed (cloud-init writes files first, and dpkg keeps a config file that is already there), so Caddy never serves its welcome page. - The certificate lives on the data volume, in
<mount>/caddy, owned by Caddy's user and skipped by the forge's ownership walk. An Update, Roll back or new claim link starts a machine that finds it there and asks Let's Encrypt for nothing; otherwise six replacements in a week would meet its limit of five certificates for one name. Caddy waits for the volume's mount (aRequiresMountsFordrop-in). - The forge listens on loopback. The machine's environment sets
FORGE_BIND=127.0.0.1,FORGE_URL=https://<host>,FORGE_HOST=<host>andFORGE_TRUSTED_PROXIES=127.0.0.1/32(servedEnv); a deploy's config may not name them. So until the certificate exists nothing of the forge can be reached, and plain HTTP only ever gets the proxy's redirect and its ACME challenge.FORGE_BINDgoverns the web listener alone, and the SSH listener binds every interface, so the machine's environment also setsFORGE_SSH_PORT=0: a pinned forge has no SSH listener, and git and every door go over HTTPS. - One DNS record, written for you or by you.
<host> A <address>, DNS only (not proxied). With a Cloudflare account that allows writes whose token can edit the zone holding the name, the forge writes it itself (see "Pay and go" below) and the deploy answer and Check say so; otherwise the deploy answer names it when the cloud has already assigned the address, and Check reads the address and names it. Every view carries it asdns, anddnsWrittenBysays which account wrote it, empty when it is yours to make. - The address changes when the machine is replaced. Update, Roll back and a new claim link each start a new machine on the same volume, and a new machine has a new address: the forge updates the record it wrote (the same record, never a second one); a record you made by hand is yours to change, and Check says "waiting for DNS" with the new record until you do.
The claim (#16217)
A deploy is for one person. Its answer holds a claim link, https://<host>/first-admin#<code>, shown once: on the page, in the HTTP and MCP answer (claim.link, claim.expiresAt), and in the terminal's dialog. Whoever opens it makes the forge's first admin with a passkey; an agent trades the part after # at POST /api/v1/first-admin for a token. It works once, for 7 days (FIRST_ADMIN_SEED_TTL_MS), and never once the forge has an admin. A visitor without it gets the refusal any wrong code gets, and a new forge's signup is by invite, so nobody else gets an account there first.
- Nobody stores the link. This forge keeps its sha256 and deadline (
pinned_forge.claim_hash,claim_expires); the machine is booted with the same two asFORGE_FIRST_ADMIN_SEED=<sha256>@<deadline>. Boot config stays readable through the cloud's API and the machine's metadata endpoint, so it must not open the forge, and a hash does not.test/pinned-claim.test.tsshows the boot config is a function of the stored row and that the row, the events and the audit hold no form of the link. - It is the first-admin code, not a second mechanism. At boot the deployed forge takes the seed as its one first-admin row (
seedFirstAdmininsrc/core/first_admin.ts): the same row--first-adminwrites, spent by the same statement at the same doors under the same throttle. Each seed is taken once, so a restart revives nothing; a seed that is not a hash and a deadline stops the boot. - A new claim link (
claim,n, the button) is for a link that ran out unused or was lost. A new hash can reach a machine nobody can sign in to only through new boot config, so the machine is replaced on its volume, as an Update replaces it; the forge takes the new seed and the link before it is dead. It is refused once the forge has said it was claimed (After the claim, below), and a replacement the cloud refuses issues nothing: the row takes the new hash only when the machine that holds it exists. - Check says what became of it. Once the forge answers, Check asks it
GET /api/v1/first-admin/claim?seed=<sha256>, which answerswaiting,claimedorexpiredto that hash and 404 to anything else. The result carries it asclaim(unknownwhile the forge cannot be asked). - A forge deployed before forges had names has no
host: Update and Roll back are refused until a new claim link gives it one (the claim takeshostonce).
Why it cannot move on its own
pinned_forge.version and .config are guarded by a SQLite trigger (migration 20261103090000-pinned-forge): an UPDATE passes only with a change_id that points at a newer update or rollback row in pinned_change whose target is exactly the new version and config. pinned_change cannot be updated or deleted. crew and auto_release are CHECKed to 0. test/pinned-forge.test.ts tries each other way and fails if one works. A pinned forge is a row and a droplet, not a repository on this forge, so the crew, the release keeper and upstream following have nothing of it to touch.
Credentials
The cloud token stays sealed. It is opened for the one call that needs it (a secret.read event names the run), sent as an Authorization header over HTTPS, and never reaches argv, a row, an event, a request body or the boot script. The boot script holds no secret: of the claim it carries the sha256 alone (see The claim). Config refuses names that look like secrets.
What the booted machine is (#16218)
A pinned forge runs on a public address, so its machine is set up for that (src/cloud/harden.ts; test/pinned-harden.test.ts).
- User. The forge runs as
forge, an unprivileged system user with no login shell, never as root. Bun is installed under/opt/bun, owned by root, so the forge can run it and cannot change it. The checkout is/opt/forge, owned byforgeand read-only to the running service. The unit setsNoNewPrivileges,PrivateTmp,ProtectSystem=strict,ProtectHome,RestrictSUIDSGID, and nothing that hides a part of /proc or /sys (the sandbox mounts its own /proc and may only under a whole one), and leaves only the data volume and/var/lib/forgewritable. At every start the volume is madeforge's, which also covers a volume an earlier root forge wrote. - Ports. Only 80 and 443 are open to the world, by ufw on the machine. What listens on them is the machine's proxy (The name and HTTPS); the forge's own port is bound to loopback and closed from outside, and it has no SSH listener. The provider's own firewall (Hetzner firewalls, DigitalOcean cloud firewalls) is not used yet.
- SSH. Port 22 is closed, password login is off, root login is off, and only public keys could ever be accepted. Nobody gets a shell. No root password is ever made: both clouds email one to the account holder when a server is created with no SSH key, so each create sends a fresh Ed25519 public key whose private half was never exported and is dropped at once, and deletes the key from the account after the call (
src/cloud/throwaway_key.ts). The DigitalOcean token therefore needs the SSH key write permission as well as droplets and volumes. - Updates. Security updates install themselves (
unattended-upgrades), and the first boot upgrades packages. The machine does not reboot by itself: a new kernel takes effect at the next Update, which replaces the machine. - Sandbox. The boot installs bubblewrap and socat. Ubuntu 24.04 refuses user namespaces to unconfined programs (
kernel.apparmor_restrict_unprivileged_userns=1), so an AppArmor profile (/etc/apparmor.d/forge-bwrap) lets/usr/bin/bwrap, and only it, make one; the system-wide setting stays on. Where bubblewrap still cannot start, the forge says so (agent sandbox not available here; runs are unrestricted,src/crew/dispatch.ts), and a pinned forge has no crew. The machine's environment setsFORGE_CREW_SANDBOX=require(#16233): where the profile did not load (the boot goes on), no agent process starts, a run's log and a refused turn name the cause, and that forge's admin reads it at the foot of every page (Reduced protection: crew shells (…) its runs are refused). The forge asks again each minute while something waits, so loading the profile by hand needs no restart. - Config. A config name that steers the loader, the runtime or the path (
LD_*,DYLD_*,NODE_*,BUN_*,GIT_*,PATH,HOME,SHELL,USER,IFS,ENV,BASH_ENV,TMPDIR, …) is refused, as is any name that looks like a secret (secret, token, password, passphrase, auth, cookie, credential, private, key). So is a name the boot sets itself (BOOT_NAMESinsrc/core/pinned.ts:FORGE_URL,FORGE_HOST,FORGE_BIND,FORGE_TRUSTED_PROXIES,FORGE_SSH_PORT,FORGE_FIRST_ADMIN_SEED,FORGE_CREW_SANDBOX,FORGE_APP_DATA); those are written after the config,FORGE_APP_DATAlast.
What only a real boot proves
On a new machine (reach it through the provider's console, since SSH is closed): ufw status verbose lists only 80 and 443; systemctl show forge -p User says forge and ps -o user= -C bun too; sshd -T | grep -Ei 'passwordauthentication|permitrootlogin' says no; apt-config dump | grep Unattended-Upgrade:: and systemctl status apt-daily-upgrade.timer; journalctl -t forge-boot says sandbox ready; systemd-run --wait --pty -p User=forge -p NoNewPrivileges=yes -p ProtectSystem=strict -p PrivateTmp=yes bwrap --unshare-user --ro-bind / / -- /bin/true exits 0 (the one that proves NoNewPrivileges and bubblewrap agree); the same with every directive of the unit and a sandbox that mounts its own /proc, systemd-run --wait --pty -p User=forge -p NoNewPrivileges=yes -p ProtectSystem=strict -p ProtectHome=yes -p PrivateTmp=yes -p ProtectKernelModules=yes -p ProtectClock=yes -p RestrictSUIDSGID=yes bwrap --unshare-user --unshare-pid --ro-bind / / --proc /proc --dev /dev -- /bin/true, exits 0 (the unit hides no part of /proc, which is why it has no ProtectKernelLogs); stat -c %A /usr/bin/bwrap is not setuid; journalctl -u forge shows no read-only-file-system error from the checkout; systemctl is-active caddy says active and ss -ltnp shows Caddy on 80 and 443 and Bun on 127.0.0.1 alone; cat /etc/caddy/Caddyfile is the forge's own and curl -s http://<address>/ never showed Caddy's welcome page (the claim that dpkg kept the file); stat -c %U <mount>/caddy says caddy after a forge restart; once the DNS record exists, journalctl -u caddy shows the certificate obtained, and after an Update it shows none requested. HTTP/3 is not offered a way in (ufw opens 443/tcp only; browsers fall back). The forge's start walks the whole volume to set ownership, which is slow on a large one. No email from the provider with a root password arrives.
Where it is made: the place (#16205)
A deploy is made at a place from the Places catalog (GET /api/v1/places): provider:datacenter:size, such as digitalocean:sfo2:s-1vcpu-2gb. Every door takes it as place (the API body and MCP tool field, the Place select on /deploy-to, an optional last word of the terminal's d line). Left out, it is the catalog's default for the small plan among the chosen account's provider (the cheapest orderable place in the United States, or the one pinned on Places). The place must exist in the catalog, be orderable and be on the account's provider; otherwise the deploy is refused in a sentence, before any call to a provider. ARM sizes are listed with their reason and are never offered: the machine boots x86 only.
The row records its place (datacenter and size, in pinned_size); the volume and the machine are made in that datacenter, and every replace (Update, Roll back, a new claim link) orders the row's own place, never today's default, because the volume lives there. The ceiling prices that place. A forge deployed before places were kept has none recorded and is read as the place the drivers once hard-coded (DigitalOcean nyc3 s-1vcpu-2gb, Hetzner nbg1).
Pay and go: no DNS work for the buyer (#16205)
An admin names the domain for deployed forges (forges.example.com) on Pinned forges (/pinned; the terminal's b; PATCH /api/v1/admin/settings with {"pinnedDomain": "forges.example.com"}, null to clear; the MCP tool's domain verb). It is a forge setting (settings/pinned_domain.ts, pinned.base_domain, every change kept with who and when). With one set, a deploy needs no hostname: the forge is served on <name>.<domain>; a full hostname may still be given (the terminal's - takes the default).
With a Cloudflare cloud account attached and writes allowed, the forge then writes the record itself: after the machine has an address (the deploy, and every Update, Roll back and new claim link), and again on Check, it upserts <host> A <address> in the zone that holds the name, through the first such account whose token can edit that zone: found by name and updated, or made, so a replaced machine's new address changes the record and never adds one; DNS only (not proxied, so the machine gets its own certificate), TTL 60. The calls go to api.cloudflare.com only (upsertARecord, src/cloud/providers.ts), the token in the Authorization header alone, each call audited as pinned:dns like the other cloud calls; the record's id and zone are kept (pinned_dns) with the account that wrote it. A zone the token cannot see or edit, a CNAME already at the name, or any refusal leaves the record for a person to make, and the deploy answer and Check say that instead (dnsWrittenBy is empty). The token needs DNS edit on the zone; the cloud account's check cannot tell that, so the first write is the proof.
Paid forges on a cloud machine (#16205)
An admin chooses where paid forges run on Pinned forges (/pinned; the terminal's p; PATCH /api/v1/admin/settings with {"paidPlacement": "digitalocean/main"}, "hosted" or null for the default; GET answers it as paidPlacement). It is a forge setting (settings/paid_placement.ts, paid.placement, every change kept with who and when). hosted, the default, is today's: a bought forge runs inside this one. A cloud account (one a pinned forge can be deployed to, with writes allowed) makes each paid order a pinned forge of its own (src/spawn/cloud_placement.ts). Free forges always stay hosted.
- Told before paying.
/pricing(and the terminal's pricing screen) asks the cloud placement'sroombefore the checkout is made: no domain for deployed forges, a catalog never read, a default place that cannot be ordered, or a deploy the account's ceiling would refuse, each is said in the deploy's own sentence, and nothing is held or charged. - Deployed as the order. Once paid, the forge is deployed at the catalog's default place for the plan, with no hostname (it is served on
<name>.<domain>), running the forge's own source repository (public, cloned from this forge over https) at the commit this forge runs (FORGE_COMMIT; the release tag when the build names none; a forge run from source refuses). The deploy acts as the order, never a borrowed admin: the row's history saysorder:<id>, its events carryorderand no actor, and the token reads name the order in their run. Every refusal an admin's deploy has (target, catalog, place, ceiling) applies. - Making, then the link. A machine takes minutes, so the order is
making(/pricing/donesays so and refreshes) until the forge answers on its name: the pinned check, asked as the order at most every 15 seconds by the order's row, by the page and by this process for 15 minutes after the deploy. The claim link is the pinned one, issued with the machine: kept sealed as a forge secret (ORDER_CLAIM_<id>, each read audited) until the order isspawned, then mailed (when the forge can mail) and shown once on the done page, after which it is deleted. - Never two machines, never hosted instead. A restart while making only asks again. A spawn lost to a restart after its machine was recorded issues a new claim instead (the machine replaced on its own volume); one lost before is deployed again on its volume. A refused deploy leaves the order
failedwith the sentence, for an admin to retry or refund; it is never made hosted. - Not yet. Lapse and cancel do nothing to a cloud forge;
/pricing/resendcannot issue a new link for one (it would replace the machine); the crew credit a paid plan lends is lent over loopback to hosted forges and does not reach a cloud one (the plan rows on/pricingstill state it); the after-payment steps, the lapse words, the key note and the<name>--<parent>address on/pricingstill describe a hosted forge.
Retiring a forge (#16219)
A test forge, or one whose buyer left, would bill forever without a way out. Retire (POST /api/v1/admin/pinned/:name/retire, the pinned_forge tool's retire verb, Retire on /pinned, x in the terminal) deletes the forge's machine and the DNS record the forge wrote for it (job above), and keeps its data volume: the answer says what keeping it costs a month at list price. The row ends retired, and the account's ceiling counts it at that volume's price alone. The volume is deleted only by the second word: withData on the API and the tool, Retire and delete its data on the page (which asks for the forge's name), and a second choice and the name in the terminal. That call is the data-destroying one under the delete tier (tier: "delete" on the tool, test/delete-tier.test.ts): the forge's own agent is refused it with the page to use. A retired forge can be retired again with its data, and nothing else: Update, Roll back, a new claim link and Check refuse it. It is idempotent: a machine or volume already gone at the cloud (a 404) is done, so asking again finishes a retire whose volume the cloud would not delete (the machine is gone and the forge retired by then, its data kept). A forge its buyer has claimed, as the forge itself says when asked (or as recorded), is refused with the sentence that its data is on that volume, unless despiteClaim says the owner means it (the page's form for a claimed forge carries it; the terminal asks in its question). One event, pinned.retired, says who, whether the data went, and what became of the record.
After the claim: what the host can still do (#16204)
Nobody marks a forge claimed by hand: the deployed forge says so. Check, and every Update, Roll back and request for a new claim link, asks it first; when one hears claimed (The claim, above), the selling forge records it once (pinned_forge.claimed_at, event pinned.claimed). From then it refuses update, rollback and a new claim link for that forge, each with the same sentence (CLAIMED_REFUSAL): updates are the buyer's to take, and no machine of theirs is replaced from here. A forge that cannot be asked is never recorded as claimed, and is not taken as unclaimed either: once its current machine has answered about its claim (pinned_forge.reached), silence from it (a broken DNS record, a forge that is down) refuses Update, Roll back and a new claim link, with a sentence saying the forge could not be reached to confirm nobody claimed it and to run Check until it answers. A forge whose current machine has never answered (still booting, DNS not pointed yet, a first boot that failed) may still be replaced, or it could never be recovered. The question starts with a read of the machine at its cloud: when the cloud refuses that read the change is refused with the cloud's answer, before anything is recorded; a machine that is gone (404) has nobody to ask and is replaced. /pinned (once, when any forge is claimed) and /deploy-to say what the host still can while the machine is in the host's cloud account (HOST_CAN in src/core/pinned.ts): open its console, boot it into rescue, snapshot its disk, read its boot data. It never says "no access". The path that gives the host none is the buyer's own cloud account: deploy there (the account picker on /deploy-to; choosing it at purchase is #16203).
Targets: what runs, what it costs, what is refused
Prices are list prices as last read (USD a month); the owner's own bill is the truth. Source of truth in code: src/cloud/targets.ts.
| Target | Status | What runs | Cost | Refused / caveat |
|---|---|---|---|---|
| DigitalOcean | deploys today | One droplet (Ubuntu 24.04) at the forge's place, with a 10 GiB block volume in the same datacenter as FORGE_DATA. An Update deletes the droplet and starts a new one on the same volume, so data is untouched. | ~$12 + ~$1.20 | A token cannot be narrowed below "create droplets and volumes". |
| Hetzner Cloud | deploys today | One server (Ubuntu 24.04) with a 10 GiB volume as FORGE_DATA, at the forge's place. See deploy-to-hetzner.md. | the API's list price + the volume | The token must be read-write; Hetzner offers nothing narrower. |
| AWS | not written | EC2 t4g.small + EBS gp3, same boot script; SigV4 already exists for reads. | ~$12 + ~$0.80 + public IPv4 ~$3.65 | Wants a role scoped to a tag rather than a long-lived key. |
| Azure | not written | B1ms VM + managed disk through a service principal on one resource group. | ~$15 + ~$1 + public IP ~$3.65 | Needs a resource group, network and public IP first: three calls more. |
| Cloudflare | refused | Workers/Durable Objects keep state, but not as files a Bun process opens. Containers run, with a disk wiped on sleep or replace. | Workers Paid from $5 | No volume that survives; the forge refuses rather than lose repositories quietly. |
| Vercel | refused | Functions and Sandboxes: short-lived, scratch disk. | Pro from $20/seat | No long-running process, no persistent disk. Vercel can host an app a forge ships, not the forge. |
The cloud facts for Cloudflare and Vercel are from memory of their documentation, last written 2026-11-02; check them before relying on a refusal for a decision beyond this forge.
Prior art
Open-source "Deploy to" buttons (Heroku's app.json, Render's render.yaml, DigitalOcean's App Platform button, Railway templates) are a link carrying a repository and a settings file to a provider's sign-in. That is the shape for the button: a link with app, source, version that lands on the Deploy form after one sign-in. The older deploy/ cloud path and the child-forge path (#4416, #2928, #3785) are the other prior art; neither pins.
Address and health check (#8745)
check (POST /api/v1/admin/pinned/:name/check, MCP pinned_forge verb check, terminal c) reads the machine from its cloud (read-only, no write permission needed) and records its public IPv4 (pinned_forge.address, validated as IPv4). It then asks DNS for the forge's name. Until the name resolves to that address the result is healthy: false, waiting: "dns" with the record to create, and nothing is sent anywhere: the probe only ever goes to the machine this forge made. Once it does, Check probes https://<host>/; no answer yet is waiting: "answer" (the machine is booting, or its certificate is not issued). Every view carries url (https://<host>/) and dns. A forge that answers is set running, so a failed one recovers by itself once its machine is up; one that does not answer keeps its state. A deploy and a new claim read the address once, so their answer can name the record; a cloud that has not assigned one yet leaves it to check.
One at a time
Every create (a deploy, and the machine an Update, Roll back or new claim link makes) is held to its cloud account's ceiling (src/cloud/ceiling.ts, set on /settings/cloud). A forge is priced from the one catalog of places (src/cloud/places.ts, GET /api/v1/places): what the provider's own API last said its size costs at the place its row records, with its volume and address, converted at the day's rate and rounded up. The forge reads the catalog again before a create when it is stale or was never read; a size it still has no price for is refused, never counted as free. Creates on one account run one after the other from the ceiling check until the machine is recorded, so two asked together cannot both fit where one does. Changes to one forge run one after the other too: two new claim links asked together make two replacements in turn, never two machines at once, and the second link is the one that works.
Failing half-way
Each id is recorded the moment it exists. A first deploy that fails before a droplet exists leaves a failed row with the volume's id; deploying the same name again reuses that volume. An Update deletes the old droplet and clears its id at once; a 404 on that delete counts as deleted, so after a failed create a Rollback or another Update goes straight to creating. A failed forge may be told the version it already has, to finish the replacement. The droplet installs the Bun in BUN_VERSION (src/cloud/droplet.ts), so the runtime moves only when a pull moves it.
Not done
- No canary result on a real account yet: the script is written, the run needs an owner's token (#8746, see Canary).
- Without a Cloudflare account that can edit the name's zone, the DNS record is made by hand, and again after each Update, Roll back or new claim link, because a replaced machine has a new address. A reserved address would end that; it is not written. Nor are wildcard records, per-app subdomains or a DNS provider other than Cloudflare.
- The boot config (the hardened unit, ufw, the sandbox profile, Caddy from Ubuntu 24.04's repository and its certificate) has not run on a real machine: it was written with no network. The first real deploy is the check, with the list above and the canary below.
- A forge that answered and then stays unreachable for good (its machine broken, unclaimed) cannot be updated, rolled back or reissued from here: the forge will not guess that nobody claimed it. Nothing overrides that yet; the way out is to make it answer, or to deploy another.
- A forge claimed on a machine that never answered this forge (the buyer used the link before the seller's DNS view or any Check or change reached it, and it is unreachable now) is not known to be claimed, and may still be replaced. Its data is on the volume and its admin stays; a new seed is ignored.
- No provider firewall, and no way to give the deployer a shell: an optional deployer-supplied SSH key is not accepted.
- AWS and Azure drivers.
Canary (#8746)
The driver is tested against a fake API only. scripts/pinned-canary.ts runs one real Deploy, Update and Rollback through the admin API, times each, and fails past 10 minutes or when a version or state is not the asked one:
FORGE_TOKEN=<admin token> bun scripts/pinned-canary.ts https://your.forge --account <do account, writes allowed> --host <a name you control> \
--app owner/name --source https://… --version <commit> --next <second commit or tag>
The name defaults to canary-<date>-<time>, so a second run the same day does not collide. Versions and source are checked before any paid call, and on failure the script prints the droplet and volume ids it recorded. It leaves a droplet and a volume (~$13 a month) the driver cannot delete; remove them in the DigitalOcean console. test/pinned-canary.test.ts covers the script against a fake forge.
Canary results
Not run yet. It needs a DigitalOcean token an owner has put in Settings → Cloud accounts; none was available to the agent that wrote the script. Paste the table the script prints here, with the date, and close #8746.
This is an operator script, not a feature: it has no screen in src/tui/ and no MCP verb because it drives the doors that exist (the HTTP admin API, the same actions the terminal and pinned_forge use); a second door to a one-off paid test would be one more thing to keep honest. It is small, touches no src/, and was written so the owner's run is one command; it does not displace the pipeline list. The pull refers to #8746 and does not close it: the issue closes when the table above is real.