All mechanics live in the bro CLI. This skill is policy only.
bro work sweep is the bead lifecycle's outflow stage: closed beads
accumulate forever, and bd prune alone would burn lessons nobody
harvested. Sweep gates the burn on a harvest marker.
The contract
- A closed bead is harvested when it carries the
sweep:distilledstate label (bd set-state <id> sweep=distilled). The marker is the gate's only input — no heuristics, no second channel. bro work sweep distillmaterializes the work instead of judging it: beads already cited as learn evidence auto-mark; the rest pour as an agent molecule (one step per bead —bro flow convoy run/bro fleet agents upexecutes them).bro work sweep runrefuses while unharvested closed beads are older thansweep.olderThanDays(default 30).--forceis the explicit override — the refusal is the feature, so use it only when the burn is intended. A closed bead with noclosed_atalso blocks: a row that can't be dated can't be proven safe.
Commands
| Command | What it does |
|---|---|
bro work sweep status |
Read-only: harvested/unharvested counts, age vs olderThanDays, the would-burn set |
bro work sweep distill [--dry-run] |
Auto-mark learn-cited beads; pour an agent molecule for the rest |
bro work sweep run [--dry-run] [--force] [--no-flatten] |
Gate → archive → sync-verify → bd prune --older-than → bd flatten |
Pipeline stages (run)
- Gate — unharvested beads past
olderThanDaysblock the run. - Archive —
bd exportJSONL + a per-beadprovenance logdump (bd prunedeletes provenance rows with the bead — the dump is the only place the bead→SHA/PR bindings survive). - Sync-verify — the archive must commit to
refs/bro/dataand be present in the ref tree, or run stops before pruning.sweep.dirmust resolve inside the synced set (.agents/or the debt dir) — anywhere else warns instatusand refuses inrun. - Prune —
bd prune --older-than <N>d --force. bd's protections apply unchanged: pinned, open, ephemeral, and open-bead-cited rows skip. - Flatten —
bd flattensquashes Dolt history + full GC (the space reclaim).sweep.flatten: falseor--no-flattenskips it.
Policy
- Wire
bro work sweep runinto loop end-of-queue or scheduled flows — the gate makes unconditional invocation safe. BRO_SWEEP_DIRoverridessweep.dir; keep it inside.agents/or archives stop syncing andrunrefuses.- Memories never leave the local store (
bd exportexcludes them) — the archive is issue content + provenance, nothing sensitive. bd set-stateleaves one residue event bead per mark; those are ephemeral-class and outsidebd prunescope — accepted, not a bug.