Public: anyone can read this; the crew can change it.

See and manage everything on any cloud: provider ▸ account ▸ project ▸ resources, the cloud's own view, a console that always works #17253

opened this in answer to

Merged 29h 16m ago, live in production

This pull delivers V2 of #17151 for DigitalOcean and Hetzner only: the cloud's own view of each machine, read from the provider's API when someone opens it, so it works with the agent dead. Nothing else in the issue is done here.

Notes

opened this

This pull delivers V2 of #17151 for DigitalOcean and Hetzner only: the cloud's own view of each machine, read from the provider's API when someone opens it, so it works with the agent dead. Nothing else in the issue is done here.

What changed

  • What it shows: power state, size, image, region, public and private IP, created time, attached volume ids, and the provider's recent actions, newest first and capped at 8 (e.g. power_on · completed · 2026-12-01 17:44). Fields the provider returns malformed are dropped, not guessed.
  • Reads: DigitalOcean reads the droplet and its actions. Hetzner reads the server and its actions. The read is admin-only and opens the account's token for a read, never a write.
  • Doors:
    • Page: GET /infra/:name/cloud, reached from an "At the cloud" button on each machine row on /infra.
    • Terminal: v on a machine row in the infra screen.
    • MCP: infra with action: "cloud" and id: <machine name>. This is a new action on the existing tool, not a new tool.
    • How-to: a section in docs/features/infra.md.
  • Reused: withCloud for the token and gated fetch, and the Driver pattern (viewMachine sits beside readMachine).
  • Tests: test/machine-view.test.ts covers the two parsers and bounds, both drivers' calls, the action (admin only, unknown forge), the page (escaped, anonymous refused), the tool, and the v key. It passes, along with tsc, design-lint, the infra page tests, test/route-marks.test.ts and test/mcp-size.test.ts. The gate has no failing rules after the last commit; the commit lines carry No door, No look and Try for the gate. I did not run the full suite.

Left out

  • Volume mount state: neither API reports it, so volumes show as "attached" with their ids.
  • Refresh on a schedule while something is in flight: the view is read each time it is opened, with no cache.
  • Hetzner's view is covered by a driver test with a fake call, not an end-to-end test; DigitalOcean has the end-to-end one.
  • V3 (the provider ▸ account ▸ project tree, placement, and moves as plan steps) and V4 (the agent shell, provider consoles, and a time-limited SSH step). V1 is already in flight elsewhere.
  • OVH has no view yet. Its machine says "not read here yet".
  • No forge.json egress change: the calls go to the provider hosts that the existing cloud code already uses.

Try it Open /infra as an admin and press "At the cloud" on a machine. Or press v in the terminal infra screen. Or call the infra tool with {action: "cloud", id: "<machine name>"}.

Closes #17151

12 earlier comments · 1 event
commented

This pull delivers V2 of #17151 for DigitalOcean and Hetzner only: the cloud's own view of each machine, read from the provider's API when someone opens it, so it works with the agent dead. Nothing else in the issue is done here.

What changed

  • What it shows: power state, size, image, region, public and private IP, created time, attached volume ids, and the provider's recent actions, newest first and capped at 8 (e.g. power_on · completed · 2026-12-01 17:44). Fields the provider returns malformed are dropped, not guessed.
  • Reads: DigitalOcean reads the droplet and its actions. Hetzner reads the server and its actions. The read is admin-only and opens the account's token for a read, never a write.
  • Doors:
    • Page: GET /infra/:name/cloud, reached from an "At the cloud" button on each machine row on /infra.
    • Terminal: v on a machine row in the infra screen.
    • MCP: infra with action: "cloud" and id: <machine name>. This is a new action on the existing tool, not a new tool.
    • How-to: a section in docs/features/infra.md.
  • Reused: withCloud for the token and gated fetch, and the Driver pattern (viewMachine sits beside readMachine).
  • Tests: test/machine-view.test.ts covers the two parsers and bounds, both drivers' calls, the action (admin only, unknown forge), the page (escaped, anonymous refused), the tool, and the v key. It passes, along with tsc, design-lint, the infra page tests, test/route-marks.test.ts and test/mcp-size.test.ts. The gate has no failing rules after the last commit; the commit lines carry No door, No look and Try for the gate. I did not run the full suite.

Left out

  • Volume mount state: neither API reports it, so volumes show as "attached" with their ids.
  • Refresh on a schedule while something is in flight: the view is read each time it is opened, with no cache.
  • Hetzner's view is covered by a driver test with a fake call, not an end-to-end test; DigitalOcean has the end-to-end one.
  • V3 (the provider ▸ account ▸ project tree, placement, and moves as plan steps) and V4 (the agent shell, provider consoles, and a time-limited SSH step). V1 is already in flight elsewhere.
  • OVH has no view yet. Its machine says "not read here yet".
  • No forge.json egress change: the calls go to the provider hosts that the existing cloud code already uses.

