Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 78 additions & 6 deletions .opencode/opencode.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2819,6 +2819,18 @@
},
"scout": {
"name": "Scout - routine work: cheapest, fastest, smart enough",
// Class fallback (Drew 2026-11-13): on exhaustion this class
// escalates to the route(s) appended at the END of its targets.
// Per-call visited-set semantics: the route expander prunes
// re-entry into a route already on the expansion path, so
// escalation never re-enters a tried class and always
// terminates at specialist, the sink. Full layout:
// .opencode/route-fallbacks.md; guard:
// bin/check-opencode-route-rules.mjs (CLASS_FALLBACKS).
// Scout's own edge (workhorse) is a PROPOSAL (Drew has not
// ruled on scout yet, 2026-11-13): routine work that
// exhausts the free/cheap seats escalates to the standard
// tier rather than erroring.
// 2026-11-11 (Drew, direct order): ordered selection, haiku-plan leg LAST (last resort).
// 2026-11-11 (Drew): scout order — Beam ahead of DeepSeek Flash.
// 2026-10-26 (pool remap review): all three routes addressed at #low — the rung every
Expand All @@ -2838,13 +2850,26 @@
"targets": [
"opencode-route/beam-plan",
"opencode-route/deepseek-flash-plan#low",
"opencode-route/haiku-plan#low"
"opencode-route/haiku-plan#low",
"opencode-route/workhorse"
],
"selection": "ordered",
"autonomy": "rules"
},
"background": {
"name": "Background - patient queue work: best value first, no latency contract",
// Class fallback (Drew 2026-11-13): on exhaustion this class
// escalates to the route(s) appended at the END of its targets.
// Per-call visited-set semantics: the route expander prunes
// re-entry into a route already on the expansion path, so
// escalation never re-enters a tried class and always
// terminates at specialist, the sink. Full layout:
// .opencode/route-fallbacks.md; guard:
// bin/check-opencode-route-rules.mjs (CLASS_FALLBACKS).
// Background's own edge (workhorse) is a PROPOSAL (Drew
// has not ruled on background yet, 2026-11-13): patient
// queue work that exhausts the value seats escalates to
// the standard tier rather than erroring.
// NEW 2026-10-27 (pool redesign): the tier for machinery-dispatched
// work no human watches — repo sweeps, issue-queue workers,
// stewardship cycles, batch classification. Ordered chain in value
Expand Down Expand Up @@ -2897,7 +2922,8 @@
"model": "opencode-route/deepseek-flash-plan#high",
"window": "deepseek-peak-early"
},
"opencode-route/mimo-flash-plan"
"opencode-route/mimo-flash-plan",
"opencode-route/workhorse"
],
"selection": "ordered",
"autonomy": "rules"
Expand Down Expand Up @@ -3110,6 +3136,21 @@
},
"workhorse": {
"name": "Workhorse - standard work: Flash primary, weighted relief pool behind it, Fable #low last resort if all else is down",
// Class fallback (Drew 2026-11-13): on exhaustion this class
// escalates to the route(s) appended at the END of its targets.
// Per-call visited-set semantics: the route expander prunes
// re-entry into a route already on the expansion path, so
// escalation never re-enters a tried class and always
// terminates at specialist, the sink. Full layout:
// .opencode/route-fallbacks.md; guard:
// bin/check-opencode-route-rules.mjs (CLASS_FALLBACKS).
// Workhorse's chain: scout FIRST (its failure mode is
// quota exhaustion; scout diversifies onto different
// doors - free Beam via CommandCode, DeepSeek #low,
// Haiku #low), then specialist (the sink). Reached FROM
// speed or scout, the visited-set pruning skips the
// scout edge's re-entry and the call lands on
// specialist.
// 2026-10-27 pool redesign (Drew's structure): incremental —
// DeepSeek Flash #high is the primary every session tries first;
// the weighted relief pool (workhorse-weighted) absorbs failover
Expand Down Expand Up @@ -3145,7 +3186,9 @@
"opencode-route/workhorse-ordered",
"opencode-route/workhorse-primary",
"opencode-route/workhorse-weighted",
"opencode-route/workhorse-last-resort"
"opencode-route/workhorse-last-resort",
"opencode-route/scout",
"opencode-route/specialist"
],
"selection": "ordered",
"autonomy": "rules",
Expand Down Expand Up @@ -3351,6 +3394,10 @@
},
"specialist": {
"name": "Specialist - hard work: quality first, Fable #low head, then Claude Sonnet, Argon, Meta Spark, OpenAI",
// Class fallback (Drew 2026-11-13): specialist is the
// SINK - no class fallback out of specialist. If every
// specialist leg is down, the call errors; there is no
// cheaper class to fall back to and nothing above it.
// 2026-11-10 (Drew, direct order): Fable #low (fable-plan,
// _claude door) takes the HEAD of this chain. AA v5 #low
// II 53.9 tops every member it now leads (the former head,
Expand Down Expand Up @@ -3392,6 +3439,15 @@
},
"summit": {
"name": "Summit - very complex design only, deliberate use: Fable #low head, then Opus, Argon, Hydrogen, Wonder, Sol",
// Class fallback (Drew 2026-11-13): on exhaustion this class
// escalates to the route(s) appended at the END of its targets.
// Per-call visited-set semantics: the route expander prunes
// re-entry into a route already on the expansion path, so
// escalation never re-enters a tried class and always
// terminates at specialist, the sink. Full layout:
// .opencode/route-fallbacks.md; guard:
// bin/check-opencode-route-rules.mjs (CLASS_FALLBACKS).
// Summit's only edge: specialist (the sink).
// 2026-11-11 (Drew, direct order): fable-plan leg low -> medium.
// 2026-11-10 (Drew, direct order): Fable #low (fable-plan,
// _claude door) takes the HEAD of this chain. AA v5 #low
Expand Down Expand Up @@ -3429,13 +3485,24 @@
"opencode-route/argon-plan#high",
"_antigravity/gemini-4-hydrogen#high",
"_muse/muse-wonder-1.0-contributor#xhigh",
"opencode-route/sol-plan#xhigh"
"opencode-route/sol-plan#xhigh",
"opencode-route/specialist"
],
"selection": "ordered",
"autonomy": "rules"
},
"speed": {
"name": "Speed - fastest seats at or above the Haiku bar, for latency-bound work",
// Class fallback (Drew 2026-11-13): on exhaustion this class
// escalates to the route(s) appended at the END of its targets.
// Per-call visited-set semantics: the route expander prunes
// re-entry into a route already on the expansion path, so
// escalation never re-enters a tried class and always
// terminates at specialist, the sink. Full layout:
// .opencode/route-fallbacks.md; guard:
// bin/check-opencode-route-rules.mjs (CLASS_FALLBACKS).
// Speed's chain: workhorse first (cheaper, more
// available), then summit, then specialist (the sink).
// 2026-11-11 (Drew, direct order): ordered selection, haiku-plan leg LAST (last resort).
// 2026-10-26 pass 3 (AA figures re-baselined to v5 2026-10-31, #1673): a latency pool is judged on
// time-to-first-token as much as decode — Spark contributor #xhigh / TTFT 19.1s /
Expand Down Expand Up @@ -3469,7 +3536,10 @@
"_muse/muse-spark-1.3-contributor#xhigh",
"opencode-route/deepseek-flash-plan#high",
"opencode-route/gemini-hydrogen-plan#high",
"opencode-route/haiku-plan#high"
"opencode-route/haiku-plan#high",
"opencode-route/workhorse",
"opencode-route/summit",
"opencode-route/specialist"
],
"selection": "ordered",
"autonomy": "rules"
Expand Down Expand Up @@ -3560,7 +3630,9 @@
// 2026-10-27 from luna-haiku-100k; the pre-2026-11-13
// shape seated luna-plan#xhigh + haiku-plan#high under
// a 200k route cap.
"targets": ["opencode-route/limited"],
// Class fallback (Drew 2026-11-13): small -> speed (see
// the scout route's note + route-fallbacks.md).
"targets": ["opencode-route/limited", "opencode-route/speed"],
"selection": "ordered",
"autonomy": "rules"
}
Expand Down
93 changes: 93 additions & 0 deletions .opencode/route-fallbacks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Route fallback layout (Drew, 2026-11-13)

