Commit Graph
11 Commits
Author SHA1 Message Date
w3cjandClaude Opus 5.5 49d7205360 feat(sync): host settings, agent config and mounts for VMs
A new VM's setup now sends the whole of guest/sync.sh and its host
side, staged in memory: the hostname, timezone, UTF-8 locale and git
identity; the agents' config files (never their history), with their
folders mounted read-only at their host paths (one with a comma is left
out, with a warning); and the VM's tokens, as they are without network
policy (naming MCP servers whose secrets go too) or as its own
placeholders with it. With network policy it also sends devvm's CA, the
proxy's address (Backend.ProxyURL), the logins' copies with placeholders
and the agents' settings files with secret-looking values redacted (one
that can't be read that way isn't sent). UpdateAgentDirs keeps an
existing VM's agent mounts current through Backend.SetAgentDirs; its
caller comes with up for an existing VM. New docs page: coding agents.

Ported: sync_vm, agent_dirs, agent_files, agent_mounts,
update_agent_mounts, host_tz, claude_mcp_warn, the settings redaction;
guest/sync.sh copied whole (one comment edited).

Bats cases converted:
- project.bats: agent_mounts (one per line, names with spaces); the
  four update_agent_mounts cases (Go table tests, plus a running VM
  restarted once the user agrees)
- build.bats: sync_vm staging removed on failure, settings redacted
  with network policy (testscript sync.txtar)
- guest.bats: the prompt, blocked since the last prompt, MCP servers'
  merge (testscript guest.txtar)
- network.bats: claude_mcp_warn (sync.txtar, secrets Go test)
Deferred: guest.bats VS Code settings (ssh/code).

e2e: project gains agent folders and the VM's setup (mount read-only,
settings copied, history never, git identity, timezone, hostname, the
token without network policy); network becomes claude+codex and checks
the CA installed, the VM's own placeholder, the logins' copies and the
host's login files unchanged, with curl verifying TLS (no -k). Agent
folders on relaunch and restart wait for those commands.

Messages: agent_dir_comma, agent_dirs_added, agent_dirs_removed,
update_mounts, mounts_next_start, mounts_updated, no_claude_token,
claude_token_invalid, no_github_token, login_copy_failed,
config_redacted, config_not_copied, claude_mcp_secrets_copied;
sync_failed reworded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 11:20:03 -06:00
w3cjandClaude Opus 5.5 ff57370ffb feat(network): network policy for VMs
A new VM can get network policy: --network-policy, else a question in a
terminal (no by default), else off. devvm makes its CA, writes the VM's
secret bindings, starts the VM's proxy (devvm _proxy, its password in a
file) and starts the VM confined to it, then runs the self-check before
the setup and the shell: a VM that isn't held to its proxy is stopped.
Tokens stay on the host; the hidden devvm secret get reads them for the
proxy, from the Keychain or a file. e2e gets a network section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 10:46:24 -06:00
w3cjandClaude Opus 5.5 f4508dfb61 feat(proxy): the network policy proxy as devvm _proxy
The network policy proxy moves into the binary as internal/proxy
(standard library only), run by the hidden devvm _proxy with its own
flags. Main returns errors instead of exiting, writes only to the
streams devvm hands it (the event log and data on stdout, its log
lines on stderr), and returns when the VM's hostagent is gone. The
connect mode is gone: devvm _qemu connect does that. Logins copied
as they are are warned about through ui.

Its tests come along, with a short run, fuzz targets for policy rules,
request targets and ClientHellos, a testscript, and the network page
of the docs for the proxy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 10:12:26 -06:00
w3cjandClaude Opus 5.5 42d3fd4356 feat(tools): shared tools
The toolchains and agents an image name holds (node, python, rust, go,
claude, codex, opencode) are shared tools: resolved per user into the
tools lock by devvm's pinned, checksummed mise, built once into
read-only EROFS images in a throwaway VM from base, and mounted into
every VM that names them. The lock is checked again daily, in the
background through devvm _refresh-tools, and before a new VM when due.
Copies tools/ and guest/tools.sh, and the shared tools part of
guest/sync.sh, which a new VM runs once it starts. e2e gains a tools
section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 09:50:15 -06:00
w3cjandClaude Opus 5.5 53c37e4dee feat(up): create a project VM and open a shell
devvm [IMAGE] in a folder creates its VM: the folder checked (its path,
unsafe folders, a folder made again), its size and ports, the image
named or detected and built, cloned with only the folder mounted, its
state, .git hooks and config locked (macOS), started, then the backend's
shell in place of devvm. Network policy isn't there yet, so a VM is
created only with --no-network-policy; an existing VM is refused for
now. Ctrl+C before the first shell deletes the VM and unlocks .git.

