Sweep schema
The sweep.json fields agb sweep reads and the plan sweepToPlan generates from them.
A sweep runs the same operation across many targets: a migration, a refactor, an audit, a test backfill. agb sweep sweep.json turns the sweep spec into an ordinary plan with one ticket per target, validates it with the same validatePlan, and hands it to the normal run pipeline (build, gate, prosecute, merge) (dispatcher). The conversion is sweepToPlan in lib/sweep.mjs.
Example
{
"repo": "/abs/path/to/repo",
"base": "main",
"gate": { "test": "npm test" },
"tier": "cheap",
"pool_hint": "auto",
"operation": "Add JSDoc to every exported function in {target}. Do not change behavior.",
"targetGlob": "src/**/*.mjs",
"scopePerTarget": ["{target}"]
}Input fields
Prop
Type
sweepToPlan throws, and agb sweep exits 1, when repo is missing, operation lacks {target}, or neither targets nor targetGlob yields at least one target (checks).
Generated plan
For target number i (1-based) the generated ticket is (ticket mapping):
Prop
Type
Generated tickets have no edges and no rails: every item is independent. The plan itself carries repo, base (default main), gate, caps, prosecution and tickets (return value).
Scopes must not overlap
Each target becomes a parallel ticket. If two scopePerTarget expansions name the same file (for example a shared index), the tickets race on it. Keep per-target scopes disjoint, or run the shared change as a separate plan.
See the Sweeps guide for when to use a sweep and how --project applies, and agb sweep for the command.