Repository navigation
Description
I ran the native route on layerfs_v2_0_0 at 81f8758 on an M3 Max, macOS 26.6.2 (25G83), arm64, node v22.22.1, LayerFS built with rustc 1.85.1, no root and no Docker. The flow is what I want for several coding agents on one Mac: init a small Rust repo of mine (171 files, 13 MB), fork, mount, edit from the host with plain fs calls, git status and grep on the mount, commit, cargo build inside the Workspace, commit target/, fork that branch and build again, merge, close. All of it worked and nothing was left after close. Before that I ran the same on #427 at d3a2a8c and hit the same three problems
sandbox.create 18 ms
mount / exec / unmount 22-27 / 69 / 23-91 ms (first unmount 1.8 s)
2000 small files on the mount 1508 ms (197 ms on APFS)
cargo build, empty target/ 16.0 s with RUSTUP_HOME/CARGO_HOME set (11.9 s in a plain APFS clone, same ~/.cargo, measured earlier)
commit with target/ 3.5 s (551 MB logical, 107 MB new stored)
cargo build in a fork of a built branch 0.70 s
sandbox.close 5.7 s
- Agents that start at the same time fail on open. I started three node processes at once, each doing LayerFS.open, fork, sandbox.create, mount and 20 commits. In both runs two of the three got this from LayerFS.open:
LayerFSError: Failed: Store open: Store busy before effect
On d3a2a8c one also got Busy from branch.fork. With the starts 2 s apart and 30 commits each, all three commit loops overlapped with no errors (90 of 90, p50 111 ms against about 48 ms alone).
This comes from lane/writer_admission.rs. Store open runs a write transaction (add_binding_hints), and on Linux Writer::acquire waits on the Store directory's flock first. On macOS it returns at once, so SQLite's Busy comes straight out under the no-retry rule. The comment there says that's on purpose: Darwin's flock conflicts with SQLite's locks and Host Init is the sole owner. With native, though, every agent process opens the Store itself. I didn't run the same on Linux. LayerFS.open also reports this as code Failed (store_service.rs wraps every open error that way), so a caller can't tell it from a broken Store, while the same contention in branch.fork is code Busy.
- The Store's directory has to be private, and nothing says so. If it doesn't exist, init fails with
Unsupported: the Store's directory ... cannot be examined: ENOENT. Aftermkdir -p vol/globalwith the default umask, init succeeds and sandbox.create fails with only:
Failed: native sandbox stopped at Listener: Provider(LaunchFailure { phase: Listener, identity: None, cause: Protocol("local daemon exited before its listener line") }); its daemon's last log lines:
daemon I/O: private directory ownership/mode/type
That's the Store parent check in layerfs-daemon/src/application/config.rs. Init could check the mode up front, or create the directory 0700 when it's missing, and the native section of agent.md could mention it
- Commands get HOME=/tmp, so rustup, cargo and git don't see the user's setup. My first build downloaded the repo's pinned toolchain (1.94.0) and the crates again into the sandbox's tmp and took 54.0 s, and git has no user identity there. Exporting RUSTUP_HOME and CARGO_HOME in the command brings it down to the 16.0 s above. agent.md says tmp/ is the commands' HOME, but not that this hides the user's rustup, cargo and git config. Native runs as this user with no isolation and already passes the caller's PATH, so it could pass HOME too, or the docs could say what breaks.
I know #533 replaces LayerFS.open and the LAYERFS_* settings. 1 and 3 look like they carry over to the native machine, 2 may go away if store create makes the directory.
@jiangkoumo since this came in with #427
Activity
jiangkoumo commentedon Nov 5, 2026
@ImmuneFOMO 感谢你在 M3 Max 上这么完整的实测,三个问题都复现得很清楚,省了我们很多功夫。
修复在 #570(基于 layerfs_v2_0_0):
Busy,不再报Failed: Store busy before effectproject init会直接报出路径和chmod 700命令HOME=tmp导致找不到 Rust 和 git 配置:macOS native 下会透传RUSTUP_HOME、CARGO_HOME、GIT_CONFIG_GLOBAL(存在时),HOME仍是沙箱 tmp如果方便,麻烦用你之前那套流程(三个 node 进程同时 open、fork、挂载、各 20 次 commit,再跑一遍 cargo build)在 #570 上复测一下,有任何问题直接在这里或 PR 里告诉我。再次感谢!
ImmuneFOMO commentedon Nov 5, 2026
Retested 6be2f6c on #570 with my #534 scripts and 3 to 10 agents at once. All three are fixed on my M3 Max, details and two questions are in #570 (comment)
fix(persistence): admit Store writes on macOS through the directory lane
docs(architecture): describe macOS writer admission in Store pages
ImmuneFOMO commentedon Nov 11, 2026
@jiangkoumo #647 took only the writer admission from #570. The other two fixes from #570 are not in #647 (7d2bfbd) or on layerfs_v2_0_0 (e9b903e): the Store folder and doctor 0700 check (
store/create.rs,doctor/scan.rs) and passingRUSTUP_HOME,CARGO_HOMEandGIT_CONFIG_GLOBALto commands (host_process/exec.rs). Will they come in a separate PR?fix(store): private 0700 Store folders, macOS toolchain passthrough, …
ImmuneFOMO commentedon Nov 14, 2026
All three are fixed on layerfs_v2_0_0 (8cfb6e2). #647 fixed the concurrent open, and #663 brought the 0700 Store folder and passing
RUSTUP_HOME,CARGO_HOMEandGIT_CONFIG_GLOBALto commands.Checked on my M3 Max, macOS 26.6.2. 5 and then 10 agents starting at once all opened the Store and made 100 of 100 commits in each run.
store createon an existing 0755 folder refuses with thechmod 700hint, and commands in a native Sandbox see my~/.rustup,~/.cargoand~/.gitconfigeven with those vars unset in my shell. Closing