Elffuss BraidHub

utopia-ia/elffuss-braid public

Demos: workspaces under .braid/work, and braid agents init on camera

Recorded again with 0.0.2, where a workspace lives in .braid/work/<name>.
A fourth recording sets braid up in a project's git checkout the way
agents.md says: init, ignore .braid, import the history, agents init,
the rules the section gives, and a new session's workspace.
Changeseta00d76d443c2c25680cfa5ec8e15e8e8e676c4c0e11cc2fb59ebe14eb0b3a1a8
AuthorKikoCis <KikoCis@users.noreply.github.com> · 2026-10-17 12:13 +02:00
CommitterKikoCis <KikoCis@users.noreply.github.com> · 2026-10-17 13:46 +02:00
Parentsb27b4d239a54

Browse the files at this changeset

6 files changed

modified README.md +2 −0
@@ -125,6 +125,8 @@
125125 [braid.elffuss.com/agents.md](https://braid.elffuss.com/agents.md), next to
126126 an [llms.txt](https://braid.elffuss.com/llms.txt).
127127
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+
128130 ## Quick start
129131
130132 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 @@
156156 check(a.run("for a in a b c; do braid workspace add agent-$a; done"), 0, "workspaces")
157157 a.note("they edit and commit at the same time: no shared index, no lock")
158158 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")
160160 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")
162162 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")
164164 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")
168168 a.save()
169169
170170 # 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")
172172 b.note("agent-c changed the line agent-a landed first: main did not move")
173173 b.note("the conflict comes back as data, with all three sides")
174174 check(b.run("braid land --json | jq '.outcome, .next, (.conflicts[0].hunks[0] | map_values(.text))'",
@@ -200,7 +200,7 @@
200200 ):
201201 check(s.quiet(f"braid workspace add {who}"), 0, "workspace")
202202 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)
204204 check(s.quiet(
205205 f"""set -e
206206 {GIT} clone -q github.git laptop && cd laptop
@@ -215,11 +215,32 @@
215215 s.save()
216216
217217
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+
218238 def main():
219239 os.makedirs(WORK)
220240 os.makedirs(OUT, exist_ok=True)
221241 agents_and_conflict()
222242 git_sync()
243+ agents_init()
223244
224245
225246 main()