# Oxygen Oxygen (`oxy`) is a distributed, commutative version control system written in Rust for large repositories. See [docs/spec.md](docs/spec.md) for the specification. It is self-hosting: this directory is an Oxygen repository, and the project's own history is kept with `oxy`, not with Git. ## Working with agents An AI agent works in Oxygen under its own key, delegated by you for a scope and a time (`oxy identity delegate add agent.identity --scope changes --expires 8h`): every change it makes is authored by you and signed by the agent, so `oxy log`, `oxy verify` and the hub show *who did the work* ("Andy McCall · via Claude Code") and a policy can require that a person approved it. See [docs/ai_native_agent_workflows.md](docs/ai_native_agent_workflows.md) for the design and [docs/guide.md](docs/guide.md) §9 for the setup. ## What is different - **History is a set of changes, not a chain of snapshots.** A change records what it did to identified lines and tree nodes and which earlier changes it depends on. Changes that do not depend on each other commute, so there are no merge commits and rebasing independent work rewrites nothing. - **Conflicts are data.** A conflicted state can be committed, pushed and pulled. Resolving one is an ordinary edit followed by a commit. - **Every change has a stable ID and a content hash.** The ID survives rewrites; the hash makes history tamper-evident. - **Everything is signed.** Composite Ed25519 + ML-DSA-65 signatures on changes and on every bookmark update, verified against a trust policy that lives in the repository. - **Every operation is undoable** through an operation log. - **Large files are chunked** with content-defined chunking into a BLAKE3-addressed store. ## Status Early, but usable for its own development. Implemented: the object model, the change graph with conflict detection and resolution, the working copy (`status`, `commit`, `checkout`, `diff`, `undo`), identities and signatures, remotes over local paths and HTTP(S) with `clone`, `fetch`, `pull`, `push`, the reference server `oxy serve`, the trust policy, and packed storage. Not yet: checkpoints for very long histories, history editing (`rebase`, `split`, `edit`), multiple workspaces, garbage collection with retention, and the Thin client profile for constrained machines. ## Building ``` cargo build --release cargo test --workspace ``` The binary is `target/release/oxy`. ## Quick start ``` oxy identity create --name "Your Name" --email you@example.org oxy config --user core.sign change # sign every commit oxy init # in a project directory oxy status oxy commit -m "First change" oxy log ``` Collaborating: ``` oxy serve --root /srv/oxy --bind 0.0.0.0:8890 --tls-cert cert.pem --tls-key key.pem --token SECRET oxy clone https://host:8890/project oxy config remote.origin.token SECRET oxy push oxy pull ``` Trust policy, so a server accepts only changes from keys you have granted: ``` oxy policy init # your key becomes the root oxy identity export # a contributor sends you this file oxy policy grant alice.identity oxy push # publishes the policy ``` ## Layout | Path | Contents | |---|---| | `crates/oxy-core` | Library: encoding, hashing, objects, the change graph, storage, identities, policy, protocol, repository operations | | `crates/oxy-server` | Reference HTTP(S) server for the wire protocol | | `src/cli` | The `oxy` command-line interface | | `docs/spec.md` | The specification | ## Licence MIT or Apache-2.0, at your option.