cloud: one-command dev loop on a kept Cloud machine (build, patch-push, restart, journey in about a minute)

Merged
TE
1d ago
+560-7

A machine-side change (cmux-tui, cmux-host or acpmux) can now be checked end to end on a real Cloud machine in about a minute, with no image bake or nightly: bun scripts/cmux-next/cloud-devloop.ts --credentials FILE.

Leo, 2026-11-05: "Just running commands and then we're seeing, Oh, okay, we gotta fix this. Then we gotta fix that ... we hill climb within, like, you know, several minutes, we have multiple iterations within that instead of, like, one iteration every couple minutes."

What changes

scripts/cmux-next/cloud-devloop.ts: one kept Cloud machine (cloud-devloop, created on first use) is the dev box. One command:

  1. rsyncs the worktree's changed files to a warm checkout on a Linux build host (--build-host or CLOUD_DEVLOOP_BUILD_HOST);
  2. builds cmux-tui, the guest's one multi-call binary (dev profile, stripped, the guest's Ubuntu release, baseline zig CPU for libghostty-vt);
  3. pushes a zstd --patch-from delta of what the machine already runs (0.3 MB after a one-line acpmux edit) in 512 KiB fs/write pieces, SHA-256-checked;
  4. flips /opt/cmux/current to a dev profile and restarts cmux-host and acpmux.service; --restore undoes it;
  5. runs the Cloud journey on that machine and prints the first red step with the journal lines since the run began.

cloud-journey.ts:

  • --machine ID runs on an existing machine, keeps it, and resets an earlier run's model stub.
  • --keyed-start checks that the app's keyed acpmux start still holds after acpmux.service's restart delay, which is the take-over race of cmux-platform#845.

Measured (production, agent test account)

iterationbuildpushinstall and restartjourneytotal
one-line acpmux edit20.7 s5.9 s14.6 s22.4 s66.8 s
no change0.9 snonenone20.9 s27.2 s

--keyed-start was red on production before #845 deployed and green after, 36 s each run.

Tests

cloud-devloop.test.ts and cloud-journey.test.ts: 21 pass and 0 fail on the fleet.

Changelog

none

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Machine-side changes (cmux-tui, cmux-host, acpmux) can now be checked end to end on a kept Cloud machine in about a minute, with no image bake or nightly. bun scripts/cmux-next/cloud-devloop.ts --credentials FILE rsyncs the worktree's changed files to a warm fleet Linux build host, builds the multi-call cmux-tui binary there, pushes a zstd --patch-from delta in 512 KiB pieces, flips /opt/cmux/current to a dev profile, restarts the host and acpmux units, and runs the Cloud journey on that same machine, printing the first failing step with the machine's journal lines.

  • One-line acpmux edit: build 20.7 s, push 5.9 s, install+restart 14.6 s, journey 22.4 s, about 67 s total; a no-change rerun is about 27 s.
  • --restore puts the image's binary back; --snapshot creates the dev machine as the next base image.
  • cloud-journey.ts gains --machine ID (run on an existing machine and keep it, resetting an earlier run's model stub) and --keyed-start, which verifies the keyed acpmux start still holds after acpmux.service's restart delay — the take-over race of cmux-platform#845.
  • 21 tests pass, 0 fail on the fleet.