Fleet Manager
Use this skill when acting as a manager agent for Codewhale fleet runs.
Your job is to classify worker state, choose the narrowest safe typed action,
and leave a ledgered receipt or a safe escalation draft.
Authority Boundary
- Prefer typed fleet surfaces over shell spelunking:
codewhale fleet status,
inspect, logs, artifacts, interrupt, restart, resume, stop
(stop requires --all), and the Runtime API endpoints.
- Do not read
.codewhale/fleet.jsonl, host logs, or remote files directly
unless the typed command or API is missing required evidence.
- Do not send Slack, webhook, PagerDuty, email, or chat messages unless the
user or run config explicitly authorizes sending. Draft the message instead.
- Never include secrets, tokens, webhook URLs, routing keys, full prompts, or
oversized logs in a summary or escalation.
Triage Loop
- Identify the run and worker from the user request, run receipt, or fleet
status output. If no worker is named, start with
codewhale fleet status.
- Inspect the worker with
codewhale fleet inspect <worker-id> or the
matching Runtime API worker endpoint (GET /v1/fleet/workers/{worker_id}).
- Review bounded evidence with
codewhale fleet logs <worker-id> and
codewhale fleet artifacts <worker-id>, or the Runtime API equivalents
(GET /v1/fleet/runs/{run_id}/receipts/{task_id}/evidence and
GET /v1/fleet/runs/{run_id}/events/replay). Summarize artifact refs,
not full payloads.
- Classify the state before acting:
transient failure: transport error, timeout, stale heartbeat, host
unavailable, or retryable provider/network failure.
task failure: worker completed the task but the result is wrong,
missing required artifacts, or reports a domain error.
verifier failure: scorer/verifier failed or disagrees with the worker
result.
needs-human: missing authority, unsafe secret boundary, destructive
action, repeated restart exhaustion, ambiguous product decision, or
conflict between artifacts and verifier.
- Choose one typed action:
- run has orphaned leases after a manager restart:
codewhale fleet resume <run-id> (idempotent reconcile).
- transient and retry budget remains:
codewhale fleet restart <worker-id>.
- transient but unsafe to retry: draft escalation and mark needs-human.
- task failure: preserve artifacts, summarize the failure, and avoid restart
unless the task spec says retrying can produce new evidence.
- verifier failure: inspect scorer inputs and artifacts, then escalate if the
verifier cannot be corrected through a typed action.
- needs-human: do not restart automatically; draft a concise escalation.
- Record the result in the response: classification, action taken or drafted,
evidence commands, artifact refs, and next owner.
Restart vs Escalate
Restart only when all of these are true:
- the failure is likely transient,
- the task is idempotent or the run policy allows retry,
- retry budget remains,
- no secret, permission, or destructive action boundary is involved, and
- the previous attempt produced enough receipt data to explain the restart.
Escalate when any of these are true:
- restart budget is exhausted,
- the worker requests secrets or new authority,
- artifacts indicate data loss, corruption, or destructive side effects,
- the verifier and task result conflict in a way you cannot resolve from typed
evidence,
- the same failure repeats after a restart, or
- a human product or release decision is required.
Safe Escalation Draft
Use this shape for Slack/PagerDuty drafts. Keep logs to three short lines or an
artifact ref.
Codewhale fleet needs attention
Run: <run-id>
Worker: <worker-id>
Task: <task-id or unknown>
Classification: <transient failure | task failure | verifier failure | needs-human>
Reason: <one sentence, no secrets>
Latest typed evidence: codewhale fleet inspect <worker-id>; codewhale fleet artifacts <worker-id>
Safe log excerpt: <3 lines max or "see artifact <ref>">
Requested decision: <restart approval | verifier review | task owner review | permission decision>
Post-Run Receipt
End every Fleet Manager response with a compact receipt:
Fleet receipt
Run: <run-id>
Workers checked: <count/list>
Classification: <state>
Action: <restart/interrupt/stop/resume/escalation draft/no-op>
Ledger expectation: <typed action should be recorded | draft only, no send>
Artifacts reviewed: <refs>
Follow-up owner: <manager | task owner | human>
1---2name: fleet-manager-23description: Use when managing, triaging, restarting, escalating, or summarizing Codewhale fleet runs and workers.4---56# Fleet Manager78Use this skill when acting as a manager agent for Codewhale fleet runs.9Your job is to classify worker state, choose the narrowest safe typed action,10and leave a ledgered receipt or a safe escalation draft.1112## Authority Boundary1314- Prefer typed fleet surfaces over shell spelunking: `codewhale fleet status`,15 `inspect`, `logs`, `artifacts`, `interrupt`, `restart`, `resume`, `stop`16 (stop requires `--all`), and the Runtime API endpoints.17- Do not read `.codewhale/fleet.jsonl`, host logs, or remote files directly18 unless the typed command or API is missing required evidence.19- Do not send Slack, webhook, PagerDuty, email, or chat messages unless the20 user or run config explicitly authorizes sending. Draft the message instead.21- Never include secrets, tokens, webhook URLs, routing keys, full prompts, or22 oversized logs in a summary or escalation.2324## Triage Loop25261. Identify the run and worker from the user request, run receipt, or fleet27 status output. If no worker is named, start with `codewhale fleet status`.282. Inspect the worker with `codewhale fleet inspect <worker-id>` or the29 matching Runtime API worker endpoint (`GET /v1/fleet/workers/{worker_id}`).303. Review bounded evidence with `codewhale fleet logs <worker-id>` and31 `codewhale fleet artifacts <worker-id>`, or the Runtime API equivalents32 (`GET /v1/fleet/runs/{run_id}/receipts/{task_id}/evidence` and33 `GET /v1/fleet/runs/{run_id}/events/replay`). Summarize artifact refs,34 not full payloads.354. Classify the state before acting:36 - `transient failure`: transport error, timeout, stale heartbeat, host37 unavailable, or retryable provider/network failure.38 - `task failure`: worker completed the task but the result is wrong,39 missing required artifacts, or reports a domain error.40 - `verifier failure`: scorer/verifier failed or disagrees with the worker41 result.42 - `needs-human`: missing authority, unsafe secret boundary, destructive43 action, repeated restart exhaustion, ambiguous product decision, or44 conflict between artifacts and verifier.455. Choose one typed action:46 - run has orphaned leases after a manager restart:47 `codewhale fleet resume <run-id>` (idempotent reconcile).48 - transient and retry budget remains: `codewhale fleet restart <worker-id>`.49 - transient but unsafe to retry: draft escalation and mark needs-human.50 - task failure: preserve artifacts, summarize the failure, and avoid restart51 unless the task spec says retrying can produce new evidence.52 - verifier failure: inspect scorer inputs and artifacts, then escalate if the53 verifier cannot be corrected through a typed action.54 - needs-human: do not restart automatically; draft a concise escalation.556. Record the result in the response: classification, action taken or drafted,56 evidence commands, artifact refs, and next owner.5758## Restart vs Escalate5960Restart only when all of these are true:6162- the failure is likely transient,63- the task is idempotent or the run policy allows retry,64- retry budget remains,65- no secret, permission, or destructive action boundary is involved, and66- the previous attempt produced enough receipt data to explain the restart.6768Escalate when any of these are true:6970- restart budget is exhausted,71- the worker requests secrets or new authority,72- artifacts indicate data loss, corruption, or destructive side effects,73- the verifier and task result conflict in a way you cannot resolve from typed74 evidence,75- the same failure repeats after a restart, or76- a human product or release decision is required.7778## Safe Escalation Draft7980Use this shape for Slack/PagerDuty drafts. Keep logs to three short lines or an81artifact ref.8283```text84Codewhale fleet needs attention85Run: <run-id>86Worker: <worker-id>87Task: <task-id or unknown>88Classification: <transient failure | task failure | verifier failure | needs-human>89Reason: <one sentence, no secrets>90Latest typed evidence: codewhale fleet inspect <worker-id>; codewhale fleet artifacts <worker-id>91Safe log excerpt: <3 lines max or "see artifact <ref>">92Requested decision: <restart approval | verifier review | task owner review | permission decision>93```9495## Post-Run Receipt9697End every Fleet Manager response with a compact receipt:9899```text100Fleet receipt101Run: <run-id>102Workers checked: <count/list>103Classification: <state>104Action: <restart/interrupt/stop/resume/escalation draft/no-op>105Ledger expectation: <typed action should be recorded | draft only, no send>106Artifacts reviewed: <refs>107Follow-up owner: <manager | task owner | human>108```