The complete fallback layout for every route in `.opencode/opencode.jsonc`.
The class edges are wired as the FINAL targets of each class route and are
guarded by `bin/check-opencode-route-rules.mjs` (`CLASS_FALLBACKS` there must
match this table and the config; the guard fails on drift).

## Semantics (Drew 2026-11-13)

1. **Regular chain first.** A pool's own regular chain always runs first and
completely — ordered targets, weighted draws, and door failover inside the
*-plan pools included. Class fallback never interleaves with or
short-circuits the regular chain.
2. **Fallback is a second pass.** Fallback is a per-pool property and engages
only after that pool's full regular chain is exhausted (all legs failed or
quota-walled; a 100%-walled leg is never attempted — it counts as
exhausted immediately). The fallback class brings its own seats and
purpose.
3. **Walked down the chain, no repeats.** Entering a fallback class runs THAT
class's full regular chain first, then its own fallback if it too
exhausts — subject to a per-call visited set: a class already tried in
this call is skipped, never re-entered. The class set is finite and each
escalation consumes one, so every walk terminates at **specialist**, the
sink. (Mechanism: the fork's route expander carries the expansion path
and prunes re-entry into a route already on it, so the legal pairs
workhorse → scout / scout → workhorse cannot loop.)

## Class routes (confirmed by Drew, except the two marked PROPOSAL)

