Commit Graph
34 Commits
Author SHA1 Message Date
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
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 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
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 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 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
w3cjandClaude Opus 5.5 e9bd270398 docs: brew trust before brew install, as Homebrew 7 asks
The --confirm flag's ssh-askpass hint names no tool: put one on PATH or set SSH_ASKPASS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 09:20:11 -07:00
w3cjandClaude Opus 5.5 a85cba7858 build(release): scripts/publish.sh, a release from a signed tag in one run
The maintainer tags main's HEAD (git tag -s vX.Y.Z) and runs
mise exec -- scripts/publish.sh, entering the minisign password once.
It checks the preconditions (release.sh --check for the tag and its
signer, main's HEAD and origin, a clean tree, gh logged in, minisign,
no other release, the tap's checkout clean on main), builds dist/ with
release.sh, prints the version, commit, files with sizes and SHA-256s,
the CHANGELOG entry and the tap's diff, asks once on the terminal, then
pushes main and the tag, makes the GitHub release as a draft with every
file and publishes it, and commits and pushes the tap's formula. Each
step skips what's done, a draft left by a failed run gets its files
again, and a failure says what was and wasn't published. --dry-run
stops before the question; --help.

release.sh gains --check (the tag's checks only, printing its commit),
fills in the formula's @URL@ and @SHA256@ only outside its comments,
and points at publish.sh in its last line.

Tests: testdata/script/publish.txtar (a local bare origin and tap, a
fake gh, SSH-signed tags, a passwordless minisign key): refusals (no
tag, a tag release-signer doesn't pin, a dirty tree, an existing
release without its files, gh logged out, no tap), --dry-run, n, y
failing at gh release create then at publishing the draft, the reruns
and the call order, and a run with everything done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 07:56:07 -07:00
w3cjandClaude Opus 5.5 586b45f9ad fix(release): install.sh's checksum in the signed SHA256SUMS
release.sh wrote install.sh after it signed SHA256SUMS, so nothing signed
covered the script and checking it by hand with the release key wasn't
possible. It now writes install.sh, adds its checksum to SHA256SUMS, then
signs. install.sh and devvm upgrade look up their archive by name, so the
extra line changes nothing for them. release_head.txtar checks the line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 07:25:15 -07:00
w3cjandClaude Opus 5.5 8d44175601 refactor: the Go module is github.com/devvmhq/devvm
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 06:16:29 -07:00
w3cjandClaude Opus 5.5 2545de19f3 test(e2e): the Go runner is the entry point, mise run e2e -- FLAGS, and tests/e2e.sh goes
TestE2E already set up the sandbox, slots, locks and flags itself, so the
898-line script only handed over. The run is now `mise run e2e -- FLAGS`
(go test -tags e2e from tests/e2e, CGO_ENABLED=0) with the same flags:
--only, --from, --clean, --every-feature, --slots, --slot, --newest-base,
--golden, plus --reuse.

- options: the flags named as the script's options; the hand-over flags
  (lock-holder, count, total, started, summary) and the ported/unported
  split are gone.
- e2eUbuntuRelease, a const in sandbox_test.go, holds the Ubuntu pin;
  scripts/bump.sh e2e-ubuntu moves it (get_const), and TestE2EUbuntuPins,
  bump.txtar and the E2E workflow read it there.
- From the script into Go: the OpenSSL-not-LibreSSL host check, and
  --newest-base's start line and its UPSTREAM DRIFT summary.
- The script's leftover bash helpers (perl vm_state, no_leak, ca_*,
  lima_listens, the retry list, its heartbeat) are gone with it.
- mise's e2e:go task merges into e2e; TestCommandLines drops its $D rule.
- Docs (contributing, testing, maintaining, internals) and AGENTS.md name
  mise run e2e; testing.md's "Porting a section" becomes "Adding a section".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 01:56:50 -07:00
w3cjandClaude Opus 5.5 500f70d8b0 test(e2e): the link and from sections in Go
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 22:41:09 -07:00
w3cjandClaude Opus 5.5 15e063c616 chore: the Homebrew tap is devvmhq/tap
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 00:14:40 -07:00
w3cjandClaude Opus 5.5 f4f2ec6a8f chore: the repo is devvmhq/devvm
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 00:09:04 -07:00
w3cjandClaude Opus 5.5 09f7f3b568 test(e2e): the Go end-to-end runner, tests/e2e, and its gc section
tests/e2e (build tag e2e) is the end-to-end runner in Go that takes over
tests/e2e.sh's sections one at a time. TestE2E is the run, with
tests/e2e.sh's options as flags (-e2e.only, -e2e.from, -e2e.clean,
-e2e.every-feature, -e2e.slots, -e2e.slot, -e2e.newest-base, -e2e.golden)
and its own -e2e.reuse. It keeps the sandbox (each slot's paths, Lima
home, XDG folders, Keychain service, ports +100 per slot, the lock),
devvm built from the checkout, config.toml and the pinned tool lock, the
host-tool check, the output lines (PASS/FAIL/SKIP/RETRY [n/N], times,
ETA), the heartbeat, each check's time limit (process groups: TERM, then
KILL), the timings files and the check-count guard (keyed by a checksum
of tests/e2e's Go files), the retry of checks marked Flaky, the slots'
plan, seeding (clonefile, reflinks) and summing, and the cleanup of only
what the run made.

Files: main_test.go (TestMain, TestE2E), options_test.go (flags),
sandbox_test.go, runner_test.go, check_test.go (S, Check, Skip, Flaky,
Builds, Tail, Needs), cmd_test.go (Run, Devvm, DevvmNames, Msg, Limactl,
InVM, Status), state_test.go (Paths: State, VMOf, VMDir, KeysOf, Record;
NewProject, Launch, Reuse, Layer, Own, Until, Settle, Port, Defer),
shared_test.go (Golden, GoE2E), slots_test.go, clone_{darwin,linux}_test.go,
sections_test.go (the table), gc_test.go (the gc section, its five check
titles tests/e2e.sh's word for word) and harness_test.go (TestHarness*,
no VM, run by scripts/test.sh).

tests/e2e.sh no longer has the gc block: after its own sections it hands
the chosen sections that go_sections lists to TestE2E in its sandbox and
under its lock, passing its pid, check count, expected total and start,
and adds the Go run's summary.go to its results. mise run e2e:go runs the
Go runner on its own. golangci-lint builds with the e2e tag; tests/e2e may
print, exit from TestMain, signal its own process groups, and run and read
its sandbox's commands and files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 21:28:44 -07:00
w3cjandClaude Opus 5.5 0941219a76 feat(build): base's packages recorded per key, replayed from a host cache
base's apt packages are no longer pinned by a snapshot. A key's first
build of base records them: assets/layers/apt.sh (a recipe step, as
root, before base.sh and after the last feature) points the image's
sources at an apt mirror+file: list of config.toml's ubuntu-mirror and
then Ubuntu's own archive, so apt checks everything against the archive
key whichever server answers, and keeps what it downloads. At the end it
gives back each package with apt's entry for it. devvm checks what comes
back (regular files only, each named by its own SHA-256, each entry
matching a file's size and SHA-256, nothing left over, at most 20,000
entries and 16 GiB), keeps the files in
~/.local/share/devvm/packages/<sha256>.deb and the key's set in
packages/sets/<key>.json, before the image's record. Every later build of
that key replays the set from the cache, checked on the host first, with
apt given only those files: no network for base's packages, and a key's
packages never change. A --from base keeps its image's own sources,
unpinned. base keeps no package lists, so each layer's recipe starts
with apt.sh lists, which fetches them when there are none.

- backend.ImageSpec.Packages (Send before the steps, Take after) and
  backend.PackagesDir; Lima runs both over limactl shell as root.
- Fail fast: apt.sh turns apt's retries off and exits 75 when no source
  answers, which Lima reports as build_sources_unreachable.
- packages_missing refuses a replay whose cached file is gone or changed;
  packages_refused what a build gives back that isn't packages.
- config.toml's ubuntu-mirror (settings.UbuntuMirror), checked as an
  http(s) address without a user, query or spaces (ubuntu_mirror_invalid).
- devvm gc deletes the sets of keys neither current nor built, then,
  under the cache's lock, the files no set names at that moment, and
  builds' leftover folders over a day old (gc_packages,
  deleted_packages); devvm space lists the cache.
