-
Notifications
You must be signed in to change notification settings - Fork 0
Swarm
Mental model: "Try this task N different ways in parallel, then keep the best." Each agent works in its own git worktree + branch off a recorded base SHA, so agents never collide and main stays clean until you merge. Agents commit locally and never push β you are the merge gate.
Repo: StructuPath/herdr-swarm Β· Full reference: the repo README
| # | Action | You do | It does |
|---|---|---|---|
| 1 | Fan out | how many agents (N), preset per slot, the task | N worktrees + swarm/<run>/<slot> branches, task β .swarm-task.md, launches agents, opens Status |
| 2 | Status | watch; 1β9 jump into a slot, q quit |
per-slot state + committed/uncommitted counts vs the fork point |
| 3 | Harvest | review + merge, one slot at a time | merges good slots back --no-ff; removes worktree after (branch kept) |
| 4 | Prune | confirm via env flags | deletes fully-merged swarm/* branches (dry-run lists first) |
| β | Abort | bail anytime | stops agents, removes clean worktrees, keeps branches |
Everyday flow: TUI menu β Fan out (answer prompts) β Status (watch) β Harvest (keep winners) β Prune (tidy).
-
1β9select slot Β·rre-preview Β·qquit - Clean slot β merged automatically (base drift-checked before every merge)
- Dirty slot β
wcommit WIP Β·sskip Β·ddiscard (typed confirm, snapshot ref saved first) - Conflict β
sshell into merge tree Β·aabort merge Β·bback out
HERDR_SWARM_PRUNE_CONFIRM=yes # delete listed merged swarm/* branches
HERDR_SWARM_PRUNE_ACK_REVERTED=yes # also needed for merged-then-reverted
HERDR_SWARM_PRUNE_BACKUPS=yes # delete discard-snapshot backup refsPrune uses safe git branch -d semantics (never force), refuses branches still checked out in a worktree, and never touches snapshots belonging to the active run.
fanout can not be action-invoked β panes spawned by the herdr server don't inherit the caller's environment. Call the pane script directly with env overrides:
HERDR_SWARM_SLOTS=3 \
HERDR_SWARM_PRESETS=claude,claude,codex \ # one name = applies to all slots
HERDR_SWARM_TASK_FILE=/path/brief.md \
HERDR_SWARM_DETRITUS=rename \ # delete | rename | abort (leftover branches)
HERDR_WORKSPACE_ID=<repo workspace id> \
bash "$(herdr plugin list --json | jq -r '.plugins[]|select(.id=="structupath.swarm").root')/scripts/fanout-pane.sh"Harvest (scripts/harvest-step.sh), abort, and prune are also zero-TTY scriptable β an agent can drive the whole plugin. Presets live in presets.conf (name|kind|args); defaults are claude and codex.
-
Isolation is the point β own worktree + branch each;
mainuntouched until harvest. - You are the merge gate β agents commit locally, never push; you decide what lands.
- Cleanup is layered + safe β abort keeps branches, prune won't force-delete, discards snapshot first.
-
Fresh worktrees lack your env β
.env,node_modules, build caches are absent; the most likely cause of "all my agents failed instantly." Drop asetup.shin the plugin config dir to prep each worktree automatically. - Squash merges are invisible β a slot you squash-merged yourself still shows as pending; skip it by hand.
- Closing the parent repo workspace kills swarm agents silently β committed work survives and stays harvestable.
-
0.7.5 cosmetic quirk β a finished slot shows
workingin Status until you open Harvest; committed work is harvestable regardless.