Patch-based version control for successful cargo builds
You spend 3 hours coding. You run cargo build. 500 errors. You don't remember what you changed.
Git shows you a diff with 800 lines across 12 files. You spend 2 hours trying to undo your changes. You give up and git reset --hard to your last commit from yesterday, losing everything.
Cairn solves this: Every successful build is automatically captured as a patch. One command rolls back to any previous working state.
With Git, you can commit anything—broken code, untested changes, WIP disasters. Your history becomes polluted with commits that don't even compile.
Cairn's guarantee: Every snapshot in history is guaranteed to build successfully.
$ cargo build
Finished dev [unoptimized + debuginfo] target(s) in 2.34s
✓ Cairn: Snapshot created (a3f8d9e1)
$ cairn list
● a3f8d9e1 - just now - "Successful build" ← GUARANTEED TO WORK
● d7e2c1f - 1 hr ago - "Successful build" ← GUARANTEED TO WORK
● 9f1d3e7 - yesterday - "Successful build" ← GUARANTEED TO WORK
Build succeeds → Cairn saves it automatically. Build fails → Nothing happens. You cannot pollute history with broken code.
cargo build succeeds → Cairn creates a patch automaticallycargo build fails → Nothing happens$ cairn rollback a3f8d9e1
Restored to patch a3f8d9e1 (37 minutes ago)
✓ Rolled back 10,000 files (1 changed) in 16ms
$ cargo build
Finished dev [unoptimized + debuginfo] target(s) in 0.23s
Patches stored in Versatile Storage Format:
If you edit files while build is running, Cairn snapshots what cargo actually compiled, not what's on disk when the build finishes. Uses cargo's fingerprint as source of truth.
Cairn builds on:
What's novel:
Cairn is in active development. Linear history only (no merges yet—coming with commutation). Rust-specific for now, can be adapted for other languages later.
→ View on GitHub