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]>
internal/structure parses every Go file in the repo, tests and every
platform's included, and checks what linters don't, as part of
mise run test. Each failure names its rule and file:line:
- max-methods: at most 24 methods a type; largeTypes lists the larger
ones (the backends and backendtest's Fake, which implement
backend.Backend; paths.Dirs, ui.UI, tools.Tools, build.Builder), each
capped at its count
- no-init: no func init, tests included
- package-vars: outside internal/proxy, only interface checks, error
sentinels, compiled regexps and templates, sync.Once* values,
embedded files, and what allowedVars lists with why (ldflags values,
fixed tables, test fixtures)
- layers: only cmd/devvm and cli import ui; only cli imports vm; only
cmd/devvm imports cli; backends import none of the packages above
them; only cli and the registry name a backend; only tests import
backendtest; proxy imports no devvm package; assets, locales,
platform, msg, paths, state and image import only what's below them
TestRulesFail breaks each rule and each layer on in-memory sources.
A new vm.creation type holds create, plan and undoCreate, keeping
Launch under the limit; msg/gen checks fields with idRe. Contributing
describes the test, AGENTS.md points at it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- backend.Backend gains Problems(ctx) []Problem (Key, Fix, Msg): all
that a backend needs and the host lacks. Check is the first of them,
so every command that needs the backend stops at the first one.
- Lima's Problems (check.go): host OS, arm64/amd64 (arch), macOS 13+
(macos, via sysctl kern.osproductversion: platform.MacOSVersion),
Lima missing/broken/older than 2.0 (lima; brew install/reinstall/
upgrade lima when Homebrew is there), on Linux qemu-system-<arch> and
qemu-img (qemu; apt-get, dnf, pacman or zypper's command), /dev/kvm
missing (kvm) or not openable (kvm-access; sudo usermod -aG kvm
USER), Lima's global configs (lima-config). DEVVM_KVM swaps /dev/kvm
for tests.
- devvm doctor [--backend NAME] [--fixes]: a features table (FEATURE,
one column per backend: native, emulated, unreviewed, none; Support
gains String), Docker found or not, then doctor_ok or each problem
(the last one fails). --fixes prints KEY<tab>FIX<tab>MESSAGE lines
and succeeds either way.
- Messages: lima_missing_fix, lima_broken_fix, lima_old_fix,
qemu_missing_fix, lima_arch_unsupported, macos_old, no_kvm,
kvm_access, docker_found, docker_missing, doctor_ok, doctor_failed;
kvm and ok are initialisms in the generator.
- Tests: TestProblems (23 cases), TestWriteFeatures, TestWriteFixes,
TestMacOSVersion, Support's String in TestSupport; doctor.txtar;
the script sandbox sets DEVVM_KVM; e2e images checks doctor.
- Converted: cli.bats preflight (arm64 and x86_64), doctor (macOS
without Lima, Linux without QEMU, x86_64 Linux, limactl that doesn't
run), the doctor half of "all there", doctor's half of the Lima
global configs case.
- Docs: new install.md (requirements, checking them, --fixes keys),
lima.md requirements, backends.md, commands.md, contributing.md,
README; CLI reference regenerated.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
locales/*.toml now hold only go-i18n's message fields and load with
go-i18n's own loader (RegisterUnmarshalFunc with BurntSushi/toml, then
LoadMessageFileFS), so go-i18n's tools work on them. Doc links move to
the docs map in internal/msg/docs.go; TestDocLinks checks every key is a
message and every page and heading exists. The generator decodes en.toml
into go-i18n's message fields and refuses anything else.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>