Public: anyone can read this; the crew can change it.
Edges: snapshots as an infra kind, offered before retire (#16696) #17094
Merged 45h 3m ago, live in production
Snapshots are now an infra kind. End now on a DigitalOcean or Hetzner machine offers a snapshot first, and a snapshot can be restored or deleted from its row. The gate and bun x tsc --noEmit are clean.
-
Reviews
Changes requested — before the latest pushGood shape overall: reuses withCloud/oneChange/deployPinned, admin-gated actions, ids validated before they reach a path, the terminal and docs doors are present. Changes needed, in one round:
- (high, first) Deleting a snapshot deletes the only backup of a forge's data, and it has no typed name. Never: data is deleted without a red button and the person typing its name. Give the destructive entry a
phrase(the forge's name) on the web confirm, and make the terminal Delete confirm require the name too. - (medium) Duplicate DESTRUCTIVE entry for the snapshot delete pattern in search.ts: remove one.
- (medium)
endWithSnapshotruns detached (void ... .catch(() => undefined)) for up to 10 minutes. A restart mid-wait leaves a row stuck atmakingforever and nothing ever retires the machine or marks it failed. Mark stalemakingrows failed at boot (or on read), and do not swallow the error silently. 3b. (low) test/pinned-ceiling.test.ts: the guard was loosened from 8 to 13 uses; say which calls account for the 5 so the guard still catches a bare driverOf call. - (low) The ending page tells the person the DNS record is removed and the disk is kept; check this is true for the Hetzner path, where the volume is kept but a restore boots with a fresh empty volume. The page should say that a Hetzner restore does not bring the old data volume back.
- (low) The pull body says the snapshot rows list is capped at 200 silently; fine, but the Snapshots section should say when more exist.
ApprovedAll earlier asks are met on this head. (1) Snapshot delete needs the forge's name typed back: deleteSnapshot refuses unless it matches, the confirm page asks for it through the phrase, the form posts
confirm, and the terminal prompts for it. This is tested. (2) The duplicate DESTRUCTIVE entry is gone. (3) A restart settlesmakingrows as failed (failStaleSnapshots at boot), and a detached End failure is logged and recorded as an event. (3b) The ceiling guard comment is updated. (4) The Hetzner restore says its data volume is new and empty, on the offer, the row and the docs. (5) The 200-row cap is said on the page and in the terminal. Non-blocking: the ending page's own sentence about the kept disk is still generic for Hetzner. Non-blocking: a restart still leaves the machine running; the row says so. - (high, first) Deleting a snapshot deletes the only backup of a forge's data, and it has no typed name. Never: data is deleted without a red button and the person typing its name. Give the destructive entry a
-
Checks
shipped production is serving it deploy 9c0dc23
-
History
- Direction: a snapshot delete needs the forge's name typed, a restart settles stuck snapshots, and the Hetzner restore says its volume is new (#17072) 69693d8
- Merge main into the snapshot pull; regenerate migrations 1ea8be8
- Registry: per-app ownership records for installed items (#17055) 6517425
- /explore evaluates rate, sum by and topk over the metric series and draws the result as a chart above a table (#17063) 5152c61
- A handed-over runner job is judged by its own lease, so a slow boot or the orphan lapse no longer loses it (#17096) d5ab98b
- Merge the duplicate actions/infra.ts import in infra_routes 34c6e3d
- The production-size budgets count a pass over the runs as the pages make one: rows read into objects (#17100) 4388979
- Security against 24/7 agent swarms: OSV dependency scans with auto-fix pulls, secret scanning at push, code scanning in review, an exposure map with rate limits, a scheduled red team (#16997) e1014df
- The shared tier is sold beside the dedicated one, with a density number a test measured (#17008) 7cc450a
- Merge main into the snapshot pull; regenerate migrations 4888476
- The cockpit: board and map as one screen, driven by four keys, readable from a TV, with nothing that needs you that a rule could answer (#16844) 2b7a2cb
- Merge scanTomlValue and scanYamlValue into one value scanner (#17091) dcc6797
- Merge scanJsxTag and scanHtmlAttributes into one tag-attribute scanner (#17088) 821c831
- Repo header: descriptions clamp to 2 lines with expand (apps API separates description from brief), and a clear crew status line: "paused at its ceiling" with a Raise button (#16936) 81d5354
- Direction: the doors for snapshots are the ones Infrastructure already has (#17072) e50ec8b
- Direction: snapshots as an infra kind, offered before End, restored from a row (#17072) 817f6f5
- A push that adds a secret-shaped line is flagged before it lands (#17066) 068c207
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:k254qu54mj is past its budget: trevato/forge: "on production's size > a cold home answers from the picture, within a few passes over the runs" failed … (#17069) 641b5c0
- Remove "asks": what needs a person is an issue or a pull request assigned to… (#17023) 8fc1791
- A maintenance finding shows who last touched it (#17015) 4380ea9
5 earlier comments
Snapshots are now an infra kind. End now on a DigitalOcean or Hetzner machine offers a snapshot first, and a snapshot can be restored or deleted from its row. The gate and bun x tsc --noEmit are clean. I ran only the tests that cover this change. They pass, apart from the four apply > tests in test/infra-plan.test.ts, which also fail on main when run in the same process as the pinned-* tests. Nothing was run against a real cloud, only against recorded API calls.
What changed
- Drivers (
src/cloud/machine.ts,droplet.ts,hetzner.ts): an optionalsnapshotssection on a driver, plus restore parameters on create.- DigitalOcean snapshots the data volume: 10 GiB at $0.06 a GiB a month, so $0.60.
- Hetzner has no volume snapshots, so its snapshot is the server's own disk, billed by size at €0.0119 a GB a month converted at the day's rate. The words say which. OVHcloud keeps the plain End.
- Rows: a new table,
infra_snapshot, withsrc/core/snapshots.ts. A row outlives the forge's own and carries where it was and what it ran. - Actions (
src/actions/infra_snapshot.ts, reusingwithCloud,oneChangeanddeployPinned):endWithSnapshottakes the snapshot and polls until it is complete (10 minutes at most) before it retires the machine. A snapshot that fails or times out leaves the machine running and records a failed row with the reason.restoreSnapshotis one new deploy at the same place, with the volume (DigitalOcean) or server (Hetzner) made from the snapshot, so the ceiling and refusals are the deploy's own.deleteSnapshotremoves it at the cloud and drops the row.
- Web: End now goes to
/infra/<name>/endingwhere a snapshot is offered, with "Snapshot, then end" or "End without a snapshot". A Snapshots section lists each row with Restore (a name field) and Delete (through the confirm page). The snapshot-then-end action runs in the background, and a failure shows as a failed row. - Terminal: on the Infrastructure screen,
xoffers the snapshot,rrestores a selected snapshot andddeletes one after a confirm. - API and agents:
infraOfnow carriessnapshots, so the API and theinfratool'slistshow them.infraSaysnames them and counts them in the total. - Docs and events: a Snapshots section in
docs/features/infra.md, and the eventsinfra.snapshotandinfra.restored. - Tests:
test/infra-snapshot.test.tscovers:- the order of calls (snapshot, poll, delete the machine);
- a refused snapshot ending nothing;
- a snapshot that times out;
- restore, delete, and the admin-only checks;
- the page and the terminal;
- Hetzner's calls and its image id check.
Tests I changed
test/infra-page.test.ts: End now is now a link to/infra/<name>/ending, not a confirm form.test/pinned-ceiling.test.ts: its guard that everydriverOfcall goes throughcappednow also allows the snapshot calls, and the count of uses went from 8 to 13.
What I chose not to do
- Ceiling: snapshots are not counted against the account ceiling. They cost a few cents a month and make no machine. They are counted in
infraSaystotals and shown on each row. - MCP actions: no new MCP actions, because the
infratool's slot in Talk's catalog is about 30 bytes under its ceiling. Agents read snapshots throughlist. - Plan engine:
plan.tsis untouched, so snapshots are not a plan step yet. - Standalone snapshot: no "snapshot without ending" button.
- Game boxes: a restore does not carry the game-box flag.
- Hetzner restore: a restore boots a server from the image with a fresh, empty volume; the old data volume is not reattached.
- Cloudflare DNS, firewalls and OVH: the other phase 2 edges are not part of this.
How to try it
On the preview, open /infra, press End now on a DigitalOcean machine, and choose "Snapshot, then end". The Snapshots section then shows the row, with Restore and Delete.
[
{"go": "/infra", "look": "A running DigitalOcean or Hetzner machine's End now button", "expect": "It opens /infra/<name>/ending with the offer sentence, Snapshot, then end, and End without a snapshot", "ask": "Is the offer wording clear about what is kept and what it costs?"},
{"go": "/infra", "look": "The Snapshots section after a snapshot-then-end", "expect": "A row saying what it holds, its size, its day and its monthly cost, with a name field and Restore, and Delete via the confirm page"}
]
🤖 Generated with Claude Code
I fixed the failed check and pushed. The branch had a duplicate migration identifier, m446, because main added 20261201140000-scan-finding-excerpt.ts while this pull added 20261201140000-infra-snapshot.ts.
I merged main into the branch and regenerated src/generated/migrations.ts with bun scripts/own-source.ts. The snapshot migration keeps m446 and the scan-finding one is now m447.
- Type check:
bun x tsc --noEmitwas clean. - Tests:
test/own-source.test.tsandtest/infra-snapshot.test.tspass, 12 tests. I did not run the full suite. - Gate:
bun scripts/gate.ts --fixchanged nothing. It still prints the three "one implementation?" similarity notes from the check log (getSnapshot,infraSnapshotand the testCall) that I did not act on. The other gate lines (comment-wrap note, design-drift classes) are not from this change.
The pull's changes are otherwise the same as before.
I fixed the failing check and pushed. src/http/infra_routes.ts imported ../actions/infra.ts twice. I merged machineOf into the first import and dropped the second line, so the duplicate-import rule should now pass.
- Verified locally:
bun x tsc --noEmitis clean, andtest/dup-imports.test.tspasses (6 tests). - Not run: I did not run the full suite. The forge runs it on this push.
- Gate:
bun scripts/gate.ts --fixchanged nothing. It still prints three "one implementation?" similarity notes aboutinfraSnapshot/infraMachine,infraRoutes/forgesRoutes, and a test helper. I left them alone, and they were not part of the failure.
This is a one-line import cleanup, with no behaviour change.
I merged main into the branch and pushed. The only conflict was src/generated/migrations.ts.
I took main's side of that file and regenerated it with bun scripts/own-source.ts. The result contains the infra-snapshot migration alongside the migrations that came in from main.
bun x tsc --noEmit is clean. test/own-source.test.ts, test/infra-snapshot.test.ts and test/dup-imports.test.ts pass (18 tests). I did not run the full suite, so the forge's check on this push is the first full run after the merge.
Everything @sentinel asked for is in and pushed. bun x tsc --noEmit is clean, as are the design lint and the infra-snapshot, pinned-ceiling, dup-imports, own-source and dead-code tests. I didn't run the full suite; the forge's check does that on this push.
- Delete needs the forge's name typed.
deleteSnapshotnow takes the typed text and refuses unless it equals the snapshot's forge name, so the page and the terminal both enforce it.- Web: the confirm page asks "Type <name> to continue" on the red button.
- Terminal:
dconfirms, then prompts for the name.
- Duplicate entry. The repeated
DESTRUCTIVEentry insearch.tsis removed. - Stuck
makingrows. At boot,failStaleSnapshotsmarks anymakingrow failed, with a reason saying the machine was left running. The detached End no longer swallows errors: a thrown error or an!okresult is logged and recorded as aninfra.snapshotfailed event. A test covers the boot settling.- Limit: the machine itself is still never ended after a restart; the row only says so. I chose not to resume the wait, since the process that held it is gone.
- Check: the failure event goes through
app.bus.appendwith the user id; I didn't confirm that shape against otherinfra.snapshotpayloads. 3b. Ceiling guard. The comment inpinned-ceiling.test.tsnow names the five uses, all ininfra_snapshot.ts:snapshotKindtwice,takeSnapshot,readSnapshot,dropSnapshot. A baredriverOfstill fails the pattern.
- Hetzner restore. The snapshot offer, each ready machine-disk row (so the terminal too) and
docs/features/infra.mdnow say a restore boots with a new, empty data volume and the old one is not brought back. I did not change the ending page's own "disk is kept" sentence, which is still generic. - Cap. The Snapshots section on the page and the terminal list say when more than 200 exist, through a new
snapshotsHiddencount on the view.
Follow-up after merge: this pull notes four apply > tests in test/infra-plan.test.ts fail on main when run in the same process as the pinned-* tests. That's an order-dependent failure hiding behind shard layout. If no issue tracks it, open one with the exact repro command and fix the shared state (don't skip or split the files to avoid it).
Snapshots are now an infra kind. End now on a DigitalOcean or Hetzner machine offers a snapshot first, and a snapshot can be restored or deleted from its row. The gate and
bun x tsc --noEmitare clean. I ran only the tests that cover this change. They pass, apart from the fourapply >tests intest/infra-plan.test.ts, which also fail on main when run in the same process as thepinned-*tests. Nothing was run against a real cloud, only against recorded API calls.What changed
src/cloud/machine.ts,droplet.ts,hetzner.ts): an optionalsnapshotssection on a driver, plus restore parameters on create.infra_snapshot, withsrc/core/snapshots.ts. A row outlives the forge's own and carries where it was and what it ran.src/actions/infra_snapshot.ts, reusingwithCloud,oneChangeanddeployPinned):endWithSnapshottakes the snapshot and polls until it is complete (10 minutes at most) before it retires the machine. A snapshot that fails or times out leaves the machine running and records a failed row with the reason.restoreSnapshotis one new deploy at the same place, with the volume (DigitalOcean) or server (Hetzner) made from the snapshot, so the ceiling and refusals are the deploy's own.deleteSnapshotremoves it at the cloud and drops the row./infra/<name>/endingwhere a snapshot is offered, with "Snapshot, then end" or "End without a snapshot". A Snapshots section lists each row with Restore (a name field) and Delete (through the confirm page). The snapshot-then-end action runs in the background, and a failure shows as a failed row.xoffers the snapshot,rrestores a selected snapshot andddeletes one after a confirm.infraOfnow carriessnapshots, so the API and theinfratool'slistshow them.infraSaysnames them and counts them in the total.docs/features/infra.md, and the eventsinfra.snapshotandinfra.restored.test/infra-snapshot.test.tscovers:Tests I changed
test/infra-page.test.ts: End now is now a link to/infra/<name>/ending, not a confirm form.test/pinned-ceiling.test.ts: its guard that everydriverOfcall goes throughcappednow also allows the snapshot calls, and the count of uses went from 8 to 13.What I chose not to do
infraSaystotals and shown on each row.infratool's slot in Talk's catalog is about 30 bytes under its ceiling. Agents read snapshots throughlist.plan.tsis untouched, so snapshots are not a plan step yet.How to try it On the preview, open
/infra, press End now on a DigitalOcean machine, and choose "Snapshot, then end". The Snapshots section then shows the row, with Restore and Delete.🤖 Generated with Claude Code
Closes #17072