Skip to content
b! brat

← use cases · refactor

Overnight refactor fleet

Queue a large mechanical refactor as dozens of tasks and let the fleet grind through it while you sleep.

who it's for

Engineers facing a repetitive, well-defined migration — a lint rule rollout, an API rename, a framework upgrade across many modules.

the problem

Mechanical refactors are tedious but rarely hard. The blocker is throughput and the fear that a crash at 3am leaves the repo half-migrated with no record of what finished.

how brat does it

  1. 1

    File one task per module or per file, either by hand or by letting the Mayor enumerate them.

  2. 2

    Set bounded timeouts so a hung agent releases its lease instead of stalling the convoy.

  3. 3

    Run the witness unattended; because state is an append-only log, a machine sleeping or crashing is a pause, not corruption.

  4. 4

    In the morning, brat status shows exactly what merged, what is blocked, and what failed — rebuilt deterministically from the WAL.

the outcome

A migration that would eat days of attention runs overnight, crash-safe, with a complete audit trail instead of a guessing game about what got done.