Skip to content

feat(aif-doctor): /aif-doctor operational-health triage skill (Class C runbook) - #404

Merged
artyhoo merged 3 commits into
stagingfrom
feat/aif-doctor-skill
Jun 3, 2026
Merged

feat(aif-doctor): /aif-doctor operational-health triage skill (Class C runbook)#404
artyhoo merged 3 commits into
stagingfrom
feat/aif-doctor-skill

Conversation

@artyhoo

@artyhoo artyhoo commented Jun 3, 2026

Copy link
Copy Markdown
Owner

What

New Class C skill .claude/skills/aif-doctor/SKILL.md — an operator-side operational-health triage runbook for the local aif-handoff stack. Diagnoses why a task is stuck / runtime is broken / new tasks stay backlog, maps each failure mode to its existing helper or documented fix, and gates every mutation behind operator GO.

Why: the /dispatcher loop works, but the operating environment repeatedly breaks (runtime crash-loop, capacity saturation, flaky proxy) and nothing captured how to triage it — it was re-derived every session.

Scope (3 files + 1 CI-fix)

  • .claude/skills/aif-doctor/SKILL.md — the runbook (Class C, doc-authority header, principle-15 paired-negative, §9 self-reflexive note).
  • docs/meta-factory/prior-art-evaluations.md — SSOT feat(principles): principle 15 — skill paired-negative test (N2 #5, Commit B) #112 (verdict BUILD; runbook built, helpers/endpoints reused).
  • .gitignore!/.claude/skills/aif-doctor/ negation (the aif-* glob targets AIF-installed consumer skills; this is framework-authored like dispatcher/pipeline).
  • .claude/orchestrator-prompts/aif-doctor-skill/done.md — umbrella closure.

BFR (full §3 mechanism)

SSOT consult + DeepWiki ≥3 + WebSearch ≥3 + adversarial counter-prompt → no upstream operator-facing aif health runbook. Reused upstream /health, /agent/status, the stale-watchdog, and bridge-health.sh / verify-bridge.sh / ensure-parallel.ts. Zero new scripts, zero npm deps, zero API-billed calls.

T15 bench — live-verified (the originating session's real symptoms)

Symptom Detector output Classified
Task cf8534d9 crash-loops in planning claude --versionexec format error; native-binary dir empty; coordinator log ClaudeRuntimeAdapterError … --omit=optional; /agent/status heartbeatStale:false (watchdog can't catch it) §3.1
New task stays backlog log "active":3,"limit":3,"msg":"…pipeline at capacity, skipping"; cap unset→default 3 §3.2
npm fetch hangs dual-side curl registry.npmjs.org timeout §3.3

Verify-trace

  • full principle suite green (161 passed) + skill-drift + markdownlint at pre-push
  • own cold-review (1 Opus) → 2 MAJOR + 2 MINOR, all fixed
  • CI iterations: principle 11 F2 verdict normalized to BUILD; §1.7 commit-trailer added; skill-drift broken-ref fixed (de-linked gitignored kickoff.md)
  • merge — orchestrator self-merges per maintainer instruction (no human review this PR)

Anti-scope

Does NOT run the dispatch loop (/dispatcher), plan (/pipeline), add deps, auto-mutate the runtime, or fix the host proxy tunnel (names it, stops). Separate observation: principle 20 test is slow (27s) → flaky under pre-push timeout; pre-existing, unrelated.

§1.7 Forward-check applied

The new skill complies with every active discipline layer, each verified against its source:

  • .claude/rules/build-first-reuse-default.md:3 — BUILD-runbook + REUSE-helpers verdict via full mechanism (SSOT consult + DeepWiki ≥3 + WebSearch ≥3 + adversarial counter-prompt); SSOT row docs/meta-factory/prior-art-evaluations.md:182 (feat(principles): principle 15 — skill paired-negative test (N2 #5, Commit B) #112).
  • .claude/rules/no-paid-llm-in-ci.md:1 — every probe is curl/docker/grep; zero API-billed calls; the one paid path (API transport) is explicitly DEFER-gated.
  • .claude/rules/doc-authority-hierarchy.md:3 — Class C + Authoritative-for/NOT header present (.claude/skills/aif-doctor/SKILL.md:20).
  • .claude/rules/dual-implementation-discipline.md:6@cc-only-rationale marker at .claude/skills/aif-doctor/SKILL.md:18.
  • principle 15 paired-negative (packages/core/principles/15-skill-paired-negative.test.ts:49) — ## Without this skill / ## With this skill present and distinct.

§1.7 Backward-check applied

Complete sweep of artefacts under this skill's scope; nothing superseded:

artyhoo added 3 commits June 4, 2026 00:00
…C runbook)

BUILD a thin $0 runbook over the existing helper layer + upstream read-only
endpoints. Diagnoses aif-handoff env breakage (runtime crash-loop, capacity
saturation, host-proxy block) the dispatch loop runs in — read-only sweep runs
autonomously, every mutation gates behind operator GO (Q2 contract).

- Reuses bridge-health.sh / verify-bridge.sh / ensure-parallel.ts + upstream
  /health + /agent/status (zero new scripts, zero npm deps, zero API-billed calls).
- Catalogue = the 3 modes the upstream stale-watchdog cannot see, each with a
  live-verified detector->fix->reversibility (T15 bench, 2026-06-03).
- SSOT #112 landed in this commit; Class C + doc-authority header; principle-15
  paired-negative block.

Prior-art: prior-art-evaluations.md#112 (/aif-doctor — BUILD runbook + REUSE helpers/endpoints; DeepWiki surfaced upstream /health, /agent/status, probeClaudeCli, recoverStaleInProgressTasks stale-watchdog — all reused/referenced; T16 verified watchdog problem-class = slow-stale auto-recovery vs ours = watchdog blind-spots). Companion to #111 /dispatcher.

§1.7: forward+backward self-review at .claude/skills/aif-doctor/SKILL.md:169 (§9). Forward-check: complies with build-first-reuse-default.md:3 (BUILD runbook + REUSE helpers, full DeepWiki+WebSearch mechanism), no-paid-llm-in-ci.md:1 (zero API-billed calls), dual-implementation-discipline.md:6 (@cc-only-rationale marker), doc-authority-hierarchy.md:3 (Class C header), principle 15 (paired-negative). Backward-check: dispatcher SKILL.md:24 NOT-authoritative-for verified (names planning/pipeline/orchestrator only) — complementary, not superseded; bridge-health.sh reused unedited.
…en-ref on clean checkout

The kickoff lives under .claude/orchestrator-prompts/* (gitignored; only done.md
is tracked), so the markdown link resolved locally but 404'd in CI's clean
checkout → principle 14 skill-drift FAIL. Demote to a plain code-span mention.
@artyhoo
artyhoo merged commit 35b2de8 into staging Jun 3, 2026
27 of 28 checks passed
@artyhoo
artyhoo deleted the feat/aif-doctor-skill branch June 3, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant