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]>
golangci-lint now also runs govet's nilness, unusedwrite, hostport and
waitgroup analyzers, nilnesserr, durationcheck, canonicalheader,
errchkjson, forcetypeassert, contextcheck and gochecksumtype.
- errchkjson checks each JSON encoding's error where the value could
fail and drops it where errchkjson proves it can't, and reports
structs without exported fields; tests may drop theirs.
- forcetypeassert holds the code; tests are exempt.
- gochecksumtype: agentlogin's format is a sum type (//sumtype:decl),
and a switch on one names every case, default or not.
- canonicalheader: WWW-Authenticate, X-Request-ID, X-Api-Key.
- contextcheck: ctx threaded through carry, peekClientHello and sniOf,
and through inject and value, whose cached lookup takes
WithTimeout(WithoutCancel(ctx)), so two forbidigo nolints go;
openTransparent takes its dialer's ctx. nolints stay where
contextcheck can't follow: ReverseProxy's Rewrite, WithoutCancel
alone, cobra's cmd.Context, e2e's runner window.
- No-behaviour fixes: scrubList for redact's list, the loopback
forward's ports kept with its listeners, upgradetest's Key keeps its
public key, a CA's leaves read through leafOf.
Contributing's Go lint rules lists each one and the sum-type convention.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upkeep: CI, flaky tests, dead code and the coding agents page.
- test: tests never run git on the repo they're run from. A git that
runs the tests (a hook, git rebase --exec) sets GIT_DIR and friends,
and the tests' plain git followed them into the real repo's config.
Every test's git now runs through internal/stubtest (Git, GitEnv,
NoGitRepo), the structure test enforces it, and the whole suite
passes with GIT_DIR pointing at a decoy repo that stays untouched.
- ci: two test jobs instead of three: Linux in America/Los_Angeles
(DST) and macOS in UTC, with lint on both, since golangci-lint checks
only the runner's OS's files.
- test(e2e): accept Codex 0.167's wording for an API-key login.
- test: internal/safefile's swap-after-look branch is tested on purpose
through a seam, so its coverage no longer depends on a race (97.7%
every run).
- test(fetch): TestRetryUnanswered's "no answer" comes from a listener
that keeps its port, so a parallel test's server can no longer take
the freed port and answer in its place (Linux reuses ports at once).
- refactor(proxy): the test-only policy.decide and policy.byRequest
move to the tests; the proxy already judges a host from one read of
the rules (rulesFor).
- docs(agents): "Pasting images" moves down the coding agents page,
before History, and its run of paragraphs becomes commands and
lists, every fact and anchor kept.
Gate and coverage pass on each commit; e2e `network` and `project` pass
on Linux (251 passed, 4 macOS-only skips).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
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]>