Global flags: --backend, --network-policy/--no-network-policy, --cpus,
--memory, --disk, --ports; up's own --unsafe-folder, --no-git-protect.
tests/e2e.sh gains a project section, with Lima's Exec quoting checked
on a real VM. New docs: commands, security model, .git protection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 09:14:27 -06:00
w3cjandClaude Opus 5.5 c632b96142 fix(build): a failed build keeps its VM for inspection
Once the image's VM exists, a failed start, script, sync or stop leaves
it stopped and without a record; the error says how to open a shell in
it with devvm's Lima home, and the next build deletes it. Ctrl+C, and a
failed create or clone, still delete it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 08:36:56 -06:00
w3cjandClaude Opus 5.5 27905c2413 feat(build): build and rebuild images through the backend
devvm build and devvm rebuild build base and the user's layers through
Backend.BuildImage. On Lima an image is a stopped instance: base from
Ubuntu's cloud image with base.yaml, a layer a clone of its parent, each
started confined with no host mounts, its script run, then stopped. Records
are written last; an interrupted or failed build deletes its instance
through the cleanup stack. Rebuild bumps the rebuild counter and deletes
stale images no VM uses.

tests/e2e.sh starts here, with its framework and an images section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 03:47:25 -06:00
w3cjandClaude Opus 5.5 218d8d9569 feat(lima): Lima backend
The Lima backend behind backend.Backend: limactl on devvm's own Lima
home, run from devvm's data folder, refusing Lima's global configs and
networks devvm didn't set. Start confines VMs with a Seatbelt profile
(macOS) or the QEMU wrapper, devvm _qemu, with restrict=on and a
guestfwd to the proxy (Linux), tolerates degraded starts, and records
the hostagent for Confined. Clones with qcow2 overlays on Linux, size,
ports, mounts, agent forwarding and the ssh target. BuildImage comes
with the image build.

Adds NameMax and LoggedError to the backend package, a limactl stub,
the registry with lima as the default, and the Lima docs page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 03:11:14 -06:00
w3cjandClaude Opus 5.5 e182e3787a feat(ui): output helpers, spinner, run logs and cleanups
internal/ui is now the only package that prints: the message helpers,
prompts, tty detection, the status line, the run log (Logged, step
counts, proxy keys redacted) and ui.Main, which recovers Die, runs the
cleanup stack and handles INT/TERM/HUP (exit 130). main runs devvm
through it, and Cobra's errors print as one-line devvm errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:27:59 -06:00
w3cjandClaude Opus 5.5 13b9afa59e feat(msg): generated typed messages with go-i18n
locales/en.toml holds every message; go generate ./internal/msg writes
one typed function per message. internal/msg renders them through a
go-i18n bundle in the user's language (LC_ALL, LC_MESSAGES, LANG), with
names mode (DEVVM_MESSAGES=names) and doc links. devvm _msg prints a
message's text. Tests check the generated file is current, every
message renders and is called, and every doc link exists; lint runs
the doc link check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 01:42:46 -06:00
w3cjandClaude Opus 5.5 36fb2cb540 test: testscript runner and stubs
Run testdata/script/*.txtar against a freshly built devvm, with HOME,
the XDG folders, the Lima home and the stub state in a sandbox under
/tmp, and testdata/stubs first on PATH. Add the stub_calls command,
uname and sw_vers stubs driven by env vars, scripts for the root
command and the sandbox, and README sections on writing CLI tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 01:19:09 -06:00