forked from bchanot/claude
Merge feature/routing-audit-phase into develop
# Conflicts: # .claude/memory/journal.md # .claude/memory/learnings.md # .claude/tasks/TODO.md
This commit is contained in:
commit
b961ce6b98
18 files changed
+259
-39
No files matched your search
@@ -633,3 +633,4 @@ rules:
|
||||
## 2026-10-21
|
||||
- /prune-memory: learnings.md index backfilled LRN-191..218 (28 rows), c7ebc3d on chore/prune-learnings-index. Index 221 rows = 221 entries.
|
||||
- /bugfix guardrails residuals (bugfix/guardrails-residuals): plan r3 after 2 challenge rounds (4 BLOCKERs r1: WARN severity, budget must raise, three-way SKIPPED, vacuous timing; r2: `str(URLError)` wrap), contract 22 oracles, 3 part executors, GATE 0/1/2 green, 5a98c2c + 633faa2 (checks.md IN() wording caught by doc-syncer, not the gates). BLK-033, LRN-222/223. Two LOW parked. Both branches await merge signal. Next: /feat routing policy (BLK-032).
|
||||
- /feat routing policy A (feature/routing-audit-phase, BLK-032): `audit` phase (best/xhigh) for verifier + security-auditor, opus frontmatter = outage floor (LRN-224), census tier_floor, citers. 2 challenge rounds (r1 2 BLOCKERs: dead-Fable floor, test fixture), GATE 0 15/15, verifier CONFORME, auditor PASS. d3635b6 dialog writes + session model opus, a7d747c, dae142b docs. Feat B next: ceiling rule, BDR, README doctrine.
|
||||
@@ -243,6 +243,7 @@ rules:
|
||||
| LRN-221 | 2026-10-19 | Floor-guard suppressions: remove, never waive; contract CHECK asserts intent (symbol/behaviour), not one code spelling | suppressions, writing CHECK: lines |
|
||||
| LRN-222 | 2026-10-21 | Map an error to a verdict on a typed exception or carried constant, never on `str(err)`: URLError wraps its reason | probe/fetch error mapping, any err→verdict code |
|
||||
| LRN-223 | 2026-10-21 | Regex timing lock is vacuous when the input matches early: feed a non-matching worst-path input, assert `is None`, keep ≥ 2x margin under the lock | every bounded regex test |
|
||||
| LRN-224 | 2026-10-21 | Best-tier agent row floors on tier 2nd alias: inTier writes head-or-above only, fable frontmatter = no fallback in credit outage | pinning agents on best tier, census floors |
|
||||
|
||||
---
|
||||
|
||||
@@ -1866,3 +1867,7 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s
|
||||
## LRN-223 — Regex timing lock is vacuous when the input matches early: non-matching worst-path input, assert `is None`, ≥ 2x margin
|
||||
- **Context**: plan r1 timing cases (LRN-219 lock, 1.0 s / 80 KB) fed inputs the bounded regex matched at the start, so they ran fast by construction and proved nothing (challenger BLOCKER, robustness lens). r3: inputs built to force the longest non-matching scan, cases assert `is None` and the elapsed time; SHELL_DB case at 0.65 s was too close to the lock → 1800 units (~29 KB) for margin.
|
||||
- **Apply**: one timing case per bounded regex, input that does NOT match and exercises the widest quantifier; assert the non-match too, else a regex that matches everything passes the lock; keep elapsed ≤ half the lock. Links [[LRN-219]], [[BLK-033]].
|
||||
|
||||
## LRN-224 — Best-tier agent row floors on tier's 2nd alias: inTier writes head-or-above only
|
||||
- **Context**: feat A (routing policy BLK-032) moved verifier + security-auditor to new `audit` phase (best = fable>opus>sonnet). Plan r1 set frontmatter `model: fable` (census rule floor = tier head) and claimed "Fable down → falls to opus". False: `inTier` (register.ts) writes a model only if it is the head or ranks above it, else logs "tier … down, frontmatter model kept" → fable frontmatter = gates spawn on dead Fable every credit outage (BLK-030/031). Lower tiers never hit it (head sonnet/opus always has a higher alias). Caught by correctness + robustness lenses r1, not by plan author.
|
||||
- **Apply**: an agent on a best-tier row keeps opus frontmatter; router lifts to Fable when up. Census `tier_floor` (effort-routing.test.sh) locks 2nd alias for best. Residual: spawn path unprobed → first gate of an outage window still dies once, retry lands on floor (register.test.ts audit-row case b). Links [[BLK-030]], [[BLK-032]], [[LRN-204]].
|
||||
@@ -4,7 +4,10 @@
|
||||
- [x] run — SDD 9/9, gates 0/1/2 green, opus review Importants fixed (c0fdbec, 9275e0d, 63a88bc), capitalize BDR-122 LRN-219..221 BLK-032; merge = user go
|
||||
- [x] parked review Minors + GATE 2 residuals (probe `supabase.url`, redirects, `_nonempty_rows`, printable) → /bugfix 2026-10-21, 5a98c2c + 633faa2, BLK-033
|
||||
- [ ] parked (GATE 2 LOW, 5a98c2c): probe table names not checked with `IDENT.fullmatch` per table (a `/` walks a path on the approved Supabase host); `printable` lets Unicode bidi/format controls (U+202E, U+2066…) through to the tty
|
||||
- [ ] routing policy /feat (user 2026-10-19, BLK-032): settings model → Opus 5.5; `judge` split (security-auditor + verifier → Fable, plan-challenger/analyzer/code review → opus); executors stay sonnet, "what to write" on opus; ceiling rule: main on Fable never writes code beyond a hotfix edit → dispatched executor; BDR superseding part of BDR-066 / BDR-115.
|
||||
- [~] routing policy /feat (user 2026-10-19, BLK-032): settings model → Opus 5.5; `judge` split (security-auditor + verifier → Fable, plan-challenger/analyzer/code review → opus); executors stay sonnet, "what to write" on opus; ceiling rule: main on Fable never writes code beyond a hotfix edit → dispatched executor; BDR superseding part of BDR-066 / BDR-115.
|
||||
- [x] feat A audit phase: d3635b6 (dialog writes, session model opus), a7d747c (audit row, opus floor, census, citers), dae142b (docs); gates 0/1/2 green, LRN-224
|
||||
- [ ] feat B: ceiling rule CLAUDE.global.md, BDR-123 superseding parts of BDR-066/115, README l.17 + l.72-73 doctrine (P2/P3 deferred), `skills/deploy/SKILL.md` effort low→xhigh (WARN floor drift)
|
||||
- [ ] residuals (accepted): spawn path unprobed, 1st gate of an outage window dies once (tour/onboard/audit-delta no retry); onAutoSwitch with main on opus marks nothing if engine auto-falls a gate off Fable
|
||||
|
||||
## 2026-10-18 — secure-by-default guardrails: 5 domains + /guardrails skill (feature/secure-by-default)
|
||||
User ask: hosting, a11y, Supabase, SMS/email consent, cloud functions must be baseline on every project, API and access secured systematically, plus a skill that tests all of it.
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
# CONTRACT — routing-audit-phase (feat A of the routing policy, BLK-032)
|
||||
|
||||
## REQUEST (verbatim, feat A scope after the 2026-10-21 scope split)
|
||||
model-router `judge` level split: security-auditor and verifier gates → Fable, plan-challenger / analyzer / code review → opus; executors stay sonnet. Citers census: skills/agents/lib rows that name the judge level must be patched in the same commit (make test runs the census). Feat B (settings model, CLAUDE.global.md ceiling rule, BDR) is a separate run.
|
||||
|
||||
## CLARIFICATIONS
|
||||
- [gated 2026-10-21] New phase name: `audit` (user pick over `gate`), tier `best`, effort `xhigh`.
|
||||
- [gated 2026-10-21, amended after the challenge] Scope split: feat A = router + agent floors + census + citers, preceded on the feature branch by one dedicated commit of the pre-existing routing.json (router dialog writes) and settings.json (session model `opus`) diffs; feat B = CLAUDE.global.md ceiling rule, BDR, docs.
|
||||
- Internal: `confirmed.agents` for verifier and security-auditor set to `audit` by hand (this feat is the user's confirmation; no dialog re-fire). The `about` lines of `judge` and `verify` drop the words that now describe `audit`.
|
||||
- [gated 2026-10-21] Outage floor: the gates keep `model: opus` in frontmatter (inTier never writes below the tier head; a fable floor would spawn on a dead Fable during a credit outage). The census gets a named carve-out: a best-tier agent row floors on the tier's second alias.
|
||||
- [gated 2026-10-21] Scope: 11 files in one /feat run (user call over /ship-feature after the challenge).
|
||||
- Internal: no stash. The pre-existing diffs on `mods/model-router/routing.json` (router dialog writes) and `settings.json` (session model `opus`) are committed first on the feature branch as one dedicated commit, before the executor runs.
|
||||
- Internal: `confirmed.phases.audit` is NOT written: the first-use dialog stays as the tripwire against a main-loop `route(phase="audit")`.
|
||||
- Internal: feature branch `feature/routing-audit-phase` started from the lib off develop before any commit.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. routing.json has the `audit` phase: tier best, effort xhigh, the exact about "the fresh gates: contract verdict and security scan; dispatched agents, not a main-loop phase", placed right after `judge`.
|
||||
CHECK: python3 -I -c "import json;d=json.load(open('mods/model-router/routing.json'));p=d['phases'];k=list(p);a=p['audit'];assert a['tier']=='best' and a['effort']=='xhigh' and a['about']=='the fresh gates: contract verdict and security scan; dispatched agents, not a main-loop phase' and k[k.index('judge')+1]=='audit';print('AUDIT-PHASE ok')"
|
||||
EXPECT: AUDIT-PHASE ok
|
||||
EVIDENCE: MET exit=0 marker-found :: AUDIT-PHASE ok
|
||||
2. register.ts DEFAULT_CONFIG phases carry the same `audit` line, right after `judge`.
|
||||
CHECK: grep -n -A1 "^ judge: { tier: 'big', effort: 'xhigh' }," mods/model-router/hooks/register.ts | grep -c "audit: { tier: 'best', effort: 'xhigh' },"
|
||||
EXPECT: 1
|
||||
EVIDENCE: MET exit=0 marker-found :: 1
|
||||
3. routing.json rows `agents.verifier` and `agents.security-auditor` are `audit`, so are their `confirmed.agents` entries; `confirmed.phases` has NO `audit` key (first-use dialog kept for main).
|
||||
CHECK: python3 -I -c "import json;d=json.load(open('mods/model-router/routing.json'));assert all(t[n]=='audit' for t in (d['agents'],d['confirmed']['agents']) for n in ('verifier','security-auditor'));assert 'audit' not in d['confirmed']['phases'];print('ROWS ok')"
|
||||
EXPECT: ROWS ok
|
||||
EVIDENCE: MET exit=0 marker-found :: ROWS ok
|
||||
4. `agents/verifier.md` and `agents/security-auditor.md` frontmatter read `model: opus` and `effort: xhigh` (opus = outage floor of the best tier).
|
||||
CHECK: for f in agents/verifier.md agents/security-auditor.md; do awk 'NR==1&&/^---$/{p=1;next} p&&/^---$/{exit} p' "$f" | grep -cE '^(model: opus|effort: xhigh)$'; done | tr '\n' ' '
|
||||
EXPECT: 2 2
|
||||
EVIDENCE: MET exit=0 marker-found :: 2 2
|
||||
5. The `judge` and `verify` `about` lines no longer claim audits or security review: judge = "independent judgment of work: challenges, analyses and reviews", verify = "checking a result against its spec: tests and suites".
|
||||
CHECK: grep -c '"about": "independent judgment of work: challenges, analyses and reviews"\|"about": "checking a result against its spec: tests and suites"' mods/model-router/routing.json
|
||||
EXPECT: 2
|
||||
EVIDENCE: MET exit=0 marker-found :: 2
|
||||
6. `lib/tests/model-routing.test.sh` locks the new floors (`agents/verifier.md` `model: opus`, `agents/security-auditor.md` `model: opus`, both commented as the audit row) and no longer locks `verifier.md` on sonnet.
|
||||
CHECK: a=$(grep -c "has \"agents/verifier.md\" *'model: opus'.*audit\|has \"agents/security-auditor.md\" *'model: opus'.*audit" lib/tests/model-routing.test.sh); b=$(grep -c "verifier.md\" *'model: sonnet'" lib/tests/model-routing.test.sh); echo "$a/$b"
|
||||
EXPECT: 2/0
|
||||
EVIDENCE: MET exit=0 marker-found :: 2/0
|
||||
7. Census suites green: `make test suite=lib/tests/effort-routing.test.sh` and `make test suite=lib/tests/model-routing.test.sh` exit 0.
|
||||
CHECK: make test suite=lib/tests/effort-routing.test.sh >/dev/null 2>&1 && make test suite=lib/tests/model-routing.test.sh >/dev/null 2>&1 && echo CENSUS-GREEN
|
||||
EXPECT: CENSUS-GREEN
|
||||
EVIDENCE: MET exit=0 marker-found :: CENSUS-GREEN
|
||||
8. Mod suite green and not skipped: `make test suite=lib/tests/mods.test.sh` exits 0 and reports `plugin test passed` for model-router (the CLI is present on this machine).
|
||||
CHECK: make test suite=lib/tests/mods.test.sh 2>&1 | grep -c 'model-router: plugin test passed'
|
||||
EXPECT: 1
|
||||
EVIDENCE: MET exit=0 marker-found :: 1
|
||||
9. `register.test.ts` carries the `audit` phase in `baseRouting()`, the `pending confirmation` counts 20 and 18, and two audit-row cases: fable already down → no write + log `tier best down, frontmatter model kept`; first spawn on fable then `rate_limit` → the retry writes nothing (`[FABLE, undefined]`).
|
||||
CHECK: f=mods/model-router/hooks/register.test.ts; a=$(grep -c "^ audit: { tier: 'best', effort: 'xhigh' }," $f); b=$(grep -c "pending confirmation: 20'\|pending confirmation: 18'" $f); c=$(grep -c "tier best down, frontmatter model kept" $f); d=$(grep -c "toEqual(\[FABLE, undefined\])" $f); echo "$a/$b/$([ "$c" -ge 1 ] && echo ok)/$d"
|
||||
EXPECT: 1/2/ok/1
|
||||
EVIDENCE: MET exit=0 marker-found :: 1/2/ok/1
|
||||
10. `lib/tests/effort-routing.test.sh` names the best-tier carve-out: a `tier_floor` helper returning the second alias for `best`, used by the model check, a comment naming BLK-030, and a flip test of the helper on the fixture (best → opus, big → opus).
|
||||
CHECK: f=lib/tests/effort-routing.test.sh; a=$(grep -c '^tier_floor()' $f); b=$(grep -c 'tier_floor "\$REG" "\$tier"' $f); c=$(grep -c 'BLK-030' $f); d=$(grep -c 'tier_floor "\$FIX/reg.ts" best\|tier_floor "\$FIX/reg.ts" big' $f); echo "$a/$b/$([ "$c" -ge 1 ] && echo ok)/$d"
|
||||
EXPECT: 1/1/ok/2
|
||||
EVIDENCE: MET exit=0 marker-found :: 1/1/ok/2
|
||||
11. The four citers no longer claim sonnet gates: `agents/plan-challenger.md`, `lib/challenge-plan.md`, `skills/tour/SKILL.md`, `README.md` each carry the token `` `audit` row `` (whitespace-normalised, survives a reflow), the old sentences are gone, and README's phase list names `` `audit` best/xhigh `` (checked by the verifier, no oracle).
|
||||
CHECK: a=0; for f in agents/plan-challenger.md lib/challenge-plan.md skills/tour/SKILL.md README.md; do tr '\n' ' ' < "$f" | tr -s ' ' | grep -q '`audit` row' && a=$((a+1)); done; b=$(cat agents/plan-challenger.md lib/challenge-plan.md skills/tour/SKILL.md README.md | tr '\n' ' ' | tr -s ' ' | grep -o 'both sonnet, oracle-anchored\|The executor gates stay sonnet\|security-auditor (sonnet frontmatter)\|| verifier | sonnet (pinned)\|| security-auditor | opus (judge row' | wc -l); echo "$a/$b"
|
||||
EXPECT: 4/0
|
||||
EVIDENCE: MET exit=0 marker-found :: 4/0
|
||||
12. Doctrine citers census green: `make test suite=lib/tests/doctrine-citers.test.sh` exits 0.
|
||||
CHECK: make test suite=lib/tests/doctrine-citers.test.sh >/dev/null 2>&1 && echo CITERS-GREEN
|
||||
EXPECT: CITERS-GREEN
|
||||
EVIDENCE: MET exit=0 marker-found :: CITERS-GREEN
|
||||
13. `lib/challenge-plan.md` still states the challengers run on the `judge` row (opus): no edit needed, the statement stays true.
|
||||
CHECK: grep -c 'routed to the `judge` row (opus)' lib/challenge-plan.md
|
||||
EXPECT: 1
|
||||
EVIDENCE: MET exit=0 marker-found :: 1
|
||||
14. No new lint or test suppression in the diff (floor-guard clean).
|
||||
CHECK: git diff -U0 -- . ':!.claude' | grep -E '^\+' | grep -cE 'shellcheck disable|noqa|eslint-disable|@ts-ignore|@ts-expect-error' | sed 's/^/n=/'
|
||||
EXPECT: n=0
|
||||
EVIDENCE: MET exit=0 marker-found :: n=0
|
||||
15. The diff touches only the FILE SCOPE: `git status --short` lists nothing outside it (the dialog-write and session-model diffs are committed before the executor runs).
|
||||
CHECK: git status --short -- . ':!.claude' | awk '{print $2}' | grep -vcE '^(mods/model-router/routing.json|mods/model-router/hooks/register.ts|mods/model-router/hooks/register.test.ts|agents/verifier.md|agents/security-auditor.md|lib/tests/model-routing.test.sh|lib/tests/effort-routing.test.sh|agents/plan-challenger.md|lib/challenge-plan.md|skills/tour/SKILL.md|README.md)$' | sed 's/^/n=/'
|
||||
EXPECT: n=0
|
||||
EVIDENCE: MET exit=0 marker-found :: n=0
|
||||
|
||||
## FILE SCOPE
|
||||
- mods/model-router/routing.json
|
||||
- mods/model-router/hooks/register.ts
|
||||
- mods/model-router/hooks/register.test.ts
|
||||
- agents/verifier.md
|
||||
- agents/security-auditor.md (no edit expected: frontmatter already opus/xhigh)
|
||||
- lib/tests/model-routing.test.sh
|
||||
- lib/tests/effort-routing.test.sh
|
||||
- agents/plan-challenger.md
|
||||
- lib/challenge-plan.md
|
||||
- skills/tour/SKILL.md
|
||||
- README.md
|
||||
@@ -0,0 +1,64 @@
|
||||
# PLAN r3 — routing-audit-phase (feat A, BLK-032 routing policy)
|
||||
|
||||
r2 after the 2026-10-21 challenge round 1 (outage floor, test fixture, citers, no stash). r3 after round 2: single about string, no `confirmed.phases.audit` (first-use dialog = tripwire for main), unprobed-spawn residual + its test, explicit branch step, oracles 1/3/10/11 tightened, tier_floor flip test.
|
||||
|
||||
Contract: `.claude/tasks/contracts/2026-10-21-routing-audit-phase-1506.md`
|
||||
|
||||
## Why
|
||||
User policy 2026-10-19 (BLK-032): Fable only for orchestrator reflection/plans and the important audits (security, functional); other judges opus; executors sonnet. Today `verifier` routes to `verify` (work tier = sonnet xhigh) and `security-auditor` to `judge` (big tier = opus xhigh). Both are the merge-blocking gates of verify-secure-loop.md (GATE 1 contract verdict, GATE 2 security). A new best-tier phase `audit` carries them; `judge` keeps plan-challenger, analyzer, Plan, plugin-advisor, seo/geo-analyzer on opus.
|
||||
|
||||
## Router facts that bind the plan
|
||||
- Rows are phase names; a phase names a tier; a tier is an ordered alias list, first alias not down is used (`best` = fable > opus > sonnet). An agent gets its row's model at spawn, upward only within the tier; explicit `model=` at a call site wins (BDR-115, BDR-077). No dispatch of verifier / security-auditor carries an explicit `model=` (grep 2026-10-21: tour, onboard, audit-delta dispatch them bare).
|
||||
- `lib/tests/effort-routing.test.sh` locks: every routing.json phase equals the code copy in `register.ts` DEFAULT_CONFIG (`code_phase`); every rowed agent's frontmatter `model:` equals its phase's tier head and `effort:` equals the phase effort, unless a `changed` entry explains the drift (WARN). Neither verifier nor security-auditor has a `changed` entry, so the frontmatter MUST move with the row or the census FAILs.
|
||||
- `lib/tests/model-routing.test.sh:23-24` greps the literal old pins.
|
||||
- `register.test.ts` builds every world from `baseRouting()` (11 phases, :65-78). `logMissingPhases` (register.ts:862-869) diffs `DEFAULT_CONFIG.phases` against the file, so a DEFAULT_CONFIG phase absent from the fixture is logged in every test: :1592-1601 expects exactly `lacks phases reflect`, and `/route pending` counts `st.cfg.phases` (:2555 `pending confirmation: 19`, :2567 `17`). The fixture gains `audit` and the two counts become 20 and 18.
|
||||
- `inTier` (register.ts:3163-3174) writes a model only when it is the tier head or ranks above it; otherwise "tier … down, frontmatter model kept" and the frontmatter runs (test :1278-1291). A best-tier row with a `fable` frontmatter therefore has NO fallback: every Fable credit outage (BLK-030/031) would spawn both gates on a dead model. Decision (user 2026-10-21): the gates keep `model: opus` as the outage floor; the router lifts them to Fable when it is up; Fable down or router off = opus. The census gets a named carve-out: a best-tier agent row's model floor is the tier's SECOND alias.
|
||||
- No stash. `~/.claude/settings.json` and `~/.claude/skills/model-router` are symlinks into the repo: stashing settings.json puts every new session back on Fable 1M (the BLK-032 condition) and stashing routing.json re-arms the router's dialogs. The dirty copies carry over the branch start unchanged (`git diff develop..HEAD` is empty for both files). They are committed FIRST on the feature branch as one dedicated commit (the router's own dialog writes: `deploy` apply→verify + `changed` entry, `release-executor` Keep; the session model `opus` = BLK-032 policy point 1), before the executor runs. Feat B then carries CLAUDE.global.md, the BDR and the docs only.
|
||||
- `confirmed.agents` records first-use dialog answers; an unconfirmed row re-opens the dialog at first use. This feat is the user's decision → set `audit` by hand for both.
|
||||
|
||||
## Branch (main loop, before the executor)
|
||||
1. `bash ~/.claude/lib/gitflow.sh start feature routing-audit-phase` from the current `bugfix/guardrails-residuals` (not merged): the lib branches off develop; the dirty `routing.json` / `settings.json` carry over (develop and HEAD hold the same blobs).
|
||||
2. One dedicated commit of those two files: `chore(model-router): dialog decisions (deploy verify, release-executor) and session model opus` — the router's own writes plus BLK-032 policy point 1.
|
||||
3. Dispatch the executor on the clean tree.
|
||||
4. Memory IDs for this run's capitalize start above the highest on BOTH develop and the unmerged `bugfix/guardrails-residuals` (8555bff: BLK-033, LRN-222/223): next BDR-123, LRN-224, BLK-034. The TODO line for this run goes under the 2026-10-19 routing bullet, away from the bugfix hunk at TODO.md:5-6.
|
||||
|
||||
## Checklist (dispatch-ready)
|
||||
[ ] mods/model-router/routing.json — phases: insert after `judge` (line 23-27):
|
||||
"audit": { "tier": "best", "effort": "xhigh", "about": "the fresh gates: contract verdict and security scan; dispatched agents, not a main-loop phase" }
|
||||
(exact string, 93 chars; `about` is shown in the first-use dialog only, register.ts:154, so this text is what main's first `route(phase="audit")` would print). Reword `judge.about` → "independent judgment of work: challenges, analyses and reviews"; `verify.about` → "checking a result against its spec: tests and suites". Rows: `agents.verifier` "verify" → "audit"; `agents.security-auditor` "judge" → "audit". `confirmed.agents.verifier` → "audit", `confirmed.agents.security-auditor` → "audit" (the two spawns the user decided here). Do NOT write `confirmed.phases.audit`: an unconfirmed phase keeps the first-use dialog (`confirmPhase` register.ts:2580-2585, suppressed by `isDecided` :2081 once confirmed) as the tripwire against a main-loop `route(phase="audit")`; `/route pending` listing `phases:audit` is the price. Nothing else changes: the `changed` block keeps the committed `deploy` entry, no entry is forged for the hand-moved rows.
|
||||
[ ] mods/model-router/hooks/register.ts — DEFAULT_CONFIG.phases (line ~280): insert `audit: { tier: 'best', effort: 'xhigh' },` right after the `judge` line. Same indentation, trailing comma. No other code change (inTier untouched).
|
||||
[ ] mods/model-router/hooks/register.test.ts — `baseRouting()` phases: insert `audit: { tier: 'best', effort: 'xhigh' },` after `judge` (:70-71); `pending confirmation: 19` → `20` (:2555), `17` → `18` (:2567). Leave the fixture's `verifier: 'verify'` row (:89) as is, other tests use it. Add two tests next to :1278-1291, built with `bootRun($, on, FABLE, newWorld({ edit: f => { (f.agents as Rec)['security-auditor'] = 'audit' } }))` (bootRun's 4th param, :1035-1041) and bare `spawnOf('security-auditor')` (no `model` field: an explicit model skips routing, :3199):
|
||||
(a) `test('audit row: fable down, no write, frontmatter runs', …)`: `switchTo($, FABLE, SONNET, 'auto')`, spawn once, expect `rig.specs` `[undefined]` and the one log line `'model-router: security-auditor tier best down, frontmatter model kept'` (recordLogs filter on `frontmatter model kept`).
|
||||
(b) `test('audit row: first spawn dies on fable, the retry lands on the floor', …)`: spawn, `await failWith($, 'rate_limit', 'a1')`, spawn again, expect `rig.specs` `[FABLE, undefined]` (same shape as :886-891); no log assertion in (b). This is the path verify-secure-loop's single fresh retry now depends on.
|
||||
[ ] agents/verifier.md — frontmatter `model: sonnet` → `model: opus` (effort stays xhigh). Body untouched. Rationale in the census comment, not here.
|
||||
[ ] agents/security-auditor.md — frontmatter stays `model: opus`, `effort: xhigh`: no edit.
|
||||
[ ] lib/tests/effort-routing.test.sh — add `tier_floor <file> <tier>` right after `tier_head`: second alias when `$2` = best, else `tier_head`. ONE comment above it (the only place citing BLK-030 in the file): `# a best-tier row floors on its 2nd alias: inTier keeps the frontmatter when the head is down (Fable credits, BLK-030); a fable floor would spawn the gates on a dead model`. `field_of` calls `tier_floor "$REG" "$tier"` for the model field. Section (c) header becomes `# ── (c) tracked agents with a row: tier floor == model:, effort == effort: ─` (no BLK cite). Flip test: add `best: ['fable', 'opus', 'sonnet'],` to the fixture's `reg.ts` tiers block (:88-92) and two checks: `[ "$(tier_floor "$FIX/reg.ts" best)" = opus ] && ok || ko "flip: best floors on its 2nd alias"` and `[ "$(tier_floor "$FIX/reg.ts" big)" = opus ] && ok || ko "flip: big floors on its head"`.
|
||||
[ ] lib/tests/model-routing.test.sh:23-24 — `has "agents/verifier.md" 'model: opus' # audit row (best tier, opus = outage floor; BLK-032 policy 2026-10-21)` and `has "agents/security-auditor.md" 'model: opus' # audit row since 2026-10-21 (was judge since 2026-10-11)`. Keep the column alignment of the block.
|
||||
[ ] agents/plan-challenger.md:112-113 — replace "(Contrast the verifier on its `verify` row and the executors on their `implement` row, both sonnet, oracle-anchored to a contract.)" with "(Contrast the executors on their `implement` row, sonnet, oracle-anchored to a contract; the verifier and security-auditor sit on the `audit` row, Fable with an opus floor.)". Reflow the paragraph to 80 columns.
|
||||
[ ] lib/challenge-plan.md:50 — "(The executor gates stay sonnet.)" → "(The executors stay sonnet; the two merge gates sit on the `audit` row, Fable with an opus floor.)". Reflow to 80 columns.
|
||||
[ ] skills/tour/SKILL.md:83 — "security-auditor (sonnet frontmatter)" → "security-auditor (`audit` row: Fable, opus floor)". Reflow if the line exceeds 80 columns.
|
||||
[ ] README.md:86-87 — verifier row: `| verifier | Fable (`audit` row: best/xhigh, opus frontmatter floor) | fresh gate (≤3×/loop) |`; security-auditor row: `| security-auditor | Fable (`audit` row: best/xhigh, opus frontmatter floor) | fresh gate (≤3×/loop) |`. Also README.md:111-113 phase list: insert `` `audit` best/xhigh `` after `` `judge` big/xhigh ``; :114-116 "kept equal to the rows by the census" → "kept equal to the rows by the census `lib/tests/effort-routing.test.sh` (a best-tier row floors on the tier's second alias, opus, since Fable is credit-gated; a row changed through the first-use dialog passes with a `WARN floor drift` line"; :135 best-tier row list → "(`plan`, `reflect`, `orchestrate`, `escalate`; `audit` is an agent row, never typed)". Every citer edit above carries the token `` `audit` row `` (oracle 11).
|
||||
[ ] run: the four suites first (`make test suite=lib/tests/effort-routing.test.sh`, `model-routing`, `mods`, `doctrine-citers`), then the full `make test` (plan-challenger.test.sh locks strings in plan-challenger.md / challenge-plan.md; contract-verifier and gates suites read verifier.md); then the contract oracles.
|
||||
|
||||
## Edge cases
|
||||
- Fable down (credits, BLK-030/031): `inTier` writes nothing, the `opus` frontmatter runs: the gates degrade to opus, one log line `tier best down, frontmatter model kept`. Router off (`/route off`, `enabled:false`, unreadable routing.json): opus too. Locked by the new register.test.ts case and the census carve-out.
|
||||
- `audit` appears in the main loop's `route` tool enum as a bare name (register.ts:2912-2916; `about` is never in the tool text). A main-loop `route(phase="audit")` opens the first-use phase dialog (phase left unconfirmed), which prints the about: that dialog is the tripwire. Same capability as `plan`; no orchestrator skill calls it; feat B's ceiling rule covers inline work on Fable.
|
||||
- Unprobed spawn path (TODO.md:56 residual, unchanged): the router learns Fable is down from a failure, never from a probe before a spawn. In an outage window the FIRST gate spawn dies on Fable (429), `StopFailure` marks it down, the fresh retry lands on the opus floor. verify-secure-loop's single retry covers /feat, /bugfix, /ship-feature, /init-project, /onboard, /guardrails, /a11y; tour Phase A, onboard and audit-delta dispatch the auditor with no retry rule: one dead dispatch per outage window there. Accepted, recorded in TODO; locked by test (b).
|
||||
- `onAutoSwitch` (register.ts:3662-3674) charges a sub-agent's engine fallback to main's last plan (TODO 2026-10-13 residual): a gate falling off Fable while main's last plan is sonnet marks sonnet down 15 min; with main's last plan on opus (the new session model) the early return at :3670 marks nothing, so an engine-side fallback would never mark Fable down and every gate spawn would pay the 429 again. Which event the engine emits for a sub-agent credit 429 is not established (BLK-030 saw StopFailure on main). Accepted, no code change here; test (b) locks the StopFailure path only.
|
||||
- `audit` duplicates `plan`'s (best, xhigh) pair: the Change dialog maps a pair to the first phase that fits in file order (`targetPhase` :2311-2317), so a gate row Changed away and back to "fable + xhigh" lands on `plan`; `audit` is reachable by hand edit only. Accepted.
|
||||
- `register.ts` validates a phase's tier against `tiers` keys: `best` exists. A phase named like an alias would be rejected: `audit` is not an alias.
|
||||
- `model-gate.md` (`names a fable or opus id | proceed`) is about the MAIN loop, not the gates: unaffected.
|
||||
- `lib/challenge-plan.md:46` says challengers are on the judge row (opus): still true, no edit.
|
||||
- The `verify` phase keeps one consumer once the dialog writes are committed first (skill row `deploy` = verify); no `route(phase="verify")` caller exists in skills/agents/lib. Only its `about` changes.
|
||||
- The dirty `routing.json` / `settings.json` are committed first on the feature branch (see Router facts); the executor starts from a clean tree and edits the committed routing.json, which already holds the `deploy` row and `changed` entry.
|
||||
|
||||
## Tests
|
||||
- `register.test.ts`: fixture + counts + the new outage-floor case. `effort-routing.test.sh`: best-tier floor carve-out. `model-routing.test.sh`: literal pins. `mods.test.sh` runs `claude plugin test` (CLI present on this machine). `doctrine-citers.test.sh`: citer census.
|
||||
|
||||
## Disposition (STEP 0.6, decisions-first)
|
||||
- BDR-066 [in force, partially superseded by this feat]: "verifier + security-auditor STAY sonnet" → overturned by user policy 2026-10-19; feat B writes the superseding BDR. Executors stay sonnet (honored).
|
||||
- BDR-077 [in force]: fail-safe pin rule (a forgotten override over-tiers, never downgrades judgment); no call site overrides the gates → honored: the frontmatter floor (opus) never sits below today's security-auditor pin, and the verifier floor rises sonnet → opus.
|
||||
- BDR-115 [in force]: rows in routing.json are the route, frontmatter = off-state floor, "an agent moves UP from its frontmatter alias, never below" (inTier) → honored: opus floor, router lifts to Fable; `confirmed` set because the user decided here, no `changed` entry forged.
|
||||
- BLK-030/031 [resolved, residual TODO.md:56 "spawn path not probed"]: the opus floor gives the retry a landing spot once the first failure marks Fable down; it does not save the first spawn of an outage window (Edge cases). An explicit `model:"fable"` pin would have neither.
|
||||
- LRN-203 [in force]: hooks write full ids from `config.models`; `fable` alias maps to `claude-fable-5-1` → honored, no id typed.
|
||||
- BLK-030/031 [resolved]: Fable credit outages → the `best` tier falls back; gates still run (edge case above).
|
||||
+5
-3
@@ -9,8 +9,8 @@ Format follows [Keep a Changelog](https://keepachangelog.com/) and this project
|
||||
### Added
|
||||
- **Secure-by-default guardrails**: `rules/secure-by-default.md` (always on) makes six domains baseline on every project, plus systematic API and access hygiene (auth on every route, CORS, secrets, passwords hashed with argon2id or bcrypt, never compared in clear, logged or hardcoded): hosting (rate limit, CDN and firewall, hard spend cap), Supabase (RLS on every table, owner-scoped policies, no service role key client-side), SMS and email (recorded consent, unsubscribe, STOP), cloud functions (no self-trigger, instance cap, budget stop), injection (bound values in raw escapes, `format()` for dynamic SQL, allowlisted filters, no shell into a DB tool), exposure (no data in the console, no production source map, no debug flag, no secret in hydrated state, data attributes, hidden fields or shipped comments). `/guardrails` audits them: a stdlib Python scanner (`skills/guardrails/scripts/scan.py`, FAIL / WARN / MANUAL, exit 1 on FAIL) then judgment, report in `.claude/audits/GUARDRAILS.md`. The security-auditor gate runs the scanner's `api` and `supabase` domains and blocks on FAIL. Items only a provider dashboard can set stay MANUAL, never claimed done. An optional read-only live probe (`skills/guardrails/scripts/probe.py`, `--live`) confirms a finding from outside on a target the user owns and names: anon-read, cross-user, no-auth route, CORS reflection and a capped rate-limit burst, verdicts OPEN / CLOSED / SKIPPED / ERROR. An `exposure` block in the plan adds three read-only probes, meant for a production build or a staging URL: a served or inline source map for the page's scripts, a stack trace in a 404 or a user-named error route, sensitive keys in a JSON response (identifier-shaped names printed, never values); a target the probe could not observe is SKIPPED or ERROR, never CLOSED, and every plan path must start with `/`. It sends GET, HEAD and OPTIONS only (one opt-in POST burst, capped at 25), requires `--authorized`, takes secrets from the environment never the command line, never follows a redirect to another host, and stops at a request budget. After the report, `/guardrails` proposes fixes (plan phase, so Fable when the router can switch), applies only the ones the user accepts through the `bugfixer` executor and the `lib/verify-secure-loop.md` gates, then re-scans: each accepted fix is a contract criterion whose oracle is the scanner (`--assert-absent RULE:path`, marker `GUARDRAILS-CLEAR`), and a full pass against the pre-fix baseline (`--baseline`, marker `GUARDRAILS-NO-NEW`) catches regressions; a live probe replays on the user's go; two rounds at most, residuals reported open; `--report-only` keeps the audit alone. Suites: `lib/tests/guardrails-scan.test.sh` (clean fixture plus one mutant per rule, check modes, `gates.sh` integration) and `lib/tests/guardrails-probe.test.sh` (probe logic against a localhost fixture server).
|
||||
- **/a11y skill**: accessibility leaves `/guardrails` and becomes its own skill. Same A11Y-* rules (img alt, field label, click without keyboard, focus outline removed, positive tabindex) on the shared scan engine (`skills/guardrails/scripts/scanner.py`, a `Catalogue` per CLI; `skills/a11y/scripts/scan.py`, markers `A11Y-CLEAR` / `A11Y-NO-NEW`), a Tab-only walk of the main flow on `--live` through `/browse` (marked not done otherwise), report `.claude/audits/A11Y.md`, fixes proposed with the alt and label wording as the user's choice, applied through the bugfix circuit (`bugfixer`, verify-secure gates, `bugfix/a11y-<date>`), re-pass against a baseline. The keyboard, alt and label doctrine moves from `rules/secure-by-default.md` to the lazy `rules/a11y.md` (loads on UI files only; `rules/web-building.md` points at it). `/guardrails` scans `injection` (INJ-*) and `exposure` (EXP-*) instead, with per-language SQL patterns, shared `code_files` / `hits` / `dedupe_lines` / `client_reachable` helpers and a walker that lists files over 1 MB by path; `--domain a11y` is a usage error there. `/web-validate` keeps full WCAG conformance. Suite `lib/tests/a11y-scan.test.sh`; routing row `reflect`; profiles audit, dev, web, web-full, full, max.
|
||||
- **model-router mod**: `mods/model-router/`, a Claude Code mod (function-hooks plugin), routes every repo skill and agent from phase rows (`plan`, `reflect`, `orchestrate`, `escalate`, `judge`, `implement`, `write`, `verify`, `explore`, `apply`, `mechanical`; built-ins Explore on sonnet/medium, Plan on opus/xhigh). A typed skill routes the main loop to its row, and a best-tier row holds across turns in a run slot until `/route clear`, `/route off`, a user `/model` or a typed skill on a non-best row. Agents get their row's model at spawn (within the tier, upward only) and its effort on every step; explicit Agent params win. Orchestrators declare their phases through the `mcp__model-router__route` tool. `ultrathink` in a prompt sets the turn's minimum effort and `/route effort=max` holds until `/route clear`; the built-in `/effort` is not a lever inside a run. `/route show` names the run slot (`main: run <phase>`), and a `null` row in the override drops a default row. The model gets a `route` tool and the user a `/route` command (`show|clear|off|on|reload|pending|ask on|off|forget <name|all|projects>|<phase>|model=<alias|id> effort=<level>|switch on|off|verbose on|off`). Optional per-machine config `~/.claude/model-router.json`, where `"enabled": false` turns it off on that machine. The spinner suffix and the status line show the route in force. It loads in every session through the tracked symlink `skills/model-router` (`model-router@skills-dir`). `make doctor` gains a Mods section; suite `make test suite=lib/tests/mods.test.sh`. Known limits: a main-loop switch runs only while the cold read it costs (the context minus what the target model's prompt cache holds) fits `upgradeMaxTokens` (200000) or `downgradeMaxTokens` (120000), and a downgrade also needs `mainModelSwitch` (on by default, off on any non-boolean value); the hooks send full model ids, so the `models` table has to follow new versions.
|
||||
- **model-router first-use confirmation**: `mods/model-router/routing.json` (tracked) is the single source of the phase table and of every skill and agent row, and keeps the decisions: `confirmed`, `changed` (`from`/`to`), `projects` exceptions keyed by the origin remote reduced to `host/path` (credentials and local paths never stored), and `ask`. The first use of a rowed typed skill, a rowed agent spawn or a main-loop phase declared through the `route` tool opens a dialog with context: the skill's description (first sentence of its `SKILL.md` frontmatter) or the agent's, the phase with its `about` line (a new field on each of the 11 phases) and the model id and effort the next step really runs on. A row offers Later, Keep or Change; a main-loop phase Later or Keep. Change asks the model (fable, opus, sonnet, haiku with their tier), then the effort among those the phases of that model use (skipped when there is only one), then Everywhere or This project only; the pair maps to an existing phase (rows stay phase names, the same phase counts as Keep, a pair no phase offers is added by hand as a new phase). A skill-row change toasts the model and effort it now runs on, with the `/route switch on` hint when the main loop holds back a downgrade; a free-text answer counts as Later. One dialog at a time, never in headless (`-p`) runs or inside a sub-agent. Only a dialog answer, `/route ask on|off` or `/route forget` (which takes decisions back; a changed row returns to its shipped phase, the frontmatter floors stay yours to realign) writes the file (serialized, 64 KiB cap, never created when absent); each write asks you to commit it from the config repo. `/route pending` lists unconfirmed rows and phases. Layers: routing.json < `~/.claude/model-router.json` (its `ask` wins); a project's `.claude/model-router.json` is never read. Tests: `mods/model-router/hooks/register.test.ts`.
|
||||
- **model-router mod**: `mods/model-router/`, a Claude Code mod (function-hooks plugin), routes every repo skill and agent from phase rows (`plan`, `reflect`, `orchestrate`, `escalate`, `judge`, `audit`, `implement`, `write`, `verify`, `explore`, `apply`, `mechanical`; built-ins Explore on sonnet/medium, Plan on opus/xhigh). A typed skill routes the main loop to its row, and a best-tier row holds across turns in a run slot until `/route clear`, `/route off`, a user `/model` or a typed skill on a non-best row. Agents get their row's model at spawn (within the tier, upward only) and its effort on every step; explicit Agent params win. Orchestrators declare their phases through the `mcp__model-router__route` tool. `ultrathink` in a prompt sets the turn's minimum effort and `/route effort=max` holds until `/route clear`; the built-in `/effort` is not a lever inside a run. `/route show` names the run slot (`main: run <phase>`), and a `null` row in the override drops a default row. The model gets a `route` tool and the user a `/route` command (`show|clear|off|on|reload|pending|ask on|off|forget <name|all|projects>|<phase>|model=<alias|id> effort=<level>|switch on|off|verbose on|off`). Optional per-machine config `~/.claude/model-router.json`, where `"enabled": false` turns it off on that machine. The spinner suffix and the status line show the route in force. It loads in every session through the tracked symlink `skills/model-router` (`model-router@skills-dir`). `make doctor` gains a Mods section; suite `make test suite=lib/tests/mods.test.sh`. Known limits: a main-loop switch runs only while the cold read it costs (the context minus what the target model's prompt cache holds) fits `upgradeMaxTokens` (200000) or `downgradeMaxTokens` (120000), and a downgrade also needs `mainModelSwitch` (on by default, off on any non-boolean value); the hooks send full model ids, so the `models` table has to follow new versions.
|
||||
- **model-router first-use confirmation**: `mods/model-router/routing.json` (tracked) is the single source of the phase table and of every skill and agent row, and keeps the decisions: `confirmed`, `changed` (`from`/`to`), `projects` exceptions keyed by the origin remote reduced to `host/path` (credentials and local paths never stored), and `ask`. The first use of a rowed typed skill, a rowed agent spawn or a main-loop phase declared through the `route` tool opens a dialog with context: the skill's description (first sentence of its `SKILL.md` frontmatter) or the agent's, the phase with its `about` line (a new field on each of the 12 phases) and the model id and effort the next step really runs on. A row offers Later, Keep or Change; a main-loop phase Later or Keep. Change asks the model (fable, opus, sonnet, haiku with their tier), then the effort among those the phases of that model use (skipped when there is only one), then Everywhere or This project only; the pair maps to an existing phase (rows stay phase names, the same phase counts as Keep, a pair no phase offers is added by hand as a new phase). A skill-row change toasts the model and effort it now runs on, with the `/route switch on` hint when the main loop holds back a downgrade; a free-text answer counts as Later. One dialog at a time, never in headless (`-p`) runs or inside a sub-agent. Only a dialog answer, `/route ask on|off` or `/route forget` (which takes decisions back; a changed row returns to its shipped phase, the frontmatter floors stay yours to realign) writes the file (serialized, 64 KiB cap, never created when absent); each write asks you to commit it from the config repo. `/route pending` lists unconfirmed rows and phases. Layers: routing.json < `~/.claude/model-router.json` (its `ask` wins); a project's `.claude/model-router.json` is never read. Tests: `mods/model-router/hooks/register.test.ts`.
|
||||
- **Manual-push mode**: `git config gitflow.autopush false` (human-set) now stops every push the gitflow lib makes, not only the post-commit / post-merge hooks. `gitflow start` and `finish` branch, commit and merge locally and push nothing; `gitflow delete` leaves the `origin/` copy in place and prints `git push origin --delete <br>` for the user to run. `hooks/unpushed-guard.sh` stays silent at turn end in this mode and opens each session with one `ℹ manual push mode:` line counting the commits no remote holds across every local branch; an unparseable or unreadable `gitflow.autopush` value is treated as manual push mode too, and that line names it. `hooks/push-guard.sh` (PreToolUse, `Bash|Monitor`) refuses any `git push` Claude types while `gitflow.autopush` reads false in the session cwd or in a literal `-C`/`cd` directory the command names (global config counts outside a repo); the refusal tells the user to run it with `! git push`. It reads the mode through the same lib verb as every other reader and fails closed: an unparseable or unreadable value reads as manual, and an internal error, a missing `lib/gitflow.sh`, more than 20 distinct directory tokens in one command (capped before any token is classified), a `cd`/`-C` directory token mixing quoted and unquoted parts, or a payload jq cannot parse whose raw text looks like a push refuse the push (these pathological cases fire in auto mode too). Directory tokens are read as whole shell words, adjacent quoted segments and backslash escapes included. Once the text looks like a push, the command is split into simple commands (quotes, escapes, separators, heredoc bodies dropped) and a push must be git's own subcommand in one of them: `grep "git push"`, `git log -S "git push"`, `git config --get push.default`, `git stash push`, a heredoc quoting a push or a commit message naming one are allowed; `bash -c` scripts are re-checked, wrappers (`sudo`, `env`, `eval`, `xargs`, `timeout`, `git subtree`...) and assignments keep the text verdict. The misses listed in its header fall to a new `autoMode.soft_deny` rule that no request in the turn clears. The session banner adds `🔒 push : manual (autopush=false) — ! git push` when the key reads false, and `🔒 push : manual (autopush bad) — ! git push` when the value is invalid. Skills read the mode through a new lib verb, `bash ~/.claude/lib/gitflow.sh push-mode`: it prints `auto`, `manual` or `invalid` (rc 0) and names an invalid value on stderr (printable characters only, 64 at most). It is the one reader a skill may call, since the `git config` read of the key is denied to Claude. Skills push nothing on their own, except the `/release-candidate` tag in auto-push mode on an explicit go. Every "on origin" or "not pushed" line they print comes from `git rev-list --count origin/<br>..<br>` read after the fact, with the complete `! git …` command when something is left for the user to push. An invalid value (anything but unset, true or false, or a read that fails) is manual push mode for every reader and is named where it is read (see Fixed). Tests: `lib/gitflow-test.sh` T11b (push-mode verb), T18m and T18q blocks, `lib/tests/unpushed-guard.test.sh` T10-T16, `lib/tests/push-guard.test.sh` (98 checks).
|
||||
|
||||
- **model-router prompt classifier**: a plain prompt typed in the composer (12 characters or more, not a slash command, not mid-turn, never under `-p` or in a sub-agent) that no keyword rule, skill, run slot, `/route` or floor covers is labelled by one call to the engine's small model (`design`, `analysis`, `coding`, `bookkeeping`, `chat`), bounded to 3 s. The label maps to plan, reflect, implement or apply and the turn takes that phase's route: its effort, and its model under the switch and the downgrade cap, never above the session model (an `ultrathink` floor keeps its model); no dialog, no file write, gone at the end of the turn, replaced by any route call or typed skill, and dropped for that turn by a `/effort` typed between turns. Three failures in a row pause it for `cooldownMinutes` (one toast, `classifier: paused` in the status line). `"classify": false` in `~/.claude/model-router.json` and `/route classify on|off` turn it off; `/route show` prints `classify:`. The status line reads `route: classifier <phase>` and `/route verbose on` adds `(<phase>: classifier)`.
|
||||
@@ -20,7 +20,9 @@ Format follows [Keep a Changelog](https://keepachangelog.com/) and this project
|
||||
### Changed
|
||||
- impeccable is the Build path for all UI: it replaces `frontend-design` on the design gate's `# GATE-BLOCK:` list and leads the Build line of the design doctrine. `frontend-design` stays installed as the light path for a one-off visual. Detector rule count corrected 45 to 61 (BDR-119).
|
||||
- model-router `verbose: true` logs transitions only: one line when main changes model or effort (`model-router: main: fable/high → fable/xhigh (plan: route tool)`), one hand-off line per dispatch and one per later effort move of an agent, each with its cause; the per-step, "answered by", spawn, route-tool and skill-path lines are gone. An agent answering on a model other than the planned one is said once. A non-boolean `verbose` falls back to `false`, said once.
|
||||
- `security-auditor` runs on the `judge` row (opus/xhigh) by a first-use decision; its frontmatter floor is aligned (`model: opus`).
|
||||
- `verifier` and `security-auditor` run on a new `audit` phase (best/xhigh: Fable, Opus when Fable is down). Their frontmatter floor is `model: opus` (the verifier was `sonnet`): a fable floor would spawn the gates on a dead model during a credit outage. `judge` (big/xhigh, opus) keeps plan-challenger, analyzer and plugin-advisor. The `about` lines of `judge` and `verify` no longer claim audits or security review. The census `lib/tests/effort-routing.test.sh` floors a best-tier agent row on the tier's second alias (opus).
|
||||
- `settings.json` session model `claude-fable-5-1[1m]` → `opus`: sessions start on Opus, and Fable is reached through the best-tier rows.
|
||||
- `/deploy` runs on the `verify` row (sonnet/xhigh, was `apply` sonnet/low) by a first-use decision.
|
||||
- `lib/model-gate.md` calls the model-router `route` tool and takes its answer as the witness; with the mod off the gate stops and names `/route on`. The `model:` / `effort:` frontmatter of agents and skills is now the off-state floor, census-locked equal to the rows (`lib/tests/effort-routing.test.sh`; a row changed through the first-use dialog passes with a `WARN floor drift` line while its frontmatter still holds the shipped value). `analyzer` effort goes from high to xhigh. Built-in judgment dispatches carry an explicit `effort=`.
|
||||
- `settings.json` denies every write form of the human-only `gitflow.*` keys (18 entries): any `git … config` spelling, section remove/rename, `git -c`, the git config env overrides, and Edit/Write of `.git/config`, `.gitconfig` and `~/.config/git/config`. Side effect: Claude can no longer read `gitflow.autopush` through `git config` either; hooks and `lib/gitflow.sh` still read it. The `hard_deny` rule on routing around a guardrail now names PreToolUse hook refusals.
|
||||
- `gitflow start` and `finish` warn on stderr when a base is behind origin and cannot fast-forward, instead of a silent `git pull --ff-only || true` (T18l, T18n).
|
||||
|
||||
@@ -83,8 +83,8 @@ inherits silently: typed agents run on their model-router row, their
|
||||
| Agent | Model | Tier |
|
||||
|---|---|---|
|
||||
| feater, hotfixer, bugfixer | sonnet (pinned) | executors — code from a closed plan (feat), fix from a closed diagnosis (bugfix), fix-bundle appliers |
|
||||
| verifier | sonnet (pinned) | fresh gate (≤3×/loop) |
|
||||
| security-auditor | opus (judge row: opus/xhigh, the user's first-use decision; frontmatter floor aligned) | fresh gate (≤3×/loop) |
|
||||
| verifier | Fable (`audit` row: best/xhigh, opus frontmatter floor) | fresh gate (≤3×/loop) |
|
||||
| security-auditor | Fable (`audit` row: best/xhigh, opus frontmatter floor) | fresh gate (≤3×/loop) |
|
||||
| commit-changer, release-executor, code-cleaner | sonnet (pinned) | dispatched execution — grouping+commit / release spans / approved cleanup (audit + approval gates stay in the dispatcher) |
|
||||
| onboarder, scaffolder, refactorer, validator-analyzer, plugin-probe | sonnet (pinned) | workers — config generation, scaffold, refactor, deterministic W3C/WCAG runner, mechanical plugin probe |
|
||||
| status-reporter | haiku (pinned) | mechanical collector |
|
||||
@@ -109,12 +109,13 @@ Second axis of the same table: how hard each phase thinks. Session default
|
||||
model-router mod (below): the phase table and one phase row per repo skill
|
||||
and agent, each phase naming a tier and an effort level
|
||||
(`plan` best/xhigh, `reflect` best/high, `orchestrate` best/medium,
|
||||
`escalate` best/max, `judge` big/xhigh, `implement` work/medium, `write`
|
||||
`escalate` best/max, `judge` big/xhigh, `audit` best/xhigh, `implement` work/medium, `write`
|
||||
work/high, `verify` work/xhigh, `explore` work/medium, `apply` work/low,
|
||||
`mechanical` cheap/low). The `model:` and `effort:` frontmatter of every
|
||||
typed agent and user-invoked skill stays as the off-state floor, kept equal
|
||||
to the rows by the census `lib/tests/effort-routing.test.sh` (a row
|
||||
changed through the first-use dialog passes with a `WARN floor drift` line
|
||||
to the rows by the census `lib/tests/effort-routing.test.sh` (a best-tier
|
||||
row floors on the tier's second alias, opus, since Fable is credit-gated; a
|
||||
row changed through the first-use dialog passes with a `WARN floor drift` line
|
||||
until its frontmatter follows): low
|
||||
appliers, medium executors, high writers, xhigh judgment and gates (none
|
||||
on haiku, which rejects the parameter); `/status` low … `/ship-feature`
|
||||
@@ -132,7 +133,7 @@ effort, never version. Transcript audit `python3 lib/effort-audit.py`.
|
||||
|
||||
`mods/model-router/` is a Claude Code mod (a function-hooks plugin) that applies this table per request. It loads in every session through the tracked symlink `skills/model-router`, as `model-router@skills-dir`.
|
||||
|
||||
- Main loop: every request gets the route in force. A typed skill with a row routes the main loop to it; a best-tier row (`plan`, `reflect`, `orchestrate`, `escalate`) holds across turns in a run slot until `/route clear`, `/route off`, a user `/model` or a typed skill on a non-best row. A skill without a row leaves the route as it is. A rowed skill the model loads inside a best-tier run moves effort only when its row ranks below the run's model. Main routed onto a model whose context window the conversation outgrew returns to the session model. Before main runs on a model, the one it moves to or the one it keeps (the session's own model included), the mod probes it with one small completion bounded to 8 seconds; the step (and `/route show`, the route tool's answer) waits for it. A timeout or an error marks the model down (reason `probe`, held for `cooldownMinutes` like any breaker hold) and the decision is taken again once. A model already marked down is never probed, and a model that answered is not probed again, `/clear` included, until it is marked down. When a lower model stands in for its tier's head held down (Opus for Fable on a best-tier phase), the phase's own effort goes one notch up: `reflect` xhigh, `plan` max, `orchestrate` high, `escalate` stays max. An effort asked explicitly (`/route ... effort=`, the `route` tool's `effort`) or set by a floor is never raised. `/route show` and the route tool's answer print the level with `(opus stands in for fable)`; the verbose transition line names `stand-in` as a cause.
|
||||
- Main loop: every request gets the route in force. A typed skill with a row routes the main loop to it; a best-tier row (`plan`, `reflect`, `orchestrate`, `escalate`; `audit` is an agent row, never typed) holds across turns in a run slot until `/route clear`, `/route off`, a user `/model` or a typed skill on a non-best row. A skill without a row leaves the route as it is. A rowed skill the model loads inside a best-tier run moves effort only when its row ranks below the run's model. Main routed onto a model whose context window the conversation outgrew returns to the session model. Before main runs on a model, the one it moves to or the one it keeps (the session's own model included), the mod probes it with one small completion bounded to 8 seconds; the step (and `/route show`, the route tool's answer) waits for it. A timeout or an error marks the model down (reason `probe`, held for `cooldownMinutes` like any breaker hold) and the decision is taken again once. A model already marked down is never probed, and a model that answered is not probed again, `/clear` included, until it is marked down. When a lower model stands in for its tier's head held down (Opus for Fable on a best-tier phase), the phase's own effort goes one notch up: `reflect` xhigh, `plan` max, `orchestrate` high, `escalate` stays max. An effort asked explicitly (`/route ... effort=`, the `route` tool's `effort`) or set by a floor is never raised. `/route show` and the route tool's answer print the level with `(opus stands in for fable)`; the verbose transition line names `stand-in` as a cause.
|
||||
- Sub-agents: a routed agent gets its row's model at spawn, within its tier and only upward from its frontmatter model, and the row's effort on every step. Explicit `model` / `effort` params on the Agent call win; a project-defined agent of the same name keeps its own definition. Built-ins: Explore runs on sonnet/medium, Plan on opus/xhigh. A built-in `general-purpose` agent that main spawns with no `model` param, while main runs below the session model (a downgrade or a breaker fallback), starts on the session model instead of inheriting the lower one; it is not pinned when the session model is marked down, for a fork, a workflow or a nested spawn, or when a project or user definition shadows the built-in. Other agent types are never pinned this way: the hook cannot see their frontmatter model.
|
||||
- Levers inside a run: `ultrathink` in a prompt sets the turn's minimum effort; `/route effort=max` holds until `/route clear`. The built-in `/effort` is not a lever inside a run, rows and routes outrank it.
|
||||
- Prompt classifier: a plain prompt typed in the composer (12 characters or more, not a slash command) that no keyword rule, skill, run slot, `/route` or floor covers is sent to the engine's small fast model, one call, bounded to 3 seconds (the prompt waits for it, typically under a second). The label (`design`, `analysis`, `coding`, `bookkeeping`, `chat`) maps to plan, reflect, implement or apply (`chat` routes nothing), and the turn takes that phase's route: its effort becomes the turn's default, and its model may move the main loop, never above the session model. A `coding` or `bookkeeping` guess moves main down only when `mainModelSwitch` is on and the cold read fits `downgradeMaxTokens`; an `ultrathink` floor in the same turn keeps its own model. No dialog opens and no file is written. The route is gone at the end of the turn, a later route call or typed skill replaces it, and a `/effort` you type between turns drops the guess for that turn only. A typed best-tier skill holds its run slot across turns, so nothing is classified there until `/route clear`. Long prompts are sampled (first 500 and last 1500 code points), so pasted text at the end can steer one turn's route. Three failures in a row pause it for `cooldownMinutes` (one toast, `classifier: paused` in the status line). Never in a sub-agent, mid-turn or under `-p`. Off per session with `/route classify off`, per machine with `"classify": false`. The status line reads `route: classifier <phase>`; `/route verbose on` adds the transition line.
|
||||
|
||||
@@ -194,7 +194,7 @@ l'outil `mcp__model-router__route` (`lib/effort-shift.md`). Les skills
|
||||
externes vendorés (pile design, superpowers, agent-skills, skills scroll
|
||||
MengTo, 21st) ont aussi leur ligne.
|
||||
|
||||
Taper un skill qui a une ligne route la boucle principale dessus. Une ligne du tier best (plan, reflect, orchestrate, escalate) tient d'un tour à l'autre pendant tout le run, jusqu'à `/route clear`, `/route off`, un `/model` tapé ou un skill d'un autre tier tapé. Pour relancer un tour bloqué : `ultrathink` dans le prompt (plancher du tour) ou `/route effort=max` (tient jusqu'à `/route clear`). Le `/effort` intégré n'a pas d'effet dans un run : les lignes et les routes passent devant. Un prompt tapé sans règle, skill ni route en cours passe par un classifieur (un appel au petit modèle, 3 secondes au plus) : le tour prend la route de la phase devinée : son niveau d'effort, et son modèle, jamais au-dessus de celui de la session. Une devinette `coding` ou `bookkeeping` fait descendre la boucle principale vers un modèle moins cher quand `mainModelSwitch` est actif (par défaut) et que la relecture à froid tient sous `downgradeMaxTokens` (120000 tokens par défaut). Cette relecture compte aussi le prompt qui vient d'être envoyé (un token pour 3 caractères), et un document joint bloque la descente pour cette étape. Le cache compte comme chaud pendant le TTL du moteur (`cache_ttl`, 5 ou 60 minutes), 60 minutes par défaut. `/route classify off` ou `"classify": false` dans la config machine le coupe, et un `/effort` tapé entre deux tours annule la devinette pour ce tour seulement. Avant d'envoyer la boucle principale sur un modèle, celui vers lequel elle se déplace comme celui qu'elle garde (le modèle de la session compris), le mod l'essaie une fois (un appel minimal, 8 secondes au plus) : sans réponse, ce modèle est marqué en panne (raison `probe`) et la décision est reprise une fois ; `"probe": false` dans la config machine coupe cet essai, et `/route show` affiche `probe:`. Quand un modèle inférieur remplace la tête de son tier en panne (Opus pour Fable), le niveau propre de la phase monte d'un cran (reflect xhigh, plan max, orchestrate high) ; un niveau demandé explicitement ou un plancher ne bouge jamais. Les sous-agents reçoivent le modèle de leur ligne au lancement (dans leur tier, jamais en dessous de leur frontmatter) et son niveau à chaque étape ; un `model` ou `effort` explicite sur l'appel gagne. Explore tourne en sonnet/medium, Plan en opus/xhigh. Un agent intégré `general-purpose` lancé par la boucle principale sans `model`, pendant que celle-ci tourne sous le modèle de la session (descente, ou repli quand un modèle est en panne), part sur le modèle de la session au lieu d'hériter du modèle inférieur ; les autres types d'agents ne sont jamais épinglés ainsi. `/route show` affiche la route en cours, slot de run compris (`main: run <phase>`), et le switch avec son plafond et ce TTL (`switch: on (downgrade, cap 120000 tokens cold, ttl 60 min)`). Première utilisation : la première fois qu'un skill avec ligne est tapé, qu'un agent avec ligne est lancé ou qu'une phase est déclarée sur la boucle principale via l'outil `route`, le mod demande une fois si la route convient. La question donne le contexte : la description du skill (première phrase du frontmatter de son `SKILL.md`) ou celle de l'agent, la phase avec sa ligne `about` (champ de la phase dans `routing.json`), puis le modèle et le niveau réels de l'étape suivante ; une phase déclarée dit aussi qui l'utilise. Pour une ligne : Later, Keep ou Change ; pour une phase déclarée : Later ou Keep. Change demande le modèle (fable, opus, sonnet, haiku, chacun avec son tier), puis le niveau parmi ceux des phases de ce modèle (fable : medium, high, xhigh ou max ; sonnet : low, medium, high ou xhigh ; opus et haiku n'en ont qu'un, la question est sautée), puis Everywhere ou This project only (exception rangée sous le remote origin du dépôt réduit à `host/path`, jamais d'identifiants). Une ligne reste un nom de phase : le couple modèle et niveau désigne une phase existante, et la même phase qu'avant vaut Keep. Un couple qu'aucune phase n'offre s'ajoute à la main comme nouvelle phase dans `routing.json`. Après un changement sur un skill, un toast donne le modèle et le niveau réels, et rappelle `/route switch on` quand le switch est coupé, ou nomme le plafond quand la relecture à froid bloque la descente. La réponse est écrite dans `routing.json` ; Later, un texte libre (Other) ou un dialogue fermé redemande à une session suivante. Un seul dialogue à la fois, jamais en headless (`-p`) ni dans un sous-agent, et le modèle n'écrit jamais ce fichier. Chaque réponse laisse le repo de config modifié : commite-le depuis ce repo. `/route pending` liste ce qui reste à confirmer, `/route ask off|on` coupe ou rallume le dialogue, `/route forget <nom|all|projects>` efface une décision (une ligne changée revient à la phase livrée ; `all` et `projects` demandent d'abord).
|
||||
Taper un skill qui a une ligne route la boucle principale dessus. Une ligne du tier best (plan, reflect, orchestrate, escalate ; `audit` est une ligne d'agent, jamais tapée) tient d'un tour à l'autre pendant tout le run, jusqu'à `/route clear`, `/route off`, un `/model` tapé ou un skill d'un autre tier tapé. Pour relancer un tour bloqué : `ultrathink` dans le prompt (plancher du tour) ou `/route effort=max` (tient jusqu'à `/route clear`). Le `/effort` intégré n'a pas d'effet dans un run : les lignes et les routes passent devant. Un prompt tapé sans règle, skill ni route en cours passe par un classifieur (un appel au petit modèle, 3 secondes au plus) : le tour prend la route de la phase devinée : son niveau d'effort, et son modèle, jamais au-dessus de celui de la session. Une devinette `coding` ou `bookkeeping` fait descendre la boucle principale vers un modèle moins cher quand `mainModelSwitch` est actif (par défaut) et que la relecture à froid tient sous `downgradeMaxTokens` (120000 tokens par défaut). Cette relecture compte aussi le prompt qui vient d'être envoyé (un token pour 3 caractères), et un document joint bloque la descente pour cette étape. Le cache compte comme chaud pendant le TTL du moteur (`cache_ttl`, 5 ou 60 minutes), 60 minutes par défaut. `/route classify off` ou `"classify": false` dans la config machine le coupe, et un `/effort` tapé entre deux tours annule la devinette pour ce tour seulement. Avant d'envoyer la boucle principale sur un modèle, celui vers lequel elle se déplace comme celui qu'elle garde (le modèle de la session compris), le mod l'essaie une fois (un appel minimal, 8 secondes au plus) : sans réponse, ce modèle est marqué en panne (raison `probe`) et la décision est reprise une fois ; `"probe": false` dans la config machine coupe cet essai, et `/route show` affiche `probe:`. Quand un modèle inférieur remplace la tête de son tier en panne (Opus pour Fable), le niveau propre de la phase monte d'un cran (reflect xhigh, plan max, orchestrate high) ; un niveau demandé explicitement ou un plancher ne bouge jamais. Les sous-agents reçoivent le modèle de leur ligne au lancement (dans leur tier, jamais en dessous de leur frontmatter) et son niveau à chaque étape ; un `model` ou `effort` explicite sur l'appel gagne. Explore tourne en sonnet/medium, Plan en opus/xhigh. Un agent intégré `general-purpose` lancé par la boucle principale sans `model`, pendant que celle-ci tourne sous le modèle de la session (descente, ou repli quand un modèle est en panne), part sur le modèle de la session au lieu d'hériter du modèle inférieur ; les autres types d'agents ne sont jamais épinglés ainsi. `/route show` affiche la route en cours, slot de run compris (`main: run <phase>`), et le switch avec son plafond et ce TTL (`switch: on (downgrade, cap 120000 tokens cold, ttl 60 min)`). Première utilisation : la première fois qu'un skill avec ligne est tapé, qu'un agent avec ligne est lancé ou qu'une phase est déclarée sur la boucle principale via l'outil `route`, le mod demande une fois si la route convient. La question donne le contexte : la description du skill (première phrase du frontmatter de son `SKILL.md`) ou celle de l'agent, la phase avec sa ligne `about` (champ de la phase dans `routing.json`), puis le modèle et le niveau réels de l'étape suivante ; une phase déclarée dit aussi qui l'utilise. Pour une ligne : Later, Keep ou Change ; pour une phase déclarée : Later ou Keep. Change demande le modèle (fable, opus, sonnet, haiku, chacun avec son tier), puis le niveau parmi ceux des phases de ce modèle (fable : medium, high, xhigh ou max ; sonnet : low, medium, high ou xhigh ; opus et haiku n'en ont qu'un, la question est sautée), puis Everywhere ou This project only (exception rangée sous le remote origin du dépôt réduit à `host/path`, jamais d'identifiants). Une ligne reste un nom de phase : le couple modèle et niveau désigne une phase existante, et la même phase qu'avant vaut Keep. Un couple qu'aucune phase n'offre s'ajoute à la main comme nouvelle phase dans `routing.json`. Après un changement sur un skill, un toast donne le modèle et le niveau réels, et rappelle `/route switch on` quand le switch est coupé, ou nomme le plafond quand la relecture à froid bloque la descente. La réponse est écrite dans `routing.json` ; Later, un texte libre (Other) ou un dialogue fermé redemande à une session suivante. Un seul dialogue à la fois, jamais en headless (`-p`) ni dans un sous-agent, et le modèle n'écrit jamais ce fichier. Chaque réponse laisse le repo de config modifié : commite-le depuis ce repo. `/route pending` liste ce qui reste à confirmer, `/route ask off|on` coupe ou rallume le dialogue, `/route forget <nom|all|projects>` efface une décision (une ligne changée revient à la phase livrée ; `all` et `projects` demandent d'abord).
|
||||
|
||||
La config par machine, optionnelle, vit dans `~/.claude/model-router.json` et passe devant `routing.json` ; `"enabled": false` y coupe le mod sur cette machine, `"ask": false` y coupe le dialogue, une ligne à `null` y retire une ligne. Un `.claude/model-router.json` dans un projet n'est jamais lu. Les phases et les lignes se modifient à la main dans `routing.json` ; `/route reload` relit les deux fichiers.
|
||||
|
||||
|
||||
@@ -107,10 +107,12 @@ the MAIN loop, never here):
|
||||
(correctness / robustness / simplicity), each blind to the others.
|
||||
- MODEL (BDR-076, supersedes the BDR-066 inherit): plan critique is AUDIT
|
||||
JUDGMENT, not a procedural gate — the challenger is routed to the `judge`
|
||||
row (opus) by the model-router, the `model: opus` frontmatter being the off-state floor (big
|
||||
tier; the session model stays on the inline loop). Never `model: "sonnet"` —
|
||||
a silent judgment downgrade. (Contrast the verifier on its `verify` row and
|
||||
the executors on their `implement` row, both sonnet, oracle-anchored to a contract.)
|
||||
row (opus) by the model-router, the `model: opus` frontmatter being the
|
||||
off-state floor (big tier; the session model stays on the inline loop).
|
||||
Never `model: "sonnet"` — a silent judgment downgrade. (Contrast the
|
||||
executors on their `implement` row, sonnet, oracle-anchored to a contract;
|
||||
the verifier and security-auditor sit on the `audit` row, Fable with an
|
||||
opus floor.)
|
||||
- FAIL-SAFE — never fail open: a malformed/empty verdict, a missing `PROOF`, or
|
||||
a dead challenger → retry ONCE fresh; a 2nd failure → escalate to the human and
|
||||
NAME the lens. Never report "plan challenged" on a silently dropped lens (same
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
name: verifier
|
||||
description: Fresh independent verifier — reads a CONTRACT file from disk and renders a structured verdict (CONFORME / ECARTS / ERROR) on the implemented diff. Report-only, never fixes. Dispatched fresh at every iteration; receives no iteration history.
|
||||
tools: Read, Grep, Glob, Bash
|
||||
model: sonnet
|
||||
model: opus
|
||||
effort: xhigh
|
||||
---
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ JUDGMENT — the challengers are routed to the `judge` row (opus) by the model-r
|
||||
the `model: opus` frontmatter being the off-state floor: a big tier, off
|
||||
the session model. The session model (Fable)
|
||||
keeps only this loop — synthesis, RE-THINK, gate. Never sonnet: that would
|
||||
silently downgrade the judgment. (The executor gates stay sonnet.)
|
||||
silently downgrade the judgment. (The executors stay sonnet; the two merge
|
||||
gates sit on the `audit` row, Fable with an opus floor.)
|
||||
|
||||
**Lens framing by `KIND`** (the agent's three lenses, read against the artifact):
|
||||
- `build-plan` — will it WORK / will it BREAK / is it needlessly COMPLEX.
|
||||
|
||||
@@ -52,12 +52,19 @@ code_phase() {
|
||||
awk '/^ phases: \{/{f=1;next} f&&/^ \},?$/{f=0} f' "$REG" \
|
||||
| sed -nE "s/^ *$1: \{ tier: '([a-z]+)', effort: '([a-z]+)' \},?$/\1 \2/p"
|
||||
}
|
||||
# tier_floor <file> <tier> -> the model: floor of a tier's agents
|
||||
# a best-tier row floors on its 2nd alias: inTier keeps the frontmatter when the head is down (Fable credits, BLK-030); a fable floor would spawn the gates on a dead model
|
||||
tier_floor() {
|
||||
if [ "$2" != best ]; then tier_head "$1" "$2"; return; fi
|
||||
awk '/^ tiers: \{/{f=1;next} f&&/^ \},?$/{f=0} f' "$1" \
|
||||
| sed -nE "s/^ *best: \['[a-z]+', '([a-z]+)'.*$/\1/p"
|
||||
}
|
||||
# field_of <dump> <phase> <effort|model> -> that phase's frontmatter value
|
||||
field_of() {
|
||||
local pe tier
|
||||
pe="$(phase_effort "$1" "$2")"
|
||||
if [ "$3" = effort ]; then printf '%s\n' "${pe#* }"; return; fi
|
||||
tier="${pe% *}"; tier_head "$REG" "$tier"
|
||||
tier="${pe% *}"; tier_floor "$REG" "$tier"
|
||||
}
|
||||
# verdict <dump> <kind> <name> <effort|model> <got> <phase>: ok when the
|
||||
# frontmatter equals the row's phase; warn when the row was changed through
|
||||
@@ -87,6 +94,7 @@ RD="$(dump "$RJ")"
|
||||
FIX="$(mktemp -d)"; trap 'rm -rf "$FIX"' EXIT
|
||||
cat > "$FIX/reg.ts" <<'FX'
|
||||
tiers: {
|
||||
best: ['fable', 'opus', 'sonnet'],
|
||||
big: ['opus', 'fable'],
|
||||
},
|
||||
FX
|
||||
@@ -110,6 +118,8 @@ FD="$(dump "$FIX/routing.json")"
|
||||
[ "$(phase_effort "$FD" judge)" = "big xhigh" ] && ok || ko "flip: phase"
|
||||
[ -z "$(phase_effort "$FD" nothere)" ] && ok || ko "flip: ghost phase"
|
||||
[ "$(tier_head "$FIX/reg.ts" big)" = "opus" ] && ok || ko "flip: tier head"
|
||||
[ "$(tier_floor "$FIX/reg.ts" best)" = opus ] && ok || ko "flip: best floors on its 2nd alias"
|
||||
[ "$(tier_floor "$FIX/reg.ts" big)" = opus ] && ok || ko "flip: big floors on its head"
|
||||
[ "$(changed_of "$FD" skills feat)" = "reflect implement" ] && ok || ko "flip: changed entry"
|
||||
[ -z "$(changed_of "$FD" skills doc)" ] && ok || ko "flip: ghost changed entry"
|
||||
# the drift verdicts (high = reflect's effort, medium = implement's)
|
||||
@@ -147,7 +157,7 @@ check_skill() {
|
||||
while IFS= read -r f; do check_skill "$f"; done < <(
|
||||
cd "$R" && git ls-files 'skills/*/SKILL.md' 'skills-external/*/SKILL.md')
|
||||
|
||||
# ── (c) tracked agents with a row: tier head == model:, effort == effort: ─
|
||||
# ── (c) tracked agents with a row: tier floor == model:, effort == effort: ─
|
||||
NO_ROW_AGENTS=" interviewer client-handover-writer "
|
||||
check_agent() {
|
||||
local f="$1" name phase
|
||||
|
||||
@@ -20,8 +20,8 @@ done
|
||||
# 3) executor + gate pins
|
||||
has "agents/feater.md" 'model: sonnet'
|
||||
has "agents/hotfixer.md" 'model: sonnet'
|
||||
has "agents/verifier.md" 'model: sonnet'
|
||||
has "agents/security-auditor.md" 'model: opus' # judge row since 2026-10-11 (user first-use decision)
|
||||
has "agents/verifier.md" 'model: opus' # audit row (best tier, opus = outage floor; BLK-032 policy 2026-10-21)
|
||||
has "agents/security-auditor.md" 'model: opus' # audit row since 2026-10-21 (was judge since 2026-10-11)
|
||||
has "agents/analyzer.md" 'model: opus'
|
||||
# 4) /feat executor shape
|
||||
has "skills/feat/SKILL.md" 'subagent_type="feater"'
|
||||
|
||||
@@ -69,6 +69,7 @@ const baseRouting = (): Rec => ({
|
||||
orchestrate: { tier: 'best', effort: 'medium' },
|
||||
escalate: { tier: 'best', effort: 'max' },
|
||||
judge: { tier: 'big', effort: 'xhigh' },
|
||||
audit: { tier: 'best', effort: 'xhigh' },
|
||||
implement: { tier: 'work', effort: 'medium' },
|
||||
write: { tier: 'work', effort: 'high' },
|
||||
verify: { tier: 'work', effort: 'xhigh' },
|
||||
@@ -1290,6 +1291,32 @@ test('agent row: opus and fable down, no write and one log line', async (
|
||||
])
|
||||
})
|
||||
|
||||
const auditWorld = () => newWorld({
|
||||
edit: f => { (f.agents as Rec)['security-auditor'] = 'audit' },
|
||||
})
|
||||
|
||||
test('audit row: fable down, no write, frontmatter runs', async (
|
||||
$, on) => {
|
||||
const logs = recordLogs(on)
|
||||
const rig = await bootRun($, on, FABLE, auditWorld())
|
||||
await switchTo($, FABLE, SONNET, 'auto')
|
||||
await $.agent.spawn(spawnOf('security-auditor'))
|
||||
expect(rig.specs).toEqual([undefined])
|
||||
const down = logs.filter(l => l.includes('frontmatter model kept'))
|
||||
expect(down).toEqual([
|
||||
'model-router: security-auditor tier best down, frontmatter model kept',
|
||||
])
|
||||
})
|
||||
|
||||
test('audit row: first spawn dies on fable, the retry lands on the floor',
|
||||
async ($, on) => {
|
||||
const rig = await bootRun($, on, FABLE, auditWorld())
|
||||
await $.agent.spawn(spawnOf('security-auditor'))
|
||||
await failWith($, 'rate_limit', 'a1')
|
||||
await $.agent.spawn(spawnOf('security-auditor'))
|
||||
expect(rig.specs).toEqual([FABLE, undefined])
|
||||
})
|
||||
|
||||
test('agent row: explicit model, explicit effort and fork win', async (
|
||||
$, on) => {
|
||||
const rig = await bootRun($, on)
|
||||
@@ -2552,7 +2579,7 @@ test('/route pending lists what is not confirmed, asked first', async (
|
||||
await bootRun($, on, FABLE, w)
|
||||
await typeFeat($)
|
||||
const lines = (await route($, 'pending')).split('\n')
|
||||
expect(lines[0]).toBe('pending confirmation: 19')
|
||||
expect(lines[0]).toBe('pending confirmation: 20')
|
||||
expect(lines[1]).toBe('asked this session: skills:feat')
|
||||
expect(lines[2]).toContain('agents:feater')
|
||||
expect(lines[2]).toContain('phases:plan')
|
||||
@@ -2564,7 +2591,7 @@ test('/route pending drops a confirmed row', async ($, on) => {
|
||||
await bootRun($, on, FABLE, w)
|
||||
await typeFeat($)
|
||||
const text = await route($, 'pending')
|
||||
expect(text).toContain('pending confirmation: 17')
|
||||
expect(text).toContain('pending confirmation: 18')
|
||||
expect(text).not.toContain('phases:reflect')
|
||||
})
|
||||
|
||||
|
||||
@@ -278,6 +278,7 @@ const DEFAULT_CONFIG: Config = {
|
||||
orchestrate: { tier: 'best', effort: 'medium' },
|
||||
escalate: { tier: 'best', effort: 'max' },
|
||||
judge: { tier: 'big', effort: 'xhigh' },
|
||||
audit: { tier: 'best', effort: 'xhigh' },
|
||||
implement: { tier: 'work', effort: 'medium' },
|
||||
write: { tier: 'work', effort: 'high' },
|
||||
verify: { tier: 'work', effort: 'xhigh' },
|
||||
|
||||
@@ -23,7 +23,12 @@
|
||||
"judge": {
|
||||
"tier": "big",
|
||||
"effort": "xhigh",
|
||||
"about": "independent judgment of work: audits, challenges and verdicts"
|
||||
"about": "independent judgment of work: challenges, analyses and reviews"
|
||||
},
|
||||
"audit": {
|
||||
"tier": "best",
|
||||
"effort": "xhigh",
|
||||
"about": "the fresh gates: contract verdict and security scan; dispatched agents, not a main-loop phase"
|
||||
},
|
||||
"implement": {
|
||||
"tier": "work",
|
||||
@@ -38,7 +43,7 @@
|
||||
"verify": {
|
||||
"tier": "work",
|
||||
"effort": "xhigh",
|
||||
"about": "checking a result against its spec: tests, security review, gates"
|
||||
"about": "checking a result against its spec: tests and suites"
|
||||
},
|
||||
"explore": {
|
||||
"tier": "work",
|
||||
@@ -107,7 +112,7 @@
|
||||
"capitalize": "apply",
|
||||
"close": "apply",
|
||||
"reconcile": "apply",
|
||||
"deploy": "apply",
|
||||
"deploy": "verify",
|
||||
"status": "mechanical",
|
||||
"profile": "mechanical",
|
||||
"plugin-check": "mechanical",
|
||||
@@ -138,17 +143,17 @@
|
||||
"release-executor": "apply",
|
||||
"plugin-probe": "apply",
|
||||
"validator-analyzer": "apply",
|
||||
"verifier": "verify",
|
||||
"security-auditor": "judge",
|
||||
"verifier": "audit",
|
||||
"security-auditor": "audit",
|
||||
"status-reporter": "mechanical"
|
||||
},
|
||||
"projects": {},
|
||||
"confirmed": {
|
||||
"agents": {
|
||||
"verifier": "verify",
|
||||
"verifier": "audit",
|
||||
"feater": "implement",
|
||||
"doc-syncer": "write",
|
||||
"security-auditor": "judge",
|
||||
"security-auditor": "audit",
|
||||
"plan-challenger": "judge",
|
||||
"analyzer": "judge",
|
||||
"hotfixer": "apply",
|
||||
@@ -158,7 +163,8 @@
|
||||
"bugfixer": "implement",
|
||||
"plugin-probe": "apply",
|
||||
"plugin-advisor": "judge",
|
||||
"Explore": "explore"
|
||||
"Explore": "explore",
|
||||
"release-executor": "apply"
|
||||
},
|
||||
"phases": {
|
||||
"verify": "verify",
|
||||
@@ -174,9 +180,17 @@
|
||||
},
|
||||
"skills": {
|
||||
"gitflow": "implement",
|
||||
"ship-feature": "plan"
|
||||
"ship-feature": "plan",
|
||||
"deploy": "verify"
|
||||
}
|
||||
},
|
||||
"changed": {
|
||||
"skills": {
|
||||
"deploy": {
|
||||
"from": "apply",
|
||||
"to": "verify"
|
||||
}
|
||||
}
|
||||
},
|
||||
"changed": {},
|
||||
"ask": true
|
||||
}
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"cleanupPeriodDays": 7,
|
||||
"env": {
|
||||
"ENABLE_STOP_REVIEW": "0"
|
||||
},
|
||||
"attribution": {
|
||||
"commit": "",
|
||||
"pr": "",
|
||||
"sessionUrl": false
|
||||
},
|
||||
"env": {
|
||||
"ENABLE_STOP_REVIEW": "0"
|
||||
},
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(git status)",
|
||||
@@ -354,7 +354,7 @@
|
||||
"disableBypassPermissionsMode": "disable",
|
||||
"additionalDirectories": []
|
||||
},
|
||||
"model": "claude-fable-5-1[1m]",
|
||||
"model": "opus",
|
||||
"hooks": {
|
||||
"SessionStart": [
|
||||
{
|
||||
|
||||
@@ -80,8 +80,8 @@ Model discipline (the user-fixed invariant behind this mode):
|
||||
carries this skill's reflection (fix decisions, convergence calls); it
|
||||
must never be pinned down to an executor tier.
|
||||
- Inside a runner, every dispatched agent keeps the tier this skill
|
||||
already defines: security-auditor (sonnet frontmatter), the Phase B
|
||||
audit (analyzer opus pin or `model="opus"`), doc-syncer (audit on
|
||||
already defines: security-auditor (`audit` row: Fable, opus floor), the
|
||||
Phase B audit (analyzer opus pin or `model="opus"`), doc-syncer (audit on
|
||||
`model="opus"`, patch on its sonnet frontmatter — BDR-077).
|
||||
|
||||
Runner dispatch, one per project:
|
||||
|
||||
Reference in new issue
Block a user