Content-addressed storage derives identity from bytes. Equal immutable objects converge on one identity and one stored copy.
What remains: changing one byte gives a whole-file object a new identity.
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
Chapter 1 · Foundations
A filesystem state should be complete logically but incremental physically. That is a requirement—not a later optimization—when many agents explore from the same environment.
LayerFS is designed for one environment to support many isolated agent workspaces. Each workspace must behave like a complete filesystem: tools can modify it, checkpoint it, fork it, resume it, compare it, or roll it back.
The straightforward implementation is to copy the current filesystem whenever an agent forks or records a checkpoint. That provides isolation, but it gives these operations the wrong cost model: a small edit to one workspace can require storing another copy of the entire workspace.
Multi-agent development makes that mismatch fundamental rather than incidental:
If every logical state owns its bytes, storage grows with the total size of every workspace. LayerFS instead chooses a different invariant: the physical cost of a new state should follow what changed, not the size of the filesystem that state exposes.
This choice shapes the filesystem model. A workspace starts from an immutable root. Reads reuse objects reachable from that root; writes create new objects without modifying the shared base; a checkpoint records a new root that still references everything unchanged. Isolation comes from giving each agent its own evolving root—not from duplicating all of its bytes.
Structural sharing can be lost at the object, file, or tree level. LayerFS therefore applies reuse at all three levels, and Chapter 1 builds them in that order:
Content-addressed storage derives identity from bytes. Equal immutable objects converge on one identity and one stored copy.
What remains: changing one byte gives a whole-file object a new identity.
Content-defined chunking gives unchanged regions stable boundaries, so a small insertion or deletion replaces nearby chunks rather than the entire file.
What remains: a complete filesystem state still needs a new root without copying every file and directory.
Copy-on-write creates a new file manifest and new directory records along the edited path. Every unrelated file and subtree remains shared.
Result: each checkpoint is a complete immutable root whose physical cost follows the change, not the workspace size.