- The snapshot is gone from base.sh, guest/sync.sh and desktop.sh, and
  scripts/bump.sh's apt step with it.
- Tests: recording then replaying, a missing or changed cached file,
  every refusal of what comes back, gc's view of the cache and its race
  with a new set, the set record, the mirror setting, Lima's exchange and
  exit 75, apt.sh's mirrored and record functions, apt.sh in the keys;
  the limactl stub keeps what's sent and gives back
  $STUB_DIR/packages-out.tar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 11:58:23 -07:00
w3cjandClaude Opus 5.5 e93f29333a feat(ubuntu): pin the newest signed cloud image at base's first build
devvm's files keep only Ubuntu's release (26.04) and its cloud image key.
The first build of base on a machine pins the newest dated release whose
SHA256SUMS carry a valid signature from that key and list an image for the
host (state.UbuntuPin, images/ubuntu.json), and every later build uses the
pin without looking anything up. devvm rebuild base pins the newest again.
The pin is in base's recipe, so base's key hashes it.

The signature is checked in Go (internal/ubuntu/pgp.go: OpenPGP v4 RSA
signatures with SHA-256/384/512, the standard library's crypto), so no
gpgv is needed and a host without one is no longer unchecked.

- backend.Images gains PinOrigin (backend.Pin: PinFirst, PinNewest,
  PinOlder); internal/build pins before it keys a build, and says what it
  pinned (origin_pinned).
- Lima: Origin and createFromUbuntu read the pin; PinOrigin finds the
  newest with ubuntu.Finder (Newest, Release) under images/locks/ubuntu; a
  --from conversion pins only when nothing is.
- Messages: ubuntu_unreachable and no_ubuntu_release; ubuntu_unsigned and
  ubuntu_checksum_unpinned are gone.
- e2e pins its own release (DEVVM_UBUNTU_RELEASE, a test override;
  scripts/bump.sh e2e-ubuntu moves it); bump.sh's apt moves the package
  snapshot alone. The gpgv stub is gone.
- Tests: the verifier against Ubuntu's real signature and a test key
  (damaged keys and signatures, packet and subpacket lengths, armor),
  Newest/Release, PinOrigin, the pin record, and the key covering the pin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 11:27:25 -07:00
w3cjandClaude Opus 5.5 1516133e5a test(e2e): pin the --from images by digest, and the tool lock outside the tools section
Every section but tools uses tests/e2e-mise.lock, the shared tools'
versions resolved for both architectures' glibc and musl VMs, so the
tool images built for them stay cached between runs. The tools section
resolves upstream's newest first (its resolve check moves there) and
puts the pins back at its end. The lock's first line is the SHA-256 of
the assets/shared-tools/mise.toml it was resolved from, and a run stops
at once for another.

The from section's images, and the link section's Alpine client, go by
digest: node:24, alpine:3 and ubuntu:26.04 pinned at the top of
tests/e2e.sh. The company proxy's alpine:3.21, converted each run
anyway, keeps its tag, so devvm's registry lookup is still checked.

scripts/bump.sh moves both pins: e2e-tools runs devvm's pinned host
mise's mise lock for the four platforms and refuses a tool without a
checksummed download on each; e2e-from takes each tag's index digest
from Docker Hub, its pull token passed to curl in a header file, never
in its arguments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 00:55:30 -07:00
w3cjandClaude Opus 5.5 f4fd373439 refactor(backend): remove the smolvm backend
Lima is devvm's only backend. The backend architecture stays (Backend,
Caps, Features, Review/Require, the registry, backendtest.Fake), so
another backend is an addition.

