---
name: babysit-runplan
description: Use when user asks to run/watch/babysit a run-plan — "run the plan", "babysit the runplan", "is the plan still running", "the run died, continue it" — or when a foreground runplan turn returns. Owns the launch-consume-branch loop; branches every failure on failureClass; only wrapper-engine-down is retriable.
---

# Babysit-Runplan — Foreground Run, failureClass-Branched Relaunch

Audience: AI coding agents first.

Rule: **run-plan skill owns HALT semantics and resume mechanics — this skill owns launch, log consumption, and the relaunch decision. NEVER blind-relaunch, NEVER re-run completed waves.**

ONE foreground `runplan <slug> ... --foreground` process owns orchestration; babysitter = the agent blocking on that turn, consuming its log. NEVER `run_in_background`, `&`, `nohup`, daemon mode, TaskOutput/TaskList polling, journal/process/service probing — runplan-blocking-gate denies these. Forensic reads (journal, run records, history) unlock ONLY once the coordinator is dead.

## Loop

1. **Launch**: `runplan <slug> ... --foreground` as one blocking Bash turn. Consume its output as it streams; the terminal receipt in that output is the ONLY status source for a live run.
2. **Exit 0** → step 4.
3. **Nonzero exit** → read `failureClass` from the terminal receipt (coordinator dead now → forensic reads allowed; journal wins over any other state). Branch:

   | failureClass | Verb — NEVER substitute Retry |
   |---|---|
   | `wrapper-engine-down` | Relaunch same command. ONLY retriable class. Max 2 consecutive; 3rd engine-down → escalate to `advisor`/`dead-advisor`. |
   | `gate-failed` | Read gate log, fix cause. NEVER `.warnignore` rubber-stamp, never skip review. |
   | `provider-quota` | Reroute account/seat, then relaunch. Resolver binding MUST differ from failed seat (wrapper OR model). |
   | `empty-diff` | Task produced nothing — inspect task spec + seat prompt, fix, resume. |
   | `stop-loss` / `claim-exceeded` | Budget tripwire — report to user in terminal report; do NOT relaunch around a cost stop. |
   | `workspace-provision-failed` / `dispatch-failed` | Fix environment cause (worktree, deps, wrapper path), then resume. |
   | `quality-quarantined` / `review-failed` | Read findings, fix cause, resume. |
   | `coordinator` / no receipt (crash) | Verify-then-resume: re-derive completed work from git + journal first, resume from journal position via `runplan <slug> ... --foreground`. |

   Resume after ANY fix = explicit foreground relaunch; engine resumes from journal — DO NOT restart from wave 0 when journal shows progress.
4. **Terminal report**: waves completed, commits produced (`git log --oneline` since run start), failures branched + verb applied, anything still gated on user. Quote failures exact.

## Boundaries

- **NEVER ask user mid-run** — runplan is autonomous; user input only pre-launch (gate resolution before `runplan` starts). Unexpected blocker mid-run → `advisor`/`dead-advisor`, treat verdict as the decision, act, log decision + rationale in terminal report. Asking user mid-plan = failed plan.
- DO NOT probe a LIVE run by any side channel — the foreground log is the interface.
- DO NOT resolve a failure by weakening a gate — fix cause or escalate to `advisor`/`dead-advisor`.
- Session restart with no context → `pickup` skill first to find the run, then relaunch foreground.
