vmname.VM is the name of every machine devvm runs on a backend: a
project VM, an image's machine (devvm-img-<key>), a build VM and a
remake's aside. Fields, parameters, results and map keys that held a VM's
name as a string now hold a VM, from the backend interface down to the
CLI's --json structs, whose output is byte for byte the same.
Boundary parsers, the only places a string becomes a VM:
- vmname.Parse: a project VM's name (state's vm.json name, export file
names, devvm _links's argument, the forwarder's -vm, project.Nth)
- vmname.ParseListed: one path element, for what a backend lists
- VM.UnmarshalText: JSON (Lima's list, proxy config and events, links'
targets in state, link lists); empty stays no VM
- vmname.Image(key), VM.Aside(), and typed constants for Lima's build VMs
- msg.M.VM: the VM a message's function took, read back
vmname's functions on names became methods (Hash, Slug, Short, Aside,
AsideHash, ImageKey, IsProject); Lima's image prefix moved to vmname;
vmname.Join joins VM lists. Messages' vm and vm_name fields are typed
by the generator. Seven messages whose field took something else became
what= (backend_lacks, backend_unreviewed, backend_unreviewed_used,
starting, deleting, configuring, running_script) and rm_vm_failed's
name=: the text is unchanged, the names-mode scripts follow.
Review.RequireFor names an image or the tools being built.
Typed sites per package (added lines with vmname.VM, non-test): msg 347
(generated), vm 124, lima 48, backendtest 32, vmssh 31, netpolicy 22,
backend 16, gitprotect 14, proxy 11, cli 11, project 10, state 8,
ports 6, paths 3, sshagent 2, sshconfig 2, tools 2.
The structure test's owners rule now fails on a field, parameter or
result named for a VM (vm, vms, otherVM, vmName) typed string, []string
or map[string]…, and on converting anything but a literal to vmname.VM
outside the files it lists; internal/stubtest is free. depguard holds
internal/vmname to the standard library, and the proxy may import it.
ParseListed and UnmarshalText refuse a name starting with -, which would read as a flag in limactl's argv, and vmname.Image refuses a key that's empty, holds a / or NUL, or makes a project VM's name, so Lima's ImageSize and DeleteImage no longer check it themselves. The check also fails on a *string VM name and an alias of vmname.VM, and says what it doesn't see.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm git-protect strict (0.1.0, 0.1.1-rc.1) set diff.ignoreSubmodules =
all in the locked .git/config, which can't keep git on this machine out
of a submodule the VM adds: a .gitmodules ignore line the VM writes
overrides it, and git add -A/-u, describe --dirty, diff-index,
diff-files, fetch and pull recursion and --ignore-submodules on the
command line enter submodules anyway (#37). --clone is the only way to
keep VM code away from host git.
- devvm git-protect takes on|off; strict is a usage error
(git_protect_strict_refused) naming devvm clone on. Use, help,
completion (Modes) and --json reflect it.
- A VM left strict reads as on (Mode, Next) and is pinned and kept as on.
The first check that finds it stopped (Check, then converter.unstrict:
launches, devvm stop, devvm clone on and its undo) removes the value all
from the .git/config of each repo its state recorded before that check,
under the host's git lock, and only where .git's identity is the
recorded git_id (a replaced .git, or a VM with no record after devvm
adopt, is left alone, its all named with the manual remedy:
git_strict_unknown). Each config is read through safefile first,
unlocked for the edit and locked again even after an interrupt
(context.WithoutCancel), and checked to still be a regular file in that
.git afterwards (git_lock_raced). On a watching host, a config whose sum
isn't the check's is left, and the new sums go into the watch's. An
interrupt records nothing. Then on is recorded (mode and next) with one
warning (git_strict_converted), none when next is off. Set on/off and
Unlock (devvm rm) remove it the same way, silently (strictLeft).
- strict recorded nothing about a value it overwrote, so nothing can be
restored: only all is removed (--unset-all '^all$'); any other value is
the user's and stays. This fixes off, which unset any local value.
- A config another VM keeps locked keeps it, named with the manual
remedy (git_strict_kept, via msg.M.Value), and its repo goes in the
state's strict_left, retried at each later stopped check until empty.
A config git can't change is named (git_strict_left).
- Messages: git_locked and git_embedded_new say what on can't stop;
git_locked_strict and git_config_failed go.
- Docs: .git protection's Strict section becomes VMs that were strict,
with the remedies; on and Not covered say a submodule or repo the VM
adds runs through host git until the next check names it, and only
--clone keeps VM code away; attack vectors, How it works, the design
notes, the commands table, ls, the cli skill and the CLI reference
follow.
- Tests: strict_test.go (conversion, values kept, off/on/unlock, nested,
kept and retried, replaced and unrecorded .git, interrupted, next off,
changed since the check, Linux pins and sums, Watch, next, a failed
edit), TestUnstrictFIFO, msg TestValue, git_protect.txtar,
git_pins.txtar, fixture_v010_strict.txtar (0.1.0's app VM made strict
on macOS), e2e project checks on macOS and Linux.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A VM over a folder of repos now protects each nested git repo, not only
the folder's own: one walk (hostsafety.Walk, at most 4 folders down and
100 repos, no symlinks, one device) finds them, and each is locked on
macOS, pinned on Linux or watched where Linux can't pin, scanned within
its own top folder and the mount. A repo counts as covered only when a
scan locks its git dir; git dirs follow git's own rule, .git is matched
without case on macOS, and a recorded repo stays protected while
anything is at its .git. Repos the walk can't protect, that appear,
that leave or that look like bare repos are named, with the config keys
and hooks a VM-made repo would run. Existing VMs get a one-time notice
and opt in with devvm git-protect on. Ownership fails closed under one
host lock, so a VM never unlocks what another protects; one scan budget
covers every repo, and launches into a running VM check only the top
repo. devvm doctor gives a tip to set safe.bareRepository=explicit,
reading the user's GIT_CONFIG_GLOBAL when set.
Refs #3.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Linux, a start of a VM whose protection is on pins .git, its git dirs
and every lock path read-only in a user and mount namespace that devvm
_qemu pinned makes around QEMU. It keeps the pins while QEMU runs, records
each re-pin, refuses hard links and fails closed on watches and records;
doctor says why a host can't lock, and such hosts watch .git instead. The
pins' events file is read through safefile, and the command-line check
takes "devvm lock" in prose as English.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
tree.scan finds .git's parts once per check, which locking, unlocking,
the watch and the reports all go by. A Locker interface does the locking
(Flags on macOS, Watch elsewhere), and protect's reports are a table. No
behaviour change but the order of lock's warnings; the scan's reads of
git's own files go through safefile.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
internal/safefile (standard library only) owns every read of a file a VM
can write or swap: Read and Open never block on a FIFO, follow a final
link only when asked, and check the opened file is regular, within its
cap and, with OneLink, singly linked; OpenRoot opens beneath a folder.
The proxy, secrets, agentlogin, devcontainer, detect, agent save and
gitprotect read through it, fixing three hangs on a FIFO the VM leaves,
and forbidigo holds those callers to it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Linux hosts have no unprivileged immutable flag, so devvm can't lock
.git there. It now warns at every launch of a VM that mounts a folder
with a .git (git_unprotected), unless it's a --clone VM or the user
chose devvm git-protect off (git.chosen), and it names, after the fact,
the hooks and config that changed (git_changed). It sums what a lock
would cover, .git/commondir, include.path targets and the folder
core.hooksPath names, never through a symlink out of the project folder
and within bounds (git_watch_blind names what it can't fully watch), at
each launch that finds the VM stopped and at devvm stop.
A check on such a host runs protect's reports without locking:
git_replaced, git_commondir, stray worktrees, git dirs that appeared,
core.hooksPath and delegations into the project folder, and a
submodule's folder that isn't a git dir (git_gitdir_not_git), in which
nothing is created and which the watch doesn't sum as a git dir.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The VM writes a submodule's .git file or folder, so it could name any
folder in the project as a git dir, and devvm then locked that folder's
hooks and config (a React src/hooks, say) or made an empty hooks folder
there. A git dir in the working tree now counts only when isGitDir
passes (a HEAD next to objects and refs folders), the check gitDirs
already ran for .git/modules. devvm locks and creates nothing in a
folder that fails it, and reports it once, and again whenever it
changes, as the new git_gitdir_not_git (delegation kind notgit).
Docs: safety/git-protection's When devvm reports .git, and
internals/git-protection's What's locked and On each launch.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
msg.Reporter is what every package below cli prints and asks through:
Info, Say, Note, Warn, Status, Ask, Confirm, Answer, the terminal checks
and CanPick, the run log (LogNote, LogWriter, LoggedCmd, WithSteps),
Stdout, Stderr, AddCleanup and Interrupted, under the UI's signatures.
*ui.UI implements it (a compile-time check in ui), and msg.Fake is the
tests': quiet as its zero value, its On funcs and fields record and
answer.
The six UI interfaces (tools, netpolicy, lima, registry, sshagent, vm)
are gone, and the copied output and prompt func fields of tools.Env,
tools.Making, gitprotect.Protector, secrets.Store, netpolicy.Proxy,
from.Lookup, backend.Review, lima.Lima, sshagent.Agent, vm.Env,
vm.SizeChoice, vm.AgentsChoice, vm.LayersChoice, vm.NetworkChoice,
vmssh.Forwards, build.Env and sshconfig.Config: each embeds the
Reporter. Lima's and the shared tools' Warn, which says where the run
log is too, is a method of their own over it; vm's interactive check is
a function over it. The pickers (build.Env.Pick, vm.Env's PickFeatures
and PickParts, the choices' Pick) and vm.Env.CanAsk stay fields: they
carry types of their own or cli's answer. The test UIs of tools,
netpolicy, lima, registry, build and vm become msg.Fake.
Coverage baselines raised: internal/backend/lima, internal/msg,
internal/tools.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
into and hooksPathInside resolve a path whose folder is missing with
paths.Physical on its folder, keeping the by-name result too, so a path
under a symlink to the project folder counts as inside.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
gitprotect's into, realInDir, hooksPathInside and embeddedIn's two checks
use paths.Below, Within and PhysicalParent (resolvedPath goes), and
clone.go's insideClone and saved-prefix check use Below and Within. Tests
pin each check's behaviour first: symlinks, .., trailing slashes and a
missing last element.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A project folder whose .git pointed into another repo on the host (a
gitdir file, a commondir, alternates) passed the --clone check, and the
seed push copied that other repo's branches into the VM.
gitprotect.OwnRepo now checks what git reads in the folder: a .git
folder without a commondir, or a linked worktree's .git file whose link
git made both ways (its gitdir is <repo>/.git/worktrees/<name>, that
entry's gitdir file names this .git back, and its commondir leads to
that <repo>/.git); no alternates, and no objects, packed-refs, reftable
or refs that are symlinks, in the git dir or the common dir. cloneSource
runs it before the VM is made and again before the push, and checks
that git's rev-parse --absolute-git-dir and --git-common-dir agree. A
worktree's push sends only its branch and that branch's upstream.
gitprotect's commondir and gitdir resolution are shared (commonOf,
resolvedDir) rather than copied. New messages: clone_git_elsewhere,
clone_alternates. Tests: TestCheckCloneRepoPointers (failed on the
previous code), TestSeedRefs, TestUpCloneWorktree, TestOwnRepo, and
clone.txtar's refusals.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
platform.HasImmutableFlag says whether the host has a user-immutable flag
(true on macOS alone), and the Protector's CanLock field, set from it by
New, replaces its OS field: NewMode, NewVM, Set, Check, Unlock and
devvm git-protect's running-VM check (vm's settings) read it instead of
comparing an OS name with "darwin". Tests set CanLock; TestNewCanLock
checks New takes it from platform, and TestRealLocks skips on the same
constant.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A VM's state is vms/<hash>/vm.json: core fields (version, id, name,
alias, image, chain, from, dir, folder, backend, backend_at, created)
and one section per package, each a json.RawMessage its owner decodes
into its own type (state.Section, state.SetSection), what was asked for
at its top level and what devvm made under "made":
net (netpolicy), git (gitprotect), ports (the new internal/ports),
agent (sshagent), tools (tools), secrets (secrets), and size, clone,
devcontainer, desktop and links (vm, internal/vm/state.go).
- state.VM.Update takes vms/<hash>/lock (platform.LockFile), reads the
file again, applies a change and writes it once; a failed change, or
write, writes nothing. VM.Set and its calls are gone; read-modify-write
of lists (links, publish, secrets, tools, size, ports) happens inside
Update. VM.Claim also holds run/claims.lock, after the VM's own;
VM.Create writes a new VM's whole record once, its alias chosen
(sshconfig.ChooseAlias) under the claims lock. Reads take no lock.
- created replaces "net unset" as unfinished (VM.Finished).
- internal/ports: the ports section (forward, host.ssh/proxy/desktop),
ports.Used (was netpolicy.UsedPorts), and one Allocator for ssh, proxy
and desktop ports under the claims lock (desktop allocated without
one before; run/ports.lock and netpolicy's own ports key are gone).
- gitprotect: mode recorded before the backend makes the VM (NewMode;
clone for --clone, which ls and git-protect share as gitprotect.Mode);
made.git_id (platform.FolderID), one git_dirs list for modules and
embedded git dirs, delegations, protected; Unlock takes the union of
recorded and current git dirs.
- links' entries, git dirs, tools and devcontainer commands are JSON
lists, not strings in values; the key=value parser is gone.
- vm.checkState reads every section of the folder's VM as it's found.
- registry.For drops its unused Dirs.
- Tests: TestVMRoundTrip, TestVMOtherName, TestVMID, TestVMUpdate,
TestVMUpdateTogether (two writers on one VM and on crossed VMs),
TestVMClaim, TestVMFailures, TestVMCorrupt, TestChooseAliasTogether,
TestUsed, TestSSH, TestChooseTogether, TestUnlockRecorded,
TestCheckState, TestChangesTogether, TestChangesAtOnce; testscript's
vm_state, json_set with dotted and := keys; e2e's vm_state/vm_set.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
paths.FromEnv reads HOME, which must be absolute, and keeps it, cleaned,
as Dirs.Home; everything else takes the home folder from there. Six other
reads go: vm.NewEnv's and cli's devvm secret's os.Getenv("HOME"),
gitprotect.New's, Docker's and smolvm's os.UserHomeDir (Desktop's
settings file, the machines' location), and smolvm's Getenv("HOME")
(DiskDirs).
- vm.Env.Home and secrets.Store.Home are gone: both read Dirs.Home.
secrets.NewStore takes the Dirs alone; gitprotect.New takes the home
folder for ~ in git's paths.
- forbidigo bans os.UserHomeDir, with its line in
testdata/lint/forbidigo.go; the structure test's owners check gains
envOwners, HOME read only in internal/paths/dirs.go, with cases for a
read outside it, through a field, in paths and in a test.
Tests: TestFromEnv checks Home (and a HOME cleaned), TestNewHome (~ is
the home New is given, not the environment's), TestDiskDirs checks
Location too. Coverage unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm ran git on the host bare: --clone's git status could run a repo's
core.fsmonitor or filters, its push, fetch, update-ref and remote remove
the repo's hooks, and git could ask on devvm's terminal or follow
GIT_DIR from devvm's environment. internal/hostgit is now the one runner
(Command, Output, Status), with its settings as GIT_CONFIG_COUNT pairs:
core.fsmonitor=false, core.hooksPath=/dev/null,
core.alternateRefsCommand=true, hook.EVENT.enabled=false for every
githooks(5) event, protocol.allow=never with protocol.ssh.allow=always;
and, for a command with -C DIR, hook.NAME.enabled=false and
filter.NAME's clean/smudge/process emptied with required=false for
each hook and filter driver DIR's config names. It drops every GIT_*
variable and relative PATH folders, and sets GIT_TERMINAL_PROMPT=0,
GIT_NO_LAZY_FETCH=1 (a repo that says it's a partial clone fetches
nothing, with its core.sshCommand or ssh), GIT_SSH_COMMAND=false (no ssh
but gitSSH's) and GIT_SSH_VARIANT=ssh; maintenance.auto=false and
gc.auto=0. Status adds --no-optional-locks and --ignore-submodules=all.
Callers: gitprotect (git, ignoreSubmodules), project.SSHRemote, vm/sync's
gitConfig, vm/clone (hostGit, gitSSH, saveFetched, the uncommitted-changes
status). gitSSH takes the VM: ssh with BatchMode, StrictHostKeyChecking,
devvm's known hosts only, HostKeyAlias=VM, ForwardAgent=no and
ClearAllForwardings=yes, so a url.*.insteadOf reaches only the VM with
its pinned key. The seed push adds --no-verify, --no-recurse-submodules
and --no-signed; rm's fetch --no-recurse-submodules.
Not neutralized: an include.path can make gitConfig read
user.name/email from another git-config file (sent to the VM as its
identity), and a FIFO as a config file hangs git until Ctrl+C; neither
runs code. A VM swapping the repo's config between repoOff's listing and the command
could hide a filter from it, and a --clone VM's root (its host key)
working with another VM that writes the repo could send the push to a
server of theirs; both documented in internals/git-protection.
Tests, each with plain git first running what the hardened one doesn't:
hostgit's TestCommandNoFsmonitor, TestCommandNoHooks (reference-
transaction, pre-push, from .git/hooks and a core.hooksPath; path,
file:// and ext:: pushes refused), TestCommandNoConfigHooks (hook.NAME.*),
TestCommandIgnoresGitEnv (GIT_DIR, GIT_WORK_TREE; environ),
TestCommandNoLazyFetch (a partial clone's core.sshCommand),
TestStatusNoFilters (clean, process, required, names with dots, = and
capitals), TestStatusNoSubmodules; vm's TestHostGitNoFsmonitor and
TestCloneRunsNoHooks (seed push and rm's fetch, update-ref and remote
remove); clone.txtar's push ssh options.
Docs: safety/attack-vectors (devvm's own git commands),
internals/git-protection.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A value a VM made reached the terminal unfiltered wherever a caller
forgot msg.Shown, such as the errors passed as err.Error() and a link's
name. Four cleaners did the job in different ways: msg.Shown (quoting),
ui's printable and oneLine, netpolicy's oneLine and the port
forwarder's log (which let C1 through, in UTF-8).
msg.Printable and msg.OneLine are now the one cleaner: they drop C0 but
newline and tab (OneLine drops those too), DEL and C1, in UTF-8 or as a
lone byte. Every message value goes through OneLine as the message
renders, in Text, Segments and names mode, so no caller can forget it,
and msg.Shown is gone with its 68 calls. The status line, the run log's
end and verbose output, Pick, devvm network log, the forwarder's log and
a clone's status lines use them too.
Tests: TestPrintable and TestValuesArePrintable (internal/msg), the
hostile-value segments test, TestLogLimit (internal/backend/vmssh) with
C1 in UTF-8 and as a lone byte; TestCheckLinks and
TestNewVMOtherRepoAndCommondir expect the cleaned values.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- rm_export_failed names devvm rm --no-export, the flag that skips the
export, in place of devvm rm -f.
- devvm rm --no-clone-check deletes a --clone VM without checking its
clone, after warning that its unfetched commits and uncommitted changes
go with it (clone_check_skipped). clone_check_failed names it.
- devvm git-protect on, strict or off on a running VM (macOS) is saved
in the VM's state (git_protect_next) and applied the next time devvm
finds the VM stopped: devvm stop, devvm restart, or the next launch of
a VM stopped some other way, before it starts (git_protect_next_stop).
So git_protect_flag_ignored's advice, devvm git-protect off, works on a
running VM, and git_protect_running is gone. gitprotect owns the key
(Next, SetNext; Set drops it); vm's checkGit applies it, then the
.git check and set-id files, for devvm stop and every launch.
Tests: TestSetNext (internal/gitprotect); git_protect.txtar (a running
VM's choice saved, replaced, applied by devvm stop and by the next
launch); clone.txtar (clone_check_failed, then --no-clone-check);
e2e project's git-protect check and clone's rm check.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
.golangci.yml:
- forbidigo bans context.Background and context.TODO outside internal/ui
and cmd/devvm.
- nolintlint requires each //nolint to name its linters and say why, and
reports unused ones.
- reassign (patterns .*) forbids setting another package's variables,
tests included.
- revive keeps its default rules and adds function-length (100
statements, 160 lines) and cognitive-complexity (75).
Fixes:
- Backend.Lifeline takes a ctx: smolvm's machine data-dir lookup runs
with the caller's.
- The proxy's TLS handshake with a VM uses the request's context, limited
to 30 seconds.
- OAuth token refreshes run within refreshTimeout (30 seconds).
- Tests use t.Context().
- Launch.create is split into plan, newVM.record and undoCreate.
- lima's TestStartConfined is split into helpers.
- smolvm's Terminal comes from its UI's StdinIsTerminal.
- Unused //nolint directives are removed.
- Fresh contexts that remain (an in-memory TLS parse, lookups shared by
every request, a test cleanup) each carry a nolint saying why.
Docs: contributing.md lists which lint rule enforces which convention;
AGENTS.md names the linters behind its Go conventions.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
internal/ui has no package state: ui.UI holds the streams, terminal
flags, run log, status line, cleanup stack and interrupt flag, and its
functions are methods. ui.Main makes the run's UI on devvm's own
streams, owns signals, recovers Die and runs the cleanups; ui.New makes
one on other streams. cmd/devvm passes it to cli.Execute, and every cli
command gets it through its constructor.
Only cmd/devvm and internal/cli import internal/ui (a depguard rule).
Each other package defines the small UI interface it needs, which its
constructor takes, filling fields tests set:
- gitprotect.New, secrets.NewStore, from.NewLookup: a warn func
- ubuntu.New: LoggedCmd, Note
- netpolicy.NewProxy: Note, Warn, Ask, Confirm, StdinIsTerminal; its
log lines drop control characters themselves (oneLine)
- sshagent.New: Info, Note, Warn, LogWriter
- tools.New: Info, Warn, LogNote, Status, LoggedCmd, AddCleanup
- lima.New, smolvm.New: Info, Warn, LoggedCmd (their Runner's Run),
WithSteps, AddCleanup, Interrupted; lima LogNote and ubuntu's too
- backends.Registry: lima's and smolvm's
- vm.NewEnv: all of the above, Say, Stdout, Stderr; Env has Stdout,
LogNote, LogWriter, LoggedCmd, AddCleanup, Interrupted fields
- build.Builder: Terminal and LogNote fields
- sshconfig.New: its caller sets what it prints and asks
ui's tests build their own UI over buffers and run in parallel; other
packages' tests use small fakes; cli's unit tests a UI over buffers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm git-protect shows a folder's VM's .git protection (on, strict, off,
or clone for a --clone VM) and changes it while the VM is stopped. On and
strict lock .git as it is now, reporting what a lock can't cover as a new
VM does; strict also sets diff.ignoreSubmodules=all in the locked
.git/config, which on and off take out; off unlocks. Locks need macOS.
- gitprotect: Mode, Set, ignoreSubmodules; NewVM and Check share
protect (new, on, check); strict counts as on for launches and rm.
- Messages: no_vm_git_protect, git_protect_failed, git_protect_running,
git_protect_on_needs_macos, git_protect_clone, git_config_failed,
git_locked, git_locked_strict, git_lock_later, git_unlocked;
git_protect_flag_ignored names devvm git-protect off.
- Tests: TestSet, TestSetStrictFails, TestSetLinuxAndNoGit;
testdata/script/git_protect.txtar (project.bats strict and
git-protect-waits cases). e2e project: waits for stop, strict, off/on,
refused off macOS.
- Docs: git-protection.md (turning it on or off, strict), commands.md,
CLI reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm opens a VM that exists instead of refusing it: unfinished VMs
(no state or no network choice) are refused before anything; --backend,
--network-policy, --no-git-protect, --cpus/--memory/--disk and --ports
are ignored with a warning each; an IMAGE naming what the VM lacks adds
it in place after asking (tools built and listed, a layer's script run
in the VM, new agents' folders mounted with a stop first); outdated
images and newer tools are warned about, the daily tools check runs,
agent folder mounts follow the host's, .git is checked per run, set-id
files are named on Linux, a stopped VM gets the size and ports its state
asks for (a running one is told they apply at its next start); then it
is started if stopped (a running VM with network policy keeps its
proxy), the self-check runs (a failure stops the VM), and it is set up
and its shell opened.
Commands: restart (stop, then open), update (newest shared tools, built
from base, then open), remove TOOLS (out of the image and tool list,
then open), adopt (a VM made for an earlier folder at this path, after
asking; .git protection restarts as appeared), rm [-f] (exports the
agents' history first unless -f, a failed export keeps the VM; a VM of
an earlier folder only after asking, without export; deletes the VM,
state, proxy, rules, run files, logs, .git locks, host keys and ssh
config entry, also when the delete failed but left no VM).
Inventory:
- vm: find/findExisting/existing, sameFolder, open, run, setUp,
warnIgnored, checkSetID, applySize, applyPorts, addLayers,
wantedImage, runScript, buildTools; Restart, Remove, Update, Adopt,
Rm, export, delete; start refuses vm_unfinished and stops a leftover
proxy for VMs without network policy
- gitprotect: Protector.Check (replaced, appeared, new submodules in
the tree and .git/modules, unlocked hooks, commondir, delegations on
change; locks only while stopped; unset protection set up as new),
Locked field; platform.Immutable
- tools.Update takes a build func; build.Builder.LayerScript exported
- cli: restart, remove, update, adopt, rm; withEnv; root Long
- messages: vm_other_folder (reworded), vm_other_folder_rm/_adopt,
delete_other_folder_vm, adopt_vm, vm_adopted, vm_already_here, no_vm,
vm_unfinished, backend/net/git_protect/ports_flag_ignored,
size_flags_ignored, size_next_start, ports_next_start, add_in_place,
restart_for_mounts, no_terminal_confirm, keeping, adding,
add_layer_failed, vm_is_now, exported, export_failed, deleted,
rm_failed, adopt_failed, git_replaced, git_appeared,
git_embedded_new, git_hooks_unlocked; net_unenforced_stop says devvm
starts it again confined; vm_exists removed
- tests: testscript existing.txtar, existing_agents.txtar; Go tests for
Check (five per-run reports, replaced/appeared, off/unset), open with
network policy, addLayers, Rm, Adopt, remove/update/restart; limactl
stub: delete-fails, Exec-fed scripts
- converted bats: delete (vm_unfinished, rm cleans up after a failed
delete, rm deletes only this VM), project (folder made again, update
twice, remove twice, five .git per-run reports), ports (applied once,
restart warning), size (restart warning), cli (rm forgets host keys)
- e2e: project (stop and relaunch, running relaunch, restart with host
keys, swapped .git, new submodule locked, rm unlocks; agent folder
added/removed on restart, rm exports history without logins), tools
(update, remove), network (relaunch confined, unenforced relaunch
stops it, rm -f)
- docs: commands.md (existing VM, adding, deleting, a folder made
again), coding-agents.md (mounts on launch, history), git-protection
(on each launch), images, network, security; CLI reference
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>