feat(model-router): wave 2-B — orchestrators declare phases, shifters and pins removed, frontmatter = off-state floor

The 15 Skill(effort-*) citers now call mcp__model-router__route per phase
(orchestrate at a dispatch span, reflect/plan for the skill's own level,
apply at the bookkeeping tail, escalate at the verify-secure caps); built-in
judgment dispatches carry an explicit effort= param. lib/effort-shift.md is
the route doctrine, lib/model-gate.md the mod rule (route answer = witness,
/route on as remedy). Deleted: skills/effort-*, lib/effort-pins.txt/.sh,
lib/model-check.sh, their tests, the installers' re-apply blocks. The mod
drops its Skill(effort-*) bridge. The tracked model:/effort: frontmatter
stays as the off-state floor, census-locked equal to the rows
(lib/tests/effort-routing.test.sh rewritten, 140 checks; analyzer → xhigh).

Contract .claude/tasks/contracts/2026-10-10-model-router-w2b-1045.md, plan
r4 § W2-B: GATE 0 MET, verifier ECARTS(7) then CONFORME 10/10, security
PASS, full make test green (design-tool-gate env red only).
This commit is contained in:
bchanot
2026-10-10 11:24:54 +02:00
parent 65dff0e768
commit 1f2d33b7a6
43 changed files with 318 additions and 811 deletions
+6 -6
View File
@@ -26,7 +26,7 @@ allowed-tools:
MODEL GATE (blocking): run `$HOME/.claude/lib/model-gate.md` BEFORE any
step below. Verdict `small` → STOP — print the gate's remedy, end the
turn, dispatch nothing.
EFFORT SHIFTS: follow `$HOME/.claude/lib/effort-shift.md` (BDR-107): medium when a dispatch span starts, own level before challenge synthesis, low at the bookkeeping tail, max at escalation; every shift goes in the same message as the step's first tool call, a lone Skill call is a no-op.
ROUTING: follow $HOME/.claude/lib/effort-shift.md (phases via mcp__model-router__route).
## REQUEST
$ARGUMENTS
@@ -119,14 +119,14 @@ RISK: <low/medium — what could go wrong>
obvious fix.
- If the fix is significant (>10 lines, multiple files,
behavior change): wait for user approval.
On resume: `Skill(effort-high)` first, sent with the next tool call (effort-shift: turn reset).
On resume: `mcp__model-router__route(phase="reflect")` first (route: resumed turn).
- Then run pass B of `$HOME/.claude/lib/contract-interview.md` against the
FIX PLAN: every VISIBLE / PUBLIC NAME / SCOPE choice it settles that the
bug report left open → one batch of questions, before STEP 3b. The trivial
fast-path is not exempt: a 1-line fix with a visible choice still asks.
## STEP 3b — CHALLENGE THE FIX PLAN (before the contract)
`Skill(effort-high)` first (effort-shift: own level before the challenge; send it in the same message as the challenger dispatch).
`mcp__model-router__route(phase="reflect")` first (route: own level before the challenge; send it with the challenger dispatch).
Unless the fix is the trivial 1-2 line case STEP 3 already fast-paths, the
DIAGNOSIS + FIX PLAN is a reflection worth attacking before it hardens into a
contract. Persist it to `.claude/tasks/plans/<date>-<slug>-<HHMM>.md`, then run
@@ -157,10 +157,10 @@ branch it's a no-op (commit in place). Never `finish`.
## STEP 5 — DISPATCH EXECUTOR
Dispatch the executor — sonnet by frontmatter pin, do not override:
Dispatch the executor — sonnet by its row (frontmatter = off-state floor), do not override:
```
Skill(effort-medium) # effort-shift: dispatch span starts; send with the Agent call below in ONE message
mcp__model-router__route(phase="orchestrate") # route: dispatch span starts; send with the Agent call below in ONE message
Agent(subagent_type="bugfixer")
prompt: "CONTRACT: <path from STEP 3.5>
DIAGNOSIS: <ROOT CAUSE + EVIDENCE from STEP 3>
@@ -282,7 +282,7 @@ A bugfix with an understood root cause is almost always worth one entry:
If the bug was trivial and the root cause not transferable → skip with `CAPITALIZE: trivial, skip`.
`Skill(effort-low)` first (effort-shift: bookkeeping tail; send it in the same message as the memory-commit command).
`mcp__model-router__route(phase="apply")` first (route: bookkeeping tail; send it with the memory-commit command).
**Then commit the memory** — follow `$HOME/.claude/lib/capitalize-commit.md`: it
surgically commits what capitalize just wrote (`.claude/memory` + `.claude/tasks`