State from a smolvm VM reads as an unknown backend (backend_unknown_vm,
gc_orphans_unknown); nothing migrates it. The image keys of
layers/docker.sh, layers/nix.sh and features/desktop.sh change, so images
rebuild once.

Lima's port forwarder moves off smolvm's files first: newForwarderCmd and
forwarderMain from internal/cli/smolvmports.go to limaports.go, and
assets/container/ports.sh to assets/guest/ports.sh (sent by the forwarder
at run time, so no image key changes).

Removed:
- internal/backend/smolvm (4,070 lines with tests), _smolvm-ports, its
  registry entry, registry.Experimental and backend_experimental.
- The decider: backend.Decider/UsesDecider, Confinement.Decider and
  DeciderToken, internal/proxy/decider.go and its test, the proxy's
  -decider, -decider-to and -decider-token-file, netpolicy's
  KeyDeciderPort, KeyDeciderToken and deciderToken, the decider port in
  vm's forwarding and UsedPorts.
- backend.AgentStarter/AgentUnchosen, vm's checkAgentStart and
  agent_unchosen_stop.
- vmssh/key.go (EnsureKey, Public, HostKey, ServicesArgs, Capped).
- paths.Smolvm/SmolvmImage and space's smolvm folders; paths.VM's
  Record, Key, KnownHosts and ProxyURL; project.Detect, which nothing
  called (a test helper now).
- ubuntu.ContainerRepo/ContainerDigest/ContainerRef/ContainerOrigin and
  bump.sh's ubuntu_image, with its part of bump.txtar.
- assets/smolvm/ and assets/container/; the no-init-system branches of
  layers/docker.sh, layers/nix.sh and guest/sync.sh, and the notes in
  features/desktop.sh and guest/ca.sh.
- Messages: smolvm_* (14), vm_no_ssh, vm_no_sshd, ports_no_ssh,
  creating_from_image, packing_image, pack_failed, backend_experimental,
  agent_unchosen_stop; descriptions naming smolvm reworded.
