204 Commits
Author SHA1 Message Date
w3cjandClaude Opus 5.5 7c4659ce87 chore(release): trust the second release machine's tag-signing key
packaging/release-signer names a fingerprint for each machine that tags
releases, so a tag signed on either one builds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-20 19:24:00 -07:00
w3cjandClaude Opus 5.5 bcd126a2c4 chore(release): 0.2.0-rc.1
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-20 17:51:16 -07:00
w3cjandClaude Opus 5.5 47593e21ab fix(proxy): NormHost keeps an address's trailing dot, its IPv6 zone's, and Public calls no zoned address the internet's
NormHost dropped one trailing dot from any host, so an IPv6 address whose
zone is "." (::1%.) became ::1%, an empty zone, which netip reads as no
address. The proxy refused both forms (HostOK), but a partial clone's
promisor warning (privateHost) no longer saw ::1%. as private, as
FuzzPromisorHostSite found. NormHost now leaves an address as it is, its
dot included, so every judge reads such a host as the zoned address it
is. Public now calls no address with a zone the internet's: netip's
prefixes never contain a zoned address, so the ranges alone missed, for
example, a zoned documentation address, which --from's registry check
took as public.

No VM could reach anything through such a host: every way in (CONNECT,
absolute-form requests, a transparent connection's Host and its TLS
server name) refused it with 400 before any lookup or connection, on
every tier, the broker refuses a lookup of it and a connection to a
zoned address, and no rule or NO_PROXY entry names one.

Tests: TestZonedHostsRefused sends each zoned and empty-zone host
through CONNECT, plain HTTP and the transparent path on the open,
internet, allowlist, none and loopback-allowing tiers, checking each
refusal is the proxy's own where net/http lets the request through,
with a control on each path that [::1] itself reaches the dialer where
allowed; it passed before the fix too, and fails when HostOK takes a
zone. TestNormHost, TestBrokerLookup, TestBrokerDial, TestInternal and
TestPublicAddr gain zoned cases; FuzzHostSites' splitSite and
policySite list the new divergence (zoneDot), and FuzzPromisorHostSite
lists a zoned address now counting as private; its crash input and the
zoned-unspecified one ([::%[]:) are added. design.md's list of the
host readers' differences names both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-20 17:36:57 -07:00
w3cjandClaude Opus 5.5 947decb301 fix(vm): VMs get the host terminal's COLORTERM (fixes #54)
limactl shell asks ssh to send COLORTERM (SendEnv), but its session
rides Lima's shared ssh connection (ControlMaster), opened without it,
and the master filters a session's environment by its own SendEnv, so
the variable never reached the VM (lima-vm/lima#2208, #1481). Closing
that connection would end every session and the VM's SSH agent relay,
so devvm now sets COLORTERM in the command it runs in the VM instead:

- backend.ShellOpts and ExecOpts get ColorTerm. Lima's Exec runs
  `cd D && export COLORTERM=<quoted> && exec argv`, and its Shell, with
  a ColorTerm, runs `sh -c 'export COLORTERM=<quoted> && exec "$SHELL"
  --login'`, as limactl shell does without a command; without one, the
  argv is as it was. colorTerm (lima) quotes the value with shell.Quote
  and links Lima #2208, so it can go once Lima sends it.
- vm's colorTerm is the one allow-list: only truecolor and 24bit pass,
  anything else or none is "". target.shell (devvm's shell) and
  AgentLogin.loginOpts (an agent's login on a terminal) fill it from
  Env.Getenv; no other command in the VM gets it.
- devvm's ssh config entries add `SendEnv COLORTERM`, so plain ssh by
  name (ControlMaster no) sends it: the e2e showed the base's sshd has
  AcceptEnv COLORTERM. It adds to a Host *'s SendEnv.

Tests, each failing without the fix: TestExecAndShellColorTerm (lima),
TestColorTerm (vm: the shell's and the login's value for allowed,
near-miss and injection-shaped values), testdata/script/colorterm.txtar
(the stub limactl's argv for the shell and an agent's login), ssh.txtar
and sshconfig's pinned lines, and e2e: a fresh VM's first shell, a
login shell on a terminal in the folder (24bit, and none for another
value) and ssh devvm-web. The structure test's dynamicScripts lists
both new built scripts.

Docs: Managing VMs, ssh access by name, How it works' Lima (A shell's
colors) and security (the ssh entries), and CHANGELOG Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-20 11:27:28 -07:00
w3cjandClaude Opus 5.5 c4b4c02424 test: FuzzCapture skips devvm's own placeholders; FuzzParseLFSPointer counts a size as it parses
The nightly fuzz run found two inputs that failed the tests' own checks,
not devvm:

- FuzzCapture: a 26-character access token that is a prefix of fakeJWT's
  fixed header. The VM's reply held only placeholders, and the check
  matched the placeholder's header. It now looks for the tokens in the
  reply without devvm-proxy-managed and JWT-shaped placeholders whose
  header and claims are fakeJWT's own (its mark and an expiry).
- FuzzParseLFSPointer: "size -0", which strconv.ParseInt and git-lfs read
  as 0. The check counted only a canonical size or one with a leading +
  or zeros; it now counts a size line that parses to the size taken.

Both inputs are in the corpus.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-20 02:13:41 -07:00
w3cjandClaude Opus 5.5 a1c09016a1 test(vm): TestAgentImportFailsWhole keeps the listed file's inode
The test swapped the last listed file by removing it and writing a new
one at its path. On ext4 the new file can get the removed one's inode at
once, so it is the same file by device and inode, the import copies it,
and the test failed on Linux CI. The listed file is now renamed aside,
so its inode stays in use and the new file is another.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-20 02:01:54 -07:00
w3cjandClaude Opus 5.5 755f9bfd93 fix(vm): devvm link, link add and rm, group join and leave, network learn and lock, and a VM's stop show a status line for every slow step
TestCommandStatusLines runs more of the commands on a running and a
stopped VM, answering their questions in a terminal through the
msg.Fake (Confirm, Ask, Answer and the picker) and failing on one asked
under a status line: devvm network lock's picker (learned hosts in the
proxy's log), which it checks is asked, mount-cache and mount-cache
none, whose restart it checks is asked and answers yes, and with a
second VM, api, which runs, publishes 5432 and is in group web: link
add, link, link rm, group join, then link publish and unpublish (api's
links change in the group), group and group leave, then with api
stopped link add and link, then rm of api, which web links to. devvm
restart runs last but for devvm stop, on the VM restarted and again on
it stopped, and rm, as it starts a stopped VM. A proxy or a link
session started with no status line showing fails it.

It found, each now under a status line:
- linkRuns.apply, which gives a VM its changed links (its running
  checked, its setup sent again, its link session started, the wait for
  what came of each link), for link add and rm, link publish and
  unpublish, a group's changes and a target gone: links_applying.
- Links.warnUnenforced's look at the target (Inspect, and whether its
  tier is in force): checking_vm.
- Links.List's targets' status: reading_vms.
- Net.applyTier's PrepareRunning between two confined tiers, which
  starts the proxy again for the new tier, for network learn and lock:
  proxy_applying_tier.
- Net.Lock's read of the VM after the picker: finding_vm, only around
  the read, as applyTier shows its own.
- target.stop, every stop of a folder's VM (a restart, devvm stop, a
  move, a remake): stopping, which Lima's own step shows too.

Tests: testProxy runs a link session as a sleep that says each of its
links is carried, at once and as they change (linkSession), its signal
and the test's cleanup waiting until it says nothing more; sleeper is
the one sleep standing in for a background process, for testProxy,
testForwarders and linkRunsEnv; secondVM, beside existingVM, makes
TestGroupJoinsAtOnce's second VM too.

Docs: Contributing's status lines; CHANGELOG; the descriptions of
checking_vm, reading_vms, stopping and links_applying.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 23:15:50 -07:00
w3cjandClaude Opus 5.5 888078c9cd fix(vm): devvm agent save and import read names as the store's volume does, so a name that differs only in case never deletes a file
On a volume that ignores case, as a Mac's does by default, a store with
Foo.md and a VM sending foo.md (or a home folder with foo.md, for
devvm agent import) made the command rename the new file over Foo.md,
which keeps its name, then move Foo.md aside as a file the folder no
longer has, and delete it with the staging folder, reporting success.

- pruneIn keeps what keep names as the volume reads it: every kept
  name's folder, or file with one name, by what it is (platform.DevIno),
  so the store's Foo.md that a foo.md just replaced in place stays, in
  save's pruneFolder and import's apply alike. A hard link is kept only
  by the name keep has.
- storeFiles takes the VM's names and lists a store's file that the
  volume reads one of them as, under another name, under the VM's name,
  so compare shows the VM's foo.md as a change to Foo.md, never an add
  and a remove, and a kept name keeps its file. A hard link is never
  listed so, and the diff shows its names removed, more than the save
  takes out, never less.
- storeStage.claim checks each path before the stage writes it in its
  staging folder, which is on the store's volume and holds only what it
  wrote: a part already there under no name it wrote is a name the volume
  reads as another of its own (nameClash), named with that one. The save
  stages its folders too, and checks the names it leaves out
  (agent_save_names_collide); the import checks its folders and files
  (agent_import_names_collide). Either fails before the store changes.
- The save holds a VM's paths to the import's bounds, 128 folders deep
  and 4,096 bytes, measured from the agent's folder as the import's walk
  measures them (agent_save_too_much, which now lists every bound): each
  folder's claim, make and apply opens its path one name at a time, so a
  chain thousands deep cost the square of it under the store's lock.
  safefile's walkMaxDepth and walkMaxPath are MaxDepth and MaxPath, the
  one owner of both.

Tests that fail without the fix: TestAgentSaveCaseOnly,
TestAgentImportCaseOnly (the file was gone; a left-out PH.md shown
removed), TestAgentSaveCaseOnlyHardLink (the diff showed a change and
the save took out the other name), TestAgentSaveNamesCollide (two
files, two folders, two empty folders, a file and a name left out),
TestAgentImportNamesCollide (through the import's stage); they skip on
a volume that tells case apart. TestStoreNamesByWhatTheyAre (a hard
link stands in for the volume's other name, on any host) and
TestReadSent's depth and path cases, each at its bound and past it.

Docs: using/coding-agents.md (importing, saving), internals/agents.md;
CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 23:05:59 -07:00
w3cjandClaude Opus 5.5 2de3e31a6c fix(vm): devvm ports shows a status line as it restarts a running VM's forwarder, and every lock's wait is tested for its label
Lock waits:
- Tests record the label of each lock's wait that had none, the lock held
  as by another devvm and the wait ended by a cancel, a deadline failing
  one that shows nothing rather than hanging: git_lock_waiting
  (TestGitLockWaits; .git protection's Serial is gitSerial, so a test can
  reach it), packages_waiting and rebuilds_waiting (TestImageLocksWait),
  ubuntu_pin_waiting (TestPinOriginWaits), custom_secrets_waiting
  (TestYoursLockWaits) and forwarder_waiting (TestForwardsLockWaits).
- A test build's locks panic on a nil platform.Waiting
  (platform.CheckWaiting, which the root's run calls in every test build
  beside state.CheckLockOrder), so the CLI tests and e2e catch a nil wait
  the structure test can't see, such as a zero agentlogin.File's; a
  msg.Waiting given a nil status shows nothing and stays review only.
  msg.Waiting with no status gives a wait that shows nothing, never nil;
  platform.NoWait is the Waiting of a lock that never waits (the build
  port's record, which passed nil), and the status-lines rule holds it to
  statusSites as it does nil (TestCheckWaiting, TestWaiting, the rule's
  NoWait case).
- forbidigo refuses syscall.Flock and unix.Flock outside internal/platform,
  internal/proxy/rotate.go, the stubs and tests (testdata/lint, both).
- TestLockFileWaiting runs in a synctest bubble and checks the wait shows
  while held, not before (its counters under a mutex, which the race
  detector needs, as only the file's lock orders them).

Status lines:
- TestCommandStatusLines runs the setters too: devvm ports LIST and ports
  add, size --cpus, network open, allowlist, transparent off and on, learn
  and allow, git-protect off and on, ssh-agent off. It found devvm ports on
  a running VM starting its forwarder again (ssh and a command in the VM)
  with no status line; that step now shows ports_restarting.

The folder named twice:
- vm_folder_unreadable's why was the open's error, the folder's path in
  it; folderUnreadable gives the system's reason alone when the error is
  about the folder itself (TestUnreadableFolder checks the whole message).
- platform.OpenNoLinks and StatFolder return a link on the path as an
  fs.PathError about the folder too (ErrLinkOnPath still matches), so that
  case names it once as well (TestStatFolderUnique).

Docs: Contributing's CLI page (status lines) and structure page, the
codebase-standards guards; CHANGELOG (devvm ports' status line).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 17:04:29 -07:00
w3cjandClaude Opus 5.5 f80fd2df60 fix(vm): devvm agent save applies all or nothing under the login lock; a lock's wait and a walk end with their context; a link to the home folder counts unless only root can change it
All or nothing:
- devvm agent save goes through devvm agent import's undo journal: each
  plan's files are written into a staging folder of the agent's store
  (saver.stage, newStage, the import's .devvm-import- name, swept by the
  next import or save), then put in place (applyPlan: each file renamed in,
  the one it replaces kept aside as a hard link, folders made, what a folder
  no longer has moved aside, seeds and kept entries left), and the
  .claude.json subset saved last with secrets.SaveLogins, which holds the
  login's lock. A failure after the first change puts every agent's store
  and the login back; an undo that fails too says so
  (agent_save_undo_failed) and keeps the staging folder.
- applyStages (and stageSet) is what both commands apply through;
  importStage is now storeStage, pruneIn takes an fs.FS, and pruneFolder
  moves a folder's leftovers aside. pruneStore and applySettings go.
- A file in the VM where the store has a folder, or the other way round,
  fails the save before anything changes (agent_save_store_folder,
  agent_save_store_file; sameKind), where the stage would have replaced it without the diff
  showing; storeFiles reads such a path as empty.

Contexts:
- platform.LockDir flocks a folder, polling until ctx ends as LockFile
  does (waitLock is their shared loop); agentlogin's lockLogin is it, so
  the lock is the one an older devvm's proxy takes. LockLogin, LockFolder,
  File.CaptureRequest, Capture, SetKey, Remove and
  secrets.Store.CaptureRequest take a ctx. A capture whose reply the
  endpoint has given is saved with agentlogin.AfterReply's context, the
  exchange's without its end and bounded by two minutes of its own, so the
  exchange's deadline never loses a rotated login while a refresh or a save
  holds the lock, and a stalled holder never holds it for ever
  (File.Capture, secrets.Store.Capture, its loginsDir included).
- safefile.Walk takes a ctx and stops before each folder and batch once it
  ends; readSettings, followLinks and follower.copy pass theirs.
- LockFolder's comment said its lock was another than a login file's in
  the same folder; it's the same (.claude.json's), and says so.

Links while a state can't be read:
- homeHops exempted every link on the way to the home folder, on the
  claim that no project folder can hold one, which --unsafe-folder breaks.
  rootOnly exempts a link only when every folder above it, up to /, is
  root's, has no group or other write bit and the system says you can't
  write it (platform.Writable, access(2), which counts ACLs and FUSE), and
  devvm doesn't run as root.

The structure test lets internal/agentlogin import internal/platform and
counts platform.LockDir in its status-lines rule.

Tests that fail without their fix: TestAgentSaveApplyFailsWhole (a rename
and the login failing), TestAgentSaveUndoFails, TestAgentSaveLoginLock
(waits under agent_login_waiting; Ctrl-C leaves the stores as they were),
TestAgentSaveKindChanged, TestAgentImportHomeBelowALink,
TestCaptureOutlivesItsDeadline, TestClaudeCaptureOutlivesItsDeadline,
TestWalkCancelled, TestLockLogin (synctest:
a deadline and a cancel). New: TestLockDir (synctest, and a plain flock's
lock), TestRootOnly, TestWritable, the status-lines rule's LockDir case.
TestStoreOpsRefuseLinks checks openStoreDir in pruneStore's place.

Docs: internals/agents.md (saving, the staging folder, links to the home
folder), using/coding-agents.md, Contributing's CLI and structure pages;
CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 16:49:51 -07:00
w3cjandClaude Opus 5.5 cb7177b32c feat(ui): waits for another devvm's lock show a status line; a project folder devvm can't read says so
Lock waits:
- platform.LockFile and LockFileShared take a platform.Waiting, called
  once they find the lock held, never when it's free, whose end they call
  once the wait ends; LockFileWaiting, LockFileSharedWaiting and their
  delays (ShareNote, OCINote, WaitNote, groupsNote, makingNote) go.
- msg.Waiting makes one from a Reporter's Status and a label;
  msg.WithStatus and msg.StatusOf carry the run's Status in its context
  for the two packages that take no Reporter, internal/state and
  internal/trust, which cli's execute sets; forbidigo keeps StatusOf to
  them, and AGENTS.md says so.
- Every lock that waits shows its own label: vm_state_waiting (a VM's
  state, its deletion), claims_waiting, layout_waiting, git_lock_waiting,
  ca_waiting, packages_waiting, rebuilds_waiting, ubuntu_pin_waiting,
  custom_secrets_waiting, forwarder_waiting, agent_store_waiting, and the
  waits that printed a line after a delay, which now show theirs as a
  status line: share_waiting, oci_waiting, image_build_waiting,
  group_waiting, making_waiting.
- An agent's login file's lock (agentlogin's lockLogin, a folder's flock
  that a VM's proxy holds while it refreshes the login) tries first
  without waiting and shows agentlogin.File's Waiting
  (agent_login_waiting) while it waits; secrets fills it from its
  Reporter, for SaveLogins, Claude Code's logins folder and every File.
- The structure test's status-lines rule counts a LockFile or
  LockFileShared whose waiting is nil as slow work; the build port's
  record, a file just made that never waits, is listed in statusSites.
- Without a terminal, or with -v, a status line draws nothing, so the
  waits that printed an info line after a delay no longer print it there;
  the CHANGELOG and the troubleshooting page say so. from.txtar's check
  that a free conversion lock printed no wait goes, as TestLockOCI checks
  it.

The layout's migration runs under a status line (layout_migrating),
only when there are migrations to run.

Backend calls outside a launch: TestCommandStatusLines runs devvm ls,
ports, size, network, tools, git-protect, history export, stop and rm on
a running and a stopped VM and fails on a backend call with no status
line showing, with a control that each makes one.

A project folder devvm can't open and read (vm_folder_unreadable) was
taken for another folder's VM (vm_other_folder, which offers rm and
adopt, and adopt went on); the finder now keeps why (target.unread), and
every command on the folder's VM, from the folder or a subfolder of it,
names the folder and why; devvm rm VM run elsewhere goes by the VM's
name as before.

platform.UniqueFolderID had no caller but its test: FolderStat.Unique,
from the open folder, replaced it; it goes, and its test checks
StatFolder's Unique instead.

Tests: TestLockFileWaiting (rewritten: called only when held, its end
once got or given up, shared too), TestVMLockWaits, TestCheckLayoutWaits,
TestCheckLayout (migrations under layout_migrating, nothing shown
otherwise), TestLockGroups, TestLockShare, TestMaking, TestLockOCI and
the build lock's test (status lines, not info lines), TestLockLogin,
TestInitCACancelled (ca_waiting), the status-lines rule's lock cases,
TestCommandStatusLines, TestUnreadableFolder (a subfolder of it too),
TestStatFolderUnique.

Docs: Contributing's CLI page (Status lines) and structure page, the cli
and codebase-standards skills (the guards), AGENTS.md's Go conventions,
internals/images.md and design.md (the waits), using/troubleshooting.md,
using/vms.md (a folder devvm can't read); CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 15:10:22 -07:00
w3cjandClaude Opus 5.5 b04a1a9f12 fix(vm): agent import walks within its bounds, takes turns at the store, applies all or nothing, and refuses links while a state can't be read
The bounded walk:
- fs.WalkDir read each folder whole before the import's entry bound
  applied, so a VM whose project folder is in an agent's folder could make
  the walk hold millions of entries. safefile.Walk walks as fs.WalkDir
  does (order, SkipDir, SkipAll, errors) but reads each folder 256
  entries at a time, counting every entry it reads against a
  safefile.Bound, and stops with ErrTooMany before fn sees the folder;
  it also stops at a folder more than 128 deep or a path past 4,096
  bytes, so a deep chain can't make the walk quadratic.
- readSettings walks the agent's folder through the folder opened one
  folder at a time (h.safe), whose FS now opens folders to list them
  (rootFS.openDir: no follow, no blocking, the folder Lstat saw or
  ErrSwapped), so a link or a FIFO swapped in for a folder fails the
  walk. follower.copy walks each link's target the same way; the walks
  of all links read at most linkMaxWalked (80,000) entries in all, those
  left out for the bounds included.
- The structure test's status-lines rule counts safefile.Walk as a walk.

The store's lock:
- paths.Dirs.AgentStoreLock (agents.lock in the data folder), held by
  lockStore, under a status line (agent_store_waiting) while it waits:
  devvm agent import from its staging to its logins, devvm agent save's
  writes, and a start's clean of a seed's folder (cleanSeeds, now with
  ctx), which takes it only once it finds something to take out and
  looks again under it.
- devvm agent save plans again under the lock and saves nothing when the
  store changed since it showed the diff (agent_save_store_changed),
  rather than write over an import.

All or nothing:
- After staging, apply moves aside what it replaces or prunes into the
  staging folder's replaced folder (a file kept as a hard link, so it's
  still replaced in one rename), notes the folders it makes, and keeps
  each change's undo. The logins are saved all or none
  (secrets.SaveLogins, which reads each file it replaces first, puts them
  back on a failure, and holds each login's lock, agentlogin.LockLogin,
  as the proxy does while it refreshes one).
- A failure after the first change undoes every agent's changes, going on
  past an undo that fails; each store it couldn't put back keeps its
  staging folder, named with it (agent_import_undo_failed).
- An interrupted run's cleanup waits on the stage's mutex for an apply
  that started, and an apply after the cleanup took the staging folder
  out puts nothing in place.

Links through states devvm can't read:
- While any VM's state can't be read, the import leaves out every link
  out of an agent's folder and an agent's folder or login whose path
  leads through a link, but the links on the way to the home folder
  itself, naming the state (agent_import_link_unread_state), where before
  it followed them with only a warning (projectFolders.chosen, with
  throughVM's check).

Tests that fail without their fix: TestWalkBound (fs.WalkDir as the
control), TestWalkDepth, TestWalkAsWalkDir, TestWalkErrors,
TestRootFSOpenSwapped (a FIFO), TestAgentStoreLock (import, save, a
seed's clean), TestAgentSaveStoreChanged, TestAgentImportApplyFailsWhole
(a rename and a login failing, files and folders swapping kinds),
TestAgentImportUndoFails (two agents, the second's undo failing),
TestAgentImportInterruptedApply, TestSaveLogins, TestAgentImportLinksUnreadState
(a link out, a linked folder and its login, a login behind a link),
TestAgentImportLinkWalked. TestRootFS and TestCleanSeeds* follow the new
FS and ctx.

paths.Dirs is allowed 63 methods (largeTypes), for agents.lock.

Docs: using/coding-agents.md, internals/agents.md, using/space.md,
internals/overview.md, Contributing's structure page and the owners doc,
the codebase-standards guard for bounds; CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 14:56:20 -07:00
w3cjandClaude Opus 5.5 2b176c92b3 feat(ui): every slow step shows a status line, and messages and questions never land on it
Any work that can take noticeable time now runs under the UI's status
line: a Reporter's Status with a label message, or a LoggedCmd step.

The UI:
- status lines are a stack: a Status or LoggedCmd inside another shows
  its own line, then the outer one is drawn again, where before it
  ended the outer one for good
- a message (Info, Warn, Note, Say, data on Stdout/Stderr) clears the
  line, prints and draws it again below; an unended line holds it
- a question (Ask, Confirm, Answer, Secret), the picker and
  ui.Terminal hold it until they're done
- no status line starts once the run is interrupted, as nothing would
  clear it
- the run log's path is read without the log's lock, as the status line
  reads it under outMu

Covered, by site and label:
- finder.target: finding_vm; Lima's limactl --version: checking_backend
- bringUp's checks (seeds, instance, recordFolder, hostChecks, ssh,
  requirements) and a running VM's go-on (proxy, pins, mount check):
  checking_vm; startOnce after the agent: starting; the self-check's
  probes: checking_network; pinHostKeys: reading_host_keys
- setUpVM (sync, ssh config, links, clone seed): setting_up_vm; each
  devcontainer command: running_script; makeMachine: creating;
  buildOnce: checking_image; paste's count and rm: reading_pasted
- volumeOf's lookup (diskutil), for launch, adopt, move, ls and rm:
  looking_up_volume
- vm.ListAll (devvm ls): reading_vms; devvm doctor's checks:
  doctor_checking
- devvm agent import: agent_import_reading (walk, links, opencode),
  agent_store_saving (copy, marketplace git checks, tmutil); devvm agent
  save: agent_save_reading, agent_save_comparing, agent_store_saving
- devvm stop (from its pins check on): checking_vm; a delete, an
  orphan's teardown and Lima's DeleteImage: deleting; devvm git-protect
  and clone on/off's .git work (leftBehind, mountFolder, unmountFolder):
  git_protecting; git-protect's re-read: finding_vm
- devvm clone add: clone_reading, clone_adding; clone fetch:
  clone_fetching; planClone: clone_planning; the clone check before rm
  or a remake: clone_checking; history export and import:
  history_exporting, history_importing; a remake's home: saving_home,
  restoring_home
- devvm upgrade's install: upgrade_installing; the shared tools' step
  back and .NET's downloads: resolving_tools; gc's caches: reading_space;
  the retention settings (daily and in gc): retaining

Work that takes the terminal stays off: the shell, ssh-add's
passphrase (checkAgent, Agent.Ensure, reloadAgent) and an agent's login.

Tests and guard:
- msg.Fake: OnStatus and Showing; its LoggedCmd shows its step
- backendtest.Fake: OnCall
- TestLaunchStatusLines: every backend call of a new, running and
  stopped VM's launch runs under a status line but the shell's and
  Running's (pid files)
- TestSSHAddOffStatusLine: ssh-add, on the user's agent or devvm's, never
  runs under one; chflagsCalls fails a .git lock or unlock with none
- the structure test's status-lines rule (statusSites, statusFree)
- TestStatusLinesNest, TestMessagesClearTheStatusLine,
  TestQuestionsHoldTheStatusLine, TestSecretAndPickerHoldTheStatusLine,
  TestTerminalHoldsTheStatusLine, TestNoStatusLineOnceInterrupted,
  TestFakeStatus, TestAgentImportStatus, TestAgentSaveStatus,
  TestDoctorReport, TestProblems, TestList, TestListLooksUpVolumesOnce,
  TestVolumeOfCache, TestWithSDKDownloads, TestRetainStatus,
  TestSetCloneOn, TestTeardownLeavesNothing

The rule is written in the cli skill (rule 14, checklist, review), the
codebase-standards skill (Show what devvm waits for, its checklist line
and rules.md's row), Contributing's CLI page (Status lines), its tests
and structure pages, and the troubleshooting page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 11:13:13 -07:00
w3cjandClaude Opus 5.5 3101c85260 fix(vm): a failed agent import leaves the store as it was; the import's bounds count every entry and cap a file; a login's terminal is put back
devvm agent import wrote each settings file into the store as it read
it, so a file that failed to read partway (changed since it was listed,
or past the bounds) left the store half replaced. The import now reads
and writes every agent's settings into a staging folder of the agent's
store first (.devvm-import-<random>, beside the agent's folder, so no
VM mounts it), and only once all of them are staged, and the run isn't
interrupted, moves each file into place, prunes what the home folder no
longer has and then saves the logins. A failure or an interrupt while
staging leaves the store as it was: the staging folder goes, through
discard, or through a cleanup for an interrupted run, which reaches it
by a root of its own. A failure after that (a rename, a login) can
still leave the store partly replaced, which internals/agents.md says.
A killed import's leftover staging folder counts as nothing of the
agent's (inStore), so it never makes the import ask, and the next
import of that agent takes it out first (sweepStages).

The import's bounds on an agent's own folder now match devvm agent
save's: the walk counts every entry it meets, links, sockets and FIFOs
included, not only the folders and files it keeps, and a file of more
than 16 MiB, as listed or as read, fails the import as the 128 MiB
does. Claude Code's plugin records are copied with the store's longer
paths, and what the copy grows counts against the same bounds
(hostAgent.grew), naming the folder, or the link a file came through,
so the store never gets more than the import checked. The two handles
on an agent's folder, the os.Root it lists through and the folder
opened one folder at a time that it reads through, are checked to be
one folder (sameFolder), failing the import otherwise. A VM state the
import can't read is a warning (agent_import_states_unread), naming the
file, rather than silently dropping that VM from the project-inside
warnings and the link checks; the follower takes the VMs the import
read at its start instead of reading them again.

state.WriteFileIn and writeFileMode share one tail (finishTemp).
clearKind takes the root the import opened once, rather than opening
the store for every path, and pruneStore's walk is pruneIn, which the
import calls on the same root.

Cursor's changing verbs (proxy's cursorChanges), checked again against
the 1,463 methods of DashboardService, AutomationsService and
BackgroundComposerService in 2026.11.17-f532c45, read and not run.
generate goes: it matched only GenerateGrokCollectionDescription, which
only returns a draft, and GenerateTeamGrokBotScimIdpSigningKey, which
cursorCredential refuses anyway; no other method changes between
refused and passed. test stays, justified in its comment: it matches
TestAutomationFilter, a dry run that only reads, but also
TestTeamCustomerTelemetryDestinationConnection, which has Cursor's
servers send a request with any headers to any address. park, hand,
decline, replace and resend match only methods that cursorCredential
refuses too (as rotate, link and invite do), and stay, justified in
the comment, for the methods Cursor adds. Every cursorRoutes path the
CLI's login goes to is checked against the proxy by agentlogin's
TestCursorCapture (proxy can't import agentlogin, which imports it);
TestCursorChangingVerbs now says so.

devvm agent login on a terminal saves the terminal's state before the
login (ui.Terminal, through vm.Env.Terminal, which now returns a
restore) and puts it back once the login and endLogin are done, or in
a UI cleanup if the run ends first, so an ssh that a signal killed in
raw mode doesn't leave the host terminal raw.

Tests that fail without their fix: TestAgentImportFailsWhole (a failed
import leaves the store's own files and no staging folder),
TestAgentImportTooMuch (rewritten: its dead want field gone; exactly
20,000 entries and 128 MiB list whole, one more entry or byte fails, a
link and a FIFO count, a file of 16 MiB and a byte fails),
TestAgentImportPluginsGrow, TestSameFolder (the helper, and the import
with its folder swapped between the two opens),
TestAgentImportStageLeftover, TestAgentImportInterrupted (the ctx check
before apply, and the interrupt cleanup on its own),
TestAgentImportProjectInside (beside a
broken state), TestCursorChangingVerbs (GenerateGrokCollectionDescription
passes), TestAgentLoginTerminal (put back once, after the login ended,
interrupted included), TestTerminalRestores. Tests that pin what
already held: TestNarrowNotesBesideBroken (devvm network's -g
allowlists beside a VM state that can't be read), TestWriteFileIn (a
failed rename leaves no temporary file), and TestCursorChangingVerbs'
TestTeamCustomerTelemetryDestinationConnection.

The finder now checks fst with found, so nilaway no longer reports
fst's flow, and all of fst's lines in its baseline go.

Docs: using/coding-agents.md, internals/agents.md,
internals/network.md; CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 10:02:01 -07:00
w3cjandClaude Opus 5.5 da872a6550 fix(vm): a renumbered folder's volume is checked until it's read; folder identity is read once
When a boot numbered a project folder's disk anew and its volume couldn't
be read at that launch (diskutil failing or slow), recordFolder recorded
the new device with the old volume, and from then on the identity
matched byte for byte, so no launch compared the volume again: a copy of
the disk with a volume ID of its own, mounted at the folder's path
later, would have kept the VM. It now records the folder unchecked
(state.VM.SetFolderUnchecked, vm.json's folder_unchecked), so each
launch looks the volume up again; Env.keepsVolume compares it while the
record is unchecked, as for a renumbered one, refusing another volume
(vm_other_folder), and the first lookup that finds the recorded volume
clears the mark (folderRecord). A move matches an unchecked record only
on its volume (here.same), and a move whose lookup fails keeps the
recorded volume, bound to the inode and birth time a move keeps,
unchecked (recordMove). On Linux, where the volume is read in the
process (volumeFree), every launch compares it, so a Btrfs snapshot or
a ZFS clone mounted at the folder's path is another folder even on the
original's device; after a volume's UUID changes, devvm adopt gives the
folder its VM again.

The finder's sameFolder and madeFor share one body (madeForOpen), and
the folder is opened once: platform.SameOpenFolder is SameFolder for a
folder StatFolder already read, platform.RecordedAs is its exact match,
and keepsVolume, recordFolder and here.same take that read rather than
open the folder again (here's id and unique are its stat's). madeFor,
which the checks that ask which VM mounts a folder use, falls back to
the folder's stat when it can't be opened, as when code in a VM that
mounts it took away its read permission, so no VM hides from
clone_repo_mounted or project_in_vm_folder that way. recordFolder
compares again under the state's lock with the same folderRecord.

The structure test's folder-ids rule now finds a map literal keyed by a
folder's identity whose type is a named map type of the module's, a
generic one included, or elided in a map's or a slice's literal whose
elements are maps.

Docs: a Btrfs rollback at the folder's path, or a volume's new UUID,
needs devvm adopt; a Mac volume that ignores ownership makes every
folder yours to the offer's check; the unchecked mark and Linux's check
at every launch (internals, overview's vm.json fields).

Tests: TestUncheckedOnAnotherVolume, TestKeepsVolume, TestRecordFolder
(unchecked, then checked), TestRecordFolderUnderLock,
TestRecordMoveVolume, TestMovedFrom (unchecked), TestMountedByUnreadableParent,
TestSameFolder (SameOpenFolder, RecordedAs), folder-ids' named, generic
and elided map cases, and fixture_v010_renumbered's unchecked steps on
0.1.0's state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 09:37:13 -07:00
w3cjandClaude Opus 5.5 c41ca82f6e fix(project): devvm's own folders are compared by identity; a launch warns of a project in an agent's folder
project.Unsafe's Holds and Inside compared a project folder with the home
folder and devvm's config, data and Lima folders by name alone
(paths.Within, paths.Below), so on a volume that ignores case, as a
Mac's does by default, a project at ~/.Config/devvm/layers passed both
and its VM got devvm's settings and layer scripts read-write. They now
compare by identity too: paths.In, the vm package's isIn moved to its
owner, finds the path or a folder above it to be the same folder as the
other, by device and inode, and paths.Under is In for the path's
folder. An empty folder holds nothing, so an unset one can't match the
working folder. sshagent's mountedBy, which refuses a key in a folder a
VM mounts, compared by name in the same way and uses paths.In now.

Each launch (Launch.Up, beside warnMounted) warns once, in one line,
when the project folder it mounts is inside an agent's folder in the
home folder or holds one (project_agent_folder), naming every such
folder from the agents' registry, with agent_import_project_inside's
detection (overlapsAgent). A --clone VM mounts nothing and gets no
warning.

Tests: TestUnsafeIgnoresCase, TestInAndUnder, TestMountedKeyIgnoresCase,
TestWarnAgentFolders; the case checks skip on a volume that tells
names apart by case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 09:05:20 -07:00
w3cjandClaude Opus 5.5 bb0df957a0 fix(doctor): a broken VM state hides no other VM's warnings; Cursor's account services refuse more changing verbs
doctor's policy warnings (netpolicy.NotRules) listed the VMs with
state.VMNames, which fails whole for one state it can't read, so one
broken vm.json made doctor skip every VM's policy warnings. So did
devvm network's warnings about every VM (allowlists for -g, and
OtherBinaries). They now use state.ReadableVMs, the VMs whose state
reads, which leaves the broken one out and the rest in; VMNames stays
strict for what must count every VM, such as ports. A VM folder doctor
can't read got two warnings, vms_unreadable from state.VMFolderProblems
and vm_state_broken from vm.StateProblems; VMFolderProblems now leaves
it to the latter, which names the VM and why.

cursorChanges, the verbs refused in Cursor's DashboardService,
AutomationsService and BackgroundComposerService, gains merge, fork,
write, pin, unpin, rerun, confirm, request, release, acquire, activate,
deactivate, notify, make, open, ensure, park, copy, bulk, advance,
abort, wake, snapshot, seed, reply, opt, hand, fail, use, skip, decide,
unshare, undelete, unpublish, unprepare, unresolve, enroll, unenroll,
upgrade, suspend, switch, duplicate, dismiss, deregister, deliver,
decline, convert, close, append, execute, provision, mutate, inject,
finish, finalize, reassign, reinstall, reject, renew, reorder, reparent,
replace, resend, rmdir, report and record. Each was checked against all
1,463 methods of those services in 2026.11.17-f532c45, read and not
run: every one of the 102 methods they match changes something, none
only reads, and the CLI calls none (Submit, Resolve, Check, Batch and
the like stay off, as their methods read or the CLI calls them).

fixture_v010_logs' capped.sh loop and network.txtar's sleeps around the
squatting proxy now wait with wait_until.

Tests: TestNotRules and TestOtherBinaries (beside a state that can't be
read), TestVMFolderProblems, doctor.txtar (an unreadable VM folder, one
warning), TestCursorChangingVerbs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 07:45:34 -07:00
w3cjandClaude Opus 5.5 c901b920ef fix(agents): the agent store is written only through roots, an import is bounded, and projects overlapping agents' folders get a warning
devvm agent import and save checked each path they wrote in the store by
path (storeGuard), then wrote by path (os.MkdirAll, state.WriteFileMode),
so a link swapped into the store between the check and the write could
lead the write elsewhere. They still check every path first, so a link
fails the command, naming it, before the store changes; they now write
only through the agent's folder in the store opened from devvm's config
folder as a root (makeStoreDir, which makes it and the folders on its
way through the config folder as a root, then openStoreDir), with
state.WriteFileIn, a whole-file write through an os.Root.

An import copied whatever an agent's folder held, one file at most
128 MiB, so a VM whose project folder is inside an agent's folder could
fill the store that every VM with the agent mounts. Each agent's folder
now gets agent save's bounds in all, 20,000 files and folders and
128 MiB: the walk stops at 20,000 (errFolderTooMany), the sizes as
listed are counted (hostAgent.tooMuch), and a folder over either fails
the import before anything is written, naming the folder and what to do
(agent_import_too_much); the files' reads share the 128 MiB (h.read),
so files that grew since the listing fail too.

Before it reads anything, the import warns of each VM whose project
folder is inside an agent's folder or holds it
(agent_import_project_inside). A project folder that holds an agent's
folder, such as ~/.pi for pi's ~/.pi/agent, let its VM put a link in the
agent folder's place, which the import followed, copying whatever it
led to, such as the home folder's files, into the store: the import now
resolves the folder's path one link at a time (linkHops), leaves it out
with agent_import_link_via_vm when a link in a VM's project folder leads
it out of that folder (throughVM, shared with the link follower), its
login with it (pi's auth.json), and reads the folder where the path led.
Every agent's login file but Claude Code's ~/.claude.json, which was
already a capped, regular-file read, was os.ReadFile by path, so a VM
whose project folder held it could swap in a link to another file, a
FIFO or an endless file between the check and the read: its path is now
resolved once (linkHops), left out when a link in a VM's project folder
leads it out of that folder (throughVM), and read where it led, through
its folder opened with no link and never resolved again (openPhysical),
opened without following one, a regular file of at most 128 MiB
(claudeHostLogin), so a folder swapped for a link since fails the read.

Tests: TestWriteFileIn, TestAgentImportTooMuch, TestAgentImportReadBudget,
TestAgentImportProjectInside, TestAgentImportProjectHolds (a folder and a
login led elsewhere), TestAgentImportLoginNoFollow,
TestStoreOpsRefuseLinks (makeStoreDir).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 07:36:19 -07:00
w3cjandClaude Opus 5.5 4ccdbf8125 fix(vm): folder identity's last checks: a renumbered folder keeps its volume
From the volume UUID commit's security review. A folder at its own
recorded path on a disk numbered anew (platform.SameFolder's renumbered
case) must now also be on the volume its state records, when both are
known (platform.KeepsVolume): the finder checks it (finder.sameFolder,
Env.keepsVolume, so a launch refuses with vm_other_folder) and so does
recordFolder under the state's lock, so a copy of the disk with a volume
ID of its own mounted at the folder's path is another folder. A volume
that can't be told leaves the device's rule, as for a state that
records none. mountedBy and mountsRepo keep the check without volumes
(madeFor), which errs towards warning.

hereOf reads the folder's identity, uniqueness, owner and volume from
one open folder (platform.StatFolder, now with Owner), so the folder
checked as the user's is the one matched and recorded. StatFolder is
one function for macOS and Linux (folderstat_unix.go) over each
system's openFolder, which SameFolder's renumbered case uses too, in
place of openFolderID and darwin's copy.

devvm ls and devvm space look volumes up through the run's Env
(Env.FolderOf, Inventory.List(ctx, e)), each mount once a run, in
place of diskutil for each VM; FolderOf, parentVolume and movedAway go.
FolderDevice is unexported (folderDevice), so only platform reads a
device; OnRecordedDisk takes a record without a device as on any disk.

The folder-ids rule tracks names assigned from such names, however
many steps on, and maps keyed by an identity, indexed or in a map's
literal, without counting a struct literal's field; its loop is
sitesWhereIn, shared with sitesWhere. The hdiutil e2e check makes sure
macOS gave the disk a new number, attaching up to three images first,
and is skipped when it never does. The design notes say who can forge
a volume ID and what it gets them.

Tests: TestKeepsVolume, OnRecordedDisk without a device,
TestRenumberedOnAnotherVolume (a launch and recordFolder),
TestListLooksUpVolumesOnce, StatFolder's Owner on both systems, the
folder-ids rule's new cases, and fixture_v010_renumbered.txtar (another
volume at its own path refused with nothing recorded; ls calls the
moved folder gone by its recorded volume, where it said not_connected).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 07:15:53 -07:00
w3cjandClaude Opus 5.5 ba510eec1f feat(vm): a folder moved across a restart keeps its VM, by its volume
A project folder's identity was its device, inode and birth time, and
since #60 a folder at its recorded path matched on another device. A
folder that moved while a restart gave its disk another device number
matched nothing, so plain devvm made it a second VM, and folderOf took a
renumbered disk for an unmounted one ("not connected"), so movedAway was
false too.

Each VM's state now records the folder's volume, which no renumbering
changes, as folder_volume, "<kind>:<value>:<ino>:<btime>", bound to the
folder it was read with (platform.VolumeOf, RecordedVolume): macOS's
volume UUID from diskutil (platform.VolumeUUID, only for the mount point
and device read from the folder opened with no link, its answer checked
against both), Linux's f_fsid on ext4, Btrfs and ZFS (StatFolder, read
from the open folder); none on a read-only volume or a snapshot, or
elsewhere. state.VM's folder is unexported: Folder(), FolderVolume() and
SetFolder(id, vol), the one writer, which creation, adopt, a move and
recordFolder (renumbered's successor, at each launch) use; a launch
records the volume of a VM made before, once it can (1 s at a launch,
5 s at an adopt or a move, one failure a run stops the rest, through
Env.Volumes and its run's cache).

moveHere matches a moved folder by its volume, inode and birth time
(platform.MayHaveMoved, MovedFolder), looking the volume up only once
the rest matches, with the identity it matched and records both read
from the folder opened with no link (hereOf), and folderOf compares the parent's volume where the
state records one (platform.OnRecordedDisk), through Env.folderState for
a move or an rm. The folder-ids rule now also reads Folder() and
FolderVolume() calls, FolderDevice, locals assigned from any of them,
switches and strings/slices comparisons.

An older devvm keeps folder_volume as it is (checked with 0.1.0's own
reader in a temp copy of its tree). A rename keeps the inode, so the
binding stays right; when an older devvm adopts another folder for the
VM, or a move across volumes copies it, the binding names another inode,
so the record names no volume and is recorded again. DEVVM_VOLUME stands
in for diskutil, and for Linux's f_fsid, in test builds (VolumesOnly).

Tests: TestFolderOf (not connected after a renumbering), TestMovedFrom
(moved and renumbered, and a split between the read that matched and
the one recorded), TestRecordFolder (made, a VM made before at its next
launch, a failed lookup, a renumbering keeping the bound volume),
TestVolumeOfCache, TestVolumeOf, TestMovedFolderAndRecordedDisk,
TestStatFolder(AndVolumeUUID), TestPlistStrings, the folder-ids rule's
new cases, fixture_v010_renumbered.txtar (0.1.0's VM records its volume,
then moved and renumbered it's offered, never a second VM), and e2e's
projectRenumbered (hdiutil, macOS) and the project section's volume
check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 01:59:06 -07:00
w3cjandClaude Opus 5.5 ecd266c7d3 test(cli): one wait for the scripts; the docs release job installs only what it builds with
The scripts waited with copies of the same loop: desktop.txtar's and
nix_cache.txtar's waitfor files, and sh -c loops in link_life,
fixture_v010_links, fixture_v010_small, ports and ports_stopped, each
with its own interval and limit. They now use one testscript command,
wait_until SCRIPT, which runs sh -c SCRIPT every 100 ms until it
succeeds, for up to 90 s, and fails at once when every background
command has ended, as wait_file does, or when SCRIPT exits 100
(waitGiveUp, a status no tool the scripts run gives), as the links
check does when its session has ended. Contributing's tests page names
it beside wait_file, whose limit it now says is 60 s.

The docs workflow's release job installed every tool in the tag's
mise.toml. It now installs only Go, Hugo by the name the tag gives it
(hugo-extended before Hugo 0.170) and Node when the tag draws its
diagrams, with --locked as mise-action did, picking them with mise's
own reading of the tag's mise.toml (mise ls --current --json, the tag's
file alone), and fails when the tag names no Hugo. MISE_AUTO_INSTALL is
off for the job, so mise run docs:diagrams and the shims install
nothing more, and a tool the pick missed fails the build. This job runs
only at a release, so it hasn't run yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 23:07:04 -07:00
w3cjandClaude Opus 5.5 5924a373f0 feat(doctor): devvm doctor checks every VM's state
doctor read no VM's state, so a vm.json that devvm can't read, or one
with a section its package can't read, showed only when a command on
that VM failed. doctor now reads every VM's state (ReadStates) and runs
the check every command makes of the VM it finds for a folder on it
(checkState, every section's reader), and warns of each VM it can't
read, naming it, or its folder when the file can't be read, and why,
which names the file (vm_state_broken). It only reads, and --json lists
the warnings with the rest.

The task also named "the files vm.json names that devvm reads at
launch". None in a VM's folder stops a launch from older state: its
own policy file is read by the proxy, which keeps its last rules, and
doctor already checks its lines; home.tar.gz is read only while a
remake hasn't finished; run/ is written again at each start. So only
vm.json and its sections are checked. A value that reads but that a
launch refuses, such as a size that isn't a number, isn't checked, and
the docs say so.

Tests: doctor.txtar (a vm.json that isn't JSON, a section that doesn't
read, and one that's fine), fixture_v010.txtar (every 0.1.0 VM reads,
and no file changes), fixture_v010_housekeeping.txtar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 23:07:04 -07:00
w3cjandClaude Opus 5.5 c9d0fdb270 feat(agents): warn about credentials in copied marketplaces
A Claude Code marketplace is a git clone that devvm agent import and save
copy whole into the store's plugins folder, which every VM with Claude
Code mounts, so a private marketplace's credential in its git config
reached every VM without a word. Both commands now check what they copy
and warn, naming the marketplace, the store's file and the keys, never
the credential (a URL subsection with one shows as <url>)
(marketplace_secret):

- each git config below a clone's .git (a submodule's included), read by
  git itself (listConfigFile, beside the clone seed's listConfig), and
  the files it includes from inside the clone: an http.extraHeader, and
  a URL with a credential in a remote's or submodule's URL, a push URL,
  a proxy or an insteadOf's base, judged as the clone seed judges a
  remote (cleanURL: changed or refused while it has an @);
- known_marketplaces.json's source URLs.

A config git can't read is named as unchecked (marketplace_unchecked),
as the VM reads the file whatever git makes of it. The copy is made as
before, as CJ chose.

Test: TestMarketplaceSecrets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 23:07:04 -07:00
w3cjandClaude Opus 5.5 872c2e23c0 fix(proxy): Cursor's account services refuse more changing verbs and the cloud agents' endpoints; bridge mode stays off
cursorChanges, which refuses a method of DashboardService,
AutomationsService or BackgroundComposerService whose name starts with a
verb that changes something, now has clone, commit, generate, mute,
unmute, reindex and retry. Each was checked against all of those
services' methods in the 2026.11.17-f532c45 package (1110, 57 and 296),
read and not run. Twelve match: RetryAutomationRun,
CommitBackgroundComposer, MuteBackgroundComposers,
UnmuteBackgroundComposers, CloneGrokCollection,
CommitOrganizationNetworkBlocklistUpload,
GenerateGrokCollectionDescription, GenerateTeamGrokBotScimIdpSigningKey,
ReindexAndApplyTeamMarketplaceChanges, ReindexGrokCollectionDocument,
RetrySandMessagesPermission and RetryTeamXaiMembershipHold, and the CLI
calls none of them. cursorMints also refuses every path below
/cloud-agent/, on every Cursor host. The docs say the verbs are defence in
depth, as the bindings put the login only into the CLI's own methods, and
name changing methods they miss.

Bridge mode (api2direct.cursor.sh) isn't added to the allowlist: it is
cursor-agent worker, a self-hosted Cloud Agent worker that mints identity
tokens at /cloud-agent/identity-token/worker, runs cloud agents' work
started elsewhere, mounts the agent store, and sends Host: api2.cursor.sh
through a tunnel to api2direct, which has no bindings, so the login never
goes in. The coding-agents page says it doesn't work in a VM; the
decision is CJ's.

Test: TestCursorMints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 23:07:04 -07:00
w3cjandClaude Opus 5.5 aed6424c09 fix(proxy): a stale proxy.confined no longer hides proxy_old
run/proxy.confined said how the child was confined, but not which broker
said it. After a downgrade, an older devvm starts the VM's proxy as one
process and never writes the file, so the newer devvm's file stayed and
devvm doctor took the older devvm's unconfined proxy for a confined one.

The broker now writes a second line naming itself, its pid and its start
as the system tells it (proxy.BrokerID, through IO.Started), and
ReadConfined takes the file only when it names the running broker, which
doctor finds by the pid file and platform.ProcessStart (kern.proc.pid's
p_starttime on macOS, /proc's starttime on Linux). A file that names
another broker, or none, is one that hasn't said, so another binary's
proxy gets proxy_old, and when doctor can't read the running broker's
start it says it can't tell (proxy_confinement_unknown). The e2e broker
check reads the file's first line and checks the second names
run/proxy.pid's broker.

Tests: TestUnconfinedStaleMarker, TestReadConfined, TestProcessStart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 23:07:04 -07:00
w3cjandClaude Opus 5.5 d939d1d870 fix(agents): agent import and save never write through a linked store, nor copy a link to what they leave out
devvm agent import copied a link inside an agent's folder as the file it
led to wherever that was in the folder, so a link in ~/.claude/skills or
~/.claude/plugins/cache could put the history, .credentials.json or a
plugin's data into the store. Such a link is now copied only when its
target is one of the agent's settings (listedPath, MachineOwn included),
and any other is left out, naming where it leads
(agent_import_link_not_setting). Each file the import listed is read
through the agent's folder opened one folder at a time without
following a link (readListed), and must be the file it listed, so a VM
whose project folder is in the agent's folder can't swap a link or a
folder between the listing and the read; a file it can't read so is a
message (agent_import_read_failed), as is one whose details can't be read
while listing, which was dropped without a word. One file is read up to
128 MiB.

pruneStore and clearKind opened the store by path, so a store that was a
link (to ~, say) let import and save delete the files of the folder it led
to. They now open it from devvm's config folder, refusing a link on the
path (openStoreDir, sharing one walk, walkStore, with cleanSeed and the
guard), and import and save check every path they'll write, for every
agent they handle, before the first write (storeGuard, checkStore,
checkPlan, saver.applyAll): a link fails the command, naming it, before
the store changes (agent_store_link).

Tests: TestAgentImportLinksInsideToSettingsOnly,
TestAgentImportSwappedAfterListing, TestAgentImportLinkedStore,
TestAgentImportLinkedStoreOfAnother, TestAgentSaveLinkedStore,
TestAgentSaveLinkedStoreOfAnother, TestStoreOpsRefuseLinks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 23:07:04 -07:00
w3cjandClaude Opus 5.5 01e837a164 build(deps): bump Cursor's CLI to 2026.11.17-f532c45, rechecked
scripts/bump.sh cursor: 2026.11.11-b912975 -> 2026.11.17-f532c45, the
one shared tool pinned for users, applied only when named because
devvm's login and proxy code was read against its pinned release. Then
scripts/bump.sh e2e-tools, which writes tests/e2e-mise.lock for the new
mise.toml and moves e2e's claude (2.1.326 -> 2.1.327) and opencode
(2.3.0 -> 2.3.2) patches with it.

The recheck read both releases' Linux packages (checksums checked, read,
never run) and Cursor's changelog (nothing after Nov 6):
- Package layout and entry point: the same launcher and files.
- Login: the same loginDeepControl page, GET api2's /auth/poll with
  uuid and verifier, 404 while pending, accessToken and refreshToken
  (or xAI's), selectedTeamId, NO_OPEN_BROWSER and
  /auth/exchange_user_api_key. waitForResult gained an optional wake
  argument that cursor-agent login doesn't pass.
- No refresh-token call, as before; the JWT reader still takes exp
  (300 s early) and sub, so the 2099 placeholder still serves.
- Connect: about 65 RPC definitions added, mostly DashboardService's,
  2 removed (DashboardService's pull-request draft preference), and the
  methods the bundle calls are the same, so every route agentlogin's cursorRoutes and the proxy's
  cursorMinting and cursorPersists name is still there, and no new
  method carries the login.
- Hosts, config and auth files (CURSOR_CONFIG_DIR, XDG_CONFIG_HOME,
  ~/.cursor, auth.json, cli-config.json), the updater and channel: the
  same. New environment variables don't touch updates or telemetry.
So nothing in devvm's code, tests or allowlist changes; the comments,
the policy's note and internals/network.md name the new release.

- CHANGELOG: Changed, the pin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 20:06:44 -07:00
w3cjandClaude Opus 5.5 b5f3899f1a test(vm): smaller 0.1.0 cases
fixture_v010_small.txtar runs what changed since 0.1.0 on its frozen
state, in smaller cases:

- devvm ports on 0.1.0's records of app's port forwarder (its pid and
  status, no list of what it forwarded) says nothing is held, taken,
  past the limit or refused.
- A proxy port 0.1.0 chose on one of the ports only VMs' ssh may have
  (its proxy port moved onto the sandbox's first ssh port) moves at
  app's next start, off the list, and the proxy's config listens there.
- On Linux, that start gives the guest's connections to the proxy the
  capped devvm _qemu connect, to that port, with app's own
  run/proxy.slots, where a 0.1.0 start had the two-argument form. The
  limactl stub now records the start's DEVVM_GUESTFWD
  ($STUB_DIR/start-guestfwd-<name>, empty when unset), as it records
  the start's agent, with its unit test, and the structure test's
  envSettings lists the stub as a reader of DEVVM_GUESTFWD.
- app, stopped, holds none of its listed ports: scratch lists 3000 too
  and forwards it, and app, started again, says scratch has it
  (ports_held, held_by in devvm ports --json) and that a program here
  has another port it lists (ports_taken), never the limit or a
  refusal. While it runs, devvm ports names each reason its
  forwarder's record gives (ports_taken, ports_limit, ports_refused,
  each its own port), and none for an older devvm's three-line record
  (reasons.sh judges only a run on the record as it wrote it, trying
  again when app's forwarder, waiting on scratch's port, replaced it).
- #52's leftover, a state as 0.1.0 wrote it for a folder named x--y
  before Lima refused the name (built from app's 0.1.0 state: its name
  and alias with the run of separators, the folder's path, no created
  time or start), is read as no VM and replaced by the folder's VM.
- After a boot that numbered the disks anew and a move of app's folder,
  devvm adopt VM moves app to the new path, and its launch starts it
  there.

Found, not changed: a moved folder on a renumbered device isn't taken
as the VM's folder (platform.SameFolder matches another device only at
the recorded path, as a copy keeping the inode and birth time sits
elsewhere), so devvm there, without adopt, makes a second VM for the
moved folder, saying nothing of the first, whose folder is gone; devvm
adopt VM is the way back, as the docs say.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 20:06:44 -07:00
w3cjandClaude Opus 5.5 7800be5ed5 test(vm): host keys and log caps on 0.1.0 state
fixture_v010_logs.txtar gives 0.1.0's app VM's Lima folder a serial
console's log (serialv.log) and a hostagent's error log (ha.stderr.log)
of 11 MiB each, holding the proxy's password from 0.1.0's proxy config
(which today's devvm keeps, as vm.json's proxy key) near their start
and at their end, as a boot logs it, checked there before the launch.
After a launch, each is at most 10 MiB with a .1 beside it holding the
log, and neither holds the password: the log keeper looks first in the
proxy's broker, before limactl start, so it copies 0.1.0's unredacted
log into the .1, whose redaction this checks. (Real Lima starts each
log afresh at every start, which the stub doesn't.) The launch pins
the new start's host keys in place of 0.1.0's: known_hosts' start line
is no longer 0.1.0's, a key line is pinned, and 0.1.0's key line is
gone. Nothing found to fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 19:59:14 -07:00
w3cjandClaude Opus 5.5 58c7d87fe8 test(vm): links and the resolver on 0.1.0 state
fixture_v010_links.txtar starts 0.1.0's db VM, then its app VM, which
links to db's published 5432 as db.devvm.internal at 127.77.0.1: app's
launch says nothing of a stopped target, its link session starts and
carries 127.77.0.1:5432, and run/links.json is written again from
0.1.0's link with the same hosts, address, port and target and the
sandbox's own socket, which exists. The setup app gets
(sync.tar's vm) names the confined VM's resolver,
DEVVM_RESOLVER='127.0.0.1', and the paste folder, which 0.1.0's setup
didn't have, and its hosts file names db.devvm.internal. Nothing found
to fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 19:59:14 -07:00
w3cjandClaude Opus 5.5 0fdb2ba5a2 test(vm): a 0.1.0 history export imports today
TestHistoryImportV010: devvm 0.1.0's own export script, the string its
historyExport returned, frozen in
internal/vm/testdata/v0.1.0-history-export.sh (made by running 0.1.0's
code from git archive v0.1.0), runs with real bash and GNU tar in a
home as a 0.1.0 VM had it: Claude Code's projects and todos, its
.credentials.json, settings.json and .claude.json, the store's plugins
and skills folders linked at their paths as 0.1.0 linked its mounts,
Codex's sessions, history and auth.json, opencode's storage, auth.json
and, where sqlite3 is, its database, and opencode's state. The export
holds the links and the copied settings (exportNames), the controls
for what the import leaves out, while 0.1.0's own excludes keep the
logins out of it. Today's historyImport takes it without
devvm-history-unsafe: the history arrives, opencode's database with its
session included, and the links, the copied settings and the plugins
stay out. The import's run moves to runImport, which
TestHistoryImportRuns shares, so that test stays within revive's
limit. Nothing found to fix. (It runs where GNU tar is, as the other
history tests do.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 19:59:14 -07:00
w3cjandClaude Opus 5.5 bc00ebc088 test(vm): housekeeping never deletes 0.1.0 state
fixture_v010_housekeeping.txtar runs today's housekeeping on 0.1.0's
frozen state: a launch whose daily retention is due (0.1.0's
retention.run made older than a day, and touched by the launch), then
devvm gc --force, devvm gc --orphans --tool-images --retention --force,
devvm space --json and devvm doctor. Every VM's vm.json and run folder
stays, every shared tool image a state's tools.made.files names stays
(the list read from the states before anything runs), no limactl
delete names a project VM, devvm ls, devvm space and Lima still list
all four, and nothing says unreadable or corrupt. A copy of a tool
image under a name no state has goes, the control that gc could delete
one. On Linux, 0.1.0's VMs' disks are modelled as it made them, qcow2
overlays of the image's disk (the fixture keeps no disks; the stub's
qemu-img info reads the backing file), and gc keeps 0.1.0's base image
with image_in_use; on macOS it deletes it, an older base than today's.
Nothing found to fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 19:59:14 -07:00
w3cjandClaude Opus 5.5 93322e9154 fix(vm): running 0.1.0 VMs are warned of and tested
A VM that devvm 0.1.0 started and that runs as you upgrade keeps what
0.1.0 gave it until its next start. Two of those went unsaid:

- A launch into a running VM whose start forwarded an SSH agent itself
  (an older devvm's recorded start, without made.relayed) keeps that
  agent, which can add, remove or lock keys, and now warns, naming
  devvm restart, which gives it the relay (agent_raw_old).
- devvm doctor said nothing of a running proxy without
  run/proxy.confined. One that another devvm binary started (its
  config's devvm_sha256) is an older devvm's single process without a
  sandbox, which it now names (proxy_old); one this binary started that
  hasn't written the file yet is still starting and gets none. doctor
  now passes devvm's own binary to the check.

Tests, on 0.1.0's frozen state made running in the sandbox copy
(hostagent pid file at 0.1.0's start's time from its known_hosts, run/
started, known_hosts and agent.made.started for that start, Lima
listing it running, its ssh port listened on, and 0.1.0's one-process
proxy): fixture_v010_running.txtar (doctor's proxy_old; a launch with
no stop, start or edit, ports_ssh_old, the proxy started again as
broker and child with proxy.confined, secrets.json and known_hosts
unchanged, no relayed; then stop and launch: one .ssh.localPort edit,
the new start's keys pinned) and fixture_v010_running_agent.txtar
(devvm's agent forwarded raw: kept and warned, then devvm restart gives
the relay and relayed, with only the ssh port's edit). The modelled
hostagent is a live process of the test's, not 0.1.0's pid 54798,
because a start counts as devvm's only while its hostagent runs.
TestUnconfined: a proxy that hasn't said, by this binary, another, or
an unreadable config.

- msg: agent_raw_old, proxy_old.
- Docs: ssh (agent forwarding), troubleshooting (the proxy runs without
  a sandbox), internals/install; CHANGELOG After you upgrade.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 19:59:14 -07:00
w3cjandClaude Opus 5.5 7cc0dd76ed fix(agents): a 0.1.0 store's plugin data stays out of the seed
devvm 0.1.0's agent import copied the whole of ~/.claude/plugins into
the agent store, each plugin's data and installed_plugins.json
included, and every VM with Claude Code mounts the store's plugins
folder whole as its seed, so that data kept reaching every VM until
agent import ran again. Every start (starter.bringUp) now takes out of
each seed's folder in the store the entries a seed doesn't have
(agents.MachineOwn), before the VM runs, and warns once, naming them
(agent_seed_cleaned). The folder itself stays, so no VM's mounts or
Lima config change. A running VM stops seeing them through its mount
at once on macOS; on Linux, 9p's cache can keep what it read until its
next start.

The folder is reached from devvm's config folder as a root, each part
of the path below it a folder: a link there (only a hand-made store
has one, and the VM's mount would follow it, perhaps to the user's own
~/.claude/plugins) is refused (agent_seed_link), a link among the entries is removed,
never followed, and the opened folder is checked to be the one
checked. The temporary files a concurrent agent import or save writes
known_marketplaces.json through, regular files, stay. A folder that can't be cleaned
fails the start of a VM with that agent and warns for any other
(agent_seed_clean_failed, naming what the folder should hold).

- vm: Env.cleanSeeds, cleanSeed and seedTemp (agents.go), called
  first in bringUp with the VM's agents.
- msg: agent_seed_cleaned, agent_seed_clean_failed, agent_seed_link.
- Tests: TestCleanSeeds (0.1.0-style store, a link entry, a concurrent
  import's temporary file, no store, once only), TestCleanSeedsFails
  (a link at the store, .claude or plugins, for a VM with and without
  Claude Code; an entry that can't go); fixture_v010_plugins.txtar
  (0.1.0's app with the store's plugins as 0.1.0's import left them and
  their mount: the warning, no edit but the ssh port's, the seed's link
  to a folder without data/, nothing said again; then the store's
  plugins folder a link, and an entry that can't go, each refusing
  app's start with agent_seed_link or agent_seed_clean_failed).
- Docs: coding-agents, internals/agents, the design note's threat
  check; CHANGELOG Breaking, After you upgrade (running VMs, Linux's
  cache, plugin logins) and #56's Fixed entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 19:59:14 -07:00
w3cjandClaude Opus 5.5 c9005ae4be build(deps): bump pins: mise 2026.11.10, Docker 29.10.0, Hugo 0.170.1 and e2e's pins
scripts/bump.sh's safe bumps (patches and minors; no majors or held pins):

images (assets/):
- mise 2026.11.8 -> 2026.11.10 (base's, and the host's resolving mise)
- docker 29.9.3 -> 29.10.0, compose 5.7.1 -> 5.8.0
e2e:
- claude 2.1.322 -> 2.1.326, codex 0.167.2 -> 0.169.1, opencode 2.2.7 -> 2.3.0
- pnpm 12.18.0 -> 12.21.0, uv 0.13.7 -> 0.13.9, rust 1.99.1 -> 1.100.0
- ubuntu:26.04 digest 065aa8626841 -> d66b366dac61
- Ubuntu's cloud image release-20261016 -> release-20261108
go: deadcode v0.52.0 -> v0.53.0
dev-tools: govulncheck 1.9.0 -> 1.10.0, vale 3.26.0 -> 3.27.0,
  hugo-extended 0.169.0 -> hugo 0.170.1
ci: jdx/mise-action v5.2.8 -> v5.2.10, the workflows' mise 2026.11.8 -> 2026.11.10

Hugo 0.170 has no extended edition (one binary, without LibSass, which
the site doesn't use): mise.toml's hugo-extended becomes hugo, the docs
workflow installs hugo, its release job installs the tag's own tools
(an older tag names hugo-extended), and docs/hugo.yaml drops the
deprecated hugoVersion.extended.

The e2e runner deletes its sandbox's Ubuntu pin when it names a release
other than e2eUbuntuRelease (not in a --newest-base run), as devvm keeps
a pin it has: without it, moving e2eUbuntuRelease left a cached sandbox
on the old release. pinned and ubuntuPin are e2e's one reader of the pin,
and TestHarnessRepin covers repin.

Image keys change: base and every image above it, the docker layer's
included, and the shared tools' images build again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 17:26:09 -07:00
w3cjandClaude Opus 5.5 6965efcc0a fix(vm): devvm agent login claude --setup-token shows Claude Code's address (#57)
An agent's login in the VM ran with devvm's own writers as its output,
so os/exec gave limactl shell pipes, Lima added no ssh -t, and claude
setup-token, which draws full-screen, showed nothing and waited.

When devvm's stdin and stdout are terminals and both output streams are
files, the login now gets stdout and stderr as the files they are
(ui.Terminal, set by cli as vm.Env.Terminal), so Lima gives it a
terminal in the VM, as devvm's shell has. Without a terminal it keeps
pipes, and --setup-token warns first (setup_token_no_terminal). Its
output reaches devvm's output alone, never the run log, as before. On a
terminal, Ctrl-C goes to the login in the VM, which ends, and devvm
says the login ended or saved nothing.

- internal/ui: Terminal, over Files, never a half pair; TestTerminal.
- internal/vm: Env.Terminal; AgentLogin.loginOpts; the warning; why an
  interrupted login's cleanup stays as endLogin's backstop; endLogin's
  comment for a login on a terminal; TestAgentLoginTerminal
  (fails without the fix).
- internal/backend: ExecOpts says a terminal's files pass on as they
  are; Lima's TestExecStreamsAsGiven.
- internal/cli: vmEnv sets Terminal; agent_login.txtar checks the
  warning.
- locales/en.toml, internal/msg: setup_token_no_terminal.
- tests/e2e: OnTTY, out of TTYRun; network's check that
  devvm agent login claude --setup-token on a terminal shows the
  address, waiting for its devvm to end before the next login.
- Docs: internals/network.md, using/coding-agents.md,
  contributing/extending.md and tests.md; CHANGELOG Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 15:32:47 -07:00
w3cjandClaude Opus 5.5 ea3037bc15 fix(vm): MCP servers' logins in a VM finish and survive launches (#62)
Each launch and each devvm agent login claude copied the store's VM copy
of Claude Code's OAuth login (claudeAiOauth only) over the VM's
~/.claude/.credentials.json, where Claude Code also keeps its logins to
MCP servers (mcpOAuth: their tokens and, mid-login, the PKCE verifier).
So an MCP login failed when the VM was set up again before it finished,
and a finished one was gone at the next launch.

The setup now gets the copy as claude-credentials.json (claudeSyncName),
and sync.sh's merge_claude_credentials merges it in the VM: the copy's
claudeAiOauth replaces the VM's (or takes it out when the copy has none),
every other key of the VM's file stays. It reads the VM's file with one
jq call (--slurpfile, so two JSON values or a non-object are caught) and
writes it whole, mode 600, through a mktemp file in ~/.cache, which no
history export or remake carries, then mv; a failed cat or mv removes
the temp file and fails the setup. A link, or a file that's empty, not
JSON or not one object, is replaced by the copy and said (a link removed
first, so mv never writes through it into a folder); a folder is left
and said.

With a Claude Code token (setup-token), devvm sends no copy, as before,
so the VM's file stays as it is: Claude Code prefers the token in its
environment, and a leftover login's placeholder gets the token at
api.anthropic.com and nothing at the connectors' host.

mcpOAuth stays in the VM: devvm agent save reads only settings and the
.claude.json allowlist, history export excludes .credentials.json
(HistoryExcludes) and import skips it, and a remake leaves login files
out (homeSkips), all unchanged.

Tests: TestStageClaudeOAuthMerged (the copy is staged to merge, never at
home/.claude/.credentials.json); TestClaudeSyncNamesMerged (sync.sh
merges each claudeSyncName name into its place); guest.txtar runs
merge_claude_credentials (mcpOAuth and other keys kept, claudeAiOauth
replaced or removed, a key with a \u escape, empty, not JSON, two values,
an array, a link to a file or folder, a folder, a failed move, the
warnings, mode 600, no temp left); agent_login.txtar reads the new name.

Docs: Coding agents' MCP servers' logins (real tokens the VM's code can
read, never leaving it) and its Copies, How it works' Claude Code's
login and the network page's sentences, what a VM made again keeps, the
sync.sh header, and the safety pages' claim that a VM never holds a
refresh token, narrowed to the logins devvm keeps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 13:57:45 -07:00
w3cjandClaude Opus 5.5 c1db911d1b fix(agentlogin): the Claude login reaches claude.ai's connectors (#61)
Claude Code lists a claude.ai account's connectors at
api.anthropic.com/v1/mcp_servers and reaches each at
mcp-proxy.anthropic.com/v1/mcp/<id>, with the login's access token. The
OAuth login's binding named api.anthropic.com alone, so the connectors'
requests carried the placeholder and were refused.

ClaudeOAuthBindings gives the OAuth login a second binding,
claude-connectors: the same placeholder, into Authorization for
mcp-proxy.anthropic.com below /v1/mcp/ alone. It has a name of its own
because the proxy looks a value up by its binding's name, and
secrets.Store.Get gives claude-oauth a Claude Code token in the login's
place but never gives one to claude-connectors, so a token, saved or in
devvm's environment (whose scope isn't checked), still goes only to
api.anthropic.com. The bindings file stays version 1.

Tests: TestClaudeCapture and the claude-oauth golden check both bindings;
TestClaudeBindings checks the connectors' binding gets the OAuth login and
never a saved or environment token (with the claude-oauth control);
network.txtar checks the VM's secrets.json and secrets.policy. e2e's
network section adds the connectors' host to its fake upstream: with the
claude secret, neither its placeholder nor the OAuth login's gets the
token there (the API, the control, does), and after the host's refresh
the connectors' host gets the refreshed access token.

Docs: the Claude Code login, the attack vectors' new entry for connectors
(deny mcp-proxy.anthropic.com to keep them from a VM), How it works'
bindings and threat lines, the agents' table, and Contributing's e2e
network section, whose refresh sentence was stale (the refresh succeeds).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 13:19:11 -07:00
w3cjandClaude Opus 5.5 8afdec7de4 fix(proxy): a NO_PROXY address with an IPv6 zone names nothing (#59)
parseNoProxy read an entry with netip.ParseAddr, which accepts a zone,
and PrefixFrom then dropped it, so fe80::1%eth0 sent fe80::1 direct.
Go's httpproxy, HostOK, dial and the policy all treat a zoned address
as naming nothing; the NO_PROXY reader now does too.

Tests: FuzzNoProxy's crash input (::%0 against [::]), and fe80::1%eth0
and [fe80::1%eth0]:443 in TestNoProxy's names-nothing cases.
FuzzHostSites' noProxySite lists the zoned address as a divergence
from the legacy reader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 11:51:54 -07:00
w3cjandClaude Opus 5.5 e97db057fd fix(agents): Claude Code's plugins get a folder of each VM's own, the store's a read-only seed (#56)
A VM's ~/.claude/plugins was the agent store's plugins folder, mounted
read-only, so everything Claude Code writes there failed with EROFS: a
plugin's data (${CLAUDE_PLUGIN_DATA}), installs, marketplace refreshes,
mcpb/ and the rest. Making the store writable would let one VM change
what Claude Code runs in every other VM, so each VM's ~/.claude/plugins
is now its own folder on its disk (CLAUDE_CODE_PLUGIN_CACHE_DIR), and the
store's folder is linked at ~/.claude/plugins-seed and read as Claude
Code's own read-only seed (CLAUDE_CODE_PLUGIN_SEED_DIR). Checked on a
devvm VM first: a seed-cached plugin from a GitHub-style marketplace
loads with only enabledPlugins, its hook writes ${CLAUDE_PLUGIN_DATA} in
the VM's own folder, installs in the VM work, and seed marketplaces
refuse updates.

- agents: Def.Seeds (Rel, Link, Entries), Seeds, SeedOf, MachineOwn;
  Env gains Home; Claude's Env sets both variables below $HOME.
- vm: the setup links a seed at its Link and stages own-dirs, which
  sync.sh makes a folder in place of a link; agentEnv writes Home values
  through homeValue (shared with toolchainEnv); a remake keeps the VM's
  own folder and skips the seed's link.
- devvm agent import copies only a seed's entries (known_marketplaces.json,
  marketplaces, cache), directly and through followed links, so the
  host's plugins' data, mcpb, synced, .trash, store and
  installed_plugins.json never reach the store.
- devvm agent save: the VM's script excludes a seed folder's other
  entries by name, and readSent refuses any (listedPath); a seed folder
  adds and changes, never removes or prunes; claudeRecords renames the
  VM's plugins path to the store's and joins known_marketplaces.json by
  key, leaving records Claude Code registered from the seed as the
  store's, and the store's file as it is when nothing changed.
- History: an export leaves the VM's plugins folder out and an import
  skips it and the seed's link: it's settings and plugin data (which can
  hold a plugin's own logins), not history, and reaches other VMs only
  through devvm agent save's reviewed diff.
- Review fixes (security-audit): historyImport refuses a name with a
  ., .. or empty part (GNU tar's anchored excludes missed
  .claude/./plugins and .claude//plugins, which now reach a writable
  folder) and deletes importSkips by path after the link sweep; the save
  script never excludes a name with a wildcard's character (it's sent
  and refused); only a marketplace record whose exact installLocation is
  clean and in the store's marketplaces joins the store's.
- Tests: claude_test.go (TestClaudePluginsSeed, TestClaudePluginsHistory,
  TestAgentImportClaudePlugins, TestAgentSaveScriptClaudePlugins,
  TestReadSentClaudePlugins, TestAgentSaveClaudePlugins), TestSeeds,
  TestListedPath cases, the agent, agent_save and sync CLI tests, goldens,
  and e2e project checks of the seed, the VM's folder and a plugin's data.
- Docs: coding-agents (store table, Claude Code's plugins under Mounts,
  the save's plugin example), internals/agents, a design note with its
  threat check, extending.md, CHANGELOG Fixed and After you upgrade.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 11:37:40 -07:00
w3cjandClaude Opus 5.5 f3848294d8 fix(agentlogin): names you choose in agents' settings are no longer taken for secrets
Redact judged every key by redactName's substring rule, so a plugin, a
marketplace or an MCP server named tokeneconomizer, token-saver or
secret-scanner had all its settings replaced with devvm-redacted, and
Claude Code refused the VM's settings.json whole (#55).

Each agents.Def now lists the tables of its settings files whose keys are
names you choose (Names: a table under a name isn't judged by its name)
and the tables of settings keyed by names (NamedValues: neither a table
nor a setting's word, lower-case letters and dashes such as off, is),
read from each agent's docs; agents.NameTables is their one union, which
Redact applies to every agent's files. Fields under a name are judged as
before: the substring rule, wholeTable, secretShape and the URL and text
scrubbing. Any other value right under a names table is still judged by
its key, a name that's env or headers still makes a table of secrets, and
a * in a table's path never stands for a list's element.

The trade-off: a table with a secret-looking key right under a name, such
as {"mcp": {"tokens": {...}}}, is no longer replaced whole; no agent's
schema has one there, and the fields inside it are still judged.

Tests: TestRedactNames (Claude Code's, Codex's, opencode's and pi's
names, kebab and camel, secret fields under names, misplaced values in
names and settings tables, a list under a settings table's path, a
server named env), FuzzRedact's seeds under names and settings tables,
and TestRestoreOlderNamesCopy for a VM copy an older devvm blanked, which
devvm agent save leaves out with a warning (an After you upgrade line).
Thanks to dhruv1220 for the tests' idea in #58.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 10:48:29 -07:00
w3cjandClaude Opus 5.5 2c0a894a1c fix(vm): a project folder's VM works after a boot renumbers its disk
macOS numbers its disks' devices in the order they appear at boot, so
after a restart an unchanged project folder's identity (dev:ino:btime)
can have another device. The finder then refused its VM as made for an
earlier folder (vm_other_folder), a stopped VM's start refused it as
replaced (project_folder_changed), and the next .git check called it
replaced (git_replaced).

platform.SameFolder is now the one comparison of two folder identities:
the same ID, or at the same path the same inode and birth time on
another device. On another device the ID must also be the one read from
the folder opened at the path with no link followed (OpenNoLinks, then
fstat and fstatfs on it: openFolderID), on a file system whose IDs are
their folder's alone, so a link swapped in while the caller read the ID
can't pass a copy's (a snapshot's, a cloned disk's) off as the folder's.
A folder at another path (moved) matches only exactly.
platform.Renumbered says when the record needs the folder's ID as it is
now.

The finder's sameFolder, here.movedFrom, gitprotect's protectRepo and
the strict conversion's checks use it. A start records the project
folder's identity as it is now under the VM's state lock (renumbered, in
bringUp) before the backend mounts it by Want.ProjectID, so vz's
/.vol/<dev>/<ino> mount names the current boot's device, in the one
limactl edit; folderChanged's checks after it then compare exactly. A
.git check that accepts a renumbered .git records its current identity.
The move's check stays exact, as both its IDs are read in one run.

The structure test's folder-ids rule fails on == or != on a field named
Folder or GitID, or a call of FolderID or folderID, outside
internal/platform and tests, unless exactFolderIDs lists the function
with why: the agents' and exports' Folder paths, recordMove's
unchanged-state check and folderChanged.

Tests: TestSameFolder (platform), TestRenumberedFolder (vm),
TestReportsRenumbered (gitprotect), a renumbered vz case in
TestProjectMountByInode (lima), existing.txtar's renumbered folder, and
fixture_v010_renumbered.txtar on the frozen v0.1.0 state, through the
new renumber script command and stubtest.Renumbered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 10:12:14 -07:00
w3cjandClaude Opus 5.5 ba5613e1ed fix(project): a folder name's run of separators becomes one dash in its VM's name
A folder named x--y, "foo (copy)" or "C++ stuff" failed to get a VM
(#52): project.Slug turned each character other than a-z and 0-9 into
its own dash, and Lima's instance-name grammar refuses separators in a
row. Slug now writes one dash per run.

- vmname: the project-VM grammar refuses dashes in a row
  ([a-z0-9]+(-[a-z0-9]+)*); HasRuns recognises the names releases up to
  0.1.1-rc.3 made for such folders.
- state: a vm.json whose name HasRuns and that has no created time is
  read as no state. Only a create that Lima refused leaves one (vm.json
  is written before limactl clone), so the folder's next VM, in the same
  hash folder, replaces it, rather than every read failing as corrupt.
  One with created set is still corrupt.
- The limactl stub refuses names Lima refuses on create and clone;
  TestLimactlStubContract gains a refused clone, checked against real
  Lima.
- Tests: TestNamesLimaTakes (Lima's regex as the oracle), TestHasRuns,
  TestVMWithRuns, TestLimactlRefusesNames, name_runs.txtar (a new VM for
  x--y, and an older release's leftover state replaced).
- Docs: internals/backends.md's VM names; CHANGELOG Unreleased Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 12:39:29 -07:00
w3cjandClaude Opus 5.5 70ed1db7ef build(nilaway): nilaway:linux checks Linux's build and must pass before a push to main
CI's nilaway job only warns, so a new finding hides in a green run, and
a finding's key is its code path, so code that only moved can read as
new. mise run nilaway:linux runs scripts/nilaway.sh with GOOS=linux, so
nilaway checks the code as built for Linux, as CI's job does, from a Mac
too (a nil planted in a Linux-only file fails it there, where the plain
task passes); it exits 3 on a new finding and 1 on a stale line.

Contributing's Tools and tasks and Nil checks, AGENTS.md's tasks and
codebase-standards' rules.md say it must pass before a push to main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 08:34:26 -07:00
w3cjandClaude Opus 5.5 069f646e80 test(structure): an io.ReadAll outside tests reads through an io.LimitReader
The structure test's read-limits rule fails, outside tests, on an
io.ReadAll whose reader isn't an io.LimitReader made in the call, unless
unboundedReads lists its function with why; a listed function that has
none fails. Four are listed: the status line's tail of the run's own
log, which only that run writes, and the three test stubs' reads of the
standard input devvm under test writes and closes. readCases breaks it
on a renamed io import, a reader limited before the call and a read in
a function literal.

It shares dropped-errors' walk and table check (siteRule, sitesWhere).
Named as the guard in codebase-standards' Bound what you don't control
and rules.md, and in Contributing's structure test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 08:32:17 -07:00
w3cjandClaude Opus 5.5 f9c02c1c5c build(lint): a file a VM can write is changed through what opened it
forbidigo refuses os.Chmod, os.Chtimes, os.Chown, os.Lchown and
os.Truncate in internal/proxy, internal/vmlog and internal/vmssh, outside
tests: a change by path follows a link a VM swapped in after the open.
The two sites today, the proxy's SSH agent relay socket and the link
session's sockets, chmod a unix socket devvm has just made in its own
folder, which only its path can set; each says so in a nolint.

The safefile rule widens to internal/vmlog, which has no open of its
own, and to the proxy's rotate.go and nixcache.go, whose three opens to
write or lock say why in their nolints.

testdata/lint breaks the rule once for each function and keeps the
descriptor's own methods. Named as the guard in codebase-standards'
Treat what a VM can write as hostile and rules.md, and in the checks on
owners.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 08:29:53 -07:00
w3cjandClaude Opus 5.5 bd09e883d5 test(structure): a Wait's or a strconv parse's error assigned to _ fails
The structure test's dropped-errors rule fails, outside tests, on a
function that assigns a Wait's error, or a strconv parse's (Atoi, the
Parse functions, Unquote, UnquoteChar, QuotedPrefix), to _, unless
droppedErrors lists it with why; a listed function that drops none
fails. None is listed today. errorCases breaks it on each shape: an
assignment, both of a process's Wait results in a goroutine, a renamed
strconv import, a var and an if's init.

Named as the guard in codebase-standards' Never fail silently and
rules.md, and in Contributing's structure test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 08:27:28 -07:00
w3cjandClaude Opus 5.5 2208931253 test(proxy): the broker's too_long reply to a reply past a frame
The broker's answer refuses a reply too long for a frame with
too_long, so the child's request never waits on it, but no test
reached that path. TestServeChildTooLong, in a synctest bubble on
memnet, asks for a value past wireMax and checks that the child gets
too_long for it at once, and that its next request is answered.
Without the too_long send the bubble deadlocks on the child's wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 08:22:47 -07:00
w3cjandClaude Opus 5.5 59126858c4 fix(proxy): the Nix cache's folders are made and chmodded through descriptors
makeNixFolders ran os.MkdirAll and os.Chmod on nar/ by its path, which
follows a link there. A confined proxy child makes regular files alone
in the shared Nix cache (Landlock has no MAKE_SYM for it, and Seatbelt
refuses anything but a regular file), so it can't plant one; a child
that runs without Landlock or Seatbelt could, and each proxy's next
start would chmod the folder the link led to. This is hardening for
that case, not a fix a user could see, so it has no CHANGELOG entry.

The cache's folder is now opened as a safefile.Root, and its mode set
through its descriptor (Root.Chmod: fchmodat on "."). Anything at nar/
that isn't a folder is deleted as itself (a link never followed), and
nar/ made and opened from the root as a folder, never a link
(Root.MakeDir, which tries mkdir only when nothing is there, as a
sandbox that refuses making folders may refuse it even where one is),
its mode set through its descriptor. makeNixFolders reports a
replacement, which the broker's log warns of, so the cache, which is
devvm's alone, never stops a proxy's start.

Test: TestMakeNixFoldersPlanted plants a link to a folder outside the
cache, a relative one to a folder in it, and a file; each fails without
the fix (the targets went to 700, or the start failed). Docs: How it
works' shared Nix cache and the design note on the folders the child
writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 08:22:47 -07:00
w3cjandClaude Opus 5.5 0b85f5f557 fix(size): a size that isn't a number is refused, never read as 0
Size.Backend dropped strconv's errors, so a VM's size in vm.json that
isn't a number, such as "cpus": "four" after an edit by hand, read as
0, the image's, and the VM started with the image's size without a
word. Backend now reads each part with the check that took it
(settings.CPUCount, settings.GiB, which ParseCPUs and ParseGiB now
use), and returns an error naming the key and value. storedSize turns
a stored one into size_stored_invalid, naming the VM. Every start
(bringUp, before anything runs), a restart's stop (stopToStart, so a
running VM keeps running, as a refused proxy start leaves it), devvm
size and a remake's check refuse with it; devvm size --KEY sets it
again. ParseCPUs and ParseGiB also refuse a number too big for an int
or a float64, which for --disk reached Lima as +Inf.

Lima's originOf read base's disk with ParseFloat and dropped its
error: "NaN", "Inf" and "1e400" passed its check of a size above 0.
Only devvm's own Origin writes that step (gibString of BaseDiskGiB), so
no user, VM or limactl output reaches it; it now reads it with
settings.GiB and fails naming the value.

Every other discarded strconv error outside tests goes too:
- hostgit.Bool reads a boolean as git does (yes, on, whole numbers)
  and says when a value isn't one; GIT_CONFIG_NOSYSTEM, which
  strconv.ParseBool read as false for "yes", uses it, as does the clone's
  copy of a repo's config (gitBool, which had its own copy).
- image.GlibcOlder checks both versions itself and reports ok, so one
  that isn't a version is never read as 0.
- leaktest and state's lock order panic on a goroutine number
  runtime.Stack doesn't print today, rather than reading it as 0.
- cli's test-build overrides fail on a number that isn't one (a test
  build's panic), the stub limactl refuses a size it can't read, and
  opencodeMajor's fallback to 0 is explicit.

Tests: TestSizeBackend, TestStoredSizeInvalid (a stopped VM and a
running one's restart), TestSizeNumbers, new TestParseSizes and
TestOriginOfRefuses cases, TestParseUnknownFormat, TestBool,
TestUserFilesOf's git booleans, TestGlibc's invalid versions; each
fails with its fix reverted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 08:22:47 -07:00
w3cjandClaude Opus 5.5 c8505e326a fix(daemon,desktop): a process's Wait error is kept, not dropped
daemon.Spawn dropped its Wait's error and kept only the ProcessState.
When Wait can't reap the process (wait4 fails, as when something else
reaped it), there is no state: Exit then said "<nil>" and ExitSignal
dereferenced a nil state, which would have panicked the proxy's broker
in sandboxFailed. Handle.reaped now keeps Wait's error when there's no
state, Exit names it, and ExitCode and ExitSignal answer -1 and 0.

devvm desktop's sshChannel.Close dropped ssh's Wait error. An ssh that
ends on its own with a failure, such as 255 when the VM drops the
connection, now goes in the run log once and is Close's error; one that
Close killed after channelClose, or that the dial's context killed as
devvm desktop ends, isn't, as its end is the kill. startChannel, split
from dial, starts any command as a channel, for the test.

Tests: TestHandleReaped (fails without the nil-state handling: "<nil>"
and a nil-pointer panic), TestDesktopChannelClose (fails without Close
keeping Wait's error).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 08:07:30 -07:00
w3cjandClaude Opus 5.5 ddb06b1ea7 docs(skills): the codebase-standards skill, a short checklist from what reviews kept finding, and how new code matches the codebase
A new project skill, .agents/skills/codebase-standards/, curated from
what reviews of devvm's whole history kept finding. A standard stays
only when it recurred or was costly, and a contributor can apply it
while writing or reviewing; what the linters and the structure test
enforce is only in rules.md's guard tables.

- SKILL.md: the checklist of 13 standards in four groups (safety,
  failures and processes, changes, tests), a Match the codebase
  section (names and files, comments, errors, dependencies as fields,
  table tests, scripts in the VM, prose), how to review a change, and
  the bar for adding a standard.
- standards.md: one section per standard, with its rule, what the
  reviews found and its guard:
  - Fail closed, on every path (a weaker mode only when visible,
    documented and chosen, as the proxy's warn-and-run without a
    sandbox)
  - Bound what you don't control (listeners, locks, overflow, a capping
    writer that doesn't embed its buffer)
  - Treat what a VM can write as hostile (descriptors, signed sources
    and re-hashing, escaping, host tools by absolute path)
  - Keep secrets and host data on the host (no argv or shared
    environment, allowlists into the VM, logs redacted)
  - Parse once, with a real parser (IPv6 and its IPv4-carrying forms)
  - Never fail silently, and name the real cause
  - Give every process an owner that ends it (accept loops included)
  - Survive a kill and a second devvm (one good copy, OS file locks)
  - Extend the owner, and wait for a third copy (an existing owner is
    always extended; a copy of a judge gets one owner at once)
  - Mind what's already running and released
  - Claim only what the code does, where precision belongs (headline
    pages keep their short claims)
  - Prove each fix with a test that fails without it (outside oracles,
    controls for absence checks, sandboxes proven by attack)
  - Write tests that pass on any host, at any load
- rules.md: the rules whose home is AGENTS.md or Contributing, by area,
  each with its guard or review only.
- AGENTS.md: a rule line for the skill and its row in the layout, and
  the owner rule's wait-for-a-third clause, which Contributing's
  structure page explains.
- Contributing's first paragraph links the skill.
- The docs-voice skill's scope, .vale.ini, mise run lint:docs
  (markdownlint and Vale) and TestCommandLines cover the new skill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 07:50:54 -07:00
w3cjandClaude Opus 5.5 1a16b1bb73 build(nilaway): the baseline follows three triaged findings the harden stack reshaped
The agent relay's finder calls the VM state's Name directly, the links
report is read through safefile.Read rather than os.ReadFile, and the
rotation's Stat finding is gone with the broker's descriptor-based copy.
The two that remain are the same false positives in new shapes: fst is
set together with found, and from is reset when the data is shorter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 07:14:16 -07:00
w3cjandClaude Opus 5.5 df1d76bbd9 fix(desktop): devvm desktop's relay goes on after an accept error
devvm desktop's relay returned at any error from its listener's Accept,
so running out of open files in a burst (EMFILE) ended devvm desktop.
It now waits and tries again, as devvm's other accept loops do, with
their one owner, daemon.AcceptRetry: 5 ms, doubling up to a second,
logging only the first error of a run, and it still ends with its
context or its listener's close.

- internal/desktop/relay.go: Serve uses daemon.AcceptRetry.
- Tests: TestRelayAcceptRetries (a listener that fails three Accepts
  with EMFILE, then carries a viewer; the run logged once).
- Docs: processes' desktop relay, structure's internal/daemon row;
  CHANGELOG Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 3da38436a7 feat(proxy): the broker opens the child's connections; its sandbox refuses it every one of its own
A sandbox fixed at the child's start can't tell this machine's
loopback, its own addresses and the LAN apart from the internet as a
rule changes, so the child's sandbox now refuses it every connection
of its own, and the broker looks up each name and opens each
connection for it, once its own read of the VM's policy and of the
host's addresses allows the address, as the floor does. A child that a
VM takes over reaches this machine's loopback, its own addresses and
the private and link-local ranges only where a rule names the address,
as the VM does; a company proxy, which the child still speaks to with
its password, reaches whatever it reaches.

- wire.go: lookup (a host name, absolute, with its trailing dot), dial
  (an address and a port, or the https or http company proxy of the
  broker's config, never both), the connection as the reply's one
  descriptor, and cancel, for a lookup or a dial the child gave up on,
  which frees its slot.
- dial.go: the broker's own egress (newBrokerNet: the VM's built-in
  policies, its policy files, looked at on every dial, and the host's
  addresses), lookupable, broker.lookup, dial and dialProxy, within 20
  s and 15 s; the child's side (brokerClient.lookup, dial, dialProxy)
  wired into its egress by throughHost; the resolver's errors as codes
  the child makes into net.DNSError again.
- broker.go: the caps (256 lookups, 1024 connections at once); its
  line for each failed lookup and connection, which the VM drives, at
  most 20 a minute and then one that says it stops (logFailed,
  perMinute in limits.go, which egress.abandoned now shares).
- child.go and confine.go: every lookup and connection through the
  broker; the child lowers its open files, soft and hard, before it's
  confined (limitFiles).
- seatbelt: the child's profile allows no network out, TCP, UDP or a
  unix socket, nor mDNSResponder.
- landlock: the seccomp filter refuses every socket but a netlink
  route socket, connect, socketpair, listen and MSG_FASTOPEN on
  sendto, sendmsg and sendmmsg; Landlock no longer opens the resolver's
  files below /etc.
- Tests: the broker's dial and its rules (TestBrokerDial,
  TestBrokerDialFollowsRules, TestBrokerDialProxy), lookups and their
  errors, cancel, the client over a real socketpair,
  TestBrokerFailedLogCapped, TestPerMinute, the filter's programs, the
  child's own connections refused under Seatbelt and under Landlock and
  seccomp.
- Docs: the design note's broker (what crosses to the broker: the
  names and addresses, never a connection's bytes), its threat check,
  network's The child's sandbox and proxy.log, processes, attack
  vectors, troubleshooting, testing, tests, the proxy's README;
  CHANGELOG, with the company proxy's reach.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 7bc886133d fix(proxy): the broker frees a request's slot as its reply goes; start tests wait out a loaded host
The proxy's start and broker tests failed on loaded hosts, most on the
linux host under the race detector. The causes:

- Start timeouts (TestAgentRelay, TestMainRuns, TestMainRefuses,
  TestStartChildSandbox, TestV010ProxyConfigsStart, TestHandshakeChildGone):
  a broker's start, timed from its own, hashes its executable (selfSum),
  and the in-process child's spawn hashed it again. Under -race with the
  package's other tests, each hash took 2-3.5 s on the linux host, so
  starts passed startWait's 4 s (a start frame's write timing out, a
  relay or a proxy not listening within the test's 2 s of retries).
  IO gets a startWait field, a test seam; inProcess sets it to
  testStartWait (30 s) and hashes the test binary once per inProcess,
  and the tests wait as long for the proxy (retryFor). devvm's own
  proxy still waits 4 s.
- TestBrokerClientGivesUp's "busy": a real bug. The broker gave a
  request's slot back only after its reply was written, and the child
  gives its own back as the reply arrives, so a child that kept the
  caps and sent its next value at once could get busy. answer now
  frees the slot once the reply holds the socket's write lock, just
  before it's written (frameConn.sendThen), so a reply that waits for
  a child that doesn't read still holds its slot and the bound stays.
  TestServeChildFreesSlotsAsRepliesGo checks both, in a synctest
  bubble, and fails without the fix. The broker isn't released yet,
  so no CHANGELOG entry.
- TestSpliceKeepsAnEarlyAnswer (1 in 20 on linux under -race): splice
  could put the whole 4 MiB answer into loopback's buffers and close
  before the test's delayed upload arrived, which then reset the
  connection and dropped the unread answer. The test's server now
  answers once the upload's first bytes reach it, as a 413 does.

Coverage: internal/seatbelt has 53 statements, and the mini's unit and
CLI runs cover 51 (96.2%) every time; 97.4% isn't k/53 for any k, so the
baseline was measured on an earlier version of the package (37/38).
The two misses were ProxyChild's branch for a profile that can't be
made, now tested, and ChildProfile's template panic, which can't
happen. darwin's baseline rises to 98.1.

Docs: the design note says how the broker's caps never refuse a child
that keeps them; Contributing's tests page covers testStartWait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 1793353dd9 feat(proxy): Linux confines the proxy's child with Landlock and seccomp
Before it reads a byte of the VM's, devvm _proxy-child confines every
thread of itself through proxy.confineSelf on Linux: no_new_privs
(syscall.AllThreadsSyscall), Landlock from ABI 2 (TSYNC from ABI 8) to
its logs folder, the Nix cache and the resolver's files (never /, the
home folder or one that holds it), binding no TCP port (ABI 4), scoping
signals and abstract sockets (ABI 6, or ABI 6/7 with erratum 2),
refusing named unix sockets (ABI 9) and UDP but to port 53 (ABI 10);
then a hand-written classic BPF seccomp filter, installed with TSYNC,
that refuses with EPERM AF_UNIX socket/socketpair, listen, io_uring,
ptrace, process_vm_readv/writev, pidfd_getfd, a file's mode, owner,
xattrs and times by its path (chmod, fchmodat, fchmodat2, chown, lchown,
fchownat, the six xattr calls, utime, utimes, futimesat, utimensat with
a path), truncate, the keyrings (add_key, request_key, keyctl),
prlimit64 on any pid but 0, setpriority, ioprio_set,
sched_setaffinity, sched_setscheduler, sched_setparam, sched_setattr,
inotify_init, inotify_init1, inotify_add_watch, fanotify_init,
fanotify_mark, execve, execveat, fork, vfork, unshare, setns, bpf,
userfaultfd,
perf_event_open, clone for anything but a thread or with a namespace's
flag, and clone3 with ENOSYS; it kills a foreign architecture's call or
an x32 number. fchmod, fchown, ftruncate and utimensat on a descriptor
stay. It checks the confinement holds, then proxy.checkConfined, and
that it still reads the host's addresses, within 2 seconds, or fails
the start. A kernel without Landlock or seccomp leaves that part out;
the child runs and says so. The broker sets itself undumpable
(PR_SET_DUMPABLE 0). The Nix cache marks a file used through its
descriptor. The broker's start, and its life with the child, take a
reset of the socket (ECONNRESET, Linux's end of a socket closed with
frames unread) as the child's end, as EOF is (socketEnded,
TestHandshakeChildGone).

Built on the Seatbelt item's shared owner, proxy.Confinement:
- internal/landlock (new, stdlib only, Linux build tags): Self, Result,
  Floor, ABIPorts/ABISignals/ABIUnix, ErrUnsupported; landlock_linux.go
  (resolverFolders, refusedFolder, homeFolder), filter_linux.go (filter,
  asm, encode, archOf), seccomp_linux.go, self_linux.go (Self, check,
  refused).
- internal/proxy: confineSelf on Linux calls landlock.Self;
  landlockConfinement words it (By landlock, seccomp; Why
  no-landlock-or-seccomp, no-landlock, no-seccomp, landlock-below-abi4,
  landlock-signals; full from ABI 6 with seccomp and scoped signals);
  confineChild takes the child's needs and returns an error, bounded by
  confineWait (within, confineWith); checkConfined only where Landlock
  or Seatbelt confines files; confineStarted; IO.confine required, set
  by ChildMain alone; hostAddrs.check; touch_linux.go and
  touch_other.go (touchFile, undumpable); IO.dumpable for tests.
- devvm doctor: netpolicy.Unconfined's Linux warnings
  (proxy_unconfined_no_kernel, _no_landlock, _no_seccomp, _old_ports,
  _old_signals).
- Tests: TestFilter and TestFilterBytes (an interpreter of the program's
  bytes, amd64 and arm64, and the assembler's refusals), TestSelf (a
  real confined child: outside file, ssh-like unix socket, listen, bind,
  signal, chmod, chown, setxattr, utimes, truncate, a keyring, unshare,
  exec, clone3, and new threads, fchmod, ftruncate and futimens kept),
  TestKernel, TestCheck, TestRights (refusedFolder), TestArchNumbers,
  TestLandlockConfinement, TestConfineWithin, TestCheckConfined,
  TestConfineStarted, TestRunChildOn, TestUnconfined; network.txtar; e2e
  network's Landlock, NoNewPrivs and Seccomp check.
- CI: a nocgo job (CGO_ENABLED=0) for internal/landlock and
  internal/proxy.
- Structure test, depguard, goroutineSites; docs: the child's sandbox,
  processes (and its why-Go note on unsafe), design (the network row's loopback follow-up on Linux,
  other processes and /proc without Landlock), doctor's checks,
  troubleshooting, attack vectors, Contributing, the proxy's README,
  AGENTS.md, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 941c63c696 feat(proxy): the proxy's child runs under Seatbelt on macOS
On macOS the broker starts devvm _proxy-child through
/usr/bin/sandbox-exec -p PROFILE, by devvm's real path, with a
deny-default profile, so the child is confined from its first
instruction: devvm's binary to run and read, its folder's metadata,
dyld-support.sb, /usr/lib and /System/Library, the time zone and
resolver files, its logs folder and the shared Nix cache (regular
files only, no hard links, no folder removed, no flags, ACL, owner,
set-id or xattr changes), stat alone on the watched files and every
link on the way, trustd and trustd.agent, mDNSResponder's socket, TCP
and UDP out (loopback left to the floor: a rule for a loopback port
applies at once, which a profile fixed at the start can't follow),
sysctl but kern.proc, signals to itself. No home folder, no devvm folder but its
own, no Keychain, no other unix socket, no bind, fork, exec, signal to
or look at another process (process-info, the process list).

- internal/seatbelt: the shared owner of Seatbelt (Exec, String,
  Path, Links, ChildProfile, Sandbox.ProxyChild); sbString, sbPath and
  sandboxExec move here from the Lima backend, which uses them.
  ChildProfile refuses a relative path and the root.
- internal/proxy/confine.go: the confinement report every platform
  shares (Confinement, ParseConfinement, ReadConfined: one line of
  fixed words in run/proxy.confined, refused unless it parses, and
  unless it fits what the broker started the child with), the child's
  self-check (checkConfined: its broker's config must be refused), and
  the in-process hook (confineSelf, confineself_linux.go and
  confineself_other.go) for the Landlock follow-up.
- internal/proxy/childstart.go: startChild, childSandbox, childNeeds;
  IO.Seatbelt, set by devvm _proxy on macOS.
  A missing sandbox-exec, or one that failed before devvm's code ran
  (exit 65 or 71, or SIGABRT or SIGKILL, before the child answered,
  decided before the broker's own stop), starts the child again
  unconfined within the broker's 4 seconds, with a warning in
  proxy.log; any other failure fails the start. The broker makes the
  Nix cache's folders first. start carries how the broker started the
  child (Spawned).
- watched.get: a stat refused for want of permission reads through the
  broker each time (a watched link pointed elsewhere after the start).
- daemon.Handle.ExitCode and ExitSignal.
- devvm doctor warns for each running VM whose proxy's child isn't
  fully confined (netpolicy.Unconfined; proxy_unconfined,
  proxy_unconfined_unsupported, _no_sandbox, _sandbox_failed,
  _check_failed).
- Tests: TestParseConfinement, TestCheckConfined, TestReadConfined,
  TestStartChildSandbox (an over-claiming ready, SIGTERM),
  TestSandboxFailed, TestChildNeeds,
  TestWatchedStatRefused, TestUnconfined, TestString, TestLinks,
  TestChildProfile, TestProxyChild, TestChildProfileConfines (the test
  binary run again under the profile on macOS: flags, rmdir, the
  process list), doctor's report, ExitCode and
  ExitSignal; e2e network checks run/proxy.confined is full seatbelt
  on macOS.
- Docs: How it works' The child's sandbox, Processes, the design
  note's confinement and threat check (loopback as open work, other processes'
  details and kern.procargs2, the shared folders' flags, mDNSResponder's
  records, trustd.agent's trust settings, the fallback's signals, a
  ready that claims more), Troubleshooting's The proxy runs without a
  sandbox, Staying safe's escaping the VM, doctor's
  checks, Contributing's packages, the proxy's README, AGENTS.md,
  CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 63bb1ff9a8 fix(network): a confined VM's programs ask 127.0.0.1 directly, so names fail at once
With transparent mode off or stopped, a confined VM's only name server,
127.0.0.1 (Lima's DNS setting), has nothing listening. glibc asked it
through systemd-resolved's stub, which could keep retrying it over UDP
and TCP without answering, so a lookup such as getent's waited out its
timeout instead of failing at once (seen on a Linux host: e2e network's
checks of DNS with transparent mode stopped and off).

Each launch's setup now replaces /etc/resolv.conf, the stub's link, with
devvm's own file on a confined VM: nameserver 127.0.0.1 alone, the stub's
search line, timeout:1 attempts:2. glibc gets a refusal at once with
nothing listening, and dnsmasq's answer through transparent mode's
nftables rule when it runs, as musl on Alpine does. An open VM gets the
stub's link back. Only systemd guests that have the stub's file and whose
/etc/resolv.conf is its link or devvm's own are touched.

Root cause, as far as it could be pinned down: with resolved's stub in
the path, a lookup depended on resolved's retry loop over a server that
refuses everything (24 attempts, flipping UDP and TCP feature levels),
and on the linux host that loop sometimes never answered the stub
within getent's 3 s. It didn't reproduce on demand (a base run on the
linux host passed both checks, and bursts of 200 parallel lookups and
stops mid-lookup all failed in under 2 s), so the fix takes resolved out
of glibc's path rather than tuning it.

Going back to open restarts systemd-resolved: it reads a /etc/resolv.conf
that isn't its own link as global servers and search domains, so it had
taken 127.0.0.1 and "~." from devvm's file, and kept them once the link
was back, which left an open VM unable to resolve names (caught by e2e
network's open checks on the linux host and ubuntu).

Review folded in: no change of a foreign or dangling link when the stub's
file is missing; two attempts; Docker's user-defined networks in the docs.
Second review: devvm's file alone is enough to go back on an open VM (a
warning when the stub's file is missing); a failed write says so in one
line and the launch goes on; troubleshooting's "An open VM resolves no
names after a downgrade"; tests for resolved's own resolv.conf link, an
open VM without the stub, a non-systemd guest with devvm's file and a
failed write.

workerd under wrangler dev, checked by hand on fedora with transparent
mode off: its fetch fails at once (Temporary failure in name resolution),
so the "about 40 seconds for each lookup" sentence is gone from lima.md,
safety/network.md and troubleshooting.md, and testing.md's manual check
covers it.

testdata/coverage/darwin.txt: internal/sshagent's baseline rose with
mise run coverage (unrelated to this change).

- backend.Confinement.Resolver: the one owner of a confined guest's name
  server; Lima's start sets .dns from it, sync.go sends it to the setup
  as DEVVM_RESOLVER; sync.go's setupInputs as mise run fmt writes it.
- assets/guest/sync.sh: resolver_conf; its unit test runs the function
  (internal/vm/resolver_test.go). sync.sh runs at each launch and goes in
  no image, so no image key changes.
- CLI tests: DEVVM_RESOLVER on confined (transparent on and off) and open
  VMs. e2e network: the stopped-transparent check also checks the file.
- Docs: network.md's The VM's resolver, lima.md, design.md, tests.md;
  CHANGELOG Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 aeea3135b2 feat(proxy): the proxy's broker and its child
A VM's proxy runs as two processes, as design.md's "The proxy's broker"
says: devvm _proxy, the broker, which keeps what only the host should
do, and devvm _proxy-child, which reads the VM's network and can be
confined by the follow-ups.

- wire.go: the protocol over one socketpair (close-on-exec from the
  start: SOCK_CLOEXEC on Linux, ForkLock elsewhere), length-prefixed JSON
  frames of at most 2 MiB, unknown fields refused, bytes as base64, one
  descriptor on a frame's first bytes (SCM_RIGHTS, MSG_CTRUNC breaks the
  rules), wire types for every secret (redact.Secret at once).
- broker.go: newBroker, the start (handshake: version 1 and each side's
  executable's SHA-256, within 4 s), the answers (value through lookups,
  kept 30 s or 5 min, a failure 5 s, dropped when the bindings change;
  file by number; link connected by the broker and passed as a
  descriptor; token exchanged by the broker), each by something in its
  own config, with caps 1/8/4/256; live: the lifeline closes the socket
  and kills the child 6 s later, SIGTERM stops it within a second, a
  child that ends ends the broker, a rule broken stops the child.
- child.go: the start (startOf), the child's server (newChildServer),
  the broker as hostSide over the socket (brokerClient), runChildOn;
  ready only after it reads the host's addresses (kept: the last good
  read), roots and time zone loaded first.
- process.go: Main(ctx, ...) and ChildMain; the child spawned with
  /proc/self/exe on Linux, PR_SET_PDEATHSIG from a locked thread
  (daemon.Cmd.DieWithThread), descriptors 3 and 4, and TZ, SSL_CERT_*
  and GODEBUG with updatemaxprocs=0 alone; run/proxy-child.pid and
  run/proxy.confined ("none" until the follow-ups); KeepLogs in the
  broker. ChildMain refuses to start unless descriptors 3 and 4 are a
  unix socket and an IP one (checkInherited): run by hand, without
  them, those numbers can be the Go runtime's own, which closing
  crashed it (signal_recv: inconsistent state).
- capture.go: a captured token request goes to the broker
  (captureToken, exchanger), so a login's real tokens never enter the
  child; an error reply passes up to 1 MiB, longer gets 502.
- watched.go: the child stats each changing file and asks the broker
  for it once it changed, keeping the stamp of what the broker read.
- rotate.go: proxy.log rotated by both through its descriptor, under a
  lock of a description of its own; OpenLog opens a log never through a
  link, one link, yours, replacing what a child left in its place.
- nixcache.go: the trim and its count through a safefile.Root, nar/
  only as a folder, links deleted as themselves; reads never through a
  link; the lock tried for 5 s (ErrNixLocked, nix_cache_locked).
- daemon: Cmd.Err, Files, Env, DieWithThread; Handle.Kill, Exit;
  WritePID.
- netpolicy: Proxy.Stop also stops a child that outlived its broker
  (run/proxy-child.pid, _proxy-child -for); proxy.log opened with
  OpenLog; a refused launch keeps a running VM only while both run.
  devvm network log and lock read the event log through safefile.
- vm, vmssh, vmlog: links.log and ports.log opened with OpenLog, read
  through safefile, trimmed only as a regular file with one link.
- backend: the build proxy's logs in a logs/ folder of their own.
- cli: _proxy-child; _proxy waits for its child on a signal
  (StopsItsOwn); the child reads none of devvm's folders (no
  makePrivate); ui.Files.
- Tests: FuzzBrokerFrames, the frames' rules, the handshake and the
  pair's end in synctest bubbles, the caps, the broker naming its own
  alone, the client over a real socketpair with a passed descriptor,
  ChildMain, TestInheritedSocket and proxy.txtar's child run by hand,
  the frozen 0.1.0 configs starting a broker and child,
  two writers rotating once, planted links, FIFOs and hard links; the
  testscript runner stops _proxy-child too; e2e: broker and child, their
  arguments, descriptors and environment, stop, SIGKILL either, planted
  files in the logs folder and the Nix cache, build proxies gone.
- Review fixes: the lifeline closes the socket and starts the kill's
  timer before logging; every log lock (proxy.log's, the event log's
  rotation) is tried without blocking for 200 ms (flockWithin, which the
  Nix lock shares), then written without or the rotation skipped; a
  copied log's rotation streams at most twice its limit from a line's
  start (copyFrom, copyAtomic); a reply too long to send goes as
  too_long; kept token headers capped at 1 KiB; the child gives up on a
  request whose context ended, dropping its late reply and holding its
  slot until then; a write deadline on the start frame; errors reach the
  child as codes (not_found, refused, busy, too_long, failed), their
  text in the broker's log; FuzzFrameStreams, and FuzzBrokerFrames
  writes from a goroutine; nix_cache_locked links to How it works.
- Docs: processes, network, overview, design (with threat rows for the
  logs' locks and a log made huge), troubleshooting, the proxy's
  README, structure, testing; CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 9c74dac11e fix(logs): a VM's logs are held to their caps while it runs
internal/vmlog owns every log a VM can drive but the proxy's own:
Limit (moved from vmssh's logLimit, with Allow for the link session's
warnings), Capped and Trim for ports.log and links.log while they run,
and KeepVM, which the VM's proxy (proxy.IO.KeepLogs, Config.VMLogs from
backend.Run.Logs) and a Lima build run on the serial consoles' and the
hostagent's logs: redacted as they grow (redact.FileFrom), so a reboot
in place can't leave the proxy password there, and rotated past 10 MiB,
counting what a log holds past the hole its writer left
(platform.DataStart).

The proxy's http.Server logs through its own limited log, and its
copied log counts what reached it as stderr; the build proxy's log is
held as a VM's proxy's is. git-pins.jsonl has a cap. Run logs take at
most 256 MiB together, never the newest or a live run's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 4a4aabe9a8 fix(netpolicy): a refused launch leaves a running VM and its proxy as they were
With config.toml's proxy naming a user and no proxy secret saved, devvm in
a running VM's folder refused (proxy_password_missing) but stopped the VM
(net_proxy_down_stopped), and devvm restart stopped it before refusing.
Every check that can refuse a proxy start already ran before Prepare
stopped the old proxy; runningConfinement stopped the VM on any error.

- netpolicy.Proxy.PrepareRunning: Prepare for a running VM. A refusal
  before its proxy is touched keeps the VM and proxy (net_proxy_kept, a
  new message) only while that proxy enforces the state's tier now
  (enforcesNow: built-in, files, denies, open, devvm binary); otherwise,
  or once its proxy was stopped or started, or with none running, the VM
  is stopped (unproxied, was Unproxied, which now stops a proxy left
  running too).
- netpolicy.Proxy.Refusal (shared): the user's CAs and the company proxy,
  checked first in prepare, before a VM is made (up), before a running VM
  is stopped to start again (target.stopToStart: devvm restart,
  restartForNextStart), and before a running VM's tier changes between
  confined tiers (checkTier: devvm network, lock), so its state never
  names a tier its proxy doesn't enforce.
- devvm network's change to a running VM's rules goes through
  PrepareRunning, so a proxy that can't start again stops the VM rather
  than leaving it running without one.
- Proxy.Upstream removed (no callers); shared, prepare, unproxied and
  tierNow are functions of the proxy, keeping Proxy within 24 methods.

Tests: company_proxy.txtar (launch and restart refused, VM and proxy
untouched; devvm network allowlist refused, tier unchanged),
TestPrepareRunningRefused (eight rows), e2e corpConfig checks the VM's
status after the refused launch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:32 -07:00
w3cjandClaude Opus 5.5 90a64a44d1 fix(races): lock order checked, sandboxes' own ports, pins that meet a rename, daemons' groups stopped
- state: test builds and tests check the state locks' order (state.held, CheckLockOrder): a second VM's lock, a VM's lock under the claims lock, or a lock taken again panics before waiting.
- platform: PinBeneath opens the path again when a rename takes the file away before move_mount (ENOENT), so the keeper no longer reports a false lost pin (TestPinsInNamespace's 'f lost / f pinned-again'); TestPinWhileRenamed.
- daemon: Proc.Stop signals the process group (SignalGroup), so forwarders' and link sessions' ssh masters and relays end with them; ui.UI.StopsItsOwn makes _ports and _links wait for their ssh on an outside SIGTERM.
- vm: gc --orphans and devvm space count forwarders' leftover control sockets (vmssh.ControlGlob).
- CLI tests: each sandbox claims a block of ports below devvm's range and the ephemeral range (claimPortBlock, /tmp/devvm-test-ports); free_port, the fixtures' ports and DEVVM_SSH_PORTS come from it, and the sandbox's devvm chooses from its own range (DEVVM_PORT_RANGE override). Fixtures' forwarded ports and settings ports are rewritten too (FIXTURE_PORT_<port>).
- netpolicy and vm tests: the fake proxy's stop waits for its reap, and fake daemons run until the test ends, not 30 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:31 -07:00
w3cjandClaude Opus 5.5 11ccecca15 docs(design): the proxy's broker, a design note for splitting devvm _proxy
The design note for splitting the VM's proxy into an unconfined broker
and a network-facing child that can be confined: what runs where and
why, the files and sockets each side needs, the protocol (a socketpair,
framed JSON with caps, versioned, failing closed, naming nothing but the
broker's own VM's), the token exchange in the broker, the Secret type on
the socket, the start, the end and how tests find each process, the
build proxy, upgrades and the frozen configs, what Landlock and Seatbelt
will confine in the child, performance, the options weighed and the
threat check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:31 -07:00
w3cjandClaude Opus 5.5 a7cc12521e test(fuzz): fuzz targets with properties, fuzzed nightly
Twenty-three new fuzz targets, built-in Go fuzzing, each checking a
property rather than only that nothing panics: parsers of what a VM or
the network sends fail closed and keep to their caps, a secret goes only
where it's bound, and no planted secret survives a redaction.

- internal/proxy: FuzzCursorFrames (passes only what came; no message
  over frameMax or holding a JWT's start, decompressed and unescaped),
  FuzzInject (a binding's value only to a host it names, judged apart
  from the matcher in NormHost's form, for its path and methods, in its
  own header, which held the exact placeholder once; other headers
  untouched), FuzzParseBindings, FuzzLinkList, FuzzParseUpstream (errors
  hold no more of the URL than its scheme), FuzzNoProxy, FuzzParseNarinfo
  (only cache.nixos.org-1's signed narinfo is taken).
- internal/agentlogin: FuzzParseTokenRequest, FuzzRedact (secrets planted
  eight ways in JSON and TOML settings), FuzzCapture (the VM's reply holds
  none of the endpoint's tokens).
- internal/redact: FuzzSplit (a password written in parts through Split,
  as the run log writes it, never survives).
- internal/jsonc: FuzzStrip, differential against encoding/json.
- internal/upgrade: FuzzParsePublicKey, FuzzVerify, FuzzEntryName,
  FuzzUnpack.
- internal/vmssh: FuzzParseHostKeys, FuzzParsePorts.
- internal/vm: FuzzParseCloneState, FuzzParseInit, FuzzParseKept,
  FuzzParseLFSPointer.
- internal/desktop: FuzzHandshakeVM.

What they found, each fixed with a regression test:
- NO_PROXY: an entry with port 0 (git.test:0) was read as the host on
  every port, and git.test:080 or :+80 as port 80, which Go's clients
  match against nothing; an entry whose port no request has, or that
  isn't plain decimal, now matches nothing (TestNoProxy,
  testdata/fuzz/FuzzNoProxy). FuzzHostSites' NO_PROXY site allows this
  difference from its frozen copy, and the design note lists it.
- A JSON token request with more after its object was judged by its
  first object; it's refused now (TestCaptureRefuses).

The Fuzz workflow runs nightly rather than two minutes weekly: five
minutes a target, eight at a time, each target's corpus restored from
and saved to a cache of its own (a failing input added to it, so it
fails nightly until fixed), new inputs minimized in at most 1,000 runs,
and one issue, "Fuzzing found failing inputs", opened, commented on when
the failing targets change and closed on a clean night, by a separate
job with issues: write that runs no repo code, on main alone. Target
names must be unique across packages. bump.sh moves an action in a
folder of its repo (actions/cache/restore, /save) with its repo's
releases.

Docs: Contributing's Fuzzing (running a target, the nightly run, every
target's property), Maintaining's Fuzzing failures and its actions bump,
the proxy README, the NO_PROXY and token request facts in How it works'
network page and the design note.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:31 -07:00
w3cjandClaude Opus 5.5 19f9900b86 fix(sshagent): a VM reaches its SSH agent only through its proxy's relay
OpenSSH's ssh-agent answers every request a forwarded connection sends,
so a VM that forwarded your agent or devvm's own (shared by every VM
that uses it) could remove all its keys (ssh-add -D), lock it with a
password of its own (ssh-add -x) or add keys without bound, denying the
agent to you and to the other VMs. Checked with a throwaway sshd and
ssh-agent: all three succeed over ssh -A.

Each VM's proxy now relays the agent its start chose on a socket of the
VM's own (paths.Dirs.AgentRelay, run/agent-<hash>.sock, mode 600), and
the VM's backend, devvm's own connections and the ssh entries for
editors name that socket. The relay passes on only
SSH_AGENTC_REQUEST_IDENTITIES, SSH_AGENTC_SIGN_REQUEST and the
[email protected] extension (so destination-constrained keys keep
their constraints), answers everything else with SSH_AGENT_FAILURE,
reads messages whole up to OpenSSH's 256 KiB, carries at most 16
connections and closes one idle for 2 minutes. A filtering relay rather
than an agent per VM: it covers your own agent too, needs no copy of a
key or a passphrase per VM, and fronts hardware and app-held keys.

- proxy: Config.Agent/AgentSocket (checked together, absolute), the
  relay in agent.go, listened before the proxy says it's ready; its
  accept loop backs off after an error that leaves the listener open
  (EMFILE), 5 ms doubling to 1 s, logging the first.
- daemon: AcceptRetry, vmssh's acceptRetry moved to the stdlib-only
  package the proxy already imports, so the relay, the port forwarder,
  the link session and a login's forward share one owner.
- netpolicy: Prepare takes a start's agent; a running VM's proxy keeps
  its start's agent from proxy.json (relayedAgent); Stop deletes the
  relay's socket.
- structure: paths.Dirs may have 62 methods (AgentRelay); the relay's
  goroutines in goroutineSites.
- sshagent: Made.Relayed, which RecordStart sets on every start of this
  devvm's whose choice forwards an agent, one without SSH_AUTH_SOCK
  included, and ReachOf(st,
  start): a relayed start gets the relay (or none while it's down), a
  start devvm didn't record (one outside devvm) gets none, or its
  proxy's relay, and only an older devvm's recorded start keeps the raw
  agent until its next start (runningConfinement, finder.inspect,
  sshconfig).
- vm: LeftoverSockets also finds a killed proxy's relay socket for
  devvm gc --orphans and devvm space.
- Tests: relay filter, wiring through Main, bounds and idle close, real
  ssh-agent/ssh-add/ssh-keygen through the relay, Prepare's relay,
  RecordStart/Relayed, sshconfig entries, vm agent tests, ssh_agent.txtar,
  an outside start in ssh_agent.txtar, and e2e checks that the VM can't
  remove, lock or add to your agent, nor the VM or an editor's
  connection remove devvm's agent's keys.
- Docs: processes (the SSH agents, listeners), ssh, attack-vectors,
  security, design, lima, overview, space, structure, proxy README,
  AGENTS.md, CHANGELOG Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:31 -07:00
w3cjandClaude Opus 5.5 f37c70a5cd fix(bounds): bound what a VM can make the host hold
Five bounds, each with a test that failed first. Long downloads,
WebSockets, slow streams and SSE are never cut: every bound is on what a
connection holds, never on how long it lasts.

- _qemu connect (Linux): each guest connection to the proxy was a host
  process with no cap. Connect now takes one of connectMax (256) slots,
  lock files in the VM's run/proxy.slots (paths.VM.Proxy(".slots")),
  each process about 7.7 MB, so about 2 GB per hostile VM. A connection
  past them gets an HTTP 503 (connectsFullReply) and closes before it
  dials; QEMU's stderr says qemu_connects_full at most once a minute,
  decided under full.lock so refusals at once say it once. A VM started
  before keeps the two-argument form, unbounded until its next start.
  No idle timeout or byte bound: the proxy bounds what each carries.
  TestConnectSlots.
- The VM proxy (limits.go):
  - maxConns (2048, twice maxConnects so a CONNECT still gets its 503
    first) counts a connection from its first request with the VM's
    password (conns.admit, via httpServer's ConnContext); a request past
    it gets 503 and the connection closes. Connections without the
    password wait in a pool of maxWaiting (128) where a new one closes
    the oldest, so holding connections can't take a VM's room (a host-speed flood still slows it
    through the accept queue: listed in design.md).
  - maxRequests (2048) requests upstream at once, plain HTTP's and
    intercepted tunnels' (requests.take), 503 past it: per-tunnel
    HTTP/2 streams alone allowed ~100,000 upstream connections.
  - each limit logs once a minute at most (everyMinute).
  - httpServer adds IdleTimeout (10 min); a 407 closes its connection;
    handleHTTP's WithoutCancel is replaced by whileHeard, which ends a
    plain HTTP request once its client has stopped sending and goneWait
    (1 min) passes with nothing written, so half-closing clients still
    get answers that keep coming; quiet WebSockets aren't cut.
  - heardWriter.Unwrap: plain ws:// upgrades got 502 (pre-existing) and
    get 101.
  - No ResponseHeaderTimeout: non-streaming LLM requests wait minutes
    for headers, and a waiting client is counted.
  Tests: TestProxyLimitsSet, TestProxyConnectionBounds,
  TestProxyConnectionLimit, TestProxyWaitingConnections,
  TestUpstreamRequestLimit, TestUpstreamRequestLimitIntercepted,
  TestPlainWebSocket,
  TestPlainHTTPEndsWithClient.
- serveOne (intercepted tunnels, transparent HTTP, the 403 page) takes
  maxHeaderBytes (64 KiB) always, not 1 MiB, and HTTP/2
  MaxConcurrentStreams streamsMax (100, not 250). TestServeOneHeaderLimit,
  TestServeOneStreamsLimit.
- Accept loops (forwarder, link session, login forward) retried nothing
  or at a fixed 100 ms: vmssh.acceptRetry backs off from 5 ms to 1 s and
  logs the first error of a run, ending only when the listener closes or
  ctx ends. TestAcceptRetry, TestForwarderAcceptRetries,
  TestLinksAcceptRetries.
- The login callback (LoopbackForward) carries at most
  loopbackConnsMax (16) connections, an ssh each.
  TestForwardLoopbackLimit.

Docs: processes, network, ports, lima, design (threat rows),
attack-vectors, the proxy README, CHANGELOG Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:31 -07:00
w3cjandClaude Opus 5.5 c872cfe66c fix(proxy): look names up absolute, so the host's DNS search domain never applies
The proxy looked up the checked name without a trailing dot, so the host's
resolver added its search domain: with api.corp.example denied and ** allowing
the rest, CONNECT api:443 (or api.eu, once api.eu itself had no address)
reached api.corp.example. Validated on macOS (a CGO_ENABLED=0 darwin build
resolves through libSystem's getaddrinfo, which applies scutil's search domain)
and on Linux (Go's resolver applies resolv.conf's search, single- and
multi-label names, at ndots 1 and 5). egress.lookupName now asks for host+".",
for direct connections and the company proxy's floor alike.

A block because an allowed name didn't resolve is now Refused: a rule allows
the name already, so its 403, /blocked/new and devvm network log --blocked
suggest no devvm network allow command. A name without a dot that has no
address gets reasonShortName, which says to use the full name.

Tests: TestLookupIgnoresSearchDomain, with a resolver that has a search domain;
TestShortNameBlock; TestUnresolvedReason checks Refused and the short name.
Docs: safety/network (inside the VM, the refused field), internals/network
(the proxy, the reasons), internals/design (a company proxy and its own search
domain, links' short names), using/troubleshooting (a name that doesn't
resolve); CHANGELOG Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 22:04:31 -07:00
w3cjandClaude Opus 5.5 3168eb04ad test(e2e): a company proxy in config.toml, its password the proxy secret
The network section's company proxy came only from the shell's
HTTPS_PROXY. Now config.toml's [proxy] names it with its user alone and
the shell sets none: the launch is refused (proxy_password_missing) until
devvm secret set proxy --stdin saves the password, in the run's own
secret store; then the VM's proxy config names the secret and holds no
password, and the company proxy, which refuses requests without it,
carries github.com. Its password is in no process's arguments, log,
proxy config or guest after.

netNoLeaks looks for every company proxy's password the section used,
netCorp's and netOpen's, as it is, as user:password, as Basic's base64
and as the whole Proxy-Authorization value, and for each VM's proxy
password as it is and in Basic's base64, in devvm's logs, the VMs'
proxies' logs and Lima's. corpThrough matches only the events after its
launch, so an earlier launch's tunnel can't pass it (eventsFrom), and
corpNoLeak is shared by both launches.

netSetup deletes the section's secrets at its start as well as its end,
so a proxy secret a killed run left can't let the refused launch go
ahead, and it links the section's HOME to the Keychains folder on macOS
from the start, as devvm secret set proxy is now its first Keychain
write (netClaudeLogins made the link before).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:36:41 -07:00
w3cjandClaude Opus 5.5 1b8fd8a639 test(lifecycles): synctest bubbles for the relays, the forwarder, the links, the proxy and the daemon's stop
Timeouts, graces and closes are tested in testing/synctest bubbles on the
bubble's fake clock, to the moment, instead of sleeping and polling on the
real one, with stand-ins in memory behind seams that are fields. Each kind
keeps one real-process test. No behaviour change: each seam's production
value is what the code did before.

Seams:
- vmssh: sshRelay{grace, start} carries a relay (pipeSSH's body, as
  pipeSSHFor was); start is execSSH in production.
- vmssh: Links.Listen (listenSocket unless set), for the links' sockets.
- proxy: egress.connect, the dialer for allowed far ends (a net.Dialer
  with its 15 s timeout, set in newServer).
- daemon: Proc.Alive (Alive unless set).
- proxy: httpServer, the proxy's http.Server as run serves it, which the
  tests' memServe shares.

New test-only package internal/memnet (standard library only): Pipe, whose
connections half-close, buffer 64 KiB and have deadlines, and Network,
listeners by address with Listen, Dial, DialContext and SetDeadline. The
structure test keeps it for tests and a leaf, depguard keeps it standard
library only, and its AfterFuncs are in goroutineSites.

Bubble tests:
- relay: TestRelayGrace (silent and talking, closed and half closed),
  TestRelayGraceSlowClient, TestRelayGraceWriteError,
  TestRelayCancelEndsBlockedWrite, TestGraceTimer (exact grace).
- forwarder: TestForwarder, TestForwarderAliveOnEnd, TestForwarderOnly,
  TestForwarderGap (reports exactly Gap apart), TestForwarderGivesUpSilently,
  TestForwarderClosesConnections (now also its stuck relay's ssh and slot).
- links: TestLinks, TestLinksSessionLost, TestLinksCap,
  TestLinksEndStuckRelays (memSSH; relays end at the next sync on removal,
  master replacement and target change), TestLinksList.
- proxy: TestTunnelHelloDeadline (EOF at exactly helloTimeout),
  TestTunnelHelloStall (and a hello whole a moment before the deadline),
  TestTunnelAddressSplitHello, TestConnectLimit, TestCloseConns,
  TestCloseConnsWaitsBounded (close gives up at exactly closeWait),
  TestSpliceEnds, TestSpliceEndsWhenItsClientCloses.
- secrets: TestSecretLookupFailuresNeverCached (hung lookups cut at
  lookupTimeout, cancelled, failed and empty ones never cached; a request's
  end doesn't cancel a lookup; the TTL to the moment).
- daemon: TestProcStopWaitsForTheEnd, TestProcStopKillsOnlyItsOwn,
  TestProcStopKillsAfterWait (fakeProc), TestFollowLifeline.
- TestCursorReplyScans uses httptest.NewTestServer.

Kept on real processes and the real clock: TestPipeSSHGrace,
TestPipeSSHGraceSlowClient, TestPipeSSHGraceWriteError,
TestForwarderEndsStuckRelay, TestLinksBurst, TestSpliceKeepsAnEarlyAnswer,
TestProcStop.

Docs: Contributing's Tests has Time and lifecycles; structure.md, _index.md
and AGENTS.md name memnet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:36:41 -07:00
w3cjandClaude Opus 5.5 4d409589bb refactor(redact): every secret's value is a redact.Secret, revealed only where it's used
redact.Secret holds a value that lets whoever has it act as the user or
a VM, behind a pointer, so fmt's raw printing of an unexported field
shows only an address. String, GoString and Format print <redacted> for
every verb; MarshalJSON, UnmarshalJSON and MarshalText return
redact.ErrEncode, so a secret is never silently written as a stand-in
(which would lose a login); there's no LogValue. NewSecret ("" is the
zero Secret), Reveal, Empty and TrimSpace are the rest. internal/redact
joins the proxy's standard-library-only depguard group.

Reveal is refused by forbidigo outside tests; each of the 23 call sites
carries a //nolint:forbidigo saying why, and testdata/lint/forbidigo.go
keeps a call the rule must report. The structure test (checkSecrets)
refuses a struct that embeds redact.Secret outside internal/redact and
an interface that declares Reveal() string.

Typed now: proxy.Config.Password (configFile is the wire type, in
Config's order, held to it by TestConfigFile), the server's password,
proxy.Lookup and the cached values, upstream.auth, upstreamPassword,
Upstream.WithPassword's password; backend.NewProxyPassword, ProxyURL,
Confinement.ProxyPassword, BuildProxy.Password; netpolicy.Key and
NetMade.ProxyKey (netMade wire type); settings.CompanyProxy.Password;
secrets.Store.Value, saved, ProxyPassword, Token, Save, save, Get,
SaveKey, Yours.Save, Claude.Env, saveToken, oauthToken; agentlogin
File.Get, SetKey, ClaudeToken, every format's get, setKey and chatGPT,
refresh's refresh token, capture's access, refresh and id tokens, and
the JWT helpers (a login's map stays the wire, through token and
setToken; piKey is piBound); vm.Net.SecretSave, AgentLoginOptions.Key;
ui.UI.Secret. Strings by design: platform.KeychainGet/Set and the
desktop's VNC password.

Tests: TestSecret (unexported and nested fields too), TestConfigFile,
TestV010ProxyConfigs (0.1.0's proxy.json round-trips byte for byte),
TestFixtureStoreGet saves the Linux secret file back byte for byte,
checkV010Logins (login files read, copied and bound without a change),
secretCases, and e2e netNoLeaks, twice in the network section: every
VM's proxy password and the section's values, also as Basic
credentials, in no run log or proxy log, and the passwords in no
ha.stderr.log or serial log. Docs: Contributing's Secrets in the code,
the owners table, the secrets How it works page, design.md's Where
secret values live.

Fixed, found by netNoLeaks: Lima's boot script 07-etc-environment.sh
runs under set -x, so the console logs (serial*.log) kept the VM's
proxy password; redactLog now stars passwords in them as it does in
ha.stderr.log (CHANGELOG, overview, processes and attack-vectors pages).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:36:31 -07:00
w3cjandClaude Opus 5.5 e4ea123927 feat(ports): VMs' ssh on ports browsers refuse
Lima listens on a VM's ssh port on this machine's loopback, and root in
the VM can make what answers on port 22 speak HTTP, so a page opened as
http://localhost:PORT reached a server the VM controls with the cookies
of every app on localhost, even in a VM that forwards no ports.

- Every VM's ssh port, and every build VM's, is one of the 17 ports
  every browser engine refuses (ports.SSHPorts): the Fetch standard's
  bad ports from 1024 up that Chromium's kRestrictedPorts blocks too,
  which leaves out 4190 and 6679 (headless Chrome 157 loads both). The
  one allocator chooses it (Allocator.SSH and Build, through freeSSH). A
  stopped VM keeps its port while it's on the list, free, not listed to
  forward and not held by another start or build; else it gets one no
  state records, or else a stopped VM's, which that VM gives up at its
  own next start. Another VM's listed ports are avoided only while that
  VM runs or starts.
- The proxy and desktop ports never take one (free); one an older devvm
  chose moves at the VM's next start (Choose's keep path, proxyPort,
  the desktop's listener; Allocator.SSHOnly).
- A forwarder never takes one unless its VM lists it (ports.Reserved),
  so a guest forwarding every port can't fill them; devvm ports and each
  launch warn when a VM's list names one, whatever set it (--ports, a
  devcontainer.json, config.toml's ports) (ports_ssh_listed,
  ports.SSHListed).
- A start holds its port, kept or new, for a minute in the VM's own
  run/ports.ssh-hold (paths.VM.Forwarder; hold, held, projectHold),
  which other starts and builds avoid, so none takes it before Lima
  binds it; it goes with the VM's folder.
- A build takes its clone's own port (was) only when no other is free.
- Past 17: ports_ssh_limit names the VMs whose recorded ports are in
  use ("a or b" for a port two states record) with how many are taken
  otherwise, ports_ssh_limit_all when they have them all, and
  ports_ssh_limit_others when none of your VMs has one.
- Older devvm's ports move at the VM's next start, in startSets' one
  limactl edit, and the start pins the new host keys (pinHostKeys); a
  running VM keeps its port until then, and each launch warns of
  running VMs still on an off-list port (ports_ssh_old,
  Allocator.OffList, confirmed with the backend's Running).
- A test build's own list (DEVVM_SSH_PORTS, registry.Overrides.SSHPorts,
  the Allocator's and the Proxy's SSHList field), read only by
  readOverrides in a test build: each CLI test sandbox gets as many
  ports of its own from below the ephemeral range (sandboxPorts).

Frozen 0.1.0 fixture: each launch now makes exactly one limactl edit, of
.ssh.localPort alone, onto the sandbox's list, and vm.json changes only
in .ports.host.ssh (and the start it records); the fixture's data is
untouched.

Messages: ports_ssh_limit, ports_ssh_limit_all, ports_ssh_limit_others,
ports_ssh_listed, ports_ssh_old.
Tests: TestSSHPorts (Fetch's list less Chromium's gaps, SSHListed,
SSHOnly), TestSSH, TestSSHHolds, TestSSHListed, TestOffList, TestBuild,
TestReserved, TestForwardsHeld's reserved counts, TestStartBuildSSHPort,
TestPrepareRestartsTheProxy, TestDesktopListener, TestOverrides
(DEVVM_SSH_PORTS), ssh_ports.txtar, fixture_v010.txtar, layout.txtar;
e2e project: the ssh port, first and after a move, is one browsers
refuse.
Docs: internals/lima (the ssh bullet, the hold's limit), processes
(listener table), design (threat check), ports, overview,
contributing/structure and testing (DEVVM_SSH_PORTS), using/ports-size,
troubleshooting (Too many VMs at once), safety/attack-vectors (allowed
ports, port squatting), CHANGELOG Breaking (17 VMs; forwarding every
port leaves the 17 out) and After you upgrade.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:36:31 -07:00
w3cjandClaude Opus 5.5 cc94465400 test(leaktest): goroutine leak checks, and the leaks they found
A new internal/leaktest, standard library only, so the proxy's and the
daemon's tests use it too (depguard's proxy rule allows it, and the
structure test holds it to tests and to importing nothing of devvm's):

- leaktest.Main(m), in TestMain: once the tests pass, every goroutine's
  stack (runtime.Stack), a settle of 5 s, then a failure naming those
  still running, but the standard library's own that outlive every test
  (allowed: signal.Notify's loop, an HTTP client's idle connections);
  then Go 1.27's goroutineleak profile, which fails on any goroutine
  blocked for good.
- leaktest.Check(t), first in a test: its own goroutines, followed by
  parent through those still running, and by which ran before it, never
  by ID (each thread takes a batch of IDs).

Main runs in proxy, vmssh, daemon, desktop, ui, vm, backend/lima,
platform, cli and gitprotect (main_test.go, or the TestMain they had).
Check runs in TestLinksEndStuckRelays (replacing its NumGoroutine
count), TestForwarder, the desktop relay's serve helper, TestRunChild,
TestPinWaits, and the proxy's new close tests.

The structure test's goroutines rule (internal/structure/goroutines_test.go):
goroutineSites lists every function outside tests that starts a
goroutine, with a go statement, a wait group's Go, or time's or
context's AfterFunc, function literals in package-level vars included,
as "file: Func", with its waiter, or "detached: " and why nothing waits.
A new one fails until listed, a listed one that starts none fails, and
a package that starts one fails until its tests call leaktest.Main.

Leaks it found, each fixed with a test:

- The proxy's close left its connections running: http.Server's Close
  neither closes a connection a handler took (a CONNECT's tunnel, a
  WebSocket upgrade ReverseProxy takes) nor waits for a handler. conns
  (conns.go) holds every connection the listener accepted (track) and
  counts every handler (handle); serve calls closeConns once Serve
  returns, which closes them, closes any accepted after, and waits up
  to 5 s for the handlers. splice also ends when its client's
  connection can't be read (closed, reset), rather than half-closing
  the far end and waiting on it; a failed write to the server (one that
  answered early and closed) still lets its answer through. Tests:
  TestCloseConns (a tunnel and an upgrade), TestConnectAfterClose,
  TestSpliceEndsWhenItsClientCloses, TestSpliceKeepsAnEarlyAnswer; the
  tests' listen closes as the proxy does, and the fake upstream closes
  its target once its client's end comes.
- platform's runChild left its signal-passing goroutine blocked on a
  channel signal.Stop never closes; it now closes it and waits
  (TestRunChild).
- platform's WaitExit and WatchFolders blocked in poll(2) and read(2),
  which closing their fd from the stop doesn't wake on every kernel
  (Debian's didn't), and a retried call could land on a reused fd. They
  now wait in Go's poller (pollable), which the stop wakes (TestPinWaits,
  with a wait stopped before its process ends).

Docs: Contributing's tests page (Goroutine leaks), the structure page
(the goroutines rule, goroutineSites, the layers, the packages), the Go
lint rules' depguard line, the proxy's shutdown in How it works'
processes page and the proxy's README, and AGENTS.md. Coverage
baselines: internal/leaktest's line on both systems, netpolicy's raise
on macOS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:36:28 -07:00
w3cjandClaude Opus 5.5 4e925492ca fix(proxy): every host is read in one form, proxy.NormHost, guarded by the structure test
Every check that judges or compares a host now reads it through
proxy.NormHost (internal/proxy/host.go), which also holds HostOK,
splitHostPort, hostASCII and asciiEqualFold: a host of printable ASCII is
lowercased in ASCII alone and loses its one trailing dot; any other host
stays as it is, so HostOK refuses it and no Unicode fold makes another
name match. A host with two trailing dots or more, or a dot after a
closing bracket, keeps them, so NormHost is idempotent and reading a host
twice can't turn evil.test.. into evil.test. A proxy.Host is what the
matchers take (rule.matchHost, noProxyRule.matches, local, sniMatches).

Brackets are strict (hostAddr): HostOK, Host.Addr and splitHostPort take
an address bare or an IPv6 address in one pair of brackets, never a stray
bracket ([[::1]], 1.2.3.4]) or brackets around a name or an IPv4 address
([evil.com]:443, [1.2.3.4]:443), which get 400.

Migrated: splitHostPort, sniMatches, sniHost, parseHostRule, the
policy's rulesFor, quiet, byName and coversOn, secrets.forHost,
parseNoProxy, route and local in internal/proxy; netpolicy.RiskOf,
Tickable and sameRule (devvm network rm and the duplicate check, so a
Kelvin sign never names the rule with a k); secrets.CheckHost;
from.publicHost (a name HostOK refuses isn't public);
agentlogin.claudeHost; vm.urlHostPort and privateHost. vm.urlHost
(cloneseed.go) keeps its own reading: it's a remote's ssh host, which ssh
lowercases and keeps the trailing dot of, to find a VM's alias.

Differential fuzz targets keep a frozen copy of each reader as it was and
allow only the decided differences: FuzzHostSites (proxy), FuzzRiskSites,
FuzzCheckHostSite, FuzzPublicHostSite, FuzzClaudeHostSite and
FuzzPromisorHostSite. A rule line is the same rule or no rule exactly as
before, so a broken deny stays a broken deny. TestFixtureHosts reads the
frozen v0.1.0 state's secrets.policy, secrets.json and links.json hosts
and finds them unchanged.

The structure test's new hosts check refuses, outside host.go and tests:
Trim, TrimLeft or TrimRight with a cutset holding ".", TrimSuffix or
CutSuffix with "."; ToLower, ToUpper, EqualFold and the TrimFunc family on
an argument named for a host; and a conversion to proxy.Host of anything
but a literal. Exceptions are by file and function, each with why
(request.go:trimDots, cloneseed.go:urlHost, cloneworktree.go:safeIndexPath,
cloneconfig.go:transportHelper, lima/start.go:machines.fillPassword). It
doesn't see slicing, strings.Map or variables not named for a host. The
owners doc, the proxy README, structure.md, design.md (One form of a
host), network.md and safety/network.md say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:36:28 -07:00
w3cjandClaude Opus 5.5 89f26c5771 docs(site): draw the diagrams at build time with pele, no Mermaid JS
The docs site's 18 mermaid blocks are now drawn as SVGs before Hugo
builds the site, by docs/render-diagrams.mjs with pele 1.13.0, and
inlined by a render hook, so no page loads Mermaid's 5.5 MB script.

- docs/render-diagrams.mjs: finds each mermaid block in docs/content,
  draws it with pele in Departure Mono at 14px (a measurer from the
  font's metrics), and writes <key>.svg and <key>.json (its size) to
  the git-ignored docs/.build/diagrams. pele draws edge labels,
  messages and notes at round(14 * 0.875) = 12px with no option, so the
  measurer gives that text its 14px width and the script rewrites
  font-size="12" to 14 on each small-text group (pele-edge-labels,
  -notes, -boxes, -frames); a guard fails on any such group without
  font-size="12", or small text outside them, and a self-check, run
  whenever there's something to draw, renders an edge label, a message
  and a note and fails unless pele measured them at 12 and wrote their
  group with font-size="12". It also fails on a diagram without
  accTitle and accDescr, or on an indented block. A newline after each
  </text>, outside any text element, lets the search index see labels
  as separate words; screenshots of all 18 are byte-identical with and
  without it. (Newlines between a label's tspans would move centered
  lines, so a label's own lines stay joined in the index.)
- Caching: a block's key is sha256(salt + "\n" + text)[:16], the salt
  being sha256("pele <version>\n" + the script's text)[:16], written to
  diagrams/salt. The script keeps every drawing already there, draws
  only missing ones (written to .tmp and renamed), prunes files no key
  names, and touches the folder. docs:diagrams has sources (the pages,
  the script, package.json, the lock) and outputs (the folder), so mise
  skips an unchanged run, and runs npm ci only when the lock's SHA-256
  differs from docs/node_modules/.devvm-lock-sha256. An unchanged run:
  0.45-0.75 s before, 0.02 s now (0.09 s forced); one diagram changed:
  0.09 s. CI's check job caches ~/.npm keyed on the lock; the Docs
  workflow, which publishes, keeps no cache.
- docs/package.json and package-lock.json pin pele 1.13.0
  (sha512-Ie8UKY9x00MsuR3jO6AzUwzK2Z6MIV3Tf4EDdITiuk8Uaz8K7g0R082WqsqNaSU8DdgkrRvZThzhit83mi/uiw==).
- docs/layouts/_markup/render-codeblock-mermaid.html: in place of
  Hextra's hook, reads the salt, computes the key from it and .Inner,
  inlines the SVG from assets/diagrams (hugo.yaml mounts .build/diagrams
  there), sets the wrapper's contain-intrinsic-block-size to the
  diagram's height and --devvm-diagram-width to its width, and errorf's
  when a drawing or the salt is missing. layouts/_partials/scripts/
  mermaid.html and params.mermaid go.
- custom.css: .devvm-diagram with content-visibility: auto, and pele's
  --pele-* variables from the palette (subgraphs, lifelines and notes in
  the border color). A diagram wider than the text reaches into the
  article's right padding (1.5rem, 3rem from 768px) as far as it needs,
  then into the left padding for the rest, so it never covers the table
  of contents; wider than both, it scrolls. From about 1010px no diagram
  scrolls, the four wide ones included (proxy checks 751px, agent store,
  VM states, SSH agent); at 900px five scroll. With the table of
  contents shown, the proxy checks take 48px on the right and 31px on
  the left.
- mise.toml: docs:diagrams, which docs and lint:docs depend on.
  docs.yml: the next and release jobs install node and draw the
  diagrams; the release job only when the tag has the script, so older
  tags still build.
- scripts/bump.sh: bump_pele, named only, replaces bump_mermaid: npm
  install --save-exact --ignore-scripts in docs, then mise run
  docs:diagrams, whose self-check catches a pele that changed how it
  draws small text. TestBumpCoversPins finds docs/package.json's
  dependencies (npm:NAME); bump.txtar tests --check and the install.
  The header and hextra's note say the mermaid render hook replaces
  Hextra's mermaid hook, so check it still has that name.
- Every diagram gets an accTitle and accDescr, which pele makes the
  SVG's title and desc (aria-labelledby, aria-describedby). Staying
  safe's columns are written in reading order, as pele lays subgraphs
  out from left to right. The proxy checks' description names every
  branch, and a hand-placed <br> keeps "CA)" off a line of its own.
- AGENTS.md: the one Node script; no other build script is JavaScript,
  and no other npm package is installed outside mise's tools.
  Contributing's docs, tools and
  maintaining pages describe the drawing, the caching, the margin, the
  task and the bump.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:36:28 -07:00
w3cjandClaude Opus 5.5 b6954e1e11 refactor(vmname): a VM's name is a vmname.VM, parsed where it's read
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]>
2026-11-15 19:36:28 -07:00
w3cjandClaude Opus 5.5 1ecd1faa73 build(nilaway): mise run nilaway against a triaged baseline, an advisory CI job, and two crashes it found
nilaway is pinned in mise.toml at its newest commit's pseudo-version (it
has no releases); bump.sh's dev-tools moves it, and TestBumpCoversPins
covers it through mise.toml:tool:*. mise run nilaway runs
scripts/nilaway.sh: devvm's own packages, not the tests or their helpers
(stubtest, backendtest), compared with testdata/nilaway-baseline.txt, the
findings triaged as false positives, each with its group (checked,
bounds, mapkey, nilsafe), keyed by file and trace without line numbers,
one line for each finding, compared as multisets. It exits 3 on a new
finding, a key found more often than the baseline has it included, and
1 when nilaway can't run, when a finding in its output can't be read,
or when a baseline line is stale or malformed. TestNilawayBaseline
checks each case with a stand-in nilaway. CI's nilaway job is
continue-on-error: it warns on new findings and lists the new and stale
ones, then every finding, in the run's summary, failing when the script
exits 1.

The first run reported 83 findings, 69 without the test helpers. Two
were real:
- agentlogin.Restore sliced above[1:] for a settings file that is one
  JSON string holding a placeholder, where above is empty, and
  devvm agent save panicked.
- agentlogin's readJSON returned a nil map, with no error, for a file
  that is null, which the Codex and opencode captures then wrote to. It
  now refuses it as not a JSON object.
The other 67 are the baseline. Both fixes get a CHANGELOG Fixed entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 19:36:27 -07:00
w3cjandClaude Opus 5.5 02ba74e614 build(lint): stricter linters, and the fixes they need
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]>
2026-11-15 00:17:50 -07:00
w3cjandClaude Opus 5.5 246a7aac10 docs(internals): a page on devvm's processes, its listeners and why Go
Processes, under How it works: one section for each process devvm runs
on this machine for a VM (devvm itself, a VM's and a build's proxy, the
port forwarder, the link session, the ssh masters and relays, the QEMU
wrapper and its keeper, the daily tools check, the desktop relay, the
SSH agents and Lima's hostagent), each with what it holds, what it
reads from the VM, what it writes and its bounds, its confinement, and
who starts and waits for it; an inventory of the loopback listeners a
VM's bytes reach; and why devvm stays in Go.

Linked from How it works' index, the security model, Staying safe, Attack vectors (a browser login's port),
the ports, network, desktop and Lima pages, the design notes and
Contributing's package table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 00:17:50 -07:00
w3cjandClaude Opus 5.5 0856205bd9 ci(vuln): govulncheck as its own CI job, and a weekly scan of main and the releases' binaries
mise run vuln scans the code as built for Linux and for macOS. CI's vuln job
runs it on each push and pull request, apart from lint and test, with only
Go and govulncheck installed. The Vulnerabilities workflow scans main's code
and the binaries of the latest release and the newest release, prerelease or
not (govulncheck -mode=binary, after checking that SHA256SUMS lists and
matches each archive), each Monday. A read-only scan job uploads the
findings, and an issue job, run only on main, opens, updates (with a comment
when the findings change) or closes one issue, as the Pins workflow does.
Contributing's Maintaining page says what fails, what a binary's scan can
over-report and how to respond.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 00:17:50 -07:00
w3cjandClaude Opus 5.5 2e0d580e14 chore(git): ignore .worktrees, where parallel work's worktrees live
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-15 00:17:50 -07:00
w3cjandClaude Opus 5.5 c1cf96e4b6 fix(vm): every start pins the VM's host keys, whatever its ports
A start whose VM forwarded nothing, because other programs held every
listed port or the VM was devvm ports none, never pinned its ssh host
keys: only the port forwarder (Forwards.start, which returned before
vmssh.Checked) and the ssh config pinned them, and a start that went no
further than bringUp (devvm clone fetch, rm's fetch, the clone check)
wrote no ssh config. devvm's own ssh (ownSSH, vmssh.ReadKeys) then found
no record, and devvm clone fetch failed with clone_fetch_failed.

bringUp now pins them last, once the start or the running VM has gone
through the self-check (starter.pinHostKeys, vmssh.PinHostKeys), for a
VM whose backend's ssh the review allows. A record of the current start
is kept without reading the VM; ErrNoHostKeys is skipped, as the ssh
config skips it, and other errors fail the command. A running VM without
a record of its start, as this bug left one, gets it at its next
command.

Tests: TestFetchPinsHostKeys (forwarding none, every port taken,
running without a record), and TestUp, TestUpNetworkPolicy and
TestUpTools' calls with the pin after the self-check; testscript clone_hostkeys, its ports the
script's own listeners. fixture_v010_clone passes with 3000 and 5173
held. CHANGELOG Fixed entry; design.md's host key and security.md's ssh
into VMs say when the keys are read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 23:15:36 -07:00
w3cjandClaude Opus 5.5 8f04459331 docs(changelog): unreleased changes at the bottom, linked from the top
The changelog page opens on the latest release, which people read to see
what's new in the release candidate. Changes on main since then sit in
an Unreleased section at the bottom, linked from a line under the title,
and its three entries are rewritten in the docs voice with every fact
kept. Contributing's maintaining and structure pages say where entries
go between releases, and that each release moves them to the top.
scripts/publish.sh finds a release's notes by its heading, so it's
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 23:43:19 -07:00
w3cjandClaude Opus 5.5 5225d5b43e fix(links): a relay's grace waits out a slow client; CI-proof timing in two tests
TestPipeSSHGrace failed on GitHub's macos-latest runner ("talking, half
closed: the relay ended while the VM talked") twice, and
TestLinkCheckBurst once.

The relay's grace restarted only when a read from the VM completed, and
io.Copy reads nothing while its write to the client waits, so a client
that half-closed and read slowly, holding back the VM's answer, was cut
after the grace though the VM kept sending. The grace is now time the VM
sends nothing, never time a slow client takes: graceTimer runs only once
armed (the client's side closed, or the copy to the client ended with a
failed write or the VM's EOF), stops while a write to the client waits,
and starts again after each write. A client that stops reading thus
holds its relay and ssh itself, so the owner's context now also closes
the connection when it ends (context.AfterFunc), which ends a write
waiting on such a client: a forward's close, a link's removal or
LoopbackForward.Close can't hang on it.

The CI failures themselves were the test's margins: a 200 ms grace
against a stand-in that spawns sleep between writes. The talking case
now has a 2 s grace, 40 times the stand-in's 50 ms, and reads for a
second past it; pidOf waits up to 10 s for the stand-in to start.

TestLinkCheckBurst wasn't the relay changes': its 256 checks ran on the
real clock, and a burst slower than linkRunFor (1 s) looked the target
up twice. vm.Links has a clock seam, Now (time.Now unset), which
linkCheck's targetRuns uses, and the burst runs through linkCheck on a
clock that stands still. With a targetRuns made for each call, it fails
(256 Inspects).

- vmssh: graceTimer (arm, write, restart, stop) replaces reset;
  graceWriter replaces graceReader; pipeSSHFor closes the connection
  when its context ends
- vm: Links.Now, used by linkCheck; env.go names Links' Env field
- tests: TestPipeSSHGraceSlowClient and TestPipeSSHCancelEndsBlockedWrite
  (each failed on the old code); TestGraceTimer replaces
  TestGraceTimerStopped (unarmed, armed, written to, stopped, armed
  while a write waits many graces); TestPipeSSHGrace's per-case grace;
  pidOf's wait; TestLinkCheckBurst through linkCheck on a still clock
- stress, with four cores of background load: TestLinkCheckBurst and the
  relay tests under -race -count=50 -cpu 1,2 and GOMAXPROCS=1, then the
  relay and link tests of vmssh and vm under -race -count=20 -cpu 1,2:
  all pass
- coverage: internal/vmssh's baseline raised
- docs: internals/ports (how it reaches the VM), the design note (each
  connection, the lead for relays held after their client closed)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 18:34:47 -07:00
w3cjandClaude Opus 5.5 608ab43714 fix(ports): an IPv6 listen error fails the port as an IPv4 one would, and ::1 refused alone forwards on IPv4
The forwarder's open listened on 127.0.0.1, then ::1, and gave the port
up only for EADDRINUSE on ::1. Any other IPv6 error (EMFILE, ENOBUFS...)
was ignored, so the port was forwarded and recorded on IPv4 alone until
its VM's listener went and came back: a client that connects only over
IPv6 (http://[::1]:PORT, tools without fallback) didn't reach it, and
another program on this machine could take ::1 on the port.

Now any other ::1 error closes the IPv4 listener and is returned, so try
handles it as an IPv4 listen error (f76b2fa2): EADDRINUSE recorded in
use, anything else logged, not recorded, and tried again at the next
report. A host without IPv6 on its loopback (EADDRNOTAVAIL, EAFNOSUPPORT,
EPROTONOSUPPORT) still gets IPv4 alone, and so does one that refuses ::1
alone with 127.0.0.1 bound (EACCES, EPERM), logged, so a security module
denying IPv6 sockets doesn't stop forwarding. A partly open forward is
never recorded: a port is forwarded on both addresses, on IPv4 alone on
such a host, or not at all.

- vmssh: noIPv6; open's cases for ::1 (no IPv6, EACCES and EPERM logged,
  any other error returned)
- tests: TestForwarderIPv6Failures (EMFILE on ::1: not forwarded, its
  IPv4 listener closed, unrecorded, forwarded on both at the next report;
  EADDRNOTAVAIL, EAFNOSUPPORT and EPROTONOSUPPORT: IPv4 alone; EACCES and
  EPERM: IPv4 alone and logged; EADDRINUSE: in use, not tried again)
- coverage: internal/vmssh's baseline raised
- docs: internals/ports (when it can't forward), the design note
  (listening, a lead for a forward on IPv4 alone), CHANGELOG Unreleased
  Fixed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 16:15:45 -07:00
w3cjandClaude Opus 5.5 c63f9a3340 fix(links): relays end with their link, their master or 30 s after their client closes
A relay's ssh (-W) ends only when the VM's sshd ends its channel, so a
VM that ignored EOF could keep a relay, its ssh process and one of its
owner's 256 slots:

- A link's removal closed only its listener, so its open connections
  went on until the target's master or the session ended. The same held
  for connections through a target master replaced when the target
  started again, and for a link whose address and port named another
  target at the next sync.
- While a forward or a link lasted, a relay whose client had closed its
  side stayed for as long as the VM liked.

Each relay now gets its own context, which a link's removal, its
master's replacement or end, and its target's change cancel, as a
forward's close already did (f76b2fa2); that pattern has one owner,
relayConns, which the forward, each link and each target master use.
pipeSSH, which carries every relay of the forwarder's, the link
sessions' and a login's callback, also cancels it once the client has
closed and the VM has sent nothing for 30 s, the first byte included, or
30 s after the client can take nothing more. A client that half-closes
and waits still gets an answer the VM keeps sending; one that waits
longer than that for a first byte (nc -N in front of a slow query) is
cut. devvm link unpublish keeps the link, so its open connections stay.
No cap for each target: what a target can still hold is connections the
client's programs keep open.

- vmssh: relay.go, the relays' owner: relayConns (add, done, cutAll),
  pipeSSH moved from forward.go, pipeSSHFor, relayGrace, graceTimer
  (newGraceTimer, reset, stop), graceReader. forward.conns is a
  relayConns; linkEnd holds a *relayConns, with close, and targetMaster
  one, with end; sync cuts a link's set when it goes or its target
  changes; take reads the link and its set together; carry tracks each
  connection in its link's set and its master's (track, untrack);
  targetMaster returns the master
- structure: relay.go listed in execSites (each connection's ssh -W);
  forward.go's reason is its master alone
- tests: TestLinksEndStuckRelays (an ssh stand-in that never exits: a
  removed link's, a replaced master's and a changed target's relays end,
  their ssh gone and slots freed, no goroutine left, under -race);
  TestLinksCarryCut (a cut link's and a cut master's connection: no
  check or relay, no event, not tracked); TestPipeSSHGrace (closed,
  half-closed, talking and closed while talking clients);
  TestPipeSSHGraceWriteError (failed writes end the relay within the
  grace); TestGraceTimerStopped
- e2e: link's lkRmEnds, on a port of its own: a connection held by the
  client to a server that never closes it, whose relay ssh ends after
  devvm link rm
- docs: using/links (removing a link), internals/ports (how it reaches
  the VM, when links change), the design note (each connection for
  forwards and links, a lead for relays held after their client closed,
  not covered, two threat-check rows), CHANGELOG Unreleased Fixed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 16:15:34 -07:00
w3cjandClaude Opus 5.5 940f1e2d88 chore(scripts): bump.sh moves every pin in the repo, and a guard for new ones
scripts/bump.sh now covers every pinned version, so release prep is one
command, grouped as --check prints them:

- shared-tools: cursor (only when named), Cursor's CLI pinned in
  assets/shared-tools/mise.toml, checksums computed from the downloads
- e2e: e2e-curl, tests/e2e/transparent_test.go's curlImage by digest
- go: go (newest patch: go.mod, docs/go.mod, mise.toml, mise lock),
  go-minor (only when named), go-mods (direct modules, go get and go mod
  tidy; a next major's path only reported), deadcode (mise.toml's task)
- dev-tools: mise.toml's tools but go, through mise lock
- ci: ci-mise (jdx/mise-action's version follows base's mise), actions
  (uses: by tag commit from gh api, then actionlint and zizmor)
- docs: hextra (go get and hugo mod tidy in docs/), mermaid (only when
  named)

--check prints each pin's group and whether a bump is a patch, minor or
major. With no tools named, bump.sh applies patches and minors only:
never a major, a held pin or a named-only tool; naming an images or e2e
tool still applies its major, and e2e-tools always does. Holds come from
.github/dependabot.yml's ignore list (pflag < 1.1.0) and bump.sh's own
(node on its major).

The header lists every pin as "# pin KEY TOOL", or "-" and a reason, and
says why the pins outside the scanned files are left (install.sh's Lima,
the Homebrew formula, testdata, vendored files). TestBumpCoversPins in
internal/structure scans assets/, mise.toml, both go.mod files, the
workflows, tests/e2e-mise.lock, tests/e2e's consts and docs/hugo.yaml
offline, and fails on an uncovered pin or a stale line.

The Pins workflow gets mise and a token for the new checks, and its issue
lists outdated pins under their groups. testdata/script/bump.txtar covers
the new groups with stubbed upstreams, and caught newest_of failing on
an empty list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 11:25:31 -07:00
w3cjandClaude Opus 5.5 41867769be docs(changelog): 0.1.1-rc.3's New in order of interest
Cursor, devvm paste, following dotfiles' links, --clone, pins in your own
layers, then quiet hosts, as CJ ordered them. fc0703bd was meant to carry
this order and didn't.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 10:14:34 -07:00
w3cjandClaude Opus 5.5 fc0703bd60 build(release): 0.1.1-rc.3
VERSION is 0.1.1-rc.3. CHANGELOG.md's 0.1.1-rc.3 entry becomes the release
candidate's notes on GitHub: Unreleased, rewritten as what's new, changed
and fixed in the docs voice (2,304 words to about 1,280), with New ordered
from most to least interesting: Cursor, devvm paste, following dotfiles'
links, --clone, pins in your own layers, quiet hosts. It credits #38's,
#40's, #42's and #44's authors, and adds devvm paste's entry, which merged
after rc.2 without one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 10:13:12 -07:00
w3cjandClaude Opus 5.5 872670d86e chore(deps): bump jdx/mise-action and CI's mise
- jdx/mise-action: v5.2.4 (6be3c7ed4c21d4f76b208d351d95aac273ebb76d)
  -> v5.2.8 (d5574b52816a478f9d4e6529a3f6ff17a8a36785), the tag's
  commit from gh api, in ci.yml, docs.yml (three), e2e.yml and fuzz.yml
- the mise those install: 2026.10.18 -> 2026.11.8, base's mise

Up to date: actions/cache v6.1.0, actions/checkout v7.0.1,
actions/deploy-pages v5.0.1, actions/upload-artifact v7.0.2,
actions/upload-pages-artifact v5.0.0,
amannn/action-semantic-pull-request v6.1.2, nick-fields/retry v4.0.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 08:15:32 -07:00
w3cjandClaude Opus 5.5 66d7020c43 chore(deps): bump the dev tools in mise.toml
Each with its mise.lock entries and checksums (mise lock):

- goreleaser: 2.19.0 -> 2.20.2 (checksums match its checksums.txt)
- hugo-extended: 0.168.0 -> 0.169.0
- vale: 3.25.1 -> 3.26.0
- node: 24.22.1 -> 24.22.3 (held on 24; 26.13.1 is the newest)
- markdownlint-cli2: 0.24.0 -> 0.24.1, with its lock folder
- zizmor: 1.31.1 -> 1.32.0

Up to date: golangci-lint 2.15.0, gotestsum 1.13.0, govulncheck
1.9.0, lychee 0.24.2, shellcheck 0.11.0, actionlint 1.7.12,
minisign 0.12.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 08:15:32 -07:00
w3cjandClaude Opus 5.5 88eeca20ff chore(deps): bump the end-to-end tests' pins
scripts/bump.sh e2e-tools e2e-from e2e-ubuntu e2e-lima.

tests/e2e-mise.lock, resolved again with devvm's host mise 2026.11.8:
- node: 24.22.2 -> 24.22.3
- go: 1.27.3 -> 1.27.4
- dotnet: 10.0.403 -> 11.0.100 (shared-tools/mise.toml has
  dotnet = "latest", so users already resolve .NET 11)
- claude: 2.1.319 -> 2.1.322
- codex: 0.167.0 -> 0.167.2
- opencode: 2.2.6 -> 2.2.7
- pi: 1.5.0 -> 1.5.2
Up to date: pnpm 12.18.0, bun 1.4.4, python 3.15.2, uv 0.13.7,
rust 1.99.1.

tests/e2e/from_test.go's digests from Docker Hub:
- node:24: sha256:8fa96264f302... -> sha256:9d266751ca3d...
- ubuntu:26.04: sha256:6a06111c3b0a... -> sha256:065aa8626841...
- alpine:3: up to date

Up to date: e2eUbuntuRelease release-20261016, CI's Lima 2.3.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 08:15:32 -07:00
w3cjandClaude Opus 5.5 aee6340ea9 chore(deps): bump assets' pinned downloads and devvm's host mise
scripts/bump.sh, every checksum from upstream's published sums:

- mise (base, and devvm's host mise): 2026.11.3 -> 2026.11.8, from
  the release's SHASUMS256.txt
- Docker's buildx: 0.38.1 -> 0.39.0
- Docker's compose: 5.7.0 -> 5.7.1
- nix: 2.35.5 -> 2.35.6, from releases.nixos.org's .sha256 files

Up to date: docker 29.9.3, containerd 2.4.2, model 1.2.9, Docker's
signing key, direnv 2.38.2, nix-direnv 3.2.0, git-lfs 3.8.1, rustup
1.29.3, crane 0.22.1, omb 94c2977eda06, eza 0.23.5, tealdeer 1.9.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 08:15:32 -07:00
w3cjandClaude Opus 5.5 ab078ddbef chore(deps): golang.org/x modules to their latest minor releases
x/crypto 0.59.0 clears govulncheck's module finding GO-2026-5932
(x/crypto/openpgp, which devvm doesn't import; devvm uses only blake2b).

- golang.org/x/crypto: v0.58.0 -> v0.59.0
- golang.org/x/sys: v0.49.0 -> v0.50.0
- golang.org/x/term: v0.47.0 -> v0.48.0
- golang.org/x/text: v0.43.0 -> v0.44.0
- golang.org/x/tools (indirect): v0.51.0 -> v0.52.0

Left as they are: github.com/spf13/pflag v1.0.10 (v1.1.0 is a week
old and changes help output and parse errors), and the indirect
go-md2man v2.0.6, go.yaml.in/yaml/v3 v3.0.5 and the test-only modules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 08:15:32 -07:00
w3cjandClaude Opus 5.5 9b2d903ed0 chore(deps): Go 1.27.3 -> 1.27.4
Go 1.27.4 has security fixes to cgo, the go command, the compiler, the
linker and net/http, and bug fixes to the runtime, the compiler,
crypto/tls, crypto/rsa and net.

- go.mod's go line: 1.27.3 -> 1.27.4
- docs/go.mod's go line: 1.27.3 -> 1.27.4
- mise.toml's go: 1.27.3 -> 1.27.4, and its seven mise.lock entries,
  their checksums matching go.dev/dl's

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 08:15:32 -07:00
w3cjandClaude Opus 5.5 326a701a2a docs(cursor): the safest devvm cursor is an allowlist VM without Cursor's CLI
CJ's checks with a real Cursor login: in a devvm cursor window on the
allowlist tier, in a VM without Cursor's CLI, the VM's editor server
tries api2.cursor.sh and downloads.cursor.com and both are blocked, yet
Agent and Tab still work, because Cursor sends their requests through
the app on this machine when the VM can't reach it. downloads.cursor.com
is the server trying to download itself into the VM before Cursor falls
back to downloading it here; with Cursor's CLI in the VM it is the same
request, not the CLI's update, whose channel devvm pins.

- SSH and editors, Cursor's Agent: the safest way first, with its
  commands and what devvm network log shows; the user-settings route for
  VMs with Cursor's CLI; the Tab troubleshooting line goes, as Tab never
  needed api3.cursor.sh from the VM.
- safety/network's quiet hosts: Tab's requests come from the app, not
  the VM.
- CHANGELOG's devvm cursor entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 08:01:23 -07:00
w3cjandClaude Opus 5.5 f76b2fa2a4 fix(ports): devvm ports says why a listed port isn't forwarded; a relay ends with its forward
The forwarder recorded every listed port it couldn't take on one line,
and devvm ports warned ports_taken ("in use on this machine") for all of
them, even a port past its limit of 256 forwards or one the host refused,
such as EACCES below 1024 on Linux. It now records why: in use
(EADDRINUSE), past its limit, or refused (EACCES, EPERM), each on a line
of its own in run/ports.forwarded (pid, forwarded, in use, limit,
refused). Any other listen error (EMFILE, ENOBUFS, EADDRNOTAVAIL...) says
nothing of the port: it's logged, not recorded, and tried again at the
next report, the log's limit capping the repeats. A port past the limit
is tried again at the next report once the forwarder is below it. An
older devvm's three-line record, whose third line held every failure,
is read as giving no reason, so it warns of none rather than call a
refused port in use; its forwarded ports still count.

A forward's close closed its accepted connections, but each relay's ssh
(-W) waited for the VM's sshd to end the channel, so a VM that ignored
EOF kept that ssh process and one of the forwarder's 256 relay slots
until the forwarder ended. Each relay now gets its own context, cancelled
by the forward's close under mu, so CommandContext kills its ssh; a relay
that ends by itself releases its context.

- vmssh: failure (in use, limit, refused) and failedPorts; failureOf's
  ok for errors that are the port's; Forwarder.try; apply clears limit
  failures below the limit; Note takes failedPorts;
  Forwards.Unforwarded replaces Taken; record writes five lines
  (recordLines); MaxForwards exported for ports_limit; forward.conns
  holds each relay's cancel
- messages ports_limit (count, limit, ports, vm) and ports_refused
  (count, ports, vm), linked to troubleshooting's listed-port section;
  devvm ports warns each by why
- --json unchanged: it never listed failed ports
- tests: TestForwarderFailures (EACCES, EPERM and EADDRINUSE through
  Listen, EMFILE tried again unrecorded, the limit and its retry once
  below it), TestForwarderEndsStuckRelay (an ssh stand-in on PATH that
  never exits: the relay ends, the process is gone, the slot is free),
  TestForwardsHeld's record round trip, older and foreign records, and
  ports.txtar's three warnings from a record and none from an older one
- docs: internals/ports (record lines, relays, when it can't forward and
  what's retried), the design note (how many, each connection, the
  below-1024 lead, the stuck relay as confirmed and fixed, channels a VM
  never closes as listed), ports-size, troubleshooting, CHANGELOG Fixed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 07:38:42 -07:00
w3cjandClaude Opus 5.5 54cce97049 fix(ports): a stopped VM no longer keeps its listed ports from other VMs
Only a running VM holds a host port. Each VM's forwarder records the
ports it forwards, and those it tried and couldn't take
(run/ports.forwarded: its pid, then each list on a line; an empty one
when it starts, and devvm removes it under ports.lock before each
start). A forwarder reserves another VM's ports only while that VM has a
claim: its forwarder runs, or devvm holds its ports.lock to start one
again (the restart window). It never takes the ports such a VM forwards
now, nor those it lists unless this VM lists them too. A stopped or
crashed VM holds nothing. A reserved port the VM listens on waits and is
forwarded once free, so a VM gets its port back within about 20 s of the
other VM stopping. The host decides when a port is given up: every
forwarder closes a forward whose port is now reserved every 10 s on its
own clock (Forwarder.Recheck), so a VM that holds its session open and
stops reporting can't keep another VM's listed port, and closing a
forward closes the connections it accepted, so a browser's keep-alive
connection never reaches the old VM afterwards. Two VMs starting at once
are settled by the host's bind. The ports devvm chooses (ssh, proxy,
desktop) still avoid every VM's listed ports, running or not.

- ports: Used(d) for the allocator; Reserved, Holders and Live for the
  forwarders
- vmssh: Forwarder.Recheck, Note and release; a forward tracks and
  closes its connections; Forwards.Reserved, Held, Taken, live,
  recorded and record; a start keeps a port another VM holds in -only
  and warns ports_held for any holder, listed or every-port; Main takes
  paths.Dirs
- devvm ports warns ports_held and, for a running VM's listed port its
  forwarder recorded as a program's, ports_taken, reading the
  forwarder's record and binding nothing; --json adds held_by
- backend.CountPorts; the stub's ssh master reports again when
  guest-ports changes
- tests: TestReserved, TestForwarderWaits, TestForwarderGivesUpSilently,
  TestForwarderClosesConnections, TestForwardsHeld (restart window,
  every-port holder, no record, Taken from the record alone, another
  process's or no record), TestForwardsRecordFails, TestForwardsStart
  (old record removed), ports_stopped.txtar (CJ's case end to end, and
  an every-port VM leaving a running VM's listed port alone),
  layout.txtar
- docs: ports-size's Two VMs and one port (the browser origin) and its
  JSON, internals' Ports other VMs forward, design.md's ports note and
  the listed ports' threat check; CHANGELOG Fixed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 00:20:43 -07:00
6c36850251 feat(cursor): devvm cursor opens this folder's VM in the Cursor editor
devvm cursor is devvm code's twin for Cursor, the editor. It gets the
folder's VM ready as devvm host does, then runs
`cursor --remote ssh-remote+HOST DIR` in devvm's place, with the SSH
agent devvm started with. Without `cursor` on PATH it fails with
no_cursor_command, naming the host to connect to.

Cursor's Agent and your sign-in (from CJ's manual check with a real
login): recent Cursor runs Agent in the editor's server in the VM, which
holds your Cursor sign-in in memory only (no token on disk, in any
environment or command line) and calls Cursor from the VM. Cursor's
`cursorAgentHost.remoteInferenceRoute` is application-scoped, so it's
read only from the user settings on this machine; with it set to
"always", Agent's own requests go through the Cursor app here, while
the VM's server still talks to Cursor.

- vm: Code and Cursor share openRemote; vm.CursorCommand names the
  editor's command, apart from the CLI agent's agents.Cursor. After
  LookPath finds `cursor`, devvm reads Cursor's user settings on this
  machine (platform.AppSettingsDir: Application Support on macOS,
  $XDG_CONFIG_HOME or ~/.config on Linux) through safefile.Read, 1 MiB
  at most, read-only, as JSON with comments, and warns with
  cursor_agent_in_vm unless the route is "always". It never fails on
  the file.
- sync.sh: Cursor's ~/.cursor-server/data/Machine/settings.json gets VS
  Code's remote.autoForwardPorts, git.terminalAuthentication and
  github.gitAuthentication off, in one loop over both editors' files.
  devvm doesn't write the route there, since Cursor ignores it.
- structure: nameFree lets a literal that is an agent's name stand in
  one file, with its reason, and fails when it frees nothing.
- cli: cursor.go (--ssh-config, --here, --parent), registered beside
  code; cursor_failed, no_cursor_command, cursor_agent_in_vm and their
  doc links; ssh_host_info names Cursor too; the cli skill's judgment
  note: an editor's command is a bare verb named after the editor's.
- Tests: host_code.txtar (cursor, its full-name host, the missing
  command, the warning and no warning once the route is set),
  guest.txtar, TestCursorAgentWarning (always, absent, other values, no
  file, broken JSON, too long, a FIFO, the XDG path; never written),
  e2e network: devvm cursor passes the editor only the host and folder,
  a fake editor sign-in on this machine reaches neither the VM's home,
  its processes' environments nor the proxy's logs, and a Cursor login
  in the store reaches the CLI's methods while the agent store's are
  refused.
- Docs: SSH and editors (commands first; "Cursor's Agent": it runs in
  the VM with your sign-in, the user-settings line, what it doesn't
  cover, open only VMs you trust; if Tab doesn't work on the allowlist
  tier, devvm network allow api3.cursor.sh), the agents page's Cursor
  notes, Commands, attack vectors, design, the home page, CHANGELOG,
  generated CLI pages.

Reviewed adversarially before the push: the settings read (size, FIFOs,
links), the warning's wording and when it fires. Researched with PR
#44's design as reference only.

Co-authored-by: JB <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 00:05:36 -07:00
w3cjandClaude Opus 5.5 5d7f941678 feat(network): quiet hosts: documented telemetry stays blocked without a notice in the VM
A built-in policy's `quiet HOST[:PORT]` line, for one exact host name,
marks a host devvm leaves out on purpose. A quiet host is blocked as any
host no rule allows, and an allow of the user's still lifts it. A block is
quiet only when its reason is "not on the allowlist" (notAllowed), it isn't
refused, and no rule covers the host (an allow, a deny or one that
narrows): then it's logged with "quiet": true but never counted in
/blocked or /blocked/new, so neither the VM's prompt nor devvm-why shows
it, its 403 page suggests no command, devvm network log --blocked shows it
as a row of its own with "- (quiet)", and devvm network lock never offers
it.

- proxy: rule.quiet, parseQuiet (exact hosts only), PolicyLine.Quiet,
  policy.quiet, Allowlist.Quiet, Event.Quiet, server.blocked (proxy and
  transparent paths), notAllowed; loadPolicy skips and logs quiet lines in
  the user's files.
- netpolicy: Judge.Quiet, Block.Quiet (its own row key), FormatEvent's
  ", quiet", RuleFile.Quiet, quietMark, policy_quiet_not_own in
  PolicyWarnings.
- cli: quiet in network log --json, log --blocked --json and network
  --json; the agents' table leaves quiet lines out.
- Quiet hosts, each with its source: api3.cursor.sh (the host Cursor
  documents for Tab requests; Cursor's CLI uses it for its metrics) and
  telemetry.go.dev (Go). Not marked: Claude Code's Datadog intakes (shared
  multi-tenant hosts projects may need), .NET's telemetry (no host in
  Microsoft's docs).
- Tests: TestParseQuiet, TestQuietHosts, TestQuietOnlyWhenNoRuleAllows,
  learn/log/rules tests, network_rules.txtar, e2e network check for
  api3.cursor.sh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 23:38:24 -07:00
w3cjandClaude Opus 5.5 4baa6202cc fix(cursor): Cursor's agent stream passes, read message by message
CJ's M3 run with a real login: cursor-agent couldn't chat; it kept
reconnecting to agentn.global.api5.cursor.sh, and the VM's proxy logged
AgentService/Run as refused ("devvm couldn't read the login's token
request or reply"). The CLI's agent client compresses its requests
with gzip (connect-node's sendCompression, read from the 2026.11.11
package, for messages of 1 KiB and more), and a Connect server answers
a gzipped request with gzipped messages whatever the client accepts
(connect-go's negotiateCompression mirrors the request's; the spec has
the server assume the client takes the request's encoding). cursorReply
refused any reply with a Connect-Content-Encoding or Grpc-Encoding but
identity, so it refused Run's reply at its headers.

- frameScanner: a reply whose Content-Type is a Connect or gRPC stream
  passes message by message. Each is read whole, at most 16 MiB as it
  comes and as it decompresses, gunzipped when flagged compressed, and
  checked for a JWT's start before any of it passes, as it came.
  Connect's end of stream, and every message of a JSON stream, is also
  decoded and its strings checked, so escapes can't hide a token. An
  unknown flag, a compressed message without gzip or that isn't gzip,
  one over the limit, an envelope cut off, a token in the trailers, and
  gRPC-Web's base64 text end the stream before that message. Other
  replies keep jwtScanner; requests carry placeholders and pass as
  before.
- cursorReply takes gzip only as a stream's own message encoding, and
  refuses any other encoding as before.
- TestCursorStreams: a recorded-shape Run stream (gzipped messages, a
  plain one, an end of stream), which failed first ("an encoded reply");
  gRPC; each refusal; a token compressed, plain, at the end and escaped
  there; JSON streams. TestCursorReplyScans now uses a unary reply.
- e2e network: the fake company proxy's api2.cursor.sh answers Run as a
  Connect stream with gzipped messages, which passes whole through the
  VM's proxy, and one with a token, which ends before it.
- A focused threat review (security-audit skill): no way found for a
  token to reach the VM that the old refusal stopped; its memory and
  JSON-codec points are taken (no allocation from a declared length,
  JSON streams decoded, grpc-web-text refused). Base64 inside messages
  stays unread, as before, in internals' network page.

api3.cursor.sh, also blocked in that run, is the CLI's metrics host
(MetricsService, with a fixed key of the CLI's own, fire and forget),
which the allowlist leaves out on purpose; the CLI reaches it with
http2.connect, around HTTPS_PROXY, hence "without proxy settings".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 21:57:18 -07:00
w3cjandClaude Opus 5.5 90694a414f feat(agent): devvm agent import follows links out of an agent's folder when allowed
A link out of an agent's folder, such as a dotfiles repo's link into
~/.claude, was always left out. Now it's copied when you allow it:
config.toml's follow-links names folders whose links devvm follows
without asking, and otherwise devvm names each link and its target and
asks, a question --follow-links answers. Without a terminal and the
flag, links out are left out with a warning naming --follow-links.

- The store gets copies only: a linked file as a file, a linked folder
  as a folder of files; the next import replaces them, a folder that
  became a file included, and prunes them once the link is gone.
- Each link is resolved one name at a time (linkHops), then read through
  its allowed folder as a safefile.Root opened one folder at a time from
  / (openPhysical); a link inside is read only to a file in that root.
- Always refused: the home folder or a folder holding it, devvm's config,
  data and Lima folders, ~/.ssh, ~/.gnupg, ~/.aws, ~/Library/Keychains,
  ~/.config/devvm, ~/.netrc, ~/.config/gh, ~/.docker, ~/.kube, and every
  agent's logins and history, compared by name and identity (isIn); a
  follow-links folder in or holding one fails the import.
- A target in a VM's project folder warns, naming the VM; a chain through
  a link in a VM's folder to a place outside it is refused.
- Bounds: devvm agent save's, 20,000 entries, 128 MiB and 16 MiB a file,
  across one import.
- A settings file must link to a file and a settings folder to a folder.

Messages: agent_import_link_not_followed, agent_import_link_refused,
agent_import_link_too_big, agent_import_follow, agent_import_link,
agent_import_link_followed, agent_import_link_project,
agent_import_link_via_vm, agent_import_root_refused,
follow_links_invalid.

Tests: TestAgentImportFollowsLinks, TestAgentImportNestedLinks,
TestAgentImportRefusedPlaces, TestAgentImportRefusedRoots,
TestAgentImportProjectFolderLinks, TestAgentImportLinkThroughProject,
TestAgentImportRefusedOtherCase, TestAgentImportLinkBounds,
TestLinkSourceGrown, TestAgentImportLinkKinds, TestAgentImportLinkPrune,
TestAgentImportLinkedAgentFolder, TestLinkHops, TestOpenPhysical,
TestFollowLinks; testscript agent_import_links; e2e project section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 20:47:48 -07:00
w3cjandClaude Opus 5.5 a992eea850 fix(agent): opencode's links at devvm agent import get a warning, not silence
agentDirs and agentFiles list only the folders and regular files of
opencode's folder, so a link there was never looked at: devvm agent
import dropped it without the warning the other agents' links get.
agentLinks lists the links in a WholeFolder agent's folder whose names a
setting could have, and readSettings reads them as it reads any other
agent's link: a link to a file inside the folder is copied as that file,
and any other link is left out with agent_import_link_left_out.

Test: TestAgentImportOpencodeLinks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 20:47:36 -07:00
w3cjandClaude Opus 5.5 8da71a01bb refactor(from): --from's registries judged by proxy.Public
internal/from had its own copy of the internet-address judge
(publicAddr, nonPublic) with a shorter table than the proxy's: no NAT64
or 6to4 decoding and none of IPv6's special ranges, so a registry at
64:ff9b::10.0.0.1 or fec0::1 passed it.

- publicOnly and publicHost ask proxy.Public; publicAddr and nonPublic
  go. internal/proxy is the standard library only, so from may import it.
- forbidigo refuses netip.Addr.IsPrivate outside internal/proxy, as a
  second judge would drift; testdata/lint breaks it once, and the owners'
  table in Contributing's structure page names proxy.Public.
- TestPublicAddr checks publicHost and publicOnly, with NAT64, 6to4,
  site-local and documentation rows.
- A CHANGELOG Fixed entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 20:42:43 -07:00
w3cjandClaude Opus 5.5 848d07f9f8 test(e2e): a failed check keeps the sandbox's proxy logs
A block's cause is in the proxy's own log, which the run deletes with
the VM or build that wrote it, so a failed check showed the block but
never why.

- keepProxyLogs: copies every proxy.log with lines under the sandbox's
  devvm folder (VMs' and builds', not images' or tools'), read through
  os.Root, into proxy-logs/<time> in the state folder, and prints the
  folder and the last 5 lines of each written since the attempt began.
- runner.tail calls it for a failed check and a flaky check's first
  failure; runner.began is the attempt's start; newRunner empties
  proxy-logs/ (sandbox.proxyLogs).
- TestHarnessKeepProxyLogs; Contributing's testing page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 20:42:43 -07:00
w3cjandClaude Opus 5.5 99f57d4003 fix(proxy): 6to4 judged by its IPv4 address, and more special ranges internal
A 6to4 address (2002::/16) passed the floor as public even when the IPv4
address in it was private, and Teredo, IPv6's documentation, discard-only,
benchmarking, ORCHID, SRv6 and IPv4-translated ranges, and IPv4's
documentation ranges and 192.88.99.0/24, counted as the internet.

- withIPv4 (was nat64): the IPv6 ranges that carry an IPv4 address,
  NAT64's and 6to4's, each with its site's prefix length (6to4's /48);
  embeddedIPv4 (was nat64IPv4) reads either.
- hostAddrs.internal: the host's own address first, then the 6to4 site of
  any of its own addresses (its LAN's), then the embedded IPv4 address;
  hostAddrs.own, the address map, replaces has.
- rule.matchAddr: a 6to4 address matches as its IPv4 address for a deny
  alone, as 6to4 goes through relays anyone may run; NAT64 still matches
  for both.
- notPublic gains 2001::/32, 2001:db8::/32, 3fff::/20, 100::/64,
  2001:2::/48, 2001:10::/28, 2001:20::/28, 5f00::/16, ::ffff:0:0:0/96,
  192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 and 192.88.99.0/24.
- Tests: TestInternal's rows, TestInternalOwn6to4, TestSixToFourAllowsNot,
  TestResolveSixToFourName, a 6to4 deny in TestAddressDenyAppliesToNames;
  the learning tests' public address is 93.184.215.14 now, as
  203.0.113.5 is documentation's.
- The structure test's table name, the proxy's README, network.md's range
  list (with Teredo under a broad IPv6 allow), attack-vectors and
  safety/network, and a CHANGELOG Fixed entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 20:42:43 -07:00
w3cjandClaude Opus 5.5 09c5be1887 fix(proxy): a block for a name that doesn't resolve says why
A name the host's DNS couldn't resolve was blocked with "can't resolve it"
whatever the cause, and a request whose client went away mid-lookup was
logged as a block too, so a cancelled lookup looked like a DNS failure.

- egress.lookup: the resolver, a field tests set (net.DefaultResolver's
  LookupNetIP otherwise); resolve and floorUpstream go through lookupName,
  which asks once more after a temporary failure (not a not-found), within
  floorUpstream's 3 s.
- unresolvedReason: reasonNotFound ("this machine's DNS has no address for
  it"), reasonDNSTimeout, else reasonUnresolvable; the error itself stays
  in proxy.log, as before.
- floorCheck: a lookup that ended with the request's context gives
  reasonClientLeft; events.record drops a block with it, so /blocked and
  the counts never see it, and egress.abandoned names it in proxy.log,
  at most abandonedLogMax (20) a minute, as a name can carry data out.
  The Nix cache's floor gives the context's error for it.
- Tests: TestUnresolvedReason, TestCanceledLookupNotBlocked,
  TestCanceledLookupsLogCapped, TestFloorUpstreamLookupBudget;
  TestUpstreamNoProxyDirect no longer needs the real resolver.
- network.md's log files and a CHANGELOG Fixed entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 20:42:43 -07:00
w3cjandClaude Opus 5.5 d55476d3e2 feat(images): the prelude is one line, so build scripts keep their line numbers
Every script a build runs with bash, devvm's own and the user's layers,
now gets the prelude as one line, eval $'…', in place of its #! line, so
bash's errors and $LINENO give the script's own line numbers. A script
without a #! line is one line further down.

- shell.QuoteLine: ANSI-C quoting for bash, on one line of printable
  ASCII; every other byte as \xHH, so a multibyte locale's lead byte
  (Shift-JIS, GBK, GB18030, Big5) can't swallow the backslash escaping a
  quote, and a NUL panics as a caller's bug. image's layer rule allows
  internal/shell, a leaf.
- image.WithPrelude, the one place the prelude and a script are joined
  (OwnScript calls it), used by base.sh, apt.sh, the built-in layers and
  features, the user's layers, shared-tools/build.sh and oci/build.sh.
  Every devvm script has a #! line. A leading UTF-8 BOM goes before the
  #! check.
- A build's exports for a company proxy (lima's proxyExports) and the
  user's CAs (trust's exports) end in "; ", not a newline, so they share
  the first line and move no line either; backend.Trust.Env says so.
- The stub logs a bash -s script's second line, which is the script's
  own second line with or without the prelude.
- Keys: every build script's bytes change, so base, every image and
  every shared tool image are built again once; the CHANGELOG's After
  you upgrade says so with git-lfs, and what VMs say until devvm update,
  and Breaking has its own heading.
- Tests: TestQuoteLine (every byte but NUL, a break-out word, in
  /bin/bash 3.2 and PATH's bash, in C and each of ja_JP.SJIS, zh_CN.GBK,
  zh_CN.GB18030 and zh_TW.Big5 that locale -a has), TestQuoteLineNUL,
  TestWithPrelude's shebang and BOM cases, TestWithPreludeRuns (the real
  prelude's line gives the prelude back; a layer under set -euo pipefail
  gets the names, keeps its function and its line numbers, with and
  without exports before it).
- e2e nix: the layer copy no longer adds the prelude itself.
- Docs: images.md's prelude section, Customizing's layer bullet,
  structure.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 17:46:30 -07:00
w3cjandClaude Opus 5.5 6ad4f6cb63 feat(images): your own layers get the scripts' prelude
devvm now puts assets/prelude.sh before a user's layer script, as it does
for its own scripts, so a layer gets $devvm_arch, $devvm_libc and
devvm_sha and can pin a download per architecture (and per C library on
Alpine) the way devvm's scripts do.

- image.WithPrelude puts the prelude before any script; OwnScript calls it.
- build.(*Env).LayerData reads the user's layer and puts the prelude
  before it; a deleted layer is still fs.ErrNotExist (Missing).
- The layer's step holds the prelude, so its key changes on its own:
  every image with a user's layer, and every image above one, is built
  again once. base and built-in-only images, and tool images, keep
  their keys; keyFormat is unchanged. The v0.1.0 fixtures have no user
  layers, so their keys don't move.
- The prelude runs first, so a layer that sets its own devvm_ name keeps
  it.
- layer new's starter mentions devvm_sha and $devvm_arch.
- Tests: TestWithPrelude, TestUserLayerGetsThePrelude (LayerData, the key
  differing from a prelude-less build's, a deleted layer still missing);
  prelude.txtar runs a layer as a build does on gnu and musl, and one
  that overrides devvm_arch and devvm_sha.
- e2e (images): the fixture layer prints $devvm_arch, $devvm_libc and
  devvm_sha of two fake pins, which the check compares with the VM's.
- Docs: Customizing's Mailpit example uses $devvm_arch and devvm_sha;
  images.md's key table, recipe and prelude sections; structure.md;
  CHANGELOG (Breaking).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 17:46:30 -07:00
w3cjandClaude Opus 5.5 c597c21e85 fix(history): an export packed with macOS's tar imports
devvm history import refused an export made with macOS's tar (bsdtar):
for each file with extended attributes, such as the com.apple.provenance
that recent macOS puts on new files, bsdtar adds an AppleDouble ._ file
beside it, and ._.claude, at the top, is outside the agents' history.
bsdtar's own listing hides those entries; GNU tar's, which the VM
checks, shows them. e2e's from section packs its Alpine export on the
host, so it failed on the mini (macOS) and passed on fedora (GNU tar).
The import script is unchanged since before the agents stack, so this
isn't a regression from it.

- historyImport leaves a name whose last part starts with ._ out of the
  path check (appleDouble), and never unpacks one (--exclude=._* and
  */._*); what's below a folder so named is still checked.
- TestHistoryImportRuns (GNU tar, so Linux): an export laid out as
  macOS's tar writes it imports without its ._ files (it failed before
  the fix on fedora), ._.claude/a is still refused, and an export that
  devvm history export writes imports whole (a round trip).
- The agents' golden scripts, internals' Coding agents and the
  CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 17:42:38 -07:00
w3cjandClaude Opus 5.5 dd1b87bacd fix(dotnet): DigiCert's OCSP responder on dotnet's allowlist
When NuGet can't fetch DigiCert's revocation list while it checks a
package's signature, it asks DigiCert's OCSP responder, which the
allowlist blocked (seen in e2e tools on fedora, where the list's lookup
failed under load). ocsp.digicert.com on port 80 joins
crl3.digicert.com, and the toolchains page and CHANGELOG say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 17:27:34 -07:00
w3cjandClaude Opus 5.5 7af09a596f test(cli): a failed script shows its VMs' proxy logs
A script that fails with proxy_start_failed leaves no trace of why: the
proxy's log and status file are in the sandbox, which goes with the
script. The sandbox's cleanup now logs, for a failed script only, the
last 40 lines of each VM's proxy log and its proxy's status file, before
it removes them, so the next such failure in CI shows its cause.

- logProxies, proxyLogLines

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 17:27:34 -07:00
w3cjandClaude Opus 5.5 b30229ca19 test(fixture): a fixture's host ports are ones free here
fixture_v010.txtar launched app, scratch and web on the host ports
0.1.0 recorded on the machine that made the fixture. When any of them
was taken here, by a program or by another run of the same tests (two
checkouts' gates on one machine), the launch rightly chose another port
and edited the VM's Lima config, failing the script's check that a
launch makes no limactl edit.

fixture VERSION now maps each VM's ports.host to a port free here,
wherever the number stands on its own (vm.json, the stub's state,
lima.yaml's proxy URL, the proxy's config and status, the sandbox
profile), never inside a hash. The other fixture_v010 scripts' own
free_port and json_set of ports are no longer needed and go.

- freePorts: free_port's helper, shared with fixture
- fixtureRewrite: the paths' replacer plus the ports
- TestFixtureRewritePorts

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 17:27:34 -07:00
w3cjandClaude Opus 5.5 7f0c009d4b docs(compared): bring the comparison up to date, as tables and bullets
The compared pages predated rules by method and path, Cursor's CLI,
learning and locking a VM's hosts, your own secrets, .git protection on
Linux and in nested repos, --clone's full copy and devvm paste.

- _index: the network table's devvm row gets method and path rules,
  learning, your own secrets and Cursor's CLI, and refreshing is named
  for the agents devvm refreshes (not Cursor's, not pi's API keys);
  Docker's rules gain the port its docs list. How devvm differs is
  bullets, adding --clone, transparent mode, your own secrets and
  devvm paste. Last checked is a note, and Clawk and agent-vm get a
  bullet each.
- docker-sandboxes: method and path rules move to What's the same;
  rows for learning hosts, the clone, the clipboard; nested repos in
  the .git row; Cursor's CLI and pi in logins; choosing is two bullets,
  with rules by URL query in place of method and path. Docker's
  isolation and network rules pages read again on 2026-11-12.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 15:21:02 -07:00
w3cjandClaude Opus 5.5 5c8aeafcbc test: gosec's G703 off in test files, where it reports a helper's write on some runs only
gosec's taint analysis reported internal/gitprotect's test helper write
(G703) on some runs and not others, which failed macOS CI's lint at
4f99e407 and passed on its re-run. A nolint there would fail nolintlint
on the runs that don't report it, so .golangci.yml excludes G703 in
_test.go files, as it does for tests/e2e, and the 12 nolint:gosec
comments that only covered G703 in tests go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 12:50:32 -07:00
w3cjandClaude Opus 5.5 4f99e40731 test(clone): don't depend on the machine's git-lfs or system git config
CI (run 43285988512, at 9535110f) failed two tests that pass on a Mac
with Apple's git and no git-lfs:

- TestSeedConfig found "filter" in the VM's config. With git-lfs on
  PATH, as on GitHub's runners, the seed's own per-clone
  git lfs install --local --skip-repo writes filter.lfs.*, which is
  what the copy is meant to do. The check now looks for this machine's
  filter (filter.crypt) and allows only filter.lfs.* besides. Reproduced
  with git-lfs 3.8.1 on PATH; passes with and without it.
- clone_uncommitted_retry wanted clone_kept_branches. That has nothing
  to do with LFS: after the failed first copy, the VM's repo is empty,
  and the script's git commit landed on the VM git's default branch.
  Apple's system gitconfig sets init.defaultBranch=main, so locally it
  was main, which the retry keeps (clone_kept_branches); on the runners
  it's master, so main was set as copied and only HEAD stayed
  (clone_kept_head). Reproduced with GIT_CONFIG_NOSYSTEM=1, which now
  fails the old script locally exactly as CI did. The script now puts
  the VM's HEAD on main before it commits, and every testscript runs
  with GIT_CONFIG_NOSYSTEM=1, so a machine's system config can't change
  what a script's git does.

The gate passes twice, with git-lfs 3.8.1 first on PATH and without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 12:30:46 -07:00
w3cjandClaude Opus 5.5 9535110f2f docs: user-page rule covers safety, backends and compared; strict section leads with today's behaviour
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 11:54:42 -07:00
52bb0f467b feat(clone): a --clone VM gets the repo as it is here
A --clone VM's clone is now seeded with a snapshot, not git push, and
gets everything a working copy has. devvm clone fetch brings it all
back, and devvm rm and clone off check it before deleting.

- Refs: every branch, tag and notes ref, and a detached HEAD.
- Uncommitted changes: staged, unstaged and untracked files; files
  skip-worktree by hand get the index's version, named.
- Operations in progress (merge, rebase, cherry-pick, revert, bisect)
  and the stash; a stash's untracked part goes as its own branch.
- The repo's settings and hooks, sent as settings only where they live
  in the repo (husky); ORIG_HEAD never goes.
- Partial clones, with their promisor remote, and messages per network
  tier when it can't be reached.
- Initialised submodules, nested ones too, each with a clone of its
  own; a submodule's own folder is refused as a top-level --clone.
  vm.json gains an optional `submodules` field.
- Git LFS both ways: objects hash-checked, written under os.Root with
  no link followed, a question past 2 GiB; the filter is set only in
  the clone's repos; git-lfs 3.8.1 in base, pinned by SHA-256.
- rm and clone off keep the VM when anything the VM has didn't come
  back, and name it.
- Every shell script embedded in Go is shellchecked.
- clone.md is a guide that leads with commands; TestUserPageProse
  covers it and coding-agents.md.

After you upgrade: base and every image on it build again once, for
git-lfs.

Fixes #40, reported by @Josuesp1620. Thanks to @dhruv1220 for #42,
which found the cause (receive-pack refusing a shallow push); its
receive.shallowUpdate setting stays in the VM's repos.

Co-authored-by: Dhruv Arora <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 11:54:42 -07:00
d349868c31 feat(agents): one definition per coding agent, and Cursor's CLI
Every list of the coding agents now derives from internal/agents'
registry, one Def each, and Cursor's CLI (cursor-agent) is a fifth
agent.

The registry:
- each agent's login command, login formats and capture on its Def;
  one message for every agent where each had its own
- the agents' table, the README's list and the docs' history lists are
  generated from the registry (cli.DocBlocks, TestDocBlocks); scripts
  and Go tests take their lists from it too
- each agent's own code lives in a file named for it; the structure
  test lets only an agent's own files choose by its name, following
  constants named after an agent
- a VM remade by clone on/off keeps no agent's login files
  (agents.LoginFiles from every Def.Logins; Claude Code's .claude.json
  stays, as it is also history)

Cursor's CLI:
- `devvm --agents cursor`, `devvm agent login cursor`, history import
  and export of ~/.cursor/chats
- the proxy captures its login at a GET endpoint, guards a shared host
  by path, and puts the login in only where the CLI sends it, bound to
  the CLI's 57 methods
- account changes and the agent store are refused in a VM; Cursor's
  headers and trailers are scanned for tokens
- e2e: Cursor's CLI in the network section, its poll behind the fake
  company proxy

Docs: the agents' pages lead with commands, with a How it works page
for the agents.

Co-authored-by: JB <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 11:49:48 -07:00
w3cjandClaude Opus 5.5 a03f119427 docs: user pages lead with commands, and lint:docs fails a wall of prose
The user pages (getting-started, using, safety, backends, compared) now
show a task's command first, then lists, tables, steps and callouts.
Longer mechanism moves to the matching How it works page, linked, with
every fact kept (facts.sh against each parent).

- The rule: a line in AGENTS.md's Docs, the docs-voice skill's "Commands
  first on user pages", and Writing docs' "User pages lead with doing".
- scan.sh checks runs on every page (2+ paragraphs on user pages, 3+ in
  internals and contributing), prints each run's word counts, adds a
  `long` column (paragraphs and list items over 80 words or 4
  sentences), and exempts a colon-ended lead-in only up to 40 words.
- TestUserPageProse (internal/cli/docgen), run by lint:docs, fails a
  user page with a run of 3+ paragraphs where two are over 80 words, or
  any paragraph or list item over 150 words; TestProseProblems covers
  the rules.
- Pages: images (Base first, Outdated VMs after Rebuilding), vms,
  ports-size, links, space, settings, command-line, troubleshooting ("A
  command fails" as the skill's own after example), upgrading, desktop,
  from, customizing, safety/network, safety/git-protection,
  attack-vectors, backends.
- Moved mechanism: internals/network.md (Starting a VM on its tier,
  Requests by method and path, The VM's CA) and a new "The run log" in
  internals/overview.md.

On the user pages: runs of 3+ paragraphs 32 -> 0, paragraphs or list
items over 150 words 46 -> 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 11:49:47 -07:00
CJandClaude Opus 5.5 2b49967b4e chore: CI time zones, test isolation from the repo, a flaky test and the agents page (#45)
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]>
2026-11-12 07:20:42 -07:00
2f0cc97392 feat(paste): devvm paste and devvm paste rm (#38)
feat(paste): devvm paste, an image, PDF or copied file from the clipboard into the VM (#38)

devvm paste reads the host's clipboard and streams what's on it into the
running VM's paste folder over the backend's Exec, with no SSH agent and no
new channel, then copies the file's path in the VM to the host clipboard for
the agent's prompt. devvm paste rm empties the folder after a question, and
a launch that starts a stopped VM offers to.

What it reads:
- an image (PNG, JPEG, GIF, WebP; TIFF is converted to PNG), checked by its
  bytes; browsers hand over a PNG, so an animated GIF arrives as one frame
- PDF data, sent as it is, and preferred over a file reference beside it
  (Preview's page copies)
- one copied file, after a question that shows its path on this machine;
  --send-file answers it only for a file inside the project folder reached
  without links, and never for a --clone VM
- never text; several files are refused

Security:
- macOS reads file URLs only through NSPasteboard (FileURLsOnly): AppleScript's
  «class furl» coercion turned any text, such as a path a web page or the
  VM's OSC 52 put there, into a file to send
- copied files are opened with openat and O_NOFOLLOW|O_NOCTTY|O_NONBLOCK,
  following a root-owned link only in a folder only root can change, and read
  through internal/safefile (Checked), capped at 64 MiB
- osascript and pbcopy by absolute path, Linux's tools only from system
  folders, never PATH
- time limits on every clipboard tool and on paste.sh in the VM; bounded
  reads of everything the VM prints
- the path copied back is built on the host, keeping only the file's
  extension: nothing the VM says reaches the clipboard

Also: the paste-dir setting (default /tmp/devvm-paste, made at each
launch), --json with sent, the agents' guide line, messages with doc links,
stubs, CLI tests, an e2e check in the project section, and docs on
coding-agents, settings, design, security and attack-vectors.

Co-authored-by: dustypolk <[email protected]>
Co-authored-by: w3cj <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 22:29:46 -07:00
w3cjandClaude Opus 5.5 28d7eca6c8 test(e2e): never leave or trip over a project VM
Check 2 of project fails at once without check 1's VM, cleanup deletes
any VM whose folder is under the run's project folders (and its state
folder), and setup refuses a slot whose Lima home has project VMs an
earlier run left, printing the commands that delete them (not with
--reuse). leftoverVMs, projectVMs; TestHarnessLeftovers,
TestHarnessProjectVMs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 12:19:49 -07:00
w3cjandClaude Opus 5.5 a78f212a8c docs(changelog): name the network commands' real arguments
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 11:49:19 -07:00
w3cjandClaude Opus 5.5 a47397c26e docs(changelog): 0.1.1-rc.2 as what's new, changed and removed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 11:44:04 -07:00
w3cjandClaude Opus 5.5 7c286973b9 build(release): 0.1.1-rc.2
VERSION is 0.1.1-rc.2. CHANGELOG.md's 0.1.1-rc.2 entry becomes the release candidate's notes on GitHub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 11:33:25 -07:00
w3cjandClaude Opus 5.5 d187f3cca1 docs(changelog): the remount restart, warnings once, Nix 2.35.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 11:16:29 -07:00
w3cjandClaude Opus 5.5 7b876d7285 build: bump nix to 2.35.5 and the e2e pins (#39)
scripts/bump.sh nix e2e-tools e2e-from; mise stays deferred.

- assets/layers/nix.sh: nix 2.35.4 -> 2.35.5 (sha256 arm64
  34b8d0c0658321e63143f892086bd2d9623a81bf96e4ffefc1551092d80caedb,
  amd64 c349f0559b7849a2cb3b20b8584e532b3fcf5025092cb6180eb0b99240d7b96c),
  which changes the nix layer's image key.
- tests/e2e-mise.lock: codex 0.166.0 -> 0.167.0 (its entries now carry
  mise's checksum_source = "mise-versions", as others already did) and
  opencode 2.2.5 -> 2.2.6; node, pnpm, bun, python, uv, go, rust,
  dotnet, claude and pi were already the newest.
- tests/e2e/from_test.go: fromAlpineDigest -> sha256:f59abe656b69…,
  alpine:3's digest now (3.24); node:24 and ubuntu:26.04 didn't move.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 10:46:11 -07:00
w3cjandClaude Opus 5.5 ab125b1af6 fix(lima): tidy the remount restart's failure paths
A review of the remount restart found its failure paths loose:

- A restart whose limactl stop failed returned the plain message, and
  the caller then stopped the VM's proxy with the VM still running.
  Now a folder still mounted with the old mode is warned of and the VM
  goes on with its proxy, and anything else fails as a logged
  stop_failed, saying the VM didn't stop.
- The interrupt's cleanup was dropped before the restart's stop, so a
  Ctrl+C during that stop could leave an open-tier VM running. It now
  stays until any stop in remountProject returns.
- The start again repeated the first start's warnings (policy lines,
  pins, a degraded start). The UI now says each warning once a run, by
  its name and values, which covers every package's warnings without a
  flag through each of them.
- mount_cache_unmounted and mount_cache_unchecked come only after the
  restart failed, so they no longer say to run devvm restart: they say
  the VM is stopped and its console log may say why.
  mount_cache_remount_failed says the old mode can lose writes and what
  may hold the folder. Their doc links stay on "When the cache mode
  changes", which now points to the console log.
- The mountinfo check's comments and docs say why it's used (portable:
  any awk, no util-linux tool but mountpoint), not that Alpine lacks
  findmnt, which devvm's base layer installs there.
- design.md: the stop that fails, the warnings said once, the cleanup
  through the stop, and the older race of another devvm starting the VM
  in the gap, which fails closed.

Tests: TestRemountRestartStop (the cleanup held through the stop; a
stop that fails, mounted or not), TestRemountRestartConfined (each
start's undoStart, an interrupt between the starts: one start, the proxy
stopped, the one undo kept; a start again whose proxy fails), TestWarnOnce,
and mount_cache.txtar's allowlist restart warning of a bad policy line
once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 10:33:03 -07:00
w3cjandClaude Opus 5.5 cd37a12b1b test(state): 0.1.0's Linux VMs are warned of, never refused for pins
devvm 0.1.0 and 0.1.1-rc.1 recorded .git protection off on a Linux
host, the one mode they could set there (NewMode gave off without a
user-immutable flag, and git-protect on or strict was refused), so a
Linux VM they made is never on, and a host that can't pin warns it
git_unprotected rather than refusing it backend_lacks. The fixture's
launch of app now says so: off recorded on Linux (on on macOS), the
warning, and no backend_lacks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 09:57:17 -07:00
w3cjandClaude Opus 5.5 db26def35b fix(lima): restart once when the folder can't be mounted again
After a cache-mode change, a Linux VM's start mounts its 9p project
folder again in the guest. On an Alpine --from VM (OpenRC) the umount
succeeds but both mounts fail ("already mounted or mount point busy"),
and devvm stopped the VM with mount_cache_unmounted, though a plain
restart boots with the new mode, which lima.yaml already has.

Now a folder left unmounted, still on the old mode, or a check that
fails gets one restart: the Lima backend writes why in the run log,
stops the VM under one status step (remount_restarting) and returns a
backend.RemountError. The caller, starter.start, starts the VM again
once through startOnce, the same path every start takes, so the restart
gets a new proxy following the new hostagent (the old one exits with
it), the .git pins applied in QEMU's new namespace, its host keys read
again for the new start, and its start recorded. That start's
Want.CheckCache asks Lima for the mountinfo check without the remount;
its outcome is final: unmounted or unchecked stops the VM and fails
with today's messages, another mode warns (its text now says to run
devvm restart to try again). An interrupt gets no restart, and the
cleanup stops the VM once.

- backend: RemountError, Want.CheckCache; backendtest.Fake.StartErr.
- Tests: TestStartSetsProjectCacheOnce (each failure a RemountError,
  the run log's line), TestStartRechecksProjectCache (the restart's
  check, no second restart), TestRemountInterrupted (no restart),
  TestRemountRestart in vm (two starts, a proxy each, no third).
- Stubs: remount-fails (the remount fails and leaves the folder
  unmounted until the next start); TestGuestMountOptions covers it.
- mount_cache.txtar: the restart that mounts the folder, and the one
  that doesn't, with no third start.
- e2e: the from section's Alpine check expects the launch to succeed
  through the restart.
- Docs: backends/lima.md's "When the cache mode changes", design.md's
  remount, restart and running-VM paragraphs, tests.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 09:57:17 -07:00
w3cjandClaude Opus 5.5 7c261ed15c docs(vm): mountcache.go in the package map's Settings files
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 09:03:55 -07:00
w3cjandClaude Opus 5.5 b67ae25b31 test(lima): strict conversion and the cache switch on one start
mount_cache.txtar, on a Linux host: a VM an earlier devvm left strict,
with no cache mode chosen, after devvm mount-cache none, converts strict
to on (git_strict_converted) and switches the cache in the same start,
with exactly one limactl edit that sets 9p's cache none, then mounts the
folder again; its state has git.mode=on and mount.cache=none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 09:03:55 -07:00
w3cjandClaude Opus 5.5 2406b498d8 fix(lima): check the remounted folder without findmnt
After a start that switches a Linux VM's project folder to cache none,
devvm checked the remount with findmnt -no OPTIONS, but the Alpine
--from base has no util-linux and busybox has no findmnt, so an Alpine
VM got an empty answer and was stopped with mount_cache_unchecked. The
guest now prints the folder's line of /proc/self/mountinfo, picked by a
POSIX awk (lastMount) that busybox runs: the last line whose mount
point is the folder exactly, as mountinfo escapes it (mountinfoPath:
\040, \011, \012, \134), which awk reads from the environment, as -v
would undo the escapes. devvm reads the mount's and its file system's
options from it (optionsOfMountinfo), refuses an answer that isn't a
mountinfo line, and keeps the 4 KiB cap, the last line and "unknown"
for a mode it doesn't know.

- TestOptionsOfMountinfo, TestMountinfoPath, TestLastMount: real lines,
  9p with and without cache=0x5, Alpine's without optional fields,
  stacked mounts, a path with a space; awk run on them.
- The stubs' guest answers with a mountinfo line; the start tests and
  the mount_cache script check the new command.
- e2e: the from section's Alpine VM, given Lima's mmap with no mode
  chosen, gets none from devvm mount-cache none at its next start on a
  Linux host; the e2e helper reads mountinfo too.
- design.md and tests.md say how the check works and what e2e checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:57:45 -07:00
w3cjandClaude Opus 5.5 e3f2635806 test(state): devvm update on 0.1.0's state
rc.2's notes tell users to run devvm update for transparent mode,
since their images predate dnsmasq, socat and nftables, and no fixture
test ran it. fixture_v010_update.txtar runs it on the frozen 0.1.0
fixture:

- web, a --clone VM, is refused before anything runs (remake_clone),
  so its clone and its work stay as they are.
- app without a terminal: vm_changed changed=base, then no_input, and
  nothing changes.
- app with --force: the remake exports the history, saves the home
  folder, sets the old machine aside, clones today's base, puts the
  home back and deletes the old machine. It keeps the VM's ID, tier,
  ports, shared tools (moved to the newest first), the github secret,
  its link group and .git protection (on on macOS, off on Linux, as
  0.1.0 left them), and the launch it ends with gives transparent mode
  the stand-in address.
- The remake keeps the project folder's cache mode as the state has
  it: 0.1.0 chose none, so on Linux app keeps Lima's mmap, its mount
  still without a 9p cache option and the launch still warning;
  devvm update is no opt-in to none.
- On macOS, app left strict is converted to on by the update's start
  (git_strict_converted), and diff.ignoreSubmodules is out of its
  .git/config.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:50:28 -07:00
w3cjandClaude Opus 5.5 17d082e4d9 docs(agents): restore two rules
A review of the slim-down found two lines lost and facts the pointers'
pages stated only in part.

- AGENTS.md: task IDs from any tracker never go in commit messages,
  code comments or docs (dropped with dex, not moved), and Lima's
  failed start of a running but degraded VM, which starting tolerates,
  are inline again.
- extending.md: Lima's Start owns env:, propagateProxyEnv, dns and
  hostResolver, and a project VM's size, agent mounts and forwardAgent;
  ports are never the backend's, vmssh.Forwards forwards them over its
  SSH.
- cli.md's Messages: a message made from an error carries it with
  .Because(err).
- structure.md's The packages: which packages use the standard library
  alone (fetch, redact, agents, jsonc, shell, vmname, safefile, daemon),
  proxy with daemon and safefile; devcontainer imports no outside
  module but uses image, jsonc, msg and shell. Its rows read as
  sentences, without semicolons.
- tests.md: the Go tests' introduction reads as full sentences.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:43:13 -07:00
w3cjandClaude Opus 5.5 6343f7e578 docs(changelog): 0.1.1-rc.2
## Unreleased becomes ## 0.1.1-rc.2, with what changed since rc.1:
transparent mode, the 9p cache on Linux, no strict .git protection,
folders of repos with --clone, a --clone VM in a mounted folder, nested
repos protected, .git protection on Linux, learning a VM's hosts, rules
by method and path, your own secrets, logins' known fields, opencode's
withheld keys, pi and more providers, prereleases on Homebrew, and the
fixes. Nothing repeats rc.1's entries, and every link's anchor exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:43:13 -07:00
w3cjandClaude Opus 5.5 65b2805f41 docs(network): what a lookup does with transparent mode off
The wording from the IPv6 fix said every lookup in a confined VM with
transparent mode off waits 35 to 40 seconds on a Linux host. e2e on
Fedora measured otherwise: getent fails within 3 seconds and curl with
"Could not resolve host" at once. Only the wrangler dev test saw
workerd wait about 40 seconds for each lookup there. So most tools fail
at once on macOS and Linux alike, and a few, such as workerd under
wrangler dev, can wait about 40 seconds on a Linux host
(safety/network.md, troubleshooting, internals/lima.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:43:13 -07:00
w3cjandClaude Opus 5.5 4d4c728f38 docs(agents): point to the docs
AGENTS.md goes from 4,463 words to 2,454. The lines whose facts a page
holds become one-line pointers to that page's section; the safety
rules, the gate, ask first, the editor tools, dependencies, cleanups,
test seams, external tools, CGO and most gotchas stay inline.

- Layout: each row is the path and a short what; The packages
  (contributing/structure.md) has each package's concerns and
  identifiers.
- Tasks: one line pointing to Tools and tasks.
- Rules: image keys, docs and docs by reader point to Building tools
  and Writing docs.
- Go conventions: printing, ctx and nolint point to Go lint rules;
  failing, signals, LoggedCmd to CLI conventions; the layers to
  Messages; arguments to Command arguments; the structure test to its
  section.
- Backends: How a backend plugs in, Missing and unreviewed features,
  the feature table and What devvm sets on a VM.
- Messages: four lines pointing to Messages, Questions, Names mode and
  the docs-voice skill.
- Testing: the unit, CLI and e2e lines point to Tests and End-to-end
  tests; Linux hosts and unreviewed emulations to testing.md.
- Gotchas: Lima's degraded start (backends/lima.md) and
  lima.REJECTED.yaml (internals/lima.md) go to their pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:48:49 -07:00
w3cjandClaude Opus 5.5 ffcaa20c1c docs(contributing): hold what AGENTS.md says, so it can point here
Every fact that AGENTS.md's slimmer version leaves to a pointer now has
a page, and the pages no longer send readers back to AGENTS.md.

- structure.md: The packages, a table of what each package owns, with
  the identifiers AGENTS.md's layout table named (vmname's grammar,
  agentlogin's File, Placeholder, Redact and Restore, daemon's starts,
  TERM then KILL, status file and lifeline, lima/pins.go and
  pinrun_linux.go, vmssh's ForwardLoopback and PinHostKeys, settings'
  Defaults, ParseCPUs and ParseGiB, packaging/key.go, assets/'s
  prelude.sh and network/...), in place of "AGENTS.md's layout table
  names the owners".
- _index.md: deadcode's expected list; depguard's allowed modules, and
  internal/safefile stdlib-only with proxy and daemon; a Go conventions
  section (CGO_ENABLED=0, proxy and daemon unix-only, external tools as
  commands and never linked, shell.Quote, build tags' file names, test
  seams as fields, a new dependency asked first), which the lint rules
  link to in place of AGENTS.md#go-conventions.
- cli.md: the 1 s wait for devvm's own interrupt (interruptGrace);
  AddCleanup, Interrupted() and cleanups' fresh context; LoggedCmd(ctx,
  step, cmd), backend.Logged and WithSteps; Stdout() and Stderr(); cli
  asking first and passing the answer in.
- extending.md: backends return a msg.M or backend.Logged(m), in place
  of the link to AGENTS.md#backends; backend.Validate and Want at Start,
  restart warnings the callers'; callers decide what a VM needs, one
  line on a missing feature, no fallback, an emulation's review.
- tests.md: the e2e sections clone and desktop; --only and --from before
  merging, from's every feature, no hosted macOS; new logic needs a
  test, no Keychain, VMs or your folders, XDG at t.TempDir(), VMs only
  on the fake backend in Go tests.
- docs.md: compared/ among the sections and the user pages; the README
  stays high level; a behavior's page changes in the same change.
- internals: design.md#one-binary lists prelude.sh and network/, and its
  intro points to Contributing; lima.md sets propagateProxyEnv,
  hostResolver and dns, and its start compares them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:45:36 -07:00
w3cjandClaude Opus 5.5 665f27dcb5 fix(network): log only IPv4 connections as transparent mode's refusals
In table inet devvm_transparent, the sentinel chain began with
`ip daddr != 198.18.0.1 return`, and in an inet table an ip match
holds for IPv4 alone, so every IPv6 TCP connection skipped the return
and hit the refusal's log: devvm-why listed [::1]:8787 as refused while
curl localhost:8787 worked over it. The sentinel now returns anything
but IPv4 first. The stand-in address is IPv4, and a connection to it
from an IPv6 socket (::ffff:198.18.0.1) leaves as IPv4, so this opens
no IPv6 way to it. The other chains' ip daddr rules match positively,
so IPv6 only skips them: early_in, early_out and input drop or accept
IPv4 traffic to the stand-in address, and the DNS redirects in output
and from_containers never took IPv6.

- TestTransparentRuleset: the sentinel's first rule returns IPv6, then
  the address's return, and the refusal's log is the sentinel's alone.
- e2e (transparentRuns): an IPv6 connection on loopback that works
  isn't listed under devvm-why's refused connections.
- docs: with transparent mode off, a lookup in a confined VM fails at
  once on macOS but only after systemd-resolved's timeout on a Linux
  host, 35 to 40 seconds for each lookup (safety/network.md,
  troubleshooting, internals/lima.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:41:57 -07:00
w3cjandClaude Opus 5.5 4f97f23fe2 test(proxy): a broken hello's tunnel is closed by a reset too
TestTunnelHelloStall failed on Fedora: its second case writes the
record's header and "hello" at once, the proxy refuses the header and
closes with "hello" unread, and Linux then resets the connection rather
than sending a FIN, so the client reads ECONNRESET where the test
wanted EOF. Either is the tunnel closed, which is what the test checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:32:30 -07:00
w3cjandClaude Opus 5.5 ab5d607d0e docs(contributing): a release candidate gets no state fixture
Released state and the release checklist say that only a final release
that changed the state gets a frozen fixture; a release candidate gets
none, even when it changed the state, and its final release's fixture
holds that state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:28:44 -07:00
w3cjandClaude Opus 5.5 eb45ad4e18 test(state): run devvm mount-cache and devvm network transparent on 0.1.0's state
The 9p cache and transparent-mode branches each added a vm.json
setting without running its command on the frozen 0.1.0 fixture, which
the fixture policy asks of a change to state.

- fixture_v010_mount_cache.txtar (Linux): 0.1.0's app VM shows mmap
  with the warning; devvm mount-cache none is pending while stopped, the
  next start makes it in one limactl edit with 9p's cache none and
  mounts the folder again, and the start after that edits nothing.
- fixture_v010_network.txtar: app, with no transparent mode of its own,
  follows the default, on, and its launch gives the setup the stand-in
  address; devvm network transparent off and on go in its state and
  apply from its next launch.
- checkV010Others: no 0.1.0 VM has a cache mode or a transparent mode
  of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:28:44 -07:00
w3cjandClaude Opus 5.5 79fc8dab63 docs(agents): fix stale lines
Factual corrections only, each checked against the code:
- Testing: Go tests make VMs only on the fake backend (unit tests call
  Launch.Up on backendtest); the CLI tests run the built devvm against
  the stubs, and e2e makes real VMs.
- assets/: base.yaml is base's Lima template; layers/ holds base's
  scripts, policy and Ubuntu's signing keys; network/ (the tiers' own
  policies) is listed.
- scripts/: test.sh is the test and coverage tasks' script, and
  coverage.sh, which it runs, checks the baselines.
- Tasks: lint:code and lint:docs list everything they run; test and
  coverage name their scripts; cli-docs also follows Example and the
  command's docs page.
- paths: a project VM's folder is Dirs.VMDir; forbidigo's
  os.WriteFile/os.Create/O_TRUNC exemptions are internal/state,
  internal/proxy, internal/msg/gen, internal/stubtest and tests.
- The testscript runner also stops port forwarders, link sessions and
  the stub ssh masters.
- e2e: the slots run in slots_test.go; sandbox_test.go has the
  sandbox, its slot's paths and lock, and e2eUbuntuRelease.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:21:01 -07:00
w3cjandClaude Opus 5.5 1bc77c9fbd docs(agents): drop dex
AGENTS.md no longer names dex: the tasks line, dex complete, dex edit
and the rule on task IDs go. One commit per finished task (its docs and
review included) and no commit before the gate passes stay, and a task
that turns out wrong or incomplete is said so, with the change
proposed. .gitignore keeps .dex/, so an existing checkout's task file
can't be committed by mistake.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:21:00 -07:00
w3cjandClaude Opus 5.5 f1d8f86a43 docs(contributing): keep every release's state working
Released state (contributing/structure.md) is the guide to the state
fixtures: what one holds; that each is generated once from its
release's own binary and never edited or regenerated, and a release
that changes nothing on disk adds none; the tests on every fixture
(stateFixtures, fixtureBinaries, storeFixtures, the per-release
fixture_v* scripts and the checks that each fixture has them); that a
change to state runs its new commands on every fixture in the same
commit; a Breaking changelog entry and a one-time notice at launch for
a change in what devvm does with existing state; freezing a release's
state at release time; and the support window: every release since
0.1.0 until 1.0, a release's fixture and compat code leaving together
in one commit that says so.

maintaining.md's release checklist gets the step that freezes
testdata/v<version>/, and AGENTS.md the rule, in one line linking to
the guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:20:52 -07:00
w3cjandClaude Opus 5.5 e7a62d3677 test(state): run the state fixture tests over every release's fixture
The tests of a release's frozen state (testdata/v<release>/<os>/) run
over every release folder, so adding the next release's state is its
folder and its expectations.

- internal/vm: stateFixtures() lists each release's expectations (its
  VMs, vm.json's version, the layout version, its one-repo clones, and
  check functions for its VMs, defaults and agent store); 0.1.0's are
  v010Fixture() in fixture_v010_test.go. TestFixtureVMStates,
  TestFixtureVMsRead, TestFixtureSettings, TestFixtureAgentStore and
  TestFixtureClonesReadAsOneRepo run once per release and system, and
  TestStateFixturesListed fails when a testdata/v*/ folder has no entry
  or an entry has no folder.
- internal/proxy: TestFixtureBindings and TestFixtureProxyConfig read
  every release's files; fixtureBinaries() records each release's and
  system's binary SHA-256. TestV010Rules stays 0.1.0's own grammar table.
- internal/secrets: storeFixtures() lists each release's Linux secret;
  TestFixtureStoreGet runs each, TestStoreFixturesListed checks every
  release with a linux/ folder has one.
- internal/cli: TestFixtureScripts fails when a release folder has no
  script that runs `fixture v<release>`, or a script names a folder
  that isn't there. The scripts stay per release (fixture_v010*.txtar),
  because their checks are of that release's VMs.

testdata/v0.1.0 is unchanged; its generate.sh and generate.txtar run
against the v0.1.0 tag as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:20:28 -07:00
w3cjandClaude Opus 5.5 cb36951de2 refactor(git-protect): drop strict, convert strict VMs to on
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]>
2026-11-09 07:20:00 -07:00
w3cjandClaude Opus 5.5 647ad4bf2a feat(network): transparent mode for tools that ignore the proxy settings
On every confined tier, a tool that ignores the proxy settings (workerd
under wrangler dev, a static Go binary, a container made through Docker's
API) reaches the VM's proxy by the names it looks up. In the VM, dnsmasq
answers every name with the stand-in address 198.18.0.1 and has no
upstream; nftables sends that address's ports 80, 443 and those the allow
rules name to socat listeners on it, which make each an authenticated
CONNECT transparent.devvm.proxy:PORT to the VM's proxy. The proxy reads the
host from the connection's first bytes (TLS SNI, or each HTTP request's
Host) and judges it as CONNECT host:PORT, with the same order of checks,
log, secrets and floor. A blocked HTTPS host gets the 403 over a
certificate from the VM's CA. Nothing new runs on the host, and the
backends don't change.

Proxy (internal/proxy):
- transparent.go: TransparentHost, ProxyDomain, SentinelAddr,
  IsSentinelAddr, ViaDNS, transparent (serve, take, tls, handler,
  refusePage, ports), sniHost, replay, reservedRefusal, withVia, viaOf.
- routeFor and route: the one order of checks for CONNECT and the
  transparent path; carry, the one tunnel with its SNI check; block split
  into the record and blockPage; links.refuse split (isLinkDomain);
  caEndedRefusal's test moved to routeFor; handshake and serveOne shared
  by intercept and the 403 page.
- devvm.proxy reserved whole, CONNECT devvm.proxy:P included; the stand-in
  address refused with its own reason.
- Hosts and SNI in ASCII alone, never folded (the Kelvin sign), in
  splitHostPort, sniMatches and sniHost.
- A ClientHello record past 16 KiB + 256 is never read; once it starts,
  a ClientHello must arrive whole within 10 s, on every tunnel; a stream
  whose first byte is 0x16 is TLS from then on, so a record header that
  doesn't come whole, or isn't TLS's version, is refused, never passed on
  unchecked; and only a ClientHello that parsed (sniOf) counts, so one
  split across records is refused, an address's tunnel's included, which
  may have no name (a gap older than this change).
- routeFor carries the method and path rules: a host they narrow is
  refused where it can't be decrypted and intercepted where it can, on
  the transparent path too.
- On the transparent HTTP path, devvm.proxy answers /blocked alone.
- policy.transparentPorts and /transparent/ports: 80, 443, then the ports
  allow rules name for hosts by name, at most 32, never 22 or 53.
- Event.Via ("dns"), shown in devvm network log, /blocked and the prompt's
  note as "without proxy settings".

Guest (assets/): base.sh installs dnsmasq(-base), socat and nftables;
guest/transparent.sh is devvm-transparent: setup and teardown from
sync.sh (the proxy URL on stdin), the supervisor service (systemd or
OpenRC), the ruleset (render: two filter chains at -150 keep every
interface but lo and Docker's bridges, and every protocol but TCP, UDP
and ICMP, off the stand-in address; both NAT chains at -110 map every port of
the stand-in address, so Docker's published ports never take one; DNS to
public servers and 127.0.0.1:53 go to dnsmasq, which listens on the
stand-in address alone; private, link-local, CGNAT and loopback servers
are left alone, but the VM's own name servers, which Lima's DHCP adds
beside 127.0.0.1 and Docker gives containers, go to dnsmasq too), slots,
the port list's check, and status for devvm-why. Names without a dot and
names under the search domains (this machine's network's, through Lima)
don't resolve.

Setting: config.toml's transparent-proxy, and devvm network transparent
[on|off], the VM's own value in net.transparent (Settings.Transparent,
SetTransparent; netpolicy.TransparentOf, TransparentAddr); the setup gets
DEVVM_TRANSPARENT_ADDR while the VM runs confined and its mode is on.
devvm network --json has transparent; devvm network lock lists apart the
hosts only tools without proxy settings reached (Learned.NoProxy, via in
--json). vmssh.dialAddr refuses the stand-in address.

Tests: the transparent path's unit tests and FuzzTransparent; the
setting, TransparentOf, FormatEvent's via and learned hosts; the ruleset,
slots and port list under bash 3.2; network_transparent.txtar and
sync.txtar; e2e: transparentRuns, the network section's checks, a docker
step, the from section's Debian 12 and Alpine on the allowlist tier, and
the guarantee checks run with transparent mode stopped and running.

Docs: safety/network.md (tools that ignore the proxy, what isn't
covered, the setting, logs, lock), internals/network.md (tools that skip
the proxy), internals/design.md (the design note and threat check),
using/settings.md, using/troubleshooting.md, using/limits.md,
using/images.md, safety/attack-vectors.md, internals/lima.md,
contributing/tests.md and testing.md, the proxy's README, the CLI
reference and the Commands page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:18:53 -07:00
w3cjandClaude Opus 5.5 6fd1d846d6 fix(lima): cache a Linux VM's project folder with 9p's none
Linux's 9p client loses data with Lima's default cache=mmap for a
writable share: a stat() during an extending write() takes the host's
stale size and writeback drops the data, so files reach the host empty
or cut to 4096 bytes even after fsync (Claude Code's Edit sets it off);
and on devvm's Ubuntu 26.04 guest kernel, a lock after a write makes the
next read return zeros, which breaks SQLite in any journal mode and
Gradle's daemon. macOS's vz VMs use virtiofs and aren't affected.

- New VMs on a Linux host record cache mode none in a new mount section
  of vm.json, and their project folder is made and started with it, as
  is the folder devvm clone off mounts. VMs whose state has no mode
  (0.1.0's, and every VM made before this) keep Lima's mmap untouched,
  with no limactl edit, and each launch warns (mount_cache_unchosen)
  until devvm mount-cache none.
- devvm mount-cache [none], with --json: none is the only mode devvm
  sets, so any other value is a usage error (mount_cache_invalid); a
  stopped VM gets it in its next start's one edit, a running one after
  the restart devvm offers. macOS refuses (backend_lacks), and so does a
  Linux VM whose folder isn't a 9p mount (mount_cache_no_choice). No -g
  or config.toml key: every new VM gets none.
- The start that changes the mode mounts the folder again in the guest,
  as cloud-init rewrites fstab only after systemd has mounted it, through
  the logged runner with a minute's limit (output pipes closed a second
  after), then checks it with mountpoint and findmnt, reading 4 KiB at
  most and only the last line: a folder left unmounted stops the VM and
  fails the start before its shell (mount_cache_unmounted), and so does a
  check that gets no answer (mount_cache_unchecked); one still mounted
  with the old mode is warned of (mount_cache_remount_failed), any mode
  but none or mmap named unknown. An interrupt meanwhile, on any tier,
  leaves a cleanup that stops the VM, the one stop then. A launch into a
  running VM asks the guest, in words, whether its folder is a mount
  point, and refuses one that isn't (project_unmounted) or whose check
  fails or gives no answer (project_unchecked). A stored mmap, from a
  build before none alone, reads as none chosen, and devvm clone off
  records none for its new mount; any other mode is refused naming
  vm.json.
- backend: FeatureMountCache (native on Linux, none on macOS, built on
  project-mount), Want.ProjectCache, Instance.ProjectCache, CacheModes.
- lima: mount rewrites keep only the sshfs and 9p settings devvm knows
  where they differ from Lima's defaults, and drop the rest for Lima to
  fill in, so lima.yaml never freezes a default; same() compares the
  cache where devvm sets one. Build VMs' writable output folders (tools,
  --from) get none.
- tools: an EROFS tool image that ends before its superblock does, or is
  shorter than its superblock says, as a build under mmap could leave
  one, counts as not built, so the next build makes it again; a build's
  short output is refused. The fakes' tool images are a page
  (backendtest.ToolImage).
- The limactl stub lists QEMU's vmType, fills in 9p cache defaults on
  Linux, and answers the remount's check.
- Docs: backends/lima (the project folder's cache, when it changes,
  programs that map files for writing, SQLite), using/limits,
  using/clone, commands, internals/lima, internals/backends, the design
  note (both mmap bugs, why none alone, the remount, tool images, the
  e2e findings), the CLI reference and the cli skill.
- Tests: TestProjectCache, TestMountRoundTrip,
  TestStartSetsProjectCacheOnce (the remount's outcomes), TestCutShort,
  TestBuiltCutShort, TestGuestMountOptions, TestFilledMounts,
  TestUpCacheMode, TestWarnMountCache, TestCacheAtNextStart,
  TestSwitchCache, TestSetMountCache, TestCheckStateCache, the
  mount_cache CLI test, clone_switch and the 0.1.0 fixture on Linux, and
  e2e's projectMountCache (findmnt, a stat-while-write loop, SQLite's
  journals, a shared writable mmap refused, the opt-in switch of an
  unchosen VM, what mmap does reported, macOS unchanged).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:17:12 -07:00
w3cjandClaude Opus 5.5 cf1f195490 test(state): exercise devvm 0.1.0's state with today's commands
The fixture tests read 0.1.0's state and launched each VM once; they now
use it with what changed since: custom secrets and nested-repo protection.

- fixture_v010.txtar: app's launch keeps 0.1.0's bindings file byte for
  byte and finds its github secret; scratch's and web's launches edit no
  Lima config and say nothing of nested repos or the github secret.
- A repo nested in app: on macOS, git_nested_protectable once, then
  devvm git-protect on locks lib/.git; on Linux (watched, unlocked), the
  stop says git_nested_appeared and the watch covers it from then on.
- On Linux with DEVVM_PINS=on: git_protect_available, devvm git-protect
  on, and the next start's run/git-pins.json pins .git and lib/.git.
- A secret of your own used in app beside github: secrets.names, yours,
  version 1, github's binding kept; devvm rm unlocks both .gits (macOS),
  keeps none, and deletes the VM.
- internal/secrets TestV010StoreGet: the Linux fixture's store gives
  app's 0.1.0 github binding ghp_testfakev010.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 21:38:23 -07:00
w3cjandClaude Opus 5.5 01e5d2488a feat(network): rules by HTTP method and path, and secrets by method
A policy rule for a host name can narrow it to some of its requests:
`api.github.com GET,HEAD /repos/` in a policy file, written by devvm
network allow, deny and rm from --method and --path. Allows add up and a
deny beats any allow, as for every rule, so narrowing a host that a rule
allows whole, such as devvm's built-in GitHub, takes a deny:
`devvm network deny api.github.com --method POST,PUT,PATCH,DELETE`, or
`devvm network deny github.com --path '/*/*/git-receive-pack'`. An allow
by method and path for a host already allowed whole warns that it
narrows nothing and names the deny.

The proxy decrypts such a host's HTTPS on :443 with the VM's CA, refuses
its tunnels on other ports and without a CA, and judges every request on
the connection, kept-alive HTTP/1.1 and HTTP/2 alike, every absolute-form
one, and the shared Nix cache's own fetches. A connection's verdict and
whether its requests are judged come from one read of the policy files.
A blocked request gets 403 and a blocked event with its method and path;
devvm network log shows it, and an allowed one's forward event names the
rule that let it through.

One matcher, internal/proxy/request.go, judges rules and secrets'
bindings: methods from a closed list (RFC 9110's, PATCH, QUERY; never
CONNECT); the methods a request names besides its own (every
override-like header in any spelling, `_` for `-`, and the query's
_method), each word judged, and while a rule narrows by method, a value
that isn't exactly one method refused; path patterns with *, ** and a
last / for everything below; and only a path in plain form. Allows and
bindings match strictly, denies broadly: any case, every path that isn't
plain, the prefix above a trailing /, and a last segment cut at its first
dot (/admin.json, /admin.). A method devvm doesn't know isn't a rule, so
a typo in a deny is a broken deny. Upgrades other than WebSocket and
CONNECT inside a decrypted tunnel are refused for narrowed hosts.

devvm secret set takes an optional --method (none for every method), and
a secret's --path takes the same patterns, marked path_pattern in
custom-secrets.json; a saved path with a * from before is refused rather
than read as a wildcard. The bindings file stays version 1 while every
binding reads alike to an older proxy, so devvm secret set and rm after
an upgrade don't take a running older proxy's bindings away; a binding
with methods or a pattern makes it version 2, which such a proxy refuses
instead of putting a value in for every method, and writing one warns
for each such VM. devvm network allow, deny and rm warn, naming the VM,
when a rule by method and path changes while the VM's proxy runs from
another devvm binary, or one devvm can't tell. A query with a ; or one
Go can't read whole is refused while a rule narrows the host by method,
and denies also match each segment with its trailing dots dropped. An
allow that narrows nothing names the VMs, with -g by each VM's own
allowlist, and says when it narrows only port 80's plain HTTP.

- proxy: match, Methods, ParseMethods, PathOK, plainPath, matchPath,
  overrides, overrideLike, server.judgeRequest; parseRule/parseHostRule,
  CanonicalRule, NarrowRule, Narrowable, hostRules (rulesFor, verdict,
  byRequest, judge, unjudgeable), egress.checkHost,
  Allowlist.CoversWhole, trimDots; Binding.Methods, BindingListVersion
  2 when needed (v1Binding);
  pathWithin and PathPrefixOK folded into match; the Nix cache judged
- netpolicy: Rule(rule, deny, methods, path), NarrowedHost, sameRule,
  Proxy.Allowlist, Proxy.NarrowNotes, Proxy.OtherBinaries, BasePolicy,
  Proxy.SecretsWritten (after RefreshSecrets and devvm agent login
  --api-key's write);
  FormatEvent shows a blocked request's method and path and a forward's
  rule
- secrets: Def/Secret/customJSON Methods, path_pattern, CheckMethods,
  CheckPath on proxy.PathOK
- vm: RuleChange, PolicyChange(ctx, rules, RuleChange)
- cli: --method and --path on network allow, deny and rm, --method on
  secret set, METHODS in devvm secret and "methods" in its --json
- messages: bad_request_path (was bad_secret_path), bad_methods,
  rule_not_narrowable, rule_narrows, rule_narrows_nothing,
  rule_narrows_http_only, rule_narrows_unknown, proxy_other_binary,
  secrets_other_binary
- tests: TestParseRuleNarrowed, TestMatchPath, TestDenyBypasses,
  TestAllowNarrowed, TestCoversWhole, TestForRequestMethods,
  TestInterceptRules and TestInterceptSecretMethods (HTTP/1.1 kept alive
  and HTTP/2), TestNarrowedNotDecrypted, TestNixCacheRulesByPath,
  FuzzDenyBypass (paths, methods, headers, _method), TestRule,
  TestNarrowedRules, TestOtherBinaries, TestRefreshSecretsOtherBinary,
  TestNarrowNotesUnreadable, TestDefine's path of /, TestReadBindings'
  versions,
  TestCustomsUnreadable's prefix path, network_narrow.txtar (narrows
  nothing), secret_custom.txtar's --method; on 0.1.0's frozen state:
  TestV010Bindings, TestV010ProxyConfig, TestV010Rules (0.1.0's
  TestParsePolicy and TestDecide, frozen), fixture_v010_network.txtar;
  e2e network: netRequestRules
  and the basic secret's --method GET,HEAD
- docs: safety/network.md's Rules by method and path, the secrets'
  flags and an example, internals/network.md's Requests by method and
  path, the design note replacing the open-work entry, attack vectors,
  the commands page, internal/proxy/README.md, the CLI reference

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 21:38:23 -07:00
w3cjandClaude Opus 5.5 20d2fe1db7 feat(clone): workspace clones of a folder of repos
devvm --clone in a folder of git repos gives one VM a clone of each repo
the user chooses, each at the same path as on the host, so paths between
them (file:../pkg, ../Lib/Lib.csproj) work in the VM, and a copy of the
folder's own files outside the repos, made once.

- Discovery by .git protection's walk (4 folders down, the same skipped
  folders, 100 repos); each repo checked as --clone checks one; a linked
  worktree of a repo in the folder isn't a repo of its own; a repo whose
  folder, or common dir, another VM mounts is refused, naming it, as is
  one whose name a terminal can't show. A picker in a terminal (every
  copyable repo ticked, the others shown with why); --repos
  all|none|LIST answers without one, and the question is refused naming
  it. A folder that's a repo keeps today's single clone unless --repos
  is given; one inside another repo's working tree is refused
  (workspace_inside_repo). The choice is recorded in the VM's state.
- A single --clone, or devvm clone on, in a folder another VM mounts is
  refused too (clone_folder_mounted), at plan time and before the seed's
  push.
- Each repo seeded with its current and default branch (origin/HEAD,
  else main, else master); a detached HEAD checks out the default. One
  VM command makes every repo, leaving one an earlier push reached as it
  is; each repo is checked again just before its push, and its remote
  chosen once the one before is added. The folder's own repo's clone
  excludes the other clones (escaped, anchored lines) and the host's
  info/exclude, at the seed and at devvm clone add.
- The folder's own files: walked folder by folder beneath the folder
  (safefile.Root.OpenDir), no links followed, no hard-linked files, no
  bare repos, no set-id bits, bounded; refused folders (checkUnsafe)
  apply.
- devvm clone fetch [--json]: every repo's branches into its remote's
  remote-tracking branches (--refmap=, one refspec), listed by branch
  name with their repos; nothing new is said only when a repo was
  fetched from. devvm clone add PATH: one more repo; one whose copy
  didn't finish is copied again.
- rm, devvm clone off and the switch loop over the repos; rm's check
  reads every repo in one VM command (cloneState), parsed strictly and
  capped (8 MiB, 10,000 branches in all), counting only worktrees inside
  the folder, a VM-side folder never made read as every repo gone; a
  clone missing in the VM is asked about, an unfinished repo checked
  when it's there; a host repo that changed refuses the check, and one
  another VM mounts, a single clone's too, gets no host git and is asked
  about; each repo is checked again before rm's fetch.
- The finder opens a workspace clone VM inside one of its repos; --here
  still makes the repo's own. --repos's dependencies go through needs(),
  which now takes a first argument too (devvm clone on).
- State is additive: clone.workspace, clone.repos, clone.made.files; a
  0.1.0 clone reads as one repo at ".". CHANGELOG: an Unreleased section.

Messages: flag_needs_flag, repos_value, repos_not_workspace,
workspace_repo_unknown, workspace_pick_help, workspace_pick_cannot,
workspace_reason_*, workspace_inside_repo, workspace_repos_past,
workspace_skipped, workspace_repo_dropped, workspace_detached,
copying_repo, uncommitted_not_copied_repos, workspace_ready,
workspace_files_failed, workspace_files_skipped, unfetched_commits_in,
clone_repo_dirty, clone_repo_gone, clone_repo_changed,
clone_repo_mounted, clone_repo_unchecked, clone_folder_mounted,
clone_check_repo_changed, fetch_before_delete_repos,
no_terminal_fetch_repos, clone_fetch_*, fetching_repo, clone_fetched_*,
clone_add_*, clone_added.

Tests: TestDefaultBranch, TestBranchPlan, TestIsWorkspace,
TestChooseRepos, TestPickRepos, TestFindRepos, TestRepoExcludes,
TestWorkspaceFiles, TestCloneChangesAcrossRepos, TestFetchedByBranch,
TestCloneRepos, TestV010CloneReadsAsOneRepo, TestCoversRepo,
TestParseCloneState, TestCloneStateScript, TestWorktreePathPins,
TestOpenDir; the clone_workspace, clone_workspace_repo, subfolder and
nested_replaced scripts; fixture_v010_clone (0.1.0's web clone fetched,
checked by rm, made a workspace clone by devvm clone add, switched off;
its scratch switched on); the e2e clone section's cloneWorkspace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 21:38:23 -07:00
w3cjandClaude Opus 5.5 62d54923ec docs: compared to other tools
A Compared section: devvm beside Docker Sandboxes, OpenShell,
microsandbox, smolvm, Claude Code's sandbox, Codex CLI, nono and
Codespaces, in two tables, with what devvm doesn't do, sources and a
last-checked date; a page on Docker Sandboxes side by side. Every
competitor claim links to that tool's own docs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 17:45:43 -07:00
w3cjandClaude Opus 5.5 776a1edb49 docs: fix stale and overstated claims found in a competitive audit
- Linux .git protection (namespace read-only binds, watch-only where the
  kernel refuses) described wherever pages said macOS only
- attack vectors: the duplicated "Minting credentials" fragment removed,
  the shell prompt moved from Blocked to Narrowed, what a build reaches,
  localhost cookies on forwarded ports, malware left in the project folder,
  same-user programs and the proxy password, devvm's host programs that
  read what a VM sends
- builds' reach per host, the hostagent profile limits only the network
- known limits: macOS and Linux only
- design: tokens for other services are built (devvm secret set)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 17:45:43 -07:00
w3cjandClaude Opus 5.5 b2b12ee55d feat(gitprotect): protect every repo nested in a VM's folder
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]>
2026-11-08 16:34:40 -07:00
w3cjandClaude Opus 5.5 8f6b30a887 feat(secret): your own secrets, bound to the hosts you choose
devvm secret set NAME --host HOST[,HOST…] --env VARIABLE [--header H]
[--prefix P] [--stdin] saves a secret of your own: the value from a hidden
prompt or stdin (never argv) into the Keychain or devvm's secrets folder,
and its definition into custom-secrets.json. A VM that uses it (devvm
secret use NAME) gets only a per-VM placeholder in VARIABLE, and its proxy
puts the real value in that header only for those exact hosts, over TLS on
443; the hosts join that VM's allowlist. Names, hosts, headers, variables
and prefixes are checked; wildcards, addresses, internal names and other
ports are refused. One placeholder builder serves every secret and login,
and the proxy caches values by kind, agent and name.


After an independent review, a secret goes in only in four exact shapes
(alone; Bearer, Token or a saved --scheme in Authorization; the Basic
password; the Basic username only with --basic-user), values are
printable ASCII under 3,800 bytes, the proxy checks each binding against
its definition, definitions carry IDs and VMs record their hosts, and
custom values are stored apart from the known secrets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 14:22:42 -07:00
w3cjandClaude Opus 5.5 f8f29e7acb docs(site): fonts served from devvm.dev, no third-party requests
devvm.dev and next.devvm.dev loaded Instrument Sans and Martian Mono from
Google Fonts, with preconnects to fonts.googleapis.com and fonts.gstatic.com.
They were the site's only automatic third-party loads; both fonts are now
served from docs/static/fonts/ with their OFL, and a lint:docs check keeps
it that way.

- Instrument Sans: Instrument/instrument-sans at commit
  7fa22308a3d0c94ee2b3cd537a1196b65db34a3e, fonts/webfonts/
  InstrumentSans[wdth,wght].woff2 (88,784 B, sha256 aa72922a...826d) and
  InstrumentSans-Italic[wdth,wght].woff2 (94,888 B, sha256 e958f71f...9ba5),
  OFL.txt (sha256 9e27a72e...f966).
- Martian Mono: evilmartians/mono release v1.1.0 (commit 8ffa86c2),
  martian-mono-1.1.0-variable.zip (sha256 b8773097...0867), its
  MartianMonoVF.woff2 (83,044 B, sha256 7cdf8e98...238a, wdth 75-112.5 for
  the code's font-stretch), the commit's OFL.txt (sha256 ddafd2c3...c256).
- head-end.html: @font-face for each with font-display: swap and the
  same family names, a preload for the upright Instrument Sans, and a
  comment recording every font's source, pin and full SHA-256s,
  Departure Mono's included.
- TestNoThirdPartyLoads (internal/cli/docgen/site_test.go): lint:docs
  runs it on the site it builds (DOCS_SITE); it fails on any link,
  script, img/srcset, iframe, source, video, object, SVG image/use,
  style attribute, <style> block or stylesheet url()/@import pointing at
  a host other than hugo.yaml's and next.yaml's baseURL. TestPageLoads
  covers the scanner.
- Branding links each font to its upstream repo and its served license;
  Contributing's Writing docs covers the fonts and the check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 12:32:19 -07:00
w3cjandClaude Opus 5.5 017cc90a4a test(state): devvm 0.1.0's state, frozen, read and upgraded by today's devvm
testdata/v0.1.0/{darwin,linux} hold what devvm 0.1.0 itself left: four
VMs, its defaults, its agent store and logins, its image and tool records
and each --json it printed. The TestV010 tests in internal/vm read and
write back every field, and fixture_v010.txtar runs today's devvm on it:
each --json keeps all of 0.1.0's, read-only commands change no file, and
launches start each VM without a Lima edit, naming Codex's unknown login
field as withheld. Contributing's Released state says the fixture is
frozen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 11:28:27 -07:00
w3cjandClaude Opus 5.5 423d3da279 refactor: owner rules from one source, and Contributing in topic pages
Contributing's table of the checks on owners is generated from ownerDocs
(TestOwnersDoc, -update), and TestOwnersAgree checks every owner the
structure test names has its row; the agent home-folder literals come
from agents.Defs. Contributing's index splits into topic pages (structure,
extending, cli, tests, docs), with the batch's own Contributing changes
in the pages that now hold their sections.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:06:28 -07:00
w3cjandClaude Opus 5.5 2b68a2347c feat(gitprotect): .git protection on Linux without root, through a user namespace around QEMU
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]>
2026-11-08 10:06:17 -07:00
w3cjandClaude Opus 5.5 d89f3501a2 refactor(gitprotect): one scan, a locker per platform, reports as a table
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]>
2026-11-08 10:06:07 -07:00
w3cjandClaude Opus 5.5 2865158e02 feat(network): learn the hosts a new VM needs, then lock it to them (#22)
--network learn runs a VM on the internet tier while it records the hosts
it reaches beyond its allowlist, shown as internet (learning). devvm
network lock picks which of them go into the VM's own rules, ticking only
reviewed registries on 443 and listing risky hosts apart, then gives the
VM the allowlist tier at once. learn is per VM only. The lock command
names its docs page in its about.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:59 -07:00
w3cjandClaude Opus 5.5 9b40a133ed fix(proxy): agents' logins swap only an exact placeholder, OpenRouter's below /api/ and in x-api-key too
A login binding's placeholder goes in only when its header's one value is
the placeholder alone, or Bearer and the placeholder in Authorization;
secrets keep substring replacement. Bindings gain an optional Path, below
which the value goes in (OpenRouter's /api/), and agents.Provider's
Header becomes Headers, so OpenRouter's key is bound in x-api-key too, for
its Anthropic models.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:51 -07:00
w3cjandClaude Opus 5.5 785fb4c1d4 fix(agents): Codex and Claude Code VMs get only the login fields devvm knows
The VM's copy of Codex's auth.json holds only codexKeep's fields, and its
~/.claude.json only claudeAccountKeep's oauthAccount fields; everything
else is withheld and named by path in login_fields_withheld, which
replaces login_kept. A declarative keep-list in format.go owns what each
format keeps or binds, and TestFormatsWithholdUnknown puts a canary in
every object of every format's golden login.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:41 -07:00
w3cjandClaude Opus 5.5 33ec9eb0dc refactor(tools): one definition per toolchain
Each toolchain is one image.ToolDef in image.SharedTools, which also
holds its guest environment, its PATH folders and its version files. They
leave base's devvm-tools.sh for /etc/devvm/toolchains.sh, which every
launch writes, so base.sh changes and every image rebuilds once. The
structure test's names rule fails on a toolchain's name as a literal
outside internal/image, TestToolchainsComplete checks the toolchains
page, and Contributing gains Adding a toolchain.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:29 -07:00
w3cjandClaude Opus 5.5 f5e6eebc55 refactor: one safe reader for files a VM can write
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]>
2026-11-08 10:05:22 -07:00
w3cjandClaude Opus 5.5 3e81767482 refactor(cli): each command carries its own docs link, group and samples
A command's metadata moves from hand-kept tables into the command itself:
an about (docs page, help group, why no --json) set as its Cobra
Annotations. msg.commandDocs, commandGroups and withoutJSON are gone;
TestDocLinks reads the links from the generated CLI reference, and help
output and the reference are byte-identical. AGENTS.md's cli and vm rows
point at new doc.go package comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:13 -07:00
w3cjandClaude Opus 5.5 fb19879aaa fix(msg): one rule for which characters reach the terminal
msg.Safe is the one owner: a graphic character in any script is safe;
controls, bidi controls, format characters, variation selectors, private
use and the invisible fillers are not. Printable and OneLine drop what
Safe refuses, agent save's diff escapes it, and forbidigo bans
unicode.IsGraphic, IsPrint, IsControl and Bidi_Control outside
internal/msg.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:04:59 -07:00
w3cjandClaude Opus 5.5 ae5c9b7221 docs(cli): reference pages keep their place when a command is added
Command pages carry no weight, so Hugo sorts the CLI section by title and
a new command changes only its own page, _index.md and devvm.md; the built
sidebar and index order are unchanged. TestPagesHaveNoWeight guards it,
and .gitattributes marks messages_gen.go and the CLI pages as generated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:04:38 -07:00
w3cjandClaude Opus 5.5 425a655ef6 test(vm): the test proxy's stop waits for its sleep to be reaped
testProxy's proxies are sleeps reaped by a goroutine, and its Args
names a pid for as long as the test runs, so a stopped one counts as
running until that goroutine reaps it. With Tick at 1 ms, Proxy.Stop
gives up after about 8 ms, which a busy runner can exceed:
TestUpLinksInvalid failed on macOS CI with "its proxy runs". Its Signal
now returns once the sleep it signalled has ended and been reaped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 01:30:18 -07:00
w3cjandClaude Opus 5.5 ffd0d3bcf8 fix(agents): placeholders carry the prefix the agent checks for (#32)
pi 1.5.0 takes an OpenAI key that doesn't start with sk- for a Sign in with
ChatGPT token and leaves max_output_tokens, temperature and the prompt cache
settings out of its requests. agents.Provider gets a Prefix, sk- for
OpenAI, and keyPlaceholder makes opencode's and pi's provider-key
placeholders with it first. TestInterceptWebSocket checks that a WebSocket
upgrade in an intercepted tunnel gets the key, and the network e2e checks
pi's OpenAI request in an API key's shape with the key the proxy put in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 00:54:16 -07:00
w3cjandClaude Opus 5.5 0f31804cad feat(agents): Gemini, Groq, Mistral, xAI and DeepSeek keys as protected placeholders (#31)
The model providers whose API keys the VM's proxy puts in for opencode and
pi are one table, agents.Providers (ID, name, hosts, header), from which the
bindings, devvm agent login --provider and its help, and the docs' table
derive (TestProvidersComplete). Google Gemini, Groq, Mistral, xAI and
DeepSeek join Anthropic, OpenAI and OpenRouter: the VM gets a placeholder,
and the proxy puts the key in, in the provider's header, for its hosts
alone. Binding wins over [pass-keys], and each launch notes a bound API key
that [pass-keys] still lists (login_pass_bound), never a bound OAuth login.

The docs and the note say that a key a VM was given before stays usable
wherever it was copied, that a bound key can mint credentials that work
without the proxy (Gemini's Live API ephemeral tokens, xAI's and OpenAI's
realtime client secrets), and that some providers' own tools fetch URLs the
VM names. The network e2e checks pi's Gemini key in x-goog-api-key, never
in the URL, and opencode's Groq key in its Authorization.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 00:54:10 -07:00
w3cjandClaude Opus 5.5 eaa1706966 docs: a unix socket's path has fewer than 104 characters
macOS's sun_path holds 104 bytes, its terminating NUL included, and Lima
refuses a socket path whose length is UNIX_PATH_MAX or more, so a path
has 103 characters at most. The internals pages (design, overview,
ports), AGENTS.md and the comments on paths.SocketMax, the forwarder's
control socket and the links' sockets said "at most 104"; they now say
fewer than 104, as the Lima backend page and NameMax already did. The
figures computed from the limit (a home folder of up to 37 characters,
ControlMax) already allowed for the NUL and stay as they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:26:55 -07:00
w3cjandClaude Opus 5.5 26a7aca55c fix(lima): a build VM's ssh port is never the one its clone kept
testdata/script/tools.txtar expects five numbered steps for each tool's
build, configure among them, and once counted three configure steps for
four tools. The cause wasn't load or a race in the stubs' state. A tool's
build VM is a clone of base, and the clone keeps the .ssh.localPort that
base's own build set. The only edit a tool build VM needs is its new ssh
port, chosen at random from 20000 to the host's ephemeral range, so when
the random port happened to be the clone's own (about 1 in 29,000 on
macOS and 1 in 12,800 on Linux, for each build), nothing differed,
Lima's start rightly made no edit, and the build's steps were numbered
[2/5] starting to [4/5] deleting.

ports.Allocator.Build now takes the port the VM's config already has and
never chooses it, so a build VM's start always edits its new port in and
its steps are the same every run. The test is unchanged: it checks what
it always meant to. TestBuild and TestStartBuildSSHPort check that a
build never gets the clone's port; the latter fails without the fix.
The tools script passed 20 runs in a row while mise run test ran
alongside, though at these odds a run that short can't show the flake
either way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:26:14 -07:00
w3cjandClaude Opus 5.5 77d2b202ab fix(agents): opencode's unknown providers' keys withheld by default, as pi's (#30)
opencode gets the rule pi got: an entry of its auth.json that devvm
neither binds nor passes reaches the VM's copy with only the fields
that name its account, with the login_withheld warning, which says to
list the provider under opencode in config.toml's [pass-keys]. A listed
provider's api entry goes whole, metadata included (login_passed), and
opencode 2's import brings every API key the copy holds into its
database. A bound API key's entry is {type, key: placeholder} alone, its
metadata kept on the host. pi's allowlist becomes withheldEntry and
withheldKeep, which both agents share; login_oauth_withheld goes.

A user with a local server's key in opencode sees it withheld after
upgrading, and the launch warning names the provider.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:47 -07:00
w3cjandClaude Opus 5.5 9f51e79421 refactor(agents): one definition per coding agent (#29)
Each coding agent gets one definition, an agents.Def in a new stdlib-only
leaf package, internal/agents, and everything else iterates over
agents.Defs: agentlogin's format per login kind, secrets' login kinds,
settings' [pass-keys], image.SharedTools, the vm package's store tables
and scripts, and cli's help lists. The VM copies of every login file,
their bindings, the store's layout, the scripts and the CLI reference
stay the same byte for byte, as golden tests made before the refactor
show.

The agents' guest variables leave base.sh for /etc/devvm/agents.sh,
written at every launch, so every image rebuilds once. Messages are
merged per agent (login_kept, login_passed, login_withheld,
login_oauth_withheld, agent_login_key_only). The structure test's new
names rule fails on an agent's name or login kind as a literal outside
internal/agents, and literals on one holding an agent's folder. Docs
link the supported coding agents rather than listing them, and
Contributing gains Adding a coding agent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:40 -07:00
w3cjandClaude Opus 5.5 84f1190b04 feat(agents): pi, as a fourth coding agent (#23)
Adds pi (earendil-works/pi) as a shared coding agent beside Claude
Code, Codex and opencode: --agents pi, devvm tools add pi, the new-VM
picker and devvm setup offer it. Its network policy allows pi.dev; base
sets PI_SKIP_VERSION_CHECK=1 and PI_TELEMETRY=0 and installs fd-find,
so base and every image on it build again once. The agent store mounts
and copies pi's settings, with keys redacted as JSON.

pi's auth.json is a new login kind: its API keys for Anthropic, OpenAI
and OpenRouter become per-VM placeholders the proxy fills in (devvm
agent login pi --api-key --provider PROVIDER), and everything else is
withheld by default, unless config.toml's [pass-keys] lists the
provider. pi's own account logins aren't supported, and pi has no musl
build, so a musl VM refuses it (image.ToolDef.GlibcOnly). Its sessions
go into devvm history export and import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:35 -07:00
w3cjandClaude Opus 5.5 cda2d09f42 feat(gitprotect): on Linux, warn at each launch and report .git hooks and config that changed (#20)
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]>
2026-11-07 19:16:30 -07:00
w3cjandClaude Opus 5.5 365e562cbc fix(gitprotect): lock only real git dirs, never a folder a VM names as one (#28)
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]>
2026-11-07 19:16:24 -07:00
w3cjandClaude Opus 5.5 bd00db91d4 fix(netpolicy): a VM saves a login only for an agent it has (#27)
The capturer fell back to every agent of OpenAI's token endpoint when
the VM's image had none of them, so any VM, even one with no agents,
could replace the store's Codex or opencode login with one of its
choosing. The capturer now keeps only those of the endpoint's agents
that the VM's image has, and picks among them by User-Agent. When none
is left, it refuses the capture for every agent, Claude Code included,
before the request leaves the host and again on the reply, and the
proxy's log names the new login_capture_refused.

Docs: coding-agents' Logins made in a VM, safety/network's agents'
logins, and internals/network's capture section state the rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:19 -07:00
w3cjandClaude Opus 5.5 cbe2947438 fix(history): opencode's database copy runs with sqlite 3.54 (#26)
With -bail, sqlite3 3.54's CLI stops after an SQL statement given with
-cmd and runs nothing else, exiting 0, so devvm_opencode_clean's VACUUM
INTO and every later step did nothing and the export would ship an empty
opencode.db. Each sqlite3 run now gets PRAGMA trusted_schema = OFF; first
in its own input, and passes no -cmd, which works with older and newer
sqlite3 alike.

The check now fails closed: the run that makes the copy prints the
database's count of tables, which must be above 0 and match the copy's,
and each of the final checks' statements must print exactly one 0, so
empty or short output fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:12 -07:00
CJandClaude Opus 5.5 81f3feeecf docs: each page's social card shows its title and what it covers (#21)
## What this changes

Every page on devvm.dev and next.devvm.dev gets its own Open Graph card,
which Hugo draws when it builds the site. Each card is the brand card
(the pixel logo with the lock, black, the lime bar, devvm.dev) with the
page's section in lime capitals, its title, and a short explainer of
what the page covers.

> [!NOTE]
> The six preview cards in `docs/og-preview/` were for review only.
`chore(docs): drop the preview social cards` removes them again, so the
squashed commit doesn't have them, and the images below still show from
the commit that added them.

- **The template**, `docs/assets/images/og-template.png`, is
`docs/static/images/social-card.png` with the headline and tagline rows
filled with the background's exact black. The repo has no SVG or
generator for the card: it was a headless Chrome screenshot of the logo
SVG and text. The old card has only four colors (`#000000`, `#7fff00`,
`#eeeeee`, `#8f93a2`) and no antialiasing, so filling those rows leaves
no marks. The logo, `devvm.dev` and the bar match the card pixel for
pixel, and the template has those four colors and nothing else.
- **The drawing**, `docs/layouts/_partials/og-image.html`, uses
`images.Text` with Departure Mono at multiples of 11px (22px for the
section label, 66, 55 or 44px for the title, whichever fits it in two
lines, and 33px for the explainer). Every line starts on a whole pixel,
so the generated cards also have exactly the template's four colors and
no antialiasing: they are as crisp as the logo. `og-wrap.html` wraps
lines by length, because the font is monospaced. The block is centered
between the logo and devvm.dev. The section is the page's section title,
*Docs* on a section's own page, and none on the home, branding and
taxonomy pages.
- **The font:** Departure Mono **v1.500**, the release the site's woff2
comes from (checked: the woff2 in the release zip is byte-identical to
`docs/static/fonts/departure-mono/DepartureMono-Regular.woff2`, sha256
`5b4fed1d…`, and so is the LICENSE). That release ships an OTF, not a
TTF. Hugo's `images.Text` reads it fine, so
`docs/assets/fonts/departure-mono/` has `DepartureMono-Regular.otf`
(sha256
`4d53f663155cf8bf7ffc8e688776e719625f7bbb80a8d90073438b249261a2e0`) and
its OFL. Source: `gh release download v1.500 -R
rektdeckard/departure-mono`, `DepartureMono-1.500.zip`, sha256
`bf3e48059aeef4617ec585bdea81dcc3491c576b3e7a472f52faf40e09ee5c3a`.
- **The tags:** `custom/head-end.html` writes `og:image`,
`og:image:type`, `og:image:width`/`height`, `og:image:alt` and
`twitter:image:alt`. The alt text is `devvm docs: TITLE: EXPLAINER`.
`_partials/_funcs/get-page-images.html` replaces Hugo's own, which
Hugo's `twitter_cards.html` and `schema.html` call, so `twitter:card` is
`summary_large_image` and `twitter:image` and `itemprop=image` are the
same card. `params.images` is removed from `hugo.yaml`, so Hextra's
`opengraph.html` writes no second `og:image`. In the built site, every
one of the 115 HTML pages (the 404 included) has exactly one `og:image`,
and each card is different.
- **The explainer** is a new front matter key, `explainer`, not
`description`. `description` is the page's meta description,
`og:description`, the search snippet and its `llms.txt` line. Those want
a sentence or two, and only two pages have one. A 4–9 word card line
would be a weak search snippet. Every hand-written page has one. The CLI
pages get their command's `Short` from `internal/cli/docgen` (`mise run
cli-docs` rerun), and the reference's index gets a fixed one. The home
page also sets `cardTitle: One VM for every project` (the hero's
headline), because its title, `devvm`, would repeat the logo.
- **The guard:** `TestExplainers` in
`internal/cli/docgen/explainer_test.go` fails when any page under
`docs/content` has no `explainer`. It also fails when the explainer
takes more than two card lines of 48 characters (33px), or when the
title (or `cardTitle`) takes more than two lines of 36 characters
(44px). Those are the card's real limits, and they also cover the
longest `Short`s. It runs in `mise run test` and in `mise run
lint:docs`, next to `TestDocLinks`. `TestFrontMatter` and
`TestWrappedLines` cover its parsing.
- **Docs:** Contributing › Writing docs describes the cards, the key and
the test. The branding page says each page has its own card.
`social-card.png` stays as the brand asset.

### Numbers

| | Before (main) | After |
| --- | --- | --- |
| Built site (`hugo -s docs --minify`, apparent size) | 40,194 KB |
42,138 KB (+1.9 MB) |
| Cards | 1 static card | 115 PNGs, 14.9–16.6 KB each, 1.84 MB total |
| Build time, image cache cold (`--ignoreCache`) | ~1.0 s | 1.4–1.95 s |
| Build time, image cache warm | ~1.0 s | ~1.0 s |

The cards are smaller than the prototype's estimate (about 16 KB, not
22–34 KB), because they have only four colors.

next.devvm.dev: `hugo -s docs --minify --config hugo.yaml,next.yaml`
gives `og:image`, `twitter:image` and `itemprop=image` as
`https://next.devvm.dev/images/og-template_hu_….png` on every page.

### Examples

| Home | Short title |
| --- | --- |
|
![home](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/home.png?raw=true)
|
![Installing](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/getting-started-install.png?raw=true)
|
| **Longest title (two lines)** | **CLI page, longest explainer** |
| ![What devvm keeps on this
machine](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/using-space.png?raw=true)
| ![devvm
limactl](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/cli-devvm-limactl.png?raw=true)
|
| **Section index** | **How it works page** |
| ![Using
devvm](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/using.png?raw=true)
| ![.git
protection](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/internals-git-protection.png?raw=true)
|

### Every page's card

From a local `hugo -s docs --minify` build. "(none)" is a page whose
card has no section label or no explainer. The 404 page's card, titled
*404 Page not found*, isn't listed.

| Section | Page | Title | Explainer | Card |
| --- | --- | --- | --- | --- |
| (none) | `/branding/` | Branding | devvm's logo, icons, colors and
fonts | 15.6 KB |
| (none) | `/categories/` | Categories | (none) | 15.0 KB |
| Docs | `/docs/backends/` | Backends | The program that runs devvm's
VMs | 15.7 KB |
| Backends | `/docs/backends/lima/` | Lima | What Lima needs, and how
devvm uses it | 15.7 KB |
| CLI reference | `/docs/cli/devvm_adopt/` | devvm adopt | Give this
folder the VM made for an earlier folder or path | 16.3 KB |
| CLI reference | `/docs/cli/devvm_agent_import/` | devvm agent import |
Copy the agents' settings and logins from this machine into devvm's
store | 16.6 KB |
| CLI reference | `/docs/cli/devvm_agent_login/` | devvm agent login |
Log an agent in, in this folder's VM, and save the login in devvm's
store | 16.6 KB |
| CLI reference | `/docs/cli/devvm_agent_save/` | devvm agent save |
Copy the agents' settings from this folder's VM into devvm's store |
16.5 KB |
| CLI reference | `/docs/cli/devvm_agent/` | devvm agent | Fill devvm's
store of the agents' settings and logins that every VM gets | 16.6 KB |
| CLI reference | `/docs/cli/devvm_build/` | devvm build | Build an
image and the images under it, unless they're built | 16.4 KB |
| CLI reference | `/docs/cli/devvm_clone/` | devvm clone | Show or
change whether this folder's VM has its own clone of the repo | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_code/` | devvm code | Open this
folder's VM in VS Code over Remote-SSH | 15.9 KB |
| CLI reference | `/docs/cli/devvm_completion/` | devvm completion |
Print the shell completion script for bash, zsh or fish | 16.3 KB |
| CLI reference | `/docs/cli/devvm_desktop/` | devvm desktop | Open this
folder's VM's desktop in a VNC viewer | 16.0 KB |
| CLI reference | `/docs/cli/devvm_doctor/` | devvm doctor | Check what
devvm needs on this machine | 15.8 KB |
| CLI reference | `/docs/cli/devvm_gc/` | devvm gc | Delete stale
images, unused tools, old files and the Nix cache over its cap | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_git-protect/` | devvm git-protect |
Show or change .git protection for this folder's VM | 16.3 KB |
| CLI reference | `/docs/cli/devvm_group_join/` | devvm group join | Put
this folder's VM in a group of VMs | 15.9 KB |
| CLI reference | `/docs/cli/devvm_group_leave/` | devvm group leave |
Take this folder's VM out of its group | 16.0 KB |
| CLI reference | `/docs/cli/devvm_group/` | devvm group | Show the
group this folder's VM is in | 15.9 KB |
| CLI reference | `/docs/cli/devvm_history_export/` | devvm history
export | Save this folder's VM's agent history to a .tar.gz | 16.5 KB |
| CLI reference | `/docs/cli/devvm_history_import/` | devvm history
import | Put an export of agent history into this folder's VM | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_history/` | devvm history | List the
saved exports of agents' history | 16.0 KB |
| CLI reference | `/docs/cli/devvm_host/` | devvm host | Get this
folder's VM ready for ssh and editors, and show its host name | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_images_rm/` | devvm images rm |
Delete images, by name or by key | 15.9 KB |
| CLI reference | `/docs/cli/devvm_images/` | devvm images | List the
images and the shared tools | 15.9 KB |
| CLI reference | `/docs/cli/devvm_layer_add/` | devvm layer add | Make
this folder's VM again with more layers, then open a shell in it | 16.6
KB |
| CLI reference | `/docs/cli/devvm_layer_new/` | devvm layer new | Start
a layer of your own | 15.8 KB |
| CLI reference | `/docs/cli/devvm_layer_rm/` | devvm layer rm | Make
this folder's VM again without some of its layers, then open a shell in
it | 16.6 KB |
| CLI reference | `/docs/cli/devvm_layer/` | devvm layer | Make image
layers of your own, or change this folder's VM's layers | 16.6 KB |
| CLI reference | `/docs/cli/devvm_limactl/` | devvm limactl | Run
Lima's limactl for debugging, which starts VMs unconfined, whatever
their tier | 16.6 KB |
| CLI reference | `/docs/cli/devvm_link_add/` | devvm link add | Link
this folder's VM to a port of another VM | 16.0 KB |
| CLI reference | `/docs/cli/devvm_link_publish/` | devvm link publish |
Show or add the ports this folder's VM offers to links | 16.3 KB |
| CLI reference | `/docs/cli/devvm_link_rm/` | devvm link rm | Remove
one of this folder's VM's links | 15.8 KB |
| CLI reference | `/docs/cli/devvm_link_unpublish/` | devvm link
unpublish | Stop offering ports of this folder's VM to links | 16.1 KB |
| CLI reference | `/docs/cli/devvm_link/` | devvm link | List this
folder's VM's links to your other VMs | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ls/` | devvm ls | List the project
VMs | 15.7 KB |
| CLI reference | `/docs/cli/devvm_network_allow/` | devvm network allow
| Allow hosts for this folder's VM | 15.9 KB |
| CLI reference | `/docs/cli/devvm_network_deny/` | devvm network deny |
Deny hosts for this folder's VM | 15.9 KB |
| CLI reference | `/docs/cli/devvm_network_log/` | devvm network log |
Show what this folder's VM connected to and what its proxy blocked |
16.5 KB |
| CLI reference | `/docs/cli/devvm_network_rm/` | devvm network rm |
Remove rules from this folder's VM | 15.8 KB |
| CLI reference | `/docs/cli/devvm_network/` | devvm network | Show or
change the network tier of this folder's VM | 16.2 KB |
| CLI reference | `/docs/cli/devvm_ports_add/` | devvm ports add |
Forward more ports from this folder's VM | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ports_rm/` | devvm ports rm | Stop
forwarding some ports from this folder's VM | 16.1 KB |
| CLI reference | `/docs/cli/devvm_ports/` | devvm ports | Show or
change which ports this folder's VM forwards | 16.3 KB |
| CLI reference | `/docs/cli/devvm_rebuild/` | devvm rebuild | Build an
image again, and delete the old one | 16.0 KB |
| CLI reference | `/docs/cli/devvm_restart/` | devvm restart | Restart
this folder's VM and open a shell in it | 16.0 KB |
| CLI reference | `/docs/cli/devvm_retention/` | devvm retention | Show
or change what devvm deletes on its own | 15.9 KB |
| CLI reference | `/docs/cli/devvm_rm/` | devvm rm | Delete this
folder's VM, or a VM whose folder is gone | 16.1 KB |
| CLI reference | `/docs/cli/devvm_secret_rm/` | devvm secret rm |
Delete a saved secret | 15.7 KB |
| CLI reference | `/docs/cli/devvm_secret_set/` | devvm secret set |
Save a secret on this machine | 15.8 KB |
| CLI reference | `/docs/cli/devvm_secret_unuse/` | devvm secret unuse |
Stop this folder's VM using a secret | 16.0 KB |
| CLI reference | `/docs/cli/devvm_secret_use/` | devvm secret use | Let
this folder's VM use a secret | 15.8 KB |
| CLI reference | `/docs/cli/devvm_secret/` | devvm secret | List the
secrets kept on this machine, for VMs to use | 16.2 KB |
| CLI reference | `/docs/cli/devvm_setup/` | devvm setup | Choose base's
features, and new VMs' size, network tier, coding agents and layers |
16.6 KB |
| CLI reference | `/docs/cli/devvm_size/` | devvm size | Show or change
this folder's VM's size | 15.9 KB |
| CLI reference | `/docs/cli/devvm_space/` | devvm space | Show what
devvm keeps on this machine and the space it takes | 16.3 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent_add/` | devvm ssh-agent add
| Load a key into devvm's own SSH agent | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent_rm/` | devvm ssh-agent rm |
Remove a key from devvm's own SSH agent | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent/` | devvm ssh-agent | Show
or change SSH agent forwarding for this folder's VM | 16.4 KB |
| CLI reference | `/docs/cli/devvm_stop/` | devvm stop | Stop this
folder's VM | 15.6 KB |
| CLI reference | `/docs/cli/devvm_tools_add/` | devvm tools add | Add
shared tools to this folder's VM, then open a shell in it | 16.3 KB |
| CLI reference | `/docs/cli/devvm_tools_rm/` | devvm tools rm | Take
shared tools out of this folder's VM, then open a shell in it | 16.3 KB
|
| CLI reference | `/docs/cli/devvm_tools_update/` | devvm tools update |
Move this folder's VM to the newest shared tools, then open a shell in
it | 16.5 KB |
| CLI reference | `/docs/cli/devvm_tools/` | devvm tools | Show or
choose this folder's VM's shared tools | 15.9 KB |
| CLI reference | `/docs/cli/devvm_update/` | devvm update | Bring this
folder's VM up to date, then open a shell in it | 16.3 KB |
| CLI reference | `/docs/cli/devvm_upgrade/` | devvm upgrade | Install
devvm's newest release | 15.8 KB |
| CLI reference | `/docs/cli/devvm/` | devvm | Open a shell in this
folder's VM, creating it first | 16.1 KB |
| Docs | `/docs/cli/` | CLI reference | Every devvm command, with its
arguments and flags | 16.1 KB |
| Docs | `/docs/contributing/` | Contributing | Build devvm, run its
tests and follow its rules | 15.8 KB |
| Contributing | `/docs/contributing/maintaining/` | Maintaining | Bump
pinned versions, release devvm and run the docs sites | 16.3 KB |
| Contributing | `/docs/contributing/testing/` | Testing on other hosts
| Run devvm's tests on Linux, x86_64 and other hosts | 16.3 KB |
| Getting started | `/docs/getting-started/commands/` | Everyday
commands | The commands you use most, in their groups | 16.0 KB |
| Getting started | `/docs/getting-started/first-vm/` | Your first VM |
Make a project's VM and start an agent in it | 16.0 KB |
| Docs | `/docs/getting-started/` | Getting started | From installing
devvm to your first VM | 15.9 KB |
| Getting started | `/docs/getting-started/install/` | Installing |
Install devvm and check what it needs | 15.8 KB |
| (none) | `/docs/` | Docs | The guides, in the order you'll need them |
15.6 KB |
| How it works | `/docs/internals/backends/` | Backends | What a backend
gives devvm, and how VMs are named | 16.1 KB |
| How it works | `/docs/internals/design/` | Design notes | Why devvm is
built this way, and what's open | 15.9 KB |
| How it works | `/docs/internals/desktop/` | The desktop | How devvm
desktop serves a VM's desktop | 15.9 KB |
| How it works | `/docs/internals/git-protection/` | .git protection |
What devvm locks in .git, and when | 15.9 KB |
| How it works | `/docs/internals/images/` | Images and caching | How
images and shared tools are built and cached | 16.2 KB |
| Docs | `/docs/internals/` | How it works | How devvm works, for
reviewers and contributors | 15.9 KB |
| How it works | `/docs/internals/install/` | Installing and updating |
What the install script and devvm doctor check | 16.1 KB |
| How it works | `/docs/internals/lima/` | Lima | How devvm sets up,
confines and clones Lima's VMs | 16.0 KB |
| How it works | `/docs/internals/network/` | Network tiers | How the
proxy confines VMs and keeps your secrets | 16.2 KB |
| How it works | `/docs/internals/overview/` | Overview | What devvm
does at each step of a VM's life | 15.8 KB |
| How it works | `/docs/internals/ports/` | Port forwarding | How devvm
forwards a VM's ports to this machine | 16.1 KB |
| How it works | `/docs/internals/security/` | Security model | What
devvm protects, how, and what it doesn't | 16.0 KB |
| Staying safe | `/docs/safety/attack-vectors/` | Attack vectors |
Common attacks, and what devvm does about each | 15.9 KB |
| Staying safe | `/docs/safety/git-protection/` | .git protection | Keep
code in the VM out of your .git | 16.0 KB |
| Docs | `/docs/safety/` | Staying safe | How devvm keeps untrusted code
off your machine | 16.0 KB |
| Staying safe | `/docs/safety/network/` | Network tiers | Choose what
each VM can reach on the network | 15.9 KB |
| Using devvm | `/docs/using/clone/` | Working on a clone | Give a VM
its own clone of the repo | 15.9 KB |
| Using devvm | `/docs/using/coding-agents/` | Coding agents | Run
Claude Code, Codex and opencode in a VM | 16.0 KB |
| Using devvm | `/docs/using/command-line/` | The command line | Help,
flags, questions, JSON output and completion | 16.3 KB |
| Using devvm | `/docs/using/customizing/` | Customizing images | Add
your own layers and choose base's features | 16.1 KB |
| Using devvm | `/docs/using/desktop/` | A VM's desktop | Add a desktop
to a VM and open it | 15.8 KB |
| Using devvm | `/docs/using/devcontainer/` | devcontainer.json | Set up
a VM from a project's devcontainer.json | 16.1 KB |
| Using devvm | `/docs/using/from/` | Starting from a container image |
Start base from a Debian, Ubuntu or Alpine image | 16.6 KB |
| Using devvm | `/docs/using/images/` | Images and tools | The images
VMs are made from, and their tools | 16.1 KB |
| Docs | `/docs/using/` | Using devvm | What you change in your VMs as
you work | 15.9 KB |
| Using devvm | `/docs/using/limits/` | Known limits | What devvm can't
do, and where | 15.7 KB |
| Using devvm | `/docs/using/links/` | Links between VMs | Let one VM
reach a service in another by name | 16.1 KB |
| Using devvm | `/docs/using/ports-size/` | Ports and size | Forward a
VM's ports and change its size | 15.9 KB |
| Using devvm | `/docs/using/settings/` | Settings and files | The files
you edit and the files devvm keeps | 16.2 KB |
| Using devvm | `/docs/using/space/` | What devvm keeps on this machine
| Each file devvm keeps, and how it's cleaned up | 16.5 KB |
| Using devvm | `/docs/using/ssh/` | SSH and editors | Reach VMs by name
from ssh and VS Code | 15.9 KB |
| Using devvm | `/docs/using/toolchains/` | Toolchains | The toolchains
VMs get, and the files that choose them | 16.2 KB |
| Using devvm | `/docs/using/troubleshooting/` | Troubleshooting | What
to do when something fails | 15.9 KB |
| Using devvm | `/docs/using/upgrading/` | Upgrading and uninstalling |
Upgrade devvm, or remove it and what it keeps | 16.5 KB |
| Using devvm | `/docs/using/vms/` | Managing VMs | Open, stop, delete
and list your VMs | 15.9 KB |
| (none) | `/` | One VM for every project | An isolated sandbox for you
or a coding agent | 16.1 KB |
| (none) | `/tags/` | Tags | (none) | 14.9 KB |

## How it was tested

- `mise run fmt && mise run lint && mise run test` passes on macOS.
`mise run lint:docs` passes: markdownlint, Vale, lychee, `TestDocLinks`,
`TestCommandLines`, `TestExplainers` and the `--panicOnWarning` build.
- I built devvm.dev and next.devvm.dev, checked that every HTML page has
exactly one `og:image`, and opened the cards for the home page, a short
title, the longest title, the longest CLI explainer, a section index, a
How it works page and the 404. I checked each card's color histogram:
four colors, so there's no antialiasing and no marks from the template.
- No e2e: the change is docs only.

## Checklist

- [x] The title is a Conventional Commit, `type(scope): summary`,
because it becomes the squashed commit's subject.
- [x] `mise run fmt && mise run lint && mise run test` passes.
- [x] New behaviour has tests, and every behaviour change updates its
page in `docs/content/docs/`.
- [x] A changed command follows the cli skill, and `mise run cli-docs`
is rerun when its help changed. (No command changed. `cli-docs` was
rerun for the generated explainers.)
- [x] Nothing here belongs in a private security advisory instead (see
SECURITY.md).

**Ready to merge:** the previews are removed and main (#25) is merged
in. The gate passes on macOS (2362 tests).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 15:17:55 -07:00
Jürgen ŠuvalovandClaude Fable 5.1 72f6284eb9 fix(lima): VM names leave the NUL byte out of the ssh socket's path (#25)
`NameMax` budgets for `paths.SocketMax - 1`, as
`ControlMax` does, and the Lima package's own copy of the limit goes, so
`paths.SocketMax` is the one owner. On the edge case above, devvm now
picks a one-character-shorter folder part,
`devvm-jyrkki-webs-fbe3918054ffd3`, and the VM is made. The Lima limits
page says a socket path has fewer than 104 characters.

Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-11-07 15:01:08 -07:00
CJandClaude Opus 5.5 72b648df31 feat(release): prereleases on the Homebrew tap, as devvm-rc (#19)
Prereleases now reach the Homebrew tap through a second formula, `devvm-rc`. The stable `devvm` formula stays on the last final release.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 11:36:20 -07:00
CJ c27b913b17 build(release): 0.1.1-rc.1, and its changelog entry (#18)
VERSION is 0.1.1-rc.1, and CHANGELOG.md has its entry, which becomes the release candidate's notes on GitHub.

Refs #1
2026-11-07 11:03:56 -07:00
CJandClaude Opus 5.5 8d8da01037 feat(tools): dotnet, the .NET SDK, as a shared toolchain (#7)
Adds `dotnet`, the .NET SDK, as a fifth shared toolchain next to node,
python, rust and go. `--tools dotnet`, `devvm tools add dotnet` and the
picker offer it, and a folder with `*.sln`, `*.slnx`, `*.csproj`,
`*.fsproj` or `global.json` at its top level suggests it in the new VM's
summary, the way `package.json` suggests node.

Refs #2. Thanks to @jsskeen-utah for the detailed request.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 10:44:25 -07:00
CJandClaude Opus 5.5 da804f0568 ci: devvm.dev shows the latest release's docs, next.devvm.dev shows main's (#16)
Two docs sites, from one Docs workflow (`.github/workflows/docs.yml`):

- **devvm.dev** shows the latest release's docs. The `release` job
builds a tag's `docs/` and the `deploy` job deploys it to GitHub Pages
(`github-pages` environment), on a published release that isn't a
prerelease, and on a `workflow_dispatch` with `site=devvm.dev` and `ref`
(a release tag; empty means the latest release, from `gh release view`).
The tag is checked against `^v[0-9]+\.[0-9]+\.[0-9]+$` through `env:`
before it's used, and checked out as `refs/tags/<tag>`. Pushes to main
no longer deploy devvm.dev.
- **next.devvm.dev** shows main's docs. On pushes to main that touch the
docs (the same paths anchor), or a dispatch with `site=next.devvm.dev`,
`check` lints and builds, then `next` builds with `hugo -s docs --minify
--config hugo.yaml,next.yaml`, checks out devvmhq/docs-next with
`DOCS_NEXT_DEPLOY_KEY` (environment `docs-next`, only after the build),
replaces everything but README.md, and commits `Build from devvm <short
sha>` as github-actions[bot], skipping an unchanged build. Its
concurrency group keeps pushes from racing.
- `docs/next.yaml` sets `baseURL: https://next.devvm.dev/`, Hextra's
`params.banner` (a note that links devvm.dev), and `noindex` both as a
site param and through `cascade`, so Hextra's head writes `noindex,
nofollow` on every page. `docs/layouts/robots.txt` adds `Disallow: /`
when the site's `noindex` is set. The build stays in Hugo's production
environment, so Hextra's minified, fingerprinted assets are the same as
devvm.dev's.
- PRs get the same lint and build as before, and nothing runs with an
environment or a secret on `pull_request`. Permissions: `contents: read`
at the top; only `deploy` has `pages: write` and `id-token: write`. The
publishing jobs set `cache: false` on mise-action (zizmor's
cache-poisoning, now that the workflow publishes on `release`), and so
does `check`.
- Docs: Contributing's Maintaining has a new section, The docs sites
(what deploys each, the hand redeploy, the key and environments,
Cloudflare Pages serving devvmhq/docs-next); Contributing's two mentions
of the deploy point at it; Upgrading's Trying a prerelease links
next.devvm.dev.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 09:02:34 -07:00
CJandClaude Opus 5.5 b3a188712f fix(tools): the host's mise trusts the system's and devvm's CAs (#9)
devvm's host mise didn't trust the CAs in ~/.config/devvm/ca, so behind a
network that inspects TLS, resolving the shared tools' versions failed with
UnknownIssuer and a message to check the connection.

The host mise and its download now trust the folder's checked CAs: mise gets
them as MISE_EXTRA_CA_CERTS, and on Linux also an SSL_CERT_FILE bundle of the
system's roots plus those CAs (SSL_CERT_DIR only when the user set neither
variable). On macOS, mise's Sigstore client still needs the CA trusted in the
Keychain, as the docs say. A certificate failure now shows tools_untrusted,
pointing at the CA docs.

Refs #1

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 08:33:56 -07:00
CJandClaude Opus 5.5 63e41118c6 feat(release): release candidates and betas, as GitHub prereleases (#13)
devvm can ship prereleases, such as release candidates and betas, for
people to try before a release is out. A prerelease's version is
`x.y.z-<word>.N`, such as `0.2.0-rc.1` or `0.2.0-beta.2`. `VERSION`
holds it, the tag is `v0.2.0-rc.1`, and it gets a `CHANGELOG.md` entry
as usual.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 23:36:15 -07:00
CJandClaude Opus 5.5 3c4e90da0c fix(tools): opencode's backend is named, so mise's registry can't move it to npm (#10)
## What this changes

**The cause.** The pin bump in 588ba6f9 moved devvm's mise, on the host
and in VMs, from 2026.10.7 to 2026.11.3. Starting with mise 2026.10.9
(jdx/mise#14295), mise's registry puts npm first for opencode 2.x. Here
is `registry/opencode.toml` at each version:

```toml
# v2026.10.7
backends = ["aqua:anomalyco/opencode"]

# v2026.11.3
backends = [
  { full = "npm:@opencode/cli", min_version = "2.0.0", options = { allow_builds = ["@opencode/cli"] } },
  "aqua:anomalyco/opencode",
]
```

devvm named opencode only as `opencode = "2"`, so mise 2026.11.3
resolved it to `npm:@opencode/cli`. That lock entry has no download for
any platform. As a result, every resolve warned that opencode 2.2.5
isn't published for every platform, opencode's tool image couldn't be
built, and the e2e check "the shared tools resolve to upstream's newest"
failed on every machine. opencode's GitHub releases still ship v2
binaries for every platform, musl included, along with a `SHA256SUMS`.

**The fix.** `assets/shared-tools/mise.toml` now has a `[tool_alias]`
table. It names the backend of every shared tool that isn't one of
mise's own `core:` tools, so the registry's choice can't move them:

- `opencode = "github:anomalyco/opencode"`: its GitHub releases. With
mise 2026.11.3, the aqua backend now gives opencode.ai URLs, and on musl
it gives the glibc tarball. The github backend gives musl VMs opencode's
own `-musl` build and records `provenance = "github-attestations"`.
- `claude`, `codex`, `pnpm` and `uv` keep the aqua backends they already
resolve to, so their lock entries are unchanged. They are named because
each of them already lists a second backend in the registry (http, npm,
npm, and asdf/pipx). That is how opencode's switch happened.
- node, bun, python, go and rust are mise's `core:` tools. None of them
changed between 2026.10.7 and 2026.11.3, so they are not aliased.

The other two places where mise picks a backend now follow the same
table:

- The step back (`lockVersions`) locks older versions from the backend
the newest one came from.
- Each project VM's `/etc/mise/config.toml` gets the same table, sent as
`tool-alias.toml` in the setup. Without it, the VM's mise 2026.11.3
reports opencode's backend as npm, and a non-shared version would be
installed from npm.

`tests/e2e-mise.lock` was resolved again with mise 2026.11.3 through
`scripts/bump.sh e2e-tools`. It now has lockfile version 4 and opencode
from GitHub. codex stays at 0.166.0, because mise's latest for codex is
still the older 0.163.0.

**The guard.** `TestToolBackendsNamed` fails in two cases: when a shared
tool that isn't on a `core:` backend has no `[tool_alias]` entry, and
when an alias isn't the backend that `tests/e2e-mise.lock` resolved. On
main it would have failed for claude, codex, opencode, pnpm and uv. The
existing download-per-platform check (`TestE2ELockPins`) couldn't catch
this regression, because the e2e lock had never been resolved again with
2026.11.3. `TestAliases` covers the VM's table, and
`TestRefreshStepsBack` now checks the step back's `mise.toml`.

Docs: internals/images.md (Versions) explains the aliases.
contributing/maintaining.md says where a new shared tool's alias goes
and what the test checks.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 18:52:16 -07:00
CJandClaude Opus 5.5 062c89c913 ci: the docs deploy from main only when the docs change (#12)
## What this changes

The Docs workflow deploys from `main` only when a push changes the docs:
`docs/**`, Markdown files, the Vale and markdownlint config, or
`docs.yml` itself. Both triggers use one path list (a YAML anchor), so
they can't drift apart. `workflow_dispatch` still deploys by hand.

Why it's safe:
- The site is built from `docs/` alone; Hugo mounts nothing outside it.
- The generated CLI reference is in `docs/content/docs/cli/`, and
`TestReferenceIsCurrent` makes a help change commit it there, so those
pushes still deploy.
- The Hextra theme's version is in `docs/go.mod`, so its updates still
deploy.
- CI's `mise run lint` runs the docs checks (Vale, markdownlint,
`TestDocLinks`, `TestCommandLines`) on every code change, so skipping
this workflow loses no checking.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 18:50:29 -07:00
dependabot[bot] a965e68651 build(deps): bump github.com/spf13/pflag from 1.0.9 to 1.0.10 in the go group across 1 directory (#8)
Updates github.com/spf13/pflag from 1.0.9 to 1.0.10: a deprecation comment fix (spf13/pflag#447) and no errors.Is, for old Go versions (spf13/pflag#448).

https://github.com/spf13/pflag/compare/v1.0.9...v1.0.10

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-06 18:33:05 -07:00
w3cjandClaude Opus 5.5 770cb99329 build(deps): go-i18n 2.7.0, and pflag stays on 1.0.x
pflag 1.1 prints every boolean flag as --flag[=true|false] in the help, with no way to turn
it off, so Dependabot ignores pflag 1.1 and later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 12:53:26 -07:00
w3cjandClaude Opus 5.5 588ba6f9a1 build: bump docker 29.9.3, mise 2026.11.3, rustup 1.29.3, oh-my-bash, tealdeer 1.9.1 and the --from digests
docker 29.9.3, containerd 2.4.2, buildx 0.38.1, compose 5.7.0, model 1.2.9;
mise 2026.11.3 (VMs and the host mise); rustup 1.29.3; oh-my-bash 94c2977;
tealdeer 1.9.1; e2e's node:24 and alpine:3 digests. Every checksum is from
upstream's published sums.

bump.sh's value check now knows a Go constant's camelCase *Digest name, which
it refused before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:53:56 -07:00
w3cjandClaude Opus 5.5 1276474123 ci: a weekly check of the pins scripts/bump.sh keeps, as an issue
Mondays, scripts/bump.sh --check runs and its outdated lines go into one
open issue, "Pinned versions to bump", created or updated with gh and
--body-file; with none left the issue is closed. bump.sh's output passes
through files only. maintaining.md says what to do with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:36:38 -07:00
w3cjandClaude Opus 5.5 22387c5b78 fix(scripts): bump.sh --check never offers an older version as the latest
When upstream's latest is a version older than the pin (a release marker
that lags, as codex's and opencode's have), report() says the pin is newer
and neither counts it as outdated nor bumps it. Digests and dated releases
are compared as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:32:37 -07:00
w3cjandClaude Opus 5.5 c3a262bec9 ci: Dependabot's updates come monthly
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:31:30 -07:00
w3cjandClaude Opus 5.5 5fb0732580 ci: Dependabot's weekly updates for Go modules and pinned actions, a week after each release
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:25:51 -07:00
w3cjandClaude Opus 5.5 1a6d653431 chore(github): a pull request template, and every pull request asks the maintainer for a review
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:25:51 -07:00
w3cjandClaude Opus 5.5 57cf548b31 ci: pull request titles follow Conventional Commits, as squash merges take them as the subject
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:18:53 -07:00
w3cjandClaude Opus 5.5 b24da31e41 build: Lima 2.3 in CI, bump.sh e2e-lima, and Lima 2.2 as devvm's minimum
CI's e2e workflow installs Lima 2.3.0, its tarball's checksum taken from the release's SHA256SUMS, checked against the sha256 Lima's release notes publish. scripts/bump.sh e2e-lima moves that pin the same way. devvm's doctor, install.sh, the README and the Lima page ask for Lima 2.2 or newer, compared by major and minor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 09:57:01 -07:00
w3cjandClaude Opus 5.5 f3e4753445 build(release): the Homebrew formula installs the release's signed binary
The formula has an archive per platform (macOS and Linux, arm64 and
Intel), each URL and checksum filled in by release.sh from the
SHA256SUMS it wrote, and installs only the binary; no Go dependency.
release.sh --formula-from DIR writes the formula for a published
release from its downloaded SHA256SUMS, checked against minisign.pub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 09:34:18 -07:00
1306 changed files with 123496 additions and 12962 deletions

No files matched your search

+14 -11
View File
@@ -9,22 +9,22 @@ devvm's command line should be easy to learn: once you know a few commands, you
The reasoning behind most rules is in the [Command Line Interface Guidelines](https://clig.dev/), and the mechanics of commands, flags and groups are in [Cobra's docs](https://cobra.dev/docs/). Read them there, because this skill doesn't restate them. It says only what devvm decided and how devvm's code does it.
[judgment.md](judgment.md) explains, with examples, the rules that no test can check: where a command goes, rm or unX, which commands are settings, what an argument is, what a destructive command does, and how help and usage errors are worded. [Contributing](../../../docs/content/docs/contributing/_index.md) covers the code: [Command arguments](../../../docs/content/docs/contributing/_index.md#command-arguments) for the checks in `internal/cli/args.go`, [JSON output](../../../docs/content/docs/contributing/_index.md#json-output) for `--json`, [A command's help](../../../docs/content/docs/contributing/_index.md#a-commands-help) for help and groups, and [The CLI rule tests](../../../docs/content/docs/contributing/_index.md#the-cli-rule-tests) for what each test checks.
[judgment.md](judgment.md) explains, with examples, the rules that no test can check: where a command goes, rm or unX, which commands are settings, what an argument is, what a destructive command does, and how help and usage errors are worded. [Contributing](../../../docs/content/docs/contributing/_index.md) covers the code: [Command arguments](../../../docs/content/docs/contributing/cli.md#command-arguments) for the checks in `internal/cli/args.go`, [JSON output](../../../docs/content/docs/contributing/cli.md#json-output) for `--json`, [A command's help](../../../docs/content/docs/contributing/docs.md#a-commands-help) for help and groups, and [The CLI rule tests](../../../docs/content/docs/contributing/cli.md#the-cli-rule-tests) for what each test checks.
## The tree
devvm has 33 commands at the top, plus help. Each one is in a group of the root's help, in this order. The table shows each command with its subcommands and the values a setting takes, and each command's help lists its flags.
devvm has 36 commands at the top, plus help. Each one is in a group of the root's help, in this order. The table shows each command with its subcommands and the values a setting takes, and each command's help lists its flags.
| Group | Commands |
| --- | --- |
| Your VM | devvm, with --tools, --agents and --layers; restart, stop, update, rm [VM], adopt [VM], ls, code, desktop, host, history, history export [FILE], history import [FILE] |
| Change your VM | tools (a picker in a terminal), tools add\|rm TOOL..., tools update; size, with --cpus, --memory and --disk; ports [all\|none\|LIST], ports add\|rm LIST; network [open\|internet\|allowlist\|none], network allow\|deny\|rm RULE..., network log; ssh-agent [on\|devvm\|off], ssh-agent add\|rm KEY_FILE; git-protect [on\|strict\|off]; clone [on\|off]; secret, secret set\|rm\|use\|unuse NAME; layer add\|rm LAYER... |
| Your VM | devvm, with --tools, --agents and --layers; restart, stop, update, rm [VM], adopt [VM], ls, code, cursor, desktop, host, history, history export [FILE], history import [FILE], paste, paste rm |
| Change your VM | tools (a picker in a terminal), tools add\|rm TOOL..., tools update; size, with --cpus, --memory and --disk; mount-cache [none]; ports [all\|none\|LIST], ports add\|rm LIST; network [open\|internet\|learn\|allowlist\|none], network allow\|deny\|rm RULE..., network log, network lock, network transparent [on\|off]; ssh-agent [on\|devvm\|off], ssh-agent add\|rm KEY_FILE; git-protect [on\|off]; clone [on\|off], clone fetch, clone add PATH; secret, secret set\|rm\|use\|unuse NAME; layer add\|rm LAYER... |
| Links between VMs | group, group join NAME, with --as NAME, group leave; link, link add\|rm TARGET PORT, with --as NAME on add; link publish [PORTS], link unpublish PORTS |
| Images | images, images rm IMAGE\|KEY..., build IMAGE, rebuild IMAGE, layer new NAME |
| Disk space | space, gc, retention [KEY=VALUE...] |
| This machine | setup, agent, agent import [AGENT...], agent login AGENT, agent save [AGENT...], doctor, upgrade, completion SHELL, limactl [ARGS...] |
size, ports and network take `-g` for what new VMs get. Every command takes `-h`/`--help`, `--no-input` and `-v`/`--verbose`, and the root takes `--version`. `devvm --help` prints the tree as it is, and `commandGroups` in `internal/cli/help.go` holds the groups. A subcommand can sit in a group other than its parent's, as layer add and layer rm do, and `devvm --help` then lists it by both names in that group.
size, ports and network take `-g` for what new VMs get. Every command takes `-h`/`--help`, `--no-input` and `-v`/`--verbose`, and the root takes `--version`. `devvm --help` prints the tree as it is. `helpGroups` in `internal/cli/help.go` holds the groups, in order, and each command names its own group in its `about`. A subcommand can sit in a group other than its parent's, as layer add and layer rm do, and `devvm --help` then lists it by both names in that group.
## The rules
@@ -43,6 +43,7 @@ Each rule says what it looks like in devvm, and what checks it. A test's name me
11. **Usage errors are devvm messages, checked before anything runs.** They name the argument or the values the command expected, and `usage_help` follows each one with the command's own `--help`. `TestUsageErrorsEveryCommand` checks that each one is a usage error and nothing runs, and the wording is by hand ([usage errors](judgment.md#usage-errors)).
12. **devvm takes no word of its own.** `devvm WORD` is an unknown command, a usage error (`checkWord` in `internal/cli/word.go`), so an image's, a shared tool's or a layer's name is never a command line's word, and a layer may have a command's name. A toolchain's, an agent's or a layer's name points to its flag (`no_command_part`), and any other word gets a did-you-mean over the commands. `TestUnknownWord` checks it.
13. **Exit codes are 0 for success, 1 for a failure, 2 for a usage error and 130 for an interrupt.** `TestExecuteExitCodes` and `TestRanErrorIsAFailure` check them.
14. **Slow work shows a status line.** Anything that can take noticeable time, such as a host command, host git, a command in a VM, a backend's `limactl list`, a request over the network, a walk of the user's folders, a `diskutil` lookup or a wait for a lock or a timeout, runs under the UI's status line: a `LoggedCmd` step, or the Reporter's `Status` with a label from `locales/en.toml`, such as `defer e.Status(msg.ReadingVMs())()`. Work that takes the terminal, such as a VM's shell or `ssh-add` asking for a passphrase, never runs under one. A wait for a lock passes the lock a `platform.Waiting` with its own label (`msg.Waiting`), so it shows only while another devvm holds the lock. The structure test's `status-lines` rule (`statusSites`), `TestLaunchStatusLines`, `TestCommandStatusLines` and `TestSSHAddOffStatusLine` check it, and whether a label says what the user waits for is by hand ([status lines](../../../docs/content/docs/contributing/cli.md#status-lines)).
## Adding a command
@@ -54,13 +55,14 @@ Work through this list for each new command, in order, then run [the review](#re
4. **Add its flags** in the command's own `Flags()`, reusing an adder from `internal/cli/flags.go` or a flag name that already means the same thing. A new flag name means one thing, and its help text is lower case without a full stop, with its value as a backticked placeholder, such as ``the `N` CPUs the VM gets``. Check a flag's value in `checkFlagValue` and flags that can't go together with `exclusive`.
5. **Settings:** when the command shows a setting bare and changes it with a value, wrap its `Args` in `showsOnly`, and give it `-g` (`--global`) when new VMs have a default for it ([settings](judgment.md#settings)).
6. **Questions:** every question the command asks needs a flag or a command that answers it beforehand, declared where it's asked: `u.Ask(msg.X(...).AnsweredBy("--flag"))`, so its refusal names it. A command that deletes takes `addForceFlag`, asks only without `--force`, with `AnsweredBy("--force")`, and returns the question's error ([destructive commands](judgment.md#destructive-commands)).
7. **Output:** when it shows or lists something, give it `jsonFlag`, a struct of its own with snake_case `json` tags, `printJSON`, a row in `TestJSONShapes` and a section with an example on its docs page. Otherwise add it to `withoutJSON` in `internal/cli/json_test.go` with why.
8. **Help:** write a `Short`, a `Long` of one to three sentences and an `Example` from `examples()`, with the docs-voice skill ([help](judgment.md#help)). Add its path to `commandDocs` in `internal/msg/docs.go`, pointing at the user page that covers it, and add a root command to its group in `commandGroups`.
7. **Output:** when it shows or lists something, give it `jsonFlag`, a struct of its own with snake_case `json` tags, `printJSON`, a row in `TestJSONShapes` and a section with an example on its docs page. Otherwise say why it has none in its `about`'s `noJSON`, such as `noJSON: "it deletes"`.
8. **Help:** write a `Short`, a `Long` of one to three sentences and an `Example` from `examples()`, with the docs-voice skill ([help](judgment.md#help)). Set its `Annotations` from an `about` (`internal/cli/help.go`): `docs`, the user page that covers it as `page#anchor`, and for a root command its `group`, one of `helpGroups`, such as `Annotations: about{docs: "using/vms#listing-vms", group: groupVM}.annotations()`.
9. **Messages:** every message goes in `locales/en.toml`, with the docs-voice skill's Messages rules, and then `go generate ./internal/msg`. A usage error names what the command expected ([usage errors](judgment.md#usage-errors)). The command fails by returning its error from `RunE`, as `failed(err, msg.XFailed)` when the error may not be a message, or through `a.env`, which does the same, and never prints the failure itself, because `execute` shows it (`TestExecuteShowsEachFailure`).
10. **Register it** with `AddCommand` in `NewRoot` (`internal/cli/root.go`) or under its noun, and write it in its own file, `internal/cli/<command>.go`, named in AGENTS.md's Layout row for `internal/cli`.
11. **Tests:** add a CLI test in `testdata/script/` for what it does and for each refusal, with `DEVVM_MESSAGES=names`. Add the command's arguments to `argSamples` in `internal/cli/args_test.go` when `TestUseMatchesArgs` asks for them.
12. **Docs:** add the command to its group's table on the Commands page (`docs/content/docs/getting-started/commands.md`), and to the page that `commandDocs` names, with the docs-voice skill. Then run `mise run cli-docs` and commit the pages it writes.
13. **The gate:** `mise run fmt && mise run lint && mise run test`.
10. **Status lines:** wrap each step that can take noticeable time in a status line, with a label message of its own, a lowercase phrase in `-ing` such as `reading the VMs`, and keep it off a step that takes the terminal. Its Go test records the label with a `msg.Fake`'s `OnStatus` or `Showing` ([status lines](../../../docs/content/docs/contributing/cli.md#status-lines)).
11. **Register it** with `AddCommand` in `NewRoot` (`internal/cli/root.go`) or under its noun, and write it in its own file, `internal/cli/<command>.go`, with what completes its arguments and flags (`ValidArgsFunction`, `RegisterFlagCompletionFunc`) set there too.
12. **Tests:** add a CLI test in `testdata/script/` for what it does and for each refusal, with `DEVVM_MESSAGES=names`. Add a sample value to `argSamples` in `internal/cli/args_test.go` when `TestUseMatchesArgs` asks for one, for a placeholder no command had, and a command on this folder's VM to `folderCommands` in `internal/cli/flags_test.go`.
13. **Docs:** add the command to its group's table on the Commands page (`docs/content/docs/getting-started/commands.md`), and to the page its `about` names, with the docs-voice skill. Then run `mise run cli-docs` and commit the pages it writes.
14. **The gate:** `mise run fmt && mise run lint && mise run test`.
## Changing a command
@@ -77,6 +79,7 @@ Run the command's help and read the code, then check what the tests can't:
- **Destructive commands:** it asks unless given `--force`, its question answered by `--force` and refused where devvm can't ask, and `--force` never deletes more than the command does without it. Deleting more has its own flag.
- **Help:** the `Short` names what it acts on, such as this folder's VM, the `Long` says what it does, and the rules and edge cases go on the docs page. The examples start with the common case, and each comment says what that line does.
- **Usage errors:** each one names the argument or the values the command expected, as the `Use` shows them.
- **Status lines:** each slow step shows one whose label says what the user waits for, a caller's status line that `statusSites` names covers the call, and none spans a step that takes the terminal.
- **The tree:** `devvm --help` still matches [the tree](#the-tree), and the Commands page's tables match `devvm --help`.
Then run the gate, and read the command's page in `docs/content/docs/cli/` as a user would.
+7 -5
View File
@@ -1,18 +1,20 @@
# The rules a reviewer checks
The tests in [The CLI rule tests](../../../docs/content/docs/contributing/_index.md#the-cli-rule-tests) check a command's shape: its names, its flags, its help's parts and its `--json`. They can't tell whether a command is in the right place, whether its arguments are the right ones, or whether its words help the user. Those choices are yours, and this page explains each one with examples from devvm's own commands. Each section ends with the question to ask in a review.
The tests in [The CLI rule tests](../../../docs/content/docs/contributing/cli.md#the-cli-rule-tests) check a command's shape: its names, its flags, its help's parts and its `--json`. They can't tell whether a command is in the right place, whether its arguments are the right ones, or whether its words help the user. Those choices are yours, and this page explains each one with examples from devvm's own commands. Each section ends with the question to ask in a review.
## Where a command goes
A command is either a verb on this folder's VM or a noun with its verbs.
- **A bare verb acts on this folder's VM.** devvm restart, devvm stop and devvm rm need no argument, because the VM is the folder's. devvm code, devvm desktop and devvm adopt are verbs of the same kind.
- **A bare verb acts on this folder's VM.** devvm restart, devvm stop and devvm rm need no argument, because the VM is the folder's. devvm code, devvm cursor, devvm desktop and devvm adopt are verbs of the same kind.
- **Anything else goes under its noun.** A secret is a thing of its own, so saving one is devvm secret set, not devvm save-secret. A rule belongs to the network policy, so adding one is devvm network allow, not devvm allow. A key belongs to devvm's own SSH agent, so loading one is devvm ssh-agent add.
- **A bare noun shows or lists.** devvm secret lists the secrets, devvm images lists the images, and devvm history lists the exports, so none of them has an `ls` or `show` subcommand. devvm ls is the one list at the top, because it lists every VM rather than something of this folder's VM.
- **The exceptions stay at the top:** ls, build, rebuild, gc, setup, doctor, upgrade, completion and limactl. Each is a verb a user reaches for by name, and moving build under images, as devvm images build, would make the most common image command the hardest to find. upgrade acts on devvm itself, not on this folder's VM, and it's the name other tools give the same verb. Add to that list only when the same is true, and say why in the commit.
Links between VMs follow the rule. A link is a thing of this folder's VM, so it's a noun: devvm link lists the VM's links, devvm link add TARGET PORT makes one, and devvm link rm TARGET PORT removes it. devvm group is a noun too, with devvm group join NAME and devvm group leave.
An editor devvm opens the VM in is a bare verb named after its command, as devvm code is VS Code's `code` and devvm cursor is Cursor's `cursor`. A name an editor shares with an agent is the editor's at the top, and the agent is reached only through `--agents`, as in `devvm --agents cursor`. The agent's own commands in the VM are `cursor-agent` and `agent`, so the two never meet on a command line.
When a command could go in two places, put it where a user who knows the rest of the tree would look first. A user who wants to stop forwarding a port types devvm ports, because the ports are what change, and finds devvm ports rm there.
**In a review:** would a user who knows devvm ports and devvm network guess this command's name?
@@ -34,11 +36,11 @@ Don't name a command `delete`, `remove` or `disable`, because rm and unX cover t
A setting is a value devvm keeps, which a user reads and changes. Each setting is one command that does both:
- **Bare, it shows the value.** devvm size shows the VM's CPUs, memory and disk, devvm ports shows what it forwards, and devvm git-protect shows its `.git` protection.
- **With a value, it changes it.** devvm ports none, devvm network open, devvm ssh-agent devvm and devvm git-protect strict each set the value. devvm size takes its values as `--cpus`, `--memory` and `--disk`, because it holds three, and devvm retention takes `KEY=VALUE` words, because it holds many.
- **With a value, it changes it.** devvm ports none, devvm network open, devvm ssh-agent devvm and devvm git-protect off each set the value. devvm size takes its values as `--cpus`, `--memory` and `--disk`, because it holds three, and devvm retention takes `KEY=VALUE` words, because it holds many.
- **With `-g`, it shows or changes what new VMs get.** devvm size -g --memory 16, devvm ports -g none and devvm network -g none change the defaults. A setting takes `-g` only when new VMs get a default for it, so devvm git-protect, devvm ssh-agent and devvm clone have none, and devvm retention is about the whole machine.
- **With `--json`, it only shows.** `showsOnly` refuses a value, so devvm network --json off is a usage error and changes nothing.
The commands that are settings are size, ports, network, ssh-agent, git-protect, clone and retention. devvm clone holds whether the VM has its own clone of the repo, the setting `--clone` gives a new VM, and setting it makes the VM again, as devvm layer add does. tools isn't one, because its value is a list that devvm tools add and devvm tools rm change, and that devvm tools shows in a terminal as a picker whose changes become add and rm. setup isn't one either: it asks the first-run questions, and its flags, `--features` and `--agents`, answer the two that no other command sets.
The commands that are settings are size, mount-cache, ports, network, network transparent, ssh-agent, git-protect, clone and retention. devvm mount-cache holds how a Linux host's VM caches its project folder, and takes one value, none, the only mode devvm sets, as a word rather than a bare opt-in command, so it reads as what it shows and stays the same should another mode be worth setting. It has no `-g`, because every new VM gets none. devvm network transparent has no `-g` either: a VM without its own value follows config.toml's `transparent-proxy` as it is at each launch, so there's no default new VMs take. devvm clone holds whether the VM has its own clone of the repo, the setting `--clone` gives a new VM, and setting it makes the VM again, as devvm layer add does. tools isn't one, because its value is a list that devvm tools add and devvm tools rm change, and that devvm tools shows in a terminal as a picker whose changes become add and rm. setup isn't one either: it asks the first-run questions, and its flags, `--features` and `--agents`, answer the two that no other command sets.
A command is a setting when its bare form shows one value and the user can type the new value after its name. When the value is a list that grows and shrinks, give it add and rm, as devvm ports has besides devvm ports LIST.
@@ -78,7 +80,7 @@ A command that takes out only what the user named, and what one command puts bac
A command's help is short, and its docs page holds the rest. Write it with the docs-voice skill.
- **`Short` is an action on a named thing.** "Delete this folder's VM", "Forward more ports from this folder's VM" and "Load a key into devvm's own SSH agent" each say what happens and to what. A noun's `Short` says what it shows: "List the secrets kept on this machine, for VMs to use". A settings command starts with "Show or change", as in "Show or change this folder's VM's size".
- **`Long` says what the command does in one to three sentences.** devvm rm's says what it deletes, that it asks in a terminal, and that it exports the agents' history unless `--no-export` is given. Edge cases, limits and how it works go on the docs page that `commandDocs` names.
- **`Long` says what the command does in one to three sentences.** devvm rm's says what it deletes, that it asks in a terminal, and that it exports the agents' history unless `--no-export` is given. Edge cases, limits and how it works go on the docs page that its `about` names.
- **The examples start with the common case.** devvm rm's first example is devvm rm, then devvm rm --force, then devvm rm --no-export. Each comment says what that line does, in lower case, such as "delete it without asking, as a script must". A noun's examples can show its subcommands, as devvm secret's show devvm secret set github.
- **A flag's help is a short phrase in lower case without a full stop,** with its value as a backticked placeholder, such as ``the `N` CPUs the VM gets``. A default goes at its end in parentheses, as in "(default: devvm ports -g, else all)".
- **The same thing has the same words everywhere.** Say this folder's VM, new VMs, devvm's own SSH agent and shared tools, as the docs-voice skill's Terms say. A flag shared between commands has one help text, unless `manyUses` in `internal/cli/flags_test.go` says why it differs.
@@ -0,0 +1,69 @@
---
name: codebase-standards
description: devvm's standards for keeping its code clean and safe, as a short checklist for a commit and a review, drawn from what reviews of devvm's history kept finding (fallbacks that fail open, unbounded or trusted input from a VM, secrets in arguments, hand-rolled parsers, swallowed errors, processes without an owner, runs that a kill or a second devvm breaks, slow work with no status line, copies of an owner, running VMs at an upgrade, overclaims, fixes without a failing test, tests that need one machine), and how new code matches the existing code's style. Use before a commit, when reviewing a change or a branch, and when a review's finding may be one a standard covers.
---
# devvm's codebase standards
Reviews of devvm's code kept finding the same mistakes, in code that different people and agents wrote for different features. This skill turns each of those into a standard, so a change meets it before a review has to find it, and it says how new code matches the code already there. It isn't a rulebook to apply line by line: a standard matters where a change touches its ground, and each one is here because it recurred or because missing it was costly.
- [standards.md](standards.md) has a section for each standard: the rule, what the reviews found, sometimes a pair of devvm's code that breaks it and code that keeps it, and its guard.
- [rules.md](rules.md) lists the rules that AGENTS.md and the Contributing pages hold, each with what guards it, so a reviewer knows what the gate checks and what's left to read.
A command follows the [cli skill](../cli/SKILL.md), prose and messages follow the [docs-voice skill](../docs-voice/SKILL.md), and a sandbox or a backend's emulation gets its threat check with the security-audit skill, so this skill doesn't restate them.
## The checklist
Go through the items that a change touches. Each links to its section in [standards.md](standards.md).
Safety:
1. **[Fail closed, on every path.](standards.md#fail-closed-on-every-path)** A refusal, a failure or a retry leaves things as strict as they were, and a weaker mode is visible, documented and chosen.
2. **[Bound what you don't control.](standards.md#bound-what-you-dont-control)** What a VM or another process can make devvm read, hold or wait for has a cap in size, count and time.
3. **[Treat what a VM can write as hostile.](standards.md#treat-what-a-vm-can-write-as-hostile)** Reach its files by descriptor, check what it hands back, escape its text, and run nothing it can plant.
4. **[Keep secrets and host data on the host.](standards.md#keep-secrets-and-host-data-on-the-host)** A secret stays out of arguments and shared environments, and only an allowlist crosses into a VM.
5. **[Parse once, with a real parser.](standards.md#parse-once-with-a-real-parser)** The function that checked a value reads it, and an address check knows IPv6.
Failures and processes:
1. **[Never fail silently, and name the real cause.](standards.md#never-fail-silently-and-name-the-real-cause)** An error is never dropped without a reason, and a message names the cause the code found.
2. **[Give every process an owner that ends it.](standards.md#give-every-process-an-owner-that-ends-it)** A context cancels it, something waits for it, and an accept loop goes on through `daemon.AcceptRetry`.
3. **[Survive a kill and a second devvm.](standards.md#survive-a-kill-and-a-second-devvm)** One good copy survives every step, and an OS file lock guards a change, with the state read again under it.
4. **[Show what devvm waits for.](standards.md#show-what-devvm-waits-for)** Slow work runs under a status line, a `Status` or a `LoggedCmd` step with a label message, never across work that takes the terminal, and its test records the label.
Changes:
1. **[Extend the owner, and wait for a third copy.](standards.md#extend-the-owner-and-wait-for-a-third-copy)** Find the owner first, and give a judge one owner at once.
2. **[Mind what's already running and released.](standards.md#mind-whats-already-running-and-released)** The CHANGELOG says what a running VM keeps, and a change to state runs on every frozen fixture.
3. **[Claim only what the code does, where precision belongs.](standards.md#claim-only-what-the-code-does-where-precision-belongs)** Precise pages hold every limit, and headline pages keep their short claims.
Tests:
1. **[Prove each fix with a test that fails without it.](standards.md#prove-each-fix-with-a-test-that-fails-without-it)** Its oracle comes from outside the code, an absence check has a control, and a sandbox is proven by attacking it.
2. **[Write tests that pass on any host, at any load.](standards.md#write-tests-that-pass-on-any-host-at-any-load)** A test stays off the real clock, assumes nothing about the machine, and uses stubs that behave like the real tool.
## Match the codebase
New code reads like the code around it. Before writing, read a neighbour in the same package and follow it. These are the habits that hold across the codebase, each with a place to see it:
- **Names** are short and plain: `bounded`, `target`, `parsePort`, `vmLog`, and a getter has no `Get` prefix. A file holds one concern and is named for it in lower case, its words run together, such as `linksession.go` or `cloneseed.go`. A `_` in a file's name marks a build tag, a test, a generated file or a part of a parent's file, such as `internal/cli`'s `gc_caches.go` for a subcommand, since each Cobra command has its own file. A large package maps its files in a `doc.go`, as `internal/vm/doc.go` does, or in a README, as `internal/proxy` does.
- **Comments** are full sentences that say what a thing is and why it's that way, starting with its name, as `bounded` in `internal/vm/bounded.go` explains why its buffer isn't embedded. A struct's fields have a comment each where the name isn't enough, as in `vm.Options` and `vm.Env`. A test starts with a comment that states the behavior it checks, and comments describe the code as it is, never its history.
- **Errors** that the user sees are messages: `msg.PortInvalid(strconv.Quote(v)).Because(err)`, never prose built with `fmt` ([Messages](../../../docs/content/docs/contributing/cli.md#messages)). An error usually passes up as it is, as `return err`. When a caller adds context, the wrap is lower case, says what was being done or on what, and uses `%w`, such as `fmt.Errorf("reading devvm's %s: %w", name, err)` or `fmt.Errorf("backend %s: %w", name, err)`. A sentinel is a package-level `ErrX` or `errX` from `errors.New`, such as `safefile.ErrTooLong`, and callers test it with `errors.Is`.
- **Dependencies are fields.** A type's dependencies and test seams are exported fields that its constructor fills and a test replaces, as `NewEnv` fills `vm.Env`'s and a test changes the ones it needs. A call's choices go in a struct of fields, as `vm.Options` holds what `devvm` was asked for, never functional options. A package's type embeds the one `msg.Reporter` its constructor takes, and a package-level variable is rare enough that the structure test lists each one.
- **Tests** are table tests next to the code, as a map from input to what's wanted, as `TestPortsRows` has, or a slice of structs (`for _, tc := range []struct{…}{…}`), with `t.Run` where cases need names of their own. They use the standard library alone, with no assertion library, call `t.Fatal` on a setup step's error, and name the case and what came out against what was wanted, such as `t.Errorf("rows for %s: %v, want %s", shown, got, want)`. They compare a message by its ID (`msg.IDOf`, `msg.Recorder`) and run host commands through `stubtest` ([Go test helpers](../../../docs/content/docs/contributing/tests.md#go-test-helpers)).
- **Scripts in the VM** follow AGENTS.md's rules for bash 3.2 and pins, and they run on every base devvm supports, Alpine's BusyBox included, which has no `findmnt`.
- **Prose** follows the docs-voice skill, and Go follows [Go conventions](../../../docs/content/docs/contributing/_index.md#go-conventions), which the linters and the structure test enforce.
## Reviewing a change
1. **Read the whole diff,** and the code around each change, because a path used twice or a copy of an owner spans more than the lines that changed.
2. **Check each standard the change touches,** and the style of the code it adds against its neighbours.
3. **Check the claims** that the change adds or touches, in the docs, the CHANGELOG, comments and the commit message, against the code.
4. **Prove the fixes:** revert each fix and run its test, which must fail.
5. **Hand off what another skill owns:** a command to the cli skill's review, prose to the docs-voice skill, and a sandbox or a backend's emulation to the security-audit skill.
6. **Run the gate,** `mise run fmt && mise run lint && mise run test`, and the end-to-end sections for what changed when the change touches VMs.
7. **Report each finding** with the standard it breaks, where it is and what would fix it. A finding that no standard covers is fine to report as it is.
## Adding a standard
A finding becomes a standard when it has recurred, or when missing it was costly, and when a contributor can apply it while writing or reviewing a change. A one-off, a rule that a linter or a test already enforces, or a detail of one backend doesn't qualify. Before adding one, look for a standard it extends, because a short list gets used. A new standard gets a section in [standards.md](standards.md) with its rule, what the reviews found and its guard, and a line in the checklist. When a check that enforces it lands, the standard names that check as its guard.
+113
View File
@@ -0,0 +1,113 @@
# The rules with an owner elsewhere
These rules are written in [AGENTS.md](../../../AGENTS.md) and the [Contributing](../../../docs/content/docs/contributing/_index.md) pages, which stay their one home. Each table gives a rule in a few words, links to where it's written in full, and names what guards it, so a reviewer can skip what the gate already checks and read for the rest. A guard that names a test or a linter fails the gate when the rule breaks, except for the end-to-end checks, which `mise run e2e` runs, and the CI jobs a row names. "Review only" means nothing fails, so the reviewer checks it.
## Go code
| Rule | Written in | Guard |
| --- | --- | --- |
| Only `internal/ui` prints, and only `cmd/devvm` calls `os.Exit` | [Go lint rules](../../../docs/content/docs/contributing/_index.md#go-lint-rules) | forbidigo (`fmt.Print*`, `os.Stdout`, `os.Stderr`, `os.Exit`) |
| A function takes its caller's context, and a fresh one says why | [Go lint rules](../../../docs/content/docs/contributing/_index.md#go-lint-rules) | forbidigo (`context.Background`, `context.TODO`), contextcheck |
| Every `//nolint` names its linters and says why | [Go lint rules](../../../docs/content/docs/contributing/_index.md#go-lint-rules) | nolintlint |
| A function stays within 100 statements, 160 lines and a cognitive complexity of 75 | [Go lint rules](../../../docs/content/docs/contributing/_index.md#go-lint-rules) | revive |
| No type has more than 24 methods, no `func init`, and few package vars | [The structure test](../../../docs/content/docs/contributing/structure.md#the-structure-test) | the structure test's `max-methods`, `no-init` and `package-vars` |
| Packages import only down their layers | [The structure test](../../../docs/content/docs/contributing/structure.md#the-structure-test) | the structure test's `layers` |
| Test seams are fields, never package vars | [Go conventions](../../../docs/content/docs/contributing/_index.md#go-conventions) | reassign, and the structure test's `package-vars` |
| Dependencies stay on the allowlist, and the proxy's packages use the standard library alone | [Go lint rules](../../../docs/content/docs/contributing/_index.md#go-lint-rules) | depguard |
| External tools run as commands, through the UI's `LoggedCmd`, a backend's `Runner` or `internal/hostgit` | [CLI conventions](../../../docs/content/docs/contributing/cli.md#cli-conventions) | the structure test's `owners` (`commands`, `execSites`) |
| A string that goes into a shell is quoted with `shell.Quote` | [Go conventions](../../../docs/content/docs/contributing/_index.md#go-conventions) | the structure test's `literals` (`'\''` outside `internal/shell`), and `TestEmbeddedScripts` for scripts in Go strings |
| A `Wait`'s error and a `strconv` parse's are never assigned to `_` outside tests, but where `droppedErrors` says why | [The structure test](../../../docs/content/docs/contributing/structure.md#the-structure-test) | the structure test's `dropped-errors` (`droppedErrors`) |
| An `io.ReadAll` outside tests reads through an `io.LimitReader`, but where `unboundedReads` says why | [The structure test](../../../docs/content/docs/contributing/structure.md#the-structure-test) | the structure test's `read-limits` (`unboundedReads`) |
| Two folders' identities are compared only by `platform.SameFolder`, but where `exactFolderIDs` says why | [The structure test](../../../docs/content/docs/contributing/structure.md#the-structure-test) | the structure test's `folder-ids` (`exactFolderIDs`) |
| Code for one system goes behind build tags in `internal/platform` | [Go conventions](../../../docs/content/docs/contributing/_index.md#go-conventions) | forbidigo for the host's CPUs, memory and free space outside `internal/platform`, and the rest is review only |
| devvm builds with `CGO_ENABLED=0` | [Go conventions](../../../docs/content/docs/contributing/_index.md#go-conventions) | `mise.toml` and `.goreleaser.yaml` set it, and CI's `nocgo` job runs `internal/landlock`'s and `internal/proxy`'s tests that way |
| A nil value that may reach a dereference is fixed or triaged | [Nil checks](../../../docs/content/docs/contributing/_index.md#nil-checks) | `mise run nilaway` and CI's `nilaway` job, which warn without failing, and `mise run nilaway:linux`, which fails on a new finding or a stale baseline line and must pass before a push to `main` |
| A dependency with a known vulnerability is updated | [Tools and tasks](../../../docs/content/docs/contributing/_index.md#tools-and-tasks) | `mise run vuln` and CI's `vuln` job |
## Owners
| Rule | Written in | Guard |
| --- | --- | --- |
| Before adding a helper, a parser, a path, a reader, a message or a table, extend its owner | [One owner for each concern](../../../docs/content/docs/contributing/structure.md#one-owner-for-each-concern) | the checks below where an owner has one, and otherwise review only and [the consolidation pass](../../../docs/content/docs/contributing/structure.md#the-consolidation-pass) before a release |
| Each owner that has a check: `fetch`'s HTTP clients, `daemon`'s signals, `state`'s whole files, `safefile`'s reads, `paths`' folders and home, `msg.Safe`, `proxy.Public`, `proxy.NormHost`, `vmname.VM`, `redact.Secret`, `hostgit`, the agents' and toolchains' registries, and the rest | [The checks on owners](../../../docs/content/docs/contributing/structure.md#the-checks-on-owners) | the check each row of that table names, a forbidigo rule or the structure test, with `TestOwnersDoc` and `TestOwnersAgree` keeping the table and the checks together |
| A file a VM can write or swap is changed through what opened it, never by its path, in `internal/proxy`, `internal/vmlog` and `internal/vmssh` | [The checks on owners](../../../docs/content/docs/contributing/structure.md#the-checks-on-owners) | forbidigo (`os.Chmod`, `os.Chtimes`, `os.Chown`, `os.Lchown`, `os.Truncate`), with a `nolint` that says why for a socket devvm has just made |
| A secret's value is a `redact.Secret`, revealed only where it's used, and a file that holds one writes it through its own wire type | [Secrets in the code](../../../docs/content/docs/contributing/structure.md#secrets-in-the-code) | forbidigo (`Reveal`), the structure test's checks of embedding and `Reveal() string`, and `TestSecret`, while a new secret held in a string is review only |
| Two places that must agree but can't be one have a test that they agree | [Agreement tests](../../../docs/content/docs/contributing/structure.md#agreement-tests) | each pair's own test, such as `TestDefsComplete` and `TestToolchainsComplete`, while a new pair is review only |
## Processes and goroutines
| Rule | Written in | Guard |
| --- | --- | --- |
| Every goroutine has something that waits for it, or says why nothing does | [The structure test](../../../docs/content/docs/contributing/structure.md#the-structure-test) | the structure test's `goroutines` (`goroutineSites`) |
| A package that starts goroutines checks for leaks | [Goroutine leaks](../../../docs/content/docs/contributing/tests.md#goroutine-leaks) | the structure test's `goroutines`, which requires `leaktest.Main`, and `leaktest.Check` in a test that starts and stops them |
| The startup check only reports, and devvm never installs host software without asking | [AGENTS.md's Rules](../../../AGENTS.md#rules) | review only |
| A command fails by returning its error, and `execute` alone prints it | [CLI conventions](../../../docs/content/docs/contributing/cli.md#cli-conventions) | `TestExecuteShowsEachFailure`, and forbidigo's printing rule |
| Whatever a failure would leave registers a cleanup with `AddCleanup`, which gets a fresh context | [CLI conventions](../../../docs/content/docs/contributing/cli.md#cli-conventions) | review only |
| A VM's state changes through `state.VM.Update`, under its lock, taken in order | [The checks on owners](../../../docs/content/docs/contributing/structure.md#the-checks-on-owners), in its paragraph on `vm.json` | `TestLockOrder`, as test builds panic on a lock taken out of order, and forbidigo's `os.WriteFile` rule |
## The command line and messages
| Rule | Written in | Guard |
| --- | --- | --- |
| A new or changed command follows the cli skill's checklist, then its review | [the cli skill](../cli/SKILL.md) | the tests each of its rules names, and its review for the rest |
| Arguments and flag values are checked before anything runs, and a usage error exits with 2 | [Command arguments](../../../docs/content/docs/contributing/cli.md#command-arguments) | `TestUsageErrorsEveryCommand` |
| Every message is in `locales/en.toml`, called through its generated function, with its doc link | [Messages](../../../docs/content/docs/contributing/cli.md#messages) | `TestGeneratedFileIsCurrent`, `TestEveryMessageRenders`, `TestEveryMessageIsUsed` and `TestDocLinks` |
| Prose is never built with `fmt` | [Messages](../../../docs/content/docs/contributing/cli.md#messages) | review only |
| Every question declares what answers it | [Questions](../../../docs/content/docs/contributing/cli.md#questions) | `TestQuestionsDeclareAnswers` |
| Slow work runs under a status line, a `Status` with a label message or a `LoggedCmd` step, and none spans work that takes the terminal | [Status lines](../../../docs/content/docs/contributing/cli.md#status-lines) | the structure test's `status-lines` (`statusSites`), a lock's wait included, a test build's panic on a `nil` `Waiting` (`platform.CheckWaiting`), forbidigo's `syscall.Flock` rule, `TestLaunchStatusLines` and `TestCommandStatusLines` for the backend's calls, `TestVMLockWaits` and `TestCheckLayoutWaits` for the state's locks, `TestSSHAddOffStatusLine` for `ssh-add`, and `TestMessagesClearTheStatusLine`, `TestQuestionsHoldTheStatusLine`, `TestSecretAndPickerHoldTheStatusLine`, `TestTerminalHoldsTheStatusLine` and `TestStatusLinesNest` for the UI, while a caller's status line that `statusSites` names, a backend's methods in a command the tests don't run, and a wait's label are review only |
| Tests check which message and with what, never its wording | [Names mode](../../../docs/content/docs/contributing/cli.md#names-mode) | the CLI tests run in names mode unless a script turns it off, while a Go test is review only |
| Messages follow the docs voice, only shorter | [the docs-voice skill's Messages](../docs-voice/SKILL.md#messages) | review only, with its `scan.sh` |
## State and releases
| Rule | Written in | Guard |
| --- | --- | --- |
| Every release's state keeps working, and its frozen fixture is never edited | [Released state](../../../docs/content/docs/contributing/structure.md#released-state) | `TestFixtureVMStates`, `TestFixtureVMsRead`, `TestFixtureSettings`, `TestFixtureAgentStore`, `TestStateFixturesListed`, `TestFixtureScripts` and the `fixture_v*.txtar` scripts, and a review checks that a fixture's files are unchanged |
| A change to existing state gets a Breaking entry in the CHANGELOG | [Changing what devvm does with state](../../../docs/content/docs/contributing/structure.md#changing-what-devvm-does-with-state) | review only |
| A change to the layout updates its listing, and a new layout version adds a migration | [Changing the state layout](../../../docs/content/docs/contributing/structure.md#changing-the-state-layout) | `layout.txtar`, `TestMigrations` and `TestCheckLayout` |
| Nothing goes in a project folder: state is in devvm's data and config folders | [AGENTS.md's Rules](../../../AGENTS.md#rules) | review only, as the structure test's check of paths covers only devvm's own folders |
| devvm never deletes a project VM on its own | [AGENTS.md's Rules](../../../AGENTS.md#rules) | the structure test's `owners` for the VM-name grammar (`vmname.IsVM`), so gc never takes a project VM for an image, and the rest is review only |
## Backends
| Rule | Written in | Guard |
| --- | --- | --- |
| A backend implements `backend.Backend`'s four roles, declares `Caps` for every feature and returns its errors | [How a backend plugs in](../../../docs/content/docs/contributing/extending.md#how-a-backend-plugs-in) | `TestRegisterChecksCaps`, `TestCapsCheck`, the conformance suite (`TestConformance`, `TestConformanceFinds`) and the structure test's `guardOwner` |
| A missing feature fails, naming the VM and what to do, and never falls back silently | [How a backend plugs in](../../../docs/content/docs/contributing/extending.md#how-a-backend-plugs-in) | the registry's guard (`TestGuardRefuses`, `TestGuardRoles`) |
| Every emulation is refused until it's reviewed | [AGENTS.md's Backends](../../../AGENTS.md#backends) | `TestUnreviewedEgressRefused` and `TestUnreviewedLetThrough`, and the review itself is a design note, a threat check and end-to-end checks |
| Lima edits only what differs, in one edit | [AGENTS.md's Backends](../../../AGENTS.md#backends) | `TestStartEditsOnlyWhatDiffers`, `TestStartWantInOneEdit`, and the fixture scripts' launches without a Lima edit |
## Images, assets and scripts in the VM
| Rule | Written in | Guard |
| --- | --- | --- |
| An image's key hashes everything that goes into it, the backend included | [AGENTS.md's Rules](../../../AGENTS.md#rules) | `TestKeyChangesWithEachField`, while a new input that bypasses `image.Input` is review only |
| Every download in `assets/` is pinned and checked | [AGENTS.md's Rules](../../../AGENTS.md#rules) | `TestBumpCoversPins` checks that `scripts/bump.sh` moves every pin, and a review checks that each download has one |
| A script sources the prelude before it reads its variables | [One owner for each concern](../../../docs/content/docs/contributing/structure.md#one-owner-for-each-concern) | `TestPreludeUsers` |
| Scripts in the VM are bash 3.2-safe and shellcheck-clean | [AGENTS.md's Rules](../../../AGENTS.md#rules) | shellcheck in `mise run lint:code`, and `TestEmbeddedScripts` for scripts in Go strings, while bash 3.2 is review only |
| Shared tools stay read-only in VMs | [AGENTS.md's Rules](../../../AGENTS.md#rules) | the end-to-end `tools` section's checks that the share is read-only, even for root, while a write redirected elsewhere is review only |
| Credentials never go into images, the host's agent history never goes into VMs, and devvm's own files never get a shared copy on disk | [AGENTS.md's Rules](../../../AGENTS.md#rules) | review only |
| A new or changed shared tool updates its page and follows Contributing's checklist | [Adding a toolchain](../../../docs/content/docs/contributing/extending.md#adding-a-toolchain) and [Adding a coding agent](../../../docs/content/docs/contributing/extending.md#adding-a-coding-agent) | `TestToolchainsComplete`, `TestDefsComplete`, `TestSharedToolsPolicies` and `TestConfigTools` |
| No build script is JavaScript but the docs' `docs/render-diagrams.mjs`, and no npm package is installed outside mise's tools but its pinned pele | [AGENTS.md's Rules](../../../AGENTS.md#rules) | review only |
## Tests
| Rule | Written in | Guard |
| --- | --- | --- |
| New logic gets a Go table test and a CLI test | [Go test helpers](../../../docs/content/docs/contributing/tests.md#go-test-helpers) | the coverage baselines ([Coverage](../../../docs/content/docs/contributing/tests.md#coverage)) |
| Tests never touch the Keychain, real VMs or your folders | [Go test helpers](../../../docs/content/docs/contributing/tests.md#go-test-helpers) | `scripts/test.sh` gives the tests a throwaway `HOME`, and the CLI tests run in a sandbox against the stubs, and the rest is review only |
| Timeouts and lifecycles are tested in a synctest bubble | [Time and lifecycles](../../../docs/content/docs/contributing/tests.md#time-and-lifecycles) | review only ([Write tests that pass on any host](standards.md#write-tests-that-pass-on-any-host-at-any-load)) |
| A test runs git only through `stubtest.Git` | [Go test helpers](../../../docs/content/docs/contributing/tests.md#go-test-helpers) | the structure test |
| The tests pass in any time zone | [Any time zone](../../../docs/content/docs/contributing/testing.md#any-time-zone) | CI runs `mise run test` in UTC on macOS and with `TZ=America/Los_Angeles` on Linux |
| A change that touches VMs passes the end-to-end sections for what changed | [End-to-end tests](../../../docs/content/docs/contributing/tests.md#end-to-end-tests) | review only |
## Docs and commits
| Rule | Written in | Guard |
| --- | --- | --- |
| Every behavior change updates its page in the same change | [AGENTS.md's Rules](../../../AGENTS.md#rules) | review only |
| Prose follows the docs voice | [the docs-voice skill](../docs-voice/SKILL.md) | Vale (`AIWords`, `Filler`, `QuotedCommand`) and `TestUserPageProse` in `mise run lint:docs`, and the rest is review only |
| User pages name no repo paths, Go identifiers or message names | [Writing docs](../../../docs/content/docs/contributing/docs.md#writing-docs) | review only |
| A devvm command line in the repo is one devvm has | [The CLI rule tests](../../../docs/content/docs/contributing/cli.md#the-cli-rule-tests) | `TestCommandLines` |
| The CLI reference is generated | [The CLI reference](../../../docs/content/docs/contributing/docs.md#the-cli-reference) | `TestReferenceIsCurrent` |
| One commit for each task, in Conventional Commits, with no tracker's IDs | [AGENTS.md's Commits and tasks](../../../AGENTS.md#commits-and-tasks) | CI's PR title job (`.github/workflows/pr-title.yml`) checks a pull request's title, its squashed commit's subject, against AGENTS.md's types, and the rest is review only |
@@ -0,0 +1,274 @@
# What reviews kept finding
Reviews of devvm's code found the same kinds of mistake again and again, in code that different people and agents wrote for different features. Each section here is one of them, written as the standard that would have prevented it: the rule, what the reviews found, sometimes a short pair of devvm's code that breaks the rule and code that keeps it, and what guards it. A guard that names a test means `mise run test` fails when that test's case breaks, and "review only" means the reviewer checks it by hand.
A standard applies where a change touches its ground, and judgment decides the rest. A change to how the CLI prints a table has no VM input to bound, and a refactor that keeps its tests passing needs no new failing test.
## Fail closed, on every path
A path that refuses, fails, falls back or tries again leaves things at least as strict as they were. A security step, such as a VM's confinement, its `.git` protection or a host check, sits on the one path that every start, retry and restart takes, rather than in each branch, so a new branch can't miss it. What a confined process reports about itself is checked against what devvm gave it, and when devvm can't tell whether something still holds, it stops the thing it can't vouch for and says so.
A weaker mode is fine when the user sees it, the docs describe it and the maintainers chose it. devvm warns and runs a VM's proxy without its sandbox on a host that has none, for example, rather than refusing to start. What's never fine is a fallback that nobody sees.
The reviews found this on the start's paths more than a dozen times. An export and rm's check of a `--clone` VM started it without the launch's `.git` check and network policy self-check, until both went through the launch's own start. The broker counted its own `SIGTERM` to a hung child as a failure of `sandbox-exec` and started the child again unconfined, and it took the confinement that a child's ready named, so a child it had started unconfined could report `full seatbelt`. A refused tier change could leave a looser proxy running.
Wrong, keeping a running VM's proxy whatever it enforces:
```go
if _, up := p.PID(vm); up && !touched {
p.Warn(msg.NetProxyKept(vm))
return c, err
}
return c, unproxied(ctx, p, b, vm, err)
```
Right, as `netpolicy.Proxy.PrepareRunning` has it, keeping it only while it enforces the state's tier and both of its processes run:
```go
if _, up := p.PID(vm); up && childProc(p, vm).Running() && !touched && enforcesNow(p, st) {
p.Warn(msg.NetProxyKept(vm))
return c, err
}
return c, unproxied(ctx, p, b, vm, err)
```
**Guard:** each refusal and fallback that exists has tests, such as `TestPrepareRunningRefused`, `TestStartChildSandbox`, `TestSandboxFailed` and `TestReadConfined`, and the backend registry's guard refuses a missing feature (`TestGuardRefuses`). A new path is review only.
## Bound what you don't control
Anything that a VM, the proxy's child, a peer on a socket or another process can make devvm read, hold, wait for or do again has a bound in size, in count and in time. The bound goes on what devvm reads and holds, never on the pattern that recognizes it, so a long value is still found. A listener whose bytes a VM controls has read and header timeouts and a cap on its connections, and a wait on something another process holds, such as a lock, gives up after a deadline and says so. Arithmetic on a size a VM gave checks for overflow.
The reviews found a rotation that read a sparse `proxy.log` whole into memory, a redaction that read one unended line from its start every second, locks that a child could hold for ever, and a password pattern given a length limit that then skipped a registry's long token. A writer that caps what it keeps must not embed its buffer, because `io.Copy`, as `os/exec` copies a command's output, then reads past the cap through the buffer's `ReadFrom`, as `bounded` in `internal/vm/bounded.go` explains.
Wrong, as the proxy once read a log to rotate it:
```go
data, err := os.ReadFile(r.path)
```
Right, as `internal/proxy/rotate.go` reads one, through its descriptor and no more than it keeps:
```go
from := copyFrom(r.fd, fi.Size(), 2*r.limit)
if err := copyAtomic(r.path+".1", io.NewSectionReader(r.fd, from, fi.Size()-from), 0o600); err != nil {
```
**Guard:** `safefile`'s reads and `fetch.ReadCapped` have their caps, `safefile.Walk` reads a folder in batches and stops at its bound on the entries it reads (`TestWalkBound`), where `fs.WalkDir` reads each folder whole first, the structure test's `read-limits` rule fails on an `io.ReadAll` outside tests whose reader isn't an `io.LimitReader` made in the call, unless `unboundedReads` lists its function with why, and tests keep the bounds that reviews found: `TestRotateCopiesAHugeLog`, `TestInLongLine`, `TestLongSecrets`, `TestRotateLockHeld`, `TestNixLockWaits`, `TestBounded`, and `FuzzBrokerFrames` and `FuzzFrameStreams` for the broker's frames. A new input is review only.
## Treat what a VM can write as hostile
A VM can write its project folder, its logs folder and the shared Nix cache, and it controls every byte it sends back. devvm reads all of it as an attacker's:
- **Files by descriptor.** A file in a folder that a VM can write is opened once, without following a link in any part of its path and without blocking on a FIFO, through `internal/safefile`, an `os.Root` or `proxy.OpenLog`, and checked to be a regular file with one link. From then on, devvm reads, writes, empties and changes it through that descriptor (`f.Truncate`, `f.Chmod`, `futimes`), never by its path again, because the VM can swap the name between two uses. A folder, such as the project folder, is checked by its identity rather than its path.
- **Checked against what it can't choose.** What a VM hands back is checked against a source the VM can't pick. The packages a build VM records are checked on the host against Ubuntu's signed archive lists, every pocket's included, and a cached package file is hashed again before devvm keeps it.
- **Escaped for where it goes.** Text from a VM is data. It's escaped for the format it's written into, such as a systemd unit, a plist, YAML or the ssh config, and control characters are refused or dropped (`msg.OneLine`, `msg.Printable`).
- **Nothing it can plant runs on the host.** Host tools run by absolute path, with a minimal environment, and without anything that a project's config can name, such as git's hooks, filters or `core.sshCommand` (`internal/hostgit`).
The reviews found devvm opening `proxy.log` again by its path at each start and emptying it by its path at each rotation, which would have followed a link a child left there into a file of yours, and a VM started on a project folder that was replaced after the finder found it. Host git once ran programs that a repo's config named.
Wrong, as the Nix cache once marked a file used, by its path:
```go
func touch(file string) {
now := time.Now()
_ = os.Chtimes(file, now, now)
}
```
Right, as `internal/proxy/nixcache.go` marks the file it opened (`touchFile` is `futimes` on macOS and `utimensat` with no path on Linux):
```go
func touch(f *os.File) { _ = touchFile(f, time.Now()) }
```
**Guard:** forbidigo refuses `os.Open`, `os.OpenFile`, `os.ReadFile` and `os.Root`'s openers in the files that the `safefile` row of [the checks on owners](../../../docs/content/docs/contributing/structure.md#the-checks-on-owners) lists, and forbidigo refuses `os.Chmod`, `os.Chtimes`, `os.Chown`, `os.Lchown` and `os.Truncate` in `internal/proxy`, `internal/vmlog` and `internal/vmssh`, but for a socket devvm has just made, with a `nolint` that says why. The child's seccomp filter on Linux refuses it a change by path (`TestSelf`). `TestOpenLogReplacesWhatIsPlanted`, `TestRotateCopiesWithoutItsPath`, `TestTrimNixCachePlanted`, `TestOneLineDropsInvisible` and `internal/hostgit`'s tests, such as `TestCommandNoHooks` and `TestCommandSSHOnly`, keep what reviews found, and the end-to-end `network` and `nix` sections plant links, FIFOs and hard links. A path-based change elsewhere is review only.
## Keep secrets and host data on the host
A secret never goes into a process's arguments, which any local user can read with `ps`, or into an environment that more than one process shares. It goes on standard input, into a file only you can read, or into the environment of the one child that needs it. A secret's value is a `redact.Secret`, revealed only where it's used ([Secrets in the code](../../../docs/content/docs/contributing/structure.md#secrets-in-the-code)).
What crosses into a VM is an allowlist: the fields devvm parsed and knows, never a whole file with the known secrets taken out. A log that a VM can drive goes through `internal/vmlog`, which caps and redacts it, or through the proxy's own rotating log, and a rotation masks the start of a secret its cut leaves (`redact.Unended`). Credentials never go into an image, and your agents' history never goes into a VM.
This was the most frequent security finding, about 15 times for secrets in arguments or a shared environment and about 11 for whole files sent to a VM. The VM's proxy password reached the guest through `limactl edit --set`, visible to `ps`, Codex and Claude Code VMs got every field of their login files rather than the ones devvm knows, and Lima's boot script, which runs under `set -x`, put the proxy password into the serial console log.
**Guard:** forbidigo refuses `Reveal` without a `nolint` that says why, `TestStartConfined` checks that the proxy's password is in no command's arguments and goes into the VM's `lima.yaml` instead, and `TestRotateCutSecret`, `TestUnended` and `FuzzSplit` keep the redaction. The end-to-end `network` section's `netNoLeaks` looks for each VM's proxy password and the section's tokens in every run log, proxy log and Lima log. A new argument, environment variable or file sent to a VM is review only.
## Parse once, with a real parser
A value is read with a real parser for its format, such as `BurntSushi/toml` for mise's lock or `net/netip` for an address, never with a regular expression or `strings.Split` over a format that has quoting or escapes. The function that checked a value is the one that reads it later, so the two can't disagree, and when devvm needs a tool's effective setting, it asks the tool rather than parsing its config again. A check of an address handles IPv6, and the IPv6 forms that carry an IPv4 address (`::ffff:`, NAT64 and 6to4), as `proxy.Public` does.
About 17 fixes came from this. Network policy files had a lenient reader in one place and a strict one in another, so a broken deny rule was skipped rather than refused. A ports value with a bad entry read as port 0, because one of several port parsers dropped `strconv.Atoi`'s error, until `backend.ParsePortRanges` became the only one. Transparent mode logged IPv6 connections as refusals, and a 6to4 address whose IPv4 address was private passed the proxy's floor as public.
**Guard:** each owner's parser has its table tests and often a fuzz target, such as `TestParsePortRanges`, `FuzzPublicHostSite` and `TestInternalOwn6to4`, and [the checks on owners](../../../docs/content/docs/contributing/structure.md#the-checks-on-owners) keep some readers in their owner. A new hand-rolled parser is review only.
## Never fail silently, and name the real cause
No error is dropped without a reason in a comment: not a `Wait`'s, not a parse's, not a `|| true` in a script. A loop that skips an item it can't handle says so, and a check whose output is empty or shorter than it should be fails rather than passing. An error that devvm turns into a message keeps its cause with `.Because(err)`.
Before a message names a cause, the code finds that cause. Errors that need different actions get different messages, and the advice in each one works in the state the user is in. A message that tells a user whose VM can't start to run devvm restart sends them in a circle.
The reviews found about 16 swallowed errors and about 17 messages that named the wrong cause. A shared tool that failed to mount was skipped with only a line on standard error, which no page described and nobody had chosen, so mise downloaded it into the VM instead. The proxy's floor, which refuses this machine's addresses, refused none when it read no addresses. A name the host couldn't resolve was blocked with "can't resolve it" whatever the cause, so a lookup cancelled because its client went away looked like a DNS failure.
**Guard:** errorlint, nilerr and nilnesserr catch some of it in the linters, and `TestExecuteShowsEachFailure` checks that a command's failure reaches the user. The structure test's `dropped-errors` rule fails on a `Wait`'s error or a `strconv` parse's assigned to `_` outside tests, unless `droppedErrors` lists its function with why. Any other error assigned to `_`, and a message's cause, are review only.
## Give every process an owner that ends it
Every process and goroutine devvm starts has an owner that bounds it and ends it: a context that cancels it, a `WaitDelay` for its pipes, a stopper that kills a half-started pipeline, and something that waits for it. An accept loop goes on after an error that leaves its listener open, through `daemon.AcceptRetry`, because a loop that returns at the first `EMFILE` leaves its port bound and dead, while `http.Server`'s `Serve` tries again itself.
The reviews found relays that outlived their forward and their link, and an ssh that a stuck relay held open. They also found the same accept loop written four ways, two of them returning at the first error, before `daemon.AcceptRetry` became its owner.
**Guard:** the structure test's `goroutines` rule lists every function that starts a goroutine with what waits for it, `leaktest.Main` and `leaktest.Check` fail on a goroutine that outlives its tests ([Goroutine leaks](../../../docs/content/docs/contributing/tests.md#goroutine-leaks)), and only `internal/daemon` and `internal/platform` signal a process by its pid (forbidigo). `TestAcceptRetry` and each loop's own test, such as `TestForwarderAcceptRetries`, keep the accept loops, and `TestProcStop` stops real processes. A process's bound is review only.
## Survive a kill and a second devvm
Assume the last run was killed at the worst moment, and that another devvm runs beside this one:
- **Killed runs.** A destructive step is ordered so that one good copy survives at every point, a "done" marker is written last, a file is written whole through `state.WriteFile`, and a cancelled or failed result is never cached.
- **Concurrent runs.** Two runs that change the same thing take an OS file lock (`platform`'s locks, `state.VM.Update`), and read the state again once they hold it. A lock is never a folder or a pid file, which a killed run leaves behind.
About 13 fixes each came from these. A second devvm took a remake that was still running for one that had stopped and finished it, and an undo that failed partway could leave the saved home deleted. The remake holds the VM's lock and reads its state again under it, and it deletes the saved home only after its record is gone. Two runs that pinned a VM's host keys at once could lose one's change to `known_hosts`, and retention's lock was a folder, which a crash left held.
**Guard:** forbidigo keeps whole-file writes in `internal/state`, and `TestLockOrder` panics in test builds on a lock taken out of order. The order of a destructive step is review only.
## Show what devvm waits for
Any work that can take noticeable time runs under the UI's status line, so the user sees what devvm waits for rather than a terminal that looks hung. Slow work is anything whose time devvm doesn't control: a host command, host git, a command in a VM, a backend's own commands, such as `limactl list` or `limactl --version`, a request over the network, a walk of a folder the user owns, a lookup of a folder's disk with `diskutil`, and a wait for a lock, a timeout or another process. A logged command shows its step on its own (`LoggedCmd`, a backend `Runner`'s `Run`), and the rest shows one with the Reporter's `Status`, its label a message in `locales/en.toml`. Status lines nest, so a phase can show one around steps that show their own. Work that takes the terminal never runs under one: a VM's shell, `ssh-add` asking for a passphrase, an agent's login in the VM.
The reviews found the newest commands' slow work all without one: devvm agent import walked and copied up to 128 MiB and ran git on each marketplace's config, devvm ls looked up each folder's disk after Lima's list, and devvm doctor read every VM's state, each with nothing on the screen. They also found the status line itself drawing over what devvm said: a warning landed on its line, and its redraw erased a question's prompt.
Wrong, as devvm ls read the VMs, Lima's list and a `diskutil` for each folder with nothing on the screen:
```go
inv, err := vm.ReadInventory(cmd.Context(), env.Dirs, env.Registry, vm.AllBackends)
```
Right, as `vm.ListAll` has it, under one status line that its steps' own lines nest in:
```go
defer e.Status(msg.ReadingVMs())()
inv, err := ReadInventory(ctx, e.Dirs, e.Registry, AllBackends)
```
A test records the label rather than a terminal: a `msg.Fake` gives each label to its `OnStatus`, and `Showing` is the one showing, so a seam the slow work goes through records what showed meanwhile, as `TestAgentImportStatus` does:
```go
im.Opencode = func(context.Context, ...string) ([]byte, error) {
m, _ := im.fake.Showing()
during = append(during, "opencode: "+m.ID())
return nil, exec.ErrNotFound
}
```
**Guard:** the structure test's `status-lines` rule fails on a function that makes a host command, runs host git, walks a folder, looks up a volume, makes a request through `internal/fetch`, waits for a lock whose `platform.Waiting` is `nil` or `platform.NoWait`, which show nothing while another devvm holds it, or runs a backend's command outside a step with no status line of its own, unless `statusSites` lists it with why, such as the caller's status line it runs under. A test build's locks panic on a `nil` `Waiting` at run time (`platform.CheckWaiting`), and forbidigo refuses a raw `syscall.Flock` outside `internal/platform`. `TestLaunchStatusLines` fails on a backend call that a launch makes with no status line showing, `TestCommandStatusLines` on one that the other commands on a VM make, its setters included, `TestVMLockWaits`, `TestCheckLayoutWaits` and each lock's own test, such as `TestGitLockWaits`, `TestImageLocksWait`, `TestPinOriginWaits`, `TestYoursLockWaits` and `TestForwardsLockWaits`, on a wait with no label or the wrong one, `TestSSHAddOffStatusLine` on an `ssh-add` under one, and `TestMessagesClearTheStatusLine`, `TestQuestionsHoldTheStatusLine`, `TestSecretAndPickerHoldTheStatusLine`, `TestTerminalHoldsTheStatusLine` and `TestStatusLinesNest` keep the status line off what devvm says and asks. That a caller's status line covers a listed call, a backend's methods in a command the tests don't run, and a wait's label are review only.
## Extend the owner, and wait for a third copy
Before adding a helper, a parser, a path, a file reader, a constant, a limit, a message or a table, find its owner and extend it, as [One owner for each concern](../../../docs/content/docs/contributing/structure.md#one-owner-for-each-concern) says. When the owner is out of reach, as most packages are for the proxy, move the owner to a package both can import.
An owner that exists is always extended. Code that has no owner yet is different: a second copy of it is a judgment call, because a copy can be cheaper than the wrong shared helper, so wait for a third before extracting one. The exception is a copy of a judge, such as what counts as a public address or the one form of a host, because two judges that drift apart let through what one of them refuses. Those get one owner at once, and a forbidigo rule or a structure-test check where the check can be exact.
The reviews found hosts read by hand in five packages besides the proxy, each lowercasing and trimming a dot in its own way, so a deny rule and the check it guarded could read one host as two, and `--from`'s registries judged public by a copy of `proxy.Public`.
Wrong, as `netpolicy.RiskOf` once read a host:
```go
host = strings.ToLower(strings.TrimSuffix(host, "."))
```
Right, in the one form that every judge of a host compares:
```go
h := proxy.NormHost(given)
```
**Guard:** the structure test's owner checks and the forbidigo rules in [the checks on owners](../../../docs/content/docs/contributing/structure.md#the-checks-on-owners), with `TestOwnersDoc` and `TestOwnersAgree` keeping that table current. Any other copy is review only, in [the consolidation pass](../../../docs/content/docs/contributing/structure.md#the-consolidation-pass) before a release.
## Mind what's already running and released
A user upgrades devvm with VMs running and with state from every release since 0.1.0, so a change says what happens to both:
- **Running VMs.** A change to what devvm runs beside a VM, such as its proxy, its port forwarder, its agent relay or its Lima config, gets a line under After you upgrade in `CHANGELOG.md`'s Unreleased section, saying what a running VM keeps until its next start and what to run to get the change at once. The new devvm still stops, lists and reads the logs of what the old one left running. What devvm does to a running VM follows the start it runs under, not the stored setting, which the user may have changed since.
- **Released state.** A change that adds a state field runs the commands that read and write it on each frozen `testdata/v<release>/` fixture, in the same commit, and so does a command the CHANGELOG tells users to run, as [Released state](../../../docs/content/docs/contributing/structure.md#released-state) says. A change to what devvm does with existing state gets a Breaking entry in the CHANGELOG.
The agent relay, the ssh port that moved to one of the ports browsers refuse, and the proxy that became two processes each needed an After you upgrade line that a review found missing. The ssh config's agent once followed the stored setting rather than the VM's running start, and the settings that devvm mount-cache and devvm network transparent added to `vm.json` went in without a run of either command on 0.1.0's state.
**Guard:** `TestFixtureScripts` and the `fixture_v*.txtar` scripts run today's commands on each release's state, and `TestV010ProxyConfigsStart` starts a broker and its child from 0.1.0's proxy configs. The CHANGELOG line is review only.
## Claim only what the code does, where precision belongs
The How it works pages, Staying safe, Contributing, the CHANGELOG, comments, commit messages and messages say what the code does, with its limits. A guarantee with "never", "only", "every" or "no" holds on every path, or it names the paths where it doesn't. Before a commit, check each claim the change makes, and each existing claim about the code it changed, against that code.
The README, the home page and Getting started keep their short headline claims, such as "ready in seconds" or "reach only the hosts you allow", without qualifiers. A wrong fact gets fixed everywhere, but the precision goes on the safety and How it works pages, which those pages link to.
Nearly every review found an overclaim on a precise page. The docs of an IPv6 fix said that every lookup in a confined VM with transparent mode off waits 35 to 40 seconds on a Linux host, from one tool's behavior. An end-to-end run on Fedora showed `getent` failing within 3 seconds and curl at once, and only workerd under wrangler dev waiting about 40 seconds.
Wrong, from one case:
```markdown
every lookup waits 35 to 40 seconds on a Linux host
```
Right, as the measurement showed:
```markdown
most tools fail at once on macOS and Linux alike, and a few, such as workerd under wrangler dev, can wait about 40 seconds on a Linux host
```
**Guard:** `TestCommandLines` checks every devvm command line in the repo, `TestDocLinks` the messages' doc links, lychee the docs' links and `TestReferenceIsCurrent` the CLI reference, and the docs-voice skill's `facts.sh` checks that a rewrite kept every fact. Whether a claim is true is review only.
## Prove each fix with a test that fails without it
A fix lands with a test that fails without it: revert the fix, or break the code it guards, watch the test fail, then put the fix back. Code that has no test gets one that pins its current behavior before it changes. When a change breaks an assertion, either the change is wrong or the commit says why the assertion changed, and an assertion is never loosened to make a test pass.
- **The oracle comes from outside the code under test:** the specification, a frozen copy of the old behavior, a list written by hand from the source, or the real program, never the code's own table or logic, which agrees with any bug.
- **An absence check has a control** that shows the probe can find what it looks for, such as the guest's own environment holding the token that `ps` must not show.
- **A security boundary is proven by attacking it.** A change to a sandbox, such as the proxy child's Seatbelt profile, its Landlock rules or its seccomp filter, is tested by a process under the real sandbox that tries what an attacker would, and other ways to the same thing, rather than by reading the rules back. The change also gets a threat check with the security-audit skill.
The reviews found tests that still passed with their fix reverted, expected values taken from the function under test, and absence checks that couldn't have found anything. The Landlock filter took three rounds of review, because each attack found a call the filter allowed, such as `prlimit64` setting another process's CPU limit.
Wrong, an oracle that is the code's own list:
```go
if got := SSHPorts(); !slices.Equal(got, sshPorts) {
```
Right, as `TestSSHPorts` builds its own from the Fetch standard's list and Chromium's gaps:
```go
want := slices.DeleteFunc(slices.Clone(fetch), func(n int) bool { return n < 1024 || slices.Contains(chromiumGaps, n) })
if got := SSHPorts(); !slices.Equal(got, want) || len(got) != 17 {
```
**Guard:** the coverage baselines fail `mise run test` when a package's coverage falls ([Coverage](../../../docs/content/docs/contributing/tests.md#coverage)), and `TestSelf` and `TestChildProfileConfines` attack the proxy child's sandboxes. That a test fails without its fix, and where its oracle comes from, are review only.
## Write tests that pass on any host, at any load
A test passes on a loaded Linux CI runner, on a Mac in another time zone, and under `git rebase --exec`, as it does on your machine:
- **Off the real clock.** A test of a timeout, a grace or a close runs in a `testing/synctest` bubble on stand-ins in memory ([Time and lifecycles](../../../docs/content/docs/contributing/tests.md#time-and-lifecycles)). A test that must use the real clock waits for the event, an absence included, rather than for a duration, and fails at once when what it waits on has exited.
- **No assumptions about the host.** A test brings its own git config (`stubtest.Git`), time zone, ports from its sandbox's block and temp folders, and it doesn't assume Linux or macOS, the number of CPUs, or GNU or BSD tools.
- **Stubs behave like the real tool.** A stub or fake is held to the real tool by a contract test or by golden output from the real tool, as the backend conformance suite holds the fake backend, the limactl stub and real Lima to one set of cases.
- **Stress what's timing-sensitive.** A test whose result depends on timing or order passes `go test -race -count=20` on a loaded Linux host before it counts as done, and a test that opens many connections has a cap and runs on a test host rather than your own machine.
Tests that assumed their host failed about 25 times, on a machine's git-lfs or system git config, a time zone, a BSD tool's flags or a CPU count. The broker's start tests failed on loaded Linux hosts, because hashing the test binary took most of the 4 seconds a start waits, and a reviewer's flood test used up a Mac's local ports and broke every ssh to the test hosts.
Wrong, sleeping out a grace on the real clock with a margin:
```go
time.Sleep(grace + time.Second)
if !fired.Load() {
```
Right, as `TestGraceTimer` checks the moment itself:
```go
synctest.Test(t, func(t *testing.T) {
var fired atomic.Bool
g := newGraceTimer(grace, func() { fired.Store(true) })
tc.steps(g)
time.Sleep(grace - time.Nanosecond)
synctest.Wait()
if fired.Load() {
```
**Guard:** the structure test checks that a test runs git only through `stubtest.Git`, CI runs the tests in UTC on macOS and with `TZ=America/Los_Angeles` on Linux ([Any time zone](../../../docs/content/docs/contributing/testing.md#any-time-zone)), each CLI test's sandbox holds a block of ports, and `TestConformance` runs the backend conformance suite on the limactl stub and on real Lima's instances, while `TestConformanceFinds` checks that the suite fails a backend that breaks it. A real-clock test, the stress run and a flood's cap are review only.
+44 -3
View File
@@ -20,6 +20,47 @@ devvm's docs should read like a guide a colleague wrote: full sentences that say
- **Present tense, current state.** Describe how devvm works now. Don't mention older behavior, what changed or what moved.
- **House rules.** Write commands as devvm x or in backticks, never in quotes. Never write "please", "note that" or "simply". Use sentence-case headings. Address the reader as "you".
## Commands first on user pages
The user pages, in Getting started, Using devvm, Staying safe, Backends and Compared (`getting-started/`, `using/`, `safety/`, `backends/` and `compared/`), are where readers go to get something done or to learn what they can rely on, so each section there that has a task starts with what to type: a copyable command block, or a numbered list of steps, with a comment on each line that says what it does. Explanation follows, and it stays short.
- **One paragraph is fine.** A paragraph that says why, next to the command it's about, is good, and so is one that gives the details a reader needs while doing the task, such as a limit, a question devvm asks or the flag that answers it.
- **The target is paragraphs back to back.** Two or more prose paragraphs with no command, list, table or callout between them are the sign that mechanism has crept in. Split them with the command each one describes, turn parallel facts into a short list, or move the mechanism to its How it works page.
- **Move mechanism, don't delete it.** How devvm does something, such as what it checks, in what order, and why an attack fails, goes to its How it works page in `internals/`, under a heading that a link from the user page names. Leave a sentence that says what the reader gets and links there.
- **Keep every fact.** A move is a cut and a paste, not a summary. Run `facts.sh --all REV` after a move, so a fact that went to another page doesn't show as removed, and add the heading on the How it works page first if it doesn't exist.
- **Lists for parallel facts only.** A list of modes, refusals, limits or what a command keeps is easier to scan than a paragraph. Facts that build on each other stay prose, as [Bold-label bullets](tropes.md#bold-label-bullets-boldlabel) says.
`scan.sh -p paras FILE` lists each run of paragraphs, two or more on a user page and three or more in `internals/` and `contributing/`, with each paragraph's words, its line and its heading. A paragraph of 40 words or fewer that ends with a colon doesn't count, because it introduces the block after it. `scan.sh -p long FILE` lists each paragraph or list item over 80 words or 4 sentences. A run or a long paragraph is a candidate, not an error: leave one that a reader needs in one piece, such as a warning and the action that follows it. `mise run lint:docs` fails on the worst of them on a user page: a run of three or more paragraphs where two are over 80 words, and a paragraph or list item over 150 words.
Before, from Troubleshooting's A command fails (five paragraphs in a row, abridged):
> devvm prints its own steps, and it sends the output of the commands it runs to a log instead of the terminal. When a step fails, devvm prints the end of the log.
>
> To see the commands' output as they run, add `-v` or `--verbose` to any command, as in `devvm -v build base` or `devvm -v`. devvm then shows each line on standard error … and devvm drops the control characters a command prints …
>
> Each run that runs a command has one log, `~/.local/share/devvm/logs/runs/<date>-<time>-<pid>.log` … A command that devvm runs in a VM adds at most 4 MiB of output to the log … A VM's proxy key and the build proxy's password are written as `devvm:<key>@` …
>
> Lima keeps a log of its own for each VM, `ha.stderr.log` … devvm replaces each password there with as many `*` …
>
> In a terminal and without `-v`, a status line shows the step, how long it has run, and the log's latest line …
After:
> devvm prints its own steps and sends the output of the commands it runs to a log, and when a step fails, it prints the end of that log. To watch the output as it runs, add `-v`:
>
> ```sh
> devvm -v # open this folder's VM, showing each command's output
> devvm -v build base # the same for any command
> ```
>
> With `-v`, devvm shows each line on standard error as the log gets it, in place of the status line, and when a step fails it names the log instead of printing its end again. Without `-v`, a status line in a terminal shows the step, how long it has run and the log's latest line, and a step that takes more than a few seconds leaves a line with its time.
>
> - **The log** is `~/.local/share/devvm/logs/runs/<date>-<time>-<pid>.log`, one for each run, which only you can read, and devvm keeps the newest 20.
> - **Each command** appears in it as a `+` line with its arguments, followed by its output, and a numbered step adds a `# [2/5] <step>` line first.
> - **Passwords and a VM's proxy key** stay out of it, written as `user:<password>@` and `devvm:<key>@`, including a company proxy's password from your shell's `HTTPS_PROXY`, and How it works would have the rest.
The rest would move to a new The run log section on How it works' Overview, which the after version links to: the 4 MiB cap on a VM command's output and the `devvm: truncated` line, the build proxy's password, a proxy address without a scheme, passwords written in pieces, the VM's setup and a `devcontainer.json`'s commands being covered, `-v` showing the log's own lines with control characters dropped, and Lima's `ha.stderr.log`, where devvm replaces each password with as many `*`, warns when it can't and lets you delete the file.
## Scope
All prose in the repo:
@@ -28,7 +69,7 @@ All prose in the repo:
- The command help that generates those CLI pages: `Short` and `Long` in `internal/cli/*.go`. Run `mise run cli-docs` after editing them.
- `README.md`, `SECURITY.md`, `CONTRIBUTING.md`, `assets/oci/README.md` and `internal/proxy/README.md`.
- The messages in `locales/en.toml`, which also follow the [Messages](#messages) rules below.
- The cli skill, `.agents/skills/cli/`.
- The cli skill, `.agents/skills/cli/`, and the codebase-standards skill, `.agents/skills/codebase-standards/`.
These follow their own rules and are out of scope:
@@ -59,11 +100,11 @@ Messages use the same voice as the docs, only shorter, so the CLI reads like the
Use these terms on every page and in every message.
- **Secret** is the general term for what devvm keeps on this machine for VMs to use, as in devvm secret. The Staying safe and Network policy pages define it: "A secret is a credential devvm keeps on this machine for VMs to use: your GitHub token, Claude Code's token, an agent's login or an API key."
- **Name the secret when the specific one matters:** "GitHub token", "Claude Code token" (from claude setup-token), "API key", "Codex login" or "opencode login". Never write a bare "token" or "tokens", because agents use "tokens" for model tokens. The one exception is right after a prompt that names the token: after "GitHub token:", "You didn't paste a token" is clear.
- **Name the secret when the specific one matters:** "GitHub token", "Claude Code token" (from claude setup-token), "API key", "Codex login", "opencode login" or "pi's API key". Never write a bare "token" or "tokens", because agents use "tokens" for model tokens. The one exception is right after a prompt that names the token: after "GitHub token:", "You didn't paste a token" is clear.
- **Feature** on user pages means only base image features (omb, fzf, cli-tools) and devcontainer features. Backend features, which are native, emulated or none, appear only on the How it works pages. devvm doctor prints backend features as "features", so say so where a user page compares backends.
- **Image** means devvm's images, such as base or foo+bar. Say "container image" for the images that `--from` and a `devcontainer.json` start from.
- **Layer** means devvm's layers. Say "Docker's image layers" when you mean Docker's.
- **Shared tool** means node, python, rust, go, claude, codex or opencode.
- **Shared tool** means a toolchain or a coding agent that devvm shares read-only between VMs, such as node or claude: the toolchains page and the coding agents page's Supported agents table list them.
## Workflow
+75 -1
View File
@@ -7,6 +7,12 @@
# scan.sh -v FILE... each hit: file:line: [pattern] the line as written
# scan.sh -p NAME FILE.. -v for one pattern only
#
# paras counts runs of prose paragraphs back to back, two or more on a user
# page and three or more in internals/ or contributing/, and long counts
# paragraphs and list items over 80 words or 4 sentences. -v, -p paras and
# -p long show each with its words. A colon-ended paragraph of 40 words or
# fewer introduces the block after it, so it doesn't count in a run.
#
# A .toml file is scanned as messages (locales/en.toml): only the other and
# one strings, with their {{.fields}} read as code spans. -v shows each hit's
# message ID, and -m REGEX scans only the messages whose ID matches.
@@ -28,7 +34,7 @@ while [ $# -gt 0 ]; do
shift
;;
-h | --help)
sed -n '2,12s/^# \{0,1\}//p' "$0"
sed -n '2,18s/^# \{0,1\}//p' "$0"
exit 0
;;
--) shift && break ;;
@@ -131,6 +137,61 @@ shown() { # file line
fi
}
# The paragraphs of one file, for paras or long (what), one per line.
# paras: each run of prose paragraphs, as its first line, the count, each
# paragraph's words joined with + and the heading above it; a user page's runs
# start at two paragraphs, any other page's at three. long: each paragraph or
# list item over 80 words or 4 sentences, as its line, words, sentences and
# heading. Code fences, lists, tables, callouts, shortcodes, HTML and headings
# end a run, and a line that is only an HTML comment neither counts nor ends
# one. A paragraph of at most 40 words whose last line ends with a colon
# introduces the next block, so it doesn't count in a run.
paras() { # file what
local min=2
case $1 in */internals/* | */contributing/*) min=3 ;; esac
awk -v what="$2" -v min="$min" '
function flush() {
if (what == "paras" && n >= min) printf "%d\t%d\t%s\t%s\n", start, n, sizes, head
n = 0
sizes = ""
}
function endblock( t, w, s) {
if (kind != "") {
t = text
gsub(/`[^`]*`/, "x", t)
gsub(/\]\([^)]*\)/, "]", t)
w = split(t, _, /[[:space:]]+/)
if (t ~ /^[[:space:]]/) w--
s = gsub(/[a-z0-9)x*][.!?]([[:space:]]|$)/, "&", t)
if (what == "long" && kind != "o" && (w > 80 || s > 4))
printf "%d\t%d\t%d\t%s\n", from, w, s, head
if (kind == "p" && !(last ~ /:[[:space:]]*$/ && w <= 40)) {
if (n == 0) start = from
n++
sizes = sizes (sizes == "" ? "" : "+") w
}
}
kind = ""
text = ""
}
function block(k) { endblock(); kind = k; from = NR; text = $0; last = $0 }
BEGIN { head = "(no heading)" }
NR == 1 && /^---$/ { front = 1; next }
front { if (/^---$/) front = 0; next }
/^[[:space:]]*(```|~~~)/ { endblock(); flush(); fence = !fence; next }
fence { next }
/^[[:space:]]*<!--.*-->[[:space:]]*$/ { next }
/^[[:space:]]*$/ { endblock(); next }
/^[[:space:]]*([-*+]|[0-9]+\.)[[:space:]]/ { block("l"); flush(); next }
kind == "p" || kind == "l" { text = text " " $0; last = $0; next }
kind == "o" { next }
/^#/ { endblock(); flush(); head = $0; next }
/^[[:space:]]*[|><]/ || /^[[:space:]]*\{\{/ { block("o"); flush(); next }
/^[[:space:]]+[^[:space:]]/ { block("l"); flush(); next }
{ block("p") }
END { endblock(); flush() }' "$1"
}
hits() { # flags regex: matching lines (-n) or matches (-o) from stdin
local flags=$1 re=$2 mode=$3 opts=-E
case $flags in *w*) opts="$opts -w" ;; esac
@@ -144,6 +205,7 @@ if [ "$verbose" = 0 ]; then
while IFS=' ' read -r name _ _; do printf ' %5.5s' "$name"; done <<EOF
$patterns
EOF
[ "$mode" = toml ] || printf ' %5s %5s' paras long
printf '\n'
fi
@@ -159,6 +221,16 @@ for f in "$@"; do
done <<EOF
$patterns
EOF
if [ "$mode" = md ] && { [ -z "$only" ] || [ "$only" = paras ]; }; then
paras "$f" paras | while IFS=' ' read -r n count sizes head; do
printf '%s:%s: [paras] %s paragraphs (%s words) under %s\n' "$f" "$n" "$count" "$sizes" "$head"
done
fi
if [ "$mode" = md ] && { [ -z "$only" ] || [ "$only" = long ]; }; then
paras "$f" long | while IFS=' ' read -r n words sents head; do
printf '%s:%s: [long] %s words, %s sentences under %s\n' "$f" "$n" "$words" "$sents" "$head"
done
fi
continue
fi
words=$(printf '%s\n' "$text" | wc -w | tr -d ' ')
@@ -169,5 +241,7 @@ EOF
done <<EOF
$patterns
EOF
[ "$mode" = toml ] || printf ' %5s %5s' "$(paras "$f" paras | wc -l | tr -d ' ')" \
"$(paras "$f" long | wc -l | tr -d ' ')"
printf '\n'
done
+3
View File
@@ -0,0 +1,3 @@
# Generated files: GitHub collapses them in diffs.
internal/msg/messages_gen.go linguist-generated=true
docs/content/docs/cli/** linguist-generated=true
+2
View File
@@ -0,0 +1,2 @@
# Every pull request asks the maintainer for a review.
* @w3cj
+7 -7
View File
@@ -1,5 +1,5 @@
name: Toolchain request
description: A language or runtime you'd like devvm to build in, such as .NET, Java, PHP, Ruby or Elixir.
description: A language or runtime you'd like devvm to build in, such as Java, PHP, Ruby or Elixir.
labels: ["enhancement", "toolchain", "triage"]
body:
- type: markdown
@@ -18,7 +18,7 @@ body:
attributes:
label: The toolchain
description: Its usual name, and its mise tool name if you know it (what `mise registry NAME` prints).
placeholder: .NET (mise's dotnet)
placeholder: Ruby (mise's ruby)
validations:
required: true
- type: textarea
@@ -26,7 +26,7 @@ body:
attributes:
label: Files that should pick it
description: The project files that tell devvm a folder needs this toolchain.
placeholder: "*.csproj, *.sln, global.json"
placeholder: "Gemfile, .ruby-version"
validations:
required: true
- type: textarea
@@ -41,25 +41,25 @@ body:
attributes:
label: Versions
description: Whether the latest is enough or you need several major versions, and which.
placeholder: The latest LTS, and 8 for older projects
placeholder: The latest, and 3.3 for older projects
- type: input
id: source
attributes:
label: Official install source
description: Where the toolchain's own builds come from.
placeholder: https://dotnet.microsoft.com/download
placeholder: https://www.ruby-lang.org/en/downloads/
- type: textarea
id: registries
attributes:
label: Package managers and their hosts
description: The package managers people use with it and the hosts they download from, which the toolchain's network policy lets through.
placeholder: "NuGet: api.nuget.org, globalcdn.nuget.org"
placeholder: "RubyGems: rubygems.org, index.rubygems.org"
- type: textarea
id: writes
attributes:
label: What it writes into its own folder
description: Global installs, plugins or self-updates that write into the toolchain's install folder, which devvm has to send somewhere else because shared tools are read-only in VMs.
placeholder: "`dotnet tool install -g` writes to ~/.dotnet/tools"
placeholder: "`gem install` writes into Ruby's own gems folder"
- type: dropdown
id: builds
attributes:
+36
View File
@@ -0,0 +1,36 @@
# Monthly updates, each ecosystem in one grouped pull request, for devvm's Go modules and the actions its workflows pin by SHA. Their titles follow
# Conventional Commits, as the PR title check asks. scripts/bump.sh moves these too, and every pin
# Dependabot doesn't know, and holds each module or action as an ignore entry below does: keep each
# one's dependency-name line followed by a versions: [">= X"] line, the form it reads.
version: 2
updates:
- package-ecosystem: gomod
directories: ["/", "/docs"]
schedule:
interval: monthly
# A release has a week to be found bad before an update proposes it.
cooldown:
default-days: 7
commit-message:
prefix: build
include: scope
# pflag 1.1 prints every boolean flag as --flag[=true|false] in the help, with no way to turn it
# off, so devvm stays on 1.0.x.
ignore:
- dependency-name: github.com/spf13/pflag
versions: [">= 1.1.0"]
groups:
go:
patterns: ["*"]
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
cooldown:
default-days: 7
commit-message:
prefix: ci
include: scope
groups:
actions:
patterns: ["*"]
+16
View File
@@ -0,0 +1,16 @@
<!-- markdownlint-disable-file MD041 -- a pull request's body, under GitHub's own title -->
## What this changes
<!-- What the change does and why. Link the issue it fixes, as in "Fixes #12". -->
## How it was tested
<!-- The tests you added or ran. For a change that touches VMs, the e2e sections you ran (mise run e2e -- --only SECTION) and on which OS. -->
## Checklist
- [ ] The title is a Conventional Commit, `type(scope): summary`, because it becomes the squashed commit's subject.
- [ ] `mise run fmt && mise run lint && mise run test` passes.
- [ ] New behaviour has tests, and every behaviour change updates its page in `docs/content/docs/`.
- [ ] A changed command follows the cli skill, and `mise run cli-docs` is rerun when its help changed.
- [ ] Nothing here belongs in a private security advisory instead (see SECURITY.md).
+113 -7
View File
@@ -26,25 +26,131 @@ concurrency:
jobs:
check:
# The tests run in UTC, then again on Linux in a zone with DST, so a
# test that depends on the zone fails here, not only on a laptop.
# The tests run on macOS in UTC and on Linux in a zone with DST, so a
# test that depends on the zone fails here, not only on a laptop. Lint
# runs on both, because golangci-lint checks only the files built for
# the runner's OS, such as internal/platform's *_darwin.go or *_linux.go.
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, tz: UTC }
- { os: macos-latest, tz: UTC }
- { os: ubuntu-latest, tz: America/Los_Angeles }
- { os: macos-latest, tz: UTC }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.10.18
version: 2026.11.10
# npm's downloads for the docs' diagrams (lint:docs runs docs:diagrams), keyed on the lock. npm ci
# checks each package against the lock's integrity, and the Docs workflow, which publishes, keeps
# no cache.
- name: Cache npm downloads
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ hashFiles('docs/package-lock.json') }}
- run: mise run lint
if: matrix.tz == 'UTC'
- run: mise run test
env:
TZ: ${{ matrix.tz }}
# Its own job, so a newly published vulnerability fails this check alone,
# and lint and test still report. The Vulnerabilities workflow scans main
# and the releases' binaries each week.
vuln:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Only Go and govulncheck, cached apart from the check jobs' full set.
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.11.10
install_args: go go:golang.org/x/vuln/cmd/govulncheck
cache_key_prefix: mise-v1-vuln
# mise run would install the rest of mise.toml's tools first.
- run: mise run vuln
env:
MISE_TASK_RUN_AUTO_INSTALL: "false"
# Without cgo, as devvm ships. On Linux the proxy's child confines every
# thread of itself through syscall.AllThreadsSyscall, which a build with
# cgo, such as the race detector's in the check jobs, refuses: here a
# child of the confinement's own tests confines itself on the runner's
# kernel, Landlock and the seccomp filter, and is refused what it must
# be. (The CLI tests' devvm is built without cgo in the check jobs too.)
nocgo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Only Go, cached apart from the check jobs' full set.
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.11.10
install_args: go
cache_key_prefix: mise-v1-nocgo
- run: go test -count=1 ./internal/landlock/... ./internal/proxy/...
env:
CGO_ENABLED: "0"
# Advisory: nilaway's findings include false positives, so they never fail
# CI. A finding testdata/nilaway-baseline.txt hasn't triaged is a warning
# on the run, and the run's summary lists the new ones, then every
# finding. The job fails only when the check itself breaks (nilaway
# can't run, its output can't be read, a stale baseline line), and that
# blocks nothing either.
nilaway:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Only Go and nilaway, cached apart from the other jobs' tools.
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.11.10
install_args: go go:go.uber.org/nilaway/cmd/nilaway
cache_key_prefix: mise-v1-nilaway
# scripts/nilaway.sh exits 3 on a finding the baseline hasn't, and
# otherwise non-zero when nilaway couldn't run, its output couldn't be
# read or a baseline line is stale: the job fails then, after the
# summary.
- name: Run nilaway
env:
MISE_TASK_RUN_AUTO_INSTALL: "false"
run: |
set -uo pipefail
out=$RUNNER_TEMP/nilaway.txt
mise run nilaway 2>&1 | tee "$out"
status=${PIPESTATUS[0]}
n=$(grep -c '^new: ' "$out" || true)
{
echo "## nilaway: $n new findings"
echo
echo "A new finding needs triage: see [Nil checks](https://next.devvm.dev/docs/contributing/#nil-checks)."
echo
# Four backticks: nilaway's own backticks can't end the block.
echo '````'
grep -E '^(new|stale): |^nilaway: ' "$out" || echo "none"
echo '````'
echo
echo "Every finding, the triaged ones included:"
echo
echo '````'
cat "$out"
echo '````'
} >> "$GITHUB_STEP_SUMMARY"
if (( n > 0 )); then
echo "::warning title=nilaway::$n new possible nil dereferences: see the run's summary"
fi
if (( status != 0 && status != 3 )); then
echo "nilaway's check failed with status $status: see the run's summary" >&2
exit "$status"
fi
+170 -16
View File
@@ -1,30 +1,53 @@
name: Docs
# Pull requests touching the docs get their lints and a build; main deploys.
# Two sites. devvm.dev shows the latest release's docs: a published release that isn't a
# prerelease deploys its tag's docs to GitHub Pages, and so does a dispatch, with any release's
# tag. next.devvm.dev shows main's: each push to main that changes the docs builds them with
# docs/next.yaml and commits the site to devvmhq/docs-next, which Cloudflare Pages serves.
# Pull requests touching the docs get their lints and a build, and nothing else.
# The site is built from docs/ alone (the CLI reference included, which a help change commits
# there), and CI's lint runs the docs checks on every code change, so other pushes skip this.
# A release event runs this file as its tag has it.
on:
push:
branches: [main]
pull_request:
paths:
paths: &docs-paths
- "docs/**"
- "**.md"
- ".vale.ini"
- ".vale/**"
- ".markdownlint-cli2.yaml"
- ".github/workflows/docs.yml"
pull_request:
paths: *docs-paths
release:
types: [published]
workflow_dispatch:
inputs:
site:
description: The site to deploy
type: choice
options: [devvm.dev, next.devvm.dev]
default: devvm.dev
ref:
description: "devvm.dev only: the release tag whose docs it shows, such as v0.1.0 (empty: the latest release)"
type: string
required: false
permissions:
contents: read
# Deploys queue one after another; a pull request's newer run replaces its last.
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
# main's docs, or a pull request's: the lints and a build.
check:
if: >-
github.event_name == 'pull_request' || github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs.site == 'next.devvm.dev')
runs-on: ubuntu-latest
# A pull request's newer run replaces its last.
concurrency:
group: docs-check-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
# Only the docs' tools, not every tool in mise.toml.
MISE_TASK_RUN_AUTO_INSTALL: "false"
@@ -34,22 +57,153 @@ jobs:
persist-credentials: false
# Full history, for each page's last updated date.
fetch-depth: 0
- uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.10.18
install_args: go hugo-extended node markdownlint-cli2 vale lychee
version: 2026.11.10
install_args: go hugo node markdownlint-cli2 vale lychee
# The workflow publishes, so no job in it reads a cache another run could have written.
cache: false
# It draws the diagrams first (docs:diagrams), which the build below uses too.
- run: mise run lint:docs
# The site's address is baseURL in docs/hugo.yaml.
- run: hugo -s docs --minify
- if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
# next.devvm.dev: main's docs, committed to devvmhq/docs-next.
next:
if: >-
github.ref == 'refs/heads/main' &&
(github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs.site == 'next.devvm.dev'))
needs: check
runs-on: ubuntu-latest
# One push at a time; a newer run waiting replaces an older one.
concurrency:
group: docs-next
cancel-in-progress: false
# The environment holds the deploy key, and only main can use it.
environment:
name: docs-next
url: https://next.devvm.dev/
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.11.10
install_args: go hugo node
# What's published is built from no cache.
cache: false
# The diagrams, drawn before the build (docs/render-diagrams.mjs).
- run: mise run docs:diagrams
# docs/next.yaml over docs/hugo.yaml: next.devvm.dev's address, the banner and noindex.
- run: hugo -s docs --minify --config hugo.yaml,next.yaml -d "$RUNNER_TEMP/next"
# The key is checked out only after the build, which never sees it.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: devvmhq/docs-next
ref: main
path: docs-next
ssh-key: ${{ secrets.DOCS_NEXT_DEPLOY_KEY }}
# The push below needs the key; this checkout is the only thing that uses it.
persist-credentials: true # zizmor: ignore[artipacked] -- the push needs the deploy key, and nothing is uploaded
- name: Publish
working-directory: docs-next
run: |
# Everything but README.md is the site's.
find . -mindepth 1 -maxdepth 1 ! -name .git ! -name README.md -exec rm -rf {} +
cp -R "$RUNNER_TEMP/next/." .
git add -A
if git diff --cached --quiet; then
echo "next.devvm.dev is already this build."
exit 0
fi
git -c user.name="github-actions[bot]" \
-c user.email="41898282+github-actions[bot]@users.noreply.github.com" \
commit -q -m "Build from devvm ${GITHUB_SHA::7}"
git push origin HEAD:main
# devvm.dev: a release's docs, built from its tag.
release:
if: >-
(github.event_name == 'release' && !github.event.release.prerelease) ||
(github.event_name == 'workflow_dispatch' && inputs.site == 'devvm.dev')
runs-on: ubuntu-latest
env:
# Only the tools the install step picks: mise run and a shim would otherwise install every
# tool in the tag's mise.toml, and a tool it missed fails the build rather than downloads.
MISE_AUTO_INSTALL: "false"
steps:
- id: tag
name: The release's tag
env:
GH_TOKEN: ${{ github.token }}
EVENT: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
INPUT_REF: ${{ inputs.ref }}
run: |
if [ "$EVENT" = release ]; then
tag=$RELEASE_TAG
elif [ -n "$INPUT_REF" ]; then
tag=$INPUT_REF
else
tag=$(gh release view --repo devvmhq/devvm --json tagName --jq .tagName)
fi
if ! [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::A release tag is vX.Y.Z, such as v0.1.0; this is $tag."
exit 1
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: refs/tags/${{ steps.tag.outputs.tag }}
persist-credentials: false
# Full history, for each page's last updated date.
fetch-depth: 0
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.11.10
# The next step installs only what the build needs.
install: false
# What's published is built from no cache.
cache: false
# Only what the build needs, at the versions of the tag's own mise.toml, as mise reads it: Go,
# for Hugo's modules, Hugo by the name the tag gives it (hugo-extended in a tag from before Hugo
# 0.170), and Node when the tag draws its diagrams.
- run: |
want='^(go|hugo|hugo-extended)$'
if [ -f docs/render-diagrams.mjs ]; then
want='^(go|hugo|hugo-extended|node)$'
fi
mapfile -t tools < <(mise ls --current --json |
jq -r --arg f "$(pwd -P)/mise.toml" 'to_entries[] | select(any(.value[]; .source.path == $f)) | .key' |
grep -E "$want")
if ! printf '%s\n' "${tools[@]}" | grep -qE '^hugo(-extended)?$'; then
echo "::error::The tag's mise.toml names no Hugo."
exit 1
fi
# --locked, as mise-action adds where the tag has a mise.lock: every download from the lock.
mise install --locked "${tools[@]}"
# The tag's diagrams, drawn before the build, when its docs draw them (docs/render-diagrams.mjs);
# an older tag's pages load Mermaid instead.
- run: |
if [ -f docs/render-diagrams.mjs ]; then
mise run docs:diagrams
fi
# The tag's docs/hugo.yaml, whose baseURL is devvm.dev.
- run: hugo -s docs --minify
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/public
deploy:
if: github.event_name != 'pull_request'
needs: build
needs: release
runs-on: ubuntu-latest
# Deploys queue one after another.
concurrency:
group: docs-pages
cancel-in-progress: false
permissions:
pages: write # to deploy the site
id-token: write # to prove the deployment comes from this workflow
+6 -5
View File
@@ -15,9 +15,10 @@ concurrency:
cancel-in-progress: false
env:
LIMA_VERSION: 2.2.1
# lima-2.2.1-Linux-x86_64.tar.gz in the release's SHA256SUMS.
LIMA_SHA256: b391ac7fcac2b2a5a1628107756463188ded4d18d3104a40a66a8bb6fec01bcb
LIMA_VERSION: 2.3.0
# lima-$LIMA_VERSION-Linux-x86_64.tar.gz in the release's SHA256SUMS
# (scripts/bump.sh e2e-lima).
LIMA_SHA256: cc8ba97f1c801b899f7c9eda9919dfc4ce4fa2c140c53e5add15aa2d0a1936f9
jobs:
project:
@@ -49,9 +50,9 @@ jobs:
tar -xzf "$RUNNER_TEMP/$f" -C "$HOME/.local"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/limactl" --version
- uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.10.18
version: 2026.11.10
# devvm's image keys are computed while it builds, so the cache key
# hashes what goes into them that this checkout fixes: assets/, the
# pinned tool lock, e2e's Ubuntu release and Lima's version. A stale
+150 -14
View File
@@ -1,11 +1,16 @@
name: Fuzz
# go test runs only each fuzz target's seeds; this runs every target for a
# few minutes a week. The list is read from the tests, so a new target is
# fuzzed without editing this file.
# go test runs only each fuzz target's seeds; this fuzzes every target for
# five minutes each night, starting from the inputs its earlier nights found
# (its corpus, which a cache keeps). The list is read from the tests, so a
# new target is fuzzed without editing this file. The targets that fail go in
# one open issue, which closes once a night's targets all pass: a failing
# input is kept in its target's corpus, so it fails again each night until
# the code is fixed. The fuzz jobs have only read access; the issue job,
# which can write issues, runs no code of the repo's.
on:
schedule:
- cron: "17 6 * * 1"
- cron: "17 3 * * *"
workflow_dispatch:
permissions:
@@ -18,13 +23,17 @@ concurrency:
jobs:
targets:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
matrix: ${{ steps.list.outputs.matrix }}
count: ${{ steps.list.outputs.count }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Each target as {"pkg","name"}, the proxy's first.
# Each target as {"pkg","name"}, the proxy's first. A name is a
# target's alone, as its artifacts and its line in the issue are
# named by it.
- id: list
run: |
set -euo pipefail
@@ -32,34 +41,161 @@ jobs:
| sed -E 's#^(.*)/[^/]*:func (Fuzz[A-Za-z0-9_]*)$#\1 \2#' \
| sort -u | awk '{print ($1 ~ /^internal\/proxy$/ ? 0 : 1), $0}' | sort -k1,1n -k2 | cut -d' ' -f2-)
test -n "$lines"
dup=$(printf '%s\n' "$lines" | cut -d' ' -f2 | sort | uniq -d)
if [[ -n $dup ]]; then
echo "fuzz targets of one name in two packages: $dup" >&2
exit 1
fi
matrix=$(printf '%s\n' "$lines" | awk 'BEGIN{printf "["} {if (NR>1) printf ","; printf "{\"pkg\":\"./%s\",\"name\":\"%s\"}", $1, $2} END{printf "]"}')
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
echo "count=$(printf '%s\n' "$lines" | wc -l)" >> "$GITHUB_OUTPUT"
fuzz:
needs: targets
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
max-parallel: 4
max-parallel: 8
matrix:
target: ${{ fromJSON(needs.targets.outputs.matrix) }}
name: ${{ matrix.target.name }}
env:
NAME: ${{ matrix.target.name }}
PKG: ${{ matrix.target.pkg }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
# Only Go, cached apart from the other workflows' tools.
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.10.18
- run: go test -run '^$' -fuzz "^${NAME}\$" -fuzztime 2m "$PKG"
env:
NAME: ${{ matrix.target.name }}
PKG: ${{ matrix.target.pkg }}
version: 2026.11.10
install_args: go
cache_key_prefix: mise-v1-fuzz
# go test keeps a target's corpus in GOCACHE's fuzz folder, under the
# package's import path and the target's name.
- id: corpus
run: |
set -euo pipefail
dir="$(go env GOCACHE)/fuzz/$(go list "$PKG")/$NAME"
echo "dir=$dir" >> "$GITHUB_OUTPUT"
echo "key=fuzz-${PKG#./}-$NAME" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.corpus.outputs.dir }}
key: ${{ steps.corpus.outputs.key }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: ${{ steps.corpus.outputs.key }}-
# Each new input is minimized in at most 1,000 runs: by time, a
# target whose runs write files, such as FuzzUnpack, spends its five
# minutes minimizing.
- id: fuzz
run: go test -run '^$' -fuzz "^${NAME}\$" -fuzztime 5m -fuzzminimizetime 1000x "$PKG"
# A failing input lands in the package's testdata/fuzz/<target>/;
# committed there, go test runs it as a seed.
- if: failure()
# committed there, go test runs it as a seed. It goes in the corpus
# too, so the next night starts with it and fails until it's fixed.
- if: failure() && steps.fuzz.outcome == 'failure'
env:
DIR: ${{ steps.corpus.outputs.dir }}
run: |
set -euo pipefail
shopt -s nullglob
mkdir -p "$DIR"
for f in "$PKG/testdata/fuzz/$NAME"/*; do
cp "$f" "$DIR/"
done
- if: failure() && steps.fuzz.outcome == 'failure'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: crash-${{ matrix.target.name }}
path: ${{ matrix.target.pkg }}/testdata/fuzz/${{ matrix.target.name }}/
if-no-files-found: ignore
# Saved whatever the night found, a failure included.
- if: always() && steps.corpus.outputs.dir != ''
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.corpus.outputs.dir }}
key: ${{ steps.corpus.outputs.key }}-${{ github.run_id }}-${{ github.run_attempt }}
# The target's line for the issue job: its package, its name and how
# its run ended.
- if: always()
env:
OUTCOME: ${{ steps.fuzz.outcome }}
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/result"
echo "$PKG $NAME $OUTCOME" > "$RUNNER_TEMP/result/$NAME.txt"
- if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: result-${{ matrix.target.name }}
path: ${{ runner.temp }}/result/
if-no-files-found: error
retention-days: 7
# Only main's run reports, so a run started on another branch never
# closes the issue as main's.
issue:
needs: [targets, fuzz]
if: always() && github.ref == 'refs/heads/main' && needs.targets.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
issues: write # to open, update and close the one issue of the failing targets
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: result-*
merge-multiple: true
path: ${{ runner.temp }}/results
- name: Open, update or close the issue
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
COUNT: ${{ needs.targets.outputs.count }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -euo pipefail
shopt -s nullglob
title="Fuzzing found failing inputs"
# Each target's line, with only the characters a package path, a
# target's name and an outcome have.
files=("$RUNNER_TEMP"/results/*.txt)
cat ${files[@]+"${files[@]}"} /dev/null | LC_ALL=C tr -cd '0-9A-Za-z._/ \n-' > "$RUNNER_TEMP/all.txt"
awk '$3 != "success" { print "- `" $2 "` in `" $1 "`: " $3 }' "$RUNNER_TEMP/all.txt" | sort > "$RUNNER_TEMP/failed.txt"
# A target whose job reported nothing failed too.
reported=$(wc -l < "$RUNNER_TEMP/all.txt")
if (( reported < COUNT )); then
echo "- $((COUNT - reported)) targets didn't report" >> "$RUNNER_TEMP/failed.txt"
fi
number=$(gh issue list --state open --search "in:title \"$title\"" --json number,title \
--jq "map(select(.title == \"$title\")) | .[0].number // empty")
if [[ ! -s $RUNNER_TEMP/failed.txt ]]; then
if [[ -n $number ]]; then
gh issue close "$number" --comment "Every fuzz target passed tonight, its failing inputs included: $RUN_URL"
fi
exit 0
fi
{
echo "The nightly fuzzing found inputs that fail these targets:"
echo
cat "$RUNNER_TEMP/failed.txt"
echo
echo "The run, with each failing input as an artifact named \`crash-<target>\`: $RUN_URL"
echo
echo "Put each input in its package's \`testdata/fuzz/<target>/\` folder, fix the code, and commit both."
echo "The input stays in the target's corpus, so it fails each night until the fix is on main,"
echo "and this issue closes on the first night every target passes:"
echo "see [Fuzzing](https://next.devvm.dev/docs/contributing/testing/#fuzzing)."
} > "$RUNNER_TEMP/body.md"
if [[ -z $number ]]; then
gh issue create --title "$title" --label bug --body-file "$RUNNER_TEMP/body.md"
exit 0
fi
# A night's new failures get a comment, which notifies; the same
# targets failing again only update the run's link.
gh issue view "$number" --json body --jq .body | tr -d '\r' > "$RUNNER_TEMP/old.md"
if ! grep '^- ' "$RUNNER_TEMP/old.md" | cmp -s - "$RUNNER_TEMP/failed.txt"; then
gh issue comment "$number" --body "The failing targets changed: the description lists tonight's."
fi
gh issue edit "$number" --body-file "$RUNNER_TEMP/body.md"
+82
View File
@@ -0,0 +1,82 @@
name: Pins
# scripts/bump.sh --check once a week: the pins with a newer upstream go in
# one open issue, which closes when none is left. It reports and never bumps.
on:
schedule:
- cron: "47 6 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pins
cancel-in-progress: false
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# mise for the dev tools' newest versions; no tools, as nothing builds.
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.11.10
install: false
cache: false
- name: Check the pins
# gh api reads the actions' releases, and mise GitHub's for the dev tools.
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
scripts/bump.sh --check | tee "$RUNNER_TEMP/check.txt"
# bump.sh's output is upstream's text: it goes through files, never into
# a script.
- name: Open, update or close the issue
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
title="Pinned versions to bump"
# Each outdated pin, under its group's [header], with only the
# characters --check's lines use, so no upstream text can end the
# issue's code fence (a backtick) or add markup; \133 and \135 are
# the brackets, written so no tr reads them as a class.
awk '/^\[/ { g = $0; next } index($0, " -> ") { if (g != "") print g; g = ""; print }' \
"$RUNNER_TEMP/check.txt" | LC_ALL=C tr -cd '0-9A-Za-z.+~_ ()>:/,\133\135\n-' > "$RUNNER_TEMP/outdated.txt"
number=$(gh issue list --state open --search "in:title \"$title\"" --json number,title \
--jq "map(select(.title == \"$title\")) | .[0].number // empty")
if [[ ! -s $RUNNER_TEMP/outdated.txt ]]; then
if [[ -n $number ]]; then
gh issue close "$number" --comment "Every pin is up to date: scripts/bump.sh --check lists nothing to bump."
fi
exit 0
fi
{
echo "scripts/bump.sh --check found pins with a newer upstream version:"
echo
# Four backticks: a line from upstream can't end the block early.
echo '````'
cat "$RUNNER_TEMP/outdated.txt"
echo '````'
echo
echo "Bump them with \`scripts/bump.sh\`, which applies every patch and minor, or \`scripts/bump.sh TOOL…\`;"
echo "its header says which tool moves each pin, and a line marked by hand or only when named says how."
echo "Pin bumps change images, so run the \`--from\` tier of the end-to-end tests before merging:"
echo "see [Updating pinned versions](https://devvm.dev/docs/contributing/maintaining/#updating-pinned-versions)."
} > "$RUNNER_TEMP/body.md"
if [[ -n $number ]]; then
gh issue edit "$number" --body-file "$RUNNER_TEMP/body.md"
else
gh issue create --title "$title" --label enhancement --body-file "$RUNNER_TEMP/body.md"
fi
+38
View File
@@ -0,0 +1,38 @@
name: PR title
# Pull requests are squash-merged with their title as the commit's subject, so the title follows
# Conventional Commits, with the types AGENTS.md lists. pull_request, not pull_request_target: the
# check only reads the title through the API with a read-only token and checks out no code.
on:
pull_request:
types: [opened, edited, reopened, synchronize]
permissions:
contents: read
concurrency:
group: pr-title-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
title:
name: Conventional Commits title
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: read
steps:
- uses: amannn/action-semantic-pull-request@2252a14e810aa9b85c2d560bd7070c802206ecf6 # v6.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
docs
test
refactor
build
ci
chore
requireScope: false
+186
View File
@@ -0,0 +1,186 @@
name: Vulnerabilities
# govulncheck once a week, on main's code for Linux and macOS and on the
# binaries of the latest release and of the newest release, prerelease or not:
# what it finds goes in one open issue, which closes when every scan finds
# nothing. CI's vuln job checks each push, and this catches a vulnerability
# published since, and one in what users run. The scan job has only read
# access; the issue job, which can write issues, runs no govulncheck.
on:
schedule:
- cron: "37 6 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: vuln
cancel-in-progress: false
jobs:
scan:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Only Go and govulncheck.
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
with:
version: 2026.11.10
install_args: go go:golang.org/x/vuln/cmd/govulncheck
cache: false
- name: Scan main and the releases
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
shopt -s nullglob
work=$RUNNER_TEMP/scan
mkdir -p "$work" "$RUNNER_TEMP/findings"
found=$RUNNER_TEMP/findings/found.txt
# A fixed first line, so the artifact is never empty; the issue
# job checks it and skips it.
echo "# govulncheck findings" > "$found"
# scan NAME ARGS…: govulncheck exits 3 when it finds a vulnerability,
# and any other failure fails the job, so a scan that didn't run
# never closes the issue.
scan() {
local name=$1 status=0
shift
govulncheck "$@" > "$work/report.txt" || status=$?
cat "$work/report.txt"
case $status in
0) ;;
3)
{
echo "[$name]"
grep -E '^Vulnerability #|^ +(Found|Fixed) in: ' "$work/report.txt"
} >> "$found"
;;
*)
echo "govulncheck failed on $name with status $status" >&2
exit 1
;;
esac
}
# What mise run vuln runs: the code for each OS devvm ships for.
GOOS=linux scan "main linux" ./...
GOOS=darwin scan "main darwin" ./...
latest=$(gh release view --json tagName --jq .tagName)
newest=$(gh release list --exclude-drafts --limit 1 --json tagName --jq '.[0].tagName')
printf '%s\n' "$latest" "$newest" | sort -u > "$work/tags.txt"
while IFS= read -r tag; do
if [[ ! $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$ ]]; then
echo "unexpected release tag: $tag" >&2
exit 1
fi
version=${tag#v}
dir=$work/$tag
mkdir -p "$dir"
gh release download "$tag" --dir "$dir" --pattern SHA256SUMS --pattern "devvm-$version-*.tar.gz"
archives=("$dir"/devvm-"$version"-*.tar.gz)
if (( ${#archives[@]} == 0 )); then
echo "$tag has no archives" >&2
exit 1
fi
# Every archive has a line in SHA256SUMS, so --ignore-missing
# skips none of them.
for archive in "${archives[@]}"; do
base=${archive##*/}
if ! awk -v b="$base" '$2 == b { f = 1 } END { exit !f }' "$dir/SHA256SUMS"; then
echo "$tag's SHA256SUMS has no line for $base" >&2
exit 1
fi
done
(cd "$dir" && sha256sum --check --ignore-missing --strict SHA256SUMS)
for archive in "${archives[@]}"; do
platform=${archive##*/devvm-"$version"-}
platform=${platform%.tar.gz}
tar -xzf "$archive" -C "$dir" "devvm-$version-$platform/devvm"
scan "$tag $platform" -mode=binary "$dir/devvm-$version-$platform/devvm"
done
done < "$work/tags.txt"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: findings
path: ${{ runner.temp }}/findings/found.txt
if-no-files-found: error
retention-days: 7
# Only main's run reports, so a run started on another branch never
# closes the issue as main's.
issue:
needs: scan
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
issues: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: findings
path: ${{ runner.temp }}/findings
# govulncheck's report holds the vulnerability database's text: it goes
# through files, never into a script.
- name: Open, update or close the issue
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
title="Known vulnerabilities in devvm"
# Each scan's vulnerabilities and versions, with only the characters
# those lines use, so no text from the database can end the issue's
# code fence (a backtick) or add markup; \133 and \135 are the
# brackets, written so no tr reads them as a class.
found=$RUNNER_TEMP/findings/found.txt
if [[ $(head -n 1 "$found") != "# govulncheck findings" ]]; then
echo "the findings don't start with the scan job's first line" >&2
exit 1
fi
tail -n +2 "$found" | LC_ALL=C tr -cd '0-9A-Za-z.+~_ ()#@:/,\133\135\n-' > "$RUNNER_TEMP/clean.txt"
number=$(gh issue list --state open --search "in:title \"$title\"" --json number,title \
--jq "map(select(.title == \"$title\")) | .[0].number // empty")
if [[ ! -s $RUNNER_TEMP/clean.txt ]]; then
if [[ -n $number ]]; then
gh issue close "$number" --comment "govulncheck finds no known vulnerability in main's code or in the releases' binaries."
fi
exit 0
fi
{
echo "govulncheck found known vulnerabilities in main's code or in the releases' binaries:"
echo
# Four backticks: a line from the database can't end the block early.
echo '````'
cat "$RUNNER_TEMP/clean.txt"
echo '````'
echo
grep -oE 'GO-[0-9]{4}-[0-9]+' "$RUNNER_TEMP/clean.txt" | sort -u | sed 's#.*#- https://pkg.go.dev/vuln/&#'
echo
echo "A binary's scan lists the vulnerable code it holds, and can name a package that isn't linked,"
echo "so check one with \`go version -m\` and \`govulncheck -mode=binary -show traces\` before releasing for it."
echo "A vulnerability in the standard library is fixed by the Go release that fixes it: \`scripts/bump.sh go\`,"
echo "or \`scripts/bump.sh go-minor\` when only a newer minor has the fix."
echo "One in a module is fixed by the module's fixed version: \`scripts/bump.sh go-mods\` or \`go get\`."
echo "A release's binaries keep theirs until the next release ships the fix:"
echo "see [Known vulnerabilities](https://next.devvm.dev/docs/contributing/maintaining/#known-vulnerabilities)."
} > "$RUNNER_TEMP/body.md"
if [[ -z $number ]]; then
gh issue create --title "$title" --label bug --body-file "$RUNNER_TEMP/body.md"
exit 0
fi
# An edit alone notifies nobody, so changed findings, the lines in
# the body's code fence, get a comment; a change to the rest of the
# text only edits the body.
gh issue view "$number" --json body --jq .body | tr -d '\r' > "$RUNNER_TEMP/old.md"
if ! cmp -s "$RUNNER_TEMP/old.md" "$RUNNER_TEMP/body.md"; then
gh issue edit "$number" --body-file "$RUNNER_TEMP/body.md"
if ! awk '/^````$/ { n++; next } n == 1' "$RUNNER_TEMP/old.md" | cmp -s - "$RUNNER_TEMP/clean.txt"; then
gh issue comment "$number" --body "The scans' findings changed: the description lists what they find now."
fi
fi
+4 -1
View File
@@ -1,7 +1,10 @@
.dex/
.claude/
.worktrees/
/.claude/
dist/
docs/public/
docs/resources/
docs/.hugo_build.lock
docs/.build/
docs/node_modules/
/devvm
+124 -2
View File
@@ -9,14 +9,21 @@ linters:
default: standard
enable:
- bodyclose
- canonicalheader
- contextcheck
- depguard
- durationcheck
- errchkjson
- errorlint
- exhaustive
- forbidigo
- forcetypeassert
- gochecksumtype
- gocritic
- gosec
- misspell
- nilerr
- nilnesserr
- noctx
- nolintlint
- reassign
@@ -26,24 +33,44 @@ linters:
settings:
depguard:
rules:
# The proxy, and the background-process helper it uses: the
# standard library alone.
# The proxy, and the background-process helper, the file reader,
# the child's confinement, the VM names and the secrets' type it
# uses: the standard library alone, and each other; and the leak
# checks and the network in memory, which their tests use.
proxy:
list-mode: strict
files:
- "**/internal/proxy/**"
- "**/internal/landlock/**"
- "**/internal/daemon/**"
- "**/internal/safefile/**"
- "**/internal/vmname/**"
- "**/internal/leaktest/**"
- "**/internal/redact/**"
- "**/internal/memnet/**"
allow:
- $gostd
- github.com/devvmhq/devvm/internal/proxy
- github.com/devvmhq/devvm/internal/landlock
- github.com/devvmhq/devvm/internal/daemon
- github.com/devvmhq/devvm/internal/safefile
- github.com/devvmhq/devvm/internal/vmname
- github.com/devvmhq/devvm/internal/leaktest
- github.com/devvmhq/devvm/internal/redact
- github.com/devvmhq/devvm/internal/memnet
main:
list-mode: strict
files:
- $all
- "!$test"
- "!**/internal/proxy/**"
- "!**/internal/landlock/**"
- "!**/internal/daemon/**"
- "!**/internal/safefile/**"
- "!**/internal/vmname/**"
- "!**/internal/leaktest/**"
- "!**/internal/redact/**"
- "!**/internal/memnet/**"
allow:
- $gostd
- github.com/devvmhq/devvm
@@ -66,7 +93,13 @@ linters:
files:
- $test
- "!**/internal/proxy/**"
- "!**/internal/landlock/**"
- "!**/internal/daemon/**"
- "!**/internal/safefile/**"
- "!**/internal/vmname/**"
- "!**/internal/leaktest/**"
- "!**/internal/redact/**"
- "!**/internal/memnet/**"
allow:
- $gostd
- github.com/devvmhq/devvm
@@ -104,6 +137,35 @@ linters:
msg: write a file whole through state.WriteFile, or state.WriteFileMode for another mode, which replace it atomically; internal/proxy uses its writeAtomic; a log or a download streamed into its file says why in a nolint.
- pattern: ^(os|syscall)\.(Setenv|Unsetenv|Clearenv)$
msg: devvm's environment never changes, as every command and process it starts inherits it; set a command's own (exec.Cmd's Env), as a VM's SSH agent is (backend.ExecOpts.Agent). Only daemon.Ready takes its status file out.
- pattern: ^unicode\.(IsGraphic|IsPrint|IsControl|Bidi_Control)$
msg: ask msg.Safe which characters reach the terminal (msg.Printable and msg.OneLine drop the rest); a check that isn't about the terminal says why in a nolint.
- pattern: ^(os\.(Open|OpenFile|ReadFile|OpenRoot|OpenInRoot|DirFS)|os\.Root\.(Open|OpenFile|ReadFile|FS))$
msg: read a file a VM can write through internal/safefile (Read, Open, OpenRoot), which never waits on a FIFO or follows a link it wasn't asked to, and reads only a regular file within its cap; what opens a file to write, or a folder, says why in a nolint.
- pattern: ^os\.(Chmod|Chtimes|Chown|Lchown|Truncate)$
msg: change a file through what opened it (os.File's Chmod, Chown and Truncate, or an os.Root's methods), never by its path, which a VM can swap for a link between the open and the change; a path only devvm writes, such as a socket it just made, says why in a nolint.
- pattern: ^netip\.Addr\.IsPrivate$
msg: ask proxy.Public whether an address is on the internet, the one table of the ranges that aren't.
- pattern: ^(syscall|unix)\.Flock$
msg: take a lock with internal/platform's LockFile, LockFileShared or LockDir, which wait until the context ends and show their wait (platform.Waiting); a blocking flock waits for ever and shows nothing.
- pattern: ^msg\.StatusOf$
msg: show a lock's wait through the Reporter your constructor takes (msg.Waiting with its Status); only internal/state and internal/trust, which take none, read the run's status from the context.
- pattern: ^redact\.Secret\.Reveal$
msg: pass the redact.Secret on; its value is revealed only where it must be used (a header, a file only the user can read, the Keychain), with a //nolint:forbidigo that says why.
# A value errchkjson proves encodes without fail drops the error; any
# other checks it, so a field that could fail gets its check back.
errchkjson:
check-error-free-encoding: true
report-no-exported: true
# A switch on a sum type's type (//sumtype:decl) names every case, as
# exhaustive holds a switch on an enum's values to.
gochecksumtype:
default-signifies-exhaustive: false
govet:
enable:
- hostport
- nilness
- unusedwrite
- waitgroup
nolintlint:
require-explanation: true
require-specific: true
@@ -122,6 +184,10 @@ linters:
presets:
- std-error-handling
rules:
# msg.Safe is the one rule for which characters reach the terminal.
- path: ^internal/msg/
linters: [forbidigo]
text: ask msg\.Safe
- path: ^cmd/devvm/
linters: [forbidigo]
text: os\.Exit|context\.(Background|TODO)
@@ -136,6 +202,21 @@ linters:
- path: ^tests/e2e/
linters: [gosec]
text: G204|G304|G702|G703
# A test's helpers write the paths its own temp folder names. gosec's
# taint analysis reports some of them on some runs and not others
# (internal/gitprotect's write), so a nolint would fail nolintlint.
- path: _test\.go$
linters: [gosec]
text: G703
# A test's assertion that fails panics, which fails the run and names
# the line.
- path: _test\.go$
linters: [forcetypeassert]
# Tests encode values they built or decoded themselves, of strings,
# numbers, lists and maps, which always encode.
- path: _test\.go$
linters: [errchkjson]
text: is not checked
- path: ^internal/ui/
linters: [forbidigo]
text: fmt\.Print|os\.(Stdout|Stderr)|context\.(Background|TODO)
@@ -145,6 +226,10 @@ linters:
- path: ^internal/cli/
linters: [forbidigo]
text: testbuild\.On
# proxy.Public is the judge of internet addresses.
- path: ^internal/proxy/
linters: [forbidigo]
text: ask proxy\.Public
# daemon and platform signal processes; tests signal their own
# children (exec.Cmd's Process).
- path: ^internal/(daemon|platform)/
@@ -158,6 +243,16 @@ linters:
- path: ^internal/(fetch|proxy)/|_test\.go$
linters: [forbidigo]
text: reach the web through internal/fetch
# The packages that take no Reporter show a lock's wait through the context.
- path: ^internal/(state|trust|msg)/|_test\.go$
linters: [forbidigo]
text: msg\.StatusOf
# platform's locks themselves; the proxy's log rotation's (the proxy
# imports the standard library alone); test stubs; and tests, which
# hold locks as another devvm would.
- path: ^internal/(platform|stubtest)/|^internal/proxy/rotate\.go$|_test\.go$
linters: [forbidigo]
text: (syscall|unix)\.Flock
# state's own writer; the proxy's (standard library only); the
# message generator (a leaf); test stubs; and tests' fixtures.
- path: ^internal/(state|proxy|msg/gen|stubtest)/|_test\.go$
@@ -168,6 +263,33 @@ linters:
- path: ^internal/daemon/status\.go$|_test\.go$
linters: [forbidigo]
text: devvm's environment never changes
# The readers of files a VM can write, or swap, are held to
# internal/safefile: the project folder's (devcontainer.json, its
# default.nix, .git's), devvm agent save's store, devvm paste's copied
# file, the agents' logins and the policy files, the logs a VM drives
# (vmlog, and the proxy's rotate.go) and the Nix cache. Tests make
# their own fixtures.
- path-except: ^internal/(gitprotect/|vm/(devcontainer|detect|paste|agentsave[a-z_]*)\.go$|agentlogin/|netpolicy/rules\.go$|proxy/(config|policy|rotate|nixcache)\.go$|vmlog/)|^testdata/lint/
linters: [forbidigo]
text: internal/safefile
- path: _test\.go$
linters: [forbidigo]
text: internal/safefile
# The packages that change files a VM can write or swap (the proxy's
# logs and Nix cache, the logs vmlog keeps, and vmssh's sockets and
# files beside the VM's) change them through what opened them. Tests
# make their own fixtures.
- path-except: ^internal/(proxy|vmlog|vmssh)/|^testdata/lint/
linters: [forbidigo]
text: never by its path
- path: _test\.go$
linters: [forbidigo]
text: never by its path
# A secret's value is revealed where it's used, each call with a
# //nolint:forbidigo that says why. Tests check the values.
- path: _test\.go$
linters: [forbidigo]
text: pass the redact\.Secret on
paths:
- ^\.agents/
+4
View File
@@ -3,3 +3,7 @@ config:
MD013: false
# Lists may follow a paragraph directly.
MD032: false
# A heading may repeat under another parent, as each release's Fixed
# does in CHANGELOG.md.
MD024:
siblings_only: true
@@ -9,8 +9,8 @@ importers:
.:
dependencies:
markdownlint-cli2:
specifier: 0.24.0
version: 0.24.0
specifier: 0.24.1
version: 0.24.1
packages:
@@ -42,15 +42,12 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==}
ansi-regex@6.4.0:
resolution: {integrity: sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==}
ansi-regex@6.6.0:
resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==}
engines: {node: '>=12'}
argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
[email protected]:
resolution: {integrity: sha512-Sn98ftV3KfsO8xfLPHG6oT8y+b0yvbrLgZjgPDXsharNY15tTAjqIsIju4S32nl6/iEUNNE4v+yL2Zhm8ooP3w==}
argparse@3.0.4:
resolution: {integrity: sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==}
[email protected]:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
@@ -115,8 +112,8 @@ packages:
resolution: {integrity: sha512-c8B/VNLmxRcmqqenRA9t+9IyOjf9+V6lTxPaUJLqOCONdQkWZ0ETYgX0qbtJqPsgCNusT9MZ5Jeidw8Eb9tn2g==}
engines: {node: '>=20'}
[email protected]3:
resolution: {integrity: sha512-2E8Q6rh+1RRSq/YdaGsNfXsEZy9FVqv6BSSrkmZJP7BnaoPnRfKL+YaofPvP+5rzdk144qSm6i4+hvPgUcbV4Q==}
[email protected]4:
resolution: {integrity: sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==}
engines: {node: '>= 4'}
[email protected]:
@@ -147,8 +144,8 @@ packages:
resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==}
engines: {node: '>=12'}
js-yaml@5.4.3:
resolution: {integrity: sha512-yzzNtgczwgoVHNigCyKTXcQJU4Y8t/ikU4UxXW0BvrLfHTGWZhsNcOT2s/a7vn81/4KqVnNmHjaUEPlvWnNwVw==}
js-yaml@5.5.0:
resolution: {integrity: sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==}
hasBin: true
[email protected]:
@@ -174,13 +171,13 @@ packages:
peerDependencies:
markdownlint-cli2: '>=0.0.4'
[email protected].0:
resolution: {integrity: sha512-c5hU2MDoTlS230MLzdNlkIyxImXq5acxGKz4nYz4aDhH/2BgFtpsA7iK9/OoTHMgZ4FuR0wedTQA31K6Lp9I/Q==}
[email protected].1:
resolution: {integrity: sha512-nLhes/MIPJQLm+Gmh+3jQEnwMOaalaN0wfCD2qz1247zNZ7R3r2WDHJB191x4hcy6soKAUTybp1bFK7aJGw/WA==}
engines: {node: '>=22'}
hasBin: true
[email protected].0:
resolution: {integrity: sha512-kzsCV/rPWRFn3jUhcB919YF4Qgeh0g9tcogoXFadGSo6Zxj6662YOqWXv0jDn8nv5KCCxDfMKJZv6N4HkNkvTg==}
[email protected].1:
resolution: {integrity: sha512-Otolm9JX12iO2NG5cetlKfzGygpiLSlHuqXKxoT6HGhN5HtbxprJPicKZqqCQd88qOvUi/TEs3o1AmcYioVscA==}
engines: {node: '>=22'}
[email protected]:
@@ -289,9 +286,9 @@ packages:
[email protected]:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
re2js@2.8.6:
resolution: {integrity: sha512-xLgQil4kIUCrAzVk9fRSkxkFNwmygLFjVxXrLc65aE1F0+Zsb8rxumFBy4XKyvgMCTL6kilDq3EZ0piE2dP/Dg==}
engines: {node: '>=18.0.0'}
re2js@2.9.1:
resolution: {integrity: sha512-JIT3bEEUZTOR2YS1walNEIfH4cF/cQeZcBUFq7ldqO6lR6g0X5CBq/S8rsa9omzZcsNf8qc36jCkWpKKtncrZg==}
engines: {node: '>=20.0.0'}
[email protected]:
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
@@ -353,11 +350,9 @@ snapshots:
'@types/[email protected]': {}
ansi-regex@6.4.0: {}
ansi-regex@6.6.0: {}
argparse@2.0.1: {}
[email protected]: {}
argparse@3.0.4: {}
[email protected]:
dependencies:
@@ -413,13 +408,13 @@ snapshots:
dependencies:
'@sindresorhus/merge-streams': 4.0.0
fast-glob: 3.3.3
ignore: 7.0.13
ignore: 7.0.14
is-path-inside: 4.0.0
micromatch: 4.0.8
slash: 5.1.0
unicorn-magic: 0.4.1
[email protected]3: {}
[email protected]4: {}
[email protected]: {}
@@ -442,9 +437,9 @@ snapshots:
[email protected]: {}
js-yaml@5.4.3:
js-yaml@5.5.0:
dependencies:
argparse: 2.0.1
argparse: 3.0.4
[email protected]: {}
@@ -460,32 +455,32 @@ snapshots:
[email protected]:
dependencies:
argparse: 3.0.3
argparse: 3.0.4
entities: 8.1.0
linkify-it: 6.1.0
mdurl: 2.1.0
punycode.js: 2.3.1
uc.micro: 3.0.0
[email protected]([email protected].0):
[email protected]([email protected].1):
dependencies:
markdownlint-cli2: 0.24.0
markdownlint-cli2: 0.24.1
[email protected].0:
[email protected].1:
dependencies:
globby: 16.2.4
js-yaml: 5.4.3
js-yaml: 5.5.0
jsonc-parser: 3.3.1
jsonpointer: 5.0.1
markdown-it: 15.0.3
markdownlint: 0.42.0
markdownlint-cli2-formatter-default: 0.0.6([email protected].0)
markdownlint: 0.42.1
markdownlint-cli2-formatter-default: 0.0.6([email protected].1)
micromatch: 4.0.8
smol-toml: 1.9.1
transitivePeerDependencies:
- supports-color
[email protected].0:
[email protected].1:
dependencies:
micromark: 4.0.3
micromark-core-commonmark: 2.0.4
@@ -495,7 +490,7 @@ snapshots:
micromark-extension-gfm-table: 2.1.2
micromark-extension-math: 3.1.0
micromark-util-types: 2.0.3
re2js: 2.8.6
re2js: 2.9.1
string-width: 8.3.0
transitivePeerDependencies:
- supports-color
@@ -705,7 +700,7 @@ snapshots:
[email protected]: {}
re2js@2.8.6: {}
re2js@2.9.1: {}
[email protected]: {}
@@ -724,7 +719,7 @@ snapshots:
[email protected]:
dependencies:
ansi-regex: 6.4.0
ansi-regex: 6.6.0
[email protected]:
dependencies:
@@ -2,6 +2,6 @@
"name": "mise-npm-install",
"private": true,
"dependencies": {
"markdownlint-cli2": "0.24.0"
"markdownlint-cli2": "0.24.1"
}
}
+4
View File
@@ -21,6 +21,10 @@ devvm.Filler = NO
[.agents/skills/cli/*.md]
BasedOnStyles = devvm
# The codebase-standards skill is prose for contributors too.
[.agents/skills/codebase-standards/*.md]
BasedOnStyles = devvm
# Not checked: .agents/skills/docs-voice/tropes.md, whose lists and examples
# are the very words and quoted phrases every devvm rule flags, and
# .agents/skills/security-audit/, which is vendored.
+82 -77
View File
@@ -4,51 +4,59 @@ devvm: one isolated VM per project folder, cloned from a base image, with toolch
## Layout
Each package's concerns and identifiers: [The packages](docs/content/docs/contributing/structure.md#the-packages).
| Path | What |
| --- | --- |
| `cmd/devvm/` | the entry point: `ui.Main` makes the run's UI and runs the root command with it; the only `os.Exit` |
| `internal/cli/` | Cobra commands, one file each (root = up, `build`/`rebuild`, `images`, `gc`, `space`, `retention`, `layer` (its new, add and rm), `setup`, `agent` (its import and save; login in `agentlogin.go`), `restart`, `tools`, `adopt`, `rm`, `stop`, `update`, `history`, `ls`, `network` (its rules and log too), `doctor`, `secret`, `link` (its add, rm, publish and unpublish too), `group` (join, leave), `ssh-agent`, `host`, `code`, `desktop`, `limactl`, `ports`, `size`, `git-protect`, `clone`, `completion`, `upgrade`, hidden `version`, `_msg`, `_qemu`, `_proxy`, `_ports` (`forwarder.go`), `_links`, `_refresh-tools`); `app.go`: the run's services, each made once (folders, overrides, secrets, registry, tools, `vmEnv`, `builder`; `a.env` runs a command on the folder's VM); `args.go` checks arguments and flags (usage errors), `flags.go` the flags several commands share, `word.go` refuses devvm WORD and help's unknown words (a part's name points to its flag; did-you-mean over commands, `msg.Closest`); `help.go` the help's groups, `Example`s and docs links (`msg.CommandDocURL`); `json.go`: `--json` (`printJSON`, `"version": 1`), its shapes in `json_test.go`; `script_test.go` runs testscript; `docgen/` writes the CLI reference |
| `internal/vm/` | `Env` (`env.go`: shared dependencies, and its parts, each made once by `wire`, which the commands reach, never converting one type to another); the start (`start.go`: `starter.bringUp`, every path's one start, `requirements`, `confinementFor`, `hostChecks`); the finder (`finder.go`: `target` finds the VM a command acts on, as its `need` says; `target.go`: that VM, read once, and what a command does with it; `move.go`: a VM whose folder moved, devvm adopt VM); the inventory (`inventory.go`: every VM's state, backend and list, read in one place, one failure policy); `Launch`: a new VM (`up.go`; `parts.go`: its toolchains, agents and layers, the picker, setup's agents and layers; `detect.go`: what the folder's files call for), an existing one (`existing.go`), `ssh.go`, agents' mounts from devvm's agent store (`agents.go`: `agentStore`, the one reader of `Dirs.AgentSettings`; `secrets.LoginFile` the logins'), `AgentImport` (`agentimport.go`: devvm agent import, the one reader of the home's agent files), `AgentLogin` (`agentlogin.go`: devvm agent login, the agent's login in the VM, its forward, API keys), `AgentSave` (`agentsave.go`: devvm agent save, a VM's settings into the store, after a diff (`linediff.go`) and a yes; `agentsave_read.go`: its fixed list and the checks on the VM's stream); `Lifecycle` (`lifecycle.go`; `remake.go`: the one remake, a VM made again from another image, devvm layer add, devvm layer rm, devvm update and devvm clone; `home.go`: its home folder's copy); `Housekeeping` (`housekeep.go`: images, shared tools, exports and leftovers for devvm images, gc, space and retention); `Exports` (`exports.go`: the exports of agents' history, their `.folder` files, `Newest`); `Tools` (`tools.go`: a VM's shared tools); `Settings` (`settings.go`, `size.go`, `ports.go`, `sshagent.go`); `Net` (`network.go`, `secret.go`); `Links` (`links.go`: links between VMs, published ports), `Groups` (`groups.go`: the links a group makes); `--clone` (`clone.go`: the clone, rm's check, devvm clone's switch); a devcontainer.json's mapping and commands (`devcontainer.go`); the setup it sends (`sync.go`) |
| `internal/shell/`, `internal/vmname/` | stdlib leaves: quoting for a POSIX shell (`Quote`, `QuoteJoin`) and its variables' names (`EnvName`); a project VM's name grammar (`Prefix`, `HashLen`, `IsVM`, `HashOf`, `SlugOf`, a remake's `Aside`) |
| `internal/project/`, `internal/gitprotect/`, `internal/hostsafety/`, `internal/hostgit/` | a project folder (VM name, link targets, unsafe folders, parents); `.git` protection; the folder's other host checks (set-id files, skipping `.git`, once stopped; an SSH origin); every host git command devvm runs (no fsmonitor, hooks or filters, ssh only, no `GIT_*` of the environment, no prompts) |
| `internal/sshconfig/`, `internal/sshagent/` | the ssh config for running VMs by name, the `~/.ssh/config` Include line; each VM's SSH agent choice, devvm's own agent and its keys |
| `internal/build/`, `internal/image/` | building and rebuilding images, their records; image keys and names (pure) |
| `internal/fetch/` | every HTTP client (stdlib): `NewClient` (timeout, `HTTPSOnly`/`SameScheme`), `Retry`/`Transient`, `ReadCapped`, `Get`, `Resolve` (where a HEAD's redirects end), `Download` (checks the SHA-256, capped) |
| `internal/upgrade/` | devvm upgrade: how this devvm was installed (`Detect`), the releases (`Source`: the newest, `Check` for a notice, `Fetch`: minisign's `ED` signature by the built-in key, then the SHA-256), the unpack, the link's switch and rollback, brew; `upgradetest/` (tests only: a TLS release server, a minisign signer) |
| `internal/from/` | `--from`: references, registry digests (anonymous token), Docker's IDs, the recorded digests |
| `internal/redact/` | passwords out of logs (stdlib): `String` (the run log's lines: proxy keys, URL passwords), `File` (another program's log, in place, its length kept) |
| `internal/devcontainer/`, `internal/jsonc/` | a project's devcontainer.json (pure): finding it, mapping it to a new VM's plan, refusals, what devvm update's reading again replaces (`Reread`); JSON with comments (`jsonc.Strip`, stdlib) |
| `cmd/devvm/` | the entry point (`ui.Main`); the only `os.Exit` |
| `internal/cli/` | the command line: one file per Cobra command, the run's services (`app.go`), argument checks, help, `--json`, the CLI tests, `docgen/`; `doc.go` maps it |
| `internal/vm/` | what each command does to a folder's VM, below the command line; `doc.go` maps the package and its owners |
| `internal/shell/`, `internal/vmname/` | quoting for a POSIX shell; every VM's name (`vmname.VM`, parsed where it's read) and a project VM's name grammar |
| `internal/project/`, `internal/gitprotect/`, `internal/hostsafety/`, `internal/hostgit/` | a project folder; `.git` protection; the folder's other host checks; every host git command devvm runs |
| `internal/sshconfig/`, `internal/sshagent/` | the ssh config for running VMs by name; each VM's SSH agent and devvm's own |
| `internal/build/`, `internal/image/` | building images and their records; image keys and names, and the shared tools' registry (`SharedTools`) |
| `internal/fetch/` | every HTTP client |
| `internal/upgrade/` | devvm upgrade; `upgradetest/` (tests only) |
| `internal/from/` | `--from`'s references and digests |
| `internal/redact/` | passwords out of logs; `Secret`, the type of every secret's value |
| `internal/vmlog/` | every log a VM can drive (but the proxy's own): its rate, its cap while it runs, and the backend's logs, serial consoles' included |
| `internal/safefile/` | every read of a file a VM can write or swap |
| `internal/landlock/` | Linux's sandbox for the proxy's child: Landlock and the hand-written seccomp filter (`Self`) |
| `internal/devcontainer/`, `internal/jsonc/` | a project's devcontainer.json; JSON with comments |
| `internal/tools/` | the shared tools: the lock, host mise, the daily check, tool image builds, the share |
| `internal/netpolicy/`, `internal/secrets/` | network policy (the choice, the VM's proxy, the self-check); tokens on the host and the VM's bindings |
| `internal/trust/` | the user's CAs (`~/.config/devvm/ca`): read and checked, sent to VMs, build VMs' `Trust` scripts, the guest environment; each VM's own CA and its next (`InitCA`, in `vms/<hash>/run/ca/`) |
| `internal/agentlogin/` | agents' login and settings files on the host: the VM's copies with placeholders, bindings, values and OAuth refresh (`File`), `Redact`, and `Restore`, which puts the store's values back for a VM's placeholders |
| `internal/proxy/` | the proxy, run as `devvm _proxy`; see its `README.md` |
| `internal/daemon/` | devvm's background processes (stdlib only): detached starts, pid files checked against the process's arguments, stopping (TERM, then KILL), readiness by status file, the lifeline; the only place a process is signalled by pid (forbidigo) |
| `internal/desktop/` | devvm desktop's relay on the host: VNC's password checked here, then an ssh channel to the VM's socket, the viewer's clipboard dropped; passwords |
| `internal/backend/` | `Backend` and its roles, `Caps`, `Require`, `Check`, the registry and its guard (`As`); `backendtest/` (fake), `registry/` (every backend's), `lima/` |
| `internal/vmssh/` | devvm's own over a VM's ssh, on every backend: `Checked`, the one way to a VM's ssh (the review, the backend's `SSH` checked by `FromTarget`, its host keys read or pinned; `UnusableError`, `ErrNoHostKeys`), the port forwarder and its one owner (`Forwards`: lock, stop, start, its ports from vm.json), a login's forward of this machine's loopback ports in devvm's own process (`ForwardLoopback`), links' sessions, each VM's one host-key record per start (`PinHostKeys`, `vms/<hash>/run/known_hosts`) that every ssh of devvm's checks |
| `internal/ui/` | the only package that prints: `ui.UI` (messages, prompts, status line, run log, cleanups), `ui.Main` (signals); no package state |
| `internal/msg/`, `locales/` | messages: `en.toml`, the generated functions, doc links (`docs.go`), the generator (`gen/`); `Reporter` (`reporter.go`: what every package prints and asks through, `*ui.UI` its one implementation, `Fake` the tests'); `Question` (`question.go`: a question and what answers it, `AnsweredBy`/`RefusedWith`; where devvm can't ask, its `Refusal` is the prompt's error) |
| `internal/ports/` | a VM's ports section (forwards asked for, host ports chosen) and the one allocator of host ports, under the claims lock |
| `internal/paths/`, `internal/state/` | every folder and file devvm uses, a VM's in its folder (`Dirs.VM`: `vms/<hash>/`), host paths resolved and compared (`Physical`, `PhysicalParent`, `Within`, `Below`: `resolve.go` says which for what); a VM's state, `vm.json` (core fields, one section per package, changed only in `VM.Update` under the VM's lock); the layout version (`CheckLayout`, `migrations`; `testdata/script/layout.txtar` lists every file); every file written whole (`WriteFile`, `WriteFileMode`: forbidigo bans `os.WriteFile`, `os.Create` and `O_TRUNC` elsewhere but the proxy), private folders (`PrivateDir`) |
| `internal/settings/` | the defaults (`Defaults`, `Read`, `Save`): `config.toml` (yours, strict) over `settings.json` (devvm's), each value's check (`ParsePorts`, `ParseCPUs`, `ParseGiB`, the retention settings) |
| `internal/platform/`, `internal/ubuntu/`, `internal/testbuild/` | build-tagged OS code; finding and verifying Ubuntu's cloud image (never downloads); whether this is a test build (ldflags: only it reads the test overrides, `cli`'s `readOverrides`) |
| `assets/` | the files devvm ships, embedded (`assets.FS`, passed to constructors by `cli`): `base.yaml`, `prelude.sh` (`$devvm_arch`, `$devvm_libc`, `devvm_sha`: first in each build script run with bash, read through `image.OwnScript`), `layers/` (base's Lima template and scripts; the built-in layers, `desktop`, `docker` and `nix`, each with its policy), `features/` (base's optional ones), `shared-tools/` (`mise.toml`, `build.sh`, `*.policy`), `guest/` (in-VM scripts sent on every launch, and the port forwarder's `ports.sh`), `oci/` (`--from`'s conversion; see its `README.md`) |
| `internal/structure/` | the structure test (tests only) |
| `internal/stubtest/` | the test stubs (tests only): `stub/`, one Go binary for every host command, dispatched on `argv[0]` (each stub's comment lists its switches; `guest.go`, the VM behind limactl shell and ssh; `stub`, scripts' commands on its state), built once into `$TMPDIR/devvm-stubs-<hash>`; `stubstate/`, their typed JSON state under a lock; `stubtest` puts them on `PATH`: their folder, calls, files and state, `ExecRunner`; `msg.Fake`, `msg.Recorder`, `msg.IDOf` and `msg.NamesOf` are tests' too, `backendtest.Stored` a fake with disks |
| `testdata/` | `script/*.txtar` (CLI tests), `golden/<os>/` (what the real tools printed, `mise run e2e -- --golden`; the stubs and devvm's parsers are checked against it), `mise.lock` (fixture), `coverage/<os>.txt` (each package's coverage baseline, per system), `lint/` (a line breaking each forbidigo rule, which `lint:code` checks) |
| `tests/e2e/`, `tests/e2e-mise.lock` | end-to-end tests on real VMs (Go, tag `e2e`, a file per section; `TestE2E` is the run, `mise run e2e -- FLAGS`; the sandbox, slots, locks and `e2eUbuntuRelease` in `sandbox_test.go`); the shared tools' versions every section but `tools` uses (`scripts/bump.sh e2e-tools`) |
| `scripts/`, `packaging/`, `.goreleaser.yaml`, `VERSION`, `CHANGELOG.md` | `bump.sh` (pins), `release.sh` (signed-tag checks around GoReleaser, then minisign), `publish.sh` (the release: checks, release.sh, one yes, then pushes, `gh release` and the tap), `test.sh` and `coverage.sh` (mise's test tasks); the Homebrew formula; `packaging/key.go` embeds the folder, so devvm upgrade's key is `minisign.pub`'s (none without it); `VERSION` is read by the scripts only |
| `install.sh` | `curl \| bash`: the host's archive (the binary, README, changelog, license), checked, into `~/.local/lib/devvm/<version>`, then doctor's fixes, asking first; tests source it (`DEVVM_INSTALL_TEST`) |
| `internal/netpolicy/`, `internal/secrets/` | network policy; tokens on the host, the VM's bindings and your own secrets |
| `internal/trust/` | your CAs, and each VM's own CA |
| `internal/agents/` | the coding agents' registry: one `Def` each, which every list of the agents derives from |
| `internal/agentlogin/` | agents' login and settings files on the host, and their placeholders |
| `internal/proxy/` | the proxy: its broker, `devvm _proxy`, and the child that reads the VM's network, `devvm _proxy-child`; see its `README.md`; every host's one form (`NormHost`); the VM's SSH agent relay, the only way a VM reaches an agent |
| `internal/daemon/` | devvm's background processes; the only place a process is signalled by pid |
| `internal/seatbelt/` | macOS's sandbox: `sandbox-exec`, profile strings and real paths, the proxy child's profile |
| `internal/desktop/` | devvm desktop's relay on the host |
| `internal/backend/` | `Backend`, its roles, `Caps`, the registry and its guard; `backendtest/`, `registry/`, `lima/` |
| `internal/vmssh/` | devvm's own ssh to a VM (`Checked`), the port forwarder (`Forwards`), each start's host keys |
| `internal/ui/` | the only package that prints |
| `internal/msg/`, `locales/` | messages, `Reporter` and `Question` |
| `internal/ports/` | a VM's ports and the one allocator of host ports |
| `internal/paths/`, `internal/state/` | every folder and file devvm uses; `vm.json`, the layout version, files written whole |
| `internal/settings/` | the defaults: `config.toml` over `settings.json`, each value's check |
| `internal/platform/`, `internal/ubuntu/`, `internal/testbuild/` | build-tagged OS code; Ubuntu's cloud image (never downloads); whether this is a test build |
| `assets/` | the files devvm ships, embedded (`assets.FS`) |
| `internal/structure/` | the structure test |
| `internal/stubtest/`, `internal/leaktest/`, `internal/memnet/` | the test stubs; the goroutine leak checks (`Main`, `Check`); the network in memory for synctest bubbles |
| `testdata/` | CLI tests, golden fixtures, coverage baselines, each release's frozen state (`v<release>/`), `lint/` |
| `tests/e2e/`, `tests/e2e-mise.lock` | end-to-end tests on real VMs |
| `scripts/`, `packaging/`, `.goreleaser.yaml`, `VERSION`, `CHANGELOG.md` | pins, releases, the test tasks' scripts, the Homebrew formula, devvm upgrade's key |
| `install.sh` | `curl \| bash`, asking before doctor's fixes |
| `docs/` | the docs site (Hugo + Hextra); `content/docs/cli/` is generated, never edit it |
| `mise.toml`, `.golangci.yml`, `.vale*`, `.markdownlint-cli2.yaml`, `.github/` | tools, tasks, linters, CI and Pages |
| `.agents/skills/security-audit/` | the security-audit skill, for backend reviews |
| `.agents/skills/cli/` | the cli skill: devvm's command line rules, the checklist for adding a command, the tests behind each rule, `judgment.md` for the rest |
| `.agents/skills/docs-voice/` | the docs-voice skill: the voice of the prose and messages, terms, tropes, `scan.sh` and `facts.sh` |
| `.agents/skills/codebase-standards/` | the codebase-standards skill: the checklist for a commit and a review from what reviews kept finding, matching the codebase's style, every rule's guard |
## Tasks
`mise run <task>`: `fmt`; `lint` (`lint:code`: Go, shellcheck, workflows with actionlint and zizmor; `lint:docs`: docs, `TestDocLinks`, `TestCommandLines`); `test` (`scripts/test.sh`: `-race`, in a throwaway `HOME`; needs a C compiler; then each package's coverage, unit and CLI tests merged, against `testdata/coverage/<os>.txt`); `coverage` (the same, then raises the baselines it beat: commit them with the change); `vuln`; `deadcode` (lists only `backendtest`, `stubtest`, `upgradetest`, `msg.IDOf`, `msg.NamesOf`, `msg.Recorder` and `msg.Fake`, which tests use; anything else gets a caller or goes); `cli-docs` (after changing any command's `Use`, `Short`, `Long` or flags; commit the pages); `docs` (serves `http://localhost:1313/`); `e2e`.
`mise run <task>`: `fmt`, `lint` (`lint:code`, `lint:docs`), `test`, `coverage` (commit the baselines it raised with the change), `vuln`, `nilaway` (advisory: a new finding gets a fix and a test, or a line in `testdata/nilaway-baseline.txt`), `nilaway:linux` (must pass before a push to `main`), `deadcode` (anything but the tests' helpers gets a caller or goes), `cli-docs` (after changing a command's help, flags or docs page; commit the pages), `docs`, `e2e`: [Tools and tasks](docs/content/docs/contributing/_index.md#tools-and-tasks).
## Rules
@@ -57,87 +65,84 @@ devvm: one isolated VM per project folder, cloned from a base image, with toolch
- **devvm's own files never get a shared copy on disk:** the proxy reads them from the binary, base.yaml and scripts go on stdin, `--from`'s build writes its scripts into its own temp folder.
- **Credentials never go into images.** Host agent history never goes into VMs.
- **Never auto-delete project VMs:** they may hold unsaved work. Warn instead.
- **Every release's state keeps working** until 1.0: a change to state runs its new commands on every frozen `testdata/v<release>/` fixture (never edited or regenerated) in the same commit, and a change for existing state gets a Breaking changelog entry ([Released state](docs/content/docs/contributing/structure.md#released-state)).
- **The startup check only reports.** Never install host software without asking.
- **Image keys hash everything that goes into an image**, the backend included. A tool image's key is its lock entry, `assets/shared-tools/build.sh` after the prelude, `shared-tools/mise.toml`'s `[settings]`, the mise `layers/base.sh` pins (not rust's), the libc and the base it builds in: devvm's own Ubuntu base for gnu, the only one gnu ones build in, and for musl its `--from` base's digest (`Share.Build` checks the base's record).
- **Image keys hash everything that goes into an image**, the backend included; a tool image's key is in [Building tools](docs/content/docs/internals/images.md#building-tools).
- **Pin every download** in `assets/`'s `layers/`, `features/`, `shared-tools/build.sh`, `oci/build.sh`: `<tool>_version` and `<tool>_sha256_arm64`/`_amd64` at the top, picked with the prelude's `devvm_sha`, fetched with `devvm-fetch` (`oci/build.sh`: `sha256sum`). No `curl | sh`, no "latest". Upstream-checked exceptions: shared tools (`MISE_LOCKED=1`), Ubuntu's signed `SHA256SUMS`, Lima in `install.sh`. Go checks a download's SHA-256 before use.
- **Shared tools are read-only in VMs:** whatever writes into a tool's folder (global installs, self-updates, `corepack enable`, `rustup component add`) is redirected (`~/.npm-global`, `go_set_gobin = false`), done in `assets/shared-tools/build.sh`, or off.
- **In-VM scripts are bash 3.2-safe and shellcheck-clean** (`assets/`, `install.sh`): guard empty arrays (`${a[@]+"${a[@]}"}`), no associative arrays. Everything else is Go.
- **Docs:** an easy-to-follow guide in full, joined sentences, every fact kept; write and edit prose with the docs-voice skill (Vale's `devvm.AIWords` fails on chatbot vocabulary). Every behavior change updates its page in `docs/content/docs/` in the same task. The README stays high level.
- **The one exception, the docs build's Node script:** `docs/render-diagrams.mjs` (`mise run docs:diagrams`) draws the site's diagrams with pele, pinned in `docs/package.json` and its lock and installed with `npm ci --ignore-scripts`; no other build script is JavaScript, and no other npm package is installed outside mise's tools.
- **Docs:** an easy-to-follow guide in full, joined sentences, every fact kept, written with the docs-voice skill; every behavior change updates its page in the same task, and the README stays high level ([Writing docs](docs/content/docs/contributing/docs.md#writing-docs)).
- **Every code change meets the codebase-standards skill** (`.agents/skills/codebase-standards/`): its checklist before committing, and its review when reviewing one.
- **Adding or changing a command** follows the cli skill (`.agents/skills/cli/`): its checklist, then its review.
- **Adding or changing a shared tool** updates its page: `using/toolchains.md` for a toolchain, `using/coding-agents.md`'s Supported agents for an agent.
- **Docs by reader:** user pages (`getting-started/`, `using/`, `safety/`, `backends/`) say what devvm does and what you type, without repo paths, Go identifiers or message names; How it works (`internals/`) explains mechanisms; Contributing (`contributing/`) has repo paths and Go identifiers.
- **Extend the owner, don't copy it:** before adding a helper, parser, path, file reader, message or table, find its owner and extend it; a new owner gets a forbidigo rule or a structure-test check only when a second copy would be a bug ([Contributing](docs/content/docs/contributing/_index.md#one-owner-for-each-concern)).
- **Adding or changing a shared tool** updates its page and follows Contributing's checklist: `using/toolchains.md` for a toolchain ([Adding a toolchain](docs/content/docs/contributing/extending.md#adding-a-toolchain)), `using/coding-agents.md`'s Supported agents for an agent ([Adding a coding agent](docs/content/docs/contributing/extending.md#adding-a-coding-agent)).
- **Docs by reader:** user pages name no repo paths, Go identifiers or message names; How it works explains mechanisms; Contributing has the paths and identifiers ([Writing docs](docs/content/docs/contributing/docs.md#writing-docs)).
- **User pages lead with doing:** in `getting-started/`, `using/`, `safety/`, `backends/` and `compared/`, a task shows its command, and prose never runs to back-to-back paragraphs; one explanatory paragraph is fine, and longer mechanism moves to How it works, linked, every fact kept.
- **Extend the owner, don't copy it:** before adding a helper, parser, path, file reader, message or table, find its owner and extend it (code with no owner yet gets one at its third copy, a judge at its second); a new owner gets a forbidigo rule or a structure-test check only when a second copy would be a bug ([Contributing](docs/content/docs/contributing/structure.md#one-owner-for-each-concern)).
- **Edit files with the editor tools,** not `sed`, `awk`, `python`, heredocs or `cat >`.
- **Ask first** before anything outward-facing (publishing, releases, repos, pushing) and before deleting anything you didn't create.
- **A task that turns out wrong or incomplete** gets a proposed change (`dex edit`), not quietly something else.
- **A task that turns out wrong or incomplete:** say so and propose the change; don't quietly do something else.
## Go conventions
- **Only `internal/ui` prints.** forbidigo bans `fmt.Print*`, `os.Stdout`/`os.Stderr` elsewhere and `os.Exit` outside `cmd/devvm`. Data goes to the UI's `Stdout()`, non-message log lines to its `Stderr()`.
- **Functions take their caller's `ctx`:** forbidigo bans `context.Background`/`TODO` outside `internal/ui` and `cmd/devvm`; one that must outlive its caller's gets `//nolint:forbidigo // why`.
- **Every `//nolint` names its linters and says why** (nolintlint). Functions stay within revive's `function-length` and `cognitive-complexity` limits: split one that grows past them.
- **Fail by returning:** `RunE` returns the error, as `failed(err, msg.XFailed)` when it may not be a message; `execute` alone prints it (`showFailure`: a `LoggedError` with the log's end via `ErrorLogged`, a message as it is, else `what`) and returns 1, then `ui.Main` runs the cleanups. Only the UI ends a run itself (`die`: no run log). INT/TERM/HUP cancel the root context, wait for the logged command, then, with cleanups to run, up to 2 s for the command to return (`returnGrace`; not while it waits at a question, whose answer after a signal is refused), run the cleanups and return 130; a second signal is ignored; after one, failures print nothing. A logged command a signal ended (or 128+) waits up to 1 s for devvm's own interrupt, as Ctrl+C can end it first.
- **Only `cmd/devvm` and `internal/cli` import `internal/ui`** (the structure test's layers): cli passes the run's `app` (its `*ui.UI` and services) to each command; other packages embed the one `msg.Reporter` (messages, prompts, status line, run log, cleanups), which their constructors take and cli gives them, or cli asks first and passes the answer in; a package's own `Warn` that says where the run log is too (Lima's, the shared tools') is a method over it.
- **Arguments and flag values are checked before anything runs**, in `Args` (`noArgs`, `exactArgs`… from `args.go`, never Cobra's; values with `cobra.MatchAll`), `checkFlagValue` and `exclusive`: a usage error exits 2 and names the command's --help. Exit codes: 0, 1, 2, 130.
- **Only `internal/ui` prints, functions take their caller's `ctx`, and every `//nolint` names its linters and says why;** functions stay within revive's limits ([Go lint rules](docs/content/docs/contributing/_index.md#go-lint-rules)).
- **Fail by returning:** `RunE` returns the error and `execute` alone prints it; signals, exit codes and the run log: [CLI conventions](docs/content/docs/contributing/cli.md#cli-conventions).
- **Only `cmd/devvm` and `internal/cli` import `internal/ui`;** other packages print and ask through the one `msg.Reporter` their constructors take ([Messages](docs/content/docs/contributing/cli.md#messages)); a lock's wait shows through `msg.Waiting` with its `Status`, and only `internal/state` and `internal/trust`, which take none, read it from the context (`msg.StatusOf`).
- **Arguments and flag values are checked before anything runs**, with `args.go`'s checks, never Cobra's; a usage error exits 2 ([Command arguments](docs/content/docs/contributing/cli.md#command-arguments)).
- **Cleanups:** whatever a failure would leave (a build VM, a temp file) registers with the UI's `AddCleanup` and is removed once done; one only for interrupts checks `Interrupted()` and stays once interrupted, as the cleanups run after the command returns. Cleanups get a fresh context.
- **External commands run with the UI's `LoggedCmd(ctx, step, cmd)`** (a backend's `Runner`): output to the run log, a failure after one returned as `backend.Logged(m)`. `WithSteps(ctx, n)` numbers steps.
- **OS-specific code goes behind build tags** in `internal/platform` (`*_darwin.go`, `*_linux.go`, `*_other.go`).
- **Dependencies:** the depguard allowlist (cobra, pflag, cobra/doc, go-i18n, BurntSushi/toml, x/text, x/term, x/sys, x/crypto's `blake2b` only (minisign's prehash); go-internal in tests; cobra/doc's own deps never imported directly). `internal/proxy` and `internal/daemon` are stdlib only. Adding one: ask.
- **External commands run with the UI's `LoggedCmd(ctx, step, cmd)`**, a failure after one returned as `backend.Logged(m)` ([CLI conventions](docs/content/docs/contributing/cli.md#cli-conventions)).
- **OS-specific code goes behind build tags** in `internal/platform` (`*_darwin.go`, `*_linux.go`, `*_other.go`); packages the proxy imports keep their own (`internal/safefile`, `internal/daemon`, `internal/proxy`, `internal/landlock`).
- **Dependencies:** the depguard allowlist (cobra, pflag, cobra/doc, go-i18n, BurntSushi/toml, x/text, x/term, x/sys, x/crypto's `blake2b` only (minisign's prehash); go-internal in tests; cobra/doc's own deps never imported directly). `internal/proxy`, `internal/landlock`, `internal/daemon`, `internal/safefile`, `internal/vmname`, `internal/leaktest`, `internal/memnet` and `internal/redact` are stdlib only. Adding one: ask.
- **A secret's value is a `redact.Secret`:** each `Reveal` with a `//nolint:forbidigo` saying why, and a file that holds one writes it through its own wire type ([Secrets in the code](docs/content/docs/contributing/structure.md#secrets-in-the-code)).
- **External tools are commands, never linked** (`limactl`, `docker`, `security`, `git`, `chflags`…); prefer the standard library to shelling out. Strings into a shell are quoted with `shell.Quote`.
- **Test seams are fields** tests set (`Host`, `Exec`, `Runner`, `OS`, `Reporter`…), never package vars (reassign: no package sets another's); `internal/proxy`'s are its `server`'s, which each test makes.
- **The structure test** (`internal/structure`, in `mise run test`) holds types to 24 methods, bans `func init`, allows only constants' kin as package vars, checks the package layers and the owners (host git only in `internal/hostgit`; `DEVVM_` variables only in `readOverrides` and the listed settings; `HOME` only in `internal/paths`, as `Dirs.Home`; shell quoting only in `internal/shell`, the VM-name grammar only in `internal/vmname`, `state.ReadHash` and `project.Parents` only in the finder, `state.ReadAll` only in the inventory, `Dirs.AgentSettings` only in `vm/agents.go` and `Dirs.AgentLogins` only in `secrets/secrets.go`): see [Contributing](docs/content/docs/contributing/_index.md#the-structure-test) before raising a limit or listing an exception.
- **The structure test** holds types to 24 methods, bans `func init`, limits package vars, checks the layers and keeps each concern in its owner (its failure names the owner: extend that); read [The structure test](docs/content/docs/contributing/structure.md#the-structure-test) before raising a limit or listing an exception, and regenerate [the checks on owners](docs/content/docs/contributing/structure.md#the-checks-on-owners) after changing its tables (`go test ./internal/structure -run TestOwnersDoc -update`).
- **The CLI reference is generated:** `TestReferenceIsCurrent` fails on a stale one (`mise run cli-docs`).
- `CGO_ENABLED=0`. `internal/proxy` and `internal/daemon` are unix-only for now (`syscall.Kill`, `Setsid`, `Flock`).
## Backends
- Every backend implements `backend.Backend` and declares `Caps` per feature: native, emulated (reviewed) or none. A new `Feature` goes in `backend.Features` and the table in `docs/content/docs/internals/backends.md`.
- **`backend.Backend` is `Name`, `Caps` and four roles**, `Host`, `Images`, `Machines`, `Housekeeping`, all required; a backend's type splits the same way (Lima's `host`, `images`, `machines`, `housekeeping`). The one optional role, `Forgetter`, is found with `backend.As`.
- **A missing feature fails** in one line naming the VM and what to do; never fall back silently. Callers check the registry's `Review.Require(b, vm, spec.Features()...)` first, and its guard refuses the rest (it has every role's methods); backends don't decide what a VM needs.
- **A backend implements `backend.Backend`'s four roles, declares `Caps` for every feature and returns errors, never ending the run:** [How a backend plugs in](docs/content/docs/contributing/extending.md#how-a-backend-plugs-in); a new `Feature` goes in `backend.Features` and [the feature table](docs/content/docs/internals/backends.md#the-feature-table).
- **A missing feature fails, naming the VM and what to do; never fall back silently** ([Missing and unreviewed features](docs/content/docs/internals/backends.md#missing-and-unreviewed-features)).
- **Every emulation is refused until reviewed:** a design note in `docs/content/docs/internals/design.md`, a threat check with the security-audit skill, and e2e checks proving the guarantee; then it's marked reviewed in `Caps`.
- Backend-specific code stays in its package; what isn't (`.git` protection, the proxy) stays out.
- **Backends return errors, they don't die:** a `msg.M`, or `backend.Logged(m)` after a logged command failed. A stopped VM changes only at `Start`, which applies what its `Want` asks where it differs (`backend.Validate` first); a running one is left as it is; restart warnings are the callers'. Ports are never the backend's: `vmssh.Forwards` forwards over its `SSH`, which `vmssh.FromTarget` checks.
- **Lima edits only what differs:** any `limactl edit` gives the VM new ssh host keys at its next boot, so `Start` compares first and makes one edit. `Start` owns `env:`, `propagateProxyEnv`, `dns` and `hostResolver`, and a project VM's size, agent mounts and `forwardAgent`.
- **Lima edits only what differs:** any `limactl edit` gives the VM new ssh host keys at its next boot, so `Start` compares first and makes one edit ([What devvm sets on a VM](docs/content/docs/internals/lima.md#what-devvm-sets-on-a-vm)).
## Messages
- **Messages use the docs voice**, only shorter: the docs-voice skill's Messages and Terms rules.
- **Every message lives in `locales/en.toml`**, called through its generated function (`msg.NoVM(dir)`); `go generate ./internal/msg` after editing. Only go-i18n's fields (`other`, `one`, `description`); snake_case plain template fields (`{{.vm_name}}`); `one` makes it plural (`count int`). Doc links go in `internal/msg/docs.go`. A message without a caller fails the tests. `msg.M` is an `error`. Never build prose with `fmt`. Message values render on one line without control or bidi characters (`msg.OneLine`, at render); a VM's text shown as data goes through `msg.Printable`. A message made from an error carries it (`.Because(err)`), not only `err.Error()`.
- **Every question declares what answers it** (`msg.X().AnsweredBy("--force")` or `.RefusedWith(msg.Y())`); `Ask`/`Confirm`/`Answer`/`Secret` return its refusal where devvm can't ask (no terminal, `--no-input`, end of input), which callers return or fall back on, never checking for a terminal. The CLI tests answer with `ttyin` or `DEVVM_PIPED_ANSWERS=1`.
- An error or warning is at most two sentences; a prompt gets at most two lines of context.
- **The mechanism goes in the doc link**, not the message: every warning or error the user can act on has one.
- Status steps stay a few words, lowercase. Commands are written as devvm x, not quoted. No "please", "note that" or "simply". `[y/N]`/`[Y/n]` stay literal.
- Not messages: data output and text in scripts that run elsewhere.
- **Tests check which message and with what, never its wording:** `DEVVM_MESSAGES=names` prints `no_vm dir=/x`; `devvm _msg NAME k=v…` gives e2e the text.
- **Every message lives in `locales/en.toml`**, called through its generated function (`go generate ./internal/msg` after editing), with its doc link in `internal/msg/docs.go`; prose is never built with `fmt` ([Messages](docs/content/docs/contributing/cli.md#messages)).
- **Every question declares what answers it** (`AnsweredBy`, `RefusedWith`), and callers never check for a terminal ([Questions](docs/content/docs/contributing/cli.md#questions)).
- **Messages use the docs voice, only shorter:** the docs-voice skill's [Messages](.agents/skills/docs-voice/SKILL.md#messages) and Terms rules; the mechanism goes in the doc link.
- **Tests check which message and with what, never its wording** ([Names mode](docs/content/docs/contributing/cli.md#names-mode)).
## Testing
- **Unit tests** are Go table tests next to the code; **CLI tests** are testscript against the built binary in a `/tmp` sandbox in names mode, stubs first on `PATH` (`stub_calls`, `stub_reset`), with `project`, `vm_name`, `catg`, `vm_state`, `json_set` and `$DATA`/`$VMS`/`$RUN`/`$CFG`; the binary has `assets/` embedded (no override: scripts read `$DEVVM_REPO/assets/`; rebuild before a manual run after editing them). New logic needs a test. Neither touches the Keychain, real VMs or the user's folders; state-writing tests point the XDG folders at `t.TempDir()`. Go tests never run up: scripts do.
- **New logic needs a test:** Go table tests next to the code, and CLI tests (testscript against the built binary and the stubs); neither touches the Keychain, real VMs or your folders ([Tests](docs/content/docs/contributing/tests.md)).
- **Never touch VMs, images or containers devvm's tests didn't make:** your own stay as they are. Manual runs: `DEVVM_LIMA_HOME=~/.lt LIMA_HOME=~/.lt XDG_DATA_HOME=/tmp/x/data XDG_CONFIG_HOME=/tmp/x/config DEVVM_SECRET_SERVICE=devvm-sandbox-test` (devvm's Lima home is `$XDG_DATA_HOME/devvm/lima` unless `DEVVM_LIMA_HOME`; `LIMA_HOME` is for your `limactl`). Add a `config.toml` with `features = []` and pass `--network TIER` so nothing prompts. Delete test Keychain items. Never use your own tokens or logins: a network-policy VM reads its agent's login file from `HOME`, so give it its own (the Keychain needs the real `HOME`: test it apart).
- **End-to-end:** `mise run e2e -- FLAGS` (`--only`, `--from`, `--clean`, `--slots`, `--golden`…) builds devvm from the checkout and drives real VMs in its sandbox (`~/.lt-e2e-go`, `/tmp/devvm-go-e2e`, service `devvm-go-e2e`), deleting only what it made; images stay cached (`--clean`). `--slots N` spreads the sections over N sandboxes at once (slot K's paths end `-K`, its ports +100·K, its images cloned from slot 0's). Only `tools` resolves the newest tool versions; the rest use the pinned lock, and `--from` images go by pinned digest but one tag (`scripts/bump.sh e2e-tools e2e-from`). Run it in the background. Sections: `images`, `project`, `clone` (a throwaway repo, its own `HOME`), `gc` (an `img-*` folder's VM, a stale fixture), `tools` (a node VM), `network` (a VM with Claude Code, Codex and opencode), `desktop` (a base VM refused, then the desktop layer, devvm desktop), `nix` (a node VM with the nix layer and a flake), `from` (Debian 12, Alpine and Ubuntu bases, a docker that isn't running), `link` (two targets and a client, then the three in a group, the design note's threat check). Tiers: none (all but `desktop` and `from`, no features); `--from` (everything, every feature; before merging `assets/` or `--from` changes); `--only a,b` (with `from`: every feature). Hosted CI can't run it on macOS.
- **Linux hosts:** `LIMA_HOME=~/.lt-linux-go`, VM `linuxhost` (nested virtualization, the repo read-only, copied to `~/devvm`), set up as [testing.md](docs/content/docs/contributing/testing.md) says, apart from any Lima home of your own.
- **Unreviewed emulations** are checked through `DEVVM_UNREVIEWED=backend:feature`, which only test builds (e2e's, the CLI tests', by ldflags) read.
- **Timeouts and lifecycles** are tested in a `testing/synctest` bubble on fakes in memory (`memnet`, the seams' fields), never by sleeping on the real clock; each kind keeps one real-process test ([Time and lifecycles](docs/content/docs/contributing/tests.md#time-and-lifecycles)).
- **Goroutines:** a package that starts them calls `leaktest.Main` in its `TestMain`, and each function that does is in the structure test's `goroutineSites`, with what waits for them or `detached:` and why ([Goroutine leaks](docs/content/docs/contributing/tests.md#goroutine-leaks)).
- **End-to-end:** `mise run e2e -- --only SECTIONS` in the background for what changed, `--from` before merging `assets/` or `--from` changes ([End-to-end tests](docs/content/docs/contributing/tests.md#end-to-end-tests)).
- **Linux hosts:** `LIMA_HOME=~/.lt-linux-go`, VM `linuxhost`, set up as [Linux hosts](docs/content/docs/contributing/testing.md#linux-hosts) says, apart from any Lima home of your own.
- **Unreviewed emulations** are checked through `DEVVM_UNREVIEWED=backend:feature`, in test builds only ([Unreviewed emulations](docs/content/docs/contributing/testing.md#unreviewed-emulations)).
- **Delete test VMs and temp files afterwards.** Long builds run in the background. Tests that `chflags` real files unlock them (`chflags -R nouchg`), only in their own temp folders.
- **The testscript runner stops the sandbox's proxies** (`pkill -f` on `_proxy -config` in the sandbox): the stub hostagent is gone before they look, so they'd wait 15 minutes.
- **The testscript runner stops the sandbox's proxies** (`pkill -f` on `_proxy -config` in the sandbox, then `_proxy-child -for`): the stub hostagent is gone before they look, so they'd wait 15 minutes. It also stops the sandbox's port forwarders, link sessions and stub ssh masters.
- **`limactl shell` reads stdin:** give it none unless the input is meant for it.
- **Boot problems:** read `<devvm's Lima home>/<vm>/serialv.log` before restarting; every start overwrites it.
- **Boot problems:** read `<devvm's Lima home>/<vm>/serialv.log` (and its `.1`, past 10 MiB) before restarting; every start overwrites it.
## Gotchas learned
- **Lima `vz`:** raw disks only; clones are APFS copy-on-write (`du` overcounts). Direct kernel boot needs an uncompressed arm64 `Image`. Stopping sends a GPIO power key, so guests need `gpio_keys`, or Lima hard-kills them after 30 s. Lima can't shrink disks. virtiofs tags are `lima-<hash>`. The project mount is `/.vol/<dev>/<ino>` at its path; vz serves a share by the path it had at the start, so a rename while it runs gives "Operation not permitted". After root touches a directory on a virtiofs mount, the guest sees it as root's for a few seconds (git: "dubious ownership"). `mounts: []` doesn't remove the home mount from `base: template:…`: pass `--mount-none` (or `--mount-only`) to `limactl create`/`clone`.
- **Lima can report a failed start for a VM that is running but degraded.** Starting tolerates it.
- **`limactl list --json` fills in the config:** mounts get `mountPoint`, port forwards a `guestIP` (`127.0.0.1`) and host side; compare only what devvm set. `--set` applies after `--mount-none`. `limactl create` downloads the image at once (no dry run).
- **`limactl shell` quotes each argument for the guest's shell**, so `Exec` passes `sh -c` and one `shell.QuoteJoin` string. QEMU's guestfwd command goes through `/bin/sh -c` too, commas doubled.
- **The ssh socket path limit (104 characters)** bounds VM names (`NameMax`).
- **The ssh socket path limit (103 characters at most: macOS's 104 include the NUL)** bounds VM names (`NameMax`).
- **Linux hosts (QEMU):** mounts are 9p, and a 9p share mounts once per guest. Debian's tmpfs `/tmp` hides anything mounted below it during boot. Project VMs' qcow2 disks are overlays of their image's, so never start an image VM or write its disk after it's built.
- **Shared tools:** mise rewrites `latest`/`24`/`lts` links in a tool's folder after any install, so those folders are local in the VM; only version folders are mounted.
- **Lima can report a failed start for a VM that is running but degraded;** starting tolerates it.
- **Linux's `pgrep -f` matches the shell running it** (procps), so e2e's patterns are written `[_]proxy`. mise skips minisign on linux/arm64 (no build).
- **Lima writes `lima.REJECTED.yaml` into the current folder** on an invalid config: run `limactl` outside the repo (devvm runs it from its data folder).
## Commits and tasks
- Tasks are in dex (`.dex/`, git-ignored).
- **One commit when each task is complete**, its Docs and Review subtasks included. Conventional Commits: `type(scope): summary`, types `feat`, `fix`, `docs`, `test`, `refactor`, `build`, `ci`, `chore`. Then `dex complete <id> --commit <sha>`.
- **Don't commit or `dex complete` until the gate passes**, with whatever `mise run fmt` changed in the commit.
- **Dex task IDs never go in commit messages, code comments or docs.**
- **AGENTS.md stays short:** one line per path or rule. Inventories (functions, messages, test names) go in the commit message and the `dex complete` result, not here.
- **One commit when each task is complete**, its docs and review included. Conventional Commits: `type(scope): summary`, types `feat`, `fix`, `docs`, `test`, `refactor`, `build`, `ci`, `chore`.
- **Don't commit until the gate passes**, with whatever `mise run fmt` changed in the commit.
- **Task IDs from any tracker never go in commit messages, code comments or docs.**
- **AGENTS.md stays short:** one line per path or rule. Inventories (functions, messages, test names) go in the commit message, not here.
+177
View File
@@ -1,5 +1,178 @@
# Changelog
What's changed on `main` since the latest release is in [Unreleased](#unreleased), at the bottom of this page.
## 0.2.0-rc.1
A release candidate for 0.2.0, adding to 0.1.1-rc.3. 0.2.0 takes 0.1.1's place, because its breaking changes need a new minor version. Install it with `devvm upgrade --to 0.2.0-rc.1`, the install script's `--version 0.2.0-rc.1`, or `brew install devvmhq/tap/devvm-rc`. Homebrew's `devvm` stays on 0.1.0.
### Breaking
- **At most 17 VMs run at once:** each VM's ssh is now on one of the 17 ports from 1024 up that every browser refuses, so no page in your browser reaches a server in a VM through it. Root in a VM could make its ssh port answer as a web server, which got the cookies of the apps you use on `localhost`, even in a VM that forwards no ports. A start past 17 fails and names the VMs that run on those ports ([too many VMs at once](https://next.devvm.dev/docs/using/troubleshooting/#too-many-vms-at-once)).
- **A VM that forwards every port leaves out those 17:** a server in the VM on one of them, such as an X server on 6000, reaches this machine only when you list the port with `devvm ports`, so a VM can't take the ports other VMs' ssh needs. `devvm ports` and each launch warn when a VM's list names one of them ([ports](https://next.devvm.dev/docs/using/ports-size/#ports)).
- **A short host name no longer reaches a host through the proxy:** a tool in a VM that used a name such as `jenkins` for a host on your company's network now needs its full name, such as `jenkins.corp.example.com`, as the proxy no longer adds this machine's DNS search domain ([a name that doesn't resolve](https://next.devvm.dev/docs/using/troubleshooting/#a-name-that-doesnt-resolve)).
- **The agent store keeps only what a seed has of Claude Code's plugins:** if you imported Claude Code's settings with devvm 0.1.0, which copied your whole `~/.claude/plugins`, the first start of any VM takes your plugins' data, and the store's other entries of that folder that are this machine's own, such as `installed_plugins.json`, out of devvm's agent store, where every VM with Claude Code could read them, and warns once, naming them. Your own `~/.claude/plugins` is left as it is. A store whose plugins folder is a link, or below one, which only a store you made yourself has, now stops every VM with Claude Code from starting until it's a folder of its own, as a VM's mount would follow the link ([Claude Code's plugins](https://next.devvm.dev/docs/using/coding-agents/#claude-codes-plugins)).
- **`devvm agent import` and `devvm agent save` refuse a linked store:** when a folder on the way to what they write in devvm's agent store is a link, from `~/.config/devvm/agents` down, such as `~/.config/devvm/agents/claude` linked into a dotfiles repo, they now fail and name the link before they change anything. Before, they wrote through the link and took out whatever the folder it led to held that they didn't write, which for a link to your home folder deleted your files. Make that folder one of its own, then run the command again ([devvm's agent store](https://next.devvm.dev/docs/using/coding-agents/#devvms-agent-store)).
### After you upgrade
- A VM's proxy that runs as you upgrade keeps running as one process, without a sandbox, until the VM's next launch, which starts its two processes, as it starts a proxy again for every new devvm. Until then, `devvm doctor` names each VM whose proxy an older devvm started ([the proxy runs without a sandbox](https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox)).
- Each existing VM's ssh moves to one of the 17 ports that browsers refuse at the VM's next start, in the one change devvm makes to its Lima config, which gives the VM new ssh host keys, as any change to its Lima config does. A VM that runs as you upgrade keeps its old port until then, and devvm warns of it at each launch, so stop it with `devvm stop` in its folder, and its next start moves it ([too many VMs at once](https://next.devvm.dev/docs/using/troubleshooting/#too-many-vms-at-once)).
- A VM whose copy of an agent's settings file had `devvm-redacted` under a name you chose, such as a plugin's marketplace, gets the whole copy at its next launch, over its own. Until then, `devvm agent save` leaves that file out and warns, so make any change to it in devvm's agent store, or launch the VM again and make the change there.
- A VM that runs as you upgrade, with Claude Code's plugins imported by devvm 0.1.0, loses the store's entries that are this machine's own from its mount at the first start of any VM, so Claude Code there may not find the store's plugins until that VM's next launch. On a Linux host, it can keep seeing what it had read of them until its next start. If a plugin's data held a login of the plugin's own, every VM with Claude Code could read it, so sign in to that plugin again where you don't trust those VMs. Each VM gets its own `~/.claude/plugins` at its next launch, with no restart, in place of its link to the store's folder, and Claude Code started in a shell that was open before that launch finds none of the store's plugins, so start it in a new shell ([Claude Code's plugins](https://next.devvm.dev/docs/using/coding-agents/#claude-codes-plugins)).
- Each VM records its project folder's volume at its first launch that finds the folder. Until then, and for a VM whose folder was already gone before the upgrade, which never records one, a folder that moves while a restart gives its disk another device number still needs `devvm adopt VM`, and after a restart such a gone folder can still be called not connected ([a moved or renamed folder](https://next.devvm.dev/docs/using/vms/#a-moved-or-renamed-folder)).
- A VM that forwards an SSH agent and runs as you upgrade keeps the agent as it was, so it can still remove, lock or add keys, until its next start, and devvm warns of it each time it opens the VM or changes its links. Run `devvm restart` in its folder to give it the relay at once ([agent forwarding](https://next.devvm.dev/docs/using/ssh/#agent-forwarding)).
- Run `devvm update` in each existing VM's folder. The new mise and Docker change what goes into the images, so until you do, a VM made from an older image says it's outdated, and every existing VM says there are newer shared tools at the same versions. The first update or new VM builds base and each of its shared tools again, one at a time, which takes several minutes.
### Changed
- **Each VM's proxy runs as two processes:** `devvm _proxy` alone reads your Keychain, your agents' login files and your other files, and `devvm _proxy-child` reads the VM's network and asks `devvm _proxy` for each name's lookup and each connection, for a login's token exchange, and for each value bound to the VM as a request needs it. So the code that reads every byte a VM sends holds, besides the VM's own proxy password and CAs and your company proxy's password, only the values that the VM's own bindings name, each kept for a few minutes after it was last asked for. A new login's tokens, its refresh token among them, never reach the process that reads the VM's requests, and an error reply from an agent's token endpoint reaches the VM as it is up to 1 MiB, and gets `502` past that. A build's proxy writes its logs to a `logs/` folder of their own in its folder ([a VM's proxy](https://next.devvm.dev/docs/internals/processes/#a-vms-proxy)).
- **On macOS, the proxy's child runs in a macOS sandbox:** `devvm _proxy-child` starts under `sandbox-exec`, with a profile that lets it write only its VM's logs and the shared Nix cache and look at your policy files, so a bug that a VM drove there couldn't read your files, reach the Keychain or connect to this machine's unix sockets, such as ssh's and Docker's. If `sandbox-exec` is missing or fails to start it, the child runs without the sandbox, so the VM keeps its network, and `devvm doctor` warns for each VM whose proxy runs that way ([the proxy runs without a sandbox](https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox)).
- **On Linux, the proxy's child confines itself:** before it reads a byte of the VM's, `devvm _proxy-child` confines itself with Landlock and a seccomp filter, so a bug that a VM drove there could write and read only its VM's logs and the shared Nix cache, couldn't change any other file's mode, owner, attributes or times, run a program, or connect to a unix socket, such as an ssh master's, Docker's or your SSH agent's. It could still learn whether a file of yours exists, its size and when it changed. A kernel without Landlock or seccomp filters, or whose Landlock is older than ABI 6 or lacks its fix for signals between threads, confines the child only in part, and the VM keeps its network, and `devvm doctor` warns for each VM whose proxy runs that way, naming what the kernel lacks ([the proxy runs without a sandbox](https://next.devvm.dev/docs/using/troubleshooting/#the-proxy-runs-without-a-sandbox)).
- **The proxy's child connects only through `devvm _proxy`:** wherever its sandbox runs, on macOS and on Linux, it refuses the child every connection of its own, so `devvm _proxy` looks up each name for it and opens each connection, once its own read of your rules and this machine's addresses allows the address. So a bug that a VM drove in the child can't reach this machine's services on `localhost`, such as your dev servers, Docker's published ports and other VMs' proxies, nor this machine's own addresses or your LAN's private addresses, unless a rule names the address, just as the VM can't. A rule such as `devvm network allow 127.0.0.1:5432` still applies from the next connection, and a company proxy on `localhost` still works, though the child reaches whatever that company proxy reaches, as the VM does. Because `devvm _proxy` looks up its names, the child reads no file below `/etc` on Linux and doesn't talk to mDNSResponder on macOS ([the child's sandbox](https://next.devvm.dev/docs/internals/network/#the-childs-sandbox)).
- **`devvm doctor` checks every VM's state:** it reads each VM's `vm.json` and each of its sections as every command on a VM does, and warns of each VM whose state devvm can't read, naming the VM and why, the file included, once, even when it can't read the VM's folder, without changing anything. Such a VM no longer hides doctor's warnings about the other VMs' policy files, nor what `devvm network` warns of every VM ([a file devvm can't read](https://next.devvm.dev/docs/using/troubleshooting/#a-file-devvm-cant-read)).
- **A marketplace's credential gets a warning:** when `devvm agent import` or `devvm agent save` copies a Claude Code marketplace that has a password or an access token in its clone's git config or its source in `known_marketplaces.json`, which every VM with Claude Code can read, it warns and names the marketplace, the store's file and the keys, and copies it as before ([mounts](https://next.devvm.dev/docs/using/coding-agents/#mounts)).
- **`devvm agent import` copies at most 20,000 files, folders and links, 128 MiB, and 16 MiB in one file, of each agent's folder:** an agent's folder that holds more, such as one a VM's project inside it filled, fails the import before the store changes, naming the folder, so take out what it doesn't need and import again. An import that fails, while it reads, such as at a file that changed meanwhile, or while it puts the settings and logins in place, such as at a login it can't save, leaves the store as it was, and in the rare case that putting it back fails too, it names what it kept. The import also warns of each VM whose project folder is inside an agent's folder, such as a skill you work on in `~/.claude/skills`, or holds one, such as `~/.pi`, because that VM can change the settings the import copies for every VM, and of each VM whose state it can't read, as it can't tell where that VM's project folder is. It leaves out an agent's folder that a link in a VM's project folder leads elsewhere, and while a VM's state can't be read, it leaves out every link out of an agent's folder, and an agent's folder or login whose path leads through a link, one on the way to your home folder included unless only root can change it, naming the state, so run `devvm doctor` and import again ([importing from this machine](https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine)).
- **A launch warns of a project in an agent's folder:** when a VM's project folder is inside a coding agent's folder on this machine, such as `~/.claude/skills/mine`, or holds one, such as `~/.pi`, each launch of the VM warns in one line, because code in the VM can change that agent's settings on this machine ([project folders devvm refuses](https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses)).
- **Cursor's CLI in a VM can change less of your Cursor account:** its proxy refuses more of the methods that change your account, your team or your cloud agents, such as merging a cloud agent's pull request, forking or pinning a cloud agent, or writing to its machine, while every call the CLI itself makes passes. Do those from Cursor on your machine ([Cursor CLI login](https://next.devvm.dev/docs/using/coding-agents/#cursor-cli-login)).
- **Pins:** mise is 2026.11.10, in base and on this machine, the docker layer's Docker is 29.10.0 and its compose 5.8.0, and Cursor's CLI is 2026.11.17-f532c45. The new mise and Docker change what goes into the images, so base, every image built on it and every shared tool that mise installs are built again once.
- **Slow steps show a status line:** in a terminal, devvm now shows what it's waiting for while it finds the folder's VM, checks it before a start, checks its network and reads its host keys, sets it up, runs a `devcontainer.json`'s commands, looks up a folder's disk, checks Lima, deletes a VM or an image, applies the retention settings and installs an upgrade, and while `devvm ls` reads the VMs, `devvm doctor` checks this machine, `devvm agent import` reads your agents' folders and copies them into the store, and `devvm agent save` reads and compares the VM's settings. `devvm clone add`, `clone fetch`, `clone on` and `clone off`, `devvm git-protect`, `devvm stop`, a `--clone` VM's check before `devvm rm`, a history export or import, and `devvm ports` as it starts a running VM's port forwarder again show one too, and so do `devvm link` as it asks about the VMs its links lead to, `link add`, `link rm`, `link publish` and `link unpublish`, `devvm group join` and `group leave`, and `devvm rm` of a VM that others link to, as they give each running VM its changed links and check the VMs that links lead to, `devvm network learn` and `network lock` as they give a running VM's proxy its new tier, and every stop of a VM, as for `devvm restart` or a restart you agree to after changing a setting. While devvm waits for another devvm that's changing the same thing, such as a VM's state, its folders' layout, a group, an image's build or the shared tools, a status line says so, only while it waits, where before some of those waits showed nothing and others printed a line after a few seconds that stayed. Like every status line, it shows only in a terminal without `-v`, so a run with `-v`, or with its output piped, no longer prints that line ([a command fails](https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails)).
### Fixed
- **A project folder devvm can't read says so:** when you, or code in a VM that mounts it, took away your read permission on a project folder, devvm said its VM was made for an earlier folder that was deleted or replaced, and offered `devvm rm` and `devvm adopt`. It now names the folder and why it can't be read, so make it readable again ([a folder made again](https://next.devvm.dev/docs/using/vms/#a-folder-made-again)).
- **A warning no longer lands on the status line:** a warning that devvm printed during a slow step was written onto the status line's own line, and the status line's next redraw could erase a question's prompt and what you typed. A message now prints above the status line, which comes back below it, and a question, the picker and an agent's login in the VM take the status line away until they're done ([a command fails](https://next.devvm.dev/docs/using/troubleshooting/#a-command-fails)).
- **`devvm agent login claude --setup-token` shows Claude Code's address (#57):** the login in the VM got no terminal of its own, so `claude setup-token`, which draws full-screen, showed nothing and waited. When devvm runs in a terminal, an agent's login in the VM now gets one too, as devvm's shell does, so Claude Code shows the address to open and the prompt for its code. Without a terminal, `--setup-token` warns that the login may show nothing. On a terminal, Ctrl-C now goes to the agent's login in the VM, which ends, and devvm then says that the login ended or saved nothing, and devvm puts the terminal back as it was before the login, even when a signal ends devvm itself ([Claude Code login](https://next.devvm.dev/docs/using/coding-agents/#claude-code-login)).
- **The VM's shell gets your terminal's 24-bit color (#54):** devvm's shell in a VM, an agent's login with `devvm agent login` and `ssh` to a VM by name never got your terminal's `COLORTERM`, so programs in the VM, such as coding agents, fell back to fewer colors. devvm's shell and an agent's login now get it when it's `truecolor` or `24bit`, and no other value ([opening a VM](https://next.devvm.dev/docs/using/vms/#opening-a-vm)). The ssh config's entries now send it as your terminal has it, from the next time devvm launches or stops a VM, which writes them again, and a VM made with `--from` gets it only when its image's sshd accepts it ([ssh access by name](https://next.devvm.dev/docs/using/ssh/#ssh-access-by-name)).
- **MCP servers' logins in a VM finish and stay (#62):** with your subscription's login, each launch and each `devvm agent login claude` wrote devvm's copy of the login over the VM's `~/.claude/.credentials.json`, where Claude Code also keeps its logins to MCP servers. So a login to an MCP server that you started with `/mcp` in a VM failed when devvm set the VM up again before it finished, such as when you ran devvm in its folder from another terminal, and one that finished was gone at the VM's next launch. devvm now replaces only the Claude login in that file and keeps the rest, so the MCP servers' logins you make in a VM stay in that VM, and they never reach this machine or another VM. With a Claude Code token, the VM's file stays as it is ([MCP servers' logins](https://next.devvm.dev/docs/using/coding-agents/#mcp-servers-logins)).
- **Your claude.ai connectors work in a VM (#61):** with your subscription's login, Claude Code in a VM couldn't use the connectors you added in claude.ai, because the VM's proxy put the login only into requests to `api.anthropic.com`, so those to `mcp-proxy.anthropic.com`, which carries the connectors' traffic, held the login's placeholder and were refused. From each VM's next launch, the proxy puts the login into those too, below `/v1/mcp/`, so a VM with Claude Code can use every connector you added, as Claude Code on this machine can, and code in the VM can read and act through them. Disconnect the ones you don't want VMs to use, or deny `mcp-proxy.anthropic.com` with `devvm network deny` ([your claude.ai connectors](https://next.devvm.dev/docs/safety/attack-vectors/#the-network)). A Claude Code token, from `claude setup-token` or in devvm's environment, still goes only to `api.anthropic.com` ([Claude Code login](https://next.devvm.dev/docs/using/coding-agents/#claude-code-login)).
- **A `NO_PROXY` address with a zone no longer goes direct (#59):** an IPv6 address with a zone in your company proxy's `NO_PROXY`, such as `fe80::1%eth0`, sent that address without its zone past the company proxy. Such an entry now matches nothing, as it does in Go's HTTP clients ([behind a company proxy](https://next.devvm.dev/docs/safety/network/#behind-a-company-proxy)).
- **Claude Code's plugins work in a VM (#56):** a VM's `~/.claude/plugins` was devvm's agent store's folder, mounted read-only, so everything Claude Code writes there failed, such as a plugin's data in `${CLAUDE_PLUGIN_DATA}`, installing a plugin and updating a marketplace. Each VM's `~/.claude/plugins` is now its own folder, and the store's plugins are Claude Code's read-only seed at `~/.claude/plugins-seed`, so the store's plugins load as before, a plugin keeps its data in the VM, and a plugin you install in a VM stays in that VM until `devvm agent save` copies it into the store. The save adds plugins to the store and never takes one out, and an export of a VM's history leaves its plugins folder out. A store that devvm 0.1.0's import filled keeps only what a seed has, as Breaking above says ([Claude Code's plugins](https://next.devvm.dev/docs/using/coding-agents/#claude-codes-plugins)).
- **devvm's own folders are refused in any case on a Mac:** devvm compared a project folder with your home folder and its own folders by name alone, so on a Mac, where a name's case doesn't count, a project at `~/.Config/devvm/layers` got a VM with read-write access to devvm's settings and layer scripts. devvm now compares the folders themselves too, and refuses such a folder as it refuses `~/.config/devvm/layers`. A VM already made in such a folder still mounts it, so delete it with `devvm rm` there. An SSH key in a folder that a VM mounts by a name in another case is refused in the same way ([project folders devvm refuses](https://next.devvm.dev/docs/using/settings/#project-folders-devvm-refuses)).
- **A folder that moved across a restart keeps its VM:** a folder that moved while a restart gave its disk another device number wasn't recognised, so devvm made it a second VM, and the gone folder of a VM whose disk was renumbered was called not connected. Each VM now records its folder's volume, which no renumbering changes: its volume UUID on macOS, and the file system's own ID on Linux's ext4, Btrfs and ZFS. So devvm offers a moved folder its VM by its volume, inode and birth time, and calls a VM's gone folder gone, once the VM has recorded its volume, as After you upgrade says ([a moved or renamed folder](https://next.devvm.dev/docs/using/vms/#a-moved-or-renamed-folder)). A folder at the VM's own path whose disk was renumbered, but on another volume than the one recorded, such as a copy of the disk with a volume ID of its own mounted there, is another folder, so devvm gives it the VM only after `devvm adopt` ([a folder made again](https://next.devvm.dev/docs/using/vms/#a-folder-made-again)). When devvm can't read the volume at the launch after a renumbering, such as when `diskutil` doesn't answer, the volume stays to check, and each launch looks it up until it can. On Linux, where reading the volume costs nothing, every launch checks it, so a Btrfs snapshot rolled back at the folder's path, or the folder after you give its volume a new UUID, needs `devvm adopt` too.
- **Two devvms no longer write the agent store at once:** `devvm agent import`, `devvm agent save` and a start that cleans Claude Code's plugins out of the store now take turns, so a second one waits, saying so, until the first is done, where before their files could mix or one could fail partway. A save that finds the store changed since it showed what differs saves nothing, rather than write over an import ([importing from this machine](https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine)).
- **A failed `devvm agent save` leaves the store as it was:** a save that failed partway, such as at a file it couldn't write in one agent's store or at the Claude Code login it saves last, left the agents it had saved before the failure saved and the rest not. It now saves all or nothing, as an import does, and in the rare case that putting the store back fails too, it names what it kept. A file in the VM where the store has a folder, or the other way round, fails the save before anything changes, naming the store's path. It also holds the lock on Claude Code's logins while it saves Claude Code's part of `~/.claude.json`, the lock a VM's proxy holds while it saves a Claude Code login made in that VM, so the two take turns, and Ctrl-C while it waits for either lock ends the wait ([saving a VM's settings](https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings)).
- **`devvm agent save` has an import's bounds on depth:** a VM that sends folders nested more than 128 deep, or a path of more than 4,096 bytes, now gets nothing saved, as an import of such folders does, where before a chain of thousands of folders could keep the save busy for a long time while it held the agent store's lock ([saving a VM's settings](https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings)).
- **Names that differ only in case no longer lose a file on a Mac:** when the VM, or your home folder for `devvm agent import`, had a file whose name differed from the store's only in case, such as `foo.md` where the store had `Foo.md`, `devvm agent save` and `devvm agent import` deleted the store's file and reported success, because macOS's volume reads both names as one file. They now treat the two as one file, as the volume does, so the store's file gets the new content and keeps its name, and the save's diff shows it as changed. Two names in the VM that differ only in case, such as `A.md` and `a.md`, would be one file in the store, so the save now saves nothing and names both, and so does an import of two such names from a home folder on a volume that tells case apart ([saving a VM's settings](https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings)).
- **A link inside an agent's folder copies only a setting:** `devvm agent import` copied a link inside an agent's folder as the file it led to wherever that file was in the folder, so a link in `~/.claude/skills` or `~/.claude/plugins/cache` could put your history, `~/.claude/.credentials.json` or a plugin's data into the store, where every VM with the agent reads it. Such a link is now copied only when it leads to one of the settings the import copies, and any other is left out with a warning that names where it leads ([importing from this machine](https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine)).
- **`devvm agent import` no longer copies your plugins' data into every VM:** it copied all of `~/.claude/plugins` into the store, so every VM with Claude Code got the data that your plugins keep on this machine, which can hold their own logins. It now copies only the marketplaces, their records and the plugins' cache, and `devvm agent save` copies only those from a VM ([importing from this machine](https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine)).
- **An export can't put what an import leaves out into a VM:** `devvm history import` left out the agents' logins and the files devvm's setup writes by their names as an export wrote them, so an export that spelled one another way, such as `.claude/./settings.json` or `.claude//plugins`, got it into the VM's home. The import now refuses a name with a `.` or empty part, and deletes what it leaves out by its path once it's unpacked ([importing history](https://next.devvm.dev/docs/internals/agents/#importing-history)).
- **A project folder's VM works after your Mac restarts (#60):** macOS numbers its disks' devices in the order they appear at boot, so after a restart an unchanged folder could be on a device with another number. devvm then took the folder for another one, so every command on its VM refused it as made for an earlier folder at its path, a stopped VM's start refused it as replaced, and the next check of `.git` called it replaced. A folder at the same path, with no link on it and with the same inode and birth time, is now the same folder on whichever device it's on, and its VM's next start records it on that device before it mounts it, in the one change devvm makes to its Lima config. A folder that moved after a restart, before its VM started again, isn't offered the VM, so `devvm adopt VM` moves it ([one VM per folder](https://next.devvm.dev/docs/internals/security/#one-vm-per-folder)).
- **Names you choose in an agent's settings are no longer taken for secrets (#55):** devvm took a plugin, a marketplace or an MCP server whose name had `key`, `token`, `secret` or `passw` in it, such as `tokeneconomizer` or `secret-scanner`, for a secret, and put `devvm-redacted` in place of all its settings in the VM's copy. Claude Code then refused the VM's `settings.json` whole, so every plugin was off in the VM. devvm now knows the agents' tables of names, such as Claude Code's `extraKnownMarketplaces` and `mcpServers` and Codex's `marketplaces` and `hooks.state`, and judges only the fields under a name, so a server named `secret-scanner` keeps its command and still loses its `env` and its `apiKey`. Thanks to @jspiro for the report and @dhruv1220 for the tests' idea in #58 ([keys in settings files](https://next.devvm.dev/docs/internals/network/#keys-in-settings-files)).
- **A folder whose name has separators in a row gets a VM (#52):** a folder named `x--y`, `foo (copy)` or `C++ stuff` failed to get one, because devvm turned each character other than a letter or digit into its own dash, and Lima refuses a name with dashes in a row. Each run of them now becomes one dash, so `foo (copy)` gets `devvm-foo-copy-<hash>`, and the state such a folder's failed VM left is replaced when you run devvm there again. Thanks to @se6a for the report ([VM names](https://next.devvm.dev/docs/internals/backends/#vm-names)).
- **Lima's console logs no longer keep a VM's proxy password:** Lima's boot scripts write the VM's proxy settings, with the VM's own proxy password, to the VM's serial console, and Lima keeps that console in `serial.log`, `serialp.log` or `serialv.log` in the VM's folder in devvm's Lima home. devvm took the passwords out of Lima's `ha.stderr.log` only, so those logs kept the VM's password. devvm now replaces each password in them with as many `*` once the VM has started, as it does in `ha.stderr.log` ([the run log](https://next.devvm.dev/docs/internals/overview/#the-run-log)).
- **A short name no longer reaches a denied host under your search domain:** the proxy looked names up with this machine's DNS search domain, which macOS takes from the network's settings and Linux from `/etc/resolv.conf`. So with `api.corp.example.com` denied and `**` allowing the rest, a VM could reach that host as `api`, or `api.eu.corp.example.com` as `api.eu`, when either had a public address, because no rule judged the name the search domain made. The proxy now looks each name up as it's written, so a short name such as `jenkins` no longer reaches a host through the proxy, and a tool in the VM reaches a host on your network by its full name, such as `jenkins.corp.example.com`. When a name without a dot doesn't resolve, the block says to use its full name, and a block because a name doesn't resolve no longer suggests a `devvm network allow` command, which the name's rule already gives ([a name that doesn't resolve](https://next.devvm.dev/docs/using/troubleshooting/#a-name-that-doesnt-resolve)).
- **A VM can no longer take an SSH agent away from you or other VMs:** a VM that forwarded your agent or devvm's own could remove every key from it with `ssh-add -D`, lock it with a password of its own with `ssh-add -x`, or add keys to it, because `ssh-agent` answers every request a forwarded connection sends. Every VM that shares devvm's agent lost it then, and with your own agent, so did you. A VM now reaches its agent only through its proxy, which passes on listing keys, signing and binding a session to a host, and refuses everything else, so `ssh-add` in a VM can still list and use the keys, but not remove, lock or add them. The ssh entries for editors name the same socket, so an editor's connection gets the same agent as devvm's shell, the one the VM started with, and the entry of a VM started outside devvm, such as with `devvm limactl start`, forwards no agent. A VM that's running when you upgrade keeps the old behaviour until its next start, so restart it with `devvm restart` ([the SSH agents](https://next.devvm.dev/docs/internals/processes/#the-ssh-agents)).
- **A VM's host keys are pinned whatever its ports:** when other programs on this machine, such as your own dev servers, held every port a VM lists, or the VM forwarded none with `devvm ports none`, a start that went no further than starting the VM, such as `devvm clone fetch` on a stopped `--clone` VM, didn't pin the VM's ssh host keys. devvm's own ssh to the VM then failed until something else pinned them, so `devvm clone fetch` and `devvm rm`'s fetch failed with `clone_fetch_failed`. devvm now pins the keys each time it starts a VM, whatever the VM forwards, and a command that finds the VM running without them pins them first ([ssh into VMs](https://next.devvm.dev/docs/internals/security/#ssh-into-vms)).
- **A removed link's connections end with it:** `devvm link rm` used to stop a link's new connections but leave its open ones running. A target that never closed its end kept each of those connections' ssh processes on this machine, and one of the 256 connections a client's links carry at once, until the client or the target stopped. Removing a link now ends its open connections within a few seconds, and when a target starts again, the connections still open through its earlier start end too ([removing a link](https://next.devvm.dev/docs/using/links/#removing-a-link)).
- **An agent's settings file that's one string no longer crashes `devvm agent save`:** when an agent's settings file in the VM was a single JSON string holding a placeholder, `devvm agent save` crashed. It now puts the saved value back in it. A login file on this machine that holds only `null` is now refused as not a JSON object, where saving a Codex or opencode login made in a VM failed on it ([saving a VM's settings](https://next.devvm.dev/docs/using/coding-agents/#saving-a-vms-settings)).
- **A closed connection's ssh process ends:** when a VM never closed its end of a forwarded port's or a link's connection, that connection's ssh process stayed on this machine after the program here, or in the client, had closed its side. So a hostile VM could take all 256 connections that a forwarder or a client's links carry at once. Such an ssh process now ends once its client has closed and the VM has sent nothing for 30 seconds. A program that closes its side for writing and then waits for an answer, as `nc -N` does, keeps its connection only while the VM sends something at least every 30 seconds, the first byte included, so a slow query that takes longer than that to start answering is cut ([how it reaches the VM](https://next.devvm.dev/docs/internals/ports/#how-it-reaches-the-vm)).
- **A forwarded port answers on `::1` too:** when this machine briefly couldn't listen on a port's IPv6 address, such as when it ran out of open files, the forwarder forwarded the port on `127.0.0.1` alone until the server in the VM restarted. A client that connects only over IPv6, such as `http://[::1]:PORT` or a tool that doesn't fall back to `127.0.0.1`, then didn't reach the VM, and another program on this machine could take `::1` on that port and get those connections instead. The forwarder now tries the port again at the VM's next report and forwards it on both addresses. A machine that denies the forwarder `::1` alone, such as through a security module, still gets its ports on `127.0.0.1`, and the forwarder's log says so ([when it can't forward](https://next.devvm.dev/docs/internals/ports/#when-it-cant-forward)).
- **Every host is read as the proxy reads it:** a few of devvm's checks read a host in a way of their own. A name with a letter that isn't plain ASCII, such as the Kelvin sign, which Unicode's case folding turns into `k`, was taken as the ASCII name it folds into by `devvm secret set --host`, an MCP server's URL and a `NO_PROXY` entry, and `--from` took a registry's host with such a letter, or an address in brackets before a trailing dot such as `[::1].`, as one on the internet. The proxy refuses such a host, so now `devvm secret set` refuses it, an MCP server with one gets no secret, a `NO_PROXY` entry with one matches no host, `--from` doesn't take such a registry as public, and `devvm network rm` with it never removes the rule with the plain letter. The proxy also answers `400` to a host with brackets around anything but an IPv6 address, such as `[evil.com]:443`. A partial clone's warnings also read a remote's host without its trailing dot, so they name `example.com` rather than `example.com.`, and a remote at `localhost.` gets the same warning as one at `localhost` ([how the proxy reads a host](https://next.devvm.dev/docs/internals/network/#the-proxy)).
- **A VM can't fill a Linux host with processes:** on a Linux host, each connection that a VM confined to its proxy made to the proxy started a devvm process on this machine, with no limit, so a VM that opened connections without end could start thousands of them. devvm now carries at most 256 of a VM's connections to its proxy at once, and answers any past that with `503` before it reaches the proxy. A VM that's running when you upgrade has no limit until its next start ([the QEMU wrapper](https://next.devvm.dev/docs/internals/processes/#the-qemu-wrapper-and-its-keeper)).
- **A forwarded port answers after a burst:** when the port forwarder ran out of open files while accepting a connection, it stopped accepting connections on that port while it still listened there, so the port took connections that nothing answered until the server in the VM restarted. It now tries again shortly after, and so do a link's socket and a browser login's forward, which also carries at most 16 connections at once ([how it reaches the VM](https://next.devvm.dev/docs/internals/ports/#how-it-reaches-the-vm)).
- **A VM's proxy lets go of what a VM leaves:** a VM's proxy counted only its tunnels toward its limit, kept idle connections open without end, kept a plain HTTP request running after its client had gone, and took 1 MiB of a request's headers inside an intercepted tunnel. It now holds at most 2048 of the VM's connections of every kind at once, where one without the VM's password doesn't count, has at most 2048 requests to hosts under way at once, closes a connection that waits 10 minutes for its next request, or that lacked the VM's password, ends a plain HTTP request a minute after its client has stopped sending and nothing has come back, takes at most 64 KiB of headers everywhere, and carries at most 100 HTTP/2 requests at once in a tunnel. A plain `ws://` WebSocket through the proxy, which got `502`, now connects. Long downloads, WebSockets and slow streams go on as long as they last ([the proxy](https://next.devvm.dev/docs/internals/network/#the-proxy)).
- **A `NO_PROXY` entry with port 0 matches nothing:** the proxy read an entry such as `git.test:0` as `git.test` on every port, so it sent those hosts directly rather than through your company proxy, and it read `git.test:080` or `git.test:+80` as port 80, which Go's clients don't. An entry whose port no request has, or whose port isn't in plain decimal, now matches no host, as one past 65535 already didn't ([through a company proxy](https://next.devvm.dev/docs/internals/network/#through-a-company-proxy)).
- **No false lost pin on Linux hosts:** when git on this machine replaced `.git/config` just as devvm pinned it again, the pin could fail, and devvm warned that the file lost its pin and couldn't be pinned again, then that it was pinned again, at the VM's next check. A VM's start could fail the same way. devvm now pins the file the rename left, and warns only that it was pinned again ([how a Linux host locks .git](https://next.devvm.dev/docs/internals/git-protection/#on-linux-hosts)).
- **A stopped forwarder or link session takes its ssh with it:** devvm stopping a VM's port forwarder or link session, or a `kill` of either, could leave its ssh connection to the VM running on this machine, with its control socket in devvm's run folder. Each signal devvm sends now reaches what the process started too, either one stops its ssh before it exits, and `devvm gc --orphans` also deletes a forwarder's socket that nothing listens on ([how devvm starts them](https://next.devvm.dev/docs/internals/processes/#how-devvm-starts-them)).
- **A name fails at once with transparent mode off:** in a VM confined to its proxy, with transparent mode off or stopped, a lookup through the system's resolver, such as `getent`'s or curl's, could wait out its timeout rather than fail at once, seen on a Linux host, because systemd-resolved's stub kept retrying a name server where nothing listened. The VM's programs now ask that name server, its own `127.0.0.1`, directly, from each VM's next launch, so workerd under `wrangler dev`, which waited about 40 seconds for each lookup on a Linux host, fails at once too, and a VM on the open tier keeps systemd-resolved's stub ([the VM's resolver](https://next.devvm.dev/docs/internals/network/#the-vms-resolver)).
- **A Nix package is downloaded once:** when two requests for a package that wasn't in the shared Nix cache yet came close together, the second could download it again after the first had kept it, and the cache counted it twice against its cap. It now looks in the cache again before it downloads ([the shared Nix cache](https://next.devvm.dev/docs/internals/network/#the-shared-nix-cache)).
- **A refused launch leaves a running VM running:** when `config.toml`'s proxy named a user and no `proxy` secret was saved, `devvm` in the folder of a running VM refused, as it should, but also stopped the VM, and `devvm restart` stopped it before it refused. The same happened when your CAs folder couldn't be used, or the VM's CA or secret files couldn't be readied. On a launch or a `devvm network` change, devvm now checks the company proxy, your CAs, the VM's CA and its secret files before it stops the VM's proxy, and says it left the VM and its proxy running as they were. `devvm restart` checks the company proxy and your CAs before it stops the VM. A `devvm network` change between `internet`, `allowlist` and `none` on a running VM is refused before the VM's tier changes, so its tier never says one thing while its proxy enforces another. A VM whose proxy doesn't enforce the tier the VM has now, or whose proxy is stopped for new settings and then can't start again, is still stopped, because a VM never runs on without its proxy. A `devvm network` change now stops it in that case too, where it left the VM running without its proxy ([the proxy](https://next.devvm.dev/docs/internals/network/#the-proxy)).
- **A VM's logs are held to their caps:** root in a VM could write to its serial console, `/dev/hvc0`, without end, and Lima's console log for the VM grew until this machine's disk was full, and so could Lima's own logs for the VM until its next start. While a VM runs, its proxy now keeps the disk space each of those logs takes under 10 MiB, on a file system with holes such as APFS or ext4, moving its end to the same name with `.1` added, of up to 10 MiB more, with any password in it replaced. It also replaces the VM's proxy password as the logs grow, so a reboot inside the VM, which on Linux hosts writes it to the console's log again, can't leave it there. A VM that's running when you upgrade gets this once a devvm command starts its proxy again. The port forwarder's and the link session's logs now stay under 1 MiB while they run, not only from their next start, a link's warnings take turns with the session's other lines, the build proxy's log stays under 10 MiB as a VM's proxy's does, a run writes at most 128 MiB to its run log, and the run logs take at most 256 MiB together, though devvm never deletes the newest or one that a running devvm still writes ([Lima's hostagent](https://next.devvm.dev/docs/internals/processes/#limas-hostagent)).
- **devvm desktop goes on after a burst:** when `devvm desktop`'s relay ran out of open files while accepting a viewer, `devvm desktop` ended with an error, and the desktop's port with it. It now tries again shortly, as the port forwarder does ([the desktop relay](https://next.devvm.dev/docs/internals/processes/#the-desktop-relay)).
- **A VM's size that isn't a number is refused:** when a VM's state file held a size devvm couldn't read as a number, such as `"cpus": "four"` after an edit by hand, the VM started with the image's size without a word. devvm now refuses to start the VM or show its size, names the value, and says to set it again with `devvm size`. `--cpus`, `--memory`, `--disk`, `config.toml` and `devvm size -g` also refuse a number too big for devvm to read, which for a disk reached Lima as infinity ([size](https://next.devvm.dev/docs/using/ports-size/#size)).
## 0.1.1-rc.3
A release candidate for 0.1.1, adding to 0.1.1-rc.2. Install it with `devvm upgrade --to 0.1.1-rc.3`, the install script's `--version 0.1.1-rc.3`, or `brew install devvmhq/tap/devvm-rc`. Homebrew's `devvm` stays on 0.1.0.
### Breaking
- **Your layers run after devvm's prelude:** devvm puts one line of its own in place of your layer's `#!` line, which gives the layer `$devvm_arch`, `$devvm_libc` and `devvm_sha`. A layer that sets its own `devvm_arch` or another `devvm_` name keeps its own. In a layer without a `#!` line, the line numbers in bash's errors are one more than the file's ([your own layers](https://next.devvm.dev/docs/using/customizing/#your-own-layers)).
### After you upgrade
- Base, every image built on it and every shared tool image are built again once, because base now has `git-lfs` and each build script starts with devvm's prelude on one line, which keeps the line numbers in a build's errors the script's own.
- Run `devvm update` in each existing VM's folder. Until you do, a VM made from an older image says it's outdated, and every existing VM says there are newer shared tools at the same versions. The first update or new VM builds each of its shared tools again, one at a time, which takes several minutes.
- An existing `--clone` VM gets `git-lfs` only once it's made again, with `devvm clone off`, then `devvm update`, then `devvm clone on`. Until then, its Git LFS files stay pointers.
### New
- **Cursor (#44, thanks to @barnesoir):** `--agents cursor` gives a VM Cursor's CLI, as `cursor-agent` or `agent`, and `devvm agent login cursor` logs it in from a browser on any machine, with the login kept on this machine ([Cursor CLI login](https://next.devvm.dev/docs/using/coding-agents/#cursor-cli-login)). `devvm cursor` opens the folder's VM in the Cursor editor, as `devvm code` does in VS Code. Recent Cursor runs its Agent in the VM with your Cursor sign-in in memory, so `devvm cursor` warns unless your Cursor settings send Agent's requests through the app on this machine, and you should open only VMs you trust with it ([Cursor's Agent](https://next.devvm.dev/docs/using/ssh/#cursors-agent)).
- **`devvm paste` (#38, thanks to @DustyPolk):** sends the image, PDF or file you copied on this machine into the running VM and puts its path in the VM on your clipboard, so you can paste it into a coding agent. A copied file goes only after you say yes, and `devvm paste rm` deletes what it sent ([pasting images](https://next.devvm.dev/docs/using/coding-agents/#pasting-images)).
- **`devvm agent import` can follow your dotfiles' links:** a link out of an agent's folder, such as `~/.claude/skills/x` into a dotfiles repo, is copied when you say yes in a terminal, when you pass `--follow-links`, or when it leads into a folder that `config.toml`'s `follow-links` names, such as `["~/dotfiles"]`. The store gets copies, never links, and devvm never follows a link to your home folder, its own folders, places that hold secrets, such as `~/.ssh`, or an agent's logins or history ([links out of an agent's folder](https://next.devvm.dev/docs/using/coding-agents/#links-out-of-an-agents-folder)).
- **`--clone` copies your repo as it is here:** the VM's clone gets every branch, tag and remote-tracking branch, a detached HEAD, what you've staged and what you haven't, a rebase, merge or other operation in progress, and your stash. It also gets your remotes without credentials, the repo's hooks and its own settings, your initialised submodules, each with a clone of its own, and the Git LFS objects your checked-out files point to, as every VM now has `git-lfs`. A partial clone is copied with the objects it has, and the VM's git fetches the rest from its remote. Untracked and ignored files, such as `.env`, and credential helpers stay on this machine, and devvm names anything it leaves out that you'd expect in the VM. Because `origin` is real in the VM, code there that may use your GitHub token can push to it, which a network rule can stop ([what's copied](https://next.devvm.dev/docs/using/clone/#whats-copied), [the settings](https://next.devvm.dev/docs/using/clone/#the-settings), [submodules](https://next.devvm.dev/docs/using/clone/#submodules), [a partial clone](https://next.devvm.dev/docs/using/clone/#a-partial-clone), [Git LFS](https://next.devvm.dev/docs/using/clone/#git-lfs)).
- **All of a `--clone` VM's work comes back:** `devvm clone fetch` also saves commits that only the VM's detached HEAD has as `saved/devvm/HEAD` and the VM's stash entries as `saved/devvm/stash-N`, and it brings back each submodule's branches and the LFS objects the VM's work points to, without `git-lfs` on this machine. `devvm rm` and `devvm clone off` check all of these and ask before any of them goes ([deleting the VM](https://next.devvm.dev/docs/using/clone/#deleting-the-vm)).
- **Pins in your own layers:** a layer of yours can pin a download for each architecture and fetch the right one with `devvm-fetch "$URL" "$(devvm_sha TOOL)" OUT`, as devvm's own scripts do ([the example](https://next.devvm.dev/docs/using/customizing/#example-mailpit)).
- **Quiet hosts:** Cursor CLI's metrics host, `api3.cursor.sh`, and Go's `telemetry.go.dev` stay blocked, but their blocks no longer show before the VM's prompt, in `devvm-why` or in `devvm network lock`. `devvm network log` still lists them, each line ending `, quiet` ([quiet hosts](https://next.devvm.dev/docs/safety/network/#quiet-hosts)).
### Changed
- **`--clone` in a folder of repos or a git worktree** copies each repo as above. A worktree's clone also gets the repo's default branch, remote-tracking branches and tags, and devvm says that the repo's other local branches stay on this machine.
- **`--clone` refuses a repo with a grafts file** before it makes the VM, and says what to do ([requirements](https://next.devvm.dev/docs/using/clone/#requirements)).
- **The proxy counts more addresses as internal:** a 6to4 address, in `2002::/16`, is judged by the IPv4 address in it, as a NAT64 address is, so `2002:a00:1::1` is as private as `10.0.0.1`. A deny for an IPv4 address also covers its 6to4 form, but an allow doesn't, because anyone may run a 6to4 relay. Teredo, IPv6's and IPv4's documentation ranges and other special ranges are refused unless a rule names the address, and `--from`'s registries are judged by the same list ([the proxy](https://next.devvm.dev/docs/internals/network/#the-proxy)).
- **Pins:** base's mise is 2026.11.8, Docker's buildx is 0.39.0 and compose 5.7.1, and Nix is 2.35.6.
### Fixed
- **`--clone` of a shallow or SHA-256 repo (#40):** a repo from `git clone --depth 1` or one that uses SHA-256 failed after devvm made the VM. Both work now, and a VM whose copy failed gets its clone the next time you run devvm in its folder. Thanks to @Josuesp1620 for the report and @dhruv1220 for finding the cause in #42 ([a copy that didn't finish](https://next.devvm.dev/docs/using/clone/#a-copy-that-didnt-finish)).
- **A stopped VM no longer keeps its listed ports from other VMs:** only a running VM holds a port. When the first VM starts again, devvm and `devvm ports` say that the other VM has the port, and the first VM takes it back within about 20 seconds of the other one stopping. Meanwhile, both VMs' apps share that port's site data and service workers in your browser ([two VMs and one port](https://next.devvm.dev/docs/using/ports-size/#two-vms-and-one-port)).
- **`devvm ports` says why a listed port isn't forwarded,** such as the forwarder's limit of 256 ports or Linux refusing a port below 1024, instead of always blaming a program on this machine ([a listed port isn't forwarded](https://next.devvm.dev/docs/using/troubleshooting/#a-listed-port-isnt-forwarded)). When a port's forward ends, so do its connections ([how it reaches the VM](https://next.devvm.dev/docs/internals/ports/#how-it-reaches-the-vm)).
- **A name that doesn't resolve says why:** a block now says whether this machine's DNS has no address for the name or didn't answer in time, and after a failure that may pass, the proxy asks once more before it blocks the name ([log files](https://next.devvm.dev/docs/internals/network/#log-files)).
- **dotnet on the allowlist tier** can reach DigiCert's OCSP responder, `ocsp.digicert.com` on port 80, which NuGet asks when it can't fetch DigiCert's revocation list ([dotnet](https://next.devvm.dev/docs/using/toolchains/#dotnet)).
- **`devvm history import FILE`** takes a `.tar.gz` made with macOS's `tar`, leaving out its AppleDouble `._` files ([importing history](https://next.devvm.dev/docs/using/coding-agents/#importing-history)).
- **opencode's links at `devvm agent import`** are copied or named as the other agents' are, where they were dropped without a word ([importing from this machine](https://next.devvm.dev/docs/using/coding-agents/#importing-from-this-machine)).
## 0.1.1-rc.2
A release candidate for 0.1.1, adding to 0.1.1-rc.1. Install it with `devvm upgrade --to 0.1.1-rc.2`, the install script's `--version 0.1.1-rc.2`, or `brew install devvmhq/tap/devvm-rc`. Homebrew's `devvm` stays on 0.1.0.
### After you upgrade
- Base and every image built on it are built again once, for transparent mode's programs.
- Run `devvm update` in an existing VM's folder to give it transparent mode, which new VMs get by default: its image predates the programs it needs.
- On a Linux host, run `devvm mount-cache none` for each existing VM, to stop the 9p cache bug below. Each launch reminds you until you do.
- If you used `devvm git-protect strict`, use `devvm clone on` for code you don't trust: strict is gone.
- Make new API keys for any VM you don't trust that had keys passed to it as they were.
### New
- **Transparent mode (#35), on by default:** on every tier but open, tools that ignore the proxy settings, such as `wrangler dev`, static Go binaries and containers, reach the VM's proxy and its allowlist anyway. A VM made before needs `devvm update` first, and `devvm network transparent off` turns it off for a VM ([what it covers](https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy)).
- **Folders of repos with `--clone` (#3):** one VM gets a clone of each repo you pick, at the same paths. `devvm clone fetch` brings back every repo's work, and `devvm clone add PATH` adds one ([folders of repos](https://next.devvm.dev/docs/using/clone/#folders-of-repos)).
- **Rules by HTTP method and path:** `--method` and `--path` on `devvm network allow`, `deny` and `rm`, such as `devvm network deny api.github.com --method POST,PUT,PATCH,DELETE`.
- **Your own secrets:** `devvm secret set NAME --host HOST --env VARIABLE`, then `devvm secret use NAME`. The VM only ever sees a placeholder, and `--method` and `--path` limit where the real value goes.
- **Learning a VM's hosts (#17):** `--network learn`, then `devvm network lock` to keep the hosts you choose.
- **`.git` protection on Linux (#4, #20):** `.git` is locked read-only around QEMU, without root. Where a host can't, such as Ubuntu with AppArmor, devvm watches `.git`, warns at each launch, and names what changed.
- **Nested repos (#3):** a VM protects the `.git` of each repo up to 4 folders down. `devvm doctor` suggests `safe.bareRepository explicit`.
- **pi and more providers (#23, #31, #32):** pi is a fourth agent, and Gemini, Groq, Mistral, xAI and DeepSeek keys stay on this machine.
- **Prereleases on Homebrew (#19):** `brew install devvmhq/tap/devvm-rc`.
### Changed
- **The 9p cache on Linux (#36):** Lima's default cache could write files to this machine empty or cut short, and made SQLite and Gradle fail. New Linux VMs use `none`, and `devvm mount-cache none` switches existing ones. Under `none`, keep SQLite WAL databases and other files that programs map for writing on the VM's own disk, or use `--clone`. macOS doesn't change.
- **A `--clone` VM in a folder another VM mounts** is refused, and `devvm rm` asks before deleting one made earlier.
- **Logins:** a VM's copy of Codex's and Claude Code's login files keeps only the fields devvm knows. opencode, like pi, gets no key devvm doesn't bind, unless you list the provider in `config.toml`'s `[pass-keys]` (#30).
- **Warnings** print once per command.
- **Nix** is 2.35.5.
### Removed
- **`devvm git-protect strict` (#37):** it couldn't keep git on this machine out of submodules the VM adds, so it's a usage error now. Strict VMs become `on`, and devvm takes out the `diff.ignoreSubmodules = all` it set, keeping a value of your own ([VMs that were strict](https://next.devvm.dev/docs/safety/git-protection/#vms-that-were-strict)).
### Fixed
- opencode's history copy with SQLite 3.54 (#26), a NUL byte in an ssh socket's path (#25), a build VM reusing its clone's ssh port, a login saved for an agent the VM lacks (#27), and `.git` protection locking a folder that only looks like a git folder (#28).
## 0.1.1-rc.1
A release candidate for 0.1.1, for trying the changes below before the release. Install it with `devvm upgrade --to 0.1.1-rc.1`, or with the install script's `--version 0.1.1-rc.1`. Homebrew stays on 0.1.0.
- **A dotnet toolchain:** the .NET SDK is a shared toolchain, chosen by a folder's `*.sln`, `*.slnx`, `*.csproj`, `*.fsproj` or `global.json`, and a `global.json`'s `sdk.version` picks the SDK. devvm downloads Microsoft's archive for each platform and checks its SHA-512, global tools and workloads go to the VM's home folder, and the .NET CLI's telemetry is off ([toolchains](https://next.devvm.dev/docs/using/toolchains/)).
- **A network that inspects TLS:** devvm's own mise, which looks up the shared tools' versions on this machine, now trusts the CAs in `~/.config/devvm/ca` as well as the system's, so resolving works behind a proxy that re-signs HTTPS. When a certificate isn't trusted, devvm says so and points to the docs instead of saying to check the connection. On macOS, the CA also has to be trusted in the Keychain.
- **Release candidates:** devvm can ship prereleases, such as this one. `devvm upgrade --to` installs one, and devvm upgrade, the release check and the install script's default never pick one on their own.
- **Lima 2.2 or newer:** devvm needs Lima 2.2 at least, and it's tested with Lima 2.3. `devvm doctor` says when Lima is older.
- **Updated pins:** base's docker is 29.9.3, mise 2026.11.3, rustup 1.29.3, and tealdeer 1.9.1, with a newer oh-my-bash. The shared tools' backends are named, so mise's registry can't switch opencode to a source with no downloads. base installs ICU, which .NET needs, so base and every image built on it are built again once.
## 0.1.0
Released 2026-11-06.
@@ -15,3 +188,7 @@ The first release of devvm, which gives each project folder an isolated VM of it
- **Managing VMs and space:** `devvm ls`, `devvm stop`, `devvm restart`, `devvm update` and `devvm rm` manage VMs, and `devvm images`, `devvm gc`, `devvm space` and `devvm retention` show and clean up the images, shared tools and exports devvm keeps. devvm never deletes a project VM on its own, because it may hold unsaved work.
- **Installing and upgrading:** install devvm with Homebrew (`brew trust --formula devvmhq/tap/devvm`, then `brew install devvmhq/tap/devvm`) or with the install script, which checks the release's minisign signature and checksum and asks before it installs what devvm needs, such as Lima. `devvm doctor` checks this machine, and `devvm upgrade` installs a newer release once it has checked the signature.
- **For scripts:** many commands take `--json`, and `--no-input` makes devvm fail where it would ask, naming the flag that answers the question.
## Unreleased
These changes are on `main` and go out in the next release.
+2
View File
@@ -9,3 +9,5 @@ Before sending a change, run:
```sh
mise run fmt && mise run lint && mise run test
```
Pull requests are squash-merged, and the pull request's title becomes the commit's subject, so write it as a [Conventional Commit](https://www.conventionalcommits.org/), `type(scope): summary`, with a type of `feat`, `fix`, `docs`, `test`, `refactor`, `build`, `ci` or `chore`. A check fails a title that doesn't follow it.
+4 -3
View File
@@ -30,7 +30,7 @@ Then run `devvm doctor`, which checks what devvm needs on your machine and says
Each release is signed with devvm's minisign key, `RWSjzFsn7ETaijKJ2y7F4DtZobXmyv+LmdclJwZP/KmAkLUwOCzWF/2b`, and [Checking the install script](https://devvm.dev/docs/internals/install/#checking-the-install-script) shows how to check the script with it before you run it.
- **Requirements:** macOS 13 or newer, or Linux, on arm64 or x86_64, with Lima 2.0 or newer ([Lima's requirements](https://devvm.dev/docs/backends/lima/#requirements)).
- **Requirements:** macOS 13 or newer, or Linux, on arm64 or x86_64, with Lima 2.2 or newer ([Lima's requirements](https://devvm.dev/docs/backends/lima/#requirements)).
- **Tested on** Apple silicon Macs and on Linux on arm64 and x86_64, but not yet on Intel Macs.
- [Installing](https://devvm.dev/docs/getting-started/install/) has the full list of requirements and the install script's options, and [Upgrading and uninstalling](https://devvm.dev/docs/using/upgrading/) covers what comes later.
@@ -58,8 +58,8 @@ devvm
## What's supported
- **Toolchains:** devvm detects them from the project's files, so a folder with `package.json` gets node ([toolchains](https://devvm.dev/docs/using/toolchains/)).
- **Coding agents:** Claude Code, Codex and opencode run in the VM, with your settings, skills and MCP servers. devvm keeps their settings and logins in a store of its own, and `devvm agent import` copies them in from an agent you already use on your machine ([coding agents](https://devvm.dev/docs/using/coding-agents/)).
- **Toolchains:** devvm detects them from the project's files, so a folder with `package.json` gets node, and the [toolchains](https://devvm.dev/docs/using/toolchains/) page lists them all.
- **Coding agents:** <!-- the agents' names, generated from internal/agents by mise run cli-docs -->Claude Code, Codex, opencode, pi and Cursor CLI<!-- end of the agents' names --> run in the VM, with your settings, skills and MCP servers. devvm keeps their settings and logins in a store of its own, and `devvm agent import` copies them in from an agent you already use on your machine ([coding agents](https://devvm.dev/docs/using/coding-agents/)).
- **Layers:** the built-in `docker`, `nix` and `desktop` layers, and your own from `devvm layer new` ([layers](https://devvm.dev/docs/using/images/#layers)).
- **Backend:** devvm runs its VMs on [Lima](https://lima-vm.io) ([backends](https://devvm.dev/docs/backends/)).
@@ -92,6 +92,7 @@ The docs are at [devvm.dev](https://devvm.dev/), and their source is in `docs/`.
- [Using devvm](https://devvm.dev/docs/using/): images and tools, clones, links between VMs, ports and size, coding agents, SSH and editors, and troubleshooting.
- [Staying safe](https://devvm.dev/docs/safety/): the habits that keep you safe, network tiers, `.git` protection and attack vectors.
- [Backends](https://devvm.dev/docs/backends/): Lima, which runs the VMs, and what it gives them.
- [Compared to other tools](https://devvm.dev/docs/compared/): how devvm differs from Docker Sandboxes and other sandboxes.
- [CLI reference](https://devvm.dev/docs/cli/): every command, with its arguments and flags.
- [How it works](https://devvm.dev/docs/internals/): how devvm does what it does, for checking a claim or reviewing its security.
- [Contributing](https://devvm.dev/docs/contributing/): building, testing and writing docs.
+1 -1
View File
@@ -1 +1 @@
0.1.0
0.2.0-rc.1
+78 -9
View File
@@ -1,28 +1,97 @@
package assets
import (
"crypto/sha256"
"crypto/sha512"
"encoding/hex"
"io/fs"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
)
// Every VM's shells get the tools' environment from base's
// /etc/profile.d/devvm-tools.sh, which turns off the agents'
// self-updates: their installs are read-only shared tools, and mise pins
// their versions.
func TestToolsEnvironment(t *testing.T) {
// heredoc is the body of the heredoc that base.sh starts with this line,
// up to its end marker.
func heredoc(t *testing.T, start, end string) string {
t.Helper()
b, err := fs.ReadFile(FS, "layers/base.sh")
if err != nil {
t.Fatal(err)
}
_, rest, ok := strings.Cut(string(b), "/etc/profile.d/devvm-tools.sh >/dev/null <<'SH'\n")
block, _, closed := strings.Cut(rest, "\nSH\n")
_, rest, ok := strings.Cut(string(b), start+"\n")
block, _, closed := strings.Cut(rest, "\n"+end+"\n")
if !ok || !closed {
t.Fatal("base.sh writes no /etc/profile.d/devvm-tools.sh")
t.Fatalf("base.sh has no %q", start)
}
for _, line := range []string{"export DISABLE_AUTOUPDATER=1", "export OPENCODE_DISABLE_AUTOUPDATE=1"} {
return block
}
// Every VM's shells get the tools' environment from base's
// /etc/profile.d/devvm-tools.sh, which reads the toolchains' environment
// (their telemetry off, their global installs into the VM's home) and
// their folders for the PATH from /etc/devvm/toolchains.sh, and the
// agents' (their self-updates, version checks and telemetry off) from
// /etc/devvm/agents.sh, which every launch's setup writes, so base holds
// none of it (internal/vm's TestToolchainsOwnTheirEnvironment): their
// installs are read-only shared tools, and mise pins their versions.
// Non-login shells read it too (BASH_ENV), but not devvm-telemetry.sh, so
// no agent's switch is there.
func TestToolsEnvironment(t *testing.T) {
block := heredoc(t, "sudo tee /etc/profile.d/devvm-tools.sh >/dev/null <<'SH'", "SH")
for _, line := range []string{
"if [ -r /etc/devvm/toolchains.sh ]; then . /etc/devvm/toolchains.sh; fi",
` export PATH="$devvm_path$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH" ;;`,
"if [ -r /etc/devvm/agents.sh ]; then . /etc/devvm/agents.sh; fi",
} {
if !strings.Contains("\n"+block+"\n", "\n"+line+"\n") {
t.Errorf("devvm-tools.sh lacks %q", line)
}
}
telemetry := heredoc(t, "sudo tee /etc/profile.d/devvm-telemetry.sh >/dev/null <<'SH'", "SH")
for _, v := range []string{"DISABLE_AUTOUPDATER=", "DISABLE_TELEMETRY=", "DISABLE_ERROR_REPORTING=", "OPENCODE_", "PI_"} {
if strings.Contains(block, "export "+v) || strings.Contains(telemetry, "export "+v) {
t.Errorf("base sets %s, an agent's, which the setup's agents.sh sets", v)
}
}
}
// base.sh's devvm-fetch keeps a download only when its checksum is the
// one given: a SHA-256, or a SHA-512 by its length.
func TestDevvmFetch(t *testing.T) {
for _, c := range []string{"sh", "curl", "sha256sum", "sha512sum", "cut"} {
if _, err := exec.LookPath(c); err != nil {
t.Skip("no " + c)
}
}
dir := t.TempDir()
script := filepath.Join(dir, "devvm-fetch")
if err := os.WriteFile(script, []byte(heredoc(t, "sudo tee /usr/local/bin/devvm-fetch >/dev/null <<'SH'", "SH")+"\n"), 0o600); err != nil {
t.Fatal(err)
}
src := filepath.Join(dir, "src")
body := []byte("an archive\n")
if err := os.WriteFile(src, body, 0o600); err != nil {
t.Fatal(err)
}
s256, s512 := sha256.Sum256(body), sha512.Sum512(body)
for _, tc := range []struct {
name, sum string
ok bool
}{
{"its SHA-256", hex.EncodeToString(s256[:]), true},
{"its SHA-512", hex.EncodeToString(s512[:]), true},
{"another SHA-256", strings.Repeat("0", 64), false},
{"another SHA-512", strings.Repeat("0", 128), false},
{"its SHA-256 twice", strings.Repeat(hex.EncodeToString(s256[:]), 2), false},
} {
out := filepath.Join(dir, "out")
err := exec.CommandContext(t.Context(), "sh", script, "file://"+src, tc.sum, out).Run() //nolint:gosec // base.sh's devvm-fetch, on the test's own files
_, kept := os.Stat(out)
if (err == nil) != tc.ok || (kept == nil) != tc.ok {
t.Errorf("%s: %v, kept %v", tc.name, err, kept == nil)
}
_ = os.Remove(out)
}
}
+3 -3
View File
@@ -8,9 +8,9 @@ set -euxo pipefail
eza_version=0.23.5
eza_sha256_arm64=40b87ae8628aa2ff0f0d2dc24ab52f689631366385c3da630bae745671fd71ec
eza_sha256_amd64=e06eebab74b73d6b7d51a796a353824b001bea82df077706382e100815d28904
tealdeer_version=1.9.0
tealdeer_sha256_arm64=a748f181c00933980cb850f4a24199c45900fc523787f6c524232a6bfc66b895
tealdeer_sha256_amd64=dc7263b550e90c0689ea2cb434e3144469805d5dddecbb1f7fc534e1185b7408
tealdeer_version=1.9.1
tealdeer_sha256_arm64=247746dd2d18f0135da79b849bb6b49e45262e2fe4318adfc3082dc6ce3ee968
tealdeer_sha256_amd64=5a9c3f0691b9cf375ee5c99de802885f3d50498cf686a539e2ddda028eb6b4f6
if [[ $devvm_libc == musl ]]; then
# Alpine packages eza too (its arm64 release build below is glibc).
+1 -1
View File
@@ -2,7 +2,7 @@
# oh-my-bash: themed prompt, completions, aliases
set -euxo pipefail
# Pinned commit (scripts/bump.sh updates it); git checks the content against it.
omb_commit=abf846186ab0a8a41ec5888e827ece6277dfe446
omb_commit=94c2977eda06f230aafa9628fcd869123f01896b
# Its own installer, from the pinned commit and cloning from it (OSH_REPOSITORY), so nothing comes
# from master. Replaces ~/.bashrc (backed up first); re-add the ~/.bashrc.d loader afterwards.
+5 -4
View File
@@ -7,7 +7,7 @@ You're running in a devvm VM. devvm gives each project folder on the user's mach
- The project folder is mounted read-write at the same path as on the host, so the user's editor sees your changes at once. It's the only folder of the host's that the VM can write to: the agent store's folders and the shared tools are mounted read-only.
- Your home folder is on the VM's own disk, not the host's. The coding agents' settings, skills and logins come from devvm's agent store, and the folders among them are mounted read-only.
- devvm update, devvm layer add and devvm layer rm make the VM again from a newer or another image. The project folder and your home folder survive, and everything else on the disk is lost, such as packages installed with apt, programs installed outside your home and Docker's images. Shell settings of your own go in `~/.bashrc.d`, because the image owns `~/.bashrc`.
- In the project folder, git can commit, branch, fetch and pull, but `.git`'s hooks and config are locked, so `git config`, `git remote add`, `push -u` to a new branch and hook installers fail with `Operation not permitted`. Ask the user to change them on the host. A VM made with `--clone` has its own clone of the repo instead, and the user fetches its branches with `git fetch devvm`.
- In the project folder, git can commit, branch, fetch and pull, but `.git`'s hooks and config are locked, so `git config`, `git remote add`, `push -u` to a new branch and hook installers fail with `Operation not permitted`. Ask the user to change them on the host. A VM made with `--clone` has its own clone of the repo instead, and the user fetches its work with `devvm clone fetch`, its branches, a detached HEAD's commits, stash entries and Git LFS objects.
## Network and secrets
@@ -20,17 +20,17 @@ Every request goes through a proxy that devvm runs on the host, and the VM's net
| `allowlist` | only the hosts on the VM's allowlist (the default) |
| `none` | only its agents' hosts, its secrets' hosts and its links |
The VM doesn't record its tier, and the user sees it with devvm network on the host. A request that the tier refuses fails with a 403 from the proxy, which names the host and the rule that would allow it, and on every tier but open a direct connection or a DNS lookup that skips the proxy fails at once.
The VM doesn't record its tier, and the user sees it with devvm network on the host. A VM can also learn the hosts it needs: it's on the internet tier while it learns, and once the user runs devvm network lock on the host, it's on the allowlist tier with the hosts the user kept, so a host that works while it learns may be blocked after. A request that the tier refuses fails with a 403 from the proxy, which names the host and the rule that would allow it, and on every tier but open a direct connection to an address fails at once.
- Run `devvm-why` to see what the proxy blocked lately. A note before each shell prompt says when something new was blocked.
- The proxy settings are in the environment (`HTTP_PROXY`, `HTTPS_PROXY` and their lowercase forms). A tool that ignores them, such as Java, needs the proxy's address in its own settings. A DNS or connection error for a host the tier allows means the tool skipped the proxy, and devvm-why doesn't show it.
- The proxy settings are in the environment (`HTTP_PROXY`, `HTTPS_PROXY` and their lowercase forms). On every tier but open, a tool that ignores them still reaches the proxy by the names it looks up, over HTTPS and HTTP and on the ports the rules name, unless the user turned transparent mode off: every name resolves to 198.18.0.1, and the proxy reads the real host from the connection and judges it the same way, so a blocked HTTPS host shows the proxy's 403. Another port of such a name is refused at once, and so is a protocol that names no host, such as a database's, so a tool like that needs the proxy's address in its own settings. `devvm-why` lists both what the proxy blocked and what the VM refused.
- No secret is in the VM. `GH_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN` and the agents' logins hold placeholders, and the proxy puts the real value into each request for that secret's hosts. Use them as they are, and don't copy them anywhere else, because they work nowhere but through this VM's proxy.
- git over ssh goes through the proxy too, with `devvm-ssh-proxy` as its ProxyCommand, so the host must be one the tier allows.
- Browsers ask for a proxy's password, so they use `devvm-local-proxy`, which the desktop starts on the VM's loopback.
## Tools and installs
- The toolchains (node, python, rust, go) and the coding agents are shared tools, mounted read-only from images that every VM shares. They can't update themselves, and global installs go into your home: `npm i -g` installs into `~/.npm-global`, and Python's packages go into a virtual environment or `~/.local/bin`.
- The toolchains, such as node ([the list](https://devvm.dev/docs/using/toolchains/)), and the coding agents are shared tools, mounted read-only from images that every VM shares. They can't update themselves, and global installs go into your home: `npm i -g` installs into `~/.npm-global`, Python's packages go into a virtual environment or `~/.local/bin`, and `dotnet tool install -g` installs into `~/.dotnet/tools`.
- mise runs the shared tools. A project that asks for another version, in `.tool-versions`, `mise.toml` or its own toolchain file, gets it from mise, which installs it in your home on first use.
- `sudo` needs no password, and `apt install` (`apk add` on Alpine) goes through the proxy, whose allowlist for every VM has Ubuntu's, Debian's and Alpine's package hosts. What it installs is lost when the VM is made again.
- `devvm-fetch URL SHA256 OUT` downloads a file and fails when its checksum doesn't match.
@@ -49,3 +49,4 @@ These commands run on the host, in the project folder, so ask the user to run th
| the GitHub token in this VM | `devvm secret set github`, then `devvm secret use github` |
| an agent logged in | `devvm agent login AGENT`, such as `devvm agent login claude` |
| `.git`'s hooks or config changed | devvm git-protect off, with the VM stopped, then devvm git-protect on |
| an image, a PDF or a file from the host, such as a screenshot or pages copied from a PDF | `devvm paste`, which puts it in the paste folder, `/tmp/devvm-paste` unless the user set `paste-dir`, and gives the user its path to paste to you |
+47
View File
@@ -0,0 +1,47 @@
#!/bin/sh
# devvm paste's side in the VM, run as sh -c SCRIPT devvm-paste COMMAND DIR [NAME] with the
# script itself as the argument, so nothing of it is left on disk. The host names the folder DIR
# (config.toml's paste-dir) and the file NAME, both from a fixed set of characters.
# put DIR NAME writes stdin to DIR/NAME: to NAME.part first, mode 600, then renamed over NAME,
# so a reader never sees half of it. DIR is made, mode 700, when it's missing, and
# refused when it's a symbolic link, isn't a folder or isn't this user's.
# count DIR prints how many files devvm paste left in DIR
# rm DIR deletes them and prints how many
# count and rm see only regular files at DIR's top level whose names devvm paste gives, and its
# .part leftovers, never anything else in a folder that may be yours.
set -eu
cmd=$1 dir=$2
h='[0-9a-f]'
d='[0-9]'
pat="paste-$d$d$d$d$d$d$d$d-$d$d$d$d$d$d-$h$h$h$h$h$h$h$h*"
# mine lists devvm paste's files in $dir, one a line: regular files, never links, named from the
# characters devvm uses and no other, so a name with a newline past devvm's prefix, which would
# read as two lines, isn't devvm's.
mine() { find "$dir" -maxdepth 1 -type f -name "$pat" ! -name '*[!A-Za-z0-9._-]*'; }
case $cmd in
put)
name=$3
if [ -L "$dir" ]; then echo "devvm: $dir is a symbolic link, so devvm paste can't use it" >&2; exit 1; fi
if [ ! -e "$dir" ]; then (umask 077 && mkdir -p "$dir"); fi
if [ ! -d "$dir" ]; then echo "devvm: $dir isn't a folder, so devvm paste can't use it" >&2; exit 1; fi
if [ -z "$(find "$dir" -prune -user "$(id -un)")" ]; then
echo "devvm: $dir isn't yours, so devvm paste can't use it" >&2; exit 1
fi
umask 077
cat > "$dir/$name.part"
mv -f "$dir/$name.part" "$dir/$name"
;;
count)
[ -d "$dir" ] || { echo 0; exit 0; }
mine | wc -l | tr -d ' '
;;
rm)
[ -d "$dir" ] || { echo 0; exit 0; }
n=$(mine | wc -l | tr -d ' ')
mine | while IFS= read -r f; do rm -f -- "$f"; done
echo "$n"
;;
*)
echo "devvm: paste.sh: unknown command $cmd" >&2; exit 2
;;
esac
+206 -26
View File
@@ -1,11 +1,13 @@
#!/bin/bash
# Runs inside a project VM on every devvm launch, from a staging dir the host sends over:
# home/ agents' settings files and logins from devvm's store, copied into ~
# home/ agents' settings files and logins (but Claude Code's) from devvm's store, copied into ~
# links agents' settings folders from devvm's store, two lines each: the path relative to
# ~, then the folder's path, where it's mounted read-only; linked into ~
# claude.json the store's .claude.json's settings, account state and MCP servers (never its API key
# or per-project history), merged in (MCP servers' env values and headers are
# placeholders)
# claude-credentials.json the store's Claude Code OAuth login, placeholders only, merged into
# ~/.claude/.credentials.json (merge_claude_credentials)
# env exports (LANG, CLAUDE_CODE_OAUTH_TOKEN, GH_TOKEN: placeholders), installed as
# ~/.config/devvm/env
# ca/ the CAs the VM trusts besides its system's, one certificate per file:
@@ -14,9 +16,24 @@
# vm DEVVM_* host settings applied to every VM: hostname, timezone, locale, git identity,
# DEVVM_PROXY (the proxy URL, empty when the guest has none),
# DEVVM_NO_PROXY (what reaches the VM itself without the proxy; its links go through it),
# and DEVVM_LOCAL_PROXY (ADDRESS:PORT on the VM's loopback, where devvm-local-proxy
# listens; empty without a proxy)
# DEVVM_LOCAL_PROXY (ADDRESS:PORT on the VM's loopback, where devvm-local-proxy
# listens; empty without a proxy), DEVVM_TRANSPARENT_ADDR and
# DEVVM_TRANSPARENT_HOST (transparent mode's stand-in address, empty for off, and the
# proxy's reserved target; transparent.sh), DEVVM_RESOLVER (on a confined VM, the
# one name server its programs ask, past systemd-resolved; empty for the system's
# own), and DEVVM_PASTE_DIR (the folder devvm
# paste writes to, config.toml's paste-dir: made here, the user's own, mode 700)
# transparent.sh devvm-transparent: transparent mode, for tools that ignore the proxy settings
# tools the VM's shared tool images, "FILE TOOL VERSION" lines; tools.sh mounts them
# tool-alias.toml the [tool_alias] table of devvm's shared-tools/mise.toml: the backend each
# tool's image was built from, which mise's registry might not give its name
# agent-env export lines of every coding agent's guest environment (its self-update, version
# check and telemetry off), installed as /etc/devvm/agents.sh, which devvm-tools.sh reads
# toolchain-env export lines of every toolchain's guest environment (its telemetry off, its global
# installs into ~), then devvm_path, their folders of ~ for the PATH, each followed by a
# colon; installed as /etc/devvm/toolchains.sh, which devvm-tools.sh reads
# version-files.toml the VM's mise's idiomatic_version_file_enable_tools setting: the toolchains'
# tools whose version files (.nvmrc, global.json) a project chooses versions with
# opencode-import.json the store's opencode logins as opencode auth import reads them, with
# placeholders (none: no opencode login in the store); opencode.sh imports them
# hosts the VM's links (devvm checked them): a line per target, "ADDRESS NAME
@@ -66,41 +83,70 @@ if [[ -n "$DEVVM_TZ" ]]; then
[[ "$(readlink /etc/localtime)" == "/usr/share/zoneinfo/$DEVVM_TZ" ]] || sudo ln -sfn "/usr/share/zoneinfo/$DEVVM_TZ" /etc/localtime
fi
fi
# The paste folder (devvm paste): made once, the user's own, mode 700, by the user, or by root where
# the user can't make it, such as a folder under /srv. One that's there keeps its mode. A link, a
# file or another user's folder there is left alone, with a warning, as is one that can't be made,
# under a file say: paste.sh refuses them too, and the rest of the setup goes on.
if [[ -n "${DEVVM_PASTE_DIR:-}" ]]; then
p=$DEVVM_PASTE_DIR
if [[ -L $p ]]; then echo "devvm: $p is a symbolic link, so devvm paste can't use it" >&2
elif [[ -e $p && ! -d $p ]]; then echo "devvm: $p isn't a folder, so devvm paste can't use it" >&2
elif [[ -d $p && ! -O $p ]]; then echo "devvm: $p isn't yours, so devvm paste can't use it" >&2
elif [[ ! -e $p ]]; then
(umask 077 && mkdir -p "$p") 2>/dev/null || sudo install -d -m 700 -o "$(id -u)" -g "$(id -g)" "$p" \
|| echo "devvm: $p can't be made, so devvm paste can't use it" >&2
fi
fi
# musl (Alpine) has no locales to generate.
if [[ -n "$DEVVM_LANG" ]] && command -v locale-gen >/dev/null && ! locale -a | grep -qix "${DEVVM_LANG/UTF-8/utf8}"; then
sudo locale-gen "$DEVVM_LANG" >/dev/null
fi
# Shared tools: mount this VM's images (at boot too, by devvm-tools.service), then tell mise which
# versions to use. /etc/mise is mise's system config: the user's own (~/.config/mise) comes first.
# versions to use, and each one's backend. /etc/mise is mise's system config: the user's own
# (~/.config/mise) comes first.
cmp -s "$s/tools.sh" /usr/local/sbin/devvm-tools 2>/dev/null || sudo install -D -m 755 "$s/tools.sh" /usr/local/sbin/devvm-tools
cmp -s "$s/tools" /etc/devvm/tools 2>/dev/null || sudo install -D -m 644 "$s/tools" /etc/devvm/tools
# The toolchains' and the agents' environment (their telemetry and self-updates off, the toolchains'
# folders for the PATH), which base's devvm-tools.sh reads in every shell, before anything here runs
# one.
cmp -s "$s/toolchain-env" /etc/devvm/toolchains.sh 2>/dev/null ||
sudo install -D -m 644 "$s/toolchain-env" /etc/devvm/toolchains.sh
cmp -s "$s/agent-env" /etc/devvm/agents.sh 2>/dev/null || sudo install -D -m 644 "$s/agent-env" /etc/devvm/agents.sh
# A tool it can't mount fails the setup, and devvm names it from /run/devvm/tools-unmounted.
sudo /usr/local/sbin/devvm-tools
{
cat "$s/tool-alias.toml"
echo
echo '[tools]'
while read -r _ tool version; do [[ -z $tool || $tool == rust ]] || echo "$tool = \"$version\""; done < "$s/tools"
# rust is rustup's; cursor's folder holds its own node, rg and helpers, which shims would put
# ahead of the VM's, so it has links of its own (below).
while read -r _ tool version; do [[ -z $tool || $tool == rust || $tool == cursor ]] || echo "$tool = \"$version\""; done < "$s/tools"
cat <<'T'
[settings]
experimental = true
shared_install_dirs = ["/opt/devvm/tools"]
# A project's version files choose versions, as their own tools would; a version that isn't shared
# installs into the VM on first use. Not go: go.mod's go line is a minimum, and Go's own GOTOOLCHAIN
# reads its toolchain line.
idiomatic_version_file_enable_tools = ["node", "python", "bun", "pnpm"]
# A version that a project's version files choose and that isn't shared installs into the VM on first
# use.
auto_install = true
not_found_auto_install = true
python.compile = false
# mise points GOBIN into Go's install, which is read-only: go install goes to ~/go/bin.
go_set_gobin = false
# Each .NET SDK in a folder of its own, the shared one's its image: mise would otherwise run every SDK
# from one folder of the VM's, which the shared one isn't in.
dotnet.isolated = true
# The project folder is the user's own: trust its mise.toml without asking.
trusted_config_paths = ["/"]
T
# A project's version files choose versions, as their own tools would: the toolchains' tools that
# devvm's registry names, in [settings] still.
cat "$s/version-files.toml"
} > "$s/mise.toml"
cmp -s "$s/mise.toml" /etc/mise/config.toml 2>/dev/null || sudo install -D -m 644 "$s/mise.toml" /etc/mise/config.toml
# Links into tools this VM doesn't have any more (devvm tools rm, devvm tools update).
for l in ~/.rustup/toolchains/* ~/.local/bin/claude; do
for l in ~/.rustup/toolchains/* ~/.local/bin/claude ~/.local/bin/cursor-agent ~/.local/bin/agent; do
[[ -L $l && ! -e $l && "$(readlink "$l")" == /opt/devvm/tools/* ]] && rm "$l"
done
# Rust: rustup in ~/.cargo (installed once, from the tool image) with the shared toolchain linked in.
@@ -119,9 +165,27 @@ go=$(awk '$2 == "go" { print $3 }' "$s/tools")
if [[ -n $go && "$(cat ~/.config/go/telemetry/mode 2>/dev/null)" != off* ]]; then
/opt/devvm/tools/go/"$go"/bin/go telemetry off
fi
# .NET's global tools (~/.dotnet/tools) find the shared runtime in every shell through
# /etc/dotnet/install_location, where .NET's programs look for an installed one: mise sets
# DOTNET_ROOT only in the shells it activates.
dotnet=$(awk '$2 == "dotnet" { print $3 }' "$s/tools")
loc=$(cat /etc/dotnet/install_location 2>/dev/null || true)
if [[ -n $dotnet && $loc != "/opt/devvm/tools/dotnet/$dotnet" ]]; then
sudo mkdir -p /etc/dotnet
echo "/opt/devvm/tools/dotnet/$dotnet" | sudo tee /etc/dotnet/install_location >/dev/null
elif [[ -z $dotnet && $loc == /opt/devvm/tools/* ]]; then
sudo rm -f /etc/dotnet/install_location
fi
# Claude Code checks for itself at ~/.local/bin/claude.
claude=$(awk '$2 == "claude" { print $3 }' "$s/tools")
if [[ -n $claude ]]; then mkdir -p ~/.local/bin; ln -sfn /opt/devvm/tools/claude/"$claude"/claude ~/.local/bin/claude; fi
# Cursor's CLI is cursor-agent, and agent, where its own installer links them, made again at every
# launch, so it stays the shared release devvm pins (its channel, below).
cursor=$(awk '$2 == "cursor" { print $3 }' "$s/tools")
if [[ -n $cursor ]]; then
mkdir -p ~/.local/bin
for l in cursor-agent agent; do ln -sfn /opt/devvm/tools/cursor/"$cursor"/cursor-agent ~/.local/bin/"$l"; done
fi
mise reshim 2>/dev/null || true
# A command over ssh runs bash non-interactively, and bash then reads ~/.bashrc instead of BASH_ENV:
# its first line, before the "not interactive: return". Features (oh-my-bash) and users replace ~/.bashrc.
@@ -148,6 +212,14 @@ git config --global --get-all safe.directory | grep -qx '\*' || git config --glo
[[ -d "$s/home" ]] && cp -a "$s/home/." ~/
# The agents' folders that are the VM's own, the store's being their seed, such as Claude Code's
# plugins: a link to the store's, as a VM from before has, becomes a folder.
while IFS= read -r rel; do
[[ -n "$rel" ]] || continue
[[ ! -L ~/"$rel" ]] || rm -f ~/"$rel"
mkdir -p ~/"$rel"
done < "$s/own-dirs"
while IFS= read -r rel && IFS= read -r mount; do
[[ -n "$rel" && -e "$mount" ]] || continue
mkdir -p "$(dirname ~/"$rel")"
@@ -175,6 +247,36 @@ merge_claude_json() {
if [[ -f "$s/claude.json" ]]; then
merge_claude_json ~/.claude.json "$s/claude.json" ~/.local/state/devvm/claude-mcp-copied.json
fi
# merge_claude_credentials VM STORE: the store's Claude Code login (claudeAiOauth, its placeholder)
# replaces the VM's, or takes it away when STORE has none, and the rest of the VM's file stays: what
# Claude Code keeps there of its own, such as its logins to MCP servers (mcpOAuth), which never leave
# the VM. A VM file that's a link, not JSON or not one object is replaced by STORE, and said; a folder
# is left, and said. It's written whole, mode 600: a temp file in ~/.cache, which no export or remake
# carries, moved over, and removed when that fails.
merge_claude_credentials() {
local vm=$1 store=$2 tmp
if [[ -d $vm && ! -L $vm ]]; then
echo "devvm: $vm is a folder, so Claude Code in this VM doesn't get devvm's login" >&2
return 0
fi
mkdir -p ~/.cache "$(dirname "$vm")"
tmp=$(mktemp ~/.cache/devvm-credentials.XXXXXX)
if [[ -L $vm || ! -f $vm ]] || ! jq -n --slurpfile v "$vm" --slurpfile s "$store" '
if ($v | length) == 1 and ($v[0] | type) == "object"
then ($v[0] | del(.claudeAiOauth)) + ($s[0] | with_entries(select(.key == "claudeAiOauth")))
else error("not one object") end' > "$tmp" 2>/dev/null; then
if [[ -L $vm || -e $vm ]]; then
echo "devvm: $vm couldn't be read as a file of one JSON object, so devvm's login replaced it, with any MCP servers' logins in it" >&2
fi
cat "$store" > "$tmp" || { rm -f "$tmp"; return 1; }
fi
# A link goes first, so mv never follows it into a folder.
[[ ! -L $vm ]] || rm -f "$vm"
mv -f "$tmp" "$vm" || { rm -f "$tmp"; return 1; }
}
if [[ -f "$s/claude-credentials.json" ]]; then
merge_claude_credentials ~/.claude/.credentials.json "$s/claude-credentials.json"
fi
# The project folder moved since the last setup: Claude Code's sessions and settings, kept by its old
# path, follow it.
# shellcheck source-path=SCRIPTDIR source=claude.sh
@@ -186,19 +288,40 @@ if [[ -f "$s/moved" ]]; then
claude_project_moved "$moved_from" "$moved_to" "$claude_from" "$claude_to"
fi
# VS Code over Remote-SSH (devvm code): its settings for this machine turn off what reaches the host
# beyond the editor itself: forwarding ports the VM's programs open (to the host's localhost, which
# devvm ports doesn't cover) and answering git's credential prompts with the host's GitHub sign-in.
# The VM can change this file back; it's here so ordinary use is safe.
vsc=~/.vscode-server/data/Machine/settings.json
vsc_off='{"remote.autoForwardPorts": false, "git.terminalAuthentication": false, "github.gitAuthentication": false}'
mkdir -p "$(dirname "$vsc")"
if [[ ! -s $vsc ]]; then
echo "$vsc_off" | jq . > "$vsc"
elif jq -e 'type == "object"' "$vsc" >/dev/null 2>&1; then
jq --argjson off "$vsc_off" '. + $off' "$vsc" > "$vsc.tmp" && mv "$vsc.tmp" "$vsc"
else
echo "devvm: $vsc isn't plain JSON, so VS Code's port forwarding and git sign-in stay as they are there" >&2
# VS Code and Cursor over Remote-SSH (devvm code, devvm cursor): their settings for this machine turn
# off what reaches the host beyond the editor itself: forwarding ports the VM's programs open (to the
# host's localhost, which devvm ports doesn't cover) and answering git's credential prompts with the
# host's GitHub sign-in. The VM can change these files back; they're here so ordinary use is safe.
# A file or folder of theirs devvm can't write warns and leaves the rest of the setup to run.
editor_off='{"remote.autoForwardPorts": false, "git.terminalAuthentication": false, "github.gitAuthentication": false}'
editor_settings() {
local es=$1
mkdir -p "$(dirname "$es")" 2>/dev/null || return 1
if [[ ! -s $es ]]; then
echo "$editor_off" | jq . > "$es" 2>/dev/null || return 1
elif jq -e 'type == "object"' "$es" >/dev/null 2>&1; then
jq --argjson off "$editor_off" '. + $off' "$es" > "$es.tmp" 2>/dev/null && mv "$es.tmp" "$es" 2>/dev/null || return 1
else
echo "devvm: $es isn't plain JSON, so the editor's port forwarding and git sign-in stay as they are there" >&2
fi
}
for es in ~/.vscode-server/data/Machine/settings.json ~/.cursor-server/data/Machine/settings.json; do
editor_settings "$es" ||
echo "devvm: $es can't be written, so the editor's port forwarding and git sign-in stay as they are there" >&2
done
# Cursor's CLI has no variable that turns its updates off: on its static channel, which its config
# (host-copied, or its own) keeps through its own writes, it skips them.
if [[ -n $cursor ]]; then
c=~/.cursor/cli-config.json
mkdir -p ~/.cursor
if [[ ! -s $c ]]; then
echo '{"version":1,"channel":"static"}' > "$c"
elif jq -e 'type == "object" and .channel != "static"' "$c" >/dev/null 2>&1; then
jq '.channel = "static"' "$c" > "$c.devvm" && mv "$c.devvm" "$c"
elif ! jq -e 'type == "object"' "$c" >/dev/null 2>&1; then
echo "devvm: $c isn't plain JSON, so Cursor's CLI could update itself in this VM" >&2
fi
fi
# Codex has no env-var opt-out: append the off switches unless the (host-copied) config sets them.
@@ -418,11 +541,13 @@ SH
mkdir -p ~/.ssh
proxy_block ~/.ssh/config "Host *
ProxyCommand /usr/local/bin/devvm-ssh-proxy %h %p"
# devvm-why: what the proxy blocked lately, and how to allow it.
# devvm-why: what the proxy blocked lately, and how to allow it; then, with transparent mode, what
# it refused in the VM and the names tools looked up.
sudo tee /usr/local/bin/devvm-why >/dev/null <<'SH'
#!/bin/sh
# What this VM's proxy blocked recently, and the host command that allows it.
exec curl -sS --proxy "$HTTP_PROXY" http://devvm.proxy/blocked
curl -sS --proxy "$HTTP_PROXY" http://devvm.proxy/blocked
if [ -x /usr/local/sbin/devvm-transparent ]; then sudo -n /usr/local/sbin/devvm-transparent status; fi
SH
sudo chmod 755 /usr/local/bin/devvm-why
# Before each prompt: what was blocked since the last one (HTTPS clients don't show the proxy's
@@ -451,6 +576,61 @@ else
if $systemd; then sudo rm -f "$dropin"; else conf_block "$dropin"; fi
[[ ! -f ~/.ssh/config ]] || proxy_block ~/.ssh/config
fi
# A confined VM's resolver (DEVVM_RESOLVER, 127.0.0.1): glibc asks that one name server itself, as
# musl does on Alpine, not systemd-resolved's stub, so a lookup fails at once when nothing answers
# there (transparent mode off). The stub, with 127.0.0.1 as its only server, can keep retrying it
# over UDP and TCP without answering, so a lookup waited out its timeout. /etc/resolv.conf, the
# stub's link, becomes devvm's file, with the stub's search line and a second's timeout, tried
# twice (dnsmasq answers in the VM); on an open VM, devvm's file goes back to the stub's link, and
# systemd-resolved restarts, which forgets what it read from devvm's file. The file is written only
# on systemd guests that have the stub's file, whose /etc/resolv.conf is its link or devvm's file;
# going back needs devvm's file alone.
# resolver_conf FILE STUB: FILE (/etc/resolv.conf) as DEVVM_RESOLVER has it, STUB the stub's file.
resolver_conf() {
local f=$1 stub=$2 was first want tmp
local mark='# devvm: a confined VM asks its one name server directly (DEVVM_RESOLVER)'
was=$(readlink "$f" 2>/dev/null || true)
first=$(head -n 1 "$f" 2>/dev/null || true)
if [[ -z ${DEVVM_RESOLVER:-} ]] || ! $systemd; then
# devvm's file alone is enough to go back: it's only ever written in place of the stub's link.
[[ -z $was && $first == "$mark" ]] || return 0
sudo ln -sfn "$stub" "$f"
# systemd-resolved took devvm's file as its own servers and search domain ("." routes every
# name to 127.0.0.1), and keeps them once the file is its link again, until it restarts.
! $systemd || sudo systemctl try-restart systemd-resolved || true
[[ -e $stub ]] || echo "devvm: $f leads to $stub again, which systemd-resolved hasn't made, so names may not resolve in this VM" >&2
return 0
fi
[[ -e $stub ]] || return 0
[[ (-n $was && "$(readlink -f "$f")" == "$(readlink -f "$stub")") || (-z $was && $first == "$mark") ]] || return 0
want=$(printf '%s\nnameserver %s\n' "$mark" "$DEVVM_RESOLVER"
grep '^search ' "$stub" 2>/dev/null || true
echo 'options timeout:1 attempts:2')
[[ -n $was || "$(cat "$f")" != "$want" ]] || return 0
tmp=$(mktemp)
printf '%s\n' "$want" >"$tmp"
if ! { sudo install -m 644 "$tmp" "$f.devvm" && sudo mv -f "$f.devvm" "$f"; }; then
sudo rm -f "$f.devvm"
echo "devvm: couldn't write $f, so with transparent mode off a lookup in this VM may wait out its timeout" >&2
fi
rm -f "$tmp"
}
resolver_conf /etc/resolv.conf /run/systemd/resolve/stub-resolv.conf
# Transparent mode (transparent.sh, devvm-transparent) on a confined VM: every name resolves to the
# stand-in address, whose ports 80, 443 and those the rules name go to the proxy, which reads the host
# from the connection. The proxy URL, which holds the password, goes on stdin, never in arguments.
# Off on an open VM. An image from before transparent mode lacks its programs, so names don't resolve.
if [[ -n ${DEVVM_TRANSPARENT_ADDR:-} && -n ${DEVVM_PROXY:-} ]]; then
rc=0
printf '%s\n' "$DEVVM_PROXY" | sudo bash "$s/transparent.sh" setup "$DEVVM_TRANSPARENT_ADDR" "$DEVVM_TRANSPARENT_HOST" || rc=$?
if [[ $rc == 3 ]]; then
echo "devvm: this VM's image has no dnsmasq, socat or nft, so tools that skip the proxy can't resolve names in it; devvm update makes it again from a newer image" >&2
elif [[ $rc != 0 ]]; then
echo "devvm: transparent mode didn't start in this VM, so tools that skip the proxy can't resolve names in it; the next launch tries again" >&2
fi
else
sudo bash "$s/transparent.sh" teardown || true
fi
if command -v dockerd >/dev/null; then
docker_proxies ~/.docker/config.json
docker_proxies /root/.docker/config.json sudo
@@ -485,7 +665,7 @@ if [[ "$(cat /usr/local/bin/devvm-help 2>/dev/null)" != "$(printf '#!/bin/sh\nex
fi
# Tell agents why the network may fail, and what to do about it.
note="Network access in this VM goes through devvm's proxy, which allows what the VM's network tier allows. If a download or request fails with a connection error or a 403 from the proxy, run \`devvm-why\` to see what was blocked; the user can allow it on the host with \`devvm network allow <host>\`. A DNS or connection error for an allowed host while \`devvm-why\` shows nothing means the tool skipped the proxy: turn on its own proxy setting, or give it \`\$HTTPS_PROXY\`."
note="Network access in this VM goes through devvm's proxy, which allows what the VM's network tier allows. If a download or request fails with a connection error or a 403 from the proxy, run \`devvm-why\` to see what was blocked; the user can allow it on the host with \`devvm network allow <host>\`. A tool that ignores the proxy settings still reaches the proxy over HTTPS and HTTP, and on the ports the rules name, by the names it looks up (transparent mode). A connection refused on another port, or a DNS error where transparent mode is off, while \`devvm-why\` shows nothing blocked means the tool skipped the proxy: turn on its own proxy setting, or give it \`\$HTTPS_PROXY\`."
for f in ~/.claude/CLAUDE.md ~/.codex/AGENTS.md; do
[[ -d "$(dirname "$f")" ]] || continue
[[ -f "$f" ]] && sed -i '/^<!-- devvm-proxy -->/,/^<!-- \/devvm-proxy -->/d' "$f"
+493
View File
@@ -0,0 +1,493 @@
#!/bin/bash
# devvm-transparent: transparent mode, for tools that ignore the proxy settings on a confined VM.
# dnsmasq answers every name with the stand-in address (proxy.SentinelAddr, on lo) and nothing else,
# with no upstream, so no DNS query leaves the VM. nftables sends a connection to one of the
# stand-in address's ports (80, 443 and the ports the VM's allow rules name, from the proxy's
# /transparent/ports) to a socat listener on that address, which makes it an ordinary CONNECT to the
# VM's proxy with the VM's password, for the reserved target (proxy.TransparentHost) at that port.
# The proxy reads the host from the connection's first bytes and judges it as any CONNECT. Every
# other port of the address is refused at once, and DNS to a public server goes to dnsmasq too.
# None of it is a boundary: the host confines the VM to its proxy, whatever root here changes.
# devvm-transparent setup ADDR HOST < PROXY_URL root, sync.sh: install it all, start the service
# devvm-transparent teardown root, sync.sh: stop the service, remove it all
# devvm-transparent run the service: start and watch what it runs
# devvm-transparent down the service's stop: the table, the address, the children
# devvm-transparent status devvm-why, as root: whether it runs, refusals, names
# devvm-transparent render PORT=LISTEN... the ruleset for those ports and their listeners, and
# DEVVM_TRANSPARENT_RESOLVERS's name servers
# devvm-transparent slots PORT... each port's listener, keeping the ports that stay
# devvm-transparent valid FILE whether FILE is a port list the ruleset takes
# Exit 3 from setup: dnsmasq, socat or nft is missing (an image from before transparent mode).
set -u
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
tp=${DEVVM_TRANSPARENT_DIR:-/etc/devvm/transparent}
run_dir=/run/devvm-transparent
self=/usr/local/sbin/devvm-transparent
user=devvm-transparent
table=devvm_transparent
# The listeners' ports: 80's, 443's and 32 more, above Linux's ephemeral range (32768-60999), so no
# connection out or bind(0) is given one; dead has no listener, so what goes there is refused.
listen80=61080 listen443=61443 first_slot=61100 last_slot=61131 dead=61079
# The VM's own name servers the loaded ruleset sends to dnsmasq (apply).
resolvers=''
# load_env: addr, host, proxy_host and proxy_port from the env file setup wrote.
load_env() {
addr='' host='' proxy_host='' proxy_port=''
# shellcheck source=/dev/null
[[ -f $tp/env ]] && . "$tp/env"
[[ -n $addr && -n $host && -n $proxy_host && -n $proxy_port ]]
}
# valid_ports FILE: 2 to 34 lines, each a port from 1 to 65535 in digits, once, never 22 or 53, with
# 80 and 443 among them. Anything else from the proxy is kept out of the ruleset.
valid_ports() {
local p n=0 seen=' '
while IFS= read -r p; do
n=$((n + 1))
[[ $p =~ ^[1-9][0-9]{0,4}$ ]] && ((p <= 65535)) && [[ $p != 22 && $p != 53 && $seen != *" $p "* ]] || return 1
seen+="$p "
done <"$1"
((n >= 2 && n <= 34)) && [[ $seen == *' 80 '* && $seen == *' 443 '* ]]
}
# slots PORT...: "PORT LISTEN" for each port, 80 and 443 on their own listeners, the others each on
# the one the slots file gave it, while they stay, else on the lowest that's free.
slots() {
local p l used=' ' pending='' out=''
for p in "$@"; do
case $p in
80) out+="80 $listen80"$'\n' ;;
443) out+="443 $listen443"$'\n' ;;
*)
l=$(awk -v p="$p" '$1 == p { print $2; exit }' "$tp/slots" 2>/dev/null)
if [[ $l =~ ^[0-9]+$ ]] && ((l >= first_slot && l <= last_slot)) && [[ $used != *" $l "* ]]; then
used+="$l " out+="$p $l"$'\n'
else
pending+="$p "
fi
;;
esac
done
for p in $pending; do
for ((l = first_slot; l <= last_slot; l++)); do
[[ $used == *" $l "* ]] && continue
used+="$l " out+="$p $l"$'\n'
break
done
done
printf '%s' "$out"
}
# render PORT=LISTEN...: the ruleset, one transaction that replaces the table whole. Both NAT chains
# run before Docker's (dstnat, -100: priorities are numbers, which Debian 12's nft needs here) and
# give every TCP and UDP port of the stand-in address a
# mapping, so Docker's chains, which would send a published port's traffic to a container, never
# see one: a redirected port goes to its listener, DNS to dnsmasq, and every other port to the dead
# port, which refuses it at once. DNS to any public server goes to dnsmasq, and so does DNS to the
# VM's own name servers ($resolvers, own_resolvers), which Docker gives containers; loopback's other
# addresses, private, link-local and CGNAT ones are left as they are. 127.0.0.1:53 is where the
# VM's resolver asks (Lima's DNS setting): it goes to dnsmasq, which listens on the stand-in
# address alone, so nothing of transparent mode listens on loopback.
render() {
local pl r redirects='' own='' a=${addr:-198.18.0.1}
for pl in "$@"; do
redirects+=" ip daddr $a tcp dport ${pl%%=*} dnat ip to $a:${pl#*=}"$'\n'
done
for r in ${resolvers:-}; do own+="${own:+, }$r"; done
if [[ -n $own ]]; then
redirects+=" ip daddr { $own } udp dport 53 dnat ip to $a:53"$'\n'
redirects+=" ip daddr { $own } tcp dport 53 dnat ip to $a:53"$'\n'
fi
cat <<EOF
table inet $table
delete table inet $table
table inet $table {
set kept {
type ipv4_addr; flags interval
elements = { 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16, $a }
}
# Before every NAT chain (-150): the stand-in address takes only the VM's own and Docker's bridges,
# and only TCP, UDP and ICMP, so another bridge (Podman's, LXD's) or a protocol the NAT chains don't
# map (SCTP) never reaches Docker's DNAT of a published port through it.
chain early_in {
type filter hook prerouting priority -150; policy accept;
ip daddr $a iifname != "lo" iifname != "docker0" iifname != "br-*" drop
ip daddr $a meta l4proto != { tcp, udp, icmp } drop
}
chain early_out {
type filter hook output priority -150; policy accept;
ip daddr $a meta l4proto != { tcp, udp, icmp } drop
}
chain output {
type nat hook output priority -110; policy accept;
${redirects} jump sentinel
ip daddr 127.0.0.1 udp dport 53 dnat ip to $a:53
ip daddr 127.0.0.1 tcp dport 53 dnat ip to $a:53
ip daddr != @kept udp dport 53 dnat ip to $a:53
ip daddr != @kept tcp dport 53 dnat ip to $a:53
}
chain prerouting {
type nat hook prerouting priority -110; policy accept;
iifname "docker0" jump from_containers
iifname "br-*" jump from_containers
}
chain from_containers {
${redirects} jump sentinel
ip daddr != @kept udp dport 53 dnat ip to $a:53
ip daddr != @kept tcp dport 53 dnat ip to $a:53
}
# IPv6 returns first: in an inet table, ip daddr matches IPv4 alone, so an IPv6 packet would skip
# the next return and be logged as refused. The stand-in address is IPv4, and a connection to it
# from an IPv6 socket (::ffff:198.18.0.1) leaves as IPv4, so this opens no way to it.
chain sentinel {
meta nfproto != ipv4 return
ip daddr != $a return
udp dport 53 dnat ip to $a:53
tcp dport 53 dnat ip to $a:53
meta l4proto tcp limit rate 5/second log prefix "devvm-transparent refused: " level info
meta l4proto tcp dnat ip to $a:$dead
meta l4proto udp dnat ip to $a:$dead
}
chain input {
type filter hook input priority -10; policy accept;
ip daddr $a iifname != "lo" iifname != "docker0" iifname != "br-*" drop
ip daddr $a udp dport 53 accept
ip daddr $a tcp dport 53 accept
ip daddr $a ct status dnat accept
ip daddr $a meta l4proto tcp reject with tcp reset
ip daddr $a meta l4proto udp reject
}
}
EOF
}
# pairs: the ports file's ports as render takes them (slots), and the slots file written to match.
pairs() {
local p l list
# shellcheck disable=SC2046 # one port a line
list=$(slots $(cat "$tp/ports"))
printf '%s\n' "$list" >"$tp/slots.tmp" && mv "$tp/slots.tmp" "$tp/slots"
while read -r p l; do [[ -z $p ]] || printf '%s=%s ' "$p" "$l"; done <<<"$list"
}
# own_resolvers: the VM's own name servers but loopback's, which its resolver asks besides
# 127.0.0.1 (such as the one Lima's DHCP gives it) and which Docker gives containers: IPv4
# addresses from systemd-resolved's list and /etc/resolv.conf, each once, at most 8.
own_resolvers() {
local r seen=' ' n=0
while read -r r; do
[[ $r =~ ^[0-9]{1,3}(\.[0-9]{1,3}){3}$ && $r != 127.* && $r != "${addr:-198.18.0.1}" && $seen != *" $r "* ]] || continue
n=$((n + 1))
((n <= 8)) || break
seen+="$r "
echo "$r"
done < <(awk '$1 == "nameserver" { print $2 }' /run/systemd/resolve/resolv.conf /etc/resolv.conf 2>/dev/null)
}
# apply: the ruleset for the ports file's ports and the VM's own name servers as they are now, loaded
# whole.
apply() {
local f
resolvers=$(own_resolvers | tr '\n' ' ')
f=$(mktemp)
# shellcheck disable=SC2046 # PORT=LISTEN words
render $(pairs) >"$f"
nft -f "$f" || echo "devvm-transparent: nft didn't load the ruleset" >&2
rm -f "$f"
}
# alive PIDFILE NAME: the process in PIDFILE runs, and is NAME.
alive() {
local pid
pid=$(cat "$1" 2>/dev/null) || return 1
[[ -n $pid && "$(cat "/proc/$pid/comm" 2>/dev/null)" == "$2" ]]
}
# stop PIDFILE NAME: end the process in PIDFILE when it's NAME, and forget it.
stop() {
if alive "$1" "$2"; then kill "$(cat "$1")" 2>/dev/null; fi
rm -f "$1"
}
# search_domains: the domains the VM's resolver appends to a name without a dot (/etc/resolv.conf's
# search line, which Lima fills from this machine's network), each a DNS name, at most 6.
search_domains() {
local d n=0
while read -r d; do
d=${d%.}
[[ $d =~ ^[A-Za-z0-9]([A-Za-z0-9.-]{0,252}[A-Za-z0-9])?$ ]] || continue
n=$((n + 1))
((n <= 6)) || break
echo "$d"
done < <(awk '$1 == "search" { for (i = 2; i <= NF; i++) print $i }' /etc/resolv.conf 2>/dev/null)
}
# start_dnsmasq: dnsmasq, with no answer for the names under the search domains: so a name without
# a dot that isn't in /etc/hosts doesn't resolve, as it doesn't to the stand-in address either
# (address=//), rather than turning into one of this machine's network's names.
start_dnsmasq() {
local d args=()
for d in $(search_domains); do args+=("--address=/$d/"); done
dnsmasq --keep-in-foreground --conf-file="$tp/dnsmasq.conf" ${args[@]+"${args[@]}"} &
echo "$!" >"$run_dir/dnsmasq.pid"
}
# start_socat PORT LISTEN: the listener for PORT on the stand-in address's LISTEN.
start_socat() {
socat "TCP4-LISTEN:$2,bind=$addr,reuseaddr,fork,max-children=256,backlog=256,su=$user" \
"PROXY:$proxy_host:$host:$1,proxyport=$proxy_port,proxyauthfile=$tp/auth,connect-timeout=10" &
echo "$!" >"$run_dir/socat-$1.pid"
}
# listeners: start what isn't running, the listeners of the slots file's ports, and stop those whose
# port is gone.
listeners() {
local f p l
alive "$run_dir/dnsmasq.pid" dnsmasq || start_dnsmasq
for f in "$run_dir"/socat-*.pid; do
[[ -e $f ]] || continue
p=${f##*/socat-} p=${p%.pid}
grep -q "^$p " "$tp/slots" || stop "$f" socat
done
while read -r p l; do
[[ -z $p ]] || alive "$run_dir/socat-$p.pid" socat || start_socat "$p" "$l"
done <"$tp/slots"
}
# fetch: the proxy's port list, into the ports file when it's valid and has changed (0), else 1.
fetch() {
local f
f=$(mktemp)
if curl -sSf --max-time 5 -K "$tp/curlrc" -o "$f" http://devvm.proxy/transparent/ports 2>/dev/null &&
valid_ports "$f" && ! cmp -s "$f" "$tp/ports"; then
mv "$f" "$tp/ports"
return 0
fi
rm -f "$f"
return 1
}
run() {
load_env || { echo "devvm-transparent: no $tp/env" >&2; exit 1; }
mkdir -p "$run_dir" && chmod 700 "$run_dir"
[[ -s $tp/ports ]] && valid_ports "$tp/ports" || printf '80\n443\n' >"$tp/ports"
down_children
ip -4 addr show dev lo | grep -q " $addr/32 " || ip addr add "$addr/32" dev lo
apply
trap 'down; exit 0' TERM INT
local tick=0 hosts_at
hosts_at=$(stat -c %Y /etc/hosts 2>/dev/null)
listeners
touch "$run_dir/ready"
while :; do
sleep 1 &
wait $!
listeners
if [[ "$(stat -c %Y /etc/hosts 2>/dev/null)" != "$hosts_at" ]]; then
hosts_at=$(stat -c %Y /etc/hosts 2>/dev/null)
[[ ! -f $run_dir/dnsmasq.pid ]] || kill -HUP "$(cat "$run_dir/dnsmasq.pid")" 2>/dev/null
fi
# A launch's setup fetched new ports (reload); every tenth second, the proxy's ports, the VM's
# own name servers, and the table back if something removed it (nft flush ruleset).
tick=$(((tick + 1) % 10))
if [[ -e $run_dir/reload ]] || { ((tick == 0)) && { fetch || [[ "$(own_resolvers | tr '\n' ' ')" != "$resolvers" ]] ||
! nft list table inet "$table" >/dev/null 2>&1; }; }; then
rm -f "$run_dir/reload"
apply
listeners
fi
done
}
# down_children: stop every child a supervisor recorded, this one's or one that died.
down_children() {
local f
for f in "$run_dir"/socat-*.pid; do [[ ! -e $f ]] || stop "$f" socat; done
stop "$run_dir/dnsmasq.pid" dnsmasq
}
down() {
load_env || addr=198.18.0.1
down_children
rm -f "$run_dir/ready"
nft delete table inet "$table" 2>/dev/null
ip addr del "$addr/32" dev lo 2>/dev/null
return 0
}
systemd=false
[[ -d /run/systemd/system ]] && systemd=true
# put FILE MODE OWNER: FILE from stdin, written only when it differs; 0 when it changed.
put() {
local tmp
tmp=$(mktemp)
cat >"$tmp"
if cmp -s "$tmp" "$1"; then
rm -f "$tmp"
return 1
fi
install -m "$2" -o root -g "$3" "$tmp" "$1"
rm -f "$tmp"
}
# dnsmasq_conf: dnsmasq's settings, read with --conf-file, so /etc/dnsmasq.conf and /etc/dnsmasq.d
# aren't. Every name's A record is the stand-in address, with TTL 0, and every other type is an empty
# answer, never REFUSED, which musl waits 5 s on. /etc/hosts comes first: localhost, the VM's
# hostname, host.lima.internal and the links' names keep their own addresses. A name without a dot,
# and any other name under devvm.internal, doesn't exist.
dnsmasq_conf() {
cat <<EOF
# devvm: names for tools that skip the proxy (devvm-transparent). No upstream: nothing leaves the VM.
port=53
listen-address=$addr
bind-interfaces
no-resolv
no-poll
pid-file=
user=$user
group=$user
address=/#/$addr
local=/#/
address=/localhost/127.0.0.1
address=/localhost/::1
address=/devvm.internal/
address=//
log-queries
EOF
# systemd's journal keeps stderr; OpenRC's service doesn't, so there it's syslog.
! $systemd || echo 'log-facility=-'
}
unit() {
cat <<'EOF'
[Unit]
Description=devvm: names and connections for tools that skip the proxy
After=network.target systemd-resolved.service
ConditionPathExists=/etc/devvm/transparent/env
[Service]
Type=simple
ExecStart=/usr/local/sbin/devvm-transparent run
ExecStopPost=/usr/local/sbin/devvm-transparent down
Restart=always
RestartSec=1
KillMode=control-group
[Install]
WantedBy=multi-user.target
EOF
}
openrc() {
cat <<'EOF'
#!/sbin/openrc-run
description="devvm: names and connections for tools that skip the proxy"
supervisor=supervise-daemon
command=/usr/local/sbin/devvm-transparent
command_args=run
respawn_delay=1
respawn_max=0
depend() { need net localmount; after firewall; }
start_pre() { [ -f /etc/devvm/transparent/env ]; }
stop_post() { /usr/local/sbin/devvm-transparent down; }
EOF
}
setup() {
addr=$1 host=$2
local url hp auth changed=false svc
for p in dnsmasq socat nft; do command -v "$p" >/dev/null || exit 3; done
IFS= read -r url
hp=${url#http://} auth=''
if [[ $hp == *@* ]]; then auth=${hp%%@*} hp=${hp#*@}; fi
proxy_host=${hp%:*} proxy_port=${hp##*:}
proxy_port=${proxy_port%%/*}
# The user dnsmasq and socat's connections run as: shadow's tools, else busybox's.
grep -q "^$user:" /etc/group || groupadd --system "$user" 2>/dev/null || addgroup -S "$user"
grep -q "^$user:" /etc/passwd || useradd --system --no-create-home --home-dir /nonexistent --shell /sbin/nologin -g "$user" "$user" 2>/dev/null ||
adduser -S -D -H -h /nonexistent -s /sbin/nologin -G "$user" "$user"
install -d -m 755 "$tp"
printf 'addr=%s\nhost=%s\nproxy_host=%s\nproxy_port=%s\n' "$addr" "$host" "$proxy_host" "$proxy_port" | put "$tp/env" 644 root && changed=true
printf '%s' "$auth" | put "$tp/auth" 640 "$user" && changed=true
printf 'proxy = "http://%s:%s"\nproxy-user = "%s"\nnoproxy = ""\n' "$proxy_host" "$proxy_port" "$auth" | put "$tp/curlrc" 600 root || true
dnsmasq_conf | put "$tp/dnsmasq.conf" 644 root && changed=true
put "$self" 755 root <"$0" && changed=true
if $systemd; then
svc=/etc/systemd/system/devvm-transparent.service
unit | put "$svc" 644 root && { changed=true; systemctl daemon-reload; }
systemctl enable devvm-transparent.service >/dev/null 2>&1
else
openrc | put /etc/init.d/devvm-transparent 755 root && changed=true
rc-update add devvm-transparent default >/dev/null 2>&1
fi
# The ports now, so the first shell has them, which a running service takes at once (reload); else
# the last ones, else 80 and 443.
if fetch; then
mkdir -p "$run_dir" && chmod 700 "$run_dir" && touch "$run_dir/reload"
fi
[[ -s $tp/ports ]] || printf '80\n443\n' >"$tp/ports"
if $changed; then
rm -f "$run_dir/ready"
if $systemd; then systemctl restart devvm-transparent; else rc-service devvm-transparent restart >/dev/null; fi
elif $systemd; then
systemctl start devvm-transparent
else
rc-service devvm-transparent status >/dev/null 2>&1 || rc-service devvm-transparent start >/dev/null
fi
local i=0
until [[ -e $run_dir/ready && ! -e $run_dir/reload ]]; do
i=$((i + 1))
((i <= 100)) || { echo "devvm-transparent: the service didn't start" >&2; return 1; }
sleep 0.1
done
}
teardown() {
[[ -e $self || -e $tp ]] || return 0
if $systemd; then
systemctl disable --now devvm-transparent.service >/dev/null 2>&1
rm -f /etc/systemd/system/devvm-transparent.service
systemctl daemon-reload
else
rc-service devvm-transparent stop >/dev/null 2>&1
rc-update del devvm-transparent default >/dev/null 2>&1
rm -f /etc/init.d/devvm-transparent
fi
down
rm -rf "$tp" "$run_dir" "$self"
! $systemd || resolvectl flush-caches 2>/dev/null
return 0
}
status() {
local ports
if [[ -e $run_dir/ready ]]; then
ports=$(tr '\n' ' ' <"$tp/ports" 2>/dev/null)
echo "Transparent mode: on, for ports ${ports% }; other ports are refused."
else
echo "Transparent mode: not running."
return 0
fi
echo "Refused lately (a port devvm doesn't send to the proxy):"
if $systemd; then
journalctl -k -n 1000 -o short-iso --no-pager 2>/dev/null | grep 'devvm-transparent refused: ' | tail -10 |
sed -E 's/^([^ ]+).* DPT=([0-9]+).*/ \2 at \1/'
else
dmesg 2>/dev/null | grep 'devvm-transparent refused: ' | tail -10 | sed -E 's/.* DPT=([0-9]+).*/ \1/'
fi
echo "Names looked up lately:"
{ if $systemd; then journalctl -u devvm-transparent -n 1000 -o cat --no-pager 2>/dev/null; else cat /var/log/messages 2>/dev/null; fi; } |
grep -oE 'query\[A\] [^ ]+' | awk '{ print " " $2 }' | tail -10
}
case ${1:-} in
setup) shift; setup "$@" ;;
teardown) teardown ;;
run) run ;;
down) down ;;
status) status ;;
render) shift; resolvers=${DEVVM_TRANSPARENT_RESOLVERS:-}; render "$@" ;;
slots) shift; slots "$@" ;;
valid) valid_ports "${2:?}" ;;
*) grep '^# devvm-transparent ' "$0" >&2; exit 2 ;;
esac
+51 -22
View File
@@ -4,37 +4,53 @@
set -euxo pipefail
: "${devvm_arch:?}" "${devvm_libc:?}" # devvm's prelude (prelude.sh) comes before this script
# Pinned downloads (scripts/bump.sh updates them).
mise_version=2026.10.7
mise_sha256_arm64=c7108d85a32ba17e4747d31d4a42f39f0c134f16211e204e8ef0a49d4f518fe1
mise_sha256_amd64=6eb1b890e90818417ca34c90dbbd47881917d5cd199f31b63b062ea9c6b18d85
mise_sha256_arm64_musl=e036eb7bd3ca63e8565497e597967484330a74ff24e9c4c9f2ac41824cbf4090
mise_sha256_amd64_musl=fc5137a3147494e039c3d5fc3d84de354170d7d8dafdb0b5f0b6f3f19d1dd922
mise_version=2026.11.10
mise_sha256_arm64=86ef275d541c5243cd20b1c0fcd16810e5f3601113d8db09278d0608617a3833
mise_sha256_amd64=b603a4f48563fc379a794d9ea2cf9f709ed276c9141068604cb0c59fa3e674a9
mise_sha256_arm64_musl=d33f9febe2bfd13213f7fe23ba43fffe133b37737d970680c2aeba66366ff9c2
mise_sha256_amd64_musl=ae1f7752483862f46f6eb0ffa58d3bdec8d5af8da78d98b0df477466747cba2b
git_lfs_version=3.8.1
git_lfs_sha256_arm64=67895dd77b63329796bc5efdd47b57f218e1f7b98717ebaf936a8238dbcaec0f
git_lfs_sha256_amd64=e72cf723a4a660438862282e8aecf3885fc8123e88bfcad534cf6b941a354b75
export DEBIAN_FRONTEND=noninteractive
# Alpine (--from alpine): apk, OpenRC and musl. Its packages come from the release's repositories,
# which have no snapshots: they aren't pinned.
if [[ $devvm_libc == musl ]]; then
# GNU tar: devvm's launch sends files with it (busybox's lacks options it uses). sqlite: an export
# of agents' history copies opencode's database without its logins with it.
# of agents' history copies opencode's database without its logins with it. icu-libs: the dotnet
# shared tool's .NET needs ICU. fd: the pi shared tool finds files with it, and downloads it
# itself, unpinned, where it's missing. dnsmasq, socat and nftables: transparent mode
# (guest/transparent.sh), whose service only a confined VM's setup enables.
sudo apk add --no-cache git curl wget ca-certificates build-base unzip jq ripgrep bash coreutils tar \
util-linux util-linux-misc losetup findmnt erofs-utils sqlite
util-linux util-linux-misc losetup findmnt erofs-utils sqlite icu-libs fd dnsmasq socat nftables
echo "devvm: Alpine's packages aren't pinned" >&2
else
# The package lists are apt.sh begin's: base's packages are recorded at its first build and replayed
# from devvm's cache after (layers/apt.sh), and a --from image's come from its own sources, unpinned.
# erofs-utils: the shared tools' builds make their images with it, in a VM cloned from base. sqlite3:
# an export of agents' history copies opencode's database without its logins with it.
sudo apt-get install -y git curl wget ca-certificates build-essential unzip jq ripgrep erofs-utils sqlite3
# an export of agents' history copies opencode's database without its logins with it. ICU: the dotnet
# shared tool's .NET needs it, and its package's name has its version (libicu76), so it's the newest
# libicuN the package lists have (a replay's lists have only the one recorded). fd-find (fdfind): the
# pi shared tool finds files with it, and downloads fd itself, unpinned, where it's missing.
# dnsmasq-base (dnsmasq alone, no service of its own), socat and nftables: transparent mode
# (guest/transparent.sh), whose service only a confined VM's setup enables.
icu=$(apt-cache pkgnames libicu | grep -E '^libicu[0-9]+$' | sort -V | tail -1 || true)
sudo apt-get install -y git curl wget ca-certificates build-essential unzip jq ripgrep erofs-utils sqlite3 fd-find \
dnsmasq-base socat nftables ${icu:+"$icu"}
fi
# devvm-fetch URL SHA256 OUT: every layer downloads through this, so an image only ever contains
# files whose checksums are pinned in devvm's scripts.
# files whose checksums are pinned in devvm's scripts. A SHA-512 (128 hex digits) is checked as one:
# the shared tools' build gets the .NET SDK's from the tools lock.
sudo tee /usr/local/bin/devvm-fetch >/dev/null <<'SH'
#!/bin/sh
set -eu
url=$1 want=$2 out=$3
curl -fsSL --retry 3 -o "$out" "$url"
got=$(sha256sum "$out" | cut -d' ' -f1)
sum=sha256sum
[ "${#want}" -ne 128 ] || sum=sha512sum
got=$("$sum" "$out" | cut -d' ' -f1)
if [ "$got" != "$want" ]; then
rm -f "$out"
printf 'devvm-fetch: checksum mismatch for %s\n expected %s\n got %s\n' "$url" "$want" "$got" >&2
@@ -70,7 +86,7 @@ fi
mkdir -p ~/.bashrc.d
grep -qs bashrc.d ~/.bashrc || echo 'for f in ~/.bashrc.d/*.sh; do [ -r "$f" ] && . "$f"; done' >> ~/.bashrc
# mise runs the shared tools (node, python, go, rust, agents), read-only images mounted at
# mise runs the shared tools (the toolchains and the coding agents), read-only images mounted at
# /opt/devvm/tools by devvm-tools (guest/tools.sh). Each VM's tools and versions are in
# /etc/mise/config.toml (written by guest/sync.sh); the user's own mise config and a project's version
# files (.nvmrc, .python-version, ...) come first, and versions that aren't shared install into the VM.
@@ -79,18 +95,33 @@ m=${devvm_arch/amd64/x64}; [[ $devvm_libc == gnu ]] || m+=-musl
devvm-fetch "https://github.com/jdx/mise/releases/download/v$mise_version/mise-v$mise_version-linux-$m" "$(devvm_sha mise)" /tmp/mise
sudo install -m 755 /tmp/mise /usr/local/bin/mise
rm /tmp/mise
# git-lfs: a --clone VM's clone of a repo that uses Git LFS gets the repo's LFS objects, and git there
# checks out each LFS file's content through git-lfs's filter, which the copy sets in that clone's own
# config, never the system's, so a VM that mounts its folder keeps the pointers as they are. One static
# build for glibc and musl.
devvm-fetch "https://github.com/git-lfs/git-lfs/releases/download/v$git_lfs_version/git-lfs-linux-$devvm_arch-v$git_lfs_version.tar.gz" \
"$(devvm_sha git_lfs)" /tmp/git-lfs.tar.gz
tar -xzf /tmp/git-lfs.tar.gz -C /tmp "git-lfs-$git_lfs_version/git-lfs"
sudo install -m 755 "/tmp/git-lfs-$git_lfs_version/git-lfs" /usr/local/bin/git-lfs
rm -rf /tmp/git-lfs.tar.gz "/tmp/git-lfs-$git_lfs_version"
# Every shell finds the tools: login shells through profile.d, interactive ones through mise activate
# (it follows `cd` into projects with other versions), and the rest (`bash -c` from agents, editors
# over SSH) through BASH_ENV and mise's shims. Read-only installs can't take global packages or update
# themselves: npm installs globals into ~/.npm-global, and Claude Code's and opencode's auto-updates
# are off.
# themselves, so global installs go into the VM's home, on the PATH, and the coding agents'
# self-updates are off. The toolchains' environment and their folders for the PATH (devvm_path), and
# the agents', come from /etc/devvm/toolchains.sh and /etc/devvm/agents.sh, which every launch's setup
# writes from devvm's registries, so a new toolchain or agent changes no image. Their telemetry and
# version checks are off here rather than in devvm-telemetry.sh, so a tool that a non-login shell runs
# (ssh VM pi, an editor's terminal) sends none either.
sudo tee /etc/profile.d/devvm-tools.sh >/dev/null <<'SH'
devvm_path=
if [ -r /etc/devvm/toolchains.sh ]; then . /etc/devvm/toolchains.sh; fi
case ":$PATH:" in *":$HOME/.local/share/mise/shims:"*) ;; *)
export PATH="$HOME/.npm-global/bin:$HOME/go/bin:$HOME/.cargo/bin:$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH" ;;
export PATH="$devvm_path$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH" ;;
esac
export NPM_CONFIG_PREFIX="$HOME/.npm-global"
export DISABLE_AUTOUPDATER=1
export OPENCODE_DISABLE_AUTOUPDATE=1
unset devvm_path
if [ -r /etc/devvm/agents.sh ]; then . /etc/devvm/agents.sh; fi
SH
grep -qs devvm-tools /etc/environment || echo 'BASH_ENV=/etc/profile.d/devvm-tools.sh' | sudo tee -a /etc/environment >/dev/null
echo 'eval "$(mise activate bash)"' > ~/.bashrc.d/mise.sh
@@ -129,11 +160,10 @@ SH
sudo chmod 755 /usr/local/bin/xdg-open
echo 'export BROWSER=xdg-open' | sudo tee /etc/profile.d/devvm-browser.sh >/dev/null
# Telemetry off for every tool that has a switch (installed by devvm or commonly by projects).
# Telemetry off for every tool that has a switch (installed by devvm or commonly by projects), but
# the toolchains' and the coding agents', which devvm-tools.sh turns off in every shell.
sudo tee /etc/profile.d/devvm-telemetry.sh >/dev/null <<'SH'
export DO_NOT_TRACK=1 # generic opt-out (bun and others)
export DISABLE_TELEMETRY=1 # Claude Code
export DISABLE_ERROR_REPORTING=1 # Claude Code
export NEXT_TELEMETRY_DISABLED=1
export TURBO_TELEMETRY_DISABLED=1
export ASTRO_TELEMETRY_DISABLED=1
@@ -141,7 +171,6 @@ export NUXT_TELEMETRY_DISABLED=1
export GATSBY_TELEMETRY_DISABLED=1
export STORYBOOK_DISABLE_TELEMETRY=1
export YARN_ENABLE_TELEMETRY=0
export DOTNET_CLI_TELEMETRY_OPTOUT=1
SH
# Ubuntu: no news fetched for the login banner or apt output.
sudo sed -i 's/^ENABLED=1/ENABLED=0/' /etc/default/motd-news 2>/dev/null || true
+5 -5
View File
@@ -5,11 +5,11 @@ set -euxo pipefail
: "${devvm_libc:?}" # devvm's prelude (prelude.sh) comes before this script
# Pinned downloads (scripts/bump.sh updates them). Docker's repository has no snapshots: its packages
# are pinned by version.
docker_version=29.9.0
containerd_version=2.4.1
buildx_version=0.38.0
compose_version=5.6.0
model_version=1.2.6
docker_version=29.10.0
containerd_version=2.4.2
buildx_version=0.39.0
compose_version=5.8.0
model_version=1.2.9
docker_gpg_sha256=1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570
# Alpine (--from alpine): Docker is Alpine's own package, from the release's repositories, which have
+3 -3
View File
@@ -7,9 +7,9 @@ set -euxo pipefail
: "${devvm_arch:?}" "${devvm_libc:?}" # devvm's prelude (prelude.sh) comes before this script
# Pinned downloads (scripts/bump.sh updates them). Nix's release tarball, with its own installer;
# nix-direnv is one script, the same on every architecture.
nix_version=2.35.4
nix_sha256_arm64=14a940a2d0ae5b2c623dc2ca168311c9367fd4bc416f6ded0c1087089d6de934
nix_sha256_amd64=ff66236d2f7e2a21f3350e73668e021ac6a8881ef277a38e16e952bfb22718c3
nix_version=2.35.6
nix_sha256_arm64=1f177b572baadf8c09750028f047fe943a3615a34f3e4a43927367a1e0120801
nix_sha256_amd64=b12ab64a291e41846b9da37b7f56eafa7683deaa267bafb2ed43440ab2f45f13
direnv_version=2.38.2
direnv_sha256_arm64=ec2a32dbe2f19dd085bd9315a1b4ea88b55ec288aa7eabe8723490baf466cb23
direnv_sha256_amd64=148820a187930d36ca6a204504e5cdb30d8396cd1a97e64c3b3f10d793c11247
+24 -6
View File
@@ -4,6 +4,7 @@
# (~/.local/share/devvm/mise.lock) in its .build folder. Each tool gets a VM and a folder of its own,
# so nothing one tool's installer does, as root or not, reaches another tool's image.
# build.sh TOOL VERSION FILE
# build.sh dotnet VERSION FILE URL SHA512
# The tool is installed at exactly the locked version (checked against the lock's checksums), then
# packed into one compressed read-only EROFS image, FILE in that folder; devvm moves it into the share
# and records its hash. Project VMs mount it at /opt/devvm/tools/<tool>/<version>, where mise finds it
@@ -14,11 +15,11 @@ set -euxo pipefail
: "${devvm_arch:?}" "${devvm_libc:?}" # devvm's prelude (prelude.sh) comes before this script
# Pinned downloads (scripts/bump.sh updates them). rustup checks the toolchain against Rust's signed
# channel manifest.
rustup_version=1.29.1
rustup_sha256_arm64=15f6e4ce9f583b929c996c91562bad6d4454f3281de858b02cdfdef615fac433
rustup_sha256_amd64=dda7234360b7f578ca8b0ddcb80145646fa61a67c1720a5abc7051b35c9fcb71
rustup_sha256_arm64_musl=1ddf36182ac5d1782dbeefcb9bea7f5f9412d88f4a0d5047b1564a223624e8c6
rustup_sha256_amd64_musl=331228566cc931f32cd684f9bebc5956a5e5d7394c8d5de595f196a658ab98e6
rustup_version=1.29.3
rustup_sha256_arm64=9f608c142e0e38a78957d0661ba1dfaf0b6fb37184cfaa4b9a0aa57af6184282
rustup_sha256_amd64=b1c8cb14e30889e7e2999e6b69e62d9e9b9ffc0f4df8180564d306d9680e6c55
rustup_sha256_arm64_musl=956deacdc27ab82ae7ac821d5d3e9e95e4795d476d17efe99743bb8531ca1031
rustup_sha256_amd64_musl=1552169aba2836777136ccff7a381e95c17233b5d8250cd5e10ae3cb971bfcfc
share=/mnt/devvm-tools
# Where VMs mount the tools: installs record absolute paths (mise's bin links, scripts' shebangs).
@@ -57,7 +58,8 @@ glibc_needs() {
rm -f "$files" "$elf"
}
[[ $devvm_libc != gnu ]] || command -v readelf >/dev/null || { echo "build.sh: base has no readelf (binutils)" >&2; exit 1; }
(( $# == 3 )) || { echo "build.sh: wants TOOL VERSION FILE, got $# arguments" >&2; exit 2; }
(( $# == 3 )) || [[ $# == 5 && $1 == dotnet ]] ||
{ echo "build.sh: wants TOOL VERSION FILE (dotnet: and URL SHA512), got $# arguments" >&2; exit 2; }
tool=$1 version=$2 file=$3
wait_share
@@ -75,6 +77,22 @@ if [[ $tool == rust ]]; then
RUSTUP_HOME=$work/rustup CARGO_HOME=$work/cargo "$dir/rustup-init" -y -q --no-modify-path \
--profile default --default-toolchain "$version" -c rust-src -c rust-analyzer
mv "$work/rustup/toolchains/$version-$triple" "$dir/toolchain"
elif [[ $tool == dotnet ]]; then
# Microsoft's SDK archive, the lock's download for this platform, which devvm passes with the
# SHA-512 the lock records for it: mise's own installer runs Microsoft's install script, which
# checks nothing.
[[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ && $# == 5 ]] || { echo "build.sh: dotnet wants a release's VERSION, URL and SHA512" >&2; exit 2; }
dir=$work/dotnet/$version; mkdir -p "$dir"
devvm-fetch "$4" "$5" /tmp/dotnet-sdk.tar.gz
tar -xzf /tmp/dotnet-sdk.tar.gz -C "$dir"
rm /tmp/dotnet-sdk.tar.gz
sdks=$("$dir/dotnet" --list-sdks)
[[ $sdks == "$version "* ]] || { echo "build.sh: the archive has another SDK than $version: $sdks" >&2; exit 1; }
# Workloads install into the user's ~/.dotnet, which the SDK does when its folder has this marker
# for its feature band (10.0.400 for 10.0.403): the SDK's own folder is read-only in VMs.
band=${version%.*}.$(( ${version##*.} / 100 * 100 ))
mkdir -p "$dir/metadata/workloads/$band"
touch "$dir/metadata/workloads/$band/userlocal"
else
# By name: mise resolves mise.toml's version through the lock (an explicit tool@version isn't
# matched to the lock's entry).
+12
View File
@@ -0,0 +1,12 @@
# cursor: its API, where its login polls too (api2), its agent's hosts, which api2's server config
# names (agent.api5 and its regional hosts, which its package doesn't name, so all of them), and its
# codebase indexing (repo42). Its metrics host (api3), its updates (downloads.cursor.com) and Sentry are
# left out: blocking them costs nothing, and its updates are off.
api2.cursor.sh
api5.cursor.sh
*.api5.cursor.sh
repo42.cursor.sh
# The host Cursor documents for Tab requests; Cursor's CLI uses it for its metrics, its
# MetricsService's reports, fire and forget (the metricsUrl in the 2026.11.17 package's
# service-urls, read, not run): https://cursor.com/docs/enterprise/network-configuration
quiet api3.cursor.sh
+10
View File
@@ -0,0 +1,10 @@
# dotnet: NuGet's packages and tools, and the revocation lists of DigiCert, which issues NuGet's
# signing certificates, that NuGet checks each package's signatures against, with DigiCert's OCSP
# responder, which it asks when a list can't be fetched; the SDKs mise installs for a
# global.json's version (the install script at dot.net, the SDK's archive). Microsoft's telemetry
# is left out.
api.nuget.org
crl3.digicert.com:80
ocsp.digicert.com:80
dot.net
builds.dotnet.microsoft.com
+2
View File
@@ -3,3 +3,5 @@ proxy.golang.org
sum.golang.org
go.dev
dl.google.com
# Go's telemetry uploads, which every VM turns off: https://go.dev/doc/telemetry
quiet telemetry.go.dev
+21 -1
View File
@@ -1,6 +1,21 @@
# The shared tools (the docs' images page, "Shared tools"). devvm resolves each, per user, to upstream's newest
# release matching its version here, into ~/.local/share/devvm/mise.lock with each download's checksum
# per platform. A version here is a hold (node = "24"); nothing is pinned.
# per platform. A version here is a hold (node = "24"), but for cursor, which publishes neither a
# version list nor checksums: devvm pins its release and each platform's SHA-256 here, and the lock
# takes them as they are.
# Where each tool that isn't one of mise's own (core:) comes from, named here so that mise's registry
# can't move it to another source: its first choice can change between mise releases (opencode 2
# moved to npm, which has no download per platform). VMs' mise gets the same list.
[tool_alias]
claude = "aqua:anthropics/claude-code"
codex = "aqua:openai/codex"
opencode = "github:anomalyco/opencode" # its GitHub releases: a musl build of its own, attested
pi = "github:earendil-works/pi" # its GitHub releases: one Bun-built program per platform, glibc only
cursor = "http:cursor" # Cursor's CLI package: its bundled node and programs, glibc only
pnpm = "aqua:pnpm/pnpm"
uv = "aqua:astral-sh/uv"
[tools]
node = "24" # Node 25+ drops corepack
pnpm = "latest"
@@ -9,9 +24,14 @@ python = "latest"
uv = "latest"
go = "latest"
rust = "latest" # installed with the rustup pinned in build.sh; rustup checks the toolchain
dotnet = "latest" # the SDK; devvm adds its downloads and their SHA-512 from Microsoft's releases
claude = "latest"
codex = "latest"
opencode = "2" # upstream marks its 1.x releases as GitHub's latest, which "latest" resolves to
pi = "latest"
# The address and checksums are those of the package Cursor's install script (cursor.com/install) fetches for
# this version; the musl platforms get the same, which their VMs refuse (glibc only).
cursor = { version = "2026.11.17-f532c45", platforms = { linux-x64 = { url = "https://downloads.cursor.com/lab/2026.11.17-f532c45/linux/x64/agent-cli-package.tar.gz", checksum = "sha256:189ed41d8963cd22dcdafbbd62f072cc55ac08374c922dbd04aee525f4018ab6" }, linux-arm64 = { url = "https://downloads.cursor.com/lab/2026.11.17-f532c45/linux/arm64/agent-cli-package.tar.gz", checksum = "sha256:dff929e5e5ace2ced880290095df5938545267d73fd1d84be669be75dbdc1558" } } }
[settings]
experimental = true
+4
View File
@@ -0,0 +1,4 @@
# pi: its model catalog. Its version check and install report go to the same host, and every VM turns
# them off (PI_SKIP_VERSION_CHECK, PI_TELEMETRY). Add your model provider's API host
# (e.g. api.anthropic.com, api.openai.com) with `devvm network allow`.
pi.dev
+159
View File
@@ -0,0 +1,159 @@
package assets
import (
"io/fs"
"os"
"os/exec"
"path/filepath"
"slices"
"strconv"
"strings"
"testing"
)
// bashes are the shells guest/transparent.sh's test runs it with: bash on
// the PATH, and macOS's /bin/bash, which is 3.2, as in-VM scripts must
// run on.
func bashes(t *testing.T) []string {
t.Helper()
var out []string
if p, err := exec.LookPath("bash"); err == nil {
out = append(out, p)
}
if _, err := os.Stat("/bin/bash"); err == nil && !slices.Contains(out, "/bin/bash") {
out = append(out, "/bin/bash")
}
if len(out) == 0 {
t.Skip("no bash")
}
return out
}
// transparentScript writes guest/transparent.sh into a folder of the
// test's own, and returns its path and the folder, its files' folder.
func transparentScript(t *testing.T) (string, string) {
t.Helper()
b, err := fs.ReadFile(FS, "guest/transparent.sh")
must(t, err)
dir := t.TempDir()
f := filepath.Join(dir, "transparent.sh")
must(t, os.WriteFile(f, b, 0o600))
return f, dir
}
// runTransparent runs the script with bash and args, its files in dir,
// and returns its output and whether it succeeded.
func runTransparent(t *testing.T, bash, script, dir string, args ...string) (string, bool) {
t.Helper()
cmd := exec.CommandContext(t.Context(), bash, append([]string{script}, args...)...) //nolint:gosec // G204: devvm's own embedded script, with the test's arguments
cmd.Env = append(os.Environ(), "DEVVM_TRANSPARENT_DIR="+dir, "DEVVM_TRANSPARENT_RESOLVERS=192.168.5.2 10.0.2.3")
out, err := cmd.Output()
return string(out), err == nil
}
// The ruleset: each redirected port to its listener, every other port of
// the stand-in address to the dead port (so Docker's published ports never
// take it), DNS to public servers and 127.0.0.1 to dnsmasq, private ones
// left alone, and nftables takes it where it can be asked.
func TestTransparentRuleset(t *testing.T) {
script, dir := transparentScript(t)
for _, bash := range bashes(t) {
out, ok := runTransparent(t, bash, script, dir, "render", "80=61080", "443=61443", "8443=61100")
if !ok {
t.Fatalf("%s: render failed:\n%s", bash, out)
}
for _, want := range []string{
"ip daddr 198.18.0.1 tcp dport 80 dnat ip to 198.18.0.1:61080",
"ip daddr 198.18.0.1 tcp dport 8443 dnat ip to 198.18.0.1:61100",
"meta l4proto tcp dnat ip to 198.18.0.1:61079",
"meta l4proto udp dnat ip to 198.18.0.1:61079",
"udp dport 53 dnat ip to 198.18.0.1:53",
"ip daddr 127.0.0.1 tcp dport 53 dnat ip to 198.18.0.1:53",
"ip daddr != @kept udp dport 53 dnat ip to 198.18.0.1:53",
"ip daddr { 192.168.5.2, 10.0.2.3 } tcp dport 53 dnat ip to 198.18.0.1:53",
"10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16",
"type nat hook output priority -110;",
"type nat hook prerouting priority -110;",
`iifname "br-*" jump from_containers`,
"type filter hook prerouting priority -150;",
"type filter hook output priority -150;",
`ip daddr 198.18.0.1 iifname != "lo" iifname != "docker0" iifname != "br-*" drop`,
"ip daddr 198.18.0.1 meta l4proto != { tcp, udp, icmp } drop",
} {
if !strings.Contains(out, want) {
t.Errorf("%s: the ruleset lacks %q:\n%s", bash, want, out)
}
}
// IPv6 leaves the sentinel before anything else: an inet table's
// ip daddr matches IPv4 alone, so an IPv6 connection would get past
// the address's return and be logged as refused. The log is the
// sentinel's alone.
if !strings.Contains(out, " chain sentinel {\n meta nfproto != ipv4 return\n ip daddr != 198.18.0.1 return\n") ||
strings.Count(out, "log prefix") != 1 || strings.Index(out, "log prefix") < strings.Index(out, "chain sentinel {") {
t.Errorf("%s: the sentinel doesn't return IPv6 first:\n%s", bash, out)
}
if strings.Count(out, "{") != strings.Count(out, "}") || strings.Count(out, "jump sentinel") != 2 {
t.Errorf("%s: unbalanced, or a chain without the stand-in address's ports:\n%s", bash, out)
}
if n, err := exec.LookPath("nft"); err == nil {
f := filepath.Join(dir, "rules.nft")
must(t, os.WriteFile(f, []byte(out), 0o600))
if b, err := exec.CommandContext(t.Context(), n, "-c", "-f", f).CombinedOutput(); err != nil { //nolint:gosec // G204: nft from the PATH, checking the test's ruleset
if strings.Contains(string(b), "Operation not permitted") {
t.Log("nft -c can't run here")
} else {
t.Errorf("nft -c refused it: %v\n%s", err, b)
}
}
}
}
}
// Each port past 80 and 443 keeps the listener it had while it stays, a
// port that's gone frees its own, and a new one takes the lowest free.
func TestTransparentSlots(t *testing.T) {
script, dir := transparentScript(t)
must(t, os.WriteFile(filepath.Join(dir, "slots"), []byte("8080 61101\n9000 61100\n"), 0o600))
for _, bash := range bashes(t) {
out, ok := runTransparent(t, bash, script, dir, "slots", "80", "443", "9000", "8443", "7000")
if want := "80 61080\n443 61443\n9000 61100\n8443 61101\n7000 61102\n"; !ok || out != want {
t.Errorf("%s: slots:\n%s\nwant:\n%s", bash, out, want)
}
}
}
// The proxy's port list goes into the ruleset only when it's 2 to 34
// ports, each once, with 80 and 443, never 22 or 53.
func TestTransparentPortList(t *testing.T) {
script, dir := transparentScript(t)
many := "80\n443\n"
for p := 9000; p < 9033; p++ {
many += strconv.Itoa(p) + "\n"
}
for _, bash := range bashes(t) {
for _, c := range []struct {
list string
ok bool
}{
{"80\n443\n", true},
{"80\n443\n8443\n", true},
{"443\n80\n", true},
{"80\n", false},
{"80\n8443\n", false},
{"80\n443\n22\n", false},
{"80\n443\n53\n", false},
{"80\n443\n8443\n8443\n", false},
{"80\n443\n65536\n", false},
{"80\n443\n08443\n", false},
{"80\n443\n84 43\n", false},
{"80\n443\n$(id)\n", false},
{many, false},
} {
f := filepath.Join(dir, "ports-list")
must(t, os.WriteFile(f, []byte(c.list), 0o600))
if _, ok := runTransparent(t, bash, script, dir, "valid", f); ok != c.ok {
t.Errorf("%s: %q: %v, want %v", bash, c.list, ok, c.ok)
}
}
}
}
+52 -14
View File
@@ -1165,31 +1165,69 @@ html.dark .highlight .chroma .go {
}
}
/* Diagrams (mermaid code blocks, themed in layouts/_partials/scripts/mermaid.html): at their own size,
centered, scrolled sideways when wider than the page. */
.content pre.mermaid {
/* Diagrams (mermaid code blocks, drawn before the build by render-diagrams.mjs and inlined by
layouts/_markup/render-codeblock-mermaid.html): at their own size, centered. One wider than the
text reaches into the article's padding on the right, the page's right margin, as far as it needs,
and when that's not enough, into the padding on the left for the rest; the hook sets its width
(--devvm-diagram-width), and 100% in a margin is the text's width. One wider than the text and both
paddings scrolls sideways. The browser skips drawing one until it nears the screen
(content-visibility), and keeps its place at its height, which the hook sets
(contain-intrinsic-block-size), so the page doesn't jump. pele's variables give them the palette:
panels on the surface color with blue borders, lime lines and arrows, and text in Departure Mono,
which render-diagrams.mjs measures. */
.content .devvm-diagram {
/* Hextra's article padding: 1.5rem, and 3rem from its md breakpoint. */
--devvm-diagram-reach: 1.5rem;
--devvm-diagram-over: max(0px, calc(var(--devvm-diagram-width, 0px) - 100%));
display: flex;
justify-content: safe center;
overflow-x: auto;
margin: 1.5rem 0;
padding: 0;
font-family: var(--devvm-font-pixel);
font-size: 14px;
margin-block: 1.5rem;
margin-inline-end: calc(-1 * min(var(--devvm-diagram-reach), var(--devvm-diagram-over)));
margin-inline-start: calc(-1 * min(var(--devvm-diagram-reach), max(0px, calc(var(--devvm-diagram-over) - var(--devvm-diagram-reach)))));
content-visibility: auto;
font-synthesis: none;
--pele-bg: var(--devvm-bg);
--pele-fg: var(--devvm-text);
--pele-fg-on-dark: var(--devvm-text);
--pele-muted: var(--devvm-text-secondary);
--pele-line: var(--devvm-accent);
--pele-accent: var(--devvm-accent);
--pele-surface: var(--devvm-surface);
--pele-surface-alt: var(--devvm-bg);
--pele-border: var(--devvm-blue);
--pele-font: var(--devvm-font-pixel);
--pele-font-mono: var(--devvm-font-pixel);
--pele-radius: 0;
}
.content pre.mermaid svg {
@media (min-width: 768px) {
.content .devvm-diagram {
--devvm-diagram-reach: 3rem;
}
}
.content .devvm-diagram svg {
flex: none;
}
/* Labels' lines on the font's cell, 18px at 14px, not the page's line height. Mermaid measures them in
the page, so their boxes fit. */
.content pre.mermaid foreignObject p {
margin: 0;
line-height: 18px;
/* Subgraphs and sequence diagrams' lifelines in the darker border color. */
.content .devvm-diagram .pele-cluster > rect,
.content .devvm-diagram .pele-lifeline {
stroke: var(--devvm-border);
}
.content pre.mermaid rect {
/* Notes on black, in that border, with secondary text. */
.content .devvm-diagram .pele-note > rect {
fill: var(--devvm-bg);
stroke: var(--devvm-border);
}
.content .devvm-diagram .pele-note > text {
fill: var(--devvm-text-secondary);
}
.content .devvm-diagram rect {
shape-rendering: crispEdges;
}
+93
View File
@@ -0,0 +1,93 @@
Copyright 2022–2024 Helena Zhang (helenazhang.com).
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

+7 -4
View File
@@ -1,5 +1,8 @@
---
title: devvm
# The social card's title (layouts/_partials/og-image.html): the hero's headline, as the logo says devvm.
cardTitle: One VM for every project
explainer: An isolated sandbox for you or a coding agent
layout: hextra-home
# Mostly shortcodes: no Copy page menu (hugo.yaml gives the home page no Markdown copy).
contextMenu: false
@@ -57,13 +60,13 @@ Claude Code needs your Claude login before its first start, which `devvm agent l
{{< feature title="Toolchains" icon="code" level="3" art="toolchains" >}}
`devvm` chooses the toolchains your project's files call for, and you can choose more when you customize a new VM or name them with `--tools` ([toolchains](docs/using/toolchains.md)).
`devvm` has [toolchains](docs/using/toolchains.md) for your project's languages, node among them. It chooses the ones your project's files call for, and you can choose more when you customize a new VM or name them with `--tools`.
{{< /feature >}}
{{< feature title="Coding agents" icon="robot" level="3" art="coding-agents" >}}
Claude Code, Codex and opencode run in the VM. Choose one when you customize a new VM, or choose them for every new VM in `devvm setup` ([coding agents](docs/using/coding-agents.md)).
The [supported coding agents](docs/using/coding-agents.md#supported-agents) run in the VM, Claude Code among them. Choose one when you customize a new VM, or choose them for every new VM in `devvm setup` ([coding agents](docs/using/coding-agents.md)).
{{< /feature >}}
@@ -93,7 +96,7 @@ devvm ships the `docker`, `nix` and `desktop` layers, which you choose when you
- The base image comes with [optional extras](docs/using/customizing.md#base-image-features) that you choose, such as oh-my-bash, fzf, zoxide (`z`), tree and tldr.
- Every VM gets your git name and email, so the commits made in it are authored by you or your agent.
- Ports forward on their own, so a dev server on `:5173` in the VM opens at `localhost:5173` on your machine ([ports](docs/using/ports-size.md#ports)).
- `devvm code` opens the VM in VS Code over Remote-SSH ([devvm code](docs/using/ssh.md#devvm-host-and-devvm-code)).
- `devvm code` and `devvm cursor` open the VM in VS Code or Cursor over Remote-SSH ([devvm code and devvm cursor](docs/using/ssh.md#devvm-host-devvm-code-and-devvm-cursor)).
{{< /feature >}}
@@ -108,7 +111,7 @@ devvm ships the `docker`, `nix` and `desktop` layers, which you choose when you
- The VM mounts your project folder at the same path. Apart from your agents' settings from devvm's own store, which it gets read-only, it sees nothing else in your home folder ([what a VM can reach](docs/safety/_index.md#what-a-vm-can-reach)).
- New VMs get the allowlist [network tier](docs/safety/network.md) by default, so they reach only an allowlist of hosts, through a proxy on your machine. You can choose a looser tier, internet or open, or a stricter one, none.
- On macOS, `devvm` locks `.git`'s hooks and config, so the VM can't change what git runs on your machine ([.git protection](docs/safety/git-protection.md)).
- `devvm` locks `.git`'s hooks and config, so the VM can't change what git runs on your machine, except on a Linux host whose kernel doesn't let it lock them, where it watches them instead ([.git protection](docs/safety/git-protection.md)).
- With [`--clone`](docs/using/clone.md), the VM works on a clone of the repo of its own instead of your folder, so nothing in it can touch your working tree or `.git`, and its work reaches your repo only when you fetch it.
- No sandbox closes every gap, so [attack vectors](docs/safety/attack-vectors.md#narrowed-not-closed) lists what's left open, and [staying safe](docs/safety/_index.md#the-habits) lists the habits that close most of it.
+5 -4
View File
@@ -1,5 +1,6 @@
---
title: Branding
explainer: devvm's logo, icons, colors and fonts
layout: branding
description: "devvm's logo, icons, social card, colors and fonts, to download and use when you write about devvm."
sidebar:
@@ -46,7 +47,7 @@ The app icon at any size, and the icons the site uses for browser tabs and home
## The social card
The image that sites and chat apps show with a link to devvm.dev:
The image to show with a link to devvm. Sites and chat apps show each page of devvm.dev with a card of its own in the same style, which has the page's section, its title and a line on what it covers.
{{< brand-assets wide="true" >}}
{{< brand-asset title="Social card, 1200 by 630" src="images/social-card.png" bg="dark" alt="The devvm social card: the logo, One VM for every project, and the tagline" files="images/social-card.png" >}}
@@ -60,7 +61,7 @@ Click a swatch to copy its hex.
## Fonts
All three are free under the SIL Open Font License.
All three are free under the SIL Open Font License, and this site serves each one itself, with its license.
<!-- markdownlint-disable MD034 -- the font-sample shortcodes' parameters, not bare URLs -->
@@ -68,11 +69,11 @@ All three are free under the SIL Open Font License.
A pixel font by Helena Zhang, for the logo, headings and buttons. It's sharp at multiples of 11px.
{{< /font-sample >}}
{{< font-sample name="Instrument Sans" font="sans" link="https://fonts.google.com/specimen/Instrument+Sans" >}}
{{< font-sample name="Instrument Sans" font="sans" link="https://github.com/Instrument/instrument-sans" license="fonts/instrument-sans/LICENSE" >}}
The font for text.
{{< /font-sample >}}
{{< font-sample name="Martian Mono" font="mono" link="https://fonts.google.com/specimen/Martian+Mono" >}}
{{< font-sample name="Martian Mono" font="mono" link="https://github.com/evilmartians/mono" license="fonts/martian-mono/LICENSE" >}}
The font for code, set narrower than its default and without ligatures.
{{< /font-sample >}}
+3 -1
View File
@@ -1,14 +1,16 @@
---
title: Docs
explainer: The guides, in the order you'll need them
---
The docs are in the order you'll need them: getting devvm running, using it day to day, staying safe and choosing a backend, then every command, how devvm works and how to change it.
The docs are in the order you'll need them: getting devvm running, using it day to day, staying safe, choosing a backend and comparing devvm with other tools, then every command, how devvm works and how to change it.
{{< cards >}}
{{< section-card path="getting-started" >}}Installing devvm, making your first VM, and the commands you use most.{{< /section-card >}}
{{< section-card path="using" >}}Images and toolchains, ports and size, coding agents, editors, settings, and what to do when something fails.{{< /section-card >}}
{{< section-card path="safety" >}}The habits that keep you safe, network tiers, `.git` protection, and what devvm does about each attack.{{< /section-card >}}
{{< section-card path="backends" >}}What runs the VMs: Lima.{{< /section-card >}}
{{< section-card path="compared" >}}How devvm differs from Docker Sandboxes, other VM and OS sandboxes, and hosted ones.{{< /section-card >}}
{{< section-card path="cli" >}}Every command, with its arguments and flags.{{< /section-card >}}
{{< section-card path="internals" >}}How devvm builds images, forwards ports, confines VMs to their proxies and protects `.git`.{{< /section-card >}}
{{< section-card path="contributing" >}}Building, testing and writing docs, other hosts, and releases.{{< /section-card >}}
+6 -1
View File
@@ -1,5 +1,6 @@
---
title: Backends
explainer: The program that runs devvm's VMs
weight: 40
---
@@ -17,10 +18,14 @@ A backend is the program that runs devvm's VMs and builds their images. devvm de
| The nix layer | {{< yes >}} yes |
| Limits | paths with commas, and shrinking a disk ([limits](lima.md#limits)) |
`.git` protection uses your machine's file flags, so it doesn't depend on the backend.
On macOS, `.git` protection uses your machine's file flags, so it doesn't depend on the backend. On Linux it needs the backend to keep paths in the project folder read-only in the VM, which Lima does where the kernel lets devvm use a user namespace ([.git protection on Linux hosts](../safety/git-protection.md#linux-hosts)).
An image's key includes its backend, so a backend never uses an image another backend built.
```sh
devvm doctor # Lima's features, and what devvm needs on this machine
```
`devvm doctor` lists Lima's features, which are what Lima does itself, what devvm builds from other parts of it, and what it can't do. These are backend features, not the base image features you choose with `devvm setup`, even though `devvm doctor` calls both "features". [How it works › Backends](../internals/backends.md) explains them.
## A VM's backend
+62 -4
View File
@@ -1,5 +1,6 @@
---
title: Lima
explainer: What Lima needs, and how devvm uses it
weight: 1
---
@@ -11,13 +12,13 @@ weight: 1
{{< os-tab name="macOS" >}}
- macOS 13 or newer, on arm64 or x86_64.
- Lima 2.0 or newer, with `limactl` on your `PATH`. Install it with Homebrew, `brew install lima`, or see [Lima's install guide](https://lima-vm.io/docs/installation/).
- Lima 2.2 or newer, with `limactl` on your `PATH`. Install it with Homebrew, `brew install lima`, or see [Lima's install guide](https://lima-vm.io/docs/installation/).
{{< /os-tab >}}
{{< os-tab name="Linux" >}}
- Linux on arm64 or x86_64.
- Lima 2.0 or newer, with `limactl` on your `PATH`. Install it with Homebrew, `brew install lima`, or see [Lima's install guide](https://lima-vm.io/docs/installation/).
- Lima 2.2 or newer, with `limactl` on your `PATH`. Install it with Homebrew, `brew install lima`, or see [Lima's install guide](https://lima-vm.io/docs/installation/).
- QEMU from your package manager: `qemu-system-aarch64` (or `qemu-system-x86_64`) and `qemu-img`.
- Read and write access to `/dev/kvm`. That means virtualization is turned on in the firmware (or nested virtualization, in a VM), and your user is in the `kvm` group.
@@ -62,14 +63,71 @@ To have a watcher see your edits, set it to poll the project folder, which costs
Set the variables in the VM's shell or in your project's scripts, before the tool starts. Leave Lima's own file event setting, `mountInotify`, off, because with it on, commands in the VM that write to the project folder, such as `git init`, fail at random ([details](../internals/lima.md#what-devvm-sets-on-a-vm)).
## The project folder's cache
On Linux, QEMU shares the project folder with the VM over 9p, and the VM's kernel can cache the folder's files as it reads and writes them. devvm gives every new VM the cache mode `none`, so the VM reads and writes straight through to the folder on this machine, and what you edit on either side is what the other side sees.
Lima's own default for a writable folder is `mmap`, which caches the files' contents in the VM, and Linux's 9p client loses data with it in two ways. When a program reads a file's size while another write is making the file longer, the VM can take the older size from this machine and drop the new data, even after `fsync` succeeded, so the file ends up empty or cut to 4096 bytes, and Claude Code's edits are one way to set it off. And when a program locks a file it has written, its next read of that file returns zeros. That stops SQLite at its second write with `file is not a database`, whatever its journal mode, and Gradle's second build with `Unexpected lock protocol found in lock file`.
A VM made before devvm chose `none` keeps `mmap`, and devvm doesn't change its mount on its own, so each launch of such a VM warns until you switch it:
```sh
devvm mount-cache # how this folder's VM caches its project folder
devvm mount-cache none # switch it to none from the VM's next start
```
`devvm mount-cache none` switches the mode from the VM's next start, so in a terminal devvm offers to restart a running VM now. `none` is the only mode devvm sets, so any other value is refused.
A [`--clone` VM](../using/clone.md) mounts no project folder, so it has no cache mode until `devvm clone off` mounts the folder, which then gets `none`. On macOS, VMs share the project folder with virtiofs, which has no cache mode to choose, so there `devvm mount-cache` refuses. On Linux it refuses the same for a VM whose project folder isn't a 9p mount, such as one whose Lima config you gave another mount type.
### When the cache mode changes
The VM gets `none` at its next start, and that start mounts the project folder again once the VM runs, before devvm sets the VM up or opens its shell. The VM's first mount of the folder at boot still has the old mode, because the guest reads its new mount options only after it has mounted the folder. devvm then checks the folder:
- When the folder is mounted with `none`, the VM goes on as usual.
- When the folder is still mounted with the old mode, isn't mounted at all, or the VM doesn't answer the check, devvm restarts the VM once, before it sets it up or opens its shell. The folder can be left with the old mode when the VM couldn't unmount it, because something it started at boot, such as a container, was using it, or when the VM's start was degraded. It can be left unmounted when the VM unmounted it but couldn't mount it again, as happens on an Alpine VM. The restart's boot mounts the folder with `none`, and devvm checks it again.
After the restart, devvm checks the folder once more and doesn't restart the VM again:
- When the folder is mounted with `none`, the VM goes on as usual.
- When the folder is still mounted with the old mode, devvm warns and goes on, though the folder can lose writes under that mode.
- When the folder isn't mounted at all, or the VM doesn't answer the check, devvm stops the VM before it sets it up or opens its shell, because files written there would go to the VM's own disk and vanish once the folder is mounted over them.
In both cases a restart of your own repeats what failed, so look first at why the VM's boot didn't mount the folder with `none`. Its console log, which [A VM won't boot](../using/troubleshooting.md#a-vm-wont-boot) shows where to find, has what the boot said, and the run log has what the VM's `umount` and `mount` said and why devvm restarted the VM ([logs](../using/troubleshooting.md#a-command-fails)).
When devvm can't stop the VM for the restart, a folder still mounted with the old mode is warned of and the VM goes on as it runs. Otherwise the launch fails, saying the VM didn't stop, because it may still be running. Pressing Ctrl+C while devvm mounts or checks the folder, or stops the VM for the restart, stops the VM, without a restart. A launch into a running VM checks too that its project folder is mounted, and refuses to open a shell in one whose folder isn't, naming `devvm restart`.
### devvm mount-cache --json
`devvm mount-cache --json` prints the VM's mode, whether it was chosen, as the VM was made or with `devvm mount-cache none`, rather than kept from Lima, and the mode its next start gives it, when that differs:
```json
{
"version": 1,
"mode": "mmap",
"chosen": true,
"pending": "none"
}
```
### Programs that map files for writing
With `none`, a program in the VM can't map a file in the project folder for shared writing, or map one it opened for writing at all, and it fails at once with `Invalid argument`, so nothing is lost. LMDB, numpy's `memmap` in `r+` or `w+` mode, Java's read-write `MappedByteBuffer` and the mold linker do this, while git, npm, Vite, webpack, esbuild, jest, Go, cargo with Rust's own linker, GNU ld, lld, Gradle, DuckDB, ccache and Terraform work as they do on any disk. LMDB is what Parcel's `.parcel-cache` and Gatsby's cache use.
For a program that maps its files, keep them on the VM's own disk, such as in its home folder: for mold, a `CARGO_TARGET_DIR` there, or lld instead. Or use a [`--clone` VM](../using/clone.md), whose repo is on the VM's own disk. The VM's own disk is also far faster than the shared folder, so a `--clone` VM suits large repos and heavy builds: on a Fedora 43 host, `npm ci` of 369 packages took 4.8 s in the shared folder and 2.8 s on the VM's disk, a debug `cargo build` of ripgrep 8.5 s and 4.8 s, and a cold `git status` of an 18,000-file tree 23 s and 1 s.
### SQLite and the cache
SQLite's default journal works in the project folder. WAL mode doesn't, because SQLite maps its shared index and fails with `disk I/O error`, unless the connection sets `PRAGMA locking_mode=EXCLUSIVE` before `PRAGMA journal_mode=WAL`. That keeps the index in memory, and lets only that connection use the database. A project whose database is in WAL mode works in a `--clone` VM, or with the database outside the project folder, such as in the VM's home folder or `/tmp`.
## Cleaning up
`devvm gc` deletes devvm's stale and unfinished Lima images and the shared tools that no VM has and that aren't current, and it leaves your VMs as they are. `devvm images rm` deletes an image that's current, except on Linux hosts one whose disk VMs use ([cleaning up](../using/images.md#cleaning-up)). Lima also keeps a download cache of its own, which holds Ubuntu's cloud images that devvm's builds downloaded, and which your own Lima VMs share. `devvm gc --caches` deletes the cloud images that devvm downloads and that no image of devvm's names, after listing them and asking, and devvm never runs `limactl prune`, which empties the whole cache ([what devvm keeps](../using/space.md#lima)).
## Limits
- **Folder names in VM names are cut short.** Lima keeps each VM's ssh socket in the VM's folder in its home, and a socket path has at most 104 characters. A long Lima home leaves less room for the name, so set `DEVVM_LIMA_HOME` to a shorter folder if devvm says the home is too long, or that a VM's name leaves no room for the folder's name ([VM names](../internals/backends.md#vm-names)).
- **Folder names in VM names are cut short.** Lima keeps each VM's ssh socket in the VM's folder in its home, and a socket path has fewer than 104 characters. A long Lima home leaves less room for the name, so set `DEVVM_LIMA_HOME` to a shorter folder if devvm says the home is too long, or that a VM's name leaves no room for the folder's name ([VM names](../internals/backends.md#vm-names)).
- **Paths can't contain commas.** Lima and QEMU split mount options on commas, so devvm refuses to mount a project folder whose path has one, and it leaves out an agent's folder whose path has one, with a warning.
- **Disks can grow but not shrink.**
- **Mounts on Linux are 9p.** A 9p share mounts once per guest, and file watchers in the VM miss changes in its subfolders ([file watchers](#file-watchers)).
- **Mounts on Linux are 9p.** A 9p share mounts once per guest, file watchers in the VM miss changes in its subfolders ([file watchers](#file-watchers)), and SQLite's WAL mode doesn't work in the project folder, which a `--clone` VM avoids ([SQLite and the cache](#sqlite-and-the-cache)).
- **A VM that Lima reports as failed to start** still starts, with a warning, when it's running but degraded because one of Lima's boot scripts failed. A VM that doesn't answer over ssh within a minute is stopped instead, and its console log is in its Lima folder (`serial*.log`).
+9
View File
@@ -1,6 +1,7 @@
---
title: CLI reference
weight: 90
explainer: Every devvm command, with its arguments and flags
---
Every devvm command, with its arguments and flags. `devvm <command> --help` prints the same.
@@ -13,8 +14,11 @@ Every devvm command, with its arguments and flags. `devvm <command> --help` prin
- [devvm agent save](devvm_agent_save.md): Copy the agents' settings from this folder's VM into devvm's store
- [devvm build](devvm_build.md): Build an image and the images under it, unless they're built
- [devvm clone](devvm_clone.md): Show or change whether this folder's VM has its own clone of the repo
- [devvm clone add](devvm_clone_add.md): Copy one more repo into this folder's --clone VM
- [devvm clone fetch](devvm_clone_fetch.md): Fetch the work of this folder's --clone VM into each of its repos
- [devvm code](devvm_code.md): Open this folder's VM in VS Code over Remote-SSH
- [devvm completion](devvm_completion.md): Print the shell completion script for bash, zsh or fish
- [devvm cursor](devvm_cursor.md): Open this folder's VM in Cursor over Remote-SSH
- [devvm desktop](devvm_desktop.md): Open this folder's VM's desktop in a VNC viewer
- [devvm doctor](devvm_doctor.md): Check what devvm needs on this machine
- [devvm gc](devvm_gc.md): Delete stale images, unused tools, old files and the Nix cache over its cap
@@ -39,11 +43,16 @@ Every devvm command, with its arguments and flags. `devvm <command> --help` prin
- [devvm link rm](devvm_link_rm.md): Remove one of this folder's VM's links
- [devvm link unpublish](devvm_link_unpublish.md): Stop offering ports of this folder's VM to links
- [devvm ls](devvm_ls.md): List the project VMs
- [devvm mount-cache](devvm_mount-cache.md): Show or change how this folder's VM caches its project folder
- [devvm network](devvm_network.md): Show or change the network tier of this folder's VM
- [devvm network allow](devvm_network_allow.md): Allow hosts for this folder's VM
- [devvm network deny](devvm_network_deny.md): Deny hosts for this folder's VM
- [devvm network lock](devvm_network_lock.md): Lock this folder's VM to the hosts it learned, on the allowlist tier
- [devvm network log](devvm_network_log.md): Show what this folder's VM connected to and what its proxy blocked
- [devvm network rm](devvm_network_rm.md): Remove rules from this folder's VM
- [devvm network transparent](devvm_network_transparent.md): Show or change transparent mode for this folder's VM
- [devvm paste](devvm_paste.md): Send the clipboard's image, PDF or copied file to this folder's VM
- [devvm paste rm](devvm_paste_rm.md): Delete the files devvm paste left in this folder's VM
- [devvm ports](devvm_ports.md): Show or change which ports this folder's VM forwards
- [devvm ports add](devvm_ports_add.md): Forward more ports from this folder's VM
- [devvm ports rm](devvm_ports_rm.md): Stop forwarding some ports from this folder's VM
+7 -3
View File
@@ -1,6 +1,6 @@
---
title: devvm
weight: 1
explainer: "Open a shell in this folder's VM, creating it first"
---
Open a shell in this folder's VM, creating it first
@@ -27,7 +27,7 @@ devvm [flags]
```text
--agents LIST the LIST of coding agents a new VM gets, such as claude,codex, or none (default: devvm setup's)
--clone create the VM with its own clone of this repo instead of mounting the folder
--clone create the VM with its own clone of this repo, or of each repo in this folder, instead of mounting the folder
--cpus N the N CPUs the VM gets (default: devvm size -g, else the image's)
--disk GiB the VM's disk in GiB, at least the image's (default: devvm size -g, else the image's)
--from IMAGE the container IMAGE base starts from, such as node:24, instead of Ubuntu's cloud image (default: $DEVVM_FROM)
@@ -35,12 +35,13 @@ devvm [flags]
--here use this folder's own VM, never that of a folder it's inside
--layers LIST the LIST of layers a new VM's image gets, bottom first, such as docker,mine, or none (default: devvm setup's)
--memory GiB the VM's memory in GiB, such as 16 or 16G (default: devvm size -g, else the image's)
--network TIER the network TIER a new VM gets: open, internet, allowlist or none (default: devvm network -g's, else allowlist)
--network TIER the network TIER a new VM gets: open, internet, allowlist or none, or learn for internet while it learns the hosts it needs (default: devvm network -g's, else allowlist)
--no-devcontainer create the VM without reading the folder's devcontainer.json
--no-git-protect create the VM without .git protection
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--ports PORTS the PORTS the VM forwards: all, none or a list like 5173,8000-8010 (default: devvm ports -g, else all)
--repos LIST the repos a --clone VM of a folder of repos gets: all, none or a LIST of their paths, such as frontend,backend (default: a picker in a terminal)
--ssh-agent create the VM with your SSH agent forwarded, so anything in it can use your keys while you're connected
--ssh-config add devvm's Include line to ~/.ssh/config without asking
--tools LIST the LIST of toolchains a new VM gets, such as node,python, or none (default: those the folder's files call for)
@@ -61,6 +62,7 @@ devvm [flags]
- [devvm clone](devvm_clone.md): Show or change whether this folder's VM has its own clone of the repo
- [devvm code](devvm_code.md): Open this folder's VM in VS Code over Remote-SSH
- [devvm completion](devvm_completion.md): Print the shell completion script for bash, zsh or fish
- [devvm cursor](devvm_cursor.md): Open this folder's VM in Cursor over Remote-SSH
- [devvm desktop](devvm_desktop.md): Open this folder's VM's desktop in a VNC viewer
- [devvm doctor](devvm_doctor.md): Check what devvm needs on this machine
- [devvm gc](devvm_gc.md): Delete stale images, unused tools, old files and the Nix cache over its cap
@@ -73,7 +75,9 @@ devvm [flags]
- [devvm limactl](devvm_limactl.md): Run Lima's limactl for debugging, which starts VMs unconfined, whatever their tier
- [devvm link](devvm_link.md): List this folder's VM's links to your other VMs
- [devvm ls](devvm_ls.md): List the project VMs
- [devvm mount-cache](devvm_mount-cache.md): Show or change how this folder's VM caches its project folder
- [devvm network](devvm_network.md): Show or change the network tier of this folder's VM
- [devvm paste](devvm_paste.md): Send the clipboard's image, PDF or copied file to this folder's VM
- [devvm ports](devvm_ports.md): Show or change which ports this folder's VM forwards
- [devvm rebuild](devvm_rebuild.md): Build an image again, and delete the old one
- [devvm restart](devvm_restart.md): Restart this folder's VM and open a shell in it
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm adopt
weight: 2
explainer: "Give this folder the VM made for an earlier folder or path"
---
Give this folder the VM made for an earlier folder or path
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm agent
weight: 3
explainer: "Fill devvm's store of the agents' settings and logins that every VM gets"
---
Fill devvm's store of the agents' settings and logins that every VM gets
+9 -7
View File
@@ -1,13 +1,13 @@
---
title: devvm agent import
weight: 4
explainer: "Copy the agents' settings and logins from this machine into devvm's store"
---
Copy the agents' settings and logins from this machine into devvm's store
## Synopsis
Copy the settings and logins of AGENT, claude, codex or opencode, or of every agent, from your home folder into devvm's store, never their history. It follows no link out of an agent's folder, and it asks before replacing what the store has.
Copy the settings and logins of AGENT, claude, codex, opencode, pi or cursor, or of every agent, from your home folder into devvm's store, never their history. It copies what a link out of an agent's folder leads to only from a folder that config.toml's follow-links names, or after naming the link and asking, which --follow-links answers. It asks before replacing what the store has.
```text
devvm agent import [AGENT...] [flags]
@@ -16,16 +16,18 @@ devvm agent import [AGENT...] [flags]
## Examples
```text
devvm agent import # copy every agent's settings and logins, asking before replacing the store's
devvm agent import claude codex # copy only Claude Code's and Codex's
devvm agent import --force # replace the store's without asking, as a script must
devvm agent import # copy every agent's settings and logins, asking before replacing the store's
devvm agent import claude codex # copy only Claude Code's and Codex's
devvm agent import --force # replace the store's without asking, as a script must
devvm agent import --follow-links # copy what links out of the agents' folders lead to as well, such as into a dotfiles repo
```
## Options
```text
-f, --force don't ask to confirm, which devvm needs without a terminal or with --no-input
-h, --help help for import
--follow-links copy what links out of the agents' folders lead to, naming each, without asking (default: ask in a terminal)
-f, --force don't ask to confirm, which devvm needs without a terminal or with --no-input
-h, --help help for import
```
## Options inherited from parent commands
+4 -3
View File
@@ -1,13 +1,13 @@
---
title: devvm agent login
weight: 5
explainer: "Log an agent in, in this folder's VM, and save the login in devvm's store"
---
Log an agent in, in this folder's VM, and save the login in devvm's store
## Synopsis
Log AGENT in inside this folder's VM, and keep the login in devvm's store for every VM with the agent, which gets only placeholders. claude logs in to your Claude subscription in a browser on any machine, whose code you paste back, or gets a long-lived Claude Code token with --setup-token. codex and opencode log in to ChatGPT in a browser on this machine, or with a code with --device-code, or save an API key with --api-key.
Log AGENT in inside this folder's VM, and keep the login in devvm's store for every VM with the agent, which gets only placeholders. claude logs in through a browser on any machine, whose code you paste back, or gets a long-lived Claude Code token with --setup-token. codex and opencode log in to ChatGPT in a browser on this machine, or with a code with --device-code, or save an API key with --api-key, which is pi's only login.
```text
devvm agent login AGENT [flags]
@@ -21,6 +21,7 @@ devvm agent login AGENT [flags]
devvm agent login codex # log Codex in to ChatGPT in a browser on this machine
devvm agent login codex --device-code # log in with a code, in a browser on any machine
devvm agent login opencode --api-key --provider anthropic # save opencode's Anthropic API key, asking for it
devvm agent login pi --api-key --provider openai # save pi's OpenAI API key, asking for it
```
## Options
@@ -31,7 +32,7 @@ devvm agent login AGENT [flags]
-h, --help help for login
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--provider PROVIDER with opencode's --api-key, the PROVIDER it's for: anthropic, openai or openrouter
--provider PROVIDER with opencode's or pi's --api-key, the PROVIDER it's for: anthropic, deepseek, google, groq, mistral, openai, openrouter or xai
--setup-token with claude, get a long-lived Claude Code token with claude setup-token instead
--stdin read the secret from a line of input, without asking
```
+2 -2
View File
@@ -1,13 +1,13 @@
---
title: devvm agent save
weight: 6
explainer: "Copy the agents' settings from this folder's VM into devvm's store"
---
Copy the agents' settings from this folder's VM into devvm's store
## Synopsis
Copy the settings of AGENT, claude, codex or opencode, or of every agent this folder's VM has, from the VM into devvm's store, so every VM with the agent gets them, never its logins or history. It shows what changed and asks first, so it runs only in a terminal without --no-input, and devvm starts a stopped VM for it.
Copy the settings of AGENT, claude, codex, opencode, pi or cursor, or of every agent this folder's VM has, from the VM into devvm's store, so every VM with the agent gets them, never its logins or history. It shows what changed and asks first, so it runs only in a terminal without --no-input, and devvm starts a stopped VM for it.
```text
devvm agent save [AGENT...] [flags]
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm build
weight: 7
explainer: "Build an image and the images under it, unless they're built"
---
Build an image and the images under it, unless they're built
+6 -2
View File
@@ -1,13 +1,13 @@
---
title: devvm clone
weight: 8
explainer: "Show or change whether this folder's VM has its own clone of the repo"
---
Show or change whether this folder's VM has its own clone of the repo
## Synopsis
Show whether this folder's VM has its own clone of the repo, on, or mounts this folder, off. devvm clone on and devvm clone off make the VM again from its image, after asking in a terminal without --no-input, then open a shell in it, and devvm keeps its home folder and its settings, while everything else on its disk is lost. On copies the repo's branches into the new clone, and off first offers to fetch the clone's work into this repo, unless you give --no-clone-check.
Show whether this folder's VM has its own clone of the repo, or of each repo in a folder of repos, on, or mounts this folder, off. devvm clone on and devvm clone off make the VM again from its image, after asking in a terminal without --no-input, then open a shell in it, and devvm keeps its home folder and its settings, while everything else on its disk is lost. On copies the repos' branches into the new clone, and off first offers to fetch the clone's work into this machine's repos, unless you give --no-clone-check.
```text
devvm clone [on|off] [flags]
@@ -20,6 +20,7 @@ devvm clone [on|off] [flags]
devvm clone on # make the VM again with its own clone of the repo, after asking
devvm clone off # fetch the clone's work, then make the VM again with this folder mounted
devvm clone on --force # make it again without asking, as a script must
devvm clone fetch # fetch the VM's branches into each repo on this machine
```
## Options
@@ -33,6 +34,7 @@ devvm clone [on|off] [flags]
--no-clone-check don't check a --clone VM's clone for unfetched commits and uncommitted changes first, which are lost
--no-export don't export the agents' history first
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--repos LIST the repos a --clone VM of a folder of repos gets: all, none or a LIST of their paths, such as frontend,backend (default: a picker in a terminal)
```
## Options inherited from parent commands
@@ -49,3 +51,5 @@ devvm clone [on|off] [flags]
## See also
- [devvm](devvm.md): Open a shell in this folder's VM, creating it first
- [devvm clone add](devvm_clone_add.md): Copy one more repo into this folder's --clone VM
- [devvm clone fetch](devvm_clone_fetch.md): Fetch the work of this folder's --clone VM into each of its repos
+44
View File
@@ -0,0 +1,44 @@
---
title: devvm clone add
explainer: "Copy one more repo into this folder's --clone VM"
---
Copy one more repo into this folder's --clone VM
## Synopsis
Copy the repo at PATH, a folder in this folder's --clone VM's folder, into the VM at the same path, with its branches, tags and remote-tracking branches, checked out as it is here, starting the VM if it's stopped. The repo gets a remote for the VM, as each of the VM's repos has.
```text
devvm clone add PATH [flags]
```
## Examples
```text
devvm clone add tools # copy the repo in ./tools into the VM
devvm clone add ../shared # copy a repo beside this one, in the same folder of repos
```
## Options
```text
-h, --help help for add
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm clone add](../using/clone.md#adding-a-repo) explains it in full.
## See also
- [devvm clone](devvm_clone.md): Show or change whether this folder's VM has its own clone of the repo
+45
View File
@@ -0,0 +1,45 @@
---
title: devvm clone fetch
explainer: "Fetch the work of this folder's --clone VM into each of its repos"
---
Fetch the work of this folder's --clone VM into each of its repos
## Synopsis
Fetch every branch of each repo in this folder's --clone VM into the repo on this machine, as remote-tracking branches of its remote for the VM, such as devvm/main, starting the VM if it's stopped. When a repo's HEAD in the VM is detached at commits no branch has, fetch those into a new local branch, saved/devvm/HEAD, and each stash entry the VM made into saved/devvm/stash-N. Then list the branches that are new or moved, each with the repos it's in.
```text
devvm clone fetch [flags]
```
## Examples
```text
devvm clone fetch # fetch every repo's branches, and list what's new
devvm clone fetch --json # list what's new for a script
```
## Options
```text
-h, --help help for fetch
--here use this folder's own VM, never that of a folder it's inside
--json print it as one JSON object, for scripts
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm clone fetch](../using/clone.md#fetching-the-vms-work) explains it in full.
## See also
- [devvm clone](devvm_clone.md): Show or change whether this folder's VM has its own clone of the repo
+2 -2
View File
@@ -1,6 +1,6 @@
---
title: devvm code
weight: 9
explainer: "Open this folder's VM in VS Code over Remote-SSH"
---
Open this folder's VM in VS Code over Remote-SSH
@@ -38,7 +38,7 @@ devvm code [flags]
## Docs
[The docs page for devvm code](../using/ssh.md#vs-code) explains it in full.
[The docs page for devvm code](../using/ssh.md#vs-code-and-cursor) explains it in full.
## See also
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm completion
weight: 10
explainer: "Print the shell completion script for bash, zsh or fish"
---
Print the shell completion script for bash, zsh or fish
+45
View File
@@ -0,0 +1,45 @@
---
title: devvm cursor
explainer: "Open this folder's VM in Cursor over Remote-SSH"
---
Open this folder's VM in Cursor over Remote-SSH
## Synopsis
Get this folder's VM ready as devvm host does, then open its folder in the Cursor editor over Remote-SSH, with Cursor's cursor command.
```text
devvm cursor [flags]
```
## Examples
```text
devvm cursor # open this folder's VM in Cursor
devvm cursor --ssh-config # the same, adding devvm's Include line to ~/.ssh/config without asking
```
## Options
```text
-h, --help help for cursor
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--ssh-config add devvm's Include line to ~/.ssh/config without asking
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm cursor](../using/ssh.md#vs-code-and-cursor) explains it in full.
## See also
- [devvm](devvm.md): Open a shell in this folder's VM, creating it first
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm desktop
weight: 11
explainer: "Open this folder's VM's desktop in a VNC viewer"
---
Open this folder's VM's desktop in a VNC viewer
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm doctor
weight: 12
explainer: "Check what devvm needs on this machine"
---
Check what devvm needs on this machine
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm gc
weight: 13
explainer: "Delete stale images, unused tools, old files and the Nix cache over its cap"
---
Delete stale images, unused tools, old files and the Nix cache over its cap
+3 -3
View File
@@ -1,16 +1,16 @@
---
title: devvm git-protect
weight: 14
explainer: "Show or change .git protection for this folder's VM"
---
Show or change .git protection for this folder's VM
## Synopsis
Show this folder's VM's .git protection, which locks the git hooks and config that run code on this machine, as on, strict, off, or clone for a --clone VM. devvm git-protect on, strict or off changes it at once on a stopped VM, and on a running one when it next stops, so in a terminal devvm offers to restart it now.
Show this folder's VM's .git protection, which locks the git hooks and config that run code on this machine, as on, off, or clone for a --clone VM. devvm git-protect on or off changes it at once on a stopped VM, and on a running one when it next stops, so in a terminal devvm offers to restart it now.
```text
devvm git-protect [on|strict|off] [flags]
devvm git-protect [on|off] [flags]
```
## Examples
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm group
weight: 15
explainer: "Show the group this folder's VM is in"
---
Show the group this folder's VM is in
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm group join
weight: 16
explainer: "Put this folder's VM in a group of VMs"
---
Put this folder's VM in a group of VMs
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm group leave
weight: 17
explainer: "Take this folder's VM out of its group"
---
Take this folder's VM out of its group
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm history
weight: 18
explainer: "List the saved exports of agents' history"
---
List the saved exports of agents' history
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm history export
weight: 19
explainer: "Save this folder's VM's agent history to a .tar.gz"
---
Save this folder's VM's agent history to a .tar.gz
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm history import
weight: 20
explainer: "Put an export of agent history into this folder's VM"
---
Put an export of agent history into this folder's VM
+2 -2
View File
@@ -1,6 +1,6 @@
---
title: devvm host
weight: 21
explainer: "Get this folder's VM ready for ssh and editors, and show its host name"
---
Get this folder's VM ready for ssh and editors, and show its host name
@@ -38,7 +38,7 @@ devvm host [flags]
## Docs
[The docs page for devvm host](../using/ssh.md#devvm-host-and-devvm-code) explains it in full.
[The docs page for devvm host](../using/ssh.md#devvm-host-devvm-code-and-devvm-cursor) explains it in full.
## See also
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm images
weight: 22
explainer: "List the images and the shared tools"
---
List the images and the shared tools
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm images rm
weight: 23
explainer: "Delete images, by name or by key"
---
Delete images, by name or by key
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm layer
weight: 24
explainer: "Make image layers of your own, or change this folder's VM's layers"
---
Make image layers of your own, or change this folder's VM's layers
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm layer add
weight: 25
explainer: "Make this folder's VM again with more layers, then open a shell in it"
---
Make this folder's VM again with more layers, then open a shell in it
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm layer new
weight: 26
explainer: "Start a layer of your own"
---
Start a layer of your own
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm layer rm
weight: 27
explainer: "Make this folder's VM again without some of its layers, then open a shell in it"
---
Make this folder's VM again without some of its layers, then open a shell in it
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm limactl
weight: 28
explainer: "Run Lima's limactl for debugging, which starts VMs unconfined, whatever their tier"
---
Run Lima's limactl for debugging, which starts VMs unconfined, whatever their tier
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link
weight: 29
explainer: "List this folder's VM's links to your other VMs"
---
List this folder's VM's links to your other VMs
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link add
weight: 30
explainer: "Link this folder's VM to a port of another VM"
---
Link this folder's VM to a port of another VM
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link publish
weight: 31
explainer: "Show or add the ports this folder's VM offers to links"
---
Show or add the ports this folder's VM offers to links
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link rm
weight: 32
explainer: "Remove one of this folder's VM's links"
---
Remove one of this folder's VM's links
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link unpublish
weight: 33
explainer: "Stop offering ports of this folder's VM to links"
---
Stop offering ports of this folder's VM to links
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm ls
weight: 34
explainer: "List the project VMs"
---
List the project VMs
+45
View File
@@ -0,0 +1,45 @@
---
title: devvm mount-cache
explainer: "Show or change how this folder's VM caches its project folder"
---
Show or change how this folder's VM caches its project folder
## Synopsis
Show how this folder's VM caches its project folder on a Linux host: none, which new VMs get, or mmap for a VM made before devvm chose none, which can lose writes and breaks SQLite and Gradle there. devvm mount-cache none switches it from the VM's next start, so in a terminal devvm offers to restart a running VM now.
```text
devvm mount-cache [none] [flags]
```
## Examples
```text
devvm mount-cache # show the VM's cache mode
devvm mount-cache none # stop the VM losing writes, from its next start
```
## Options
```text
-h, --help help for mount-cache
--here use this folder's own VM, never that of a folder it's inside
--json print it as one JSON object, for scripts
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm mount-cache](../backends/lima.md#the-project-folders-cache) explains it in full.
## See also
- [devvm](devvm.md): Open a shell in this folder's VM, creating it first
+7 -4
View File
@@ -1,16 +1,16 @@
---
title: devvm network
weight: 35
explainer: "Show or change the network tier of this folder's VM"
---
Show or change the network tier of this folder's VM
## Synopsis
Show the network tier of this folder's VM, which is open, internet, allowlist, none or unenforced, and then its allowlist, policy by policy: devvm's built-in ones by name, then your files by path. With a tier, give the VM that tier: between the confined tiers at once, and into or out of open from the VM's next start, so in a terminal devvm offers to restart a running VM now. With -g, show or change the tier new VMs get, allowlist unless you change it.
Show the network tier of this folder's VM, which is open, internet, allowlist, none or unenforced, and then its allowlist, policy by policy: devvm's built-in ones by name, then your files by path. With a tier, give the VM that tier: between the confined tiers at once, and into or out of open from the VM's next start, so in a terminal devvm offers to restart a running VM now, and learn gives it the internet tier while it learns the hosts it reaches, until devvm network lock. With -g, show or change the tier new VMs get, allowlist unless you change it, which is never learn, because each VM learns on its own.
```text
devvm network [open|internet|allowlist|none] [flags]
devvm network [open|internet|learn|allowlist|none] [flags]
```
## Examples
@@ -19,7 +19,8 @@ devvm network [open|internet|allowlist|none] [flags]
devvm network # show the VM's network tier and allowlist
devvm network allow example.com # let the VM reach example.com
devvm network log --blocked # list what the VM's proxy blocked
devvm network internet # let the VM reach any public host
devvm network learn # let the VM reach any public host while it learns the ones it needs
devvm network lock # choose which of them it keeps, and put it on the allowlist tier
devvm network -g none # give every new VM the none tier
```
@@ -49,5 +50,7 @@ devvm network [open|internet|allowlist|none] [flags]
- [devvm](devvm.md): Open a shell in this folder's VM, creating it first
- [devvm network allow](devvm_network_allow.md): Allow hosts for this folder's VM
- [devvm network deny](devvm_network_deny.md): Deny hosts for this folder's VM
- [devvm network lock](devvm_network_lock.md): Lock this folder's VM to the hosts it learned, on the allowlist tier
- [devvm network log](devvm_network_log.md): Show what this folder's VM connected to and what its proxy blocked
- [devvm network rm](devvm_network_rm.md): Remove rules from this folder's VM
- [devvm network transparent](devvm_network_transparent.md): Show or change transparent mode for this folder's VM
+13 -10
View File
@@ -1,13 +1,13 @@
---
title: devvm network allow
weight: 36
explainer: "Allow hosts for this folder's VM"
---
Allow hosts for this folder's VM
## Synopsis
Add RULEs to the allowlist of this folder's VM, or with -g of every VM, from the next connection on. RULE is a host, *.host for its subdomains, ** for any host, or an address or CIDR, and with a port, such as example.com:8443, it matches only that port instead of 443 and 80.
Add RULEs to the allowlist of this folder's VM, or with -g of every VM, from the next connection on. RULE is a host, *.host for its subdomains, ** for any host, or an address or CIDR, and with a port, such as example.com:8443, it matches only that port instead of 443 and 80. --method and --path narrow a host's rule to some of its requests, which its proxy decrypts to check.
```text
devvm network allow RULE... [flags]
@@ -16,19 +16,22 @@ devvm network allow RULE... [flags]
## Examples
```text
devvm network allow example.com # let the VM reach example.com
devvm network allow '*.example.com' # and any of its subdomains
devvm network allow 10.0.0.5:5432 # one port of one address
devvm network allow -g pypi.org # let every VM reach pypi.org
devvm network allow example.com # let the VM reach example.com
devvm network allow '*.example.com' # and any of its subdomains
devvm network allow 10.0.0.5:5432 # one port of one address
devvm network allow api.example.com --method GET,HEAD # let it only read from api.example.com
devvm network allow -g pypi.org # let every VM reach pypi.org
```
## Options
```text
-g, --global change your rules for every VM instead
-h, --help help for allow
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
-g, --global change your rules for every VM instead
-h, --help help for allow
--here use this folder's own VM, never that of a folder it's inside
--method METHODS narrow each rule to these METHODS of a host's requests, such as GET,HEAD
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--path PATH narrow each rule to the requests whose path matches PATH, such as /repos/ for everything below /repos/
```
## Options inherited from parent commands
+12 -8
View File
@@ -1,13 +1,13 @@
---
title: devvm network deny
weight: 37
explainer: "Deny hosts for this folder's VM"
---
Deny hosts for this folder's VM
## Synopsis
Add RULEs as denies to this folder's VM's rules, or with -g every VM's, from the next connection on, and a deny beats any allow. RULE is a host, *.host for its subdomains, ** for any host, or an address or CIDR, and with a port, such as example.com:8443, it matches only that port instead of 443 and 80.
Add RULEs as denies to this folder's VM's rules, or with -g every VM's, from the next connection on, and a deny beats any allow. RULE is a host, *.host for its subdomains, ** for any host, or an address or CIDR, and with a port, such as example.com:8443, it matches only that port instead of 443 and 80. --method and --path narrow a host's rule to some of its requests, which its proxy decrypts to check.
```text
devvm network deny RULE... [flags]
@@ -16,17 +16,21 @@ devvm network deny RULE... [flags]
## Examples
```text
devvm network deny example.com # keep the VM from reaching example.com
devvm network deny -g '*.example.com' # keep every VM from its subdomains
devvm network deny example.com # keep the VM from reaching example.com
devvm network deny api.github.com --method POST,PUT,PATCH,DELETE # keep it from changing anything through GitHub's API
devvm network deny github.com --path '/*/*/git-receive-pack' # keep it from pushing to GitHub over HTTPS
devvm network deny -g '*.example.com' # keep every VM from its subdomains
```
## Options
```text
-g, --global change your rules for every VM instead
-h, --help help for deny
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
-g, --global change your rules for every VM instead
-h, --help help for deny
--here use this folder's own VM, never that of a folder it's inside
--method METHODS narrow each rule to these METHODS of a host's requests, such as GET,HEAD
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--path PATH narrow each rule to the requests whose path matches PATH, such as /repos/ for everything below /repos/
```
## Options inherited from parent commands
+48
View File
@@ -0,0 +1,48 @@
---
title: devvm network lock
explainer: "Lock this folder's VM to the hosts it learned, on the allowlist tier"
---
Lock this folder's VM to the hosts it learned, on the allowlist tier
## Synopsis
For this folder's VM, which learns the hosts it reaches, choose in a list which of the hosts it reached beyond its allowlist to add to its own rules, then give it the allowlist tier at once. Only a host on port 443 of a package registry or vendor that devvm knows, such as registry.npmjs.org, starts ticked, and risky ones are listed apart, so read the list before you confirm it. Without a terminal, --all adds every host and --none adds none, and --json lists the hosts and changes nothing.
```text
devvm network lock [flags]
```
## Examples
```text
devvm network lock # choose the hosts the VM keeps, then lock it to them
devvm network lock --json # list the hosts it learned, changing nothing
devvm network lock --all # keep every host it learned, without asking
```
## Options
```text
--all add every host the VM learned, without asking
-h, --help help for lock
--here use this folder's own VM, never that of a folder it's inside
--json print it as one JSON object, for scripts
--none add none of the hosts the VM learned, without asking
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm network lock](../safety/network.md#locking-it) explains it in full.
## See also
- [devvm network](devvm_network.md): Show or change the network tier of this folder's VM
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm network log
weight: 38
explainer: "Show what this folder's VM connected to and what its proxy blocked"
---
Show what this folder's VM connected to and what its proxy blocked
Loaded 100 of 1306 files, more files were not shown because too many files have changed in this diff. Show more