[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77K01PCQKFBF7EH2T3KVFFE":3,"skill-same:01M77K01PCQKFBF7EH2T3KVFFE":96},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":39,"install":40,"resources":53},"01M77K01PCQKFBF7EH2T3KVFFE","conductor",null,"Shared autonomous orchestration contract for self-continuation, legitimate halts, parallel phase dispatch, and durable-state resumption. Use when running \u002Fsw-deliver, \u002Fsw-ship, \u002Fsw-doc, \u002Fsw-debug, or \u002Fsw-feedback orchestrators. Does not re-author loop logic inline.","grdavies\u002Fshipwright","grdavies","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2638082?v=4","01M77JZCZJTWB8WBWX4NNW8MNP","Ross Davies","01M77JZD0S2Q4JZEM0310T9A73",2,"MIT","https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: conductor\ndescription: Shared autonomous orchestration contract for self-continuation, legitimate halts, parallel phase dispatch, and durable-state resumption. Use when running \u002Fsw-deliver, \u002Fsw-ship, \u002Fsw-doc, \u002Fsw-debug, or \u002Fsw-feedback orchestrators. Does not re-author loop logic inline.\nmetadata:\n  shipwright-capability:\n    version: 1\n    triggers:\n      -\n        type: phase_default\n        selectionFamily: subagent-dispatch\n        command: sw-deliver\n    metadata:\n      skill: conductor\n      selectionFamily: subagent-dispatch\n---\n# Conductor contract\n\nSingle referenced primitive for agent-native orchestration (PRD 009 R1). Orchestrators (`\u002Fsw-deliver` pilot;\n`\u002Fsw-doc`, `\u002Fsw-ship`, `\u002Fsw-debug`, `\u002Fsw-feedback` in follow-on PRDs) **load this skill** and delegate loop\nbehavior here — they do not re-implement state transitions, merge logic, or halt policy in prose (R3).\n\n**Model tier:** inherit — resolve delegated atomics via `python3 scripts\u002Fsw_bootstrap.py resolve-model-tier.py -- --command \u003Cchild-slug>`.\n\n## Mechanical source of truth\n\nEvery state transition, merge-queue operation, gate evaluation, and bookkeeping action runs through the\nexisting `wave_*.py` primitives behind `scripts\u002Fwave.py` — never duplicated in agent instructions:\n\n| Concern | Entrypoint |\n| --- | --- |\n| Plan + waves | `scripts\u002Fwave.py plan`, `scripts\u002Fwave.py schedule` |\n| Plan validation | `scripts\u002Fwave.py plan validate` → `scripts\u002Fwave_plan_validate.py` (two-tier, closed-world) |\n| Durable driver | `scripts\u002Fwave.py deliver-loop`, `scripts\u002Fdoc_loop.py doc-loop` |\n| Run-state R\u002FW | `scripts\u002Fwave.py state …` |\n| Provision \u002F teardown | `scripts\u002Fwave.py orchestrator provision`, `scripts\u002Fwave.py phase provision` |\n| Phase outcomes | `scripts\u002Fwave.py status collect` → `.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002Fstatus.json` |\n| Merge queue | `scripts\u002Fwave.py merge enqueue`, `scripts\u002Fwave.py merge run-next` |\n| Locks \u002F journal | `scripts\u002Fwave.py lock …`, `scripts\u002Fwave.py journal …` |\n| Halt report | `scripts\u002Fwave.py report terminal` |\n| Living-doc reconcile | `scripts\u002Fwave.py living-docs reconcile`, `scripts\u002Fwave.py docs-currency` |\n\nThe conductor **invokes** these commands and interprets their JSON — it does not maintain parallel state.\n\n## Graph execution UX (PRD 269 R17)\n\nWorkflowGraph is the sole production execution runtime after cutover. Operator UX stays on **existing\ncommands only** — never invent `\u002Fsw-graph-*` slash commands or a parallel status surface.\n\n| Need | Existing command | Mechanical delegate |\n| --- | --- | --- |\n| Pre-run plan summary | `\u002Fsw-deliver --explain-plan` | `wave_deliver.py explain-plan` |\n| Live execution progress | `\u002Fsw-status` (`graph-progress`) | `status_integrity.py graph-progress --run-id \u003CrunId>` |\n| Per-node blockers | `\u002Fsw-status` (`explain \u003CnodeId>`) | `status_integrity.py explain \u003CnodeId> --run-id \u003CrunId>` |\n| Planning unit lifecycle | `planning-graph.py status --unit-id \u003Cid>` | Planning graph — **not** execution |\n\nGraph `metadata.runId` maps from the deliver\u002Forchestrator `runId`; receipts and status index under\n`.cursor\u002Fsw-graph-runs\u002F\u003CrunId>\u002F`. The deterministic safety kernel (`kernel-classification.json`) is not\nduplicated — graph scheduling compiles into the same gate envelope as wave\u002Fphase plans. Serial-equivalent\n`resourceLimits.maxConcurrency: 1` and `graphExecution.cache.enabled` are independently tunable (see\n`docs\u002Fguides\u002Fconfiguration.md`). Cutover stages (`dogfood` → `limited-scope` → `full-ownership`) never\ndrop the human merge gate.\n\n## Conductor vs GraphScheduler (PRD 271 R15)\n\nThe orchestrator **conductor** drives wave\u002Fphase **fan-out**, merge queues, and in-turn `deliver-loop` \u002F\n`doc-loop` self-continuation. It is **not** the `GraphScheduler` **owning loop** (`scripts\u002Fgraph\u002Fscheduler.py`).\n\n| Layer | Role | Durable state |\n| --- | --- | --- |\n| Conductor | Parallel phase dispatch, intra-phase execute fan-out, merge queue, legitimate halts | `.cursor\u002Fsw-deliver-runs\u002F`, `.cursor\u002Fsw-deliver-state.*` |\n| `GraphScheduler` | Single owning loop for node admission, pool leases, cancel fencing, cache consult | Receipt journal `.cursor\u002Fsw-graph-runs\u002F\u003CrunId>\u002F`; cache `.cursor\u002Fsw-graph-cache\u002F` |\n\nNode execution delegates through `ExecutionBackend` (`scripts\u002Fgraph\u002Fexecution_backend.py`); the host\nadjudicates terminal envelopes. Operator UX stays on existing `sw-*` commands — **no** `\u002Fsw-graph-*` family.\n\n\n## Durable artifacts (resumption — R4)\n\nA fresh agent with no prior chat context resumes from:\n\n**Precedence:** run-scoped paths under `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002F` are **authoritative** for deliver\nlifecycle state. Legacy slug-scoped paths (`.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002F`) remain the adoption source\nconsumed by R1's identity-checked adoption path — never treat slug-scoped artifacts as overriding a bound\n`runId` namespace. Authoritative layout detail: `core\u002Fsw-reference\u002Flayout.md`.\n\n| Artifact | Path |\n| --- | --- |\n| Run cursor (scoped) | `.cursor\u002Fsw-deliver-state.\u003Cslug>.json` at **repo root** (`nextAction`, `currentWave`, phase statuses) |\n| Plan (legacy slug-scoped) | `.cursor\u002Fsw-deliver-plan.json` |\n| **Run-scoped deliver state** | `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002Fstate.json` |\n| **Run-scoped deliver plan** | `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002Fplan.json` |\n| **Run-scoped deliver events** | `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002Fevents.jsonl` |\n| **Per-phase ship status (run-scoped)** | `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002Fphases\u002F\u003CphaseId>\u002Fstatus.json` |\n| Concurrent-run index | `.cursor\u002Fsw-deliver-runs\u002Findex.json` |\n| Per-phase `\u002Fsw-ship` status (legacy slug-scoped) | `.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002Fstatus.json` |\n| Phase step plan (legacy slug-scoped) | `.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002Fphase-step-plan.json` (executor-owned) |\n| Wave batching plan | `waveBatchingPlan` on `.cursor\u002Fsw-deliver-state.\u003Cslug>.json` (conductor-only) |\n| Two-tier lifecycle | `twoTierLifecycle` on shared run-state |\n| Append-only progress | `.cursor\u002Fsw-deliver-runs\u002Frun.log` |\n\n**Doc-run durable artifacts (PRD 081 R11):** `\u002Fsw-doc` resumes from the doc-loop driver alone — not chat\nhistory.\n\n| Artifact | Path |\n| --- | --- |\n| Doc run cursor | `.cursor\u002Fsw-doc-runs\u002F\u003Crun-id>\u002Fstate.json` |\n| Concurrent doc-run index | `.cursor\u002Fsw-doc-runs\u002Findex.json` |\n| Stage transition receipts | `.cursor\u002Fsw-doc-runs\u002F\u003Crun-id>\u002Freceipts\u002F\u003Cidempotency-key>.json` |\n\n**Per-branch scoped deliver state (PRD 013):** orthogonal feature branches each own\n`sw-deliver-state.\u003Cslug>.json` + `sw-deliver-\u003Cslug>.lock`. The conductor never treats branch B's\nin-flight run as stale identity for branch A. All writes use the repo-root canonical path (R28) — not a\nduplicate under orchestrator worktree `.cursor\u002F`.\n\nResume command (phase-mode):\n\n```text\n\u002Fsw-deliver run \u003Cfrozen-task-list-path>\n# inspect driver cursor (internal mechanical driver):\npython3 scripts\u002Fwave.py deliver-loop --dry-run\n```\n\nUser-facing resume\u002Fhandoff MUST use `\u002Fsw-deliver run …`. The bash `deliver-loop` driver is for\nconductor in-turn mechanical re-invocation only — never surface it as the operator resume command (R29).\n\nNever infer progress from chat history or ephemeral sub-agent logs (R19). Phase outcomes come solely from\n`status.json`.\n\n## Phase status discovery and disambiguation (PRD 059 R5–R6)\n\nPer-phase durable status and gap-check binding use the shared discovery chain\n(`scripts\u002Fphase_status_discovery.py`): **canonical repo root → phase worktree → glob** under\n`.sw-worktrees\u002F*\u002F.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002F`. Gap-check and merge paths share the helper;\nHEAD-stamp disambiguation prefers the current phase head, and **binding halt verdicts win** over stale pass\ncandidates.\n\n## Terminal blocker recovery shape (PRD 059 R14–R15)\n\n`scripts\u002Fwave.py report blockers` maps terminal branch causes to recovery commands without schema changes:\n\n| `cause` | Recovery hint |\n| --- | --- |\n| `terminal-branch-missing` | Recreate\u002Freprovision target branch, then retry `terminal pr prepare` |\n| `terminal-branch-unresolvable` | Retry when host reachable; verify host auth\u002Ftoken via `scripts\u002Fhost.py` |\n\n## Two-tier plan lifecycle (PRD 022)\n\nWave + phase plan validation, lifecycle states, reject fallbacks, and `orchestration.planPolicy` pilot wiring: [references\u002Ftwo-tier-plan-lifecycle.md](references\u002Ftwo-tier-plan-lifecycle.md).\n## Default autonomy (R13)\n\nWith default configuration (`deliver.autonomy.mode: autonomous`, `phaseAckCadence: 0`, `doc.afterTasks` not\nblocking deliver), a frozen task list runs end-to-end to the **terminal-PR human gate** with zero\n\"continue deliver\" style re-prompts. See **In-turn self-continuation loop** below (R6\u002FR7).\n\n## In-turn self-continuation loop (R2, R6, R7)\n\nThe conductor never ends its turn while `nextAction` is runnable and no legitimate halt applies.\n\n### Driver ↔ agent handshake (deliver + doc-loop)\n\nBoth `\u002Fsw-deliver` and `\u002Fsw-doc` share the same conductor interpretation — only the driver entrypoint\ndiffers.\n\n| Orchestrator | Driver entry | Resume |\n| --- | --- | --- |\n| `\u002Fsw-deliver` | `python3 scripts\u002Fwave.py deliver-loop` | `\u002Fsw-deliver run \u003Cfrozen-task-list>` |\n| `\u002Fsw-doc` | `python3 scripts\u002Fdoc_loop.py \u003Crepo> doc-loop --run-id \u003Cid>` | Re-invoke `doc-loop` with the same run id |\n\n**Deliver loop:**\n\n1. Invoke `python3 scripts\u002Fwave.py deliver-loop` (or `--dry-run` to inspect only).\n2. Parse JSON:\n   - **`awaitAgent: false`** — driver advanced mechanically; immediately re-invoke `deliver-loop` (same turn).\n   - **`awaitAgent: true`** — perform the agent step for `next.action` (see table), then re-invoke\n     `deliver-loop` without asking the user to continue.\n   - **`verdict: continue`** with `cause: conductor:drain-step-budget-exceeded` — mechanical drain step\n     budget exhausted while the next action is still mechanical; **re-invoke `deliver-loop` in the same\n     turn** — this is not a legitimate halt and must not surface as an operator interruption (R22).\n3. Repeat until `terminal: true`, `halt: true`, or a legitimate halt in **Legitimate-halt set**.\n\n**Doc-loop handshake (PRD 081 R11):** same response vocabulary — `awaitAgent`, `awaitHuman`, `halt`,\n`terminal`, and mechanical step budgets. On doc-loop step-budget exhaustion while the next stage is still\nmechanical, re-invoke `doc-loop` in the same turn rather than ending the turn or emitting a blocker report.\n\n| `next.action` | Agent work (then re-invoke `deliver-loop`) |\n| --- | --- |\n| `dispatch-batch` | Spawn **N background** `Task` sub-agents (`run_in_background: true`) — one per `phases[]` entry in the batch; each runs provision (if needed) + full `\u002Fsw-ship --phase-mode` in its phase worktree |\n| `dispatch-ship` | Full `\u002Fsw-ship --phase-mode` **inline** in the phase worktree (`SW_PHASE_MODE=1`, `SW_PHASE_SLUG`, `SW_RUN_DIR`); **never** `run_in_background: true` |\n\n### Ship-loop driver (PRD 065)\n\n`dispatch-ship` runs `ship_loop.py drive` mechanically until `awaitAgent`; drivers never spawn Tasks — conductor\nperforms agent steps inline, then re-invokes `deliver-loop`. `dispatch-batch` is the sole Task spawn (one\nphase-scoped inline executor per worktree). Details: `core\u002Fskills\u002Fdeliver\u002FSKILL.md` § Ship-loop integration.\n\n### Inline dispatch lease (PRD 063 R7–R9)\n\n- **`dispatch-ship`** acquires a durable per-phase ship lease (`python3 scripts\u002Fwave.py ship-lease acquire`) before\n  stamping `inlineDispatchedAt`. A second `dispatch-ship` while the lease is live returns `await-in-flight` —\n  never spawn a duplicate inline Task.\n- **`dispatch-batch`** is the **only** conductor action that may use `run_in_background: true` on `Task` spawns.\n- `python3 scripts\u002Fdispatch-check.py --dispatch-action dispatch-ship --run-in-background` fails closed unless an\n  audited `--override` is recorded.\n- Stale lease reclaim (`wave_lock.py`) runs only when heartbeat is stale **and** the phase has no consumable\n  terminal `status.json`; crash-after-acquire without spawn is reclaimable; a live inline Task keeps the lease.\n- Release the lease on `collect-status` after terminal phase outcomes are collected.\n| `remediate` | `\u002Fsw-stabilize` (or scoped fix) for the blocked phase within remediation budget |\n| `retrospective` | `\u002Fsw-retrospective --pre-merge` on the orchestrator worktree after all phases merge (R9; single-sourced chain) |\n| `terminal-ship` | After `retrospective` when pre-merge done: terminal PR prepare\u002Fgate, CI watch + `\u002Fsw-ready`; may arm self-wake (below) |\n\nA phase-mode P1 auto-apply refusal remains blocked until repaired-source evidence passes native gates.\nExplicit human approval for that finding\u002Fscope permits a substantive scoped repair under\n`commands\u002Fsw-ship.md` → **Authorized repair after a local-review halt**. It does not permit automatic\nsuggested-patch application, severity downgrading, counter reset, runtime extension, or merge-gate bypass.\n\n**Terminal autonomy (PRD 013 A1):** when `deliver.terminal.autonomy: auto`, the conductor runs\n`terminal retro run` then `terminal ship run` hands-off (bounded gate watch + `\u002Fsw-stabilize` via\n`deliver.remediation.maxAttempts`). Merge to `main` stays human-gated. Optional `cleanup.autonomy: auto`\napplies safe post-merge cleanup when deterministic.\n\n**Orchestrator worktree:** run `deliver-loop` from `.sw-worktrees\u002F\u003Cslug>-orchestrator` (mandatory\norchestrator provisioning — repo root is not an alternate conductor-loop cwd). Repo-root `.cursor\u002F`\nupdates during deliver are expected conductor runtime, not feature implementation; tracked\n`defaultBaseBranch` must not accumulate implementation commits during a run. See `.shipwright\u002Flayout.md`\n**Operator worktree contract**. Never hand off with \"run deliver-loop next\" as the only instruction —\nrun it in-turn.\n\n### Progress rule (R7)\n\nDo not stop after a single mechanical step or one phase ship if `verdict` is still `running` and\n`nextAction` is not a legitimate halt. The only acceptable turn endings are legitimate halts or terminal\ncompletion.\n\n### No status-pause (R14)\n\nWhile `verdict: running`, never end the turn with user-visible prose that combines a status update with a\nscope-confirmation or resume prompt. Remediation context belongs in `run.log` \u002F consolidated halt reports.\n\n### Post-remediation complete (R15)\n\nA phase whose final `status.json` is `merge-ready-green` is complete regardless of remediation path. While\na phase is `in-flight` with remediation budget remaining, do not scope-pause.\n\n### Silent dispatch window (R16)\n\nAfter `dispatch-ship` or `dispatch-batch`, emit no user-visible text until every dispatched phase has\nterminal `status.json`. Poll per **Parallel-wave completion wait** when `awaitInFlight: true`.\n\n### Terminal transition (R14\u002FR16 at terminal boundary)\n\nThe `retrospective` and `terminal-ship` driver actions are **awaitAgent-non-optional**: while\n`verdict: running`, the conductor performs each terminal step and re-invokes `deliver-loop` in the\n**same turn** — never end the turn between them.\n\nAt this boundary the **no-status-pause** prohibition (R14) applies with full force: do not emit a\nwave-complete status update combined with a scope-confirmation or resume prompt. Terminal remediation\ncontext belongs in `run.log` \u002F consolidated halt reports only.\n\n### Driver-detected halts only (R28)\n\nSubjective ambiguity is not an inline halt. Only driver-detected conditions qualify; other uncertainty\nroutes through `report blockers` with a `cause`.\n\n## Execute tier fan-out (PRD 053)\n\nPhase executor (not conductor) owns execute-tier lifecycle:\n\n| Step | Owner | Primitive |\n| --- | --- | --- |\n| Execute plan validate | Phase executor | `wave.py plan validate --tier execute` |\n| Per-ref Task dispatch | Phase executor | `intra_phase_dispatch.py` with `conductorMode: execute_fan_out` |\n| Sub-branch integrate | Phase executor | `wave.py execute integrate` → `execute_integrate.py` |\n| Frozen synthetic receipt capture | Phase executor | After integration, `wave_state.py ROOT ledger record --task REF --phase SLUG --done true --execute-run-dir RUN_DIR` |\n| Terminal gate | Phase executor | `execute_ship.py gate-check` before `sw-verify` |\n\nCapture synthetic completion after each successful integration (including retries), before phase run-directory teardown. This validates the latest native plan\u002Fjournal pair and preserves it in the durable ledger; a generic done record alone is insufficient for frozen refs absent from the task body. See `docs\u002Fguides\u002Fruntime-expansion-currency.md` for retained-receipt recovery.\n\nConductor merge queue (`wave_merge.py`) handles phase→target only. Execute integrate is **never** enqueued\non the conductor merge queue. Background-phase nested Task carve-out: see\n`rules\u002Fsw-dispatch-background-phase.mdc` execute partition.\n\n## Conductor loop hard-stop (R38)\n\nRegister bounds in `rules\u002Fsw-subagent-dispatch.mdc` hard-stops table.\n\n| Bound | Source | On trip |\n| --- | --- | --- |\n| Max driver invocations per turn | `deliver.autonomy.maxIterations` (default **500**) | Consolidated halt; resume via `deliver-loop` |\n| No-progress circuit breaker | **3** consecutive invocations with identical `nextAction` **and** identical durable-state signature | Consolidated halt (`cause: conductor:no-progress`) |\n\n**State signature** (canonical JSON of): `verdict`, `nextAction`, `currentWave`, sorted phase\n`id→status`, `mergeQueue` length, `mergeJournal` presence. Ignore `driverHeartbeatAt` \u002F `updatedAt`.\n\nOn circuit breaker: `python3 scripts\u002Fwave.py report terminal` (or `report blocker`) — never spin silently.\n\n## Self-wake sentinel (R8, R9)\n\nTerminal-PR CI, phase-mode dispatch-ship CI (`DELIVER_WAKE_${RUN_ID}_${PHASE_SLUG}`), teardown, and external-wait exhaustion: [references\u002Fself-wake-sentinel.md](references\u002Fself-wake-sentinel.md).\n\n## Parallel-wave completion wait (R44)\n\nWhen multiple phases run concurrently, the conductor waits for **all** wave members to publish terminal\n`status.json` before enqueue\u002Fmerge advancement.\n\n**Contract (pick one per environment; both bounded by `checks.watch.maxWaitMinutes`):**\n\n1. **Poll:** every `checks.watch.pollSeconds`, test\n   `.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002Fstatus.json` for each in-flight phase in the current wave batch.\n2. **Self-wake:** arm `notify_on_output` on a watcher that tails `run.log` or polls status paths; pattern\n   `^DELIVER_PHASE_READY_\u003Crun-id>` emitted when all batch members have terminal status.\n\nWhen every member is `merge-ready-green` or `blocked`, re-invoke `deliver-loop` in-turn — never ask the user\nto \"check if phases finished\".\n\nWhen the driver returns `awaitInFlight: true`, poll status paths per this section before the next\n`deliver-loop` invocation — do not re-dispatch `\u002Fsw-ship` for phases already marked `backgroundDispatchedAt`.\n\n### collect-all-ready (R27)\n\nWhen multiple in-flight phases publish `merge-ready-green` simultaneously, the driver emits\n`collect-all-ready` (mechanical) to enqueue all ready phases in deterministic phase-id order before\n`merge run-next`. The conductor never merges until the driver advances the merge queue.\n\n## Self-wake environment fallback (R46)\n\nWhere the harness cannot auto-resume on `notify_on_output` (cloud\u002Fheadless agents):\n\n1. **Degrade to bounded in-turn poll:** sleep `checks.watch.pollSeconds` between checks, up to\n   `checks.watch.maxWaitMinutes` total wall clock.\n2. After expiry → single consolidated halt (R12) with exact resume command.\n3. Never busy-spin; never yield with only \"waiting for CI\" and no halt boundary.\n\nDetect unavailable self-wake when background shell + `notify_on_output` is not offered by the runtime;\ndefault to poll-then-halt rather than indefinite yield.\n\n## Legitimate-halt set (R10)\n\nHuman-input halt conditions and driver-enforced budget trips: [references\u002Flegitimate-halt-set.md](references\u002Flegitimate-halt-set.md).\n\n## No routine halts (R11)\n\nThe conductor **must not** pause or ask the user to continue for:\n\n- Per-phase `\u002Fsw-ship` dispatch or completion\n- `status collect`, `merge enqueue`, `merge run-next`, wave advancement\n- Release bookkeeping (`bookkeeping record`)\n- Living-doc reconcile (`living-docs reconcile` — INDEX, COMPLETION-LOG, GAP-BACKLOG on feature branch, R47–R51)\n- Mechanical `deliver-loop` steps with `awaitAgent: false`\n- Drain-budget continuation (`verdict: continue`, `cause: conductor:drain-step-budget-exceeded`) and doc-loop\n  step-budget continuation — re-invoke the driver in the same turn (R22)\n\nThese advance in-turn via `deliver-loop` re-invocation. User-facing text like \"continue deliver?\" is\nforbidden when the driver can proceed.\n\n## Consolidated halt report (R12)\n\nEvery legitimate halt emits **one** actionable artifact — never a bare \"continue?\" prompt.\n\n```bash\n# Blocker \u002F mid-run halt (blocked phase, watchdog, budget exhausted):\npython3 scripts\u002Fwave.py report blockers\n# Written to .cursor\u002Fsw-deliver-runs\u002Fblockers.json by deliver-loop halt-blocked\n\n# All phases green — terminal human gate:\npython3 scripts\u002Fwave.py report terminal\n```\n\nEach report includes `resumeCommand` (e.g. `\u002Fsw-deliver run docs\u002Fprds\u002F…\u002Ftasks-….md`),\n`blockers` with `recommendedCommand` (`\u002Fsw-stabilize` when applicable), and `cause`. Surface all three to\nthe user in one message.\n\n## Multi-signal staleness classifier (R32)\n\nClassify background-phase liveness via `scripts\u002Fphase_staleness_lib.py` before watchdog timeout.\nFull contract: [references\u002Fstaleness-classifier.md](references\u002Fstaleness-classifier.md).\n\n## Phase liveness watchdog (R37)\n\nConfig: `deliver.watchdog.phaseTimeoutMinutes` (default **240**).\n\n```bash\npython3 scripts\u002Fwave.py watchdog check          # exit 20 when stale\u002Ftimeout\npython3 scripts\u002Fwave.py state heartbeat         # refresh driverHeartbeatAt during long agent work\n```\n\n`deliver-loop` `compute-next` calls the watchdog internally: an in-flight phase past timeout without\nterminal `status.json` routes to `halt-blocked` (`cause: phase-timeout:\u003Cid>`), marks the phase `blocked`, and\nwrites the consolidated blocker report.\n\nDriver heartbeat staleness (`driver-heartbeat-stale`) uses `SW_DRIVER_STALE_SECONDS` (default 4h) — refresh\nwith `state heartbeat` during long in-turn agent work.\n\n## Parallel wave dispatch protocol (R14–R20)\n\nPlan-time contention, schedule consumption, conductor Task dispatch, intra-phase rules, outcomes\u002Fblast radius, and safety invariants: `references\u002Fparallel-dispatch-protocol.md`.\n\n## Bounded planning full-conductor (PRD 035 R8–R9, R23)\n\nOpt-in `full-conductor` posture with `planning-mutation-budget` halts and **No nested dispatch** constraints; pushes use `scripts\u002Fgit-push.py` only. Detail: [references\u002Fplanning-full-conductor.md](references\u002Fplanning-full-conductor.md).\n\n## Config knobs\n\nRead from `.cursor\u002Fworkflow.config.json`:\n\n| Key | Default | Effect |\n| --- | --- | --- |\n| `deliver.autonomy.mode` | `autonomous` | `supervised` adds acknowledgement halts; `autonomous` uses minimal halt set |\n| `deliver.autonomy.maxRunMinutes` | `1440` | Run-level wall-clock ceiling → clean halt (R42) |\n| `deliver.autonomy.maxIterations` | `500` | Run-level driver-loop iteration ceiling (R42) |\n| `deliver.phaseAckCadence` | `0` | Pause every K phase merges (checkpoint) |\n| `deliver.remediation.maxAttempts` | `2` | Per-phase stabilize budget |\n| `deliver.loop.drainMechanical` | `true` | Drain mechanical steps in-process until agent wait or halt (PRD 062 R7) |\n| `deliver.loop.maxStepsPerInvocation` | `12` | Mechanical drain step budget per `deliver-loop` invocation; exhaustion → `verdict: continue` (R22) |\n| `deliver.targetLock.staleSeconds` | `300` | Target-lock heartbeat staleness window (ship-lease predicate; PRD 081 R19) |\n| `doc.loop.maxStepsPerInvocation` | `8` | Mechanical step budget per `doc-loop` invocation (PRD 081 R11) |\n| `doc.loop.drainMechanical` | `true` | Drain mechanical doc stages in-process until agent\u002Fhuman wait or halt (PRD 081 R11) |\n| `worktree.parallelCeiling` | `4` | Max concurrent phase worktrees |\n\n## Deliver-loop mechanical drain + timing (PRD 062 R7, R9, R19)\n\n`deliver.loop.drainMechanical`, step budgets, stall halts, and `elapsedMs` diagnostics: [references\u002Fdeliver-loop-drain.md](references\u002Fdeliver-loop-drain.md).\n\n## PRD 062 release acceptance metrics (R18)\n\nOperator acceptance checks: `references\u002Frelease-acceptance.md`.\n\n## Orchestrator adoption\n\nDurability and adoption-mode matrix per orchestrator: [references\u002Forchestrator-adoption.md](references\u002Forchestrator-adoption.md).\n\n## PRD 276 decision acknowledgements (driver resilience)\n\n- **D1** — Cluster finalize + orch cwd adopt + exclusive runId lease into one driver-resilience wave\n  (PRD 276) rather than three independent gap fixes; conductor\u002Fdeliver docs reference the unified surface.\n- **D2** — Prefer validated auto-adopt of a recorded orchestrator worktree over message-only halt when\n  skew is recoverable; path-record alone is insufficient — execution-time identity rebind required.\n\nReference this skill from orchestrator commands; do not duplicate loop prose.\n","# Conductor contract\n\nSingle referenced primitive for agent-native orchestration (PRD 009 R1). Orchestrators (`\u002Fsw-deliver` pilot;\n`\u002Fsw-doc`, `\u002Fsw-ship`, `\u002Fsw-debug`, `\u002Fsw-feedback` in follow-on PRDs) **load this skill** and delegate loop\nbehavior here — they do not re-implement state transitions, merge logic, or halt policy in prose (R3).\n\n**Model tier:** inherit — resolve delegated atomics via `python3 scripts\u002Fsw_bootstrap.py resolve-model-tier.py -- --command \u003Cchild-slug>`.\n\n## Mechanical source of truth\n\nEvery state transition, merge-queue operation, gate evaluation, and bookkeeping action runs through the\nexisting `wave_*.py` primitives behind `scripts\u002Fwave.py` — never duplicated in agent instructions:\n\n| Concern | Entrypoint |\n| --- | --- |\n| Plan + waves | `scripts\u002Fwave.py plan`, `scripts\u002Fwave.py schedule` |\n| Plan validation | `scripts\u002Fwave.py plan validate` → `scripts\u002Fwave_plan_validate.py` (two-tier, closed-world) |\n| Durable driver | `scripts\u002Fwave.py deliver-loop`, `scripts\u002Fdoc_loop.py doc-loop` |\n| Run-state R\u002FW | `scripts\u002Fwave.py state …` |\n| Provision \u002F teardown | `scripts\u002Fwave.py orchestrator provision`, `scripts\u002Fwave.py phase provision` |\n| Phase outcomes | `scripts\u002Fwave.py status collect` → `.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002Fstatus.json` |\n| Merge queue | `scripts\u002Fwave.py merge enqueue`, `scripts\u002Fwave.py merge run-next` |\n| Locks \u002F journal | `scripts\u002Fwave.py lock …`, `scripts\u002Fwave.py journal …` |\n| Halt report | `scripts\u002Fwave.py report terminal` |\n| Living-doc reconcile | `scripts\u002Fwave.py living-docs reconcile`, `scripts\u002Fwave.py docs-currency` |\n\nThe conductor **invokes** these commands and interprets their JSON — it does not maintain parallel state.\n\n## Graph execution UX (PRD 269 R17)\n\nWorkflowGraph is the sole production execution runtime after cutover. Operator UX stays on **existing\ncommands only** — never invent `\u002Fsw-graph-*` slash commands or a parallel status surface.\n\n| Need | Existing command | Mechanical delegate |\n| --- | --- | --- |\n| Pre-run plan summary | `\u002Fsw-deliver --explain-plan` | `wave_deliver.py explain-plan` |\n| Live execution progress | `\u002Fsw-status` (`graph-progress`) | `status_integrity.py graph-progress --run-id \u003CrunId>` |\n| Per-node blockers | `\u002Fsw-status` (`explain \u003CnodeId>`) | `status_integrity.py explain \u003CnodeId> --run-id \u003CrunId>` |\n| Planning unit lifecycle | `planning-graph.py status --unit-id \u003Cid>` | Planning graph — **not** execution |\n\nGraph `metadata.runId` maps from the deliver\u002Forchestrator `runId`; receipts and status index under\n`.cursor\u002Fsw-graph-runs\u002F\u003CrunId>\u002F`. The deterministic safety kernel (`kernel-classification.json`) is not\nduplicated — graph scheduling compiles into the same gate envelope as wave\u002Fphase plans. Serial-equivalent\n`resourceLimits.maxConcurrency: 1` and `graphExecution.cache.enabled` are independently tunable (see\n`docs\u002Fguides\u002Fconfiguration.md`). Cutover stages (`dogfood` → `limited-scope` → `full-ownership`) never\ndrop the human merge gate.\n\n## Conductor vs GraphScheduler (PRD 271 R15)\n\nThe orchestrator **conductor** drives wave\u002Fphase **fan-out**, merge queues, and in-turn `deliver-loop` \u002F\n`doc-loop` self-continuation. It is **not** the `GraphScheduler` **owning loop** (`scripts\u002Fgraph\u002Fscheduler.py`).\n\n| Layer | Role | Durable state |\n| --- | --- | --- |\n| Conductor | Parallel phase dispatch, intra-phase execute fan-out, merge queue, legitimate halts | `.cursor\u002Fsw-deliver-runs\u002F`, `.cursor\u002Fsw-deliver-state.*` |\n| `GraphScheduler` | Single owning loop for node admission, pool leases, cancel fencing, cache consult | Receipt journal `.cursor\u002Fsw-graph-runs\u002F\u003CrunId>\u002F`; cache `.cursor\u002Fsw-graph-cache\u002F` |\n\nNode execution delegates through `ExecutionBackend` (`scripts\u002Fgraph\u002Fexecution_backend.py`); the host\nadjudicates terminal envelopes. Operator UX stays on existing `sw-*` commands — **no** `\u002Fsw-graph-*` family.\n\n\n## Durable artifacts (resumption — R4)\n\nA fresh agent with no prior chat context resumes from:\n\n**Precedence:** run-scoped paths under `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002F` are **authoritative** for deliver\nlifecycle state. Legacy slug-scoped paths (`.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002F`) remain the adoption source\nconsumed by R1's identity-checked adoption path — never treat slug-scoped artifacts as overriding a bound\n`runId` namespace. Authoritative layout detail: `core\u002Fsw-reference\u002Flayout.md`.\n\n| Artifact | Path |\n| --- | --- |\n| Run cursor (scoped) | `.cursor\u002Fsw-deliver-state.\u003Cslug>.json` at **repo root** (`nextAction`, `currentWave`, phase statuses) |\n| Plan (legacy slug-scoped) | `.cursor\u002Fsw-deliver-plan.json` |\n| **Run-scoped deliver state** | `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002Fstate.json` |\n| **Run-scoped deliver plan** | `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002Fplan.json` |\n| **Run-scoped deliver events** | `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002Fevents.jsonl` |\n| **Per-phase ship status (run-scoped)** | `.cursor\u002Fsw-deliver-runs\u002F\u003CrunId>\u002Fphases\u002F\u003CphaseId>\u002Fstatus.json` |\n| Concurrent-run index | `.cursor\u002Fsw-deliver-runs\u002Findex.json` |\n| Per-phase `\u002Fsw-ship` status (legacy slug-scoped) | `.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002Fstatus.json` |\n| Phase step plan (legacy slug-scoped) | `.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002Fphase-step-plan.json` (executor-owned) |\n| Wave batching plan | `waveBatchingPlan` on `.cursor\u002Fsw-deliver-state.\u003Cslug>.json` (conductor-only) |\n| Two-tier lifecycle | `twoTierLifecycle` on shared run-state |\n| Append-only progress | `.cursor\u002Fsw-deliver-runs\u002Frun.log` |\n\n**Doc-run durable artifacts (PRD 081 R11):** `\u002Fsw-doc` resumes from the doc-loop driver alone — not chat\nhistory.\n\n| Artifact | Path |\n| --- | --- |\n| Doc run cursor | `.cursor\u002Fsw-doc-runs\u002F\u003Crun-id>\u002Fstate.json` |\n| Concurrent doc-run index | `.cursor\u002Fsw-doc-runs\u002Findex.json` |\n| Stage transition receipts | `.cursor\u002Fsw-doc-runs\u002F\u003Crun-id>\u002Freceipts\u002F\u003Cidempotency-key>.json` |\n\n**Per-branch scoped deliver state (PRD 013):** orthogonal feature branches each own\n`sw-deliver-state.\u003Cslug>.json` + `sw-deliver-\u003Cslug>.lock`. The conductor never treats branch B's\nin-flight run as stale identity for branch A. All writes use the repo-root canonical path (R28) — not a\nduplicate under orchestrator worktree `.cursor\u002F`.\n\nResume command (phase-mode):\n\n```text\n\u002Fsw-deliver run \u003Cfrozen-task-list-path>\n# inspect driver cursor (internal mechanical driver):\npython3 scripts\u002Fwave.py deliver-loop --dry-run\n```\n\nUser-facing resume\u002Fhandoff MUST use `\u002Fsw-deliver run …`. The bash `deliver-loop` driver is for\nconductor in-turn mechanical re-invocation only — never surface it as the operator resume command (R29).\n\nNever infer progress from chat history or ephemeral sub-agent logs (R19). Phase outcomes come solely from\n`status.json`.\n\n## Phase status discovery and disambiguation (PRD 059 R5–R6)\n\nPer-phase durable status and gap-check binding use the shared discovery chain\n(`scripts\u002Fphase_status_discovery.py`): **canonical repo root → phase worktree → glob** under\n`.sw-worktrees\u002F*\u002F.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002F`. Gap-check and merge paths share the helper;\nHEAD-stamp disambiguation prefers the current phase head, and **binding halt verdicts win** over stale pass\ncandidates.\n\n## Terminal blocker recovery shape (PRD 059 R14–R15)\n\n`scripts\u002Fwave.py report blockers` maps terminal branch causes to recovery commands without schema changes:\n\n| `cause` | Recovery hint |\n| --- | --- |\n| `terminal-branch-missing` | Recreate\u002Freprovision target branch, then retry `terminal pr prepare` |\n| `terminal-branch-unresolvable` | Retry when host reachable; verify host auth\u002Ftoken via `scripts\u002Fhost.py` |\n\n## Two-tier plan lifecycle (PRD 022)\n\nWave + phase plan validation, lifecycle states, reject fallbacks, and `orchestration.planPolicy` pilot wiring: [references\u002Ftwo-tier-plan-lifecycle.md](references\u002Ftwo-tier-plan-lifecycle.md).\n## Default autonomy (R13)\n\nWith default configuration (`deliver.autonomy.mode: autonomous`, `phaseAckCadence: 0`, `doc.afterTasks` not\nblocking deliver), a frozen task list runs end-to-end to the **terminal-PR human gate** with zero\n\"continue deliver\" style re-prompts. See **In-turn self-continuation loop** below (R6\u002FR7).\n\n## In-turn self-continuation loop (R2, R6, R7)\n\nThe conductor never ends its turn while `nextAction` is runnable and no legitimate halt applies.\n\n### Driver ↔ agent handshake (deliver + doc-loop)\n\nBoth `\u002Fsw-deliver` and `\u002Fsw-doc` share the same conductor interpretation — only the driver entrypoint\ndiffers.\n\n| Orchestrator | Driver entry | Resume |\n| --- | --- | --- |\n| `\u002Fsw-deliver` | `python3 scripts\u002Fwave.py deliver-loop` | `\u002Fsw-deliver run \u003Cfrozen-task-list>` |\n| `\u002Fsw-doc` | `python3 scripts\u002Fdoc_loop.py \u003Crepo> doc-loop --run-id \u003Cid>` | Re-invoke `doc-loop` with the same run id |\n\n**Deliver loop:**\n\n1. Invoke `python3 scripts\u002Fwave.py deliver-loop` (or `--dry-run` to inspect only).\n2. Parse JSON:\n   - **`awaitAgent: false`** — driver advanced mechanically; immediately re-invoke `deliver-loop` (same turn).\n   - **`awaitAgent: true`** — perform the agent step for `next.action` (see table), then re-invoke\n     `deliver-loop` without asking the user to continue.\n   - **`verdict: continue`** with `cause: conductor:drain-step-budget-exceeded` — mechanical drain step\n     budget exhausted while the next action is still mechanical; **re-invoke `deliver-loop` in the same\n     turn** — this is not a legitimate halt and must not surface as an operator interruption (R22).\n3. Repeat until `terminal: true`, `halt: true`, or a legitimate halt in **Legitimate-halt set**.\n\n**Doc-loop handshake (PRD 081 R11):** same response vocabulary — `awaitAgent`, `awaitHuman`, `halt`,\n`terminal`, and mechanical step budgets. On doc-loop step-budget exhaustion while the next stage is still\nmechanical, re-invoke `doc-loop` in the same turn rather than ending the turn or emitting a blocker report.\n\n| `next.action` | Agent work (then re-invoke `deliver-loop`) |\n| --- | --- |\n| `dispatch-batch` | Spawn **N background** `Task` sub-agents (`run_in_background: true`) — one per `phases[]` entry in the batch; each runs provision (if needed) + full `\u002Fsw-ship --phase-mode` in its phase worktree |\n| `dispatch-ship` | Full `\u002Fsw-ship --phase-mode` **inline** in the phase worktree (`SW_PHASE_MODE=1`, `SW_PHASE_SLUG`, `SW_RUN_DIR`); **never** `run_in_background: true` |\n\n### Ship-loop driver (PRD 065)\n\n`dispatch-ship` runs `ship_loop.py drive` mechanically until `awaitAgent`; drivers never spawn Tasks — conductor\nperforms agent steps inline, then re-invokes `deliver-loop`. `dispatch-batch` is the sole Task spawn (one\nphase-scoped inline executor per worktree). Details: `core\u002Fskills\u002Fdeliver\u002FSKILL.md` § Ship-loop integration.\n\n### Inline dispatch lease (PRD 063 R7–R9)\n\n- **`dispatch-ship`** acquires a durable per-phase ship lease (`python3 scripts\u002Fwave.py ship-lease acquire`) before\n  stamping `inlineDispatchedAt`. A second `dispatch-ship` while the lease is live returns `await-in-flight` —\n  never spawn a duplicate inline Task.\n- **`dispatch-batch`** is the **only** conductor action that may use `run_in_background: true` on `Task` spawns.\n- `python3 scripts\u002Fdispatch-check.py --dispatch-action dispatch-ship --run-in-background` fails closed unless an\n  audited `--override` is recorded.\n- Stale lease reclaim (`wave_lock.py`) runs only when heartbeat is stale **and** the phase has no consumable\n  terminal `status.json`; crash-after-acquire without spawn is reclaimable; a live inline Task keeps the lease.\n- Release the lease on `collect-status` after terminal phase outcomes are collected.\n| `remediate` | `\u002Fsw-stabilize` (or scoped fix) for the blocked phase within remediation budget |\n| `retrospective` | `\u002Fsw-retrospective --pre-merge` on the orchestrator worktree after all phases merge (R9; single-sourced chain) |\n| `terminal-ship` | After `retrospective` when pre-merge done: terminal PR prepare\u002Fgate, CI watch + `\u002Fsw-ready`; may arm self-wake (below) |\n\nA phase-mode P1 auto-apply refusal remains blocked until repaired-source evidence passes native gates.\nExplicit human approval for that finding\u002Fscope permits a substantive scoped repair under\n`commands\u002Fsw-ship.md` → **Authorized repair after a local-review halt**. It does not permit automatic\nsuggested-patch application, severity downgrading, counter reset, runtime extension, or merge-gate bypass.\n\n**Terminal autonomy (PRD 013 A1):** when `deliver.terminal.autonomy: auto`, the conductor runs\n`terminal retro run` then `terminal ship run` hands-off (bounded gate watch + `\u002Fsw-stabilize` via\n`deliver.remediation.maxAttempts`). Merge to `main` stays human-gated. Optional `cleanup.autonomy: auto`\napplies safe post-merge cleanup when deterministic.\n\n**Orchestrator worktree:** run `deliver-loop` from `.sw-worktrees\u002F\u003Cslug>-orchestrator` (mandatory\norchestrator provisioning — repo root is not an alternate conductor-loop cwd). Repo-root `.cursor\u002F`\nupdates during deliver are expected conductor runtime, not feature implementation; tracked\n`defaultBaseBranch` must not accumulate implementation commits during a run. See `.shipwright\u002Flayout.md`\n**Operator worktree contract**. Never hand off with \"run deliver-loop next\" as the only instruction —\nrun it in-turn.\n\n### Progress rule (R7)\n\nDo not stop after a single mechanical step or one phase ship if `verdict` is still `running` and\n`nextAction` is not a legitimate halt. The only acceptable turn endings are legitimate halts or terminal\ncompletion.\n\n### No status-pause (R14)\n\nWhile `verdict: running`, never end the turn with user-visible prose that combines a status update with a\nscope-confirmation or resume prompt. Remediation context belongs in `run.log` \u002F consolidated halt reports.\n\n### Post-remediation complete (R15)\n\nA phase whose final `status.json` is `merge-ready-green` is complete regardless of remediation path. While\na phase is `in-flight` with remediation budget remaining, do not scope-pause.\n\n### Silent dispatch window (R16)\n\nAfter `dispatch-ship` or `dispatch-batch`, emit no user-visible text until every dispatched phase has\nterminal `status.json`. Poll per **Parallel-wave completion wait** when `awaitInFlight: true`.\n\n### Terminal transition (R14\u002FR16 at terminal boundary)\n\nThe `retrospective` and `terminal-ship` driver actions are **awaitAgent-non-optional**: while\n`verdict: running`, the conductor performs each terminal step and re-invokes `deliver-loop` in the\n**same turn** — never end the turn between them.\n\nAt this boundary the **no-status-pause** prohibition (R14) applies with full force: do not emit a\nwave-complete status update combined with a scope-confirmation or resume prompt. Terminal remediation\ncontext belongs in `run.log` \u002F consolidated halt reports only.\n\n### Driver-detected halts only (R28)\n\nSubjective ambiguity is not an inline halt. Only driver-detected conditions qualify; other uncertainty\nroutes through `report blockers` with a `cause`.\n\n## Execute tier fan-out (PRD 053)\n\nPhase executor (not conductor) owns execute-tier lifecycle:\n\n| Step | Owner | Primitive |\n| --- | --- | --- |\n| Execute plan validate | Phase executor | `wave.py plan validate --tier execute` |\n| Per-ref Task dispatch | Phase executor | `intra_phase_dispatch.py` with `conductorMode: execute_fan_out` |\n| Sub-branch integrate | Phase executor | `wave.py execute integrate` → `execute_integrate.py` |\n| Frozen synthetic receipt capture | Phase executor | After integration, `wave_state.py ROOT ledger record --task REF --phase SLUG --done true --execute-run-dir RUN_DIR` |\n| Terminal gate | Phase executor | `execute_ship.py gate-check` before `sw-verify` |\n\nCapture synthetic completion after each successful integration (including retries), before phase run-directory teardown. This validates the latest native plan\u002Fjournal pair and preserves it in the durable ledger; a generic done record alone is insufficient for frozen refs absent from the task body. See `docs\u002Fguides\u002Fruntime-expansion-currency.md` for retained-receipt recovery.\n\nConductor merge queue (`wave_merge.py`) handles phase→target only. Execute integrate is **never** enqueued\non the conductor merge queue. Background-phase nested Task carve-out: see\n`rules\u002Fsw-dispatch-background-phase.mdc` execute partition.\n\n## Conductor loop hard-stop (R38)\n\nRegister bounds in `rules\u002Fsw-subagent-dispatch.mdc` hard-stops table.\n\n| Bound | Source | On trip |\n| --- | --- | --- |\n| Max driver invocations per turn | `deliver.autonomy.maxIterations` (default **500**) | Consolidated halt; resume via `deliver-loop` |\n| No-progress circuit breaker | **3** consecutive invocations with identical `nextAction` **and** identical durable-state signature | Consolidated halt (`cause: conductor:no-progress`) |\n\n**State signature** (canonical JSON of): `verdict`, `nextAction`, `currentWave`, sorted phase\n`id→status`, `mergeQueue` length, `mergeJournal` presence. Ignore `driverHeartbeatAt` \u002F `updatedAt`.\n\nOn circuit breaker: `python3 scripts\u002Fwave.py report terminal` (or `report blocker`) — never spin silently.\n\n## Self-wake sentinel (R8, R9)\n\nTerminal-PR CI, phase-mode dispatch-ship CI (`DELIVER_WAKE_${RUN_ID}_${PHASE_SLUG}`), teardown, and external-wait exhaustion: [references\u002Fself-wake-sentinel.md](references\u002Fself-wake-sentinel.md).\n\n## Parallel-wave completion wait (R44)\n\nWhen multiple phases run concurrently, the conductor waits for **all** wave members to publish terminal\n`status.json` before enqueue\u002Fmerge advancement.\n\n**Contract (pick one per environment; both bounded by `checks.watch.maxWaitMinutes`):**\n\n1. **Poll:** every `checks.watch.pollSeconds`, test\n   `.cursor\u002Fsw-deliver-runs\u002F\u003Cphase-slug>\u002Fstatus.json` for each in-flight phase in the current wave batch.\n2. **Self-wake:** arm `notify_on_output` on a watcher that tails `run.log` or polls status paths; pattern\n   `^DELIVER_PHASE_READY_\u003Crun-id>` emitted when all batch members have terminal status.\n\nWhen every member is `merge-ready-green` or `blocked`, re-invoke `deliver-loop` in-turn — never ask the user\nto \"check if phases finished\".\n\nWhen the driver returns `awaitInFlight: true`, poll status paths per this section before the next\n`deliver-loop` invocation — do not re-dispatch `\u002Fsw-ship` for phases already marked `backgroundDispatchedAt`.\n\n### collect-all-ready (R27)\n\nWhen multiple in-flight phases publish `merge-ready-green` simultaneously, the driver emits\n`collect-all-ready` (mechanical) to enqueue all ready phases in deterministic phase-id order before\n`merge run-next`. The conductor never merges until the driver advances the merge queue.\n\n## Self-wake environment fallback (R46)\n\nWhere the harness cannot auto-resume on `notify_on_output` (cloud\u002Fheadless agents):\n\n1. **Degrade to bounded in-turn poll:** sleep `checks.watch.pollSeconds` between checks, up to\n   `checks.watch.maxWaitMinutes` total wall clock.\n2. After expiry → single consolidated halt (R12) with exact resume command.\n3. Never busy-spin; never yield with only \"waiting for CI\" and no halt boundary.\n\nDetect unavailable self-wake when background shell + `notify_on_output` is not offered by the runtime;\ndefault to poll-then-halt rather than indefinite yield.\n\n## Legitimate-halt set (R10)\n\nHuman-input halt conditions and driver-enforced budget trips: [references\u002Flegitimate-halt-set.md](references\u002Flegitimate-halt-set.md).\n\n## No routine halts (R11)\n\nThe conductor **must not** pause or ask the user to continue for:\n\n- Per-phase `\u002Fsw-ship` dispatch or completion\n- `status collect`, `merge enqueue`, `merge run-next`, wave advancement\n- Release bookkeeping (`bookkeeping record`)\n- Living-doc reconcile (`living-docs reconcile` — INDEX, COMPLETION-LOG, GAP-BACKLOG on feature branch, R47–R51)\n- Mechanical `deliver-loop` steps with `awaitAgent: false`\n- Drain-budget continuation (`verdict: continue`, `cause: conductor:drain-step-budget-exceeded`) and doc-loop\n  step-budget continuation — re-invoke the driver in the same turn (R22)\n\nThese advance in-turn via `deliver-loop` re-invocation. User-facing text like \"continue deliver?\" is\nforbidden when the driver can proceed.\n\n## Consolidated halt report (R12)\n\nEvery legitimate halt emits **one** actionable artifact — never a bare \"continue?\" prompt.\n\n```bash\n# Blocker \u002F mid-run halt (blocked phase, watchdog, budget exhausted):\npython3 scripts\u002Fwave.py report blockers\n# Written to .cursor\u002Fsw-deliver-runs\u002Fblockers.json by deliver-loop halt-blocked\n\n# All phases green — terminal human gate:\npython3 scripts\u002Fwave.py report terminal\n```\n\nEach report includes `resumeCommand` (e.g. `\u002Fsw-deliver run docs\u002Fprds\u002F…\u002Ftasks-….md`),\n`blockers` with `recommendedCommand` (`\u002Fsw-stabilize` when applicable), and `cause`. Surface all three to\nthe user in one message.\n\n## Multi-signal staleness classifier (R32)\n\nClassify background-phase liveness via `scripts\u002Fphase_staleness_lib.py` before watchdog timeout.\nFull contract: [references\u002Fstaleness-classifier.md](references\u002Fstaleness-classifier.md).\n\n## Phase liveness watchdog (R37)\n\nConfig: `deliver.watchdog.phaseTimeoutMinutes` (default **240**).\n\n```bash\npython3 scripts\u002Fwave.py watchdog check          # exit 20 when stale\u002Ftimeout\npython3 scripts\u002Fwave.py state heartbeat         # refresh driverHeartbeatAt during long agent work\n```\n\n`deliver-loop` `compute-next` calls the watchdog internally: an in-flight phase past timeout without\nterminal `status.json` routes to `halt-blocked` (`cause: phase-timeout:\u003Cid>`), marks the phase `blocked`, and\nwrites the consolidated blocker report.\n\nDriver heartbeat staleness (`driver-heartbeat-stale`) uses `SW_DRIVER_STALE_SECONDS` (default 4h) — refresh\nwith `state heartbeat` during long in-turn agent work.\n\n## Parallel wave dispatch protocol (R14–R20)\n\nPlan-time contention, schedule consumption, conductor Task dispatch, intra-phase rules, outcomes\u002Fblast radius, and safety invariants: `references\u002Fparallel-dispatch-protocol.md`.\n\n## Bounded planning full-conductor (PRD 035 R8–R9, R23)\n\nOpt-in `full-conductor` posture with `planning-mutation-budget` halts and **No nested dispatch** constraints; pushes use `scripts\u002Fgit-push.py` only. Detail: [references\u002Fplanning-full-conductor.md](references\u002Fplanning-full-conductor.md).\n\n## Config knobs\n\nRead from `.cursor\u002Fworkflow.config.json`:\n\n| Key | Default | Effect |\n| --- | --- | --- |\n| `deliver.autonomy.mode` | `autonomous` | `supervised` adds acknowledgement halts; `autonomous` uses minimal halt set |\n| `deliver.autonomy.maxRunMinutes` | `1440` | Run-level wall-clock ceiling → clean halt (R42) |\n| `deliver.autonomy.maxIterations` | `500` | Run-level driver-loop iteration ceiling (R42) |\n| `deliver.phaseAckCadence` | `0` | Pause every K phase merges (checkpoint) |\n| `deliver.remediation.maxAttempts` | `2` | Per-phase stabilize budget |\n| `deliver.loop.drainMechanical` | `true` | Drain mechanical steps in-process until agent wait or halt (PRD 062 R7) |\n| `deliver.loop.maxStepsPerInvocation` | `12` | Mechanical drain step budget per `deliver-loop` invocation; exhaustion → `verdict: continue` (R22) |\n| `deliver.targetLock.staleSeconds` | `300` | Target-lock heartbeat staleness window (ship-lease predicate; PRD 081 R19) |\n| `doc.loop.maxStepsPerInvocation` | `8` | Mechanical step budget per `doc-loop` invocation (PRD 081 R11) |\n| `doc.loop.drainMechanical` | `true` | Drain mechanical doc stages in-process until agent\u002Fhuman wait or halt (PRD 081 R11) |\n| `worktree.parallelCeiling` | `4` | Max concurrent phase worktrees |\n\n## Deliver-loop mechanical drain + timing (PRD 062 R7, R9, R19)\n\n`deliver.loop.drainMechanical`, step budgets, stall halts, and `elapsedMs` diagnostics: [references\u002Fdeliver-loop-drain.md](references\u002Fdeliver-loop-drain.md).\n\n## PRD 062 release acceptance metrics (R18)\n\nOperator acceptance checks: `references\u002Frelease-acceptance.md`.\n\n## Orchestrator adoption\n\nDurability and adoption-mode matrix per orchestrator: [references\u002Forchestrator-adoption.md](references\u002Forchestrator-adoption.md).\n\n## PRD 276 decision acknowledgements (driver resilience)\n\n- **D1** — Cluster finalize + orch cwd adopt + exclusive runId lease into one driver-resilience wave\n  (PRD 276) rather than three independent gap fixes; conductor\u002Fdeliver docs reference the unified surface.\n- **D2** — Prefer validated auto-adopt of a recorded orchestrator worktree over message-only halt when\n  skew is recoverable; path-record alone is insufficient — execution-time identity rebind required.\n\nReference this skill from orchestrator commands; do not duplicate loop prose.\n",{"name":5,"metadata":24,"description":7},{"shipwright-capability":25},{"version":26,"metadata":27,"triggers":29},1,{"skill":5,"selectionFamily":28},"subagent-dispatch",[30],{"type":31,"command":32,"selectionFamily":28},"phase_default","sw-deliver","main","2633b37cdc50086084cc9c0ce6c994871d3e7aad","core\u002Fskills\u002Fconductor",0,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright","https:\u002F\u002Fgithub.com\u002Fgrdavies","2026-11-03 23:44:15",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add grdavies\u002Fshipwright --skill conductor",{"tool":46,"command":47},"bunx","bunx skills add grdavies\u002Fshipwright --skill conductor",{"tool":49,"command":50},"pnpm","pnpm dlx skills add grdavies\u002Fshipwright --skill conductor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002FSKILL.md",true,[54,60,64,68,72,76,80,84,88,92],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fcloseout-self-wake.md","REFERENCE","参考文档",1454,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Fcloseout-self-wake.md",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fdeliver-loop-drain.md",1272,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Fdeliver-loop-drain.md",{"path":65,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Flegitimate-halt-set.md",1787,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Flegitimate-halt-set.md",{"path":69,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Forchestrator-adoption.md",1084,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Forchestrator-adoption.md",{"path":73,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fparallel-dispatch-protocol.md",3889,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Fparallel-dispatch-protocol.md",{"path":77,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fplanning-full-conductor.md",1985,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Fplanning-full-conductor.md",{"path":81,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Frelease-acceptance.md",1014,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Frelease-acceptance.md",{"path":85,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fself-wake-sentinel.md",1713,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Fself-wake-sentinel.md",{"path":89,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fstaleness-classifier.md",1371,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Fstaleness-classifier.md",{"path":93,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Ftwo-tier-plan-lifecycle.md",2006,"https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fconductor\u002Freferences\u002Ftwo-tier-plan-lifecycle.md",[97,104,111,118,124,131],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M77K4Z004VAMY705XQKJAH4Y","wrong-name","Missing use when phrase and wrong directory name for critical lint failure.","https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fscripts\u002Ftest\u002Ffixtures\u002Fworkflow-pack-sdk\u002Fnegative\u002Fbad-instruction\u002Fskills\u002Fbad-skill\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M77K4WR3WP22SBT6053PYWAK","demo-skill","Demo workflow pack skill fixture. Use when validating workflow-pack-sdk golden paths in CI.","https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fscripts\u002Ftest\u002Ffixtures\u002Fworkflow-pack-sdk\u002Fgolden\u002Fvalid-pack\u002Fskills\u002Fdemo-skill\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M77K4SV48XDDDQ81PD09G9N6","good-skill","Validates Agent Skills spec conformance for fixture trees. Use when testing skills-spec-guard pass paths across core and dist mirrors. Does not ship production skills.","https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fscripts\u002Ftest\u002Ffixtures\u002Fskills-spec\u002Fpass-valid\u002Fcore\u002Fskills\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":119,"name":99,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M77K4PWVT96VMTMMFE2Y80GJ","Fixture with name\u002Fdir mismatch for guard failure tests. Use when verifying skills-spec-guard rejects invalid identity. Does not ship production skills.","https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fscripts\u002Ftest\u002Ffixtures\u002Fskills-spec\u002Ffail-name-mismatch\u002Fcore\u002Fskills\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":19},"01M77K4KSS5Z0Q0DEAA8PV9316","bad-description","Missing the required when trigger phrase in this fixture skill.","https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fscripts\u002Ftest\u002Ffixtures\u002Fskills-spec\u002Ffail-description-shape\u002Fcore\u002Fskills\u002Fbad-description\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":19},"01M77K4H9HK5FDF84D65228XFA","dropin-demo","https:\u002F\u002Fgithub.com\u002Fgrdavies\u002Fshipwright\u002Fblob\u002Fmain\u002Fscripts\u002Ftest\u002Ffixtures\u002Fcapability-select\u002Fdropin\u002Fcore\u002Fskills\u002Fdropin-demo\u002FSKILL.md",[],[]]