mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
A project VM mounts its whole folder read-write, so a nested project with a VM of its own is in the parent folder's VM too: code there can change the nested project's files, .git included where .git protection doesn't cover it, and replace its folder (which devvm's start refuses since the nested-replaced checks). devvm now says so each time it makes or opens such a VM: once per run of devvm, naming the nearest parent folder's VM that mounts the project (project_in_vm_folder, linked to using/vms.md's "A nested project replaced"). The finder owns the walk up: parentVM's loop over project.Parents is now finder.parents, which mountedBy shares. mountedBy reads only the states, so a stopped parent VM counts (it writes whenever it runs), and it passes over --clone VMs, which mount nothing, and states made for another folder. warnMounted skips a --clone VM of the folder's own, new or not. Only Up warns; devvm restart and the other commands don't. Docs: using/vms.md says when devvm warns and why; internals/overview.md how the finder finds the VM; attack-vectors.md's nested entry mentions it. Tests: TestWarnMounted (the nested VM's creation and next launch with the parent stopped warn once; the parent's own launch, the parent's VM in a subfolder, a new --clone VM and a parent --clone VM don't); nested_replaced.txtar checks the same through the CLI, and that devvm restart doesn't warn. Co-Authored-By: Claude Opus 5.5 <[email protected]>