Harness Autopilot
Lightweight orchestrator — dispatches isolated phase-agents, tracks state, chains artifacts between phases. Delegates all planning/execution/verification/review to dedicated persona agents.
When to Use
- After a multi-phase spec is approved and you want automated phase execution
- When a project has 2+ implementation phases requiring repeated skill invocations
- NOT for single-phase work (use harness-execution directly)
- NOT when the spec is not yet approved (use harness-brainstorming first)
- NOT for CI/headless execution (conversational skill)
Persona Agents
| Skill | subagent_type | State(s) |
| ----------------------- | ----------------------- | -------------------- |
| harness-planning | harness-planner | PLAN |
| harness-execution | harness-task-executor | EXECUTE |
| harness-verification | harness-verifier | VERIFY |
| harness-integration | harness-verifier | INTEGRATE |
| harness-code-review | harness-code-reviewer | REVIEW, FINAL_REVIEW |
Iron Law: Autopilot delegates, never reimplements. If writing plan/execute/verify/review logic, STOP — delegate via subagent_type. Always use dedicated persona agents, never general-purpose agents. <!-- not-a-pause: self-correction against reimplementing skills -->
Lifecycle skill hooks (project-declared) — `skillHooks`
A project may attach additional skills, commands, and prompts at lifecycle points of any hook-supporting skill via the top-level skillHooks block in harness.config.json. This is the general framework; autopilot is its flagship consumer (the review case below is the primary worked example). Resolution/normalization is shared in @harness-engineering/core (resolveSkillHooks + the hook input-context helpers) so every hook-supporting skill honors the same contract.
// harness.config.json
{
"skillHooks": {
"harness-autopilot": {
"before:EXECUTE": [
"preflight-skill", // bare string = a `skill` hook (shorthand)
{ "type": "command", "run": "pnpm lint", "blocking": true },
{
"type": "prompt",
"text": "Prefer existing helpers in packages/core/util over new ones.",
},
],
"after:REVIEW": [{ "type": "skill", "skill": "canary-cassandra", "blocking": true }],
"after:FINAL_REVIEW": ["canary-cassandra"],
"on:failure": [{ "type": "command", "run": "scripts/notify.sh" }],
},
},
}
Autopilot's hookable event vocabulary. Event keys follow the grammar ^(before|after|on):[A-Za-z0-9_-]+$. Autopilot's phase states are PLAN, EXECUTE, VERIFY, INTEGRATE, REVIEW, and FINAL_REVIEW. Hooks are wired today at exactly four points: before:EXECUTE, after:REVIEW, after:FINAL_REVIEW, and on:failure (at the failure path — see EXECUTE recovery and the review hard-halt). The remaining phase boundaries (before:PLAN/after:PLAN, after:EXECUTE, before:VERIFY/after:VERIFY, before:INTEGRATE/after:INTEGRATE, before:REVIEW) share the same grammar and resolver but are not yet wired — a hook configured at an unwired event is a no-op (silently skipped, not hard-halted) until that boundary is wired, which is a documented follow-up. Configure only the four wired events for guaranteed firing; the hard-halt false-green protection applies at those wired points.
Three hook kinds. Each array entry is a bare skill-name string (shorthand for a skill hook) or one of three discriminated objects. All object kinds accept "enabled": false to park a hook without deleting it (a disabled hook is skipped — never a hard halt):
skill—{ "type": "skill", "skill": "<name>", "blocking"?: bool }. Dispatch that skill as an additional subagent (the LLM path). Its brief MUST include the same context the built-in persona/reviewer gets (see Hook context).prompt—{ "type": "prompt", "text": "<text>" }. Mechanically APPENDtextto that phase's persona-agent prompt/context. Purely declarative — runs no process, has no pass/fail, always non-blocking. (Static text in v1;{{token}}templating is RESERVED v2.)command—{ "type": "command", "run": "<shell>", "blocking"?: bool }. Mechanically RUN the command at the hook point via the harness command-runner (honoring cwd), capturing exit code + stdout/stderr into the phase record. Deterministic, no LLM.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
Blocking & hard-halt policy (per kind).
skill— an unresolvable/undispatchable skill (typo, not installed) is a HARD HALT, not a silent skip and not an overridable finding: record it in.harness/failures.md, set the stage status to failed, and stop (resumable once config is fixed). Findings block per the default-blocking policy (review/verify events defaultblocking:true, elsefalse; a per-entryblockingoverrides).command— distinguish two failure modes: (a) the command CANNOT be spawned (binary missing / spawn error) = HARD HALT, same class as an unresolvable skill; (b) the command RAN and exited non-zero = a normal finding, blocking per the default-policy/override (NOT a hard halt).prompt— never blocks and never halts (it is only text; an emptytextis a config-validation error).
Hook context (input contract). When autopilot fires a hook it threads the invocation context, assembled once by the shared module:
| Env var (for command) | Meaning |
| ------------------------ | ---------------------------------------- |
| HARNESS_HOOK_EVENT | the event key, e.g. after:REVIEW |
| HARNESS_HOOK_SKILL | the host skill, e.g. harness-autopilot |
| HARNESS_PHASE | the current phase/state, when known |
| HARNESS_PROJECT_ROOT | absolute project root |
| HARNESS_SESSION_DIR | the session directory, when known |
| HARNESS_CHANGED_FILES | newline-separated list of changed files |
| HARNESS_PLAN_PATH | the active plan path, when known |
| HARNESS_FAILURE_REASON | set only on on:failure |
commandhooks receive this context as those env vars AND the same context as a JSON object on stdin for structured consumers. Absent values are UNSET env keys (no empty-string placeholders). Conditional/glob scoping is achievable today by a command self-gating on$HARNESS_CHANGED_FILES(a dedicated conditional-glob field is RESERVED v2).skillhooks receive the same context (event, session dir, changed files, plan path) in the subagent brief, reusing whatever context the built-inharness-code-reviewerdispatch already threads.prompthooks are the static text, appended verbatim.
Generic dispatch pattern (one pattern, every event). At each hookable point, resolve and run the project's hooks:
hooks = resolveSkillHooks(config, "harness-autopilot", "<before|after|on>:<STATE>")(empty ⇒ no-op; absent/empty config preserves today's exact behavior — no regression).- For each hook in order, by kind:
prompt→ appendtextto this phase's persona prompt;command→ run via the command-runner with the hook env + JSON stdin (cannot-spawn ⇒ hard halt; ran-and-non-zero ⇒ finding);skill→ dispatch as an additional subagent with a brief carrying the hook context. - Merge
command/skillfindings into this phase's aggregation, honoring each hook'sblocking.
Extension contract — how a skill becomes hook-supporting. (1) Declare its event vocabulary in its own SKILL.md; (2) at each lifecycle point call resolveSkillHooks(config, "<this-skill>", "<event>"); (3) honor the blocking + hard-halt rules and pass the hook input-context. harness-autopilot and harness-code-review are the wired reference consumers; remaining skills (brainstorming, fleets, ...) follow as a follow-up.
RESERVED (v2). Per-iteration granularity (after:EXECUTE:task, after:dispatch:item — a phase-level hook fires once per phase, not per item), a "*" wildcard outer key ("hooks for every skill"), and {{token}} prompt templating.
Canary detectors auto-wire at REVIEW / FINAL_REVIEW (default, zero-config, forward-wired). When canary is present, autopilot's two review moments run canary's deterministic test detectors — canary-savant (test order-dependence / shared-state leakage), canary-blackhawk (temporal dependence: wall-clock, timezone, DST, Feb 29), canary-katana (tests deleted or newly skipped by the change), and canary-cassandra (vacuous tests / assertions that cannot fail) — alongside harness-code-reviewer, never replacing it. These are the SPECIFIC detectors named by the feature request (distinct from a general-purpose test reviewer, which finds brittleness/anti-patterns but structurally cannot find a self-comparing assertion or an order-dependent pass). This is an additional default layer, not new config: it fires only when canary is detected, reusing the exact skillHooks dispatch/context path.
Forward-wired — these are harness-OPTIMISTIC defaults, not guaranteed-installed skills. A detector that is not installed is skipped, never a hard halt — the opposite of a user's typo'd hook — and each auto-activates once canary ships it and it reports as installed. Canary ships all four as of 7.2.0. Availability is matched prefix-insensitively, so a catalog reporting the plugin-qualified
canary:canary-cassandrawires the same detector as the bare name. Report the denominator and treat a surprising0/4as a finding, not as the expected state — an earlier version of this note asserted that canary shipped none of the four, which made a silent zero read as correct behaviour long after it had stopped being true.
- Detect canary once per review. Call the
canary_probeMCP tool;status: "available"⇒ canary present.degraded/absent ⇒ canary absent, and the effective hooks are exactly today's configuredskillHooks(no regression). - Determine which detectors are installed. Check the available skill catalog for each of the four detector names (the same way you know whether any other skill is dispatchable). Pass the installed set as
availableSkillsbelow — this is what makes the wiring forward-compatible and resolve-and-filter, rather than optimistic-and-halt. - Resolve effective review hooks via the merged resolver. Instead of the bare
resolveSkillHooksatafter:REVIEW/after:FINAL_REVIEW, autopilot usesresolveReviewHooksWithCanary(config, "harness-autopilot", "<after:REVIEW|after:FINAL_REVIEW>", { canaryPresent, availableSkills })(from@harness-engineering/core). It returns the project's configured hooks FIRST, then appends only the installed canary detectors, dropping any detector the project already declares (the explicit entry wins — no double dispatch). UseplanCanaryReviewDetectors(canaryPresent, event, availableSkills)to get the{ wired, skipped, expected }split for the denominator report. Wired detectors are ordinary blockingskillhooks, dispatched and aggregated through the same path as any configured hook. - A not-installed canary default detector is SKIPPED, never a hard halt. Because a canary default is harness-optimistic (forward-wired), a detector whose skill is not installed is filtered out by the resolver and simply recorded as skipped. It must NOT set the review to failed and must NOT halt. This is distinct from the user-declared
skillHookshard-halt below. - A USER-declared unresolvable hook still HARD-HALTS. A skill a project explicitly lists in
skillHooks(including a detector name typed by hand) that cannot be dispatched is the same false-green class as any configuredskillhook: record it in.harness/failures.md, set the review status to failed, and halt with "cannot verify". The distinction is intent: harness-optimistically-defaulted-but-not-yet-shipped = skip; user-declared-but-unresolvable = hard halt. - A project can override or park any detector. Re-declaring a detector in
skillHooks(e.g.{ "type": "skill", "skill": "canary-cassandra", "blocking": false }) overrides itsblocking; declaring it{ ..., "enabled": false }parks it entirely (theenabled: falsecontract applies to the auto-wired defaults too — a parked detector is skipped, never re-injected). Dedup is by raw declared name, so both cases suppress the default. - Report the denominator, including skips. State how many detectors ran of how many were expected and why any were skipped (e.g. "canary detectors: 0/4 ran — 4 skipped: not installed in this canary version"), so a partial or forward-wired run is never presented as a full one.
- Detectors wire only at
after:REVIEWandafter:FINAL_REVIEW; no other phase boundary gains them.
Craft domains auto-wire at REVIEW / FINAL_REVIEW (default, zero-config, forward-wired, ADVISORY).
The craft family's ceiling-layer critique runs automatically at autopilot's two review moments,
alongside harness-code-reviewer and the canary detectors, never replacing either. Resolve
resolveReviewHooksWithCraft(config, "harness-autopilot", "<after:REVIEW|after:FINAL_REVIEW>", { changedFiles, availableSkills, alreadyRanFor })
(from @harness-engineering/core), and use
planCraftReviewDomains(hostSkill, event, changedFiles, availableSkills, opts) for the
{ wired, skipped, expected, files } split.
- ADVISORY, NOT BLOCKING. Craft hooks are emitted
blocking: falseby contract — NOT
defaultBlocking(event), which is the canary default sitting one file away. Craft findings are
surfaced in the review report and do not contribute to the error/warn severity counts and
do not gate PHASE_COMPLETE. A taste judgment never blocks.
- DIFF-SCOPED — forward
files, and forward them as ABSOLUTE paths. Readplan.files[skill]
(the domain's owned, already-normalized subset) and forward it as the craft skill's files
argument, together with a promptBudget where that domain's MCP tool accepts one (see each
craft skill's "Invoked as a review hook" section; mcp__harness__design_craft does not — it
accepts neither promptBudget nor maxFiles, so bound it with phases / mode instead or
it runs all three phases over 13 rubrics with no ceiling). plan.files holds **repo-relative
POSIX paths — resolve each entry against the project root first**; absolute is correct for
every domain and REQUIRED for one. Forwarding them unresolved behaves DIFFERENTLY by domain:
the nine collector-based domains resolve a relative entry against the tool's path (never
the process CWD), so they still read the in-diff file
(packages/cli/tests/shared/craft/relative-files-scope.test.ts), while
mcp__harness__design_craft has no collector, resolves a relative entry against the process
CWD, and THROWS ENOENT out of runCritique, which has no try/catch
(packages/cli/tests/design-craft/phases/files-path-form.test.ts).
Never call rule.owns() yourself: it is correct only on repo-relative POSIX paths, and on raw VCS
output it yields false negatives and, worse, false positives (a dist\… build artifact leaks in).
- NO DIFF CONTEXT, NO ACTIVATION. When the changed-file set is unknown, nothing activates and
every domain is reported no-diff-context. Do not fall back to a repository walk.
- ONCE PER PHASE PER DIFF. The cap is per RESOLUTION, so two review moments can otherwise
dispatch up to 2x maxDomains on the same code. At after:FINAL_REVIEW, pass the domains wired
at after:REVIEW as alreadyRanFor when the changed-file set is unchanged; they are then
reported already-run. If the diff changed between the two moments, pass nothing — a domain
should re-run after fixes land.
- A not-installed craft domain is SKIPPED, never a hard halt. Craft defaults are
harness-optimistic (forward-wired), exactly like the canary detectors: the resolver filters them
out and they are recorded in the denominator. A **USER-declared unresolvable hook still
HARD-HALTS.** Availability is matched prefix-insensitively, so a catalog reporting
harness-claude:code-craft wires the same domain as the bare name.
- A craft hook that FAILS at runtime is recorded, and the review does not fail. Record it in
{sessionDir}/phase-{N}-review.json and in the denominator; an advisory reviewer that crashed is
a missing opinion, not a broken gate.
- A project can override or park any domain. Declaring it in
skillHookswins (no double
dispatch); { "enabled": false } parks it. Dedup is by canonical name — note that
harness-design-craft is the only craft skill whose canonical name carries the harness-
prefix, so declaring design-craft does NOT suppress it.
- Report the denominator, including skips. State how many domains activated of how many were
expected and why each was skipped — e.g. "craft domains: 2/3 activated, 1 skipped:
unsupported-language". A surprising 0/M renders as 0/M, never as silence.
- Craft domains wire only at
after:REVIEWandafter:FINAL_REVIEW; no other phase boundary
gains them.
Rigor Levels
Set at INIT (--fast / --thorough); persists for session. Default: standard.
| State | fast | standard | thorough |
| ------------ | ------------------------------- | --------------------- | ------------------------------- |
| PLAN | Skip skeleton pass | Default | Always skeleton with approval |
| APPROVE_PLAN | Signal-based (same as standard) | Signal-based | Review forced (every plan) |
| EXECUTE | Skip scratchpad | Scratchpad >500 words | Verbose scratchpad |
| VERIFY | harness validate only | Full pipeline | Expanded checks |
| INTEGRATE | WIRE only | Full tier-appropriate | Full + every ADR draft reviewed |
Rigor decides how much is checked; autonomy decides who approves (see the Pause Protocol, D2). --fast never approves a plan or INTEGRATE on its own.
Pause points
Every point below where this skill stops for the human carries a marker line, _Pause point (<class>): resolve per the Pause Protocol._ followed by a <!-- pause: <class> --> comment. Resolve each one with the Pause Protocol: agents/skills/templates/pause-protocol.md (also shipped in the harness CLI package at dist/agents/skills/templates/pause-protocol.md).
- Re-read autonomy at every pause point:
gather_context({ path, session, include: ["autonomy"] }). irreversibleandgatepauses stop at every autonomy level.- A
ceremonyorjudgmentpause auto-resolves only when autonomy istrusted, the pause states a recommendation, ajudgmentfork passed the self-audit, andrecord_auto_decisionreturnedrecorded: true. In every other case, pause exactly as written below. - If you cannot read the protocol or resolve autonomy, pause.
State Machine
INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → INTEGRATE → REVIEW → PHASE_COMPLETE
│
[next phase?]
│ │
ASSESS FINAL_REVIEW → OUTCOME_EVAL → DONE
INIT
- Resolve spec path (argument or prompt).
- Derive session slug: strip
docs/, drop.md, replace/and.with--, lowercase. SetsessionDir = .harness/sessions/<slug>/. - Apply autonomy flags first (D17). Before any subagent dispatch and before the first marked point below: if this skill was invoked with
--supervised, callmanage_state({ action: "set-autonomy", path, session, level: "supervised" }); if with--audit, call it withaudit: true. Flags only lower autonomy: on--trustedor--no-audit, change nothing and print the raise hint from the Pause Protocol. Then read autonomy withgather_context({ path, session, include: ["autonomy"] }). With no session slug nothing can auto-resolve, so there is nothing to lower. - Check for existing state: read
{sessionDir}/autopilot-state.json. If present and not DONE: report "Resuming from{currentState}, phase {N}: {name}." Apply schema migration ifschemaVersion < 5(backfill missing fields). Jump to recorded state. - Fresh start: read spec, parse
## Implementation Orderfor phases (### Phase N: Name+<!-- complexity: low|medium|high -->, default:medium). CapturestartingCommitviagit rev-parse HEAD. Writeautopilot-state.json(schemaVersion: 5, currentState: "ASSESS", currentPhase: 0). - Flags:
--fast→rigorLevel: "fast".--thorough→rigorLevel: "thorough".--review-plans→reviewPlans: true. Both flags together → reject with error. - Call
gather_context({ path, skill: "harness-autopilot", session: slug, include: ["state", "learnings", "handoff", "graph", "businessKnowledge", "sessions", "validation", "autonomy"] }). - → ASSESS.
After every dispatch
After every subagent dispatch (planner, task-executor, verifier, integration, reviewers, hooks), read {sessionDir}/handoff.json blockers and concerns.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
If any blocker starts with audit-disagreement:, the subagent hit a self-audit disagreement it could not settle headless (Pause Protocol, Escalation): present both positions from concerns to the human in plain text and wait for their choice. This escalation stops at every autonomy level. It is not a failure: it never enters the EXECUTE retry path, and the same unit is never re-dispatched to settle it. Once the human answers, record the answer per the Pause Protocol (Escalation) and resume the state that dispatched the unit, passing the answer to it as context.
_Pause point (judgment): resolve per the Pause Protocol._ <!-- pause: judgment -->
If any blocker starts with judgment-fork:, the subagent reached a judgment fork it could not audit (Pause Protocol, Handing a fork back). Resolve it here as a judgment pause per the Pause Protocol, using the options and recommendation from concerns. In trusted mode, run the self-audit in this session and auto-take only on agreement. Then remove that judgment-fork: blocker from {sessionDir}/handoff.json, so nothing later (for example the orchestrator) reads it as unresolved, and resume the state that dispatched the unit, passing the decision to it as context. Like a disagreement, it is not a failure and never enters the EXECUTE retry path.
ASSESS
- Read current phase at
currentPhase. - If
planPathset and file exists: → APPROVE_PLAN. - Intelligence-enhanced complexity assessment. Before routing by complexity, refine the annotation with signals from available tools:
- Run
predict_failureson the phase domain to check if constraints are trending toward violation — high failure probability suggests upgrading complexity. - Run
compute_blast_radiuson files the phase is likely to touch — large blast radius (>15 affected modules) suggests upgrading tohigh. - If the orchestrator is running, request intelligence analysis via
POST /api/analyzewith the phase title/description to get CML complexity scores and PESL simulation results. Use CMLstructuralComplexity > 0.7or PESLriskScore > 0.6as triggers to upgrade complexity routing. - If no orchestrator, the MCP tool signals above are sufficient.
- Complexity routing:
low/medium: auto-plan via harness-planner → PLAN.
_Pause point (judgment): resolve per the Pause Protocol._ <!-- pause: judgment -->
high: pause with two options: auto-plan via harness-planner (recommended: the planner's own forks are marked and audited, and APPROVE_PLAN still applies) → PLAN, as forlow/medium; or interactive planning: instruct "Run/harness:planninginteractively, then re-invoke/harness:autopilot." and wait for re-invocation.
- Update
currentState: "PLAN".
PLAN
Auto-plan (low/medium): Dispatch harness-planner:
subagent_type: "harness-planner"
prompt: "Phase {N}: {name}. Spec: {specPath}. Session: {sessionSlug}. Rigor: {rigorLevel}. Follow harness-planning. Write plan to docs/changes/<topic>/plans/ (topic from specPath; legacy docs/plans/ if spec is outside docs/changes/). Write {sessionDir}/handoff.json when done."
On return: read planPath from {sessionDir}/handoff.json. Complexity override check: low + tasks>10 or checkpoints>3 → "medium"; tasks>20 or checkpoints>6 → "high". Update state planPath. → APPROVE_PLAN.
_Pause point (judgment): resolve per the Pause Protocol._ <!-- pause: judgment -->
Interactive plan (high): Check for plan file at docs/changes/<topic>/plans/*{phase-name}* (or legacy docs/plans/*{phase-name}*) or planPath in handoff. If found: update planPath → APPROVE_PLAN. If not: remind and wait.
APPROVE_PLAN
- Gather: task count, checkpoint count, concerns from
{sessionDir}/handoff.json(default[]). "fast"→ same signals as"standard"(D2:--fastreduces checking; it never approves on its own)."thorough"→ forceshouldPauseForReview = true.
_Pause point (ceremony): resolve per the Pause Protocol._ <!-- pause: ceremony -->
- Signals (any true → pause; all false → auto-approve):
reviewPlans: truephase.complexity === "high"phase.complexityOverride !== null- Handoff
concernsnon-empty - Task count > 15
- Knowledge gaps:
harness knowledge-pipeline --domain <phase-domain>reportstotalGaps > 0and--fixwas not run during planning
- Auto-approve: emit report (mode, complexity, concerns, task count). Record decision with signal snapshot in
decisions[]. → EXECUTE.
_Pause point (ceremony): resolve per the Pause Protocol._ <!-- pause: ceremony -->
- Pause: show triggered signals. Ask "Approve? (yes / revise / skip phase / stop)." Record decision. Route accordingly. If
reviewPlansistrue, this approval never auto-resolves: the human asked to see every plan.
EXECUTE
Pre-dispatch: before:EXECUTE hooks. Resolve resolveSkillHooks(config, "harness-autopilot", "before:EXECUTE") and run each hook in order by kind (see Lifecycle skill hooks): a prompt hook appends its text to the task-executor brief; a command hook runs via the command-runner with the hook env + JSON stdin (cannot-spawn ⇒ hard halt to .harness/failures.md; ran-and-non-zero ⇒ a finding, blocking per its policy — surface it before dispatching); a skill hook runs as a pre-flight subagent. This is the non-review generality proof: hooks fire at a non-review phase too. Empty/absent ⇒ no-op.
Pre-dispatch: plan parallelization (standard automatic parallelism). Before dispatching tasks, decide the safe parallel structure. This is orchestration, not reimplementation — autopilot chooses HOW to dispatch; the persona agents still do the work.
- Collect the phase's tasks with their
files,dependsOn, andowns(from the plan's task headers —ownscomes from the optional**Owns:**line). Call theplan_parallelizationMCP tool:
```json
{
"path": "<project-root>",
"tasks": [{ "id": "task-1", "files": ["..."], "dependsOn": [], "owns": ["src/api/**"] }],
"depth": 1
}
```
It returns a ParallelizationPlan: waves[] (each { tasks, severity, firing, analysisLevel }), serialized[], cyclic[], narration, and ownershipForecast. Forwarding each task's owns lets the cheap deterministic owns-overlap check contribute implicit edges to the wave DAG and surface any overlapping ownership pairs in ownershipForecast. Omit owns for tasks that declare none — it stays a no-op.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
- If
cyclicis non-empty: STOP. Surface the cycle and route back to PLAN/APPROVE_PLAN (a dependency cycle is a plan defect). Do not dispatch.
- Announce (announce-and-proceed): emit
narrationverbatim. Do NOT pause here — announcing is not a gate.
- Dispatch in dependency order — prerequisites first, then waves in array order:
- First, run every task in
serialized(high-severity-group / cycle-adjacent members) serially, oneharness-task-executorper task, in listed order. These are cross-bucket prerequisites: they MUST complete before any wave that depends on them. - Then process
wavesin array order. Thewavesarray is already topologically sorted (earlier waves are prerequisites of later ones). Do NOT reorder waves and do NOT key dispatch off thefiringfield alone — the Phase-2 cross-bucket cap (a wave depending on a serialized/cyclic task is downgraded toconfirmand marked "cross-bucket prerequisite gates this wave" innarration) is only sound if serialized/cyclic ran first and waves run in order. <!-- not-a-pause: describes wave ordering, not a human ask -->
- For each wave, honor its
firing:
auto-dispatch(multi-task): emit that wave's line fromnarration, then dispatch the wave via the harness-parallel-agents skill with worktree-per-unit isolation perdocs/guides/agent-worktree-patterns.md("Worktree-per-Milestone" / "Parallel Agent Work": one worktree per task, sequential commits, squash-merge at integrate). Announce and proceed — do NOT stop for confirmation. <!-- not-a-pause: auto-dispatch proceeds without a human -->
_Pause point (judgment): resolve per the Pause Protocol._ <!-- pause: judgment -->
confirm: surface the wave and itsnarrationline, then take exactly ONE plain-text confirmation — "Dispatch wave [{tasks}] in parallel? (yes / serial)".yes→ dispatch via harness-parallel-agents (worktree-per-unit).serialor decline → run the wave's tasks serially (harness-task-executoreach). Record the choice indecisions[].serialize, or any single-task wave: run serially viaharness-task-executor, exactly as today.
- Serial fallback is preserved when a phase has fewer than
minWaveSize(default 3) independent tasks, when aconfirmis declined, or when no graph is available and the human does not confirm — honoring the standing "when in doubt, run serially" default. <!-- not-a-pause: describes the fallback after a declined confirm -->
Each dispatched unit (parallel wave or serial task) then follows the existing per-task contract below (state.json per task, checkpoints, retry budget).
Dispatch harness-task-executor:
subagent_type: "harness-task-executor"
prompt: "Phase {N}: {name}. Plan: {planPath}. Session: {sessionSlug}. Rigor: {rigorLevel}. Update {sessionDir}/state.json per task. Write {sessionDir}/handoff.json when done or blocked."
Checkpoints:
_Pause point (ceremony): resolve per the Pause Protocol._ <!-- pause: ceremony -->
[checkpoint:human-verify]→ show output, confirm, resume.
_Pause point (judgment): resolve per the Pause Protocol._ <!-- pause: judgment -->
[checkpoint:decision]→ present options, record choice, resume.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
[checkpoint:human-action]→ instruct user, wait for confirmation, resume.
After each passing checkpoint: commitAtCheckpoint().
Outcome: All tasks complete → VERIFY. A handoff blocker starting audit-disagreement: or judgment-fork: is not a task failure; handle it per After every dispatch. Task fails → retry logic:
- Attempt 1: read error, apply obvious fix, re-dispatch for failed task.
- Attempt 2: expand context — read related files, check
learnings.md, re-dispatch. - Attempt 3: full context — test output, imports, plan instructions, re-dispatch.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
- Budget exhausted: recovery commit (
[autopilot][recovery]prefix in message), record in.harness/failures.md. Fireon:failurehooks —resolveSkillHooks(config, "harness-autopilot", "on:failure")— passing the hook context withHARNESS_FAILURE_REASONset to the failure summary (acommandhook e.g.scripts/notify.shis the natural use; these are advisory and never block the failure path). Then ask: "fix manually and continue / revise plan / stop." The sameon:failurefan-out runs whenever autopilot writes a hard-halt/failure to.harness/failures.md(e.g. an unresolvable review hook).
VERIFY
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
"fast": runharness validate. Pass → INTEGRATE. Fail → surface to user."standard"/"thorough": dispatch harness-verifier:
```
subagent_type: "harness-verifier"
prompt: "Phase {N}: {name}. Session: {sessionSlug}. Rigor: {rigorLevel}. Verify and report pass/fail with findings."
```
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
Pass → INTEGRATE. Fail → ask "fix / skip verification / stop." fix: re-enter EXECUTE (retry budget resets).
INTEGRATE
- Resolve tier:
max(plan.integrationTier, derived-from-execution). If tier escalated: notify human with "Tier escalated from{planned}to{derived}: {reason}." - Dispatch harness-integration skill:
```
subagent_type: "harness-verifier"
prompt: "Phase {N}: {name}. Session: {sessionSlug}. Tier: {tier}.
Plan: {planPath}. Verify integration per harness-integration skill."
```
- Rigor interaction:
"fast": WIRE sub-phase only, no ADR drafting."standard": Full tier-appropriate checks (WIRE + MATERIALIZE + UPDATE per tier)."thorough": Full checks + human reviews every ADR draft + force knowledge graph verification.
- Pass → REVIEW.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
- Fail → report incomplete items. Ask "fix / skip integration / stop":
- fix: re-enter EXECUTE with integration-specific fix tasks, then re-VERIFY, re-INTEGRATE. Retry budget resets.
- skip: record decision in
decisions[], proceed to REVIEW (human override). - stop: save state and exit.
REVIEW
Dispatch harness-code-reviewer:
subagent_type: "harness-code-reviewer"
prompt: "Phase {N}: {name}. Session: {sessionSlug}. Follow harness-code-review. Report findings (critical / important / suggestion)."
Then run each effective after:REVIEW hook. Probe canary once (canary_probe; status: "available" ⇒ present), determine which of the four detectors are installed, and resolve resolveReviewHooksWithCanary(config, "harness-autopilot", "after:REVIEW", { canaryPresent, availableSkills }) (from @harness-engineering/core). This returns the project's configured skillHooks (default none) followed by canary's installed deterministic detectors when canary is present — see "Canary detectors auto-wire" under Lifecycle skill hooks. When canary is absent it returns exactly the configured hooks (no regression). Run each hook in order by kind (see Lifecycle skill hooks): a skill hook is dispatched as an extra reviewer, a command hook runs via the command-runner, a prompt hook appends its text to the review brief. For a skill hook:
Also resolve craft's advisory domains at this moment. Call
resolveReviewHooksWithCraft(config, "harness-autopilot", "after:REVIEW", { changedFiles, availableSkills })
and planCraftReviewDomains("harness-autopilot", "after:REVIEW", changedFiles, availableSkills) —
see "Craft domains auto-wire" under Lifecycle skill hooks. Dispatch each wired domain as an extra
reviewer with its own plan.files[skill] resolved to absolute paths, plus a promptBudget
where that domain's MCP tool accepts one (mcp__harness__design_craft does not), and
merge its findings as non-blocking advisory output that does not count toward severity. Record
which domains wired; they are the alreadyRanFor input at FINAL_REVIEW.
subagent_type: "<hook skill name>"
prompt: "Phase {N}: {name}. Session: {sessionSlug}. Domain review. Context: {hook context}. Report findings (critical / important / suggestion)."
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
If a user-declared hooked skill cannot be dispatched (typo / not installed), or a command hook cannot be spawned (missing binary), do not skip it silently and do not offer it as an overridable finding: record it in .harness/failures.md, set the review status to failed, and halt REVIEW with "cannot verify" — a hard halt (see Lifecycle skill hooks, above). (A command that RAN and exited non-zero is instead a normal finding, blocking per policy — not a hard halt.) A harness-default canary detector that is not installed is the exception: it was already filtered out by resolveReviewHooksWithCanary (forward-wired, graceful skip) and is recorded as skipped in the denominator, never a hard halt. Persist each hook's findings under a per-hook key in {sessionDir}/phase-{N}-review.json so provenance survives, and merge them into the same blocking/non-blocking aggregation as the baseline reviewer. Report the detector denominator (how many hooks ran of how many were expected, and how many were skipped-not-installed) so a partial or forward-wired run is never presented as complete. Report the craft denominator in the same breath ("craft domains: N/M activated, K skipped: <reasons>") — a not-installed or unsupported-language craft domain is a graceful skip recorded in the denominator, never a hard halt and never a blocking finding.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
Persist findings to {sessionDir}/phase-{N}-review.json. No blocking (across baseline + additional reviewers) → PHASE_COMPLETE. Blocking → ask "fix / override / stop." fix: re-enter EXECUTE. override: record decision in decisions[] → PHASE_COMPLETE.
PHASE_COMPLETE
- Present summary: name, tasks completed, retries used, verification result, integration report (
{sessionDir}/phase-{N}-integration.json), review findings count, elapsed time. - Record in
history[]: phase index, name, startedAt, completedAt, tasksCompleted, retriesUsed, verificationPassed, integrationPassed, reviewFindings. - Mark phase
completein state. Clear scratchpad:clearScratchpad({ session, phase, projectPath }). - Sync roadmap:
manage_roadmap sync apply:true(skip if no roadmap; neverforce_sync: true). - Write session summary:
writeSessionSummary(projectPath, sessionSlug, { session, lastActive, skill: "harness-autopilot", phase, status, spec, plan, keyContext, nextStep }).
_Pause point (ceremony): resolve per the Pause Protocol._ <!-- pause: ceremony -->
- More phases: "Phase {N} complete. Next: {N+1}: {name} ({complexity}). Continue? (yes / stop)."
yes→ incrementcurrentPhase, resetretryBudget, → ASSESS.stop→ save and exit. - No more phases: → FINAL_REVIEW.
FINAL_REVIEW
- Set
currentState: "FINAL_REVIEW",finalReview.status: "in_progress". - Gather per-phase findings from
{sessionDir}/phase-{N}-review.jsonfiles. - Dispatch harness-code-reviewer:
```
subagent_type: "harness-code-reviewer"
prompt: "Final cross-phase review. Diff: git diff {startingCommit}..HEAD. Session: {sessionSlug}. Prior findings: {collected}. Focus on cross-phase coherence: naming, duplicated utilities, architectural drift. Report findings (critical / important / suggestion)."
```
Then run each effective after:FINAL_REVIEW hook — resolveReviewHooksWithCanary(config, "harness-autopilot", "after:FINAL_REVIEW", { canaryPresent, availableSkills }) (configured skillHooks plus canary's installed deterministic detectors when canary is present; exactly the configured hooks when absent) — over the same cross-phase diff. Run each by kind; a skill hook is dispatched as an extra reviewer:
Resolve craft's advisory domains here too:
resolveReviewHooksWithCraft(config, "harness-autopilot", "after:FINAL_REVIEW", { changedFiles, availableSkills, alreadyRanFor }).
alreadyRanFor is the set of craft domains wired at this phase's after:REVIEW **when the
changed-file set is unchanged** — craft resolves once per phase per diff, and the budget is
per-resolution, so omitting it lets the same code be critiqued twice. Domains passed this way are
reported already-run in the denominator, not silently absent. If the cross-phase diff differs
from the REVIEW diff, pass nothing. Craft findings merge into finalReview.findings as
non-blocking advisory output and never set the final-review status to failed.
```
subagent_type: "<hook skill name>"
prompt: "Final cross-phase domain review. Diff: git diff {startingCommit}..HEAD. Session: {sessionSlug}. Context: {hook context}. Report findings (critical / important / suggestion)."
```
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
An unresolvable user-declared hooked skill (a typo, a not-installed declared skill) or an un-spawnable command hook is a FINAL_REVIEW failure, not a skip, and not an overridable finding — record it in .harness/failures.md, set the final-review status to failed, and hard-halt with "cannot verify" rather than reporting a green final review that silently dropped a configured hook. A harness-default canary detector that is not installed is instead forward-wired: resolveReviewHooksWithCanary already filtered it out, so it is a graceful skip recorded in the denominator, never a FINAL_REVIEW failure. (A command that ran and exited non-zero is a normal blocking finding, not a hard halt.) Hook findings merge into the same finalReview.findings aggregation; report the detector denominator (including skipped-not-installed) so a partial or forward-wired run is never presented as complete.
- No blocking (across baseline + additional reviewers): store in
finalReview.findings, set"passed"→ OUTCOME_EVAL.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
- Blocking: ask "fix / override / stop."
fix: incrementfinalReview.retryCount(max 3). Dispatch harness-task-executor: "Fix these blocking findings: {findings with file, line, title}. Session: {sessionSlug}. Commit each fix atomically." Runharness validate. Re-run FINAL_REVIEW from step 1. If retryCount > 3: stop, record in.harness/failures.md.override: record rationale indecisions[]. Set"overridden"→ OUTCOME_EVAL.stop: save state and exit (resumable).
OUTCOME_EVAL
The blocking post-execution spec-satisfaction gate — the harness's ship gate. It fires ONCE per session, after FINAL_REVIEW and before DONE, judging the WHOLE change against the spec. (It runs at the ship boundary, not per phase: a per-phase judgment would spuriously fail while later phases are still outstanding.) It runs at every rigor level — the gate is not weakened by --fast.
- Set
currentState: "OUTCOME_EVAL". - Gather the evidence (required). Capture the cumulative change as a unified diff:
git diff {startingCommit}..HEAD. Capture the most recent test-runner output retained from VERIFY; if none is retained, re-run the project test command and capture stdout+stderr. Resolve the head sha viagit rev-parse HEAD. - Invoke the gate. Call the
outcome_evalMCP tool:
```json
{
"specPath": "<spec path>",
"diff": "<git diff {startingCommit}..HEAD>",
"testOutput": "<captured test output>",
"commit": "<git rev-parse HEAD>"
}
```
Supplying real diff and testOutput is mandatory — omitting them degrades the verdict to INCONCLUSIVE/advisory, a silent false-negative that defeats the gate. The tool persists the verdict as an execution_outcome node (keyed by commit) and returns verdict, confidence, judgedAgainst, rationale, unmetCriteria, and the TS-derived authority.
- Honor the TS-derived authority — never the LLM.
authorityis computed in TypeScript from(verdict, confidence); read it, never recompute or override it.
authority === "advisory"(allSATISFIED, allINCONCLUSIVE, and everymedium/lowNOT_SATISFIED): record the verdict infinalReviewand proceed → DONE. An advisoryNOT_SATISFIEDis surfaced for human attention but does not halt.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
authority === "blocking"(a high-confidenceNOT_SATISFIED, and ONLY that): HALT before DONE. ReportunmetCriteriaand ask "fix / override / stop."fix: incrementfinalReview.retryCount(max 3). Dispatch harness-task-executor to address the unmet criteria, runharness validate, then re-enter OUTCOME_EVAL. If retryCount > 3: stop, record in.harness/failures.md.override: record the rationale indecisions[]— the audit trail for shipping over a blocking verdict → DONE.stop: save state and exit (resumable).
- Never block on infrastructure noise. A provider failure, a missing/unjudgable spec, or an absent
ANTHROPIC_API_KEYdegrades toINCONCLUSIVE/advisory and proceeds — surface the degradation to the human, but do not halt.
DONE
- Present: total phases, tasks, retries, time,
finalReview.status+ findings count, any overridden findings, and the OUTCOME_EVAL verdict (verdict/confidence/authority, plus any recorded override). - Auto-decision summary (SC11). If
.harness/sessions/<session-slug>/auto-decisions.jsonldoes not exist, print nothing. Otherwise runharness autonomy log --session <session-slug>. If its output contains a line startingNo auto-decisions recorded, print nothing more; otherwise print the output verbatim. If the command fails or is not recognised, printAuto-decision summary unavailable (<reason>); raw log: .harness/sessions/<session-slug>/auto-decisions.jsonland never report zero decisions you did not read.
_Pause point (irreversible): resolve per the Pause Protocol._ <!-- pause: irreversible -->
- Ask "Create a PR? (yes / no)." When creating the PR, include a bare closing line
Closes #<N>where<N>is the issue number from the roadmap row'sExternal-ID. The keyword MUST sit IMMEDIATELY before the ref — no intervening words (Closes #<N>, neverCloses roadmap #<N>), or GitHub will not link/close the issue and roadmap auto-done will skip the row. - Write final handoff to
{sessionDir}/handoff.json. Append learnings to.harness/learnings.md. CallpromoteSessionLearnings(projectPath, sessionSlug). If learnings count > 30, suggestharness learnings prune. - If
docs/roadmap.mdexists: callmanage_roadmap updateto set feature done. Skip if not found. - Write final
writeSessionSummary(). SetcurrentState: "DONE"in autopilot-state.json.
Process
Prompt the human in plain text — every phase-continue and human-decision interaction in this skill is plain text only. Do not elevate to AskUserQuestion: natural headers like "Continue phase" exceed its 12-char cap, rendering the call as ERR.
- INIT — Resolve spec, derive session slug, check for existing state, parse phases.
_Pause point (judgment): resolve per the Pause Protocol._ <!-- pause: judgment -->
- ASSESS — Route by complexity: low/medium auto-plans, high pauses to choose auto-plan (recommended) or interactive planning.
- PLAN → APPROVE — Dispatch harness-planner, check approval signals, auto-approve or pause.
- EXECUTE — Dispatch harness-task-executor with plan path, handle checkpoints and retries (max 3).
- VERIFY — Dispatch harness-verifier, confirm code correctness and wiring. <!-- not-a-pause: the verifier checks correctness, not a human -->
- INTEGRATE — Resolve integration tier, dispatch harness-integration, verify system wiring, knowledge materialization, and documentation per tier.
- REVIEW — Dispatch harness-code-reviewer plus the effective
after:REVIEWhooks (resolveReviewHooksWithCanary: projectskillHooksplus canary's INSTALLED deterministic detectors when canary is present — forward-wired, not-installed ones skip), plus craft's ADVISORY domains (resolveReviewHooksWithCraft: diff-scoped, budget-capped, non-blocking, reported in a denominator), fix blocking findings. - PHASE_COMPLETE — Summarize (including integration report), sync roadmap, loop to ASSESS for next phase or proceed to FINAL_REVIEW.
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
- FINAL_REVIEW → OUTCOME_EVAL → DONE — Cross-phase review, then the blocking spec-satisfaction gate (halt on a high-confidence NOT_SATISFIED), offer PR creation, write final handoff.
Context-Budget Trip Wire
Autopilot keeps context fresh between phases — every state dispatches a distinct cold subagent — but a single long-running turn (one harness-task-executor grinding through a large phase, or a fleet lane building an item end-to-end) can accrue context creep within its own turn and silently degrade into the "dumb zone". A token-anchored, window-keyed trip wire watches that intra-turn budget. Use evaluateContextBudget(usedTokens, window) from @harness-engineering/core as the classifier — it returns ok | warn | trip.
- Two-stage policy.
warn⇒ tell the running agent to converge the current unit of work and flush state to disk (state.json/handoff.json).trip⇒ checkpoint-and-restart: stop the turn and re-dispatch into a cold subagent seeded with the distilled state file (summarized, not raw-truncated — a raw tail loses the middle, per _Lost in the Middle_). This mirrors autopilot's between-phase cold dispatch; the trip is the intra-turn complement. - Window-keyed anchors (absolute resident tokens, not a flat percentage — 40% of 1M ≈ 400K is deep in the dumb zone):
| Window class | Soft-warn (converge + flush) | Hard trip (checkpoint-and-restart) |
| ------------------------------ | ---------------------------- | ---------------------------------- |
| 1m (≥ 900K, [1m] variants) | 250K | 350K |
| 200k (≥ 150K, Sonnet/Opus) | 80K | 100K |
| local (≤ 128K, Qwen / local) | ~30% (round(0.30×win)) | ~37.5% (round(0.375×win)) |
- Measurement rules. Classify on TOTAL RESIDENT tokens = input + output + tool results (tool output — file reads, CI logs, diffs — is the dominant, fastest-growing contributor). Prefer the model's real cumulative usage counter over tokenizer estimation; fall back to a
chars/4estimate only when usage is not surfaced. Utilization percentages are display-only — the trip fires on the absolute token count. - Wiring onto recovery machinery. A
tripmaps onto the existing EXECUTE retry path: write the recovery commit ([autopilot][recovery]prefix) capturing the distilled state, then cold re-dispatch the phase's subagent against that checkpoint rather than pushing the exhausted turn further.
Harness Integration
- State:
{sessionDir}/autopilot-state.json(orchestration) +{sessionDir}/state.json(task-level, written by harness-execution). - Handoff:
{sessionDir}/handoff.json— written by each delegated skill, read by next. Autopilot writes final handoff at DONE. - Checkpoint commits:
commitAtCheckpoint()after passing checkpoints. Recovery commits use[autopilot][recovery]prefix. - Scratchpad: cleared at PHASE_COMPLETE via
clearScratchpad(). Skipped atrigorLevel: "fast".
Gates
- No reimplementing delegated skills. Writing planning/execution/verification/review/integration logic → STOP. Delegate via
subagent_type. <!-- not-a-pause: self-correction against reimplementing skills --> - No executing without plan approval. Every plan passes APPROVE_PLAN. No exceptions.
- No skipping VERIFY, INTEGRATE, REVIEW, or OUTCOME_EVAL. Human can override findings; steps cannot be skipped. INTEGRATE may be skipped only via explicit "skip" choice with decision recorded in
decisions[]. - Ship authority for OUTCOME_EVAL is derived in TypeScript, never read from the LLM. Read
authorityoff the verdict; do not recompute or override it. A high-confidenceNOT_SATISFIED(authority: "blocking") HALTS before DONE — shipping over it requires an explicitoverriderecorded indecisions[]. Every other verdict is advisory. - No infinite retries. EXECUTE budget: 3 attempts. FINAL_REVIEW: 3 cycles. If exhausted, stop and surface.
- No modifying state files manually. If corrupted, start fresh.
Escalation
_Pause point (gate): resolve per the Pause Protocol._ <!-- pause: gate -->
- Spec missing Implementation Order: Cannot identify phases. Ask user to add phase annotations or provide roadmap.
- Delegated skill fails to produce output: Check
{sessionDir}/handoff.json. Report and ask: retry or stop. - User wants to reorder phases mid-run: Update
phases[](mark skipped, adjustcurrentPhase). Do not re-run completed phases. - Context limits approaching: Persist state immediately. "State saved. Re-invoke
/harness:autopilotto continue." - 2 consecutive phase failures: Suggest reviewing spec for systemic issues.
Rationalizations to Reject
| Rationalization | Reality |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| "Low complexity means I can skip APPROVE_PLAN" | Low complexity means auto-approval only when no signals fire. Signals override complexity. |
| "I can inline planning logic instead of dispatching to harness-planner" | Iron Law. Autopilot delegates, never reimplements. No exceptions. |
| "Retry budget exhausted but one more approach might work" | 3-attempt budget prevents compounding failure. Exceeding it without human input is unrecoverable. |
| "Keeping research in conversation is faster than scratchpad" | Scratchpad gated by rigor level. At standard/thorough, >500 words must go to scratchpad. |
| "Plan auto-approved, so I can skip recording the decision" | Every approval—auto or manual—is recorded in decisions[]. That array is the audit trail. |
| "Closes roadmap #123 reads fine, GitHub will figure out the issue" | An intervening word breaks GitHub's closing-keyword parser: closingIssuesReferences stays empty and auto-done leaves the row planned. Use a bare Closes #123. |
Success Criteria
- All phases in the spec are executed in order with plan → execute → verify → integrate → review per phase
- Every plan approval is recorded in
decisions[](auto or manual) - Retry budget (3 attempts) is enforced — exhausted retries surface to user, never silently continue
- FINAL_REVIEW runs on
startingCommit..HEADdiff and catches cross-phase coherence issues - OUTCOME_EVAL runs at the ship boundary on the full
startingCommit..HEADchange; a high-confidenceNOT_SATISFIEDhalts before DONE and its verdict persists as anexecution_outcomenode - State is persisted to
autopilot-state.jsonafter every state transition — re-invocation resumes correctly harness validatepasses after every phase
Examples
Invocation: /harness:autopilot docs/changes/security-scanner/proposal.md
INIT: 3 phases found: Phase 1: Core Scanner (low), Phase 2: Rule Engine (high), Phase 3: CLI Integration (low).
Phase 1 — ASSESS → PLAN: harness-planner dispatched. Returns plan: docs/changes/security-scanner/plans/2026-03-19-core-scanner-plan.md (8 tasks).
Phase 1 — APPROVE_PLAN (auto): All signals false. "Auto-approved Phase 1: Core Scanner | auto | low | no concerns | 8 tasks."
Phase 1 — EXECUTE: harness-task-executor dispatched with plan path + session. 8 tasks complete. 2 checkpoint commits.
Phase 1 — VERIFY: harness-verifier dispatched. Pass. REVIEW: harness-code-reviewer. 0 blocking, 2 notes.
Phase 1 — PHASE_COMPLETE: "Phase 1 complete. Next: Phase 2: Rule Engine (high). Continue? → yes"
Phase 2 — ASSESS: High complexity. "Run /harness:planning interactively, then re-invoke." [User plans interactively. Re-invokes.]
INIT (resume): "Resuming from PLAN, phase 2: Rule Engine. Found plan: docs/changes/security-scanner/plans/2026-03-19-rule-engine-plan.md"
Phase 2 — APPROVE_PLAN (paused): Complexity: high triggered. "Approve? → yes" EXECUTE → VERIFY → REVIEW → PHASE_COMPLETE. 14 tasks, 1 retry.
Phase 3: auto-plans and executes. FINAL_REVIEW: harness-code-reviewer on startingCommit..HEAD. 0 blocking, 1 warning. Passed.
DONE: 3 phases, 30 tasks, 1 retry. "Create PR? → yes" <!-- not-a-pause: worked example output, not a step -->
Retry exhaustion (during any phase):
Task 4 fails → Retry 1/3: obvious fix applied, still fails
→ Retry 2/3: expanded context (related files + learnings), still fails
→ Retry 3/3: full context gather (test output + imports + plan), still fails
Budget exhausted. Recorded in .harness/failures.md.
Fix manually and continue / revise plan / stop?