from
0fc947d9d91b39b89cd35412965f61054857dc4c17b5a4e5b498cf852f3c4a6c → 0fc947d9to
10873d1c32f3572f9360e8cffa67763d306b4001a7adfccaf000f0e4e758e11f → 10873d1c+1 −1
| 1 | 1 | # loot | |
| 2 | 2 | ||
| 3 | 3 | A from-scratch source-control system. | |
| 4 | 4 | ||
| 5 | 5 | **Thesis:** visibility and permissions belong to *content and changes*, not to | |
| 6 | 6 | the *repository*. Commit your `.env`. Keep files private inside a shared repo. | |
| 7 | 7 | Embargo a security fix: merge it, cut the release, reveal the source later. | |
| 8 | 8 | ||
| 9 | 9 | ## Security | |
| 10 | 10 | ||
| 11 | 11 | loot's cryptography is written from scratch and has never been independently | |
| 12 | 12 | reviewed. What each reader (a relay, a forge, a collaborator, the anonymous | |
| 13 | 13 | internet, the git mirror, anyone holding your `.loot/` directory) can read is | |
| 14 | 14 | stated tier by tier at **<https://loot.build/trust>**. Read it before you put | |
| 15 | 15 | anything in a loot repo whose disclosure would hurt you. In particular, the | |
| 16 | 16 | default tier is one a relay reads by design, and path names are never encrypted | |
| 17 | 17 | at any tier. | |
| 18 | 18 | ||
| 19 | 19 | **Report a vulnerability to <security@loot.build>**, not to the public Discord. | |
| 20 | 20 | One maintainer, best effort, expect days rather than hours. This repo is | |
| 21 | 21 | private (ADR 0045/0064), so `/trust` is the published route. | |
| 22 | 22 | ||
| 23 | 23 | ## What works today | |
| 24 | 24 | ||
| 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): | |
| 26 | 26 | ||
| 27 | 27 | ```text | |
| 28 | 28 | abandon absorb adopt apply apply-patch archive attest bisect blame bundle buoy | |
| 29 | 29 | burn cat | |
| 30 | 30 | cherry-pick clean clone completions config conflicts converge count-objects | |
| 31 | 31 | describe diff doctor duplicate edit embargo-status evolog explain ferry | |
| 32 | 32 | fetch format-patch gates gc grant grant-status grants grep heads id init keygen | |
| 33 | 33 | lane lanes lock log login manifest maroon merge migrate move new notes op peer pipeline | |
| 34 | 34 | propose pull | |
| 35 | 35 | pull-grants purges push range-diff rehome relay remote resolve restore revert runner runners seek serve | |
| 36 | 36 | shortlog show split squash status surface tag telemetry ticket tickets tutorial undo unlock verify | |
| 37 | 37 | view whoami | |
| 38 | 38 | ``` | |
| 39 | 39 | ||
| 40 | 40 | `loot <verb> --help` prints any verb's usage without running it. | |
| 41 | 41 | ||
| 42 | 42 | ### Try it: private `.env` in a shared repo | |
| 43 | 43 | ||
| 44 | 44 | ```bash | |
| 45 | 45 | cargo build --release | |
| 46 | 46 | export PATH="$PWD/target/release:$PATH" | |
| 47 | 47 | ||
| 48 | 48 | cd $(mktemp -d) | |
| 49 | 49 | printf 'TOKEN=supersecret\n' > .env | |
| 50 | 50 | printf '# My Project\n' > README.md | |
| 51 | 51 | printf '.env restricted=alice\n*.md public\n' > .lootattributes | |
| 52 | 52 | ||
| 53 | 53 | loot init --identity alice | |
| 54 | 54 | loot status -m "initial work" | |
| 55 | 55 | loot surface # alice: restores both README.md and .env | |
| 56 | 56 | ||
| 57 | 57 | # switch to a non-keyholder to prove it | |
| 58 | 58 | printf mallory > .loot/identity | |
| 59 | 59 | rm -f .env README.md | |
| 60 | 60 | loot surface # mallory: README.md appears; .env stays sealed | |
| 61 | 61 | ``` | |
| 62 | 62 | ||
| 63 | 63 | The `.env` ciphertext stays in `.loot/`. Mallory cannot decrypt it, and if she | |
| 64 | 64 | snapshots and re-syncs, the sealed file is carried forward untouched. | |
| 65 | 65 | ||
| 66 | 66 | ### Sync over a relay | |
| 67 | 67 | ||
| 68 | 68 | A relay stores and forwards ciphertext it cannot read. Restricted keys never | |
| 69 | 69 | travel in a sync bundle (ADR 0003). | |
| 70 | 70 | ||
| 71 | 71 | ```bash | |
| 72 | 72 | # Terminal 1: run a relay | |
| 73 | 73 | loot serve --dir /tmp/relay --addr 127.0.0.1:4000 | |
| 74 | 74 | ||
| 75 | 75 | # Terminal 2: alice pushes | |
| 76 | 76 | loot remote add origin http://127.0.0.1:4000 | |
| 77 | 77 | loot push | |
| 78 | 78 | ||
| 79 | 79 | # Terminal 3: bob pulls (bob only sees public content) | |
| 80 | 80 | loot clone http://127.0.0.1:4000 ./bob-repo --identity bob | |
| 81 | 81 | ``` | |
| 82 | 82 | ||
| 83 | 83 | ### Grants: sharing a content key | |
| 84 | 84 | ||
| 85 | 85 | ```bash | |
| 86 | 86 | # alice knows bob's public key (from `loot whoami` on bob's machine) | |
| 87 | 87 | loot peer add bob "ssh-ed25519 AAAA..." | |
| 88 | 88 | ||
| 89 | 89 | # deliver a sealed grant via the relay | |
| 90 | 90 | loot grant --relay origin .env bob | |
| 91 | 91 | ||
| 92 | 92 | # bob fetches and applies it | |
| 93 | 93 | loot pull-grants # verifies alice's signature, checks peer registry | |
| 94 | 94 | loot surface # now bob can read .env | |
| 95 | 95 | ``` | |
| 96 | 96 | ||
| 97 | 97 | ### Embargo: timed reveals | |
| 98 | 98 | ||
| 99 | 99 | ```bash | |
| 100 | 100 | # mark a file as embargoed until unix timestamp 1800000000 | |
| 101 | 101 | echo "VULN_DETAILS=CVE-2025-XXXX" > security-fix.txt | |
| 102 | 102 | printf 'security-fix.txt embargoed=1800000000\n' >> .lootattributes | |
| 103 | 103 | ||
| 104 | 104 | loot status -m "patch for CVE-2025-XXXX" | |
| 105 | 105 | loot push # relay holds the ciphertext; key withheld until reveal_at | |
| 106 | 106 | ``` | |
| 107 | 107 | ||
| 108 | 108 | At `reveal_at`, the next read promotes the key out of escrow, so anyone who | |
| 109 | 109 | pulls can read it. | |
| 110 | 110 | ||
| 111 | 111 | ## Layout | |
| 112 | 112 | ||
| 113 | 113 | The engine is `crates/loot-core`, the `loot` binary is `crates/loot-cli`, and | |
| 114 | 114 | the relay and forge deployables are `crates/loot-relayd` and | |
| 115 | 115 | `crates/loot-forge`. [CONTEXT.md](CONTEXT.md) is the domain glossary and | |
| 116 | 116 | `docs/adr/` holds the decisions. | |
| 117 | 117 | ||
| 118 | 118 | ## Build & test | |
| 119 | 119 | ||
| 120 | 120 | ```bash | |
| 121 | 121 | cargo build | |
| 122 | 122 | cargo test # includes HTTP relay integration tests | |
| 123 | 123 | cargo test -p loot-core # fast, no I/O | |
| 124 | 124 | ``` | |
| 125 | 125 |