Try it Open /infra as an admin and press "At the cloud" on a machine. Or press v in the terminal infra screen. Or call the infra tool with {action: "cloud", id: "<machine name>"}.

commented

This push fixes the failing ceiling test. The new machine view used a bare driverOf(...), which test/pinned-ceiling.test.ts forbids on any path that might make something. The read-only view, which only reads and makes nothing, now takes its driver through a small viewer() helper in src/actions/machine_view.ts. If a cloud has no view, it still answers "not read here yet".

The test now lets viewer( through, with a comment saying why, and its count of driver uses goes from 15 to 16. I judged the test's rule still right and extended it for a read-only call.

tsc is clean, and test/pinned-ceiling.test.ts and test/machine-view.test.ts pass, 25 tests in all. I did not run the rest of the suite.

I left the other failure alone. The "Talk: every control is 44 px" test in test/phone-targets.test.ts is also red on main at 7e3dfba, so the forge didn't count it against this pull.

The gate also noted that viewOf and read in src/cloud/machine.ts look alike. I left both as they are.

The earlier commits on this pull still describe what the feature does. In short, it shows a machine's cloud-side view: power, size, image, region, IPs, volumes and recent actions.

  • Web: the page is /infra/:name/cloud.
  • Terminal: press v on a machine row in /infra.
  • MCP tool: call the infra tool with action cloud.

To try it, open /infra as an admin and press "At the cloud" on a machine.

commented

I merged main into the branch and pushed it as 44c571acc. The three conflicts are resolved and keep what both sides added.

  • src/http/infra_routes.ts and src/web/pages/infra.ts: the imports now include both main's recordForm and RecordFields and this pull's machineView, cloudPage, viewRows and actionLine.
  • src/http/mcp/tools/infra.ts: it takes main's new check action and DNS-record wording, and adds this pull's cloud action and its doc line.

bun x tsc --noEmit is clean. The ceiling test, test/machine-view.test.ts and the 11 infra and DNS test files all pass. I did not run the full suite.

scripts/fast.ts said the diff is too broad to pick tests from because forge.json changed, so I chose those suites myself. The forge's check will run everything on this push.

The infra tests printed a large-blob warning and three denied forge.test:80 connections in the sandbox. They did not fail any test.

commented

This pull adds the cloud's own view of a forge's machine: DigitalOcean's or Hetzner's API says what state the machine is in, and the page needs no answer from the box's agent. The failing check (the bundle answering /readyz within 1500 ms × 3) passes here after I merged current main, so this push may clear it. I changed no boot code: the failure looked like box load, not this change.

What changed

  • src/cloud/provider_view.ts turns a provider's answer into plain data: power state, size, image, region, public and private IP, created time, attached volumes and the last 8 actions. Malformed fields are dropped, not guessed at. It also builds the one-sentence summary and the labelled rows used at every door.
  • src/actions/machine_view.ts (machineView) is admin-only and read-only. It opens the account's token for a read, never a write, and refuses plainly for a retired forge or one with no machine yet.
  • viewMachine is added to the DigitalOcean (droplet.ts) and Hetzner (hetzner.ts) drivers.
  • All four doors call machineView: the infra page, the infra route, the infra MCP tool with action: cloud, and the terminal screen src/tui/screens/infra.ts.
  • The how-to is docs/features/infra.md.
  • test/machine-view.test.ts covers the view, and test/pinned-ceiling.test.ts is adjusted.

Checks run here

  • These pass: unused-exports, machine-view, pinned-ceiling and bundle-boot-time.
  • bun x tsc --noEmit is clean.
  • scripts/gate.ts --explain has 0 failing rules. Its both-doors, name-the-issue and dead-code rules are satisfied.
  • Two gate notes remain, both advisory:
    • Over-long comment lines in 7 files. The nightly rewrap fixes them on main, and gate --fix changed nothing.
    • viewOf in machine.ts looks 0.56 similar to read. I left both as they are, since their guards are the same but the calls differ.
  • The unused-exports test also printed a note that two exports in src/spawn/ (useWatchProbeByDefault, useReachByDefault) are no longer dead. They aren't in this change.
  • I did not run the full suite. The forge's check does that on push.

Left out

  • Only DigitalOcean and Hetzner have a view. Any other cloud answers "not read here yet".
  • Nothing here writes to the cloud: there is no power, resize or delete from this view.
  • I did not try to speed up the bundle boot. If the boot test fails again on a loaded gate box, that is a separate issue.

Try it

  • Sign in as admin, open Infra, and pick a pinned forge that has a machine.
  • Or run infra with action: cloud over the MCP.
  • In the terminal, open the infra screen.
commented

Still red on current main: sweeping a checkout hands the loop back before it finishes (#7688). Fix it and push.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

This adds a read-only cloud action that shows what a provider says about a machine: power state, size, IPs and recent actions. It's in the web /infra page, the terminal infra screen and the MCP infra tool, and the docs/features/infra.md how-to covers it. This push fixes the check failure on the cloud action's addition to the Talk list.

What failed and what I did

  • Talk list ceiling: adding cloud to the infra tool's action enum brought the Talk tool list to exactly 18,500 bytes, and the test fails at or above that. I shortened the tool's description from "Cloud machines and spend." to "Cloud machines, spend." It now passes, with only a couple of bytes to spare. I did not raise the ceiling.
  • "sweeping a checkout hands the loop back" (checks-home-sweep): it passed when I ran the file alone. One earlier local run of the three failing files did show it failing, so it looks timing-sensitive under load. I changed nothing for it.
  • "the last ten follows, newest first" (fork-follow-history): it passed locally, so I changed nothing for it.

If either of those two fails again on the next check, it needs its own look.

What I ran: mcp-talk-tools, machine-view and pinned-ceiling all pass, tsc is clean, and I ran gate --fix. The gate printed two notes and asked for nothing: seven files have comment lines over 100 columns (the nightly rewrap handles them on main), and it asks whether viewOf and read in src/cloud/machine.ts are one implementation. I left that second one alone.

To try it: open /infra as an admin and look at a machine, or call the MCP infra tool with {action: "cloud", id: "<machine name>"}.

Not done: the cloud view is read-only, so there are no power or resize controls.

🤖 Generated with Claude Code

commented

I merged main into this branch, resolved the two conflicts and pushed. bun x tsc --noEmit is clean. I ran about 94 tests across the files this change touches and they pass. I did not run the full suite; the forge's check runs that on the push.

  • docs/features/infra.md: I kept both sections. The Minecraft and Projects sections from main stay, followed by this pull's "What the cloud says of a machine".
  • src/http/mcp/tools/infra.ts: the doc now carries main's Minecraft design wording and this pull's cloud action. I kept the short description, which is now "Machines, spend.".
  • Route fix: main now registers routes from a boot-time list in src/http/lazy_lists.ts. GET /infra/:name/cloud wasn't in it, so the machine page answered 405. I added it, and machine-view.test.ts passes again.
  • Talk list ceiling: the merge pushed the Talk tool list one byte over its 18,500-byte ceiling. The shorter description above brings it back under, and mcp-talk-tools.test.ts passes.

The gate (bun scripts/gate.ts --fix) changed nothing. It flagged viewOf and read in src/cloud/machine.ts as possibly duplicate, which I left alone.

I did not touch the web page, so there is no new review block.

commented

Every point in the review is addressed on the branch (9501705fe). tsc is clean. The 50 tests I ran in these files pass: machine-view, pinned-ceiling, unused-exports, the Talk list ceiling, cloud-doors, lazy-first-use and llms-budget. I did not run the full suite; the forge's check does that on push.

What changed

  • viewer() is gone. machineView now calls viewOf(driverOf(…)). The ceiling test whitelists viewOf, a real read-only call, in place of viewer. The count stays at 16 because main added a call site.
  • Typed refusals. machineView returns {reason, message}, where reason is one of denied, missing, retired, no_machine, unread or refused. The page returns 404 for missing and 422 for the rest, with no string matching. The page, the infra tool and the terminal all read .message.
  • One guard in src/cloud/machine.ts. viewOf and read both go through a single onMachine check of the machine id. viewOf returns undefined when a cloud has no view yet, which becomes the "not read here yet" answer.
  • New tests in test/machine-view.test.ts:
    • a retired forge, with a 422 on the page;
    • a forge with no machine;
    • a cloud with no viewMachine, with a 422 on the page;
    • an unknown forge, with a 404;
    • a provider answer with <script>alert(1)</script> as an action name, which the page escapes;
    • a non-admin refused on both the page and the tool.
  • Talk description. It stays "Machines, spend." to fit the Talk list's 18,500-byte ceiling. That is the trade, and it cost clarity in a one-line description. The full wording is still in the tool's doc.
  • Earlier fix, carried over. GET /infra/:name/cloud is registered in src/http/lazy_lists.ts, so the machine page no longer answers 405.

Disagreement. Item 5 is only partly resolved. The gate may still flag viewOf and read as similar, because the shared guard is the part they have in common and their bodies differ.

Left out: writes of any kind; the cloud view stays read-only and admin-only.

How to try it: open /infra as an admin and use "At the cloud" on a machine row, or press v on the row in the terminal. In the MCP, call infra with {action: "cloud", id: "<name>"}.

[
  {"go": "/infra", "look": "a machine row that exists at its provider", "expect": "an \"At the cloud\" button beside it, and a Projects section listing each project with its resources and monthly cost"},
  {"go": "/infra/<machine>/cloud", "look": "the facts list and the recent provider actions", "expect": "power, size, image, region, public and private IP, volumes, and actions such as \"power_on · completed · 2026-12-01 17:44\"; provider text appears escaped"},
  {"go": "/infra/nope/cloud", "look": "the status and message", "expect": "404 for a name no forge has; 422 with a sentence for a retired forge, one with no machine, or a cloud whose view is not read yet"}
]
commented

I merged main into the branch, resolved the three conflicts, and pushed (46d15c992).

In every conflict I kept both sides:

  • docs/features/infra.md: both sections stay: "What the cloud says of a machine" and "Provider console (Hetzner)".
  • src/http/infra_routes.ts: the imports now bring in both cloudPage (this pull) and consolePage (from main).
  • src/tui/screens/infra.ts: v still opens "At the cloud" and o still asks for the Hetzner console.

I ran the infra, machine-view, console, lazy-boot, doors and MCP tests, and all 108 pass. I did not run the whole suite: scripts/fast.ts named 2,848 files, about 233 minutes, so I picked the covering tests myself.

tsc --noEmit reports one error, in src/web/tabforge/opfs.ts: it can't find the @sqlite.org/sqlite-wasm types. I didn't touch that file or investigate whether the error was already there.

I started scripts/gate.ts --fix but killed it with the test run before it reported, so the gate hasn't run on this merge. The forge's check on this push will run it.

commented

Merged main into the branch and pushed. The type check is clean, and the five test files that cover this feature pass (55 tests). I didn't run the full suite; the forge runs the check on the push.

The conflict. main had landed #17156 ("Cloud says"), which independently added src/cloud/provider_view.ts. The file has a different job there: a cached one-line "what your provider says" for each machine, used by the web page, terminal, MCP and games. Our branch's file of the same name was the full detail view: power, size, image, region, addresses, volumes and the last actions.

Resolution.

  • main's src/cloud/provider_view.ts is kept as is, along with actions/cloud_says.ts and their tests.
  • Our pure parsing and wording module moved to src/cloud/provider_detail.ts, and its imports now point there: actions/machine_view.ts, the web and terminal infra pages, droplet.ts, hetzner.ts, machine.ts and test/machine-view.test.ts.
  • The two features now sit side by side. The machine row carries main's one-line fact, and the detail view carries ours.

Noticed.

  • The merge commit also holds the rewrap that gate.ts --fix made to long comments in 19 files.
  • The gate still flags fromDigitalOcean and fromHetzner in main's provider_view.ts as 0.57 similar ("one implementation?"). That code came from main, and I left it.
commented

Every machine in /infra now has a page for what its cloud provider's API says of it (GET /infra/:name/cloud), read when you open it. The terminal and the infra tool show the same view. A refusal comes back typed: 404 for a machine that isn't there, 422 for one the forge can't ask about.

The last red check was the "the diff is the change" gate rule. An earlier gate.ts --fix had rewrapped comments this pull didn't write, in 13 files such as test/game-volume.test.ts, src/games/sleep.ts, src/apps/dev_hot.ts and src/actions/cloud_says.ts. I restored all of those to main's text. The diff is now 13 files, all cloud-view work.

bun scripts/gate.ts --explain reads 0 failing and 1 note, a comment-width note on 7 files that the nightly rewrap fixes on main. bun x tsc --noEmit printed nothing, and 65 tests across test/machine-view.test.ts, pinned-ceiling, cloud-says-doors and hollow pass. I also ran doorless and feature-doors. I didn't run the whole suite. The dead-code test was not run by name: I couldn't find a file called that, so I ran the nearby ones.

To try it: on /infra, open a machine's "at its cloud" page. In the terminal, select a machine on the infra screen and press v. The infra tool exposes the same view. The how-to is in docs/features/infra.md.

Left out: managing resources from the provider's console, and anything above a single machine (account, project, listing every resource). Those need their own issues.

commented

Still red on current main: pinned forge address > only a well-formed public IPv4 is taken. Fix it and push.

commented

The pinned-forge-address failure was caused by this branch, and I fixed it and pushed; I couldn't reproduce the migrate failure.

Cause: my refactor of src/cloud/machine.ts turned read from an async function into a plain one that calls the shared onMachine guard. A malformed machine id therefore made read throw synchronously instead of rejecting. The test "only a well-formed public IPv4 is taken" expects a rejection. read and viewOf are async again, so both reject on a bad id.

Checked: bun x tsc --noEmit is clean, and test/pinned-forge-address.test.ts and test/tui-migrate.test.ts pass locally (22 tests).

Not reproduced: the "migrate from the terminal" test passes here. It failed in the check after 20 seconds, which looks like a timeout on a loaded runner, and nothing on this branch touches migration. The forge's check on this push will show whether it fails again.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs