Elffuss BraidHub

utopia-ia/elffuss-braid public

Changeset: c03d76685fb3
c03d76685fb3 Signatures in local time KikoCis,
.github/
crates/
docs/
fuzz/
scripts/
.gitignore50 B
CONTRIBUTING.md1.8 KiB
Cargo.lock56.3 KiB
Cargo.toml1.1 KiB
LICENSE11.1 KiB
NOTICE160 B
README.md12.8 KiB
SECURITY.md1.2 KiB
deny.toml1.0 KiB

README.md

<img src="docs/assets/braid.svg" alt="Three strands braided together" width="320">

✳ Elffuss Braid

Version control for repositories where many agents land changes at the same time.

A from-scratch version control system in Rust. Creating a change costs what the change touches, not what the repository weighs. Landing on main is one short step per branch, with no repository-wide lock. Git stays at the edges, so GitHub keeps working.

License CI Rust Status

elffuss.com · Code · Claw · Translator · Copilot · Blog · Hugging Face · Dev log


In this repository: why braid · how it works · quick start · working with git · design · status · what is honest about this · credits


Why braid

Git was designed for people who work offline and sync now and then. Agents work differently: there are many of them, each change is small, they are always connected, and they all want to land on main at once. In git that shows up as:

  • Shared mutable state. One index per working tree, and a push that is rejected whenever someone else landed first, so every agent ends up in a fetch, rebase, push and retry loop.
  • Costs that grow with the repository. Status and commit walk the whole index, and a directory with many files is rewritten whole on every change.
  • Transfers built per client. Each fetch negotiates and builds its own pack, so a cache in front of the server cannot help.
  • Large files need a side system.

Braid starts from the opposite assumptions:

gitbraid
Unit of changea commit: a full tree snapshota changeset: the files that changed against the first parent, plus the root tree id
Landing on mainthe client pushes and is rejected if behindland rebases in one short serial step per branch, at a cost that follows the change
Many writersone index per working treeone workspace per agent over a shared append-only store; creating a change takes no repository lock
Fetchingnegotiated packs, unique per clientimmutable objects by id, so any cache (local daemon, nginx, CDN) can serve them
Large directoriesrewritten whole on every changesplit into content-defined nodes; an edit rewrites only its path
Large filesa separate extensioncontent-defined chunks, deduplicated across versions
HashSHA-1BLAKE3
For agentsparse human output--json everywhere; changes can be created through the API without a checkout

This is the design. Status says what exists today.

How it works

flowchart LR
    subgraph machine["One machine"]
        A1["agent 1 · workspace"] --> ST
        A2["agent 2 · workspace"] --> ST
        A3["agent N · workspace"] --> ST
        ST[("shared store<br/>immutable objects + op log")]
    end
    ST -- "land: one short step per branch" --> MAIN(["main"])
    ST <-- "objects by id" --> SRV["braid server (optional)"]
    ST <-- "import / export" --> GIT["git bridge"]
    GIT <--> GH["GitHub · Gitea"]
  1. Everything is an immutable object named by its BLAKE3 hash: file contents, directories, and changesets. Nothing is ever rewritten in place.
  2. A changeset records what changed against its first parent, plus the root tree it produces. History, blame and rebase read the short list; the root id commits to the whole repository.
  3. Landing is one short serial step per branch. If the change was built on the current head it fast-forwards. If not, braid rebases it path by path and merges only the files both sides touched. Conflicts come back as data that an agent can act on.
  4. Many processes share one store without a daemon. Segments are leased with locks the kernel releases if a process dies, objects are published before anything refers to them, and an append-only op log records every operation so it can be undone.
  5. The same API at every tier. A local store, a per-machine daemon, a cache and a server answer the same requests, so a client never cares which one it talks to.

Quick start

Braid stores history, moves it in and out of git bit for bit, and gives each agent a workspace that lands on main without waiting for the others.

git clone https://github.com/KikoCis/elffuss-braid
cd elffuss-braid
cargo build --release
export PATH="$PWD/target/release:$PATH"

braid init /tmp/demo
cd /tmp/demo
braid git import /path/to/any/git/repository   # every branch and tag
braid log main -n 5
braid show main --json
braid fsck

Exporting writes the same commits back, with the same ids:

git init --bare /tmp/mirror.git
braid git export /tmp/mirror.git

Every operation is in the op log, and any of them can be undone:

braid op log      # who did what, newest first
braid undo        # takes the whole import back

Ids can be checked with any BLAKE3 implementation, for example the reference b3sum tool:

