Skip to content

t1k-config-mr.json

registryVersion: 2

Enabled: yes · Mode: transparent

Agent modelProviderModel
haiku—deepseek-v4.1-flash
sonnet—deepseek-v4.1-flash

Enabled: yes · Fallback to Anthropic: yes

Ordered failover pipe:

  1. / deepseek-v4.1-flash
  2. / glm-5.3-flash

Legacy circular chain:

FromTo
_commentDeprecated legacy 2-hop derivation (mr-delegate.sh _build_pipe_hops) — consulted ONLY when failover.pipe is absent or empty, which it never is. EMPTIED 2026-10-20 rather than repointed: the entries were a mutual fallback between the retired route label and codex and neither is a failover target any more. Kept as an empty object so _chain_lookup_node() finds a shape it recognises instead of taking the absent-key path.
  • claude
  • claude-code-guide
  • Plan
  • t1k-art-audio-artist
  • t1k-art-base-2d-artist
  • t1k-art-base-3d-artist
  • t1k-art-store-artist
  • t1k-art-video-artist
  • t1k-blender-base-3d-artist
  • t1k-brainstormer
  • t1k-business-base-legal-advisor
  • t1k-cocos-brainstormer
  • t1k-cocos-debugger
  • t1k-cocos-pla-retrofit-reviewer
  • t1k-cocos-reviewer
  • t1k-cocos-stdlib-contributor
  • t1k-cocos-visual-director
  • t1k-debugger
  • t1k-designer-audio-composer
  • t1k-designer-base-brainstormer
  • t1k-designer-base-game-designer
  • t1k-designer-base-game-producer
  • t1k-designer-brainstormer
  • t1k-designer-game-designer
  • t1k-designer-game-producer
  • t1k-discord-triager
  • t1k-git-manager
  • t1k-hard-coder
  • t1k-lane-worker
  • t1k-planner
  • t1k-project-manager
  • t1k-researcher
  • t1k-review-synthesizer
  • t1k-rn-base-debugger
  • t1k-rn-base-reviewer
  • t1k-routing-gap-fixer
  • t1k-routing-gap-remediator
  • t1k-rsi-reviewer
  • t1k-tree-leaf
  • t1k-tree-node
  • t1k-unity-audio-developer
  • t1k-unity-base-brainstormer
  • t1k-unity-base-developer
  • t1k-unity-base-lane-lead
  • t1k-unity-base-mono-tester
  • t1k-unity-base-optimizer
  • t1k-unity-base-parity-porter
  • t1k-unity-base-pr-reviewer
  • t1k-unity-base-project-bootstrapper
  • t1k-unity-base-ui-developer
  • t1k-unity-base-visual-director
  • t1k-unity-brainstormer
  • t1k-unity-developer
  • t1k-unity-dots-core-compile-doctor
  • t1k-unity-dots-core-debugger
  • t1k-unity-dots-core-environment
  • t1k-unity-dots-core-implementer
  • t1k-unity-dots-core-optimizer
  • t1k-unity-dots-core-reviewer
  • t1k-unity-dots-core-shader
  • t1k-unity-dots-core-tester
  • t1k-unity-dots-core-validator
  • t1k-unity-rendering-feel-developer
  • t1k-unity-ui-developer
  • t1k-web-core-visual-director