| Route | Regular chain (in order) | Class fallback | Why |
| --- | --- | --- | --- |
| small | limited (the per-member pool) | → speed | Light tier escalates to the latency tier. |
| speed | Spark #xhigh → deepseek-flash-plan #high → gemini-hydrogen-plan #high → haiku-plan #high | → workhorse → summit → specialist | Cheaper / more-available first, quality next, sink last. |
| workhorse | workhorse-ordered → workhorse-primary (empty stage) → workhorse-weighted → workhorse-last-resort | → scout → specialist | Workhorse's failure mode is quota exhaustion; scout diversifies onto different doors (free Beam via CommandCode, DeepSeek #low, Haiku #low). Scout-first was main's recommendation, wired 2026-11-13 pending Drew's pick. |
| summit | fable-plan #medium → opus-plan #high → argon-plan #high → Hydrogen #high (direct) → Wonder #xhigh (direct) → sol-plan #xhigh | → specialist | Confirmed: the deliberate tier falls back to the hard-work tier. |
| specialist | fable-plan #low → sonnet-plan #high → argon-plan #high → spark-plan #xhigh → sol-plan #medium | — (SINK) | No class fallback out of specialist; if every leg is down the call errors. |
| scout | beam-plan → deepseek-flash-plan #low → haiku-plan #low | → workhorse (PROPOSAL) | Drew has not ruled on scout yet (2026-11-13): routine work that exhausts the free/cheap seats escalates to the standard tier. |
| background | MiMo Flash / DeepSeek Flash #high, peak-window aware (see config) | → workhorse (PROPOSAL) | Drew has not ruled on background yet (2026-11-13): patient queue work escalates to the standard tier. |

## Workhorse stages and trial routes (no own class edges — escalation is workhorse's)

