Files
devvm/testdata/script
w3cjandClaude Opus 5.5 628dc11c94 feat(state): a layout version for devvm's folders, made_by in its records, the golden listing and doctor's leftovers in vms/
The data and config folders each hold a version file (state.Layout, 1).
state.CheckLayout runs before every command but help, completion,
version and devvm's hidden commands, under version.lock: the same
version goes on, a missing file gets this devvm's, an older one runs
the migrations in order (migrations(), empty now), and a newer one in
either folder refuses with layout_newer; a file that isn't a version
fails with layout_unchecked.

made_by, devvm's version, is in vm.json's core fields (set when the VM
is made, kept by later changes), image records and tool image records.
It's passed from cli's devvmVersion through vm.NewEnv, tools.New and
build.Env.Version.

testdata/script/layout.txtar makes two network-policy VMs with a
forwarded port, a link and a secret, and compares every path under the
data and config folders with checked-in listings (macOS and Linux).

devvm doctor warns about entries in vms/ that aren't VM folders
(vms_stray) and VM folders without vm.json (vm_folder_stateless),
changing nothing.

Tests: TestMigrations, TestCheckLayout, TestCheckLayoutMigrationFails,
TestVMFolderProblems, TestSkipsLayout; made_by checks in TestVMRoundTrip,
TestImage, TestToolImage, TestUp, the build and tools tests and scripts;
doctor's unit test and script. Docs: internals/overview (the layout
version, made_by), using/space, using/settings, using/troubleshooting,
internals/images, Contributing (changing the state layout).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 15:50:49 -07:00
..