Skip to content

Commit 45f58a8

Browse files
PiquelChipsclaude
andcommitted
feat: add the change workflow
The local command line on the change model. `origin init` creates the repository with the node's key (in ~/.config/origin or $ORIGIN_CONFIG_DIR), a signed `policy` target naming the node authority of `policy` and `main`, an empty `main`, and a first change. There is no commit: the working copy is always a revision of the current change, and every command that reads it snapshots it, with the stat cache and parallel snapshots, writing the new objects in one durable batch. `new`, `describe`, `edit`, `status`, `diff`, `show`, `log`, `evolog`, `abandon` (a core.abandon statement), `converge` and `index rebuild` work on changes, named by unique id prefixes. Divergence, detected by the index, shows in `status`, `log` and `show`. Benchmarks: divan snapshot benchmarks, and `just bench-git` timing origin against git with hyperfine, `origin new` standing in for a commit. A closed output pipe, as in `origin log | head`, ends a command quietly instead of panicking. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 4587472 commit 45f58a8

27 files changed

Lines changed: 3724 additions & 22 deletions

File tree

‎.cargo/config.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `cargo xtask <task>` runs the workspace's development tasks (tools/xtask).
2+
[alias]
3+
xtask = "run --package xtask --"

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ rustc-ice-*.txt
2222
# and can be added to the global gitignore or merged into this file. For a more nuclear
2323
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
2424
#.idea/
25+
26+
# This repository is used to test origin.
27+
.origin/

‎AGENTS.md‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,30 @@ review bots read and write at the same time, written in Rust.
1010
shared by every component.
1111
- `crates/origin-platform`: everything that differs between platforms
1212
(durable writes, file locks, copy-on-write clones, positioned reads,
13-
refusing network file systems), behind traits. It is the only place that may depend on the
14-
target OS.
13+
refusing network file systems), behind traits. It is the only place whose
14+
code differs by target OS. `std::os::unix`, which every supported platform
15+
has, may be used anywhere.
1516
- `crates/origin-client`: the HTTP client, generated from the server's OpenAPI
1617
document. Never edit generated code by hand.
1718
- `apps/origin-src`: the `origin` binary, both the command line and the
1819
server.
20+
- `tools/xtask`: development tasks, run with `cargo xtask`, such as timing
21+
origin against git (`just bench-git`).
1922

2023
## Testing & Benchmarks
2124

2225
Performance is a primary goal, so benchmarks matter as much as tests. A change
2326
to a hot path (hashing, storage, snapshots, transfer) should come with a
2427
benchmark, and its numbers in the pull request.
2528

29+
- `just bench`: the divan micro-benchmarks (encoding, store writes,
30+
snapshots).
31+
- `just bench-git`: times origin against git on a 20,000-file tree with
32+
hyperfine, and rewrites `docs/benchmarks.md`.
33+
34+
End-to-end tests run the `origin` binary with `ORIGIN_CONFIG_DIR` set to a
35+
temporary directory, which holds the user's `config.toml` and node key.
36+
2637
## Commits & Pull Requests
2738

2839
Titles follow conventional commits with a scope, e.g.

0 commit comments

Comments
 (0)