connor / loot

connor/loot
from0fc947d9d91b39b89cd35412965f61054857dc4c17b5a4e5b498cf852f3c4a6c → 0fc947d9
to10873d1c32f3572f9360e8cffa67763d306b4001a7adfccaf000f0e4e758e11f → 10873d1c

+1 −1

11 # loot
22
33 A from-scratch source-control system.
44
55 **Thesis:** visibility and permissions belong to *content and changes*, not to
66 the *repository*. Commit your `.env`. Keep files private inside a shared repo.
77 Embargo a security fix: merge it, cut the release, reveal the source later.
88
99 ## Security
1010
1111 loot's cryptography is written from scratch and has never been independently
1212 reviewed. What each reader (a relay, a forge, a collaborator, the anonymous
1313 internet, the git mirror, anyone holding your `.loot/` directory) can read is
1414 stated tier by tier at **<https://loot.build/trust>**. Read it before you put
1515 anything in a loot repo whose disclosure would hurt you. In particular, the
1616 default tier is one a relay reads by design, and path names are never encrypted
1717 at any tier.
1818
1919 **Report a vulnerability to <security@loot.build>**, not to the public Discord.
2020 One maintainer, best effort, expect days rather than hours. This repo is
2121 private (ADR 0045/0064), so `/trust` is the published route.
2222
2323 ## What works today
2424
25−The CLI's full verb list, from `loot --help`:
25+The CLI's full verb list, from `loot --help` (one line per verb; `loot <verb> --help` has the detail, `loot help --json` the same index as data):
2626
2727 ```text
2828 abandon absorb adopt apply apply-patch archive attest bisect blame bundle buoy
2929 burn cat
3030 cherry-pick clean clone completions config conflicts converge count-objects
3131 describe diff doctor duplicate edit embargo-status evolog explain ferry
3232 fetch format-patch gates gc grant grant-status grants grep heads id init keygen
3333 lane lanes lock log login manifest maroon merge migrate move new notes op peer pipeline
3434 propose pull
3535 pull-grants purges push range-diff rehome relay remote resolve restore revert runner runners seek serve
3636 shortlog show split squash status surface tag telemetry ticket tickets tutorial undo unlock verify
3737 view whoami
3838 ```
3939
4040 `loot <verb> --help` prints any verb's usage without running it.
4141
4242 ### Try it: private `.env` in a shared repo
4343
4444 ```bash
4545 cargo build --release
4646 export PATH="$PWD/target/release:$PATH"
4747
4848 cd $(mktemp -d)
4949 printf 'TOKEN=supersecret\n' > .env
5050 printf '# My Project\n' > README.md
5151 printf '.env restricted=alice\n*.md public\n' > .lootattributes
5252
5353 loot init --identity alice
5454 loot status -m "initial work"
5555 loot surface # alice: restores both README.md and .env
5656
5757 # switch to a non-keyholder to prove it
5858 printf mallory > .loot/identity
5959 rm -f .env README.md
6060 loot surface # mallory: README.md appears; .env stays sealed
6161 ```
6262
6363 The `.env` ciphertext stays in `.loot/`. Mallory cannot decrypt it, and if she
6464 snapshots and re-syncs, the sealed file is carried forward untouched.
6565
6666 ### Sync over a relay
6767
6868 A relay stores and forwards ciphertext it cannot read. Restricted keys never
6969 travel in a sync bundle (ADR 0003).
7070
7171 ```bash
7272 # Terminal 1: run a relay
7373 loot serve --dir /tmp/relay --addr 127.0.0.1:4000
7474
7575 # Terminal 2: alice pushes
7676 loot remote add origin http://127.0.0.1:4000
7777 loot push
7878
7979 # Terminal 3: bob pulls (bob only sees public content)
8080 loot clone http://127.0.0.1:4000 ./bob-repo --identity bob
8181 ```
8282
8383 ### Grants: sharing a content key
8484
8585 ```bash
8686 # alice knows bob's public key (from `loot whoami` on bob's machine)
8787 loot peer add bob "ssh-ed25519 AAAA..."
8888
8989 # deliver a sealed grant via the relay
9090 loot grant --relay origin .env bob
9191
9292 # bob fetches and applies it
9393 loot pull-grants # verifies alice's signature, checks peer registry
9494 loot surface # now bob can read .env
9595 ```
9696
9797 ### Embargo: timed reveals
9898
9999 ```bash
100100 # mark a file as embargoed until unix timestamp 1800000000
101101 echo "VULN_DETAILS=CVE-2025-XXXX" > security-fix.txt
102102 printf 'security-fix.txt embargoed=1800000000\n' >> .lootattributes
103103
104104 loot status -m "patch for CVE-2025-XXXX"
105105 loot push # relay holds the ciphertext; key withheld until reveal_at
106106 ```
107107
108108 At `reveal_at`, the next read promotes the key out of escrow, so anyone who
109109 pulls can read it.
110110
111111 ## Layout
112112
113113 The engine is `crates/loot-core`, the `loot` binary is `crates/loot-cli`, and
114114 the relay and forge deployables are `crates/loot-relayd` and
115115 `crates/loot-forge`. [CONTEXT.md](CONTEXT.md) is the domain glossary and
116116 `docs/adr/` holds the decisions.
117117
118118 ## Build & test
119119
120120 ```bash
121121 cargo build
122122 cargo test # includes HTTP relay integration tests
123123 cargo test -p loot-core # fast, no I/O
124124 ```
125125