- Tests: smolvm.txtar, the smolvm stub, registry, decider, netpolicy and
  sshagent cases; gc_backend, gc_skipped, gc_orphans and space test a
  failing or hanging Lima listing instead (the limactl stub's list-fails
  and list-hangs); the --backend smolvm examples; e2e's --backend smolvm
  and its section (about 1,130 lines), the smol_* helpers and the
  link section's backend switch.
- Coverage: internal/backend/smolvm's lines in both baselines.
- Docs: backends/smolvm.md, internals/smolvm.md, design.md's smolvm
  notes (Ports on Lima now holds the forwarder's description), the
  backends table's smolvm column, every page naming smolvm, the README,
  the home page's backends art, and AGENTS.md's smolvm rows and gotchas
  (and the Docker bind-mount gotcha, which nothing refers to).

Kept: the docker layer, on Lima; --from's local Docker; --backend, the
BACKEND column and setup's backend choice, which the next commit removes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 11:34:05 -07:00
w3cjandClaude Opus 5.5 1917072228 refactor(backend): remove the Docker backend
devvm is about VMs, and Docker's containers aren't VMs: Lima is the
default backend and smolvm stays experimental. The backend architecture
(Backend, Caps, Require, the registry, backendtest.Fake) stays, so
another backend is an addition.

Removed:
- internal/backend/docker, its registry entry and Names/Experimental's
  docker half; devvm _docker-connect and _docker-ports
  (internal/cli/dockerssh.go); assets/docker/unpack.sh.
- Test-build overrides DEVVM_DOCKER_KIND, DEVVM_DOCKER_PROC_SYS,
  DEVVM_LINUX_BUILD_URL/_SHA256, the registry.linuxURL/linuxSHA256
  ldflags vars and the CLI tests' Linux-build archive (linux_release).
- Interfaces only Docker implemented, with their callers:
  backend.ProxySocket/ProxySocketOf (the proxy's -listen-unix),
  DiskUser (ls's and size's disk-over warning, size's disk_used and
  --json disk_used_gib), Reporter (doctor), LeftoverLister and Leftover
  (gc --orphans' volumes, networks, containers and images),
  DockerLayerVM and VMSpec.DockerLayer, SSHTarget.ProxyCommand and
  vmssh.SSH.Proxy, vmssh.SSH.SessionArgs, CacheEntry.Name.
- The docker layer's runtime on a backend that makes VMs for it:
  vm/dockerlayer.go, KeyDockerLayer, chooseNet's refusal (chooseNet
  returns a bool now), the refusals at start and devvm network on, ls's
  "(sysbox)" and --json docker_layer, size_disk_default_unused.
- The proxy's relay mode (relay.go, -relay, -relay-to, -listen-unix).
- paths.Dirs.Docker and paths.VM.Lifeline.
- assets/guest/tools.sh's linked-folder branch; services.sh's
  DEVVM_LOOP, DEVVM_DOCKERD and DEVVM_SSHD=inetd.
- Messages: every docker_* the backend used, docker_layer_runtime,
  net_docker_layer, net_off_docker_layer, committing_image,
  pulling_image, unpacking_tools, disk_over, size_disk_default_unused,
  gc_orphan_volume/_network/_container/_image, docker_connect_failed;
  gc_orphan_elsewhere reworded.
- Tests: docker.txtar, the docker stub's engine (its --from half
  stays), the ssh stub's login-shell branch; e2e's --backend docker,
  --engine, the docker host VM and Docker Desktop runs.
- Release: one GoReleaser pass, no Linux-build pin in the macOS builds,
  no Linux devvm in the Homebrew formula's libexec. Linux builds stay.
- Docs: backends/docker.md and internals/docker.md, design.md's Docker
  notes, the Docker column of the feature table, and every page's
  mentions of the Docker backend, Docker Desktop as one, and Sysbox.

Kept: the docker layer in Lima VMs, devcontainer docker-in-docker,
--from with images only a local Docker has, Docker Hub references.

State written by a Docker VM before this reads as an unknown backend
(backend_unknown_vm).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 10:26:07 -07:00
w3cjandClaude Opus 5.5 ee8146a5e4 fix: scripts and tests work without shasum, and two CLI scripts start Lima outside devvm on bash 5.2's sh
Fedora 43 has sha256sum but no shasum (Perl's Digest::SHA), and its /bin/sh
is bash 5.3, which runs the last command of an `a && b` -c string in sh's
place.

- install.sh's check_host stops with "needs sha256sum or shasum" before
  downloading; its sha256 already used either. install.txtar covers
  shasum alone, both, sha256sum alone and neither, with made-up sums.
- scripts/release.sh and scripts/bump.sh get a sha256 helper (sha256sum,
  else shasum -a 256) in place of four shasum calls.
- gc_orphans, release, release_head and tools scripts hash with sha256sum,
  else shasum. tools' old fallback never fell back (the pipeline's
  status was cut's).
- ls and existing_agents restart a VM outside devvm with
  `sh -c '... && limactl start ...; exit $?'`: without the exit, bash's
  sh exec'd the stub, whose ha.pid then named the test runner (the pid
  devvm recorded), so the VM still looked confined.
- The install page lists sha256sum or shasum among the script's needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 07:13:46 -07:00
w3cjandClaude Opus 5.5 6f9259b514 test: give each CLI test script its own coverage folder
The CLI tests' devvm is built with -cover, and every script set one
GOCOVERDIR. Go names a run's temporary meta-data file by the time
(time.Now().UnixNano(), microseconds on macOS) with no process ID, so two
devvm runs from parallel scripts that start together write the same
temporary file; the first renames it and the second's rename fails, and
devvm prints "coverage meta-data emit failed" on stderr, failing any
script that checks stderr (seen in ls.txtar and version.txtar).

- script_test.go: scriptCoverDir sets GOCOVERDIR to a folder of the
  script's own (os.MkdirTemp under CLI_GOCOVERDIR).
- scripts/test.sh: covdata merge takes the unit folder and every
  non-empty script folder as one comma-separated -i list, so percent and
  the baselines read the same counters as before.
- Contributing's Coverage section says each script writes to a folder of
  its own, and why.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 22:04:17 -07:00
w3cjandClaude Opus 5.5 b5742dca2c build: a package's coverage may sit up to a point below its baseline
The same tests can cover a little less from run to run, with timing or the
tools a machine has, so mise run test fails a package only when it is more
than a point below its baseline (COVERAGE_TOLERANCE, 1 by default). A package
within that point passes and keeps its line, so a baseline still never goes
down. coverage.txtar covers within, beyond and a tolerance of 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 15:06:25 -07:00
w3cjandClaude Opus 5.5 ddbc377f8f test: testscript commands for the scripts' setup, and a coverage baseline per package
script_test.go's sandbox sets DEVVM_MESSAGES=names and DATA, VMS, RUN
and CFG by default, and adds stub_reset, catg (the one file a glob
matches), vm_name VAR NAME (the folder's VM) and project NAME [git];
script_cmds.txtar checks each. Every script is rewritten onto them, its
assertions kept; TestCommandLines leaves the scripts' own commands out.

mise run test runs scripts/test.sh: the tests as before, with the CLI
tests' devvm built with -cover for every package (CLI_GOCOVERDIR),
merged with the Go tests' counters by go tool covdata, then
scripts/coverage.sh holds each package to testdata/coverage/<os>.txt.
mise run coverage raises the baselines; coverage.txtar checks the
comparison. The macOS baseline is recorded from this tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 14:25:09 -07:00
w3cjandClaude Opus 5.5 91a429108f feat(images): a built-in nix layer with Nix, direnv and nix-direnv, pinned
nix is a layer devvm ships, as docker is: devvm nix, devvm node+nix, devvm
build nix, or added to an existing VM in place. A folder with flake.nix,
shell.nix or devenv.nix at its top level, or a default.nix that makes a
shell (mkShell), gets it after its toolchains, so package.json and flake.nix
give node+nix.

- assets/layers/nix.sh: Nix 2.35.4's release tarball (releases.nixos.org),
  its version and SHA-256 per arch at the top, checked against the
  tarball's .sha256 files and nixos.org/nix/install, fetched with
  devvm-fetch; 2.35.3 fixes GHSA-hf6w-2rg9-v84g (store ownership in the
  scripted installer) and CVE-2026-110450 (store corruption through the
  daemon's repair flag). The tarball's own install --daemon --yes
  --no-channel-add, with experimental-features = nix-command flakes,
  trusted-users = root, sandbox = true and sandbox-fallback = false. The
  installer runs without proxy variables (it writes any it finds into a
  systemd override for nix-daemon, which would put a build's proxy into
  the image) and with NIX_SSL_CERT_FILE at the system's bundle. The layer
  checks the store is root's, adds Nix's default profile to the end of
  sudo's secure_path (/etc/sudoers.d/devvm-nix, checked with visudo), and
  appends Nix's profiles to BASH_ENV's PATH. direnv 2.38.2 (per arch) and
  nix-direnv 3.2.0's direnvrc, pinned the same way; direnv's hook in
  ~/.bashrc.d/direnv.sh, which loads before mise.sh so direnv's prompt hook
  runs after mise's and a dev shell's PATH comes first; a direnv lib file
  puts each project's layout under ~/.cache/direnv/layouts, so nix-direnv
  writes no .direnv into the project folder. Without systemd the script
  refuses in one line.
- assets/layers/nix.policy: cache.nixos.org, channels.nixos.org,
  releases.nixos.org (GitHub is in base.policy).
- assets/guest/sync.sh: nix-daemon gets a systemd drop-in with the VM's
  proxy (http_proxy, https_proxy, no_proxy) under network policy, removed
  when it's off, the daemon restarted when it changed.
- image.NixLayer in Builtins; project.Detect's nix marker (a default.nix is
  read only as a regular file, at most 64 KiB); backend.FeatureNixLayer
  (nix-layer), needed by a VM of an image with the layer and by building
  one: Lima native, smolvm and Docker none, so both refuse in one line
  (backend_lacks); dockerLayers.choice returns every layer feature of the
  image, so docker+nix on Docker needs nix-layer too.
- scripts/bump.sh: nix (the version nixos.org's installer names, the
  sums Nix publishes; it fails when the installer names no tarball, as
  Nix's Rust installer will), direnv, nix-direnv.
- Docs: using/images (built-in layers, detection), using/toolchains (Nix
  projects), safety/network (the layer's hosts; source builds' hosts
  blocked), internals/images (the nix layer), internals/network (the
  daemons' drop-ins), internals/backends (nix-layer), internals/design
  (the nix layer beside Instead of Nix), backends, customizing,
  coding-agents, contributing (the e2e section); the CLI reference;
  AGENTS.md's assets/ and e2e lines.
- Tests: Detect (markers, default.nix with and without a shell, a linked
  one), layer and environment lists, layer new nix reserved, nix-layer in
  ImageSpec and ImageFeatures, caps tests, up_checks.txtar (node+nix
  detected under an agent), docker.txtar (nix refused for a VM and a
  build). e2e nix section: the layer built behind a company proxy leaves
  no proxy settings and no password on its image's disk; a node+nix flake
  VM with network policy: pins, a root-owned store, sandbox without
  fallback, trusted-users root and an untrusted substituter ignored, the
  daemon's drop-in, nix run nixpkgs#hello, sudo nix and nix over ssh, the
  flake's node ahead of the shared node prompt after prompt through
  direnv, no .direnv in the folder, a blocked fixed-output fetch named by
  devvm-why, and the drop-in gone after network off.

Review (security-audit skill, guidance mode, against the review task's
list): the tarball and direnv's files are pinned in devvm's source and
checked before tar or install runs; nothing from the host goes into the
image (no proxy override, e2e greps the disk); the drop-in holds only the
VM's own proxy URL, devvm's value, and goes when policy is off;
trusted-users stays root and an untrusted user's substituters are
ignored (the VM's user has sudo, so that guards an honest VM and the
allowlist is what holds); secure_path gains only the root-owned default
profile, last; /nix is on the VM's own disk and nothing mounts a host's
or another VM's store. Found and fixed in review: Nix's default
sandbox-fallback would build unsandboxed without a word where the kernel
can't sandbox, so it's off. No confirmed findings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 12:22:02 -07:00
w3cjandClaude Opus 5.5 857c0e8c53 docs(site): sections in the reader's order, attack vectors and a first-VM page
The docs move into a folder per sidebar section, in the order a new user
needs them: getting-started (install, first-vm, commands), using (images,
customizing, from, devcontainer, coding-agents, ssh, limits), safety
(attack-vectors, network, clone, git-protection, security), backends
(backends.md as the section's _index.md, lima, smolvm, docker), internals
(design), cli, and contributing (contributing.md as its _index.md,
testing, maintaining). Each section has an _index.md listing its pages,
and the docs index is grouped the same way. Commands is now Everyday
commands, SSH is SSH and editors.

New pages:
- safety/attack-vectors.md: Staying safe first (seven habits), then
  common attacks sorted into Blocked, Kept inside the VM, Narrowed, not
  closed, and Left to you.
- getting-started/first-vm.md: making a VM, the first run, what's in it,
  coding agents, coming back to it.

Links to Staying safe from the home page, README, security, install,
coding agents and clone. Every relative link, the home page's, the
README's, SECURITY.md's, CONTRIBUTING.md's, AGENTS.md's, the proxy and
oci READMEs', release.sh's hints and the recording's URL use the new
paths. internal/msg/docs.go names pages by path (using/images#...), and
checkDoc takes a section's _index.md for its folder (backends#...).
contributing/_index.md describes the sections and how links name them.

Also carries the docs edits made alongside the forwarder work in the
tree (backends, images, limits, security, design, commands and the
generated devvm ports page), whose code isn't in this commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 23:20:58 -07:00
w3cjandClaude Opus 5.5 cf5a7db974 fix(images): pin Lima's Ubuntu cloud image with base's snapshot
Lima's base starts from a pinned dated Ubuntu cloud release (release-20261016) with each architecture's SHA-256, checked against Ubuntu's signed SHA256SUMS; another checksum is refused (ubuntu_checksum_unpinned). The pin is in base's image key (Lima's KeyFiles). scripts/bump.sh apt moves it with the snapshot and container digest: the newest release dated before the snapshot, its SHA256SUMS checked with gpgv against Ubuntu's cloud key.

e2e: default tier 146/0, --only from 13/0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 05:13:12 -07:00
w3cjandClaude Opus 5.5 fcbea2c744 feat(docker): network policy, and build confinement on Docker Desktop
A Docker VM with network policy sits alone with a relay container on an
internal network of its own (inhibit_ipv4). The relay, devvm's own Linux
build in an empty imported image (read-only, every capability dropped),
copies the VM's connections to a unix socket of devvm's proxy on the
host, so tokens, the Keychain, the CA key and agents' logins never enter
Docker. On and off is docker network connect/disconnect at the next
start. Desktop builds run on a network and relay of their own, through a
host proxy allowing any host on ports 80 and 443.

- every Docker VM drops NET_RAW; it's in the config hash, so containers
  are made again from their commit
- confined: the start's ID, the VM alone on its network with the relay
  by its recorded container ID, the network still internal; a foreign
  member is docker_network_shared, at start and on removal
- proxy: -listen-unix, -relay/-relay-to; a lifeline pid file written
  after the proxy started whose process has gone ends it
- macOS fetches the release's Linux build on first use, checked against
  a SHA-256 the two-pass release.sh bakes in; builds without the pin use
  devvm-linux-<arch> beside devvm or refuse
- the build proxy is stopped through the process devvm started
- reviewed: design notes and threat check in design.md; e2e on the
  Linux engine and Desktop: dropped capabilities, network members and
  options, no IPv6 beyond the bridge's link-local, no DNS query leaving
  (captured, with an unconfined control), direct connections refused

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 05:08:03 -07:00
w3cjandClaude Opus 5.5 2b413028e6 fix(images): pin Ubuntu's container image with base's package snapshot
smolvm's and Docker's base start from Ubuntu's container image by a
digest pinned in internal/ubuntu (ContainerDigest), not the tag's digest
looked up at build time. base's key hashes it (each backend's KeyFiles),
and base's record names it. The image is never newer than
assets/layers/base.sh's snapshot: an image with newer packages leaves apt
unable to install what depends on their exact versions (the docker
layer's docker-ce, through systemd's libsystemd0).

- internal/ubuntu: ContainerRepo, ContainerDigest, ContainerRef,
  ContainerOrigin; the backends' Digest fields and UbuntuImage go.
- base.sh: apt_snapshot 20261026T000000Z, with the image's digest
  sha256:19fcd1bf268f (built 2026-10-25).
- scripts/bump.sh: apt moves the snapshot and the image's digest
  together (the index's digest hashed from what the registry sent), and
  refuses an image built after the snapshot; bump.txtar covers both.
- tests/e2e.sh: timings per selection and Docker engines, so an
  --engine linux run isn't compared with one that included Desktop; the
  Linux engine's run pulls the pinned Ubuntu image before recording what
  Docker has without the sandbox's label; base's records are checked
  against the pin; smolvm's TSI check takes any of this machine's
  resolvers; the from section allows devvm's labelled VM listing.
- docs: smolvm, Docker, images, maintaining, contributing; design.md's
  smolvm notes describe the reviewed emulations as they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 01:16:57 -06:00
w3cjandClaude Opus 5.5 e6681035b2 feat(images): a built-in docker layer
Docker is a layer devvm ships, docker, chosen per VM like any layer
(devvm node+docker, devvm build docker) and added to an existing VM in
place. base installs no Docker.

- Built-in layers: image.Builtins (docker) and IsBuiltin; a name is
  looked up in devvm's assets/layers first, so a user's docker.sh is never
  read; devvm layer new docker is refused (layer_name_reserved); an
  image's key hashes the shipped script (own file, must exist); Layers,
  Environments, completion and unknown_layer/no_image_for list it;
  Env.LayerData reads either kind's script.
- assets/layers/docker.sh: Docker's apt repository (pinned key, pinned
  package versions; Alpine's own packages, rc-update, the docker group),
  the daemon started now too (OpenRC, or with no init system as
  services.sh does) for a VM it's added to in place. scripts/bump.sh's
  docker pins read it.
- assets/layers/docker.policy: Docker's packages and the registries,
  applied to VMs with the layer (netpolicy.PolicyFiles); base.policy
  keeps OS packages (Alpine's too), mise and GitHub.
- Adding layers in place sets the new image in the VM's state before
  their scripts run, so a network-policy VM's proxy allows their hosts;
  a failing script sets it back.
- smolvm's sshd.sh keeps the snapshot's package lists, for layers'
  apt-get install.
- Docs: images (base, built-in layers, keys), customizing, commands,
  network, smolvm, from, install, maintaining, design, coding-agents,
  contributing; the CLI reference; AGENTS.md's assets/ line.
- Tests: key, layers, build, policy files, in-place add (devvm's script,
  image during the run, set back on failure), layer new docker; e2e:
  a base VM has no Docker (Lima, smolvm), the docker layer on Debian 12
  and Alpine (from), and smolvm's network-policy VM is a docker VM whose
  Docker pulls through the proxy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 07:18:30 -06:00
w3cjandClaude Opus 5.5 9f24d2639e refactor: group devvm's files under assets/
assets/ holds the files devvm ships: base.yaml, layers/, features/,
shared-tools/ (mise.toml, build.sh, the tools' policies), guest/ and
oci/. devvm reads them from assets/ beside its binary (paths.Root,
paths.RootOf); releases, the Homebrew formula, the CLI tests and e2e
put them there. Image keys hash them by their names in assets/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 17:08:33 -06:00
w3cjandClaude Opus 5.5 37d2fa57e4 feat(install): install.sh for the per-platform release archives
install.sh picks this host's archive (devvm-<version>-<os>-<arch>.tar.gz:
darwin or linux, arm64 or amd64; Apple silicon's under Rosetta, from
sysctl hw.optional.arm64), checks SHA256SUMS's minisign signature (an
empty key still skips it, with a warning; no minisign prints the command
to check by hand), then the archive's checksum, and installs the binary
with its data files in <prefix>/lib/devvm/<version>, linked from
<prefix>/bin/devvm. Older versions go, except one a running process
names in its arguments (a VM's proxy, QEMU's guestfwd on Linux): it's
kept until a later install. Then it offers devvm doctor --fixes' fixes,
asking first (Homebrew's Lima or Lima's checked release tarball, QEMU,
the kvm group), and runs devvm doctor. Downloads are HTTPS only. Its text
isn't messages: it runs before devvm is there.

release.sh --head now needs install.sh too.

Tests: testdata/script/install.txtar sources install.sh (host and archive
names, Rosetta, version choice and validation, HTTPS-only fetch, run_fix
as words, install and links, reinstall, an older version in use kept
(and the real ps), signature good, bad, missing, no minisign, a bad
checksum, no archive for this host, Lima's tarball for the host and
arch and a bad checksum, the PATH hint, the fixes with --yes, the kvm
re-login, no yes, Lima's release once allowed, nothing missing, main's
options, and the tests' devvm binary installed and finding its files);
release_head.txtar: a HEAD without install.sh is refused.

docs: install.md (Homebrew and the install script, upgrading,
uninstalling), maintaining.md (trying install.sh on a --head build),
README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:24:22 -06:00
w3cjandClaude Opus 5.5 f42d436350 build(release): release.sh around GoReleaser, bump.sh
scripts/release.sh checks the signed tag (git tag -v) and its signer
against this checkout's packaging/release-signer, then runs goreleaser
release --skip=publish (--snapshot with --head) in a clone of the commit,
so only what's committed goes in. .goreleaser.yaml builds darwin/linux x
arm64/amd64 archives with the binary and its data files, a source
tarball and SHA256SUMS, with -X github.com/w3cj/devvm/internal/cli.version
(VERSION's version, for HEAD too). release.sh checks the host's binary
prints the version, signs SHA256SUMS with minisign and verifies it, fills
in install.sh (release_version, minisign_key) and the Homebrew formula,
which builds from the source tarball with Go (brew audit --strict clean).
--head takes DEVVM_MINISIGN_PUB for a test key, and skips a missing
install.sh; a tag without one is refused.

scripts/bump.sh writes the host mise's pins in internal/tools/mise.go.
VERSION and a fresh CHANGELOG.md. docs: maintaining.md (pins, releasing).
Tests: testdata/script/release.txtar (unsigned tag, no pin, another
signer, the checkout's pin, no install.sh), release_head.txtar (unsigned,
signed and verified, install.sh and formula filled in, only committed
files, wrong key, wrong version, bad install.sh, bad VERSION), bump.txtar
(crane, mise in base.sh and mise.go, hostile and missing values, --check
control characters, unknown tool). The sandbox sets DEVVM_REPO.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:04:37 -06:00