No description
- Zig 100%
| .agent/specs/native-push-pull | ||
| src | ||
| zig-pkg | ||
| .grafignore | ||
| build.zig | ||
| build.zig.zon | ||
| CONTRIBUTING.md | ||
| KNOWN_ISSUES.md | ||
| README.md | ||
Graf
Content-addressed version control. Merkle trees, BLAKE3 hashing, CBOR serialization. Built in Zig.
What It Does
graf init Initialize repository (.graf/)
graf checkpoint "message" Snapshot worktree (three-clock timestamps)
graf status Show changes (stat-cached, sub-100ms incremental)
graf log Show checkpoint history
graf diff Myers line-level diff, unified output
graf checkout <cid> Materialize worktree from checkpoint
graf fsck Verify CAS integrity
graf stash Stash uncommitted changes
graf stash pop Restore stashed changes
graf branch list List branches (* = current)
graf branch create <name> Create branch at current HEAD
graf branch switch <name> Switch to branch
graf branch delete <name> Delete branch
graf merge <branch> Three-way merge (fast-forward detection, conflict markers)
graf sync push Push to git remote
graf sync pull Pull from git remote
graf sync status Show sync state
graf stats Scheduler metrics (Janus runtime)
Architecture
- CAS: Content-addressed store with BLAKE3 CIDs, prefix-sharded object directory
- Objects: Blob, Tree (Merkle), Change (transitions), Checkpoint (DAG with parent chain)
- Serialization: CBOR (RFC 8949)
- Diff: Myers O(ND) line-level algorithm
- Merge: LCA via alternating BFS, three-way tree+line merge
- Timestamps: Wall clock + Lamport counter + local sequence (crdt-safe)
- Concurrency: Janus M:N scheduler with fiber-based nurseries, structured cancellation
- Agent support: Three-level nested nurseries with supervisor merge
Build
Requires Zig 0.14+.
zig build # → zig-out/bin/graf
zig build test # 101 tests
zig build run -- status # run directly
License
LCL-1.0 (Libertaria Community License)