LayerFS for Allternit
What Ephemeral AI Lab's agent filesystem could do for Factory and cloud computers
Lead: LayerFS could replace git worktrees as the workspace each Factory agent gets. It is worth researching. It is not safe to adopt yet: it has no crash durability and reaches macOS only through DeepSeek Harness.
What it is
- Each agent mounts a full writable copy of the project, including
node_modules,target/and.git, without copying files. - Every tool call becomes a Commit on a Branch. Agents fork, rewind, merge and publish to
main. - One SQLite file is the Store. Content is chunked and stored once, so 157 snapshots take 100 MB, 19.9× less than Btrfs + zstd.
- Two Commits that change the same file get
Conflict, unless a.lwwrule lets the newest edit win.
Where it helps Allternit
| Pain today | What LayerFS changes | Fit |
|---|---|---|
| ~127 worktrees filled the disk on 2026-09-30; cleanups have freed up to 170 GB each time | Workspaces share one deduplicated Store, and unmount deletes the overlay | strong |
| Each new worktree reinstalls pnpm deps and rebuilds the Rust target | Dependencies and build output come with every mount | strong |
| Parallel Factory agents step on each other or need manual merges | One Branch per agent, with conflicts refused per file | strong |
| No rewind of a bad agent step | Every tool call is a checkpoint to go back to | good |
| Cloud computers and the Mail VPS keep their own copies of repos | Agents on different machines can share one Store | needs network-share testing |
| Teach Replay and Agent watch show what an agent did | The Commit history is a step-by-step record to show | idea only |
Blockers
callout warn Not ready for production
- No crash or power-loss durability. Use it only for agent scratch work. Git and GitHub stay the source of truth.
- macOS only through DSH. Linux is native, and Windows works through WSL2. Factory runs on the Mac, so the Mac path must be tested first.
- Slower sequential I/O: 0.31× on sequential write, which affects big cargo builds.
- 1.1.0 broke the 1.0.0 API. Expect churn.
Suggested path
- Put the link in the research queue for a baseline against Factory's worktree model.
- Try it on the Linux cloud computers first, where it runs natively. Run one Factory DAG with LayerFS workspaces.
- Compare disk use, mount time and merge conflicts with the worktree run.