Raw JSON (ground truth)
{
"_t1kMergeStrategy": {
"modelRouter.briefSizeAdvisory.ciWaitPatterns": "set",
"modelRouter.briefSizeAdvisory.exemptAgents": "set",
"modelRouter.contextGrowthAgents": "set",
"modelRouter.excludeAgents": "set",
"modelRouter.hopCiWait.allowAgents": "set",
"modelRouter.hopGit.laneBranchGlobs": "set",
"modelRouter.hopGit.parentPushAllowedRemotes": "set",
"modelRouter.hopGit.protectedBranchGlobs": "set",
"modelRouter.routableWriteAgents": "set",
"modelRouter.security.allowedMcpServers": "set",
"modelRouter.security.dataClassification.blockClasses": "set"
},
"_t1kMergeStrategyComment": "P05 (plans/260927-tree-default-on-routing-quality/phase-05-router-merge-annotation.md, theonekit-cli#918/6.24.0): opts four consumer-customizable arrays into a three-way SET merge instead of the atomic whole-array compare `t1k modules update` otherwise uses — a consumer's own additions/removals and this kit's own additions/removals to the SAME array now compose instead of one side permanently winning the moment they diverge (the exact gap that stranded `excludeAgents`' `claude` entry, router#704, until #918 shipped). Each of these is a plain MEMBERSHIP set consulted via inclusion/Set lookup, never iterated in order — `excludeAgents` (mr-task-interceptor.cjs), `contextGrowthAgents` (mr-defaults.cjs contextGrowthAgents(), also mr-delegate.sh's own growth= read), `routableWriteAgents` (mr-defaults.cjs routableWriteAgentsSet(), resolved straight to a Set) — so reordering any of them changes nothing observable, which is exactly the precondition `mergeSetArray` requires (its own three-way formula preserves LOCAL order, so a consumer's own ordering is kept regardless). `failover.pipe` is the converse case and stays OUT of this list on purpose: it is an ORDERED hop sequence (hop 1/2/3/standby), consumed positionally everywhere it is read, so a set merge would silently reshuffle failover priority — it keeps the pre-existing atomic whole-array compare.",
"kitName": "theonekit-model-router",
"modelRouter": {
"_backgroundDeliveryComment": "How a routed spawn that is background (`run_in_background` absent or `true` — the CLI default since 2.1.273; only an explicit `false` is foreground) is delivered. \"proxy\" (DEFAULT, and what ships here) is the background path: the spawn is rewritten in place, via hookSpecificOutput.updatedInput, to the shipped Workflow agent() proxy `t1k-model-router-proxy` (haiku, Bash only) and proceeds NATIVELY in the background — the parent is not blocked for the hop, and the work still runs on the backend/model the interceptor already picked. \"sync\" is the ESCAPE HATCH and restores the pre-2026-09-15 behaviour: the spawn is not rewritten at all, and it proceeds natively UNROUTED (the skipped-background-optout decline) rather than blocking. WHY THE DEFAULT MOVED: 465 of 1,484 successful routed spawns carried `run_in_background: true` and blocked the parent for the whole hop — 84.1h of orchestrator wall-clock in 7 days to 2026-09-15, p50 485s, p90 1337s, against p50 1s for a native background spawn (N=981). With `\"proxy\"` those hops are delivered by the proxy instead. The proxy path itself landed in 3.64.0 with the hop-2 reviewer's blocking fixes in place (C1 the detached-delegate/`--wait` split so no single Bash call has to outlast the hop, C2 the staging gate, I1 the I1 decline that degrades to an unrouted native spawn rather than to the blocking route) and was verified live on one machine 2026-09-16 before this flip. RESOLUTION: a MISSING key means \"proxy\" (the shipped default); an UNRECOGNISED value fails CLOSED to \"sync\", so a typo cannot silently enable a path on a value the kit does not recognise. Either value chooses a DELIVERY PATH, never a route: every floor, the data-classification gate, the backend allowlist and excludeAgents are applied identically on both. Full contract: docs/mr-transparent-routing.md § \"Background delivery\".",
"_contextGrowthAgentsComment": "USER DECISION 2026-08-25: emptied to disable the contextGrowth MODEL-SELECTION preference (selection precedence row 2). Shipped default is [\"Explore\", \"general-purpose\"] (mr-task-interceptor.cjs DEFAULT_CONTEXT_GROWTH_AGENTS); an empty array disables the rule entirely (contextGrowthAgents(), same file). Measured before this change: 14 of 18 routed spawns since the flash-only edit took row 2 and picked minimax-m3 (largest context window, 1M) — never reaching modelMapping/loadBalance, so the flash-only narrowing had no effect on them. With the rule off, Explore/general-purpose fall through to loadBalance -> deepseek-v4-flash. SIDE EFFECT: contextGrowthAgents also gates the WIDER per-hop timeout ceiling (contextGrowthPerHopTimeoutSec=1200 vs perHopTimeoutSec=600, mr-defaults.cjs resolvePerHopTimeoutSec). Built-in Explore/general-purpose have no .md, so the #311 maxTurns-based widening cannot rescue them either — their hops now get 600s. If Explore hops start timing out, raise failover.perHopTimeoutSec rather than re-populating this array.",
"_disableUnderAnthropicProxyComment": "Auto-disable transparent routing in sessions whose endpoint is a proxy (CCS, or any Anthropic-API gateway), so a user can run several sessions at once — plain Claude-account sessions with routing ON, CCS sessions with routing OFF — without the CCS ones re-routing to a local gateway that cannot serve the routed model. `mr-task-interceptor.cjs` passes the spawn through (reason `disabled-by-anthropic-proxy`) when this key is not `false` AND `ANTHROPIC_BASE_URL` is a non-empty string: an empty string ROUTES (presence, not truthiness, is the marker). `ANTHROPIC_BASE_URL` is exclusively a proxy/CCS marker here — `mr-delegate.sh` sets it on a delegated HOP's own env only (~5223) and a hop short-circuits earlier at the `MR_SPAWNED` guard, so a hop's inherited value never reaches the gate. This key does NOT touch `enabled`, so the statusline's own `modelRouter.enabled` read is unaffected; set `false` to route even under a proxy.",
"_excludeAgentsComment": "2026-09-13: `claude-code-guide` added. It is a HOST-PROVIDED agent that does not exist inside a routed `claude -p` subprocess, so every delegation of it fails deterministically at hop 0. Excluding it costs nothing — a routed attempt could never have succeeded. 2026-09-26: `claude` added (#704). The built-in `claude` agent has model INHERIT semantics (session model, may be Opus). The builtin-no-md code path synthesizes `model: 'sonnet'` (from defaultBuiltInModel), passing the passthrough floor — so a `claude` spawn is routed to a cheap backend and degrades or exhausts the pipe (exit 42). Excluding it preserves the inherit semantics (spawns NATIVELY on the session model). 2026-09-26: `t1k-lane-worker` added (theonekit-core agent). Its charter is to OWN a lane in a caller-created worktree, write `.claude/`, open a PR and watch it to merged; a routed hop cannot hold a worktree (it runs in the caller's tree) and cannot reliably write `.claude/`, so routing it fails the charter. Without a native write-capable specialist, sessions fell back to `fork`, which copies the whole parent conversation (measured 435-465K tokens per lane vs ~60K for a native sonnet specialist). Data-driven by design: Extend without a kit release per rules/code-conventions.md. 2026-09-28: `t1k-git-manager` added (theonekit-core agent, #743 follow-up). Its ENTIRE charter is push/merge/PR-open/PR-fleet-sweep (theonekit-core agents/t1k-git-manager.md: 'stage, commit, push, branch, PR... ends at PR opened + auto-merge armed') — exactly the population mr-hop-git-guard.cjs exists to deny in a routed hop (rules/mr-transparent-routing.md: a hop's job ends at 'PR opened + `--auto` armed', never the push/merge/gh-pr-action itself). This is not a narrow miss: even git-manager's DOCUMENTED read-only 'PR-fleet status sweep' capability runs entirely through `gh pr list`/`gh pr checks`/`gh pr view`, all NOUN=`pr`, all denied by the guard's `gh pr <anything>` rule (mirrors #741 on purpose — not narrowed to mutating actions only, see that hook's own header). Narrowing the guard to admit git-manager would reopen exactly the hole #743 closed for every OTHER routed agent. Measured before this exclusion: 196 routed `t1k-git-manager` hops over 7 days (hopCiWait's own comment above, same measurement window), and local `~/.model-router/debug.jsonl` on this machine shows `t1k-git-manager` hard-denied on `git-push`/`git-merge`/`gh-pr` mid-hop on 2026-09-27/28. Excluding it keeps the guard's full deny-list intact and lets git-manager's native path (the only one that can actually complete its charter) run unrouted. Data-driven by design: Extend without a kit release per rules/code-conventions.md. 2026-09-29: `t1k-routing-gap-fixer` added (theonekit-core, new sonnet leaf split out of `t1k-routing-gap-remediator`, plans/260928-thin-premium-agents phase-14 P14b). Its charter is to apply the judge's fix, run the named tests and LAND it: `/t1k:sync-back` in a consumer project, or a direct PR + `--auto` in a kit source repo, watched to merged. Two things make a routed hop unable to do that: it writes `.claude/**`, which a hop cannot reliably do (the `t1k-lane-worker` reason above), and it needs `git push`/`gh pr`, which mr-hop-git-guard.cjs hard-denies in every hop (the `t1k-git-manager` reason above). It is `model: sonnet` with Edit/Write/MultiEdit, and `writeAgentFloor` ships `premium-only`, so nothing but this entry keeps it native. At the time of this entry the judge (`t1k-routing-gap-remediator`, kept name) needed NO entry: it stayed `model: opus`, and the premium-family passthrough (`isKitPassthroughModel()` in mr-task-interceptor.cjs) floors opus/fable unconditionally, ahead of this list, which may only escalate more agents to native, never demote — SUPERSEDED 2026-09-30, see the dated update below: the judge itself moves to `model: sonnet` and now needs the entry too. This entry must merge before core P14a so the fixer is never routed on any consumer; with the agent absent it is inert. Data-driven by design: Extend without a kit release per rules/code-conventions.md. 2026-09-29: `t1k-debugger`, `t1k-fullstack-developer`, `t1k-kit-developer` and the new `t1k-hard-coder` added (owner decision 2026-09-29). All four run NATIVELY on Claude Sonnet 5.5 for coding/debugging quality and must never go to a cheap backend. They declare `model: sonnet` (the alias) plus a `routable: false` frontmatter declaration, which the interceptor does NOT read. `sonnet` is not a premium floor (isKitPassthroughModel() in mr-task-interceptor.cjs matches only the opus/fable families and `inherit`), and `writeAgentFloor` ships `premium-only` (no name/tool floor), so this list is the ONLY enforcement that keeps these four native. An entry for an agent not installed on a machine is inert. Pinned by tests/test-mr-sonnet-5-5-agents-excluded.sh. Data-driven by design: Extend without a kit release per rules/code-conventions.md. 2026-09-29: `t1k-code-reviewer` added (owner decision): it runs natively on Sonnet 5.5, `model: sonnet` + `routable: false`; sonnet is not a premium floor, so this entry is the only thing keeping it native. 2026-09-29/30: `t1k-tree-leaf`, `t1k-tree-node`, `t1k-routing-gap-remediator` (theonekit-core) added. Owner decision 2026-09-29 moves all three to native Claude Sonnet 5.5 (`model: sonnet` + `routable: false`) in the sibling core PR `feat/sonnet55-execution-agents` — this FLIPS `t1k-routing-gap-remediator` (the judge) from the `opus` it carried when the fixer/judge split first shipped (see the 2026-09-29 `t1k-routing-gap-fixer` paragraph above, now superseded on that one point) to `sonnet`, at which point it is no longer covered by the premium-family passthrough and this entry becomes load-bearing, exactly like the fixer. Until `feat/sonnet55-execution-agents` merges, these three may still read `model: opus` on a given machine, in which case the entry is redundant-but-harmless. `tests/test-mr-routing-gap-fixer-excluded.sh` was inverted 2026-09-30 to assert the judge IS excluded (previously asserted it carried no entry). `t1k-unity-dots-core-compile-doctor`, `t1k-unity-dots-core-implementer`, `t1k-unity-dots-core-tester`, `t1k-unity-dots-core-optimizer`, `t1k-unity-dots-core-debugger`, `t1k-unity-developer` (theonekit-unity), `t1k-cocos-debugger` (theonekit-cocos), `t1k-rn-base-debugger` (theonekit-rn), and `t1k-blender-base-3d-artist` (theonekit-blender) added — OWNER DECISION 2026-09-29: these kit execution agents move to native Claude Sonnet 5.5 (`model: sonnet` + `routable: false`) in sibling PRs across the kits. `sonnet` is not a premium floor (isKitPassthroughModel() matches only the opus/fable families and `inherit`), and `writeAgentFloor` ships `premium-only` (no name/tool floor), so this list is the ONLY thing keeping them native. An entry for an agent absent on a given machine (e.g. a Unity-only entry on a Cocos-only install) is inert. Data-driven by design: Extend without a kit release per rules/code-conventions.md. 2026-10-01: 25 agents added (owner decision, plans/261001-claude-quota-reduction P01b). The premium keep-list shrinks to `t1k-kongming`, `t1k-advisor` and `t1k-cocos-stdlib-gatekeeper`; every other opus/fable agent moves to native Claude Sonnet 5.5 (`model: sonnet` + `routable: false`, `effort: max` for the critical ones, `high` for the rest) in the sibling core PR (P01a) and one PR per kit (P01-kits). Core: `t1k-planner`, `t1k-review-synthesizer`, `t1k-researcher`, `t1k-rsi-reviewer`, `t1k-brainstormer`, `t1k-project-manager`. Unity: `t1k-unity-base-visual-director`, `t1k-unity-brainstormer`, `t1k-unity-ui-developer`, `t1k-unity-dots-core-environment`, `t1k-unity-dots-core-reviewer`, `t1k-unity-dots-core-shader`, `t1k-unity-rendering-feel-developer`. Cocos: `t1k-cocos-brainstormer`, `t1k-cocos-reviewer`, `t1k-cocos-pla-retrofit-reviewer`, `t1k-cocos-stdlib-contributor`, `t1k-cocos-visual-director`. Designer: `t1k-designer-audio-composer`, `t1k-designer-brainstormer`, `t1k-designer-game-designer`, `t1k-designer-game-producer`. Others: `t1k-rn-base-reviewer`, `t1k-web-core-visual-director`, `t1k-business-base-legal-advisor`. While these agents still read opus/fable the premium-family passthrough floors them and the entry is redundant-but-harmless; once demoted to `sonnet` (not a premium floor) this list is the ONLY thing keeping them native, which they need because they keep `Agent(...)` and a routed hop has no `Agent` tool. Must release BEFORE core P01a so no consumer ever routes a demoted spawn-capable agent; an entry for an agent absent on a machine is inert. Pinned by tests/test-mr-sonnet-5-5-agents-excluded.sh. Data-driven by design: Extend without a kit release per rules/code-conventions.md. 2026-10-01: kit agents renamed to satisfy release-action gate Y (nested prefix; unity#894, cocos#1241, designer#188) -- the new names (t1k-unity-base-*, t1k-cocos-base-*, t1k-cocos-playable-*, t1k-designer-base-*) are listed next to the old ones, which stay because consumers not yet updated still ship the old files. t1k-cocos-base-stdlib-gatekeeper stays OFF the list like its old name. 2026-10-02: Blender kit renamed to the art kit (The1Studio/theonekit-art); its only agent `t1k-blender-base-3d-artist` is now `t1k-art-base-3d-artist` (`routable: false`, model sonnet, effort high; must always run native). Both names are listed: installs still on the older kit release keep the OLD agent file, and a name that no longer matches silently stops excluding. The old name can be removed once no install ships the pre-rename theonekit-blender release. 2026-10-02: `t1k-art-base-2d-artist` added (theonekit-art module `base`, the 2D counterpart of the 3D artist; `routable: false`, model sonnet, effort high). It writes files and runs scripts and must always run native; `sonnet` is not a premium floor, so this entry is the only thing keeping it native. Inert where the art kit is absent. Pinned by tests/test-mr-sonnet-5-5-agents-excluded.sh. 2026-10-03: `t1k-fullstack-developer` REMOVED from excludeAgents (USER DECISION, reverses part of the 2026-09-29 owner decision #814; t1k-kit-developer, t1k-hard-coder and t1k-debugger stay excluded). It now routes through the cheap path (modelMapping.sonnet). The user accepts slower spawns in exchange for less Claude Code usage. Evidence: A/B batch run 2026-10-02T16-54-47-065Z in theonekit-core plans/261002-parent-decides-spawn, 12 theonekit-cli tasks none touching `.claude/`, k=2 per arm. Passes native 22/24 vs routed 23/24 (one routed attempt timed out at 600s and counts as a fail). Blind judge mean 4.50 native vs 4.64 routed. Anthropic spend $2.95 vs $0. Median wall 20s vs 234s (11.4x slower). Safety: a routed hop cannot write `.claude/**`, so the interceptor keeps any write-capable agent native when its brief makes a `.claude/` path an edit target (reason `skipped-claude-dir-brief`; a `.claude/projects/` path is Claude Code state and does not count). Core t1k-base@3.184.0 dropped its `Agent(...)` tool and set routable: true, so the spawn floor no longer applies; an older core copy that still declares `Agent(...)` is floored and stays native. Pinned by tests/test-mr-fullstack-developer-routes.sh. 2026-10-06: the interceptor NOW reads an agent's own `routable: false` frontmatter as a native floor (decision `pass-agent-declared-native`), so a kit that declares the key no longer depends on this list on a machine whose per-machine list was customised (the CLI set-merges it and never forces a new name onto it); the earlier \"which the interceptor does NOT read\" remarks above are historical for routers older than that change, and OLD routers still ignore the key, so this list stays the only protection there. Five UnityMCP agents added in the same change: `t1k-unity-audio-developer`, `t1k-unity-base-mono-tester`, `t1k-unity-base-optimizer`, `t1k-unity-base-project-bootstrapper`, `t1k-unity-dots-core-validator` (all declare `routable: false` and use UnityMCP tools; they must stay native). An entry for an agent absent on a machine is inert. Pinned by tests/test-mr-agent-declared-native.sh. 2026-10-06: built-in `Plan` added (#696). It is architecture/planning judgment (its own description: 'considers architectural trade-offs'); measured 8 of 9 routed hops failed (5 ceiling kills) in the issue's 2026-08-10..09-24 window, and the sibling planner agent `t1k-planner` is already excluded for the same reason, so Plan stays on the native session tier (fallbackTier Plan->sonnet still applies if routing is ever re-enabled). `Explore` is deliberately NOT excluded: on this host 21 of 23 routed Explore hops since 2026-09-24 succeeded (the 57% failure figure predates the 2026-09-15 doomed-hop ceiling cut and the corrected modelMapping ids, so the `unrecognized_model` rejections no longer recur). 2026-10-08: `t1k-kit-developer` and `t1k-code-reviewer` REMOVED (owner decision Tu, 2026-10-08 'flip now, production brake only'; reverses part of #814 (kit-developer) and #816 (code-reviewer)). Evidence = eval smoke verdict plans/261003-route-more-pools/eval/reports/implementers/verdict-smoke.md (kit-developer 3/3 pass, routed model verified) and the P0 baseline p0-baseline.md. Rollback = revert PR. Production brake = rolling n>=40 routed exit-0 below 85% means revert the same day. The brief guards (skipped-claude-dir-brief, kit-policy-spawn-agent floor for agents still declaring Agent(...)) keep unsafe briefs native. 2026-11-10: `t1k-discord-triager` added (theonekit-core agent, core#6224). It is the quarantined reader of untrusted Discord text: `model: sonnet`, `routable: false`, Read/Grep/Glob only. It must never reach a cheap backend, since the point of the quarantine is that the one session that reads attacker-written text runs on the trusted native path. Pinned by tests/test-mr-sonnet-5-5-agents-excluded.sh.",
"_hopGitComment": "A routed hop COMMITS and (default ON) PUSHES its own checked-out topic branch. topicPush is ON by default (decision 2026-10-14); set topicPush:false to opt a machine back out, and the one-time migration marker hopGit._topicPushDefaultOnMigrated keeps that opt-out from being re-flipped. The SPAWNER-side parentPush is separate and still OPT-IN (default false): it needs parentPushAllowedRemotes (patterns like github.com/The1Studio/*) in the HOME config only; repo-local config is ignored for it. The spawner pins branch/origin/config at spawn, scans every commit, and pushes the scanned sha after an exit-0 hop when the brief orders a push. Never for a hop: merge, PR merge, force. See docs/mr-hop-shared-filesystem.md.",
"_laneWorktreeComment": "Lane-type routing P02 (plans/260927-lane-type-routing/phase-02-router-worktree-cwd.md): whether a brief's `worktree: <abs-path>` directive is honored as the hop's cwd at all. A brief with no such directive is completely unaffected either way — this key only gates what happens to a brief that DOES carry one. `enabled:false` (or the key/block absent) is the ROLLBACK lever: every lane goes native at the caller (theonekit-core lane-shape predicate reads router capability as code-presence AND this flag — see plan.md § Rollout), with NO key deletion required — a changed value rolls forward through the CLI's key-merge, a deleted key does not. `allowedRoots` empty/absent uses the studio-default pair (parent dir of the caller's own main-clone toplevel, plus the OS tmp dir) computed in mr-lane-worktree.cjs; a non-empty array REPLACES the defaults, it does not add to them.",
"_modelMappingComment": "REPOINTED 2026-09-25 (USER DECISION): sonnet/haiku now map to the hosted backend's deepseek-v4.1-flash (RENAMED 2026-09-28 from `cc-deepseek-v4.1-flash`; the id is the gateway's pooled one, so the backend label here names the route) — the same DeepSeek V4.1 Flash served through CCS — because the hosted backend's quota is exhausted (429 GoUsageLimitError on every deepseek id it carried that day). its deepseek-v4.1-flash stays enabled as failover hop 2. | REPOINTED 2026-09-24 (id correction): sonnet/haiku now map to `deepseek-v4.1-flash` — the id `deepseek-flash` never existed in the models.dev namespace the hosted backend draws on (the gateway silently resolved it to a V4.0-class model; see the model catalog's deepseek-v4.1-flash _comment). Any historical reference below to `deepseek-flash` as a routing target means the id that is now retired. | 2026-09-08: repointed the routing defaults off kimi-k2.6. That target is unusable fleet-wide, not just on one machine: ccs.the1studio.org returns \"You've reached your weekly (7-day) usage limit\" for the moonshot pool, which also accounts for the auth_unavailable 503s, the concurrent-request-limit 403s, and the flapping between them (a few credentials retain quota, most are spent). Router run-state 2026-09-08: 229 hops, 80.3% failed - 122x kimi-k2.7-code-highspeed, 62x kimi-k2.6. deepseek-v4-flash currently returns 400 MissingSessionID because CCS does not yet forward the upstream session header to Console Go (the header is named in model-capabilities.md); that fix is merged (The1Studio/ccs 86e54f8, PR #14) and waiting on a deploy (The1Studio/ccs#15), so this default self-heals when it lands, whereas kimi-k2.6 sits behind a quota window with no fix in flight. SCOPE NOTE: this changes ROUTING ONLY. The catalog entries stay enabled on purpose - kimi-k2.6 was the only enabled model declaring the 'vision' capability when this note was written, and disabling it then would have broken contract 21 (\"no enabled model offers capability 'vision'\") since every other vision-capable id is GPT-family, excluded by a standing operator constraint. SUPERSEDED 2026-09-11: deepseek-flash gained 'vision' from a live measurement and now heads capabilityPipes.vision, so contract 21 no longer depends on kimi-k2.6 - it remains enabled as the #2 vision backstop rather than as the sole contract-21 satisfier. REPOINTED 2026-09-10: model id swapped deepseek-v4-flash -> deepseek-flash (DeepSeek V4.1 Flash) per USER DECISION — same price/tier/capabilities, see the model catalog's deepseek-flash _comment for the full rationale. VERIFIED 2026-09-10: ccs.the1studio.org did not yet list deepseek-flash (400 rejection — unknown model deepseek-flash) while deepseek-v4-flash still returned 200 — the hop was CORRECT-BUT-PENDING until CCS on sv-2 added the id, with deepseek-v4-flash left enabled:false in the model catalog for rollback. RESOLVED 2026-09-11: the id is served (`mr-probe-backends.sh --tool-use --model deepseek-flash` -> PASS 1568ms; the per-label filter no longer exists on a flat catalog) and this hop is live; deepseek-v4-flash stays enabled:false as rollback only. REKEYED 2026-09-18: the KEYS moved from full ids (`claude-sonnet-4-6`, `claude-haiku-4-5-20251001`) to short tier names (`sonnet`, `haiku`); targets unchanged. mr-task-interceptor.cjs builds its lookup as [modelKey, SHORT_TO_FULL[modelKey], FULL_TO_SHORT[modelKey]], and the RAW modelKey is tried FIRST - every modelKey measured in 7 days of ~/.model-router/debug.jsonl is already a shorthand (sonnet 2192, opus 1821, haiku 311, fable 123, inherit 13), never a full id. So a shorthand key matches ahead of any versioned key and cannot go stale when a model bump moves SHORT_TO_FULL on. A full-id key was the fragile spelling: FULL_TO_SHORT is hand-authored and can only ever remember the spellings someone remembered to add, so a `claude-sonnet-5`-modelled agent on a host whose alias table lagged would miss the mapping entirely. Both forms still WORK (the alias candidates cover each other) - this is a forward-robustness change, not a fix for a live miss. SCOPE HONESTY: modelMapping decided only 48 of 2,046 routed spawns (2.3%) in 7 days on one machine (tier:budget 54.0%, rules:reasoning 15.2%, loadBalance:* 26.2%) - this is the LAST-RESORT fallback path, so it is a correctness/robustness fix, NOT a routing-coverage improvement. `opus`/`fable`/`inherit` keys are deliberately absent: those are premium-tier passthroughs that return BEFORE modelMapping is consulted.",
"_nativeInAutoModeComment": "#1044/#1117: when true (default), a Task spawned from a session in Claude Code's auto permission mode (hook input permission_mode == 'auto') runs NATIVE instead of routed. Auto mode's classifier can deny the proxy dispatch Bash call, which ends the spawn ROUTED FAILED with no work done. Default true (a key left unset behaves as true, #1117); set it to boolean false in ~/.claude/t1k-config-mr.json to keep routing in auto mode. Reason code: native-in-auto-mode.",
"_prefixStableHopsComment": "2026-09-25 (plans/260925-mr-cache-hit/decision-prefix-stable-hops.md, candidate a). PROBLEM: the hosted backend's prompt cache keys on the request PREFIX (tools -> system -> messages), and a routed hop's `--agents` JSON embeds the REAL agent's name/description/body in `system[2]` — a DIFFERENT agent therefore looks like a different prefix from turn 1, so every agent switch is a guaranteed cache MISS on that block (captured: 0% hit for a 2nd agent when the agent-specific text sits in system; moving it after messages[0] measured 90.1%). WHEN ON: every routed hop launches with a CONSTANT, byte-stable `--agent t1k-routed-hop --agents <fixed JSON>` pair (mr-delegate.sh ~2264-2317, constant at ~2311) so the CLI-visible agent identity never varies hop-to-hop, and the REAL agent's `.md` body is prepended to the hop's stdin prompt instead, as a `--- AGENT DEFINITION (<name>) ---` block ahead of MR_HOP_PREAMBLE (mr-delegate.sh ~6029) — moving the variable part from the cached prefix into the first user turn. `--agent t1k-routed-hop` is applied at EVERY CLI launch site (first attempt, in-hop retry/failover, and the resume/salvage path) via a single HOP_CLI_AGENT variable; MR_DELEGATE_AGENT (exported for hooks/telemetry/perAgentTimeoutSec/routedHopPermissionMode), --model, --max-turns, MODE and the allowed/disallowed tools lists are ALL keyed off the REAL agent name and are UNTOUCHED by this flag — only the CLI-visible `--agent`/`--agents` identity and the prompt-prefix placement of the agent body move. KNOWN EXCEPTION (accepted): an agent declaring `mcp__*` tools still gets `--mcp-config` with its own real server list, so it forms a second, smaller prefix class among MCP-granted agents — captured tool-definition arrays are already agent-invariant otherwise (13-item MR_HOP_DISALLOWED_TOOLS is a constant). DEFAULT TRUE since 2026-09-25 — flipped by explicit user decision AHEAD of the 7-day window below, on a maintainer-machine canary whose flag-ON trace rows span only ~2.5h (12:39Z-15:08Z; the trace field landed 12:02Z in #729): deepseek-v4.1-flash on the hosted backend, n=40 hops at decision time — per-request 97.0%, token-weighted 97.3%, turn-1 median 74.0% (n=42), routed success 95.2% vs 94.5% prior 7d; no abort line tripped. EVIDENCE SCOPE: every measured flag-ON hop ran deepseek-v4.1-flash; the flag also applies to every backend the pipe can reach (the glm-5.3 failover hop, in-hop failover at every launch site) with NO measurement there — accepted by the same user decision. SIDE EFFECT: hooks inside a hop now see payload `agent_type: \"t1k-routed-hop\"` (Claude Code sets it from `--agent`); parent-side trace/telemetry/timeouts/write-guard stay keyed on the real agent via MR_DELEGATE_AGENT. The ABORT/ROLLBACK lines below still bind: if any trips, set this back to false. The original flip criteria, kept for the record: flip to true only once BOTH hold: (a) a maintainer-machine canary of >= 40 routed hops over >= 7 days shows `mr-cache-report.cjs --since 7d --backend ccs` per-request AND token-weighted cache-hit both >= 97% (the goal metrics) with turn-1 token-cache-hit ratio >= 70% (median, secondary; baseline 38.6%; the earlier >= 85% came from a synthetic-body probe and is not a structural ceiling, since turn-1 ~= shared/(shared + agent body + preamble + task): Fable review of PR #726), AND (b) routed verified-success rate stays within 3 points of the prior 7-day baseline over the same canary window. ABORT/ROLLBACK (keep or revert to false): turn-1 median < 50% after 20 hops (no clear lift over the 38.6% baseline) (the prefix still differs somewhere — recapture with analyze.cjs before re-attempting), OR verified-success drops >= 5 points, OR any hop is observed ignoring the role stated only in its first user turn (mr-hop-write-guard.cjs warn rate rising is the leading indicator, since a hop that loses its role also loses its write-contract discipline). Read via `_cfg_read '.modelRouter.prefixStableHops'` (mr-delegate.sh ~2287) — a missing/malformed value reads as empty/non-\"true\" and behaves as false, so an unreadable config can never silently turn this on.",
"_requireContractComment": "Whether routableWriteAgents membership ALONE is enough to route (false), or whether the hop additionally needs a validated micro-task contract — a `contract:` line resolving to a readable, ≤2000-char file whose budget.maxTurns is 1..40 AND which core's t1k-contract.cjs validate passes (true, shipped default). Missing/unreachable core validator script ⇒ fail CLOSED (never route on an unverifiable contract), reason skipped-contract-validator-missing.",
"_rolesComment": "Purpose roles (2026-10-08, plans/261008-*-router-roles contract.md sections 1-2 and addendum A1.1). Consumed by .claude/scripts/mr-role.cjs (resolve/call) and mr-imagine.sh (role image first). mode unset|explicit|auto; an explicit role is an ordered {model, params?} chain (the catalog is flat since 2026-10-21, so a chain entry names only a model; the retired backend label is an optional informational field), index 0 first, each next entry the retry fallback; optional per role: retry {attemptsPerModel 1-5, backoffMs 0-60000}, timeoutSec 1-300, maxBytes up to 20971520, and on an explicit entry instruction (prepended to the prompt), expect (an answer not matching is a failed try) and extract (one capture group = the printed answer); expect/extract see the first 16 KiB of an answer under a 1000 ms limit. Every chain model must be an ENABLED, non-superseded catalog model carrying the role capability (mr-validate-roles.cjs, run by tests/test-mr-roles.sh; mr-role.cjs enforces the enabled/auth/OpenAI parts again at call time). CATALOG PRUNED 2026-10-22 to exactly TWO models, deepseek-v4.1-flash and glm-5.3-flash. CONSEQUENCE, deliberate and stated: image, web, audio and dictation are `unset` because this catalog ships NO model carrying image-generation, web-search or audio, and no OpenAI-owned model at all. Those four modalities are therefore UNSUPPORTED in this catalog by design, not by omission: image generation, live web search, audio analysis and dictation all resolve to a clean exit 2 (`role X is unset and has no auto-selection`). Video survives on glm-5.3-flash; vision survives on deepseek-v4.1-flash. Re-enable a modality by re-adding a model that carries its capability to the model catalog and restoring this role to explicit. OpenAI-owned models (catalog ownedBy openai) may be named ONLY by web and image, an identity pin enforced by the validator and again by mr-role.cjs at call time; never re-pin it. With no OpenAI-owned model in this pruned catalog that half of the pin is INVERTED, not dropped: mr-validate-roles.cjs requires web and image to be `mode: unset` and fails them if they are left explicit, so the unsupported state cannot be papered over by a dangling chain. judge is defined but not consumed yet.",
"_routableWriteAgentsComment": "P16 pilot escape hatch (token-cost program lane C, `plans/260922-token-cost-program/phase-16-mr-lane-c-routable-write-agents.md`) for the NAME-based writeAgentFloor clause ('developer-suffix') that only bites at writeAgentFloor:\"named-agents\" (KIT_PASSTHROUGH_AGENTS, i.e. t1k-git-manager, is a hard floor at every scope and never pilot-eligible) — inert unless you set writeAgentFloor:\"named-agents\" (this file ships \"all\": every write-capable agent stays native, and the pilot only applies at \"named-agents\"). USER DECISION: developer agents route only inside a pilot — this list is EMPTY by default and adds no agent; a consumer opts one in by name only after switching writeAgentFloor to \"named-agents\". Listing an agent is necessary but not sufficient: requireContract (below) still gates whether membership alone is enough to route. A contract naming any `.claude/**` path in allowed_files never routes regardless of this list or requireContract — mr-hop-write-guard.cjs (P15) denies those writes unconditionally.",
"_routeTargetComment": "Where a spawn the router WOULD have routed to a CCS backend goes. \"ccs\" (default) = today's behaviour, byte-identical. \"haiku-high\" = do not route; the spawn runs NATIVE on Haiku at HIGH effort (the hook sets updatedInput.model=haiku and updatedInput.effort=high; debug.jsonl row decision `route-target-haiku-high`, recorded as native, never as a routed CCS model). Scope: ONLY would-have-routed spawns — opus/fable floors, inherit agents, excludeAgents, proxy/auto-mode passthroughs and every other native decision are untouched; this key never pierces a floor. Env MR_ROUTE_TARGET wins over this key (one-session tests). An invalid value is rejected on stderr (names the key and the value) and falls back to \"ccs\". Does not change `enabled` or `mode`. Rollback: set back to \"ccs\". Docs: docs/architecture.md § Route target.",
"_routedHopPermissionModeComment": "2026-09-14 (#491): `t1k-hooks-manager` and `t1k-rsi-reviewer` added. Both declare `mr-permissionMode: bypassPermissions` in their own frontmatter (theonekit-core) and were missing here, so `mr-delegate.sh` declined to escalate on EVERY hop — `[mr] agent '<name>' declares mr-permissionMode=bypassPermissions but modelRouter.routedHopPermissionMode does not name it; not escalating` — landing the hop in `acceptEdits`, where Claude Code's protected-path check DENIES every write under the invoking project's `.claude/`. That is precisely the write these two agents exist to make, so the deliverable could not land and the only diagnostic was a stderr line inside the hop, which nobody sees. THEY ARE THE SAME CLASS OF KIT-AUTHORING AGENT AS THE FOUR ABOVE: this map is keyed by the EXACT `subagent_type` string (a near-miss is inert, not a partial match) and the four already-granted entries are all maintainer agents whose product is a `.claude/` file. `t1k-hooks-manager` writes `.claude/hooks/*.cjs` plus their settings.json registration and module.json claim (`orchestration-rules.md` routes hook authoring to it) — measured 2026-09-14: 12 of its 25 routed hops were denied writes under `.claude/`, and since 09-12 all 15 of its hops ran `acceptEdits` with 8 ending 'apply from a session with write permission'. `t1k-rsi-reviewer`'s whole deliverable is creator-artifact edits — `skills/<name>/references/validation-checklist.md` under `.claude/` (`skills/t1k-rule-creator/references/validation-checklist.md` § \"RSI — propagate a fix to the creator\") — which is the exact path class the denial covers; filed as theonekit-model-router#491. NEITHER ENTRY CHANGES A MODEL CHOICE. Escalation is a permission MODE, not a routing decision: it is consulted inside mr-delegate.sh, which only runs at all after the interceptor has already decided to route, so adding a key here cannot route an agent that was not being routed. The one asymmetry worth stating rather than leaving to be discovered: `t1k-rsi-reviewer` declares `model: opus`, and the interceptor's premium-tier family floor (`PREMIUM_FAMILY_PREFIXES = ['opus','fable']`, `isPremiumFamily()`, mr-task-interceptor.cjs) passes any premium-family agent through BEFORE `modelMapping` is consulted — so on the interceptor path this reviewer stays on Anthropic and this key is a NO-OP, not a grant of cheap-model execution. It is present anyway for the same reason the other five are: the frontmatter declares the opt-in, and `mr-delegate.sh` is ALSO reachable directly (the `t1k-model-router-proxy` pipe, mr-proxy-run.cjs, and the documented `mr-delegate.sh <agent> <task>` form in this kit's SKILL.md) — a path that runs this script with no premium-tier floor of its own. A grant that is inert under the floor and required the moment a sanctioned path bypasses it is correct on both paths; dropping the key because the floor currently shadows it is what makes the next rsi-reviewer hop silently unable to write. GUARDS UNCHANGED AND NOT RELAXED: read-only built-ins, no-write-tool agents and plan-mode agents are still refused and WARNed by name (mr-delegate.sh:2212-2229); both agents here declare Write/Edit and are not read-only. THE GATE THAT KEEPS THIS FROM DRIFTING AGAIN is tests/test-mr-routed-hop-permission-allowlist.sh, which asserts BOTH directions (every declaring agent is named here or in that file's explicitly-reasoned EXEMPT_LIST, and every key here names an agent that exists and declares the frontmatter), plus that every value is the literal `bypassPermissions`. The two pre-existing escalation tests build synthetic agents under a fake $HOME, so a real drift between these two shipped sides passed CI silently — which is how this shipped. The declaration side is pinned in tests/fixtures/routed-hop-permission-declaring-agents.txt because those agent definitions live in theonekit-core, not here: ADDING A DECLARING AGENT IS THREE EDITS IN ONE COMMIT (its frontmatter, that fixture, this map). 2026-09-28: `t1k-lane-worker` added — its frontmatter (theonekit-core) declares `mr-permissionMode: bypassPermissions` (it holds a caller-created worktree and writes `.claude/` there) and was missing here, tripped by this file's own live arm re-deriving the declaration set from a resolvable core checkout. Same asymmetry as `t1k-rsi-reviewer` above: `t1k-lane-worker` is ALSO in `modelRouter.excludeAgents` (added the same day, for an unrelated reason — a routed hop cannot hold a worktree), so on the `mr-task-interceptor.cjs` path this key is presently a NO-OP, shadowed before `mr-delegate.sh` is ever reached. It is still required: `excludeAgents` is an INTERCEPTOR-ONLY check (`grep -c excludeAgents .claude/scripts/mr-delegate.sh` is 0) — the direct `mr-delegate.sh <agent> <task>` CLI form and the `t1k-model-router-proxy` pipe both call `mr-delegate.sh` directly and are not gated by it, so a lane-worker hop launched either way still needs the escalation to write under the invoking project's `.claude/`.",
"_routingComment": "routing.leafContext gates whether a routed hop for an omitClaudeMd:true agent gets the reduced leaf-kernel context (--settings managed-only + autoMemory off + t1k-leaf-kernel appended system prompt) instead of the full CLAUDE.md/rules/skills boot. Shipped default is kernel (phase 3 of plans/261028-router-hop-efficiency, after the 2026-10-29 replay measurement, reports/p25-measurement.md, and the P13 leaf eval, reports/p3-leaf-eval.md): the flip is inert for an agent without omitClaudeMd:true, and only agents with a measured SHIP verdict carry the flag. The runtime breaker still forces full for the rest of a delegation when a kernel hop's hooks do not fire ([mr:hooks-silent]). A user who wants the old behavior sets routing.leafContext to full in their own config.",
"_writeAgentFloorComment": "2026-10-28 (owner decision): ships \"all\" - a write-capable sub-agent (declared Write/Edit/MultiEdit/NotebookEdit tools, or a *-developer name) is NOT routed to a cheap backend; it runs natively. To let the router edit and write, set modelRouter.writeAgentFloor to \"premium-only\" in your project or user t1k-config-mr.json (that routes sonnet/haiku write agents again, as before this change). \"named-agents\" floors only the name-based clauses. Opus/fable/inherit agents and excludeAgents members are unaffected either way. Rollback of the default = revert the PR.",
"_writeAgentNativeModelComment": "2026-10-28: the Anthropic model a write-capable agent is PINNED to when writeAgentFloor keeps it native (without a pin it would inherit the session model, usually Opus). \"haiku\" or \"sonnet\" pins the spawn through updatedInput.model (the Agent tool model parameter overrides the agent frontmatter); \"off\" keeps each agent's own model. Absent key = no pin. An unrecognised value pins nothing and logs a stderr line plus nativeModelPinRejected on the decision row. Not applied to excludeAgents members, to opus/fable/inherit agents, or to a spawn whose caller already passed a model. The decision row carries nativeModelPin when a pin was applied.",
"backgroundDelivery": "proxy",
"briefSizeAdvisory": {
"_ciWaitPatternsComment": "Case-insensitive SUBSTRING match against the brief, with TWO suppressions applied by findCiWaitMatch() in scripts/mr-defaults.cjs. A match means the brief is asking the hop to wait on external state, which the hop-sizing contract assigns to the SPAWNER (via a t1k-ci-watcher hop) — the measured waste is a hop killed at its ceiling after its PR had already merged. (1) NEGATED: a match is ignored when a negation token (not|never|no|don't|dont|do not|without|avoid|stop, word-boundary) appears earlier in the SAME clause — clause = text after the last . ; : ! ? or newline before the match. A bare substring test fired on core's own t1k-sync-back sub-agent template, whose step 7 says \"do not watch CI\" while citing babysit-until-merged.md, so every sync-back spawn false-triggered and block mode denied them all. (2) IDENTIFIER: a match is ignored when the character directly before or after it is - _ / or .+letter — t1k-babysit-pr (a skill name) and babysit-until-merged.md (a path) are not instructions to babysit. Not exhaustive by design: it catches the phrasings observed in the sampled failures, and a new phrasing is a one-line addition here rather than a code change.",
"_comment": "Spawn-time ADVICE for the SPAWNER, not an enforcement gate: a routed hop's failure rate is overwhelmingly a function of the size of the brief it was written, and the measured curve is steep — over 7 days to 2026-09-11 (1,224 routed hops, unit = hop): by turns <20: 4.8% | 20-39: 8.2% | 40-59: 22% | 60-99: 47% | 100-149: 70% | >=150: 93%; by brief length (non-Explore) <1.5K chars: 2.7% | 3-5K: 27% | 5-8K: 33%; by files edited 0: 11% | 1-2: 14% | 3-5: 38% | 6-10: 52%. In a 12h sample 7 of 10 failed hops bundled CI babysitting (3 PRs had already MERGED when the hop was killed) and 4 of 10 bundled 4-10 deliverables — all 14 sampled briefs were written by a MAIN session. mr-task-interceptor.cjs measures the brief the caller wrote (excluding any router-added preamble) and annotates the routed banner with ONE [t1k:mr-brief-size] line, plus a debug.jsonl row decision=\"brief-size-advisory\" carrying {agent, briefChars, triggers:[chars|ci-wait], mode}. mode is a deliberate ratchet: 'warn' (shipped) routes normally, 'block' denies BEFORE routing with split guidance. Ratchet condition in _ratchetComment — flip to 'block' only after reviewing the warn rows.",
"_exemptAgentsComment": "Exempts an agent from the CI-WAIT trigger ONLY, because a hop whose ASSIGNED task is watching state is asking for the right thing (contract rule 5). Deliberately NOT exempt from the size trigger: 'one deliverable per brief' binds t1k-ci-watcher as much as any other hop, and its own task is already one deliverable.",
"_ratchetComment": "warn-first 2026-09-11; review advisory rows and flip mode to block on/after 2026-10-11 if false positives are low. RE-MEASURED 2026-09-12 (the review is DUE, not pending — see _ratchetEvidenceComment): the promotion question was unanswerable until briefChars landed on every debug row, and the brief-length signal it would have promoted on does not predict failure. Read _ratchetEvidenceComment BEFORE flipping mode; the honest options are to move this date forward with a stated reason, or to promote on a signal that separates (turns/deliverable-count), not on chars.",
"_ratchetEvidenceComment": "WHAT THE PROMOTION DECISION WOULD BE MADE ON, measured 2026-09-12 against ~/.model-router/debug.jsonl. (a) COMPUTABILITY — until this change the ratchet condition had no denominator: promptChars existed on 2,275 rows, all decision=\"route\", and on 0 of the 2,288 rows across pass-all-backends-failed (1,945) / pass-non-backend-failure (343) / pass-kit-policy / pass-unknown-agent. Every failure class the gate predicts was unmeasurable against it, so 'review the advisory rows' could only ever be answered by rows that had already succeeded. briefChars is now written on every row. (b) DISCRIMINATION — with the join restored, brief length barely separates: on route rows (2,168 ok / 107 failed) median briefChars is 2,561 for SUCCESS and 2,725 for FAILURE, and the fail rate is flat across the middle of the distribution (1.5% / 5.2% / 4.0% / 4.8% / 3.9% for 0-1K / 1-2K / 2-3K / 3-4K / 4-5K). Only the top bucket separates, and it is too thin to gate on: >8K chars is 9 hops / 2 failed. The shipped 4000-char limit sits at the 80th percentile — 20% of ALL hops, including most successful ones. (c) THE SIGNAL THAT DOES SEPARATE is turns, which is measured AFTER the hop, not in the brief: 40-60 turns 66.7% fail, 100-150 turns 25%, 150+ 9.1% (n = 52 joined hops with a real exit code). This is why the promotion is deliberately NOT made: promoting on chars would refuse 20% of hops without evidence of benefit. Brief length is a weak predictor of failure, and the honest conclusion is to gate on the better signal (deliverable count, or a turns ceiling) rather than the convenient one.",
"ciWaitPatterns": [
"babysit",
"watch ci",
"gh pr checks --watch",
"wait for ci",
"until merged",
"wait for the release"
],
"enabled": true,
"exemptAgents": [
"t1k-ci-watcher"
],
"lane": {
"_comment": "SSOT: docs/mr-lane-brief-gate.md. P04 router half (theonekit-core plans/261005-routed-parallel-lanes/phase-04-lane-decomposition-rules.md, Mechanism item 2). A brief that carries a lane `worktree:` directive (a routed LANE brief) is judged on its CONTRACT FIELDS, never on chars: contract.allowed_files count. An oversize lane is DENIED before routing (clean permissionDecision:deny, never a crash) with split guidance: split into sequenced or disjoint sub-lanes, NEVER spawn native by reflex, and the message names each violated rule. Full rollout, no warn phase (Core Requirement 13). KILL SWITCH: set mode to \"warn\" (annotate on the routed banner, route anyway); a deleted key does not roll back through the CLI key-merge, so a revert ships \"warn\" explicitly. REMOVED 2026-10-20: the maxTurns and requireTurnBudget dimensions, together with the router's turn caps — a routed hop has no turn budget, so a contract field sizing one constrained nothing, and an absent `contract.budget.maxTurns` is no longer a finding. maxAllowedFiles MIRRORS theonekit-core's `laneRouting.limits` in t1k-config-core.json (tests/test-mr-lane-brief-size-block.sh asserts equality whenever a core checkout or install is reachable); change both together. A lane brief (one with a VALID `worktree:` directive) MUST carry EXACTLY ONE exact `contract:` line (core's countDirectiveLines grammar; routed lanes require a contract file). It is DENIED, cause named, when the directive is ABSENT, appears 2+ times, or a line LOOKS like one but is not exact (`Contract:`, `- contract: f`, fullwidth `contract: f`, a bare `contract:`; a mid-sentence `the contract: f` is prose and ignored), or when the file cannot be resolved, opened (one fd, O_NONBLOCK/O_NOFOLLOW where available), is not a regular file, is not JSON, or exceeds 2048 chars (bounded read; no length is ever echoed). A JSON null/scalar/array contract is judged as {} (zero files), like core. The path echoed in a deny reason is JSON-quoted with control characters stripped and `[` neutralised. THIS BLOCK IS READ FROM THE PASSWD-HOME CONFIG ONLY (os.userInfo().homedir/.claude/t1k-config-mr.json, never the HOME env var), never from a project config (the repo under work is untrusted; core never consults project scope for laneRouting.limits), and is governed by `mode` alone, independent of briefSizeAdvisory.enabled. Only the string \"warn\" is the kill switch: any other non-block mode value, and any limit that is not a positive integer, is rejected (strict default used, `lane-limit-invalid` row + stderr name the key). Non-lane briefs are unchanged by this block. Resolver: scripts/mr-defaults.cjs resolveLaneBriefLimits / judgeLaneContract.",
"maxAllowedFiles": 2,
"mode": "block"
},
"maxBriefChars": 4000,
"mode": "warn",
"targetTurns": 80
},
"cacheCollapse": {
"_comment": "Prompt-cache COLLAPSE guard (scripts/mr-cache-collapse.cjs; mr-doctor.sh check 11c + SessionStart banner line). A backend/model group is COLLAPSED when its RECENT window (recentWindowHours) has >= minHops hops and >= minPromptTokens prompt tokens at a token-weighted cache ratio < collapseBelow, AND the group's own prior baseline (the baselineWindowHours before the recent window) cached at >= baselineAbove over >= baselineMinHops hops / >= baselineMinPromptTokens tokens. A group that never cached has no baseline and is never COLLAPSED; a thin sample is INSUFFICIENT-DATA, never OK. Detection only: this never reroutes, disables a backend, or touches selection/failover. baselineWindowHours is 168 (7d) on purpose: with a 24h baseline a collapse lasting longer than a day fills the whole baseline with low slices, the group reads as never-cached, and the FAIL silently turns green. Absent keys fall back to mr-defaults.cjs resolveCacheCollapse().",
"baselineAbove": 0.8,
"baselineMinHops": 8,
"baselineMinPromptTokens": 200000,
"baselineWindowHours": 168,
"collapseBelow": 0.2,
"enabled": true,
"minHops": 8,
"minPromptTokens": 200000,
"recentWindowHours": 2,
"verify": {
"_comment": "scripts/mr-cache-verify.cjs: one streamed-twice-then-non-streamed probe (unique-nonce prefix of ~prefixTokens tokens, same endpoint/credential/session key as a hop) that tells a REPORTED collapse apart from a real one. HEALTHY when the 2nd streamed send reports cacheRead >= healthyAtLeast of its prompt; REPORTING-DEFECT when streamed reports none on both sends and non-streamed reports >= defectNonStreamAtLeast (ccs-gateway#47); REAL-LOSS when non-streamed is < realLossBelow; anything else UNKNOWN. mr-doctor.sh 11c runs it on COLLAPSED; the banner shows the recorded verdict only while it is younger than freshHours.",
"defectNonStreamAtLeast": 0.5,
"freshHours": 2,
"healthyAtLeast": 0.5,
"model": "deepseek-v4.1-flash",
"prefixTokens": 3000,
"realLossBelow": 0.1,
"timeoutMs": 15000
}
},
"contextGrowthAgents": [],
"defaultBuiltInModel": "sonnet",
"disableUnderAnthropicProxy": true,
"enabled": true,
"excludeAgents": [
"claude-code-guide",
"claude",
"Plan",
"t1k-lane-worker",
"t1k-git-manager",
"t1k-routing-gap-fixer",
"t1k-routing-gap-remediator",
"t1k-debugger",
"t1k-hard-coder",
"t1k-tree-leaf",
"t1k-tree-node",
"t1k-unity-dots-core-compile-doctor",
"t1k-unity-dots-core-implementer",
"t1k-unity-dots-core-tester",
"t1k-unity-dots-core-optimizer",
"t1k-unity-dots-core-debugger",
"t1k-unity-developer",
"t1k-unity-base-developer",
"t1k-cocos-debugger",
"t1k-rn-base-debugger",
"t1k-blender-base-3d-artist",
"t1k-art-base-3d-artist",
"t1k-art-base-2d-artist",
"t1k-planner",
"t1k-review-synthesizer",
"t1k-researcher",
"t1k-rsi-reviewer",
"t1k-brainstormer",
"t1k-project-manager",
"t1k-unity-base-visual-director",
"t1k-unity-brainstormer",
"t1k-unity-base-brainstormer",
"t1k-unity-ui-developer",
"t1k-unity-base-ui-developer",
"t1k-unity-dots-core-environment",
"t1k-unity-dots-core-reviewer",
"t1k-unity-dots-core-shader",
"t1k-unity-rendering-feel-developer",
"t1k-cocos-brainstormer",
"t1k-cocos-reviewer",
"t1k-cocos-pla-retrofit-reviewer",
"t1k-cocos-stdlib-contributor",
"t1k-cocos-visual-director",
"t1k-designer-audio-composer",
"t1k-designer-brainstormer",
"t1k-designer-base-brainstormer",
"t1k-designer-game-designer",
"t1k-designer-base-game-designer",
"t1k-designer-game-producer",
"t1k-designer-base-game-producer",
"t1k-rn-base-reviewer",
"t1k-web-core-visual-director",
"t1k-business-base-legal-advisor",
"t1k-unity-audio-developer",
"t1k-unity-base-mono-tester",
"t1k-unity-base-optimizer",
"t1k-unity-base-project-bootstrapper",
"t1k-unity-dots-core-validator",
"t1k-unity-base-lane-lead",
"t1k-unity-base-parity-porter",
"t1k-unity-base-pr-reviewer",
"t1k-art-audio-artist",
"t1k-art-store-artist",
"t1k-art-video-artist",
"t1k-discord-triager"
],
"failover": {
"_agentPipesComment": "2026-10-12 (USER DECISION): per-agent pipe override. Key = the EXACT subagent_type string (same convention as perAgentTimeoutSec); value = ordered [{model[, standby]}] hops tried FIRST for that agent, then every `pipe` hop above not already listed (so the global hops still back it up). An agent with NO entry here routes exactly as before. Health / stall / hop allowance / circuit-breaker / fallbackToAnthropic are unchanged. A malformed entry or a backend/model absent from the model catalog is a loud error naming the key (interceptor: passthrough to Anthropic native; mr-delegate.sh: exit 2) -- never a silent fallback to the global pipe. Keys starting with `_` are comments. Only the first NON-standby hop is the interceptor's pick; an explicit per-spawn model override still wins over it. Shipped row: security reviews try glm/glm-5.3 first (auth is the same CCS gh-token as every hop, no extra key). NOTE 2026-10-20: glm/glm-5.3 is NO LONGER in the global pipe above — the pipe was reduced to a single hosted-backend hop, so this row is now the only thing keeping glm in the routing picture, and it RAISES the worst-case hop budget by one (tests/test-mr-agent-pipes.sh pins that). Consumers may add rows; `t1k modules update` key-merges this object. | 2026-10-22: the catalog was pruned to two models and the shipped row now names the SURVIVING glm id, glm-5.3-flash (the deleted glm-5.3 would have made this row a loud config error on every security review). The global pipe is a single deepseek-v4.1-flash hop, so this row is still the only thing routing a security review to glm. | 2026-10-22b: the row's retired backend-label field was REMOVED — the catalog is flat, so it selected nothing and was the last leftover of the deleted label dimension; both hop shapes and the flat-catalog rejection are documented in scripts/mr-defaults.cjs (section 'Per-agent pipe override').",
"_comment": null,
"_pipeComment": "2026-10-23 USER DECISION: the router has no backend-label dimension (flat catalog, one CCS gateway). The pipe is two hops in ORDER: hop 1 deepseek-v4.1-flash is THE PICK for every agent on the default selector path (selectionSource tier:*, e.g. built-in Explore, general-purpose, statusline-setup) - pipe order is authoritative there, not cheapest-tier or observed latency (both deleted) - and hop 2 glm-5.3-flash is the failover hop. capabilityPipes (vision, long-context) and the long-context / quality-driven sorts still outrank pipe order for tasks that require those capabilities. History: reduced 4 -> 1 hop on 2026-10-20; widened to 2 hops on 2026-10-23. The stall watchdog arms only when a failover target exists (_mr_has_failover_target in mr-delegate.sh): with failover.fallbackToAnthropic=true that is the case even on a one-hop pipe (the Anthropic fallback is the target), and with this 2-hop pipe it arms regardless. Stall thresholds are global only (stallWatchdog.thresholdSec 300 sync / backgroundThresholdSec 600 of no new assistant turn); there is no per-backend override. The hook timeout floor is the single SSOT HOOK_TIMEOUT_FLOOR_SEC (86400) in mr-defaults.cjs and no longer scales with the pipe length; re-run mr-validate-hook-timeout.cjs after any change here.",
"_resumeOnErrorComment": "Added 2026-10-04 (failure-tax P2, plans/261003-router-failure-tax/phase-02-resume-on-transient-error.md). A hop that fails LATE used to be re-launched from the START with a fresh session, discarding its progress: calls.jsonl rows status:rate-limit-retry (2026-09-26..10-03) had 25 retried calls with first-attempt work p50 655s, p90 1416s (24 of 25 had >60s, 18 had >600s), 7.5h of wall discarded; 57 api_error hop attempts (18.5h) were late 524/5xx/reset after 126..418 real turns in 11 of 11 sampled. Now, in the background (MR_PROXY_NO_WALL=1) attempt loop, when the hop has completed at least minTurns model turns (distinct assistant message.id from the transcript), the retry after a rate limit / truncated stream, and a NEW retry after a late 5xx/524/reset classified only on the hop error text (stderr tail plus the envelope .result when is_error is true, never the raw envelope), is a --resume of the SAME session instead of a fresh launch. maxResumes bounds the resumes per hop; a numeric 0 disables the feature (it is a count, not a flag). A failed resume falls into the unchanged failover path. MEASURED BASIS (spike S2, tests/spike-s2/, real claude 2.1.289 against a local stub gateway, one fault per run injected at turn 22/25/28 of a 30-step task with a non-idempotent echo >> counter.txt step): 524 and 429 each 3 of 3 resumes finished with an exact line count (30 of 30), resume leg appended to the SAME session transcript file with the same session id. NOT measured: a real model repeating a step after the resume (the stub is an obedient scripted model; the resume prompt forbids a repeat by wording only), resume re-read cost against a real backend. SSOT: mr-defaults.cjs RESUME_ON_ERROR_MIN_TURNS / RESUME_ON_ERROR_MAX_RESUMES / resolveResumeOnError(); mr-validate-timeout-ssot.cjs gates this shipped pair and the mr-delegate.sh mr-ssot:resumeOnErrorMinTurns / mr-ssot:resumeOnErrorMaxResumes markers agree with it.",
"_turnsSalvageComment": "Added 2026-09-28 (#P10, plans/260927-tree-default-on-routing-quality/phase-10-router-turns-salvage.md, depends on the P09 report in the same dir). A `--max-turns` exhaustion is NOT a kill — the CLI exits gracefully (exit 1, never 124) with a complete envelope already on disk (P09 Q5) — so the #399/#kill-salvage resume above (gated on HOP_EXIT -eq 124) never reaches it. P09 measured 40% (6/15) of a 24h sample left real, partly-committed work behind (up to 91 Edit calls, 6 git commits in a single exhausted hop) with no recovery mechanism, at $116/24h in thrown-away hop cost. On exhaustion, mr-delegate.sh now resumes the SAME session ONCE for wrapUpTurns turns, asking it to commit what is complete and report DONE/REMAINING/next-step rather than restart from scratch. enabled:true is a net improvement, not a pilot: an unpromoted wrap-up (empty/killed) is provably no worse than today — HOP_EXIT is only promoted away from the exhaustion when the wrap-up returns a real, non-error report at least RESUME_SALVAGE_MIN_CHARS long (the same floor #kill-salvage already uses), so the existing Anthropic-fallback path is untouched whenever the wrap-up yields nothing. wrapUpTurns=15 is deliberately far larger than the kill-salvage's 2-turn report ask: unlike a ceiling kill (nothing more CAN happen once the wall clock stops it), a turns-exhausted hop can still act — git add/git commit — before describing what remains, and 15 turns budgets for that housekeeping plus the report. Scoped to a TURNS exhaustion only, never BUDGET: a --max-budget-usd exhaustion means the dollar allowance is gone, and a further resume only spends more of it for the same shortfall. SSOT: mr-defaults.cjs TURNS_SALVAGE_WRAP_UP_TURNS / resolveTurnsSalvage() — mr-validate-timeout-ssot.cjs gates this shipped wrapUpTurns value and the mr-delegate.sh mr-ssot:turnsSalvageWrapUpTurns marker both agree with it. BUDGET: zero cost to computeOuterBudgetSec / the registered mr-task-interceptor timeout — the wrap-up resume reuses the IDENTICAL resumeCeilingSec(perHopSec) ceiling sizing (mr-ssot:resumeCeilingDivisor 3) the #399 kill-resume already reserves one slot for per hop, and the two can never both fire on the same hop (mutually exclusive on HOP_EXIT: 124 vs a graceful non-zero exit), so the existing resumeSec term in the formula already covers whichever one actually runs.",
"_turnsSalvageReportOnlyComment": "Added 2026-10-04 (failure-tax P3, theonekit-core repo plans/261003-router-failure-tax phase 3). When the wrap-up resume above ends empty or killed (the hop kept WORKING for all wrapUpTurns turns and never wrote a report; 41 of 316 wrap-ups since 2026-09-28) and the session holds at least one completed tool_result, ONE more resume runs that can only emit text: --max-turns reportOnly.turns, built-in tools disabled (--tools \"\"), an empty MCP config, an empty --allowedTools. Its output is promoted ONLY as a degraded PARTIAL ([mr:wrapup-partial]) when it is non-error, at least RESUME_SALVAGE_MIN_CHARS long, contains the heading `SPLIT PROPOSAL:`, and the lines the leg appended to the transcript hold zero tool_use blocks (num_turns is not used); otherwise exit 42 stands exactly as before. reportOnly.turns: 0 is the documented numeric zero that disables the pass; ceilingSec bounds the one leg (one cache-hit turn plus a short answer). turnsSalvage.enabled:false disables the wrap-up AND this pass. SSOT: mr-defaults.cjs TURNS_SALVAGE_REPORT_ONLY_TURNS / TURNS_SALVAGE_REPORT_ONLY_CEILING_SEC; mr-validate-timeout-ssot.cjs gates the shipped values and the bash mirrors.",
"agentPipes": {},
"chain": {
"_comment": "Deprecated legacy 2-hop derivation (mr-delegate.sh _build_pipe_hops) — consulted ONLY when failover.pipe is absent or empty, which it never is. EMPTIED 2026-10-20 rather than repointed: the entries were a mutual fallback between the retired route label and codex and neither is a failover target any more. Kept as an empty object so _chain_lookup_node() finds a shape it recognises instead of taking the absent-key path."
},
"circuitBreaker": {
"_comment": "RETUNED 2026-08-29 for a SINGLE-TARGET pool (3/300/5 -> 10/60/1). On a one-target pool with fallbackToAnthropic:true both branches end in the same place: breaker OPEN skips without probe -> pipe exhausted -> exit 42 -> Anthropic; breaker CLOSED but backend dead -> probe fails -> hop skipped -> exit 42 -> Anthropic. So the breaker's only benefit here is LATENCY, while its only cost - a false open skipping a HEALTHY backend - is entirely tokens, which is the whole point of the router. Kept enabled (not disabled) because a HUNG backend still costs perHopTimeoutSec=600s per request and nothing else caps that. failureThreshold 10: three false-open mechanisms exist and all are cheap to trigger - the liveness probe alone charges the breaker before any model call (mr-delegate.sh:2901), a 429 counts as a backend failure via BACKEND_FAILURE_RE (:1527) even though CCS shares ONE 5-hour quota across backends so a 429 is a rate limit not a dead backend, and consecutiveFailures HAD no decay window so three failures hours apart still tripped it. 10 makes a trip mean sustained outage. cooldownSec 60: on a one-target pool the cooldown is a pure token-loss window and retrying costs one probe, so cap the false-open blast radius at 60s not 300s. maxHalfOpenTrials 1: measured 88 of 578 breaker-skip lines (15%) were 'open:trial-in-flight' - requests skipped not because the target was known bad but because siblings held all 5 trial slots. One canary removes that skip class entirely. IF A SECOND PIPE HOP IS EVER ADDED, revert to 3/300/5: those values are correct once an open hop 0 falls through to a cheap hop 1 instead of to Opus. Values are reasoned from the code paths, not an A/B - revisit after a week of data. #430 (2026-09-07): landed failureDecaySec=600, closing the specific defect named above (mr-circuit-breaker.cjs's cmdRecord 'fail' branch — see its own comment for the full rationale) — a stale failure chain older than 600s no longer counts toward failureThreshold, so unrelated failures hours apart stop merging into one trip. failureThreshold/cooldownSec/maxHalfOpenTrials are deliberately UNCHANGED in the same PR that added decay: the 10/60/1 retuning above was partly a compensation for the missing decay window, and re-tuning both at once would make it impossible to attribute the observed effect to either change. Re-evaluate failureThreshold now that decay exists — this is the follow-up the comment above says was blocked pending it — after a week of data with decay alone.",
"cooldownSec": 300,
"enabled": true,
"failureDecaySec": 600,
"failureThreshold": 3,
"maxHalfOpenTrials": 5
},
"enabled": true,
"fallbackToAnthropic": true,
"inHopRetry": {
"_comment": "#430 (2026-09-07): baseDelayMs raised 1500 -> 8000, maxDelayMs (new key) capped at 20000. Evidence: the SAME two live targets probed back-to-back (seconds apart) returned 403/503, while EITHER ONE probed ALONE 20s apart returned clean 200s — a flat 1.5s retry re-hit the account well inside its own contention window on every attempt. mr-delegate.sh's in-hop retry now also reuses QUOTA_BODY_RE (the SAME body-level classification _completion_probe already applies via #365/#420, not a re-detection) so a QUOTA-EXHAUSTED 403 (no '429'/'rate limit' text at all — e.g. Kimi's exhausted-billing-cycle response) is retried too, not just literal rate-limit text. Backoff is exponential (retry N: baseDelayMs x 2^(N-1), capped, plus full jitter) — at maxRetries=1 (unchanged) only the first term ever fires: worst case base+jitter = 16s, vs the prior 3s. BUDGET: computeOuterBudgetSec's formula (mr-defaults.cjs) has NEVER included the retry SLEEP as a term (only perHopSec x (1+maxRetries)) — this was already true at the old 3s magnitude and remains a known gap, not something this change introduces. Worst-case ADDED wall-clock, computed by hand against the formula's own hopCount=3 (failover._pipeComment): (16s - 3s) x 3 hops = 39s, comfortably inside the 60s headroom the same comment records (12810s needed vs 12870s registered) — leaves 21s spare. Does NOT change failureThreshold, cooldownSec, or any circuitBreaker value; does NOT widen the classes of failure that get retried at all (permission_error/model-unavailable/auth-fail still never match RATE_LIMIT_RE or QUOTA_BODY_RE, so they still fail over immediately with zero retry, unchanged from before).",
"baseDelayMs": 8000,
"enabled": true,
"maxDelayMs": 20000,
"maxRetries": 1
},
"pipe": [
{
"model": "deepseek-v4.1-flash"
},
{
"model": "glm-5.3-flash"
}
],
"probeRetry": {
"_comment": "2026-09-15. Extra liveness-probe attempts (`_completion_probe`, mr-delegate.sh) before a hop is declared `probe-failed` and the pipe advances past it. WHY: `probe-failed` is the largest single terminal class on this deployment (15 of 30 failures over ts>=2026-09-12 in ~/.model-router/traces.jsonl, ALL of them deepseek-flash on the hosted backend, ALL exit 42 / duration 0 / breakerState closed) and it does NOT mean the backend is down — it means one POST did not answer. The interceptor's own debug row names the mechanism exactly: `completion-probe FAIL: https://ccs.the1studio.org model=deepseek-flash http=000000` then `hop 0: <backend> failed liveness probe, skipping (http=1)` then `hop 1: <backend>/deepseek-flash unknown or disabled`. `000` is curl's no-response-at-all, i.e. a dropped connection, not a verdict from CCS; the hop then falls through to the dormant disabled standby and the whole delegation exits 42 into Anthropic at premium cost, having spawned nothing. The breaker stayed CLOSED across every one of those, which is the agency's own read that the target is not unhealthy. 2 retries, spaced through the SAME `_mr_probe_space` gate as every other probe request (so this composes with `probeSpacing.interRequestDelaySec` above rather than competing with it). BUDGET: deliberately NOT a new term in computeOuterBudgetSec. The retries are bounded inside the `PROBE_TIMEOUT_SEC` (60s) per-hop probe term the outer budget already pays: attempt 1 gets the full `--max-time`, and each retry gets the REMAINDER of that window, floored at 1s and abandoned at 0 — so the probe's total wall clock per hop cannot exceed what the formula models, and neither the registered 17075s mr-task-interceptor timeout nor any SSOT constant moves. That bound is what this config's headroom (60s above a 17015s needed) depends on: a retry that added its own `--max-time` would push the worst case to 17135s and FAIL mr-validate-hook-timeout.cjs. Set 0 to restore the pre-change single-attempt probe exactly (env override: MR_PROBE_RETRY_MAX). A transient classification is reset per attempt, so a 429 on attempt 1 followed by a real fault on attempt 2 charges the breaker as the fault it is, not under attempt 1's account-level exemption (#432-follow-up).",
"maxRetries": 2
},
"probeSpacing": {
"_comment": "Fix 3 (#430), 2026-09-07. Real-traffic evidence on THIS account (127 delegations, same day): 1 delegation at a time succeeded 38% of the time, 2 concurrent 8%, 3-4 concurrent 3% — concurrent delegations each running their OWN mr-delegate.sh process and each firing their OWN _completion_probe against the SAME single-moonshot-account pool reproduce the identical burst-contention signature the standalone sweep showed (mr-probe-backends.sh's own probeSpacing default is 20s, directly measured to clear the account — see that script). This key is OFF (0) at the code level by default because it sits on the SYNCHRONOUS pre-hop path every delegation pays before its real model call, and most kit consumers are not on a single contended account. This shipped config turns it ON for this deployment. 5s, not 20s: it is a CONSERVATIVE compromise, not a directly-measured minimum for the synchronous path specifically — chosen to keep worst-case added latency bounded against the outer-budget headroom rather than to guarantee it clears the account on every hop. Worst case (every hop's probe collides with a sibling): interRequestDelaySec x hopCount(3) = 15s added to the pipe's total wall-clock, computed by hand against computeOuterBudgetSec's own hopCount term (see failover._pipeComment for the base 12810s-needed/12870s-registered figures). If a companion PR also raises inHopRetry.baseDelayMs (worst case ~39s added, see that PR), the COMBINED worst-case addition is ~54s against the 60s headroom — re-run computeOuterBudgetSec with BOTH changes applied before both land, do not assume the two headroom checks compose safely on their own. Raise toward 20s (matching the sweep's directly-measured value) only after confirming the combined budget still fits.",
"interRequestDelaySec": 5
},
"resumeOnError": {
"maxResumes": 1,
"minTurns": 20
},
"stallWatchdog": {
"_comment": "#410. Independent of perHopTimeoutSec/contextGrowthPerHopTimeoutSec: a hop whose transcript has stopped growing is killed after thresholdSec of no NEW assistant turn, instead of burning the FULL per-hop ceiling (up to 1800s for context-growth agents) before failover can even start. Reuses the SAME resume-on-kill (#399) and partial-recovery (#293) machinery a ceiling kill gets — the exit is normalized to 124 identically — but is recorded as a distinct `stall_kill` fact in calls.jsonl so a fleet report can tell 'ceiling reached' apart from 'gave up early on a dead connection'. thresholdSec must stay comfortably below perHopTimeoutSec or every hop stall-kills before it would ever reach its own ceiling. #472: the target is a hop wedged waiting on the MODEL, which produces no tool_use at all — a hop blocked on one long-running LOCAL tool (gh pr checks --watch, gh run watch, a bash polling loop) writes its tool_use and then no tool_result until the call returns, so its turn count cannot move and it was being killed as 'stalled' while perfectly healthy (8 of 18 deepseek-flash timeouts on 2026-09-10/11 were stall kills, all 3 inspected waiting on a blocking CI-watch Bash call). A pending tool_use with no matching tool_result is now treated as PROGRESS — the clock resets every poll, and thresholdSec is only ever measured from the moment the result lands and the transcript goes idle again. A genuinely hung TOOL stays bounded by the per-hop ceiling, which still applies. 2026-09-13: TWO fixes, both from the 51-kill census. (1) The watchdog is now ARMED ONLY WHEN A NEXT HOP EXISTS (the delegate's `_mr_has_next_hop`). Its stated purpose is 'shorten time-to-failover', but with this single-entry `pipe` there is nothing to fail over to: 47 of the 51 stall kills ended a one-hop delegation, discarding a mean 950s of remaining ceiling each (13.5h total), and 13 of the 51 would have exited 0 had the hop simply been left alone. Model-generation latency cannot be what trips it either: over 154,217 transcript gaps the p99.9 is 229s, and on 09-09..09-12 there were ZERO closed model gaps >= 300s out of 31,331, against 381 tool-in-flight gaps >= 300s on the same days. The gate is self-healing: add a second `pipe` entry and the watchdog arms again on its own. (2) An UNOBSERVABLE transcript now FAILS OPEN (`_mr_stall_watchdog`). It used to read turns=0/in_flight=0 on every poll when the transcript could not be located, and that is the wedged-hop signature, so the first poll reset the clock and the loop ran to a kill at ~320s with no diagnosis. `_hop_transcript` returns empty whenever the sid fails `^[A-Za-z0-9-]+$` or `find` misses, and the sid is empty by construction on Git Bash (`_hop_session_id` has no uuid source there), so EVERY Windows hop stall-killed at ~320s. Cannot observe is now cannot judge: no kill, plus a one-shot stderr diagnostic so the condition is visible rather than silent. 2026-09-24 (stall-only background hops): THREE clauses above are now SYNC-PATH-ONLY, because `mr-proxy-run.cjs` sets `MR_PROXY_NO_WALL=1` on every background-proxy launch and `mr-delegate.sh` drops its per-hop wall there. (a) 'thresholdSec must stay comfortably below perHopTimeoutSec' — a background hop HAS no per-hop ceiling, so there is nothing to stay below; the constraint still governs the sync path, where thresholdSec=300 stays comfortably below perHopTimeoutSec=600. (b) 'A genuinely hung TOOL stays bounded by the per-hop ceiling, which still applies' — on a background hop the #472 in-flight exemption is unbounded, since the ceiling that used to backstop it is gone; an unwalled hop blocked on a blocking local tool can hold indefinitely, up to the separate `blindHopMaxSec` backstop (PR #703 D1). Accepted: the alternative is killing work the caller was never waiting on. (c) 'ARMED ONLY WHEN A NEXT HOP EXISTS' — a background hop is now armed UNCONDITIONALLY, because the watchdog is its ONLY killer; the 51-kill census that justified the gate measured discarded CEILING, and an unwalled hop has none to discard. All three narrowings are scoped by the flag, which is set by the proxy and never by a user. PR #703 review D2 (same day): the 2026-09-24 change ALSO raised `thresholdSec` itself 300 -> 600 kit-wide, on the reasoning that the watchdog 'becomes the primary backstop' once the wall is gone — true only for background hops. That raise doubled the SYNC path's time-to-failover for no reason (the sync path keeps its wall untouched by this whole feature) and was REVERTED the same day: `thresholdSec` is back to 300 for sync, and the new `backgroundThresholdSec` (600) governs ONLY a `MR_PROXY_NO_WALL=1` hop — see `mr-delegate.sh`'s `MR_STALL_TIMEOUT_SEC` / `MR_BACKGROUND_STALL_TIMEOUT_SEC` resolution and `mr-defaults.cjs` for the full rationale on each value. With enabled:false (or an invalid threshold) no background hop can be judged, so EVERY background hop falls back to the blindHopMaxSec 4h hard limit, including one still making progress.",
"backgroundThresholdSec": 600,
"enabled": true,
"pollIntervalSec": 20,
"thresholdSec": 300
},
"turnsSalvage": {
"enabled": true,
"reportOnly": {
"ceilingSec": 90,
"turns": 1
},
"wrapUpTurns": 15
}
},
"fallbackTier": {
"_builtinOverridesComment": "Explore is read-only search per its own description (\"Fast read-only search agent for locating code\") — mechanical/narrow, haiku per the rubric's own worked example. Plan is architecture/planning judgment (\"considers architectural trade-offs\") — the rubric table would tier a REAL planner/architect agent as opus, but a no-.md fallback has, by definition, no evidence of the intended task's complexity to under-tier: there is no frontmatter here being overridden, only an absent one being guessed at, and opus is the exact outcome #330 exists to prevent. Sonnet is the closest quality match available under the sonnet/haiku-only constraint. general-purpose/claude/claude-code-guide are broad catch-alls with no fixed complexity signal — tie-break default.",
"_comment": "#330 — when the interceptor passes a spawn through to Anthropic native with NO resolvable agent-declared tier (no .md found at all: a genuine built-in, an engine-kit agent whose .md lives in a kit not installed on THIS machine, or a broken/typo'd subagent_type — see rules/agent-model-tier-rubric.md), Claude Code previously spawned it on the SESSION model with no pin, which under an Opus session silently burns Opus on read-only search and mechanical work. Measured 2026-08-23 via debug.jsonl: 3,694 of 6,396 passthroughs (58%) had no resolvable tier at all; Explore (719) and general-purpose (312) alone account for most of it. `defaultBuiltInModel` above only steers ROUTING (which cheap backend to try); it does nothing once routing itself gives up (pass-all-backends-failed, pass-no-candidate, pass-unknown-agent, ...) — this block is the fallback-TIER counterpart, applied via the PreToolUse hook's `updatedInput.model` on the passthrough itself. Data-driven per rules/code-conventions.md (\"no hardcoded maps\") rather than an in-code table. USER DECISION (2026-08-23): \"the final fallback will be the original anthropic cheap model (sonnet or haiku)\" — every value in this block MUST be sonnet or haiku, NEVER opus. mr-task-interceptor.cjs's CHEAP_FALLBACK_TIERS enforces this at the code level too (a stray opus here would be clamped to sonnet with a stderr warning, not honored) — this config comment states the intent, the code guard is what actually holds it.",
"_defaultComment": "Applies to every no-tier passthrough NOT named in builtinOverrides below — the tie-break default per rules/agent-model-tier-rubric.md (\"when genuinely ambiguous, default to sonnet — never under-tier quality-sensitive work\"). Covers unresolved engine-kit agents and broken/typo'd subagent_type spawns, where nothing is known about the intended task's complexity.",
"builtinOverrides": {
"Explore": "haiku",
"Plan": "sonnet",
"_comment": "Keyed by the exact built-in agent name (BUILTIN_AGENTS in mr-task-interceptor.cjs). Only applies when that built-in itself has no resolvable tier at the point of passthrough. Every value here MUST be sonnet or haiku per the 2026-08-23 user decision above.",
"claude": "sonnet",
"claude-code-guide": "sonnet",
"general-purpose": "sonnet"
},
"default": "sonnet",
"enabled": true
},
"hopCiWait": {
"_allowAgentsComment": "Agents whose ASSIGNED task is watching state are exempt from this guard — a t1k-ci-watcher hop polling until checks settle is doing exactly its job, and denying it would make the spawner's prescribed remedy impossible. The hop reads its own name from MR_DELEGATE_AGENT (mr-delegate.sh:5305, the same variable mr-metrics.cjs:24 and mr-telemetry.cjs:120 already consume). Data-driven by design (rules/code-conventions.md 'Data-Driven Over Hardcoded'): add any agent here without a kit release. Kill switch: set enabled:false, or export MR_HOP_CI_WAIT_GUARD=off (env wins over config in both directions — `enforce` re-arms it on a host whose config was edited to disable it).",
"_comment": "EXECUTION-SIDE enforcement of the hop-sizing contract's CI clause, complementing briefSizeAdvisory above. That key advises the SPAWNER'S BRIEF (a `ci-wait` phrase in the brief, one line on the routed banner, optional mode:\"block\"); this key binds the HOP ITSELF once it is running, via hooks/mr-ci-wait-guard.cjs (PreToolUse:Bash, routed hops only — inert unless MR_SPAWNED=1). The two are independent and both are needed: a hop handed a well-sized brief can still start waiting, and a spawner can write a brief that never names CI while the hop improvises a poll loop. MEASURED on this machine over 7 days of routed-hop transcripts: 41% of `t1k-git-manager` hops (80 of 196) ran a CI/merge-WAITING command — `gh pr checks --watch`, `gh run watch`, a for/while loop over `gh pr checks`/`gh run view`/statusCheckRollup with sleep, or a TaskOutput wait; that waiting is 23.7% of all git-manager hop wall-clock and 15 of the 15 slowest single tool calls, with 43 calls sitting at the 600s Bash cap. The dominant harm is not the wasted seconds but the hop killed at its per-hop ceiling AFTER its PR had already merged. Denied shapes: `gh pr checks … --watch` · `gh run watch` · a for/while/until loop that SLEEPS and touches gh pr checks / gh run view / gh run list / gh pr view / gh api, or a while/until whose TEST is itself a gh call (`while [ \"$(gh pr view 12 --json state -q .state)\" != MERGED ]`) · a `sleep N` with N >= 30s that either IS the whole command or sits in a command that also polls gh. ALLOWED (deliberately): a single non-watch snapshot — `gh pr checks 12`, `gh run view 123 --json status`, `gh pr view 12 --json statusCheckRollup` — because reporting the current check state is exactly what the hop is supposed to do before it finishes; plus build work that merely pauses (`bun run build && sleep 30 && bun run e2e`) and a non-sleeping sweep (`for pr in 12 13 14; do gh pr checks $pr; done`). Matching is against the COMMAND, not the text: quoted literals and heredoc bodies are masked first (`git commit -m \"fix: guard for flaky test\"` and `cat <<EOF … EOF` cannot deny), while `$(…)`/backticks and `bash -c \"…\"` payloads are still inspected because the shell runs those. A `TaskOutput` wait is a non-Bash tool and is NOT covered — that shape is bounded by the per-hop ceiling instead. A denial writes one debug.jsonl row `event:\"hop-ci-wait-denied\"` carrying {agent, pattern} (never the command text — same privacy rule as mr-inline-tracker.cjs), so the guard's effect is countable from the file every other routing KPI uses. Escalation, not a boundary: an inline `T1K_ALLOW_CI_WAIT=1 <cmd>` passes (read from the command TEXT, since an inline ENV=1 prefix cannot reach a hook's own process env), and the guard fails OPEN on any unreadable payload — but its CONFIG default is enforce, so a missing or corrupt config can never silently disable it.",
"allowAgents": [
"t1k-ci-watcher"
],
"enabled": true
},
"hopGit": {
"enabled": true,
"laneBranchGlobs": [
"lane/*"
],
"parentPush": false,
"parentPushAllowedRemotes": [],
"protectedBranchGlobs": [],
"topicCommit": true,
"topicPush": true
},
"hopHealth": {
"_comment": "Periodic hop-health monitoring. Detects routing targets (failover.pipe, modelMapping, loadBalance.targets, capabilityPipes) that are absent from the gateway catalog or fail a live tool-use probe. A retired/broken model is surfaced at the next session start instead of silently falling through to Anthropic for days. Disabled by setting enabled:false or MR_HOP_HEALTH_DISABLE=1.",
"_runsComment": "Tool-use runs per target per sweep. A single run is enough to detect a hard retirement like MissingSessionID or an absent catalog entry; raise only if you need stronger contract evidence.",
"enabled": true,
"intervalSec": 86400,
"runs": 1
},
"hopWriteGuard": {
"_comment": "P15 write guard (token-cost program lane B) — execution-side enforcement of a routed hop's micro-task contract (theonekit-core plans/260922-micro-task-delegation/design.md §3). Binds hooks/mr-hop-write-guard.cjs (PreToolUse Edit|Write|MultiEdit|NotebookEdit|Bash, routed hops only, inert unless MR_SPAWNED=1 AND the hop carries a valid MR_CONTRACT). No contract on the hop ⇒ unchanged (pre-P15) behaviour regardless of this block. RELEASED 2026-10-01 (USER DECISION, fail-fast: no staged rollout, no dated ratchet): mode defaults to \"enforce\" — an out-of-contract write is DENIED (debug.jsonl event hop-write-guard-denied). \"warn\" remains available as an opt-in: the write is logged (hop-write-guard-warn) and reported via additionalContext but ALLOWED. Kill switch: enabled:false, or export MR_HOP_WRITE_GUARD=off (env wins over config in both directions — warn/enforce pin the mode over whatever this block says).",
"enabled": true,
"mode": "enforce"
},
"laneWorktree": {
"allowedRoots": [],
"enabled": true
},
"leafReadiness": {
"_comment": "P08b (plans/260924-merge-up-tree-b/phase-08). A routed brief that names a merge-up TREE NODE (`node: <node.md>`) gets that node checked by core's own `t1k-contract.cjs tree-check` BEFORE the hop launches — eleven cross-node invariants (filesSubset, siblingsDisjoint, parentOwnedFiles, budgetSum, decisionWords, criteriaKept, spawnShape, agentTools, claudeDirPinned, parentResolved, claimsValid) that were previously only ever checked on the NATIVE leaf path. `node:` is NOT `contract:`: core extracts the node file's JSON block itself (loadNodeContract), so model-router ships no second parser and MR never reads the node file. WARN-ONLY: a failing check annotates the caller, it never refuses a spawn, and this block carries NO dated `_ratchetComment` — the promotion to `block` is decided by the P09 verdict in a follow-up PR (D5), so nothing can auto-flip. Resolver: scripts/mr-defaults.cjs `resolveLeafReadiness`. Checker: scripts/mr-leaf-readiness.cjs. Call sites: mr-proxy-run.cjs (PRIMARY — the reachable routed-leaf path, since a tree leaf is opus-pinned and never routed by the interceptor) and mr-task-interceptor.cjs (SECONDARY, the brief-size advisory site). Absent or unreachable core script warns once and skips (criterion 4), never blocks.",
"_modeComment": "`block` is SHIPPED (RELEASED 2026-10-01, USER DECISION, fail-fast): a failing node refuses the spawn. An unrecognised value resolves to `block` too; `warn` is an explicit opt-in that annotates instead of refusing.",
"_timeoutMsComment": "Per-check wall budget for the `tree-check` subprocess. The brief-size advisory's sibling risk row is 'interceptor latency from a node exec' — a tree-check on a pathological node must not stall a spawn, so the exec is capped and a timeout is reported as its own verdict (`skipped: \"timeout\"`) rather than as a failed check. 5s is ~2x the measured cost of a real tree-check over the core fixtures.",
"enabled": true,
"mode": "block",
"timeoutMs": 5000
},
"loadBalance": {
"_comment": "Round-robin quota split across independent backend pools — COST optimisation for the plain/mechanical/general-coding bucket only. QUALITY-DRIVEN tasks (reasoning: audit/security/architecture/root-cause; long-context; vision; image; mcp) bypass this and go to capability selection so quality is guaranteed. Rotated per spawn via a persisted counter in ~/.model-router/lb-counter.json; per-target integer `weight` (default 1) gives a weighted split. Disable with enabled:false.",
"_weightNote": "DISABLED 2026-10-20: the pool is a single target and pickLoadBalanced() already returns null on targets.length < 2, so enabled:true asserted a rotation that cannot happen. Re-enable only when a second routing target returns. | REPOINTED 2026-09-25 (USER DECISION): the single target is now deepseek-v4.1-flash on the hosted backend (primary), replacing the same id under the retired route label. RENAMED 2026-09-28 from the private `cc-deepseek-v4.1-flash`: the gateway serves ONE pooled id for this model across both upstreams and picks the upstream per request by key weight, so the route label here names the ROUTE, not necessarily the upstream that answers. Still a one-target pool, so row 3 stays inert (pickLoadBalanced returns null on targets.length < 2) and row 4 (tier, with the hosted backend declared first in the model catalog) governs plain traffic. | REPOINTED 2026-09-24 (id correction): the target is now `deepseek-v4.1-flash` (the id `deepseek-flash` never existed in the hosted backend's catalog — the gateway silently resolved it to a V4.0-class model; the 2026-09-15 FOLLOW-UP note below is WRONG about this: it called `deepseek-v4.1-flash` a placeholder that does not exist, which is backwards — the models.dev namespace the hosted backend draws on lists `deepseek-v4.1-flash` and has NEVER listed `deepseek-flash`. PR #521 had the right id). | ONE target: deepseek-flash (repointed 2026-09-10 from deepseek-v4-flash to DeepSeek V4.1 Flash — see the model catalog's deepseek-flash _comment for the CCS-not-ready caveat; row 4 still governs actual traffic per the correction below, so this pending-upstream state is inert until CCS lists the new id). CORRECTION 2026-08-29: the prior note claimed leaving enabled:true keeps selection 'resolving at row 3 with the same answer the shipped modelMapping gives, so the two cannot disagree'. That is false in code - mr-task-interceptor.cjs:837 returns null when targets.length < 2, so loadBalance claims NOTHING and row 3 is inert. Measured: zero loadBalance:* selections since 2026-08-25T05:39Z; row 4 (tier) makes 79% of picks. Harmless today because row 4 picks the same flash - but do not reason about routing from the old claim. UPDATED 2026-09-07: target swapped from the retired route label (model deepseek-v4-flash) to a second retired label (model kimi-k2.6), for the reason recorded in failover._pipeComment below (deepseek-v4-flash blocked upstream, and a USER DECISION excluded every model behind the retired label AND every OpenAI-owned model, leaving only moonshot reachable). Still a single-target pool (row 3 still inert per the correction above) — row 4 (the model catalog's enabled flags) is what actually governs traffic. UPDATED 2026-09-15 (quota-weighted two-backend split): the single target above is REPLACED by two — the hosted backend's deepseek-flash (unchanged model, same id modelMapping and failover.pipe already use) and glm/glm-5.3-flash (a new backend) — so row 3 (loadBalance) now claims a share of plain/mechanical traffic instead of returning null on targets.length < 2, and the split between the two is driven by each backend's REMAINING QUOTA rather than a hand-set constant. The scores come from the ccs-gateway companion timer (every 15 min, into the gateway's own routing-weights file on the CCS host — its name and default path are `ROUTING_WEIGHTS_FILE` in ccs-auth-proxy.mjs), exposed to clients by GET /quota/routing-weights on ccs-auth-proxy.mjs and consumed by mr-task-interceptor.cjs, which caches the response under ~/.model-router/routing-weights.json for 7 min. Each target's static weight:1 above is a FALLBACK ONLY, used when that live signal is unavailable — never a statement about the intended ratio. The score is fed through oc-go-weights.py's own curve (quantise to 1/10, square, scale 1000, floor 1) so a backend is DEPRIORITISED, never excluded. QUALITY IS AT PARITY, NOT MEASURED: both candidate models were tool-use-contract probed on 2026-09-15 and passed identically (10/10 runs, 0 violations each), so there is no task-correctness benchmark separating them and availability is the ONLY term in the score today (combined = quality_score * availability_score, quality_score = 1.0). A future quality signal multiplies in at effectiveTargetWeight() in mr-task-interceptor.cjs — do NOT read this as evidence the two models are equally good. NOT touched (deliberate): failover.pipe's own hop list and modelMapping are separate, already-litigated decisions (see failover._pipeComment) — they already point at the hosted backend's deepseek-flash today and this change does not alter that, it only adds glm as a second loadBalance target alongside it. FOLLOW-UP 2026-09-15 (this commit): PR #521 shipped with a placeholder `deepseek-v4.1-flash` id that does not exist in the catalog (the real, already-enabled id for the same model is `deepseek-flash` — see its own _comment in the model catalog) and no `glm` backend block at all, so the split was inert (pickLoadBalanced saw 0 eligible targets and fell through to row 4, byte-identical to pre-#521 behavior — never actively broken, just not yet live). This commit adds the missing `glm` backend block and fixes the target id below so the split actually takes effect.",
"enabled": false,
"targets": [
{
"model": "deepseek-v4.1-flash",
"weight": 1
}
]
},
"memGateNoFallback": {
"_comment": "K6 (2026-10-16): when the fan-out gate refuses a routed hop for a MEMORY reason (swap-high, psi-high, mem-low, mem-unreadable) the hop ends `MR-PROXY: NOT-STARTED` and the ONLY allowed next step is wait (scripts/mr-wait-memory.cjs) then re-dispatch the SAME agent routed. mr-proxy-run.cjs records the refusal (agent, brief, session); mr-task-interceptor.cjs DENIES, within windowSec, a later spawn of a DIFFERENT agent type whose brief is similar (token Jaccard of the first 2000 chars >= similarityThreshold). Re-spawning the SAME agent type is allowed and clears the record. Audited escape for an explicit user instruction: env T1K_MR_ALLOW_NATIVE_FALLBACK=1. Fail-open on any internal error. The wait itself is fanOut.memWaitMaxSec in the passwd-home t1k-config (default 7200 = the queue ceiling; 0 = the ceiling; 900 restores the old 15 min cap) with a heartbeat every fanOut.memHeartbeatSec (default 180).",
"enabled": true,
"similarityThreshold": 0.6,
"windowSec": 10800
},
"mode": "transparent",
"modelMapping": {
"haiku": {
"model": "deepseek-v4.1-flash"
},
"sonnet": {
"model": "deepseek-v4.1-flash"
}
},
"nativeInAutoMode": true,
"perSpawnModelOverride": true,
"pipeLiveness": {
"_comment": "P12 (F10, 2026-09-27): the circuit breaker trips on a DELEGATION outcome (mr-circuit-breaker.cjs), never on a pre-flight PROBE, so a total gateway outage where every probe 403s can leave every breaker half-open/closed while nothing is actually reachable. `ttlSec` bounds how recent a target's own `probe-failed*` trace row must be to count as dead evidence (unioned with the existing breaker-open signal in mr-task-interceptor.cjs's getDeadTargetKeys, consumed by both pickLoadBalanced's liveTargets filter and pickFromCandidates's breaker_open demotion). When EVERY non-standby modelRouter.failover.pipe target is dead by that combined signal, the pre-route check passes the spawn through to Anthropic native with NO proxy launch at all — distinct from the selectors' own demote-never-exclude fallback, which still returns a (possibly dead) pick for a PARTIAL outage. `nativeNextLatch` is the companion escape for the background-proxy path: mr-proxy-run.cjs's computeFinalization writes a short-TTL latch keyed to (sessionId, agent, sha256(brief)) the moment a run returns exit 42 (the exhausted sentinel) — the ONE path where this hook never observes the delegation's own outcome, since it already exited after handing the spawn to t1k-model-router-proxy. The very next identical spawn consumes that latch and passes through natively, which is the actual mechanism behind the NOT-ROUTABLE sentinel's own 're-spawn the same brief' promise (mr-proxy-run.cjs:148) — an Agent-tool caller has no other way to force a native run. `mode: \"act\"` (RELEASED 2026-10-01, USER DECISION, fail-fast: no dated ratchet) enforces them; `mode: \"warn\"` is an opt-in that logs would-passthrough decisions without changing behavior.",
"enabled": true,
"mode": "act",
"nativeNextLatch": {
"enabled": true,
"ttlSec": 600
},
"ttlSec": 120
},
"prefixStableHops": true,
"proxy": {
"_liveProgressComment": "2026-10-13 (hop live output, user answer to plan U2 \"flip the default off\"): OFF BY DEFAULT. This SUPERSEDES the USER DECISION of 2026-09-24 that made it ON. Why: the t1k-model-router-hop-view mod now shows a running hop's last lines under its status row in the Claude Code window (modelRouter.ui.hopLive, zero model tokens, bound to the hop's transcript by a launcher-written marker), so the ticker's only remaining audience is someone who opens the subagent panel, while it costs every streamed hop model tokens (up to 40 `MR-PROXY: PROGRESS` lines in the haiku proxy's context per `--wait` call, ~585 tokens est. for a 60 s hop, measured by bench-hop-live.test.cjs) and one extra `--wait` Bash round trip (a call that streamed ANY progress line defers its result to the NEXT `--wait`). Opt in with `true` (in `~/.claude/t1k-config-mr.json` or a project's `.claude/t1k-config-mr.json`, nearest wins). Existing installs: the CLI's three-way config merge rolls an UNTOUCHED shipped default forward, and the old shipped `true` is indistinguishable from untouched, so those installs become `false` on update; a `true` you set after the update (or in a project file the kit does not write) differs from the new baseline and is kept as a diverged override. When on: `--wait` tails the hop's own marker-bound transcript and prints one `MR-PROXY: PROGRESS <hh:mm:ss> turn <n> · <Tool> <target>` line per NEW tool call; change-only printing (never a timer) and the per-call cap bound the stream; a call that streamed ANY progress line never prints a result (it prints the ordinary PENDING line and exits as for pending) and the NEXT `--wait` prints the finished result from its first line, marker at line 1. When off (the default): `--wait` prints no PROGRESS line and returns byte-for-byte to the pre-feature shape, with no deferral. Only a literal boolean decides (mr-live-progress.cjs liveProgressEnabled): a missing key, a missing/corrupt file, or a wrong-typed value all leave it OFF (the code default flipped with this key, otherwise a config walk that finds no key would still enable it). Every path in the progress module is fail-silent: it can never change --wait's result or exit code. Platform note: the ticker binds by the marker, not /proc, but on a host where the launcher wrote no marker (MR_HOP_SESSION_ID=0) nothing is printed, deliberately.",
"liveProgress": false
},
"requireContract": true,
"roles": {
"advisor": {
"mode": "unset"
},
"audio": {
"mode": "unset"
},
"commit": {
"mode": "unset"
},
"default": {
"mode": "unset"
},
"dictation": {
"mode": "unset"
},
"image": {
"mode": "unset"
},
"judge": {
"chain": [
{
"model": "deepseek-v4.1-flash",
"params": {
"thinking": {
"type": "disabled"
}
}
}
],
"maxBytes": 10485760,
"mode": "explicit",
"retry": {
"attemptsPerModel": 1,
"backoffMs": 2000
},
"timeoutSec": 60
},
"memory": {
"mode": "unset"
},
"plan": {
"mode": "unset"
},
"slow": {
"mode": "unset"
},
"smol": {
"mode": "unset"
},
"speech": {
"mode": "unset"
},
"task": {
"mode": "unset"
},
"tiny": {
"mode": "unset"
},
"video": {
"chain": [
{
"model": "glm-5.3-flash",
"params": {
"thinking": {
"type": "disabled"
}
}
}
],
"maxBytes": 8388608,
"mode": "explicit",
"retry": {
"attemptsPerModel": 1,
"backoffMs": 2000
},
"timeoutSec": 90
},
"vision": {
"chain": [
{
"model": "deepseek-v4.1-flash",
"params": {
"thinking": {
"type": "disabled"
}
}
}
],
"maxBytes": 10485760,
"mode": "explicit",
"retry": {
"attemptsPerModel": 1,
"backoffMs": 2000
},
"timeoutSec": 60
},
"web": {
"mode": "unset"
}
},
"routableWriteAgents": [],
"routeTarget": "ccs",
"routedHopPermissionMode": {
"t1k-docs-manager": "bypassPermissions",
"t1k-doctor-manager": "bypassPermissions",
"t1k-hooks-manager": "bypassPermissions",
"t1k-kit-developer": "bypassPermissions",
"t1k-lane-worker": "bypassPermissions",
"t1k-rsi-reviewer": "bypassPermissions",
"t1k-rules-manager": "bypassPermissions",
"t1k-skills-manager": "bypassPermissions"
},
"routing": {
"leafContext": "kernel"
},
"security": {
"_allowedMcpServersComment": "USER DECISION (2026-08-23): ship the FULL list, not []. This kit shipping an EXPLICIT [] (rather than omitting the key) was the root cause of the \"allowlist blanked twice\" symptom chased through theonekit-cli #460/#463 — #463's key-merge fix could not help, because [] is a real shipped VALUE, not an absent key, so every `t1k modules update` overwrote a consumer's populated list with empty. It also meant work merged the same day (mcp__context7__* granted to 7 agents' `tools:` frontmatter across theonekit-unity #497, cocos #325, rn #37, web #85) could never forward for ANY consumer: forwarding is fail-closed and requires BOTH the agent's tools: grant AND the server being in this array — with [] shipped, the second half never held. The trade-off was put to the user before this changed: transparent routing re-originates a separate upstream connection, giving that third-party backend FULL PLAINTEXT access to prompt + code context (see rules/mr-transparent-routing.md), and UnityMCP/playwright/chrome-devtools expose LIVE PROJECT STATE (editor state, browser state) rather than public documentation the way context7/sequential-thinking do. The user weighed that and chose the full list anyway. The `resolveAllowedMcpServers()` resolver itself is UNCHANGED and stays fail-CLOSED on absent/malformed/empty input — only this shipped DEFAULT VALUE moved; a consumer who wants a narrower set still edits this array directly. `security.dataClassification` below remains the primary defense regardless of this list's contents: it runs as an independent, earlier gate that blocks ROUTING outright on a sensitive-content match, before any MCP-forwarding decision is even reached — a populated allowlist does not weaken it. KNOWN ISSUE (as of 2026-08-22, still applies since this file remains module-claimed — see module.json files['.']): `t1k modules update` extracts this file via a blind per-module-ZIP overwrite (theonekit-cli atomicMergeTree), so a consumer who customizes this array to something OTHER than the shipped default still gets overwritten back to the shipped value on update — re-apply a customization after each update. Unclaiming this file would fix that (shared-ZIP key-merge preserves local edits instead), but exposed a worse defect in theonekit-cli's per-module orphan-sweep on the claimed-to-unclaimed transition (#317, reverted in #318); the CLI fix for THAT (theonekit-cli #459, v6.15.1) does not by itself make unclaiming safe — see the history in git blame before touching this. ADDENDUM (2026-09-24, user approved): `code-graph-cocos` added — the studio's INTERNAL, read-only code-structure graph (`https://graph-cocos.the1studio.org/mcp`, behind Cloudflare Access), the same class as `knowledge-retrieval` already above: a first-party read-only query service over the studio's own code, not live editor/browser state and not a third-party vendor. `theonekit-cocos` PR #1043 grants `mcp__code-graph-cocos__*` in its agents' `tools:` frontmatter, and by the fail-closed rule above that grant forwards ONLY when the server is named here — omitting it leaves those grants inert for every consumer, the same gap #335 closed. Resolver behaviour is unchanged. ADDENDUM (2026-10-04, user approved): `memory` added — the LOCAL knowledge-graph MCP (a shared loopback daemon, `http://127.0.0.1:9102/servers/memory/mcp`), not a third-party vendor and not live editor/browser state, with no external side effects. Evidence (theonekit-core#3677): a native agent read an entity through `mcp__memory__open_nodes` fine, while a routed `t1k-mcp-manager` hop that declares `mcp__memory__*` in `tools:` could not — its grant is the declared servers intersected with this array, and `memory` was missing, so forwarding failed closed on the missing allowlist entry. Trade-off, same as above: transparent routing gives the routed backend plaintext access to whatever entities the hop reads or writes, and the hop can WRITE the store. `security.dataClassification` remains the primary independent gate and is unchanged; the resolver stays fail-closed and is unchanged. A hop only receives `memory` where the project actually registers the server (definitions are read from ~/.claude.json local scope for the project, then user scope), so projects without it are unaffected. github, plane, discord-mcp, jenkins, gcloud and the retired vision server were NOT approved and stay off this list. ADDENDUM (2026-10-07, plan 261007-mcp-nudges-and-contribute-back phase 3): `code-graph-unity` and `ual` added so a routed `t1k-investigator` (or any routed agent whose `tools:` grants graph tools) can reach the Unity code graph and the UAL asset catalogue. `code-graph-unity` is the Unity twin of `code-graph-cocos` (read-only graph queries); `ual` is read-only catalogue search (`asset_search`, `asset_get`, `asset_usage`, `asset_stats`; pull is dry-run only). The `ual` entry is INERT until an agent grants `mcp__ual__*` in `tools:`. Preconditions unchanged: the hop floors with `mcp-not-registered` unless the granted server is registered in ~/.claude.json (local or user scope), and `security.dataClassification` still gates every hop. Trade-off, same as above: routed backends see code-structure and catalogue results in plaintext. Contract 63 pins this list BY IDENTITY; a rise means an unreviewed server, never re-pin to the new count. ADDENDUM (2026-10-16, user approved via AskUserQuestion): `code-graph-unity-games` added — the studio's INTERNAL, read-only code-structure graph of the game repos, the same class as `code-graph-unity` above: a first-party read-only query service, not live editor/browser state and not a third-party vendor. Evidence: `t1k-unity-base-system-mapper` (theonekit-unity) grants `mcp__code-graph-unity-games__*` and was held `routable: false` (theonekit-unity#999) only because this server was missing here, so every mapping lane ran native on sonnet. Preconditions unchanged: the hop floors with `mcp-not-registered` unless the server is registered in ~/.claude.json, and `security.dataClassification` still gates every hop. Trade-off, same as above: routed backends see graph results in plaintext. Resolver unchanged and fail-closed.",
"allowedMcpServers": [
"context7",
"sequential-thinking",
"UnityMCP",
"playwright",
"chrome-devtools",
"knowledge-retrieval",
"firebase",
"code-graph-cocos",
"memory",
"code-graph-unity",
"ual",
"code-graph-unity-games"
],
"dataClassification": {
"blockClasses": [
"private-key",
"aws-key",
"github-token",
"api-key",
"credential",
"pii"
],
"enabled": true,
"intentGate": false
}
},
"spawnCapableFloor": "file-agents",
"toolUsageRetention": {
"checkIntervalHours": 24,
"keep": 2,
"maxBytes": 52428800
},
"ui": {
"_hopViewComment": "2026-10-13 (user decision): the hop-view mod (t1k-model-router-hop-view) draws NOTHING by default. Why: the Claude Code agents panel at the bottom already lists the same hops, so the band above the prompt (status rows, the live `▸` lines, the `finished (exit N)` row, `view answer`) was redundant clutter. This REVERSES the always-on band shipped in 3.144.0 and 3.146.0. Opt in with `true` in ~/.claude/t1k-config-mr.json or a project's .claude/t1k-config-mr.json (nearest wins; t1k-config-mr.local.json is read before t1k-config-mr.json in each .claude/), or with env MR_HOP_VIEW=1 for one run (env wins over every file; MR_HOP_VIEW=0 forces it off). Only a literal boolean `true` turns it on: a missing key, a missing or corrupt file, or a wrong-typed value (\\\"true\\\", 1) all leave it OFF. The mod reads the flag once, at session start, through its single helper run: a change needs a SESSION RESTART, and while it is off the mod starts no timer and spawns nothing. modelRouter.ui.hopLive (the live lines and rowsPerHop) is independent but only visible while this is on. Existing installs: the CLI's three-way config merge rolls an UNTOUCHED shipped default forward, so an install that never set this key gets `false` on update; a `true` you set afterwards differs from the shipped baseline and is kept as a diverged override.",
"_systemMessageMaxLinesComment": "UI transcript-abridging ceiling for the routed delegation's user-visible copy (systemMessage). A long cheap-model output previously made the user's transcript auto-expand into a wall of text that buried the conversation — this key caps how many lines of it are shown. The transcript copy keeps a HEAD (banner, verbatim) + TAIL (the agent's conclusion, which matters most) with a marker stating how many lines were hidden AND that the full output was delivered to the model. In THIS kit file only 5..40 is honoured (0 and larger values are ignored); to disable or raise the cap use env T1K_MR_UI_MAX_LINES or $HOME/.claude/t1k-config-mr.local.json (docs/mr-hop-output-visibility.md). Applies to the user-visible systemMessage ONLY — permissionDecisionReason, the field that reaches the calling LLM (#436), is never abridged. Data-driven per rules/code-conventions.md ('no hardcoded maps'); mr-task-interceptor.cjs reads this key with a safe default of 40 and can never throw on a missing/malformed value.",
"hopView": {
"enabled": false
},
"systemMessageMaxLines": 40
},
"writeAgentFloor": "all",
"writeAgentNativeModel": "haiku"
},
"registryVersion": 2
}