provision, resolve and exec answer the workspace's path, and a tool
result goes to the vendor in the agent's next request. With the default
root ~/.magpie-layerfs every provision named magpie upstream.
The default root is now ~/.layerfs-tools. A ~/.magpie-layerfs made by
0.7.2 or earlier is renamed to it once, at the first backend made, and
a link is left at the old path, so a session still holding an old
workspace path keeps working. A legacy root that is itself a link (the
user's own setup) is used where it is, as is one the rename is refused
on. MAGPIE_LAYERFS_HOME set by the user is unchanged. A second host
racing the rename finds the new root and uses it.
Run, in a sandbox HOME:
- bun test packages/layerfs: 53 pass, 0 fail. bun scripts/check.mjs
layerfs: ok.
- The three #360 tests against the old default (defaultRoot answering
~/.magpie-layerfs): 2 of them red, the third (a user's link) is
unchanged behaviour.
- Through magpie's real plugin host (origin/main 4dfd88206,
plugin.Add of this package + plugin.RunTool "provision" in a
testenv sandbox HOME): a fresh home answers
~/.layerfs-tools/workspaces/demo/main and makes nothing at the old
name; a home with a ~/.magpie-layerfs holding a marker answers the
new path, the marker is under ~/.layerfs-tools, and ~/.magpie-layerfs
is a symlink.
Not tried: Windows (the link is a junction there), and moving a root
while an agent's exec runs in it.
Both test files remove every temp dir in one afterAll. On a loaded box
that took 6-7.5s and went red against bun's default 5s hook timeout.
The hooks now carry their own bar.
Run: with a 7s Bun.sleepSync injected into layerfs.test.mjs's hook,
the old bar fails ("a beforeEach/afterEach hook timed out", 28 pass
1 fail) and the new one passes (28 pass 0 fail). Test-only change, so
no version bump.
New community tools package @magpie-community/tools-layerfs 0.7.1 (Mola-maker): LayerFS workspaces as tools for every agent. It imports a source folder into a versioned workspace under MAGPIE_LAYERFS_HOME (default ~/.magpie-layerfs), with checkpoints, history and diffs. Running commands (exec) is off unless the user turns it on. No network access. registry.json gains its one entry.
Run at the reviewed head 4795df0 (merges cleanly onto origin/main 1ae89aa):
- bun scripts/check.mjs layerfs: ok
- bun test in the package under a temp HOME: 48 of 48 pass, worktree clean after
- the seven points from the last review, each re-run:
1. source guard: ~/.Config/Magpie, a symlink to ~/.config/magpie, ~/.AWS, ~/.CONFIG and a symlinked parent are all refused
2. names: project a / branch b--c and project a--b / branch c no longer share a workspace; Main and main are apart
3. layerfs_history {limit:1} at 200 checkpoints: 0.1 ms (151 ms before), no trajectory.json written
4. native backend and its SDK path removed; asking for it throws a clear error
5. repository points at this repo; README images pinned
6. runShell: cat returns in 32 ms (2005 before), a backgrounded sleep doesn't hold the call, a timeout kills the process
7. storedBytes equals stored content plus checkpoint records; the description says so
- read every line changed since 1c9e4c1: no path escape, no writes outside its home
Not tried: a real agent using the tools through magpie.
Known: something exec starts in the background keeps running after a successful call, like a normal shell, and can land in the next checkpoint.