mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
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]>