From beebfe2d8281ee919e96d3b57138f34756949f87 Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 16 Nov 2026 23:55:31 +0100 Subject: [PATCH] feat(routing): skill-runner pins move from fable to opus Fable is the advisor (BDR-150): the client-handover skill-runner children and the model-gate dispatch doctrine pin opus. A pinned child's route answer "fixed at spawn" passes the gate; a repo-wide census refuses any fable pin. --- agents/client-handover-writer.md | 14 +++++++------- lib/model-gate.md | 9 +++++---- lib/tests/effort-routing.test.sh | 6 ++++-- lib/tests/model-routing.test.sh | 14 ++++++++------ skills/client-handover/SKILL.md | 2 +- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/agents/client-handover-writer.md b/agents/client-handover-writer.md index a696067..00e27ec 100644 --- a/agents/client-handover-writer.md +++ b/agents/client-handover-writer.md @@ -267,10 +267,10 @@ the gate. **Model routing (BDR-077):** EVERY `general-purpose` skill-runner dispatch in this pipeline (initial audits, fix-loop re-dispatches, commit-change, -web-validate) carries `model: "fable"` and `effort="high"` — the child hosts gated +web-validate) carries `model: "opus"` and `effort="high"` — the child hosts gated orchestration on the pipeline's behalf; it must never inherit the session model. -For web projects, dispatch in **a single message with two parallel Agent calls** (each with `model: "fable"`, `effort="high"`): +For web projects, dispatch in **a single message with two parallel Agent calls** (each with `model: "opus"`, `effort="high"`): | Audit (web) | Subagent | Prompt template | |---------------|-------------------|-----------------| @@ -429,7 +429,7 @@ for CSO) in the format ### Re-dispatch prompt template (SEO + GEO loop) -Send to `general-purpose` subagent (`model: "fable"`, `effort="high"`): +Send to `general-purpose` subagent (`model: "opus"`, `effort="high"`): > Read `~/.claude/skills/pack-seo/skills/seo/SKILL.md` and re-run it on this project in > **conservative (audit-only) intervention mode**: re-score and leave both @@ -460,7 +460,7 @@ Send to `general-purpose` subagent (`model: "fable"`, `effort="high"`): ### Re-dispatch prompt template (HARDEN loop) -Send to `general-purpose` subagent (`model: "fable"`, `effort="high"`): +Send to `general-purpose` subagent (`model: "opus"`, `effort="high"`): > Read `~/.claude/skills/harden/SKILL.md` and re-run it with `--fix` ONLY > up to the bundle: stop at `READY TO APPLY — awaiting dispatcher @@ -473,7 +473,7 @@ Send to `general-purpose` subagent (`model: "fable"`, `effort="high"`): ### Re-dispatch prompt template (CSO loop — non-web only) -Send to `general-purpose` subagent (`model: "fable"`, `effort="high"`): +Send to `general-purpose` subagent (`model: "opus"`, `effort="high"`): > Read `~/.claude/skills/pack-gstack-dev/skills/cso/SKILL.md` and re-run it in **daily mode**. > Previous score: **``/20** — below threshold. @@ -562,7 +562,7 @@ listed changes by hand before deploy." Continue to STEP 6. If `PENDING_CHANGES` non-empty → invoke /commit-change skill via subagent: -> Dispatch `general-purpose` subagent (`model: "fable"`, `effort="high"`). Prompt: +> Dispatch `general-purpose` subagent (`model: "opus"`, `effort="high"`). Prompt: > > "Read `~/.claude/skills/commit-change/SKILL.md` and execute. All pending > changes were produced by the client-handover ship pipeline during the @@ -682,7 +682,7 @@ Skip if `VALIDATE_SKIPPED=true` or `PROJECT_TYPE != web` (in either case ensure `VALIDATE_SKIPPED=true` is set so the gate logic in STEP 8 treats VALIDATE as not-applicable rather than failed). -Dispatch `general-purpose` subagent (`model: "fable"`, `effort="high"`): +Dispatch `general-purpose` subagent (`model: "opus"`, `effort="high"`): > Read `~/.claude/skills/pack-web-validate/skills/web-validate/SKILL.md` and execute against the > deployed URL: ``. Audit W3C HTML validity (validator.nu), diff --git a/lib/model-gate.md b/lib/model-gate.md index 85a5ab7..d5e2f43 100644 --- a/lib/model-gate.md +++ b/lib/model-gate.md @@ -12,6 +12,7 @@ call. The answer names the id main runs on next. | answer | action | |---|---| | names a fable or opus id | proceed, SILENT | +| says the model is `fixed at spawn` (sub-agent) | proceed, SILENT | | names sonnet, haiku, anything else; "is off"; tool absent | **STOP** | **STOP means**: print exactly `⛔ MODEL GATE — session on . @@ -24,7 +25,7 @@ the turn. No later step runs, no agent is dispatched, nothing is edited. The gate guards the MAIN loop only. Typed agents are routed by their model-router row (`model:` frontmatter = off-state floor). Built-ins (general-purpose / Explore / Plan) carry an explicit `model=` at every call -site: `model: "fable"` when the child reflects/orchestrates for the main -loop (skill-runners), else its tier (opus = dispatched judgment, sonnet = -execution, haiku = mechanical probes). A built-in judgment dispatch also -carries an explicit `effort=` (`lib/effort-shift.md`). +site, its tier: `model: "opus"` = skill-runners (the child reflects or +orchestrates for the main loop) and dispatched judgment, sonnet = execution, +haiku = mechanical probes; never fable (BDR-150, the advisor). A built-in +judgment dispatch also carries an explicit `effort=` (`lib/effort-shift.md`). diff --git a/lib/tests/effort-routing.test.sh b/lib/tests/effort-routing.test.sh index c398842..c2370ea 100755 --- a/lib/tests/effort-routing.test.sh +++ b/lib/tests/effort-routing.test.sh @@ -221,8 +221,10 @@ n_opus="$(grep -c 'model="opus",$' "$R/skills/onboard/SKILL.md")" n_eff="$(grep -c 'effort="xhigh",$' "$R/skills/onboard/SKILL.md")" [ "$n_opus" -ge 7 ] && [ "$n_opus" -eq "$n_eff" ] && ok \ || ko "onboard: $n_opus model=\"opus\" dispatches vs $n_eff effort=\"xhigh\"" -bad="$(grep 'model: "fable"' "$R/agents/client-handover-writer.md" | grep -vc 'effort="high"')" -[ "$bad" -eq 0 ] && ok || ko "client-handover-writer: $bad model: \"fable\" line(s) without effort=\"high\"" +n_opus="$(grep -c 'model: "opus"' "$R/agents/client-handover-writer.md")" +n_eff="$(grep 'model: "opus"' "$R/agents/client-handover-writer.md" | grep -c 'effort="high"')" +[ "$n_opus" -eq 7 ] && [ "$n_opus" -eq "$n_eff" ] && ok \ + || ko "client-handover-writer: $n_opus model: \"opus\" lines vs $n_eff with effort=\"high\" (want 7/7)" for s in ship-feature init-project feat bugfix web-validate seo hotfix geo harden code-clean audit-delta tour onboard; do has "$(skdir "$s")/SKILL.md" 'ROUTING: follow $HOME/.claude/lib/effort-shift.md' done diff --git a/lib/tests/model-routing.test.sh b/lib/tests/model-routing.test.sh index 5aabff4..043c0d4 100755 --- a/lib/tests/model-routing.test.sh +++ b/lib/tests/model-routing.test.sh @@ -85,14 +85,16 @@ lacks "skills/tour/SKILL.md" 'description="tour runner", model=' has "skills/onboard/SKILL.md" 'model="opus"' has "skills/tour/SKILL.md" 'model="opus"' has "lib/challenge-plan.md" 'BDR-076' -# 12) BDR-077 W1 — no-inherit: skill-runner children pinned fable at every -# call site; code-review dispatches carry opus; doctrine in model-gate. -# (fable dispatch alias spike-verified 2026-07-19: resolves -# claude-fable-5, enum-validated, loud failure — never silent fallback) -has "agents/client-handover-writer.md" 'model: "fable"' +# 12) BDR-077 W1 — no-inherit: skill-runner children pinned opus since +# BDR-150 (Fable is the advisor, never a dispatch target); code-review +# dispatches carry opus; doctrine in model-gate. +has "agents/client-handover-writer.md" 'model: "opus"' has "skills/ship-feature/SKILL.md" 'model: "opus"' has "skills/init-project/SKILL.md" 'model: "opus"' -has "lib/model-gate.md" 'model: "fable"' +has "lib/model-gate.md" 'model: "opus"' +has "lib/model-gate.md" 'fixed at spawn' +hits="$(git -C "$R" grep -nE 'model ?[:=] ?"fable"' -- agents skills lib ':!lib/tests')" +[ -z "$hits" ] && ok || ko "fable dispatch pin left: $hits" lacks "lib/model-gate.md" 'model: "sonnet" in the Agent call' # 13) BDR-077 W2 — plugin split: probe (sonnet, facts only) + advisor # reasoner (opus, PROBE REPORT is ground truth, fail-closed); gate diff --git a/skills/client-handover/SKILL.md b/skills/client-handover/SKILL.md index fa4acc3..6aacff9 100644 --- a/skills/client-handover/SKILL.md +++ b/skills/client-handover/SKILL.md @@ -31,7 +31,7 @@ Load and follow strictly: Execute the CLIENT HANDOVER WRITER agent on this project. It runs the audit/fix/gate pipeline INLINE on the big session model (gated above), its -skill-runner children dispatched `model: "fable"`, then delegates the +skill-runner children dispatched `model: "opus"`, then delegates the client deliverable to the two-mode `handover-doc-writer` subagent — synthesize on opus, render (Markdown + branded HTML + PDF) on the sonnet pin (BDR-077).