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]>