--- name: bugbash description: "Lead-only multi-reviewer bug workflow: gather full bug/linked context, swarm read-only reviewers split by reproduction method with find-it, converge via peer challenge logging rejected theories (decided:), route fixes to workers (fix-it) who resubmit to post-fix reviewers (prove-it + PR proof), and run make-it-stick (dispatching workers + review for structural guards). Use for complex, subtle, or high-impact bugs." --- # Bugbash Lead-only workflow: swarm read-only reviewers before writing fix code, converge via peer **challenge**, implement cleanly with **fix-it**, verify with **prove-it**, and capture lessons via **make-it-stick**. - **Watch & swap (all phases, per **lead**):** enforce `settings.json` clocks (`reviewer_minutes`, `worker_minutes`, `wind_down_minutes`, `check_in_minutes`) on every reviewer and worker. Stamp UTC `Started / Wind down at / End by` into briefs (pass `--settings`/`--timeout` to `astack-dispatch run`), log starts in `LANES.md`, check `astack-status` every `check_in_minutes`, remind at wind-down, and stop/swap overdue runs with a fresh successor carrying harvested artifacts/branch SHA and reset timers. - **Isolated workspaces & strict role split:** workers implement all code changes (fixes, competing prototypes, and structural guards) in **slates** in-memory VFS volumes (`https://github.com/hyper-light/slates`, preferred when available) or git worktrees. Reviewers stay strictly read-only—they run reproductions and verify submitted changes in isolated **slates** volumes or read-only review worktrees, **never writing or applying fixes themselves**; they send findings and recommended fixes to workers (via the lead), who implement them and resubmit the changes to the reviewers. 1. **Gather the bug dossier (**rtfm**):** read the report and fetch every linked issue, PR, doc, commit, log, trace, metric, or screenshot. Reuse this dossier for **both** investigation and post-fix review. 2. **Swarm read-only reviewers across reproduction methods:** dispatch blind `astack-reviewer` runs (or `astack-dispatch run --role reviewer` from `reviewer_pool`) with the full dossier, split across **complementary reproduction and investigation methods** rather than code areas (e.g., end-to-end correlated-data and full-environment replay; boundary, state-transition, and concurrency stress; history/config/env bisection; runtime profiling, tracing, and telemetry). Instruct each reviewer to: - follow **find-it** in order—replicate from correlated real data and full environment conditions, **shrink the repro first**, then narrow and prove root causes—strictly read-only; - return runnable repros, evidence, and concrete minimal fix proposals with trade-offs and **blast-radius** (never applying fixes themselves). 3. **Peer **challenge** with fresh runs and a stop rule:** - **Fresh runs, reset timers:** finished reviewers (especially one-shot `astack-dispatch` runs) cannot be messaged in place. Spawn fresh read-only reviewer runs per round with all peer reports (shrunk repros, evidence, diagnoses, fix proposals) and reset timers (`reviewer_minutes`, logged in `LANES.md`), instructing them to use **challenge** to disprove weak hypotheses. If competing fix proposals need runtime comparison before converging, the lead dispatches workers in isolated **slates** volumes or scratch worktrees to implement them and **resubmits** those workspaces to the reviewers to verify against the shrunk repro. - **Stop rule (**no-picked-constants**, **decisions-in-plain-words**):** - **Converged:** competing hypotheses are disproved or conceded with runnable proof, leaving one verified root cause and minimal fix. Log every **rejected root-cause theory** and **rejected fix approach** (with disproving evidence) as `decided:` entries in `LANES.md` (`astack-decisions`), then go to Step 4. - **No convergence / stalled:** if a round produces **no new runnable evidence**, hits a genuine product/architectural trade-off, or exhausts approved models/budgets, **stop immediately**. Escalate to the person in plain language with each surviving hypothesis (evidence + gaps), candidate fixes with **blast-radius**, and the lead's recommendation before any worker edits code. 4. **Implement via worker (**fix-it**) and resubmit:** dispatch `astack-worker` (or `astack-dispatch run --role worker`) in an isolated **slates** volume or git worktree with the converged root cause, shrunk repro, chosen fix proposal, and **rejected theories (`decided:` entries)**. Require **fix-it** discipline and a report of any **failed fix approaches/attempts** (workers never spawn subagents), then resubmit the worker's workspace/branch to the post-fix reviewers. 5. **Post-fix vectored **review** with **prove-it**:** log worker-reported failed fix approaches/attempts as `decided:` entries, then run vectored **review** (`astack-review-ledger` + `astack-check-gates`): - Pass post-fix reviewers the **original bug dossier, shrunk repro, rejected theories (`decided:` entries), and failed fix approaches/attempts**. - Instruct them to apply **prove-it** (deterministic before/after verification on the real artifact, empirical frequency from telemetry/analytics where relevant) and return concise runnable proof. - Send any proven gaps or follow-up fixes back to a fresh worker to implement in an isolated workspace and **resubmit** to the reviewers until clear. - **Attach proof to the PR:** summarize and attach the **prove-it** verification and runnable evidence (commands, outputs, traces, screenshots, benchmarks) to any PR generated for the fix (**watch-pr**). 6. **Sweep and clean up:** check **no-leaked-secrets** on diff and PR evidence; run **cleanup** to delete `_DEBUG_.` captures and ephemeral volumes/worktrees while preserving final PR evidence. 7. **Capture lessons (**make-it-stick**):** once post-fix review clears, **the lead** runs **make-it-stick** over the final fix, rejected root-cause theories (`decided:` entries), and failed fix approaches/attempts to record scoped lessons in `LESSONS.md`. Whenever a structural guard on the fix ladder (architecture, types, lint/hook, or regression test) requires code edits, **the lead dispatches a fresh `astack-worker`** (in an isolated **slates** volume or git worktree) to implement the guard and **resubmits it to a reviewer (**review**)** before landing. Referenced skills: `challenge` (`../challenge/SKILL.md`), `fix-it` (`../fix-it/SKILL.md`), `prove-it` (`../prove-it/SKILL.md`), `make-it-stick` (`../make-it-stick/SKILL.md`), `lead` (`../astack-lead/SKILL.md`), `slates` (`../slates/SKILL.md`), `rtfm` (`../rtfm/SKILL.md`), `find-it` (`../find-it/SKILL.md`), `blast-radius` (`../blast-radius/SKILL.md`), `no-picked-constants` (`../no-picked-constants/SKILL.md`), `decisions-in-plain-words` (`../decisions-in-plain-words/SKILL.md`), `review` (`../astack-review/SKILL.md`), `watch-pr` (`../watch-pr/SKILL.md`), `no-leaked-secrets` (`../no-leaked-secrets/SKILL.md`), `cleanup` (`../cleanup/SKILL.md`). Read any cited skill file before acting when its trigger applies.