| Route | Targets | Fallback |
| --- | --- | --- |
| workhorse-ordered | deepseek-effort-rr | Inherits workhorse (stage 1 of its chain). |
| workhorse-primary | — (deliberately empty; contributes nothing) | Inherits workhorse (stage 2). |
| workhorse-weighted | luna-effort-rr w10, Spark contributor #high w10, Hydrogen #low w10, Sonnet 5.5 #medium (direct _antigravity) w10 | Inherits workhorse (stage 3). |
| workhorse-last-resort | Sonnet 5.5 #medium (direct _claude) → fable-plan #low | Inherits workhorse (stage 4, last before the class fallback). |
| deepseek-effort-rr | deepseek-flash-plan #high w3 / #low w1 (weighted trial, PR #9381) | Inherits workhorse via workhorse-ordered. |
| luna-effort-rr | openai-plan Luna #medium / #high (round-robin trial, PR #9018) | Inherits its consumers (workhorse-weighted). |
| limited | Luna @100k #medium → Terra @388k #low → MiMo/DeepSeek-small peak-aware → Haiku @388k #medium | Inherits small. |
| deepseek-flash | deepseek-flash-plan (pass-through wrapper) | Inherits its consumers. |

## *-plan pools (no class edges — fallback is internal door failover)

Class escalation is inherited from the consuming class route above; a plan
never escalates on its own. "Doors" are the providers the pool fails over
between, in the pool's selection order.

| Pool | Doors (selection) | Note |
| --- | --- | --- |
| deepseek-flash-plan | OpenCode Go (3 workspaces) → ClinePass → OpenDesign → CommandCode → Mistral plan (round-robin) | The fleet's main DeepSeek pool. |
| deepseek-pro-plan | OpenCode Go → ClinePass → OpenDesign → CommandCode (round-robin) | Pro sibling of the flash pool. |
| luna-plan | openai-plan → OpenDesign → OpenCode Go (round-robin) | Legs present different contexts (200k vs 1.05M native). |
| terra-plan | openai-plan only (round-robin over its 2 doors) | Single-plan pool; door failover is openai-plan's. |
| sol-plan | openai-plan → OpenDesign → CommandCode (round-robin) | |
| fable-plan | _claude only | **Single door — no internal failover.** If _claude is down, consumers fall through to their next seat. |
| haiku-plan | _claude only | **Single door — no internal failover** (same fall-through). |
| sonnet-plan | _claude → Antigravity (round-robin) | |
| opus-plan | _claude → Antigravity (ordered) | |
| spark-plan | OpenCode Go → CommandCode → ClinePass → _muse (ordered) | Meta Spark across four doors. |
| argon-plan | OpenCode Go → Antigravity (round-robin) | |
| gemini-hydrogen-plan | Antigravity only | **Single door — no internal failover.** |
| beam-plan | CommandCode (beam:free) → OpenCode Go (beam-free) (round-robin) | The free-tier pool behind scout. |
| mimo-flash-plan | OpenCode Go → ClinePass → OpenDesign → CommandCode (round-robin) | |
| glm-5-3-plan | _vibe (Mistral) only | **Single door — no internal failover.** |
| glm-5-3-flash-plan | _vibe (Mistral) only | **Single door — no internal failover.** |

## Provider routes (door sets, expanded per model)

| Provider route | Doors |
| --- | --- |
| openai-plan | _openai.alt, _openai.main (server-side round-robin) |
| mistral-plan | _vibe, mistral |
| opencode-go-plans | opencode-go.drewrypope, opencode-go.popesdrew, opencode-go.developing-today-0 |

## Guard

`bin/check-opencode-route-rules.mjs` enforces: (a) each class route's targets
end with exactly its declared fallback chain (drift fails); (b) every class
can reach specialist through the fallback graph; (c) a simulated escalation
walk from every class terminates at specialist without revisiting a class;
(d) the composition graph (all route→route edges EXCEPT the declared
fallback pairs) is acyclic — a composition cycle is reported with its path.
Loading