version control for meaning

graf

15,000 lines doing what Git needs 400,000 for.
Content-addressed. CRDT-safe. Agent-native. Built in Zig.

~15K Lines Zig
101 Tests
4 Object Types
Get Started View Source →

First Principles. Zero Baggage.

What happens when you build a VCS from the physics up, without 30 years of accidental complexity.

Content-Addressed

BLAKE3 CIDs. The hash is the name. Every object is immutable, every reference is a proof. Physics, not policy.

Prefix-sharded CAS. Idempotent writes. CBOR (RFC 8949) serialization.

Three-Clock Causality

Wall clock + Lamport counter + local sequence. Every event has a total causal order. CRDT-safe. Merge without coordination.

Distributed-first timestamps. No clock skew ambiguity.

Agent-Native

Per-agent branches, nursery supervision, WorkFn interface, policy hooks (approve/reject/hold). Designed for machine collaboration, not bolted on.

Three-level nested nurseries. Conflict reporting with base/ours/theirs CIDs.

No Accidental Complexity

15,000 lines. Full VCS: init, checkpoint, diff, merge, branch, stash, sync. Clarity is the architecture.

Fewer lines means fewer bugs, faster audits, easier contribution.

The Record. No Adjectives.

Four version control systems. Three decades of evolution. One table.

CVS (1990) · Git (2005) · Mercurial (2005) · Graf (2026)
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.

Build. Init. Commit.

Requires Zig 0.14+. No npm. No cmake. No autotools.

terminal
# 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

Architecture

Four subsystems. Each one auditable in an afternoon.

Content-Addressed Store

BLAKE3 CIDs, prefix-sharded object directory. Every write is idempotent. Duplicate content shares a single object. graf fsck verifies the entire graph.

Object Model

Four types: BlobTreeChangeCheckpoint. All CBOR-serialized. Trees are Merkle. Checkpoints form the DAG with parent chains and three-clock timestamps.

Merge Engine

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.

Concurrency

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."