02 · Local filesystem

AgentFS

Four crates that present a Weave drive as a local filesystem. POSIX-compatible operations that mirror the Locus API, debounced watchers with intelligent batching, a bi-directional sync engine, and a structured diff format for conflict resolution. Multi-device sync is demonstrated end-to-end by Loom's 7-stage integration test.

Crates

Four crates, one filesystem.

CrateRole
agentfsPOSIX-like operations over a Weave drive — open, read, write, stat.
agentfs-watchDebounced filesystem watchers with batching by directory.
agentfs-mirrorBi-directional sync engine between a local path and a Locus drive.
agentfs-diffStructured diff format for conflict resolution and inspection.
Capabilities

The everyday surface.

  • 01POSIX-like ops compatible with the Locus API — the same calls on either side of the mirror.
  • 02Debounced watchers with batching — bursts of edits collapse into a single sync pass.
  • 03Bi-directional sync engine — changes propagate in both directions with last-writer-wins fallback.
  • 04Structured diff for conflict resolution — every divergence is inspectable, not just resolved away.
  • 05Multi-device sync demonstrated by Loom's 7-stage integration test, which runs against real DHT peers.
  • 06The developer's everyday surface — most users touch Weave through AgentFS first.
Code

Mount a drive, walk away.

use agentfs::Drive;
use agentfs_mirror::Mirror;

let drive = Drive::open("locus://team/notes").await?;
let mirror = Mirror::new("./notes", &drive).bi_directional();

mirror.start().await?; // watchers up, initial sync pass
// Now ./notes <-> locus://team/notes stay converged.
More of the runtime

The rest of the layer.

Open a drive in one line.

AgentFS is the surface most developers — and most agents — touch first. It behaves like a local filesystem and converges with the network behind the scenes.