utopia-ia/elffuss-braid public
Changesets · Branches · Tags · Compare
| Changeset | a00d76d443c2c25680cfa5ec8e15e8e8e676c4c0e11cc2fb59ebe14eb0b3a1a8 |
|---|---|
| Author | KikoCis <KikoCis@users.noreply.github.com> · 2026-10-17 12:13 +02:00 |
| Committer | KikoCis <KikoCis@users.noreply.github.com> · 2026-10-17 13:46 +02:00 |
| Parents | b27b4d239a54 |
6 files changed
modified README.md +2 −0
| @@ -125,6 +125,8 @@ | ||
| 125 | 125 | [braid.elffuss.com/agents.md](https://braid.elffuss.com/agents.md), next to |
| 126 | 126 | an [llms.txt](https://braid.elffuss.com/llms.txt). |
| 127 | 127 | |
| 128 | +<p align="center"><img src="docs/assets/demo-agents-init.gif" alt="Setting braid up in a project's git checkout: braid init, git told to ignore .braid, braid git import brings in the history, braid agents init writes the braid section into AGENTS.md, the section's rules are listed, and a new session starts in a workspace of its own under .braid/work" width="860"></p> | |
| 129 | + | |
| 128 | 130 | ## Quick start |
| 129 | 131 | |
| 130 | 132 | Braid stores history, moves it in and out of git bit for bit, and gives each |
added docs/assets/demo-agents-init.gif +0 −0
Binary content is not shown. View the file.
modified docs/assets/demo-agents.gif +0 −0
Binary content is not shown. View the file.
modified docs/assets/demo-conflict.gif +0 −0
Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.
modified docs/assets/demo-git-sync.gif +0 −0
Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.
modified scripts/demos/record.py +29 −8
| @@ -156,19 +156,19 @@ | ||
| 156 | 156 | check(a.run("for a in a b c; do braid workspace add agent-$a; done"), 0, "workspaces") |
| 157 | 157 | a.note("they edit and commit at the same time: no shared index, no lock") |
| 158 | 158 | check(a.run("echo 'free_over = 50' > shipping.toml && braid commit -m 'Free shipping from 50'", |
| 159 | - who="agent-a", cwd="shop/agent-a"), 0, "commit a") | |
| 159 | + who="agent-a", cwd="shop/.braid/work/agent-a"), 0, "commit a") | |
| 160 | 160 | check(a.run("echo 'Ships in a day.' >> README.md && braid commit -m 'Next-day shipping'", |
| 161 | - who="agent-b", cwd="shop/agent-b"), 0, "commit b") | |
| 161 | + who="agent-b", cwd="shop/.braid/work/agent-b"), 0, "commit b") | |
| 162 | 162 | check(a.run("echo 'free_over = 40' > shipping.toml && braid commit -m 'Free shipping from 40'", |
| 163 | - who="agent-c", cwd="shop/agent-c"), 0, "commit c") | |
| 163 | + who="agent-c", cwd="shop/.braid/work/agent-c"), 0, "commit c") | |
| 164 | 164 | a.note("landing on main is one short step that they take in turn") |
| 165 | - check(a.run("braid land", who="agent-a", cwd="shop/agent-a"), 0, "land a") | |
| 166 | - check(a.run("braid land", who="agent-b", cwd="shop/agent-b"), 0, "land b") | |
| 167 | - check(a.run("braid land", who="agent-c", cwd="shop/agent-c", hold=3.0), 2, "land c") | |
| 165 | + check(a.run("braid land", who="agent-a", cwd="shop/.braid/work/agent-a"), 0, "land a") | |
| 166 | + check(a.run("braid land", who="agent-b", cwd="shop/.braid/work/agent-b"), 0, "land b") | |
| 167 | + check(a.run("braid land", who="agent-c", cwd="shop/.braid/work/agent-c", hold=3.0), 2, "land c") | |
| 168 | 168 | a.save() |
| 169 | 169 | |
| 170 | 170 | # The same repository, picked up where the first recording stops. |
| 171 | - b = Scene("conflict", root, env, cwd="shop/agent-c") | |
| 171 | + b = Scene("conflict", root, env, cwd="shop/.braid/work/agent-c") | |
| 172 | 172 | b.note("agent-c changed the line agent-a landed first: main did not move") |
| 173 | 173 | b.note("the conflict comes back as data, with all three sides") |
| 174 | 174 | check(b.run("braid land --json | jq '.outcome, .next, (.conflicts[0].hunks[0] | map_values(.text))'", |
| @@ -200,7 +200,7 @@ | ||
| 200 | 200 | ): |
| 201 | 201 | check(s.quiet(f"braid workspace add {who}"), 0, "workspace") |
| 202 | 202 | check(s.quiet(f"{edit} && braid commit -m '{message}' && braid land", |
| 203 | - who=who, cwd=f"shop/{who}"), 0, message) | |
| 203 | + who=who, cwd=f"shop/.braid/work/{who}"), 0, message) | |
| 204 | 204 | check(s.quiet( |
| 205 | 205 | f"""set -e |
| 206 | 206 | {GIT} clone -q github.git laptop && cd laptop |
| @@ -215,11 +215,32 @@ | ||
| 215 | 215 | s.save() |
| 216 | 216 | |
| 217 | 217 | |
| 218 | +def agents_init(): | |
| 219 | + root, env = directory("setup") | |
| 220 | + s = Scene("agents-init", root, env) | |
| 221 | + seed(s) | |
| 222 | + check(s.quiet(f"{GIT} clone -q github.git shop"), 0, "clone") | |
| 223 | + s.cwd = "shop" | |
| 224 | + s.note('asked to "install braid in this project and set it up for agents",') | |
| 225 | + s.note("an agent follows braid.elffuss.com/agents.md in the project's checkout") | |
| 226 | + check(s.run("braid init"), 0, "init") | |
| 227 | + check(s.run("echo .braid >> .git/info/exclude", hold=0.4), 0, "exclude") | |
| 228 | + check(s.run("braid git import ."), 0, "import") | |
| 229 | + check(s.run("braid agents init"), 0, "agents init") | |
| 230 | + check(s.run("git status --short"), 0, "status") | |
| 231 | + s.note("the rules every later agent session reads, in the project's AGENTS.md") | |
| 232 | + check(s.run("grep '^- [*][*]' AGENTS.md | cut -c1-76", hold=4.0), 0, "rules") | |
| 233 | + s.note("a new session starts in a workspace of its own") | |
| 234 | + check(s.run("braid workspace add agent-1 --track main", hold=3.5), 0, "workspace") | |
| 235 | + s.save() | |
| 236 | + | |
| 237 | + | |
| 218 | 238 | def main(): |
| 219 | 239 | os.makedirs(WORK) |
| 220 | 240 | os.makedirs(OUT, exist_ok=True) |
| 221 | 241 | agents_and_conflict() |
| 222 | 242 | git_sync() |
| 243 | + agents_init() | |
| 223 | 244 | |
| 224 | 245 | |
| 225 | 246 | main() |