b3sum --derive-key "elffuss-braid 2026 blob v1" README.md

Many agents, one repository

Each agent gets its own workspace. There is no staging area and no shared index: an agent commits what it changed and lands it, and braid rebases it onto whatever the others landed first.

export BRAID_AUTHOR="Ada Lovelace <ada@example.org>"
braid workspace add agent-1          # ./agent-1, tracking main
cd agent-1
echo 'fn main() {}' > main.rs
braid status
braid commit -m "Add main.rs"
braid land                           # fast-forward, or a rebase onto main

When two agents change the same lines, the second land exits with status 2, prints the conflicts as data (--json for agents) and leaves main where it was. braid update then rebases the change and writes git-style conflict markers; fix the file, braid commit, braid land.

An agent that knows exactly what it changes needs no checkout at all, and can check that nobody changed the file under it:

braid change create --base main --set src/lib.rs=@new-lib.rs \
  --expect src/lib.rs=<blob id it read> -m "Fix the parser" --land main

New files that look like secrets (.env*, *.pem, id_*) or are larger than 1 MiB are not committed until braid track <path> says so.

Working with git

Repositories come in with their whole history and keep a git mirror.

  • braid git import reads a git repository through gitoxide. Each commit is exported again and compared with the original, so the round trip is bit for bit.

  • braid git sync keeps a branch of GitHub, Gitea or any git remote in step with a braid branch: it fetches and imports the remote branch, then fast-forwards braid, or pushes braid's branch as a fast-forward with a lease, merging first when both moved. Conflicts move nothing and exit with status 2. Braid never force-pushes.

    braid git sync https://github.com/you/project.git --branch main
    braid git sync https://github.com/you/project.git --dry-run --json
    
  • Braid contains no code from git itself, which is GPLv2. It reads and writes git data with gitoxide (MIT or Apache-2.0) and runs the git binary only as a subprocess to push.

Design

  • Design overview: store, landing, workspaces, the git bridge, the server, and how it is tested.
  • Format v1: the exact bytes of ids, trees and changesets, with golden vectors.

Status and roadmap

MilestoneScopeState
0Public repository, CI, object ids, braid hash-object✅ done
1Format v1: canonical codec, trees (flat and split), changesets, name rules; frozen✅ done
2Local store and op log: many processes, crash-safe, fsck, undo✅ done
3History and the git bridge: import, export, log, show✅ done
4Many agents on one machine: workspaces, land, conflicts, git syncnext
5Performance: deltas, chunking, derived indexes, blame, benchmarks against gitplanned
6Server: lazy sparse clones, tokens, caching tiersplanned
7Daemon, virtual file system, WebAssembly coreplanned

Each milestone ships when its tests pass: golden vectors and fuzzing for the format, crash and many-process tests for the store, bit-for-bit round trips and differential tests against git for the bridge, deterministic simulation for landing.

What is honest about this

  • It is pre-alpha. Today it stores history, round-trips git repositories, and runs workspaces for many agents on one machine. Keep your git repository as the source of truth, and do not keep anything only in braid.
  • No performance claims yet. When benchmarks land they will be ratios against git on the same machine, with the script that reproduces them, never numbers nobody can check.
  • The hashed format is frozen and every golden vector is recomputed by a second implementation written from the specification alone. Storage and protocols can still change.
  • Braid is not Scion. It starts from the ideas Anthropic described in public about its own source control system. It is an independent implementation, contains no code from Anthropic, and is not affiliated with or endorsed by Anthropic.
  • Platforms. CI tests Linux and other Unix-like systems. Windows is not tested yet.

Part of Elffuss

Braid is part of Elffuss, a family of tools for building software with agents.

Prior art and credits

Contributing and security

License

Apache-2.0. Copyright 2026 UtopiaIA. See NOTICE.


En castellano

Braid es un sistema de control de versiones escrito de cero en Rust, para repositorios en los que muchos agentes aterrizan cambios a la vez.

  • Crear un cambio cuesta lo que toca el cambio, no lo que pesa el repositorio.
  • Aterrizar en main es un paso corto por rama, sin cerrojo global.
  • Git se queda en los bordes, así que GitHub y Gitea siguen funcionando.

Parte de las ideas que Anthropic contó en público sobre Scion, su sistema interno. Es una implementación independiente, sin código de Anthropic y sin relación con la empresa.

Hoy está en pre-alfa: guarda historia, la mete y saca de git bit a bit, y cada agente tiene su espacio de trabajo y aterriza en main sin esperar a los demás. Las fases dicen qué llega después y qué pruebas tiene que pasar cada una.