15,000 lines doing what Git needs 400,000 for.
Content-addressed. CRDT-safe. Agent-native. Built in Zig.
What happens when you build a VCS from the physics up, without 30 years of accidental complexity.
BLAKE3 CIDs. The hash is the name. Every object is immutable, every reference is a proof. Physics, not policy.
Wall clock + Lamport counter + local sequence. Every event has a total causal order. CRDT-safe. Merge without coordination.
Per-agent branches, nursery supervision, WorkFn interface, policy hooks (approve/reject/hold). Designed for machine collaboration, not bolted on.
15,000 lines. Full VCS: init, checkpoint, diff, merge, branch, stash, sync. Clarity is the architecture.
Four version control systems. Three decades of evolution. One table.
| Feature | CVS | Git | Mercurial | Graf |
|---|---|---|---|---|
| Storage model | RCS deltas per file | Snapshot DAG, packfiles | Revlog delta chains | Merkle DAG, BLAKE3 CIDs, CBOR |
| Content addressing | None (sequential revnums) | SHA-1 (SHA-256 transition) | SHA-1 nodeid | BLAKE3, prefix-sharded |
| Branching | Directory copies | Lightweight refs | Named branches / bookmarks | Named refs + per-agent branches |
| Merge strategy | Manual | Recursive 3-way + rename detect | 3-way with bdiff | LCA via alternating BFS + 3-way tree+line merge |
| Timestamps | Wall clock | Wall clock + timezone | Wall clock + timezone | Three-clock: wall + Lamport + sequence (CRDT-safe) |
| Serialization | Custom RCS text | Custom pack format | Revlog binary | CBOR (RFC 8949) |
| Diff algorithm | Line-by-line | Myers + patience + histogram | bdiff | Myers O(ND) line-level |
| Identity / auth | Unix user | Author string, GPG optional | Author string | Three-clock causality + author. Ed25519 signing planned (Hinge infra exists) |
| Agent awareness | None | None | None | Native: per-agent branches, WorkFn interface, nursery-supervised parallel execution, policy hooks (approve/reject/hold), conflict reporting with three-way CIDs |
| Concurrency | Single-threaded, lock files | Single-threaded + index.lock | Single-threaded | M:N fiber scheduler (Janus), nursery-structured concurrency |
| Codebase | ~80K lines C | ~400K lines C | ~200K lines Python/C | ~15K lines Zig |
CVS counted files. Git counted snapshots. Graf counts meaning. And it does it in 15,000 lines because it doesn't carry 30 years of accidental complexity.
Requires Zig 0.14+. No npm. No cmake. No autotools.
# build (requires Zig 0.14+) zig build # initialize repository graf init # content-addressed snapshot graf checkpoint "first snapshot" # stat-cached, sub-100ms graf status # Merkle DAG history graf log
Four subsystems. Each one auditable in an afternoon.
BLAKE3 CIDs, prefix-sharded object directory. Every write is idempotent. Duplicate content shares a single object. graf fsck verifies the entire graph.
Four types: Blob → Tree → Change → Checkpoint. All CBOR-serialized. Trees are Merkle. Checkpoints form the DAG with parent chains and three-clock timestamps.
LCA via alternating BFS (depth limit 10K). Three-way tree + line-level merge. Conflict entries carry base_cid, ours_cid, theirs_cid for precise resolution.
Janus M:N fiber scheduler. Nursery-supervised structured concurrency. Three-level nesting: supervisor → agent → scanner. Budget fairness. Structured cancellation propagation.
"CVS counted files. Git counted snapshots. Graf counts meaning. And it does it in 15,000 lines because it doesn't carry 30 years of accidental complexity."