Docs menu

Platform and limits

Platform and limits

Where LayerFS runs today, what it promises about your data, how parallel work behaves, and the edges you can hit.

Supported platforms

Everything that opens a project's Store must share one Linux kernel, and the Store must sit on alocal ext4, xfs or btrfs filesystem. SQLite's locks, and LayerFS's own coordination between writers, only work within one kernel, so LayerFS checks this when it opens the Store and refuses anything else asUnsupported, before any write. There is no fallback route.

Where LayerFS runsOne Linux host, one kernel: your process with the SDK, Sandbox containers 1 and 2 each running a LayerFS daemon for the Workspaces mounted there, and the Store on a local ext4, xfs or btrfs volume that all of them open directly, with Docker Engine running the containers. Outside the host and crossed out: a macOS host, a network filesystem and another machine; from there, Store calls fail Unsupported.✓one Linux host · one kernelyour processNode 20+ · @layerfs/agentnative addonSANDBOX 1daemonWorkspacesSANDBOX 2daemonWorkspacescontainers run by Docker EngineStorelocal ext4 · xfs · btrfsmacOS hostStore over a VM boundarynetwork filesystemNFS, virtiofs, bind mountsanother machinea second kernelStore calls fail Unsupported
Your process and every Sandbox daemon open the same Store on one Linux host. From anywhere else, Store calls fail Unsupported.
You needDetails
LinuxStore calls (fs, branch, project) run in your own process.
macOS or Windows, through the worker@layerfs/runtime keeps one long-lived Linux worker per LayerFS home (a layerfs-worker container on macOS, a Node process in a WSL2 distribution on Windows). A process whose LAYERFS_WORKER_ENDPOINT names it sends its Store calls there, so the rule above still holds. The route is open to any integration; LayerFS × DSH sets it up for you.
Local filesystemext4, xfs or btrfs for the Store. NFS, virtiofs and bind mounts from macOS are refused.
Docker EngineSandboxes are containers. LAYERFS_DOCKER names the socket, /var/run/docker.sock by default.
Node 20+The SDK is three packages, @layerfs/agent, @layerfs/runtime and @layerfs/backend, linked from the LayerFS checkout's api/ folder, not npm. See SDK reference.
A native addonBuilt for the host that loads it, with the pinned Rust toolchain.
npm --prefix api install                 # in the LayerFS checkout: links the packages
npm --prefix api run build:native        # the native addon, on the host that loads it

Store formats change between versions, and an older Store is refused rather than migrated: start a fresh project with the new version.

Durability

The Store runs one profile, Disposable: SQLite in WAL mode with synchronous=OFF. LayerFS never waits for the disk to confirm a write, which keeps every Commit short.

Durability is not claimed. A crash of LayerFS itself loses nothing it reported as committed, but an operating-system crash or power loss can lose recent history or damage the Store. A durable profile exists in the code but is turned off for now. Keep anything you can't afford to lose somewhere else as well, for example by pushing Git from inside a Workspace.

Concurrency model

One project, one Store file, one writer at a time, with short holds. Agents' tool calls are separated by model thinking time, so two Commits at the same instant are rare; LayerFS keeps them correct rather than racing them. The Store diagram shows the shape.

  • Reads never wait. They read a committed snapshot beside the writer.
  • Writes take turns. Heavy work (building and encoding the new tree) runs side by side; only the short step that checks the head, merges and publishes is one at a time. A write waits its turn instead of failing.
  • Same Branch, many writers. Each write merges with the head it meets: different paths both land, the same path is refused with Conflict. See Merge and conflicts.
  • Sandbox starts take turns. sandbox.create and sandbox.close take the project's lock; a mount takes only its own Sandbox's lock; exec, status, Commit and unmount take neither. A lock another process holds is waited for up to 60 seconds, then refused Busy.
  • Keep each Workspace sequential. Parallel agents each mount their own Workspaces, in a Sandbox the mount names, each holding up to 16; keep each agent's calls on its Workspace one after another. One process can make up to six calls to one Sandbox at once.
  • Nothing is retried. Every call is attempted once and answers its exact outcome. On Unknown or Failed, look before you act again.

Limits

No file, Workspace or Commit has a size cap of its own; disk space and the filesystem are the limits. These are the edges of single calls:

WhatLimit
Project names1 to 63 of a-z 0-9 _ - ., starting and ending with a letter or digit
Workspaces per Sandbox16; another mount there is refused Capacity, so sandbox.create another. A mount never starts a Sandbox
LayerFS.init time300 s by default; pass a longer timeout for a large tree. There is no unlimited option
Commit and run messages4096 bytes of UTF-8
File bodiesuncapped: a write's body travels in the call, in your process, and is written a record at a time
fs.read window2000 lines and 48 KiB per call; huge lines come back as a prefix
Pages50 items by default, up to 1000
workspace.exec outputreturned whole, at any size; pass Writable sinks, or send long logs to a file in /tmp and read the end, to keep memory bounded
workspace.exec timeno timeout of its own: wrap long commands, timeout 110 npm test
Store growthhistory is never deleted; there is no garbage collection yet
Restartsif a Sandbox's container dies, its Workspaces and their uncommitted changes are gone

What isn't saved

History is the filesystem: the files, folders, links and modes in a tree. It is not a snapshot of a running machine.

  • Processes, memory and sockets. A dev server or a database running in a Sandbox isn't in any Commit. Forking a Branch gives you its files, not its processes.
  • Command output. workspace.exec returns stdout and stderr to you; they aren't stored. Save what matters to a file in the Workspace, or in your own logs.
  • Uncommitted Workspace changes. Nothing is saved until workspace.commit. Unmounting with discard, or losing the container, drops them.
  • Files outside the Workspace. /tmp (also HOME) and the package caches there stay in the container's own writable layer, not the tree, until the container is deleted.
  • Runs without changes. A step that changes nothing makes no Commit, and a message on workspace.exec creates no history.
  • Copy times. fs.cp gives copies new timestamps; fs.mv keeps them.
  • Daemon logs. A Sandbox's container and its logs (capped at two 10 MB files) go when it is closed, or when a stopped one is reclaimed; save them first if you trace (backend.daemon.sandbox.get_log).

A command's exit doesn't prove everything it started has finished. A Commit saves the Workspace as it stands at that moment, including what background processes have written so far.