@femtomc/mu-agent 26.2.105 → 26.2.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/assets/mu-tui-logo.png +0 -0
- package/package.json +2 -2
- package/prompts/skills/crons/SKILL.md +1 -0
- package/prompts/skills/heartbeats/SKILL.md +1 -0
- package/prompts/skills/hud/SKILL.md +4 -3
- package/prompts/skills/model-routing/SKILL.md +336 -0
- package/prompts/skills/mu/SKILL.md +2 -0
- package/prompts/skills/orchestration/SKILL.md +15 -10
- package/prompts/skills/planning/SKILL.md +7 -0
- package/prompts/skills/subagents/SKILL.md +21 -2
package/README.md
CHANGED
package/assets/mu-tui-logo.png
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@femtomc/mu-agent",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.106",
|
|
4
4
|
"description": "Shared operator runtime for mu assistant sessions and serve extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mu",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"themes/**"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@femtomc/mu-core": "26.2.
|
|
28
|
+
"@femtomc/mu-core": "26.2.106",
|
|
29
29
|
"@mariozechner/pi-agent-core": "^0.54.2",
|
|
30
30
|
"@mariozechner/pi-ai": "^0.54.2",
|
|
31
31
|
"@mariozechner/pi-coding-agent": "^0.54.2",
|
|
@@ -154,6 +154,7 @@ For DAG execution workloads, combine with:
|
|
|
154
154
|
- `planning`
|
|
155
155
|
- `orchestration`
|
|
156
156
|
- `control-flow` (when explicit loop/termination policy is required)
|
|
157
|
+
- `model-routing` (when per-issue model/provider/thinking policy is required)
|
|
157
158
|
- `subagents`
|
|
158
159
|
- `heartbeats` (for short-cadence wake loops)
|
|
159
160
|
|
|
@@ -147,6 +147,7 @@ For hierarchical DAG execution, pair this skill with:
|
|
|
147
147
|
- `planning`
|
|
148
148
|
- `orchestration`
|
|
149
149
|
- `control-flow` (when explicit loop/termination policy is required)
|
|
150
|
+
- `model-routing` (when per-issue model/provider/thinking policy is required)
|
|
150
151
|
- `subagents`
|
|
151
152
|
|
|
152
153
|
For wall-clock scheduling semantics (`at`, `every`, `cron`), use `crons`.
|
|
@@ -19,7 +19,7 @@ This skill is the canonical HUD reference for:
|
|
|
19
19
|
- [HudDoc shape](#huddoc-shape)
|
|
20
20
|
- [Recommended turn loop](#recommended-turn-loop)
|
|
21
21
|
- [Ownership and teardown protocol](#ownership-and-teardown-protocol)
|
|
22
|
-
- [Planning and
|
|
22
|
+
- [Planning, subagents, and model-routing profiles](#planning-subagents-and-model-routing-profiles)
|
|
23
23
|
- [Determinism and rendering limits](#determinism-and-rendering-limits)
|
|
24
24
|
- [Evaluation scenarios](#evaluation-scenarios)
|
|
25
25
|
|
|
@@ -143,7 +143,7 @@ that skill declares HUD-required behavior.
|
|
|
143
143
|
|
|
144
144
|
1. **Own explicit `hud_id` values**
|
|
145
145
|
- Each active skill owns one canonical doc id (for example `planning`,
|
|
146
|
-
`subagents`, `control-flow`).
|
|
146
|
+
`subagents`, `control-flow`, `model-routing`).
|
|
147
147
|
- Prefer `remove <hud_id>` over `clear` to avoid deleting other skills’ docs.
|
|
148
148
|
|
|
149
149
|
2. **Teardown is mandatory at skill end**
|
|
@@ -168,12 +168,13 @@ Example full teardown (no next HUD skill):
|
|
|
168
168
|
{"action":"off"}
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
## Planning and
|
|
171
|
+
## Planning, subagents, and model-routing profiles
|
|
172
172
|
|
|
173
173
|
Use profile-specific `hud_id` values:
|
|
174
174
|
|
|
175
175
|
- planning profile: `hud_id: "planning"`
|
|
176
176
|
- subagents profile: `hud_id: "subagents"`
|
|
177
|
+
- model-routing profile: `hud_id: "model-routing"`
|
|
177
178
|
|
|
178
179
|
Treat these as conventions layered on top of this generic contract.
|
|
179
180
|
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: model-routing
|
|
3
|
+
description: "Adds a model-selection overlay for issue DAG execution, recommending provider/model/thinking per issue from live harness capabilities."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# model-routing
|
|
7
|
+
|
|
8
|
+
Use this skill when execution should choose different models for different issue
|
|
9
|
+
kinds (for example code vs docs), while preserving orchestration protocol
|
|
10
|
+
semantics.
|
|
11
|
+
|
|
12
|
+
## Contents
|
|
13
|
+
|
|
14
|
+
- [Purpose](#purpose)
|
|
15
|
+
- [Required dependencies](#required-dependencies)
|
|
16
|
+
- [Core contract](#core-contract)
|
|
17
|
+
- [Overlay identity (`route:model-routing-v1`)](#overlay-identity-routemodel-routing-v1)
|
|
18
|
+
- [Tag vocabulary](#tag-vocabulary)
|
|
19
|
+
- [Recommendation packet contract](#recommendation-packet-contract)
|
|
20
|
+
- [Selection algorithm (deterministic)](#selection-algorithm-deterministic)
|
|
21
|
+
- [Transition table](#transition-table)
|
|
22
|
+
- [Planning handoff contract](#planning-handoff-contract)
|
|
23
|
+
- [Subagents/heartbeat execution contract](#subagentsheartbeat-execution-contract)
|
|
24
|
+
- [Failure + fallback policy](#failure--fallback-policy)
|
|
25
|
+
- [HUD visibility and teardown](#hud-visibility-and-teardown)
|
|
26
|
+
- [Evaluation scenarios](#evaluation-scenarios)
|
|
27
|
+
|
|
28
|
+
## Purpose
|
|
29
|
+
|
|
30
|
+
Model-routing policies are overlays. They do not replace `orchestration`
|
|
31
|
+
protocol semantics.
|
|
32
|
+
|
|
33
|
+
Examples:
|
|
34
|
+
- use a strong coding model for implementation leaves
|
|
35
|
+
- use a stronger writing model for docs/synthesis leaves
|
|
36
|
+
- choose lower-cost fast models for routine triage
|
|
37
|
+
- escalate to deeper thinking for high-risk or complex nodes
|
|
38
|
+
|
|
39
|
+
## Required dependencies
|
|
40
|
+
|
|
41
|
+
Load these skills before applying model-routing policies:
|
|
42
|
+
|
|
43
|
+
- `orchestration` (protocol primitives/invariants)
|
|
44
|
+
- `subagents` (durable execution runtime)
|
|
45
|
+
- `heartbeats` and/or `crons` (scheduler clock)
|
|
46
|
+
- `hud` (required visibility/handoff surface)
|
|
47
|
+
- `control-flow` (optional; when loop/termination overlays are also active)
|
|
48
|
+
|
|
49
|
+
## Core contract
|
|
50
|
+
|
|
51
|
+
1. **Overlay, don’t fork protocol**
|
|
52
|
+
- Keep `hierarchical-work.protocol/v1` + `proto:hierarchical-work-v1`.
|
|
53
|
+
- Do not redefine `kind:*`, `ctx:*`, issue lifecycle semantics, or DAG validity.
|
|
54
|
+
|
|
55
|
+
2. **Harness is source-of-truth**
|
|
56
|
+
- Drive recommendations from `mu control harness --json`.
|
|
57
|
+
- Only consider authenticated providers unless policy explicitly allows otherwise.
|
|
58
|
+
|
|
59
|
+
3. **Recommend, then apply**
|
|
60
|
+
- Route decisions are explicit artifacts (forum packets + optional tags),
|
|
61
|
+
not hidden implicit behavior.
|
|
62
|
+
|
|
63
|
+
4. **Non-blocking by default**
|
|
64
|
+
- Routing failure should degrade safely (fallback model / default model)
|
|
65
|
+
unless a hard requirement cannot be met.
|
|
66
|
+
|
|
67
|
+
5. **Bounded pass per tick**
|
|
68
|
+
- One routing decision and one bounded mutation/action bundle per heartbeat pass.
|
|
69
|
+
|
|
70
|
+
6. **Per-issue/session overrides preferred**
|
|
71
|
+
- Use `mu exec --provider/--model/--thinking` or `mu turn ...` overrides.
|
|
72
|
+
- Avoid changing workspace-global operator defaults for per-issue routing.
|
|
73
|
+
|
|
74
|
+
## Overlay identity (`route:model-routing-v1`)
|
|
75
|
+
|
|
76
|
+
- Tag scope root (or selected subtree root) with: `route:model-routing-v1`
|
|
77
|
+
- Routing metadata remains orthogonal to `kind:*`, `ctx:*`, and `flow:*`.
|
|
78
|
+
|
|
79
|
+
## Tag vocabulary
|
|
80
|
+
|
|
81
|
+
Recommended routing tags (policy metadata):
|
|
82
|
+
|
|
83
|
+
- Scope:
|
|
84
|
+
- `route:model-routing-v1`
|
|
85
|
+
- Task family:
|
|
86
|
+
- `route:task:code`
|
|
87
|
+
- `route:task:docs`
|
|
88
|
+
- `route:task:research`
|
|
89
|
+
- `route:task:ops`
|
|
90
|
+
- `route:task:review`
|
|
91
|
+
- `route:task:synth`
|
|
92
|
+
- `route:task:general`
|
|
93
|
+
- Depth intent:
|
|
94
|
+
- `route:depth:fast`
|
|
95
|
+
- `route:depth:balanced`
|
|
96
|
+
- `route:depth:deep`
|
|
97
|
+
- Budget intent:
|
|
98
|
+
- `route:budget:low`
|
|
99
|
+
- `route:budget:balanced`
|
|
100
|
+
- `route:budget:premium`
|
|
101
|
+
- Hard modality requirement:
|
|
102
|
+
- `route:modality:image` (omit for text-only)
|
|
103
|
+
- Pin indicator:
|
|
104
|
+
- `route:pin` (exact provider/model comes from packet metadata)
|
|
105
|
+
|
|
106
|
+
Notes:
|
|
107
|
+
- Keep tags concise and stable.
|
|
108
|
+
- Put detailed routing config in forum packets (not in tag strings).
|
|
109
|
+
|
|
110
|
+
## Recommendation packet contract
|
|
111
|
+
|
|
112
|
+
Post one `ROUTE_RECOMMENDATION` packet to `issue:<issue-id>` before launching work
|
|
113
|
+
with a selected model.
|
|
114
|
+
|
|
115
|
+
Suggested packet shape (JSON block inside forum message):
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
ROUTE_RECOMMENDATION:
|
|
119
|
+
{
|
|
120
|
+
"version": "route:model-routing-v1",
|
|
121
|
+
"issue_id": "<issue-id>",
|
|
122
|
+
"harness_fingerprint": "<sha256>",
|
|
123
|
+
"selected": {
|
|
124
|
+
"provider": "<provider>",
|
|
125
|
+
"model": "<model>",
|
|
126
|
+
"thinking": "<thinking-level>"
|
|
127
|
+
},
|
|
128
|
+
"alternates": [
|
|
129
|
+
{ "provider": "<provider>", "model": "<model>", "thinking": "<thinking-level>" }
|
|
130
|
+
],
|
|
131
|
+
"constraints": {
|
|
132
|
+
"task": "code|docs|research|ops|review|synth|general",
|
|
133
|
+
"depth": "fast|balanced|deep",
|
|
134
|
+
"budget": "low|balanced|premium",
|
|
135
|
+
"modality": "text|image",
|
|
136
|
+
"min_context_window": 0
|
|
137
|
+
},
|
|
138
|
+
"rationale": [
|
|
139
|
+
"provider authenticated",
|
|
140
|
+
"supports required thinking level",
|
|
141
|
+
"meets context/modality constraints",
|
|
142
|
+
"best score under budget/depth policy"
|
|
143
|
+
],
|
|
144
|
+
"created_at_ms": 0
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Optional root-level packet for custom preferences:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
ROUTE_POLICY:
|
|
152
|
+
{
|
|
153
|
+
"version": "route:model-routing-v1",
|
|
154
|
+
"task_preferences": {
|
|
155
|
+
"code": [
|
|
156
|
+
{ "provider": "openai-codex", "model": "gpt-5.3-codex", "thinking": "xhigh" }
|
|
157
|
+
],
|
|
158
|
+
"docs": [
|
|
159
|
+
{ "provider": "openrouter", "model": "google/gemini-3.1-pro-preview", "thinking": "high" }
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
If a preference entry is unavailable under current harness/auth state, skip it and
|
|
166
|
+
continue deterministic fallback selection.
|
|
167
|
+
|
|
168
|
+
## Selection algorithm (deterministic)
|
|
169
|
+
|
|
170
|
+
### Inputs
|
|
171
|
+
|
|
172
|
+
- Issue tags (`route:task:*`, `route:depth:*`, `route:budget:*`, `route:modality:image`, `route:pin`)
|
|
173
|
+
- Optional `ROUTE_POLICY` and per-issue constraints from forum/body
|
|
174
|
+
- Live harness snapshot (`mu control harness --json`)
|
|
175
|
+
|
|
176
|
+
### Step 1: gather live capabilities
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
mu control harness --json --pretty
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Step 2: build candidate set
|
|
183
|
+
|
|
184
|
+
1. Start from authenticated providers only.
|
|
185
|
+
2. Flatten model entries across providers.
|
|
186
|
+
3. Filter by hard requirements:
|
|
187
|
+
- required modality (`text` and optional `image`)
|
|
188
|
+
- minimum context window (if specified)
|
|
189
|
+
- pin requirement (`route:pin`) if specified
|
|
190
|
+
4. Resolve target thinking from depth intent:
|
|
191
|
+
- `fast` -> `minimal`
|
|
192
|
+
- `balanced` -> `medium`
|
|
193
|
+
- `deep` -> `xhigh` if available, else `high`
|
|
194
|
+
5. Clamp chosen thinking to model-supported `thinking_levels`.
|
|
195
|
+
|
|
196
|
+
### Step 3: score candidates
|
|
197
|
+
|
|
198
|
+
Use deterministic score components (example):
|
|
199
|
+
|
|
200
|
+
- Hard-fit gates (must pass): auth, modality, context, thinking compatibility
|
|
201
|
+
- Soft score:
|
|
202
|
+
- task preference match (`ROUTE_POLICY`/task family)
|
|
203
|
+
- reasoning/xhigh capability vs depth
|
|
204
|
+
- context headroom
|
|
205
|
+
- budget penalty from per-token cost
|
|
206
|
+
|
|
207
|
+
Tie-breaker: lower estimated cost, then lexicographic `provider/model`.
|
|
208
|
+
|
|
209
|
+
### Step 4: select + alternates
|
|
210
|
+
|
|
211
|
+
- pick top candidate as `selected`
|
|
212
|
+
- keep next N as `alternates` (recommended N=2)
|
|
213
|
+
- post `ROUTE_RECOMMENDATION` packet
|
|
214
|
+
|
|
215
|
+
### Step 5: apply selection
|
|
216
|
+
|
|
217
|
+
For one-shot execution:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
mu exec --provider <provider> --model <model> --thinking <thinking> \
|
|
221
|
+
"Use skills subagents, orchestration, model-routing, and hud. Work issue <issue-id>."
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
For existing session turn:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
mu turn --session-kind cp_operator --session-id <session-id> \
|
|
228
|
+
--provider <provider> --model <model> --thinking <thinking> \
|
|
229
|
+
--body "Continue issue <issue-id> with current routing selection."
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Transition table
|
|
233
|
+
|
|
234
|
+
Given an executable issue under `route:model-routing-v1`:
|
|
235
|
+
|
|
236
|
+
1. **No routing decision yet**
|
|
237
|
+
- action: compute recommendation + post `ROUTE_RECOMMENDATION` packet
|
|
238
|
+
|
|
239
|
+
2. **Routing decision exists and still valid**
|
|
240
|
+
- action: execute issue using selected provider/model/thinking
|
|
241
|
+
|
|
242
|
+
3. **Selected route fails at launch/runtime**
|
|
243
|
+
- action: choose next alternate, post `ROUTE_FALLBACK`, retry bounded once
|
|
244
|
+
|
|
245
|
+
4. **All alternates exhausted**
|
|
246
|
+
- action: degrade to harness default model, post `ROUTE_DEGRADED`
|
|
247
|
+
|
|
248
|
+
5. **Hard requirement unmet (no valid candidates)**
|
|
249
|
+
- action: create `kind:ask` node (`ctx:human`, `actor:user`) requesting
|
|
250
|
+
provider auth/config change or constraint relaxation
|
|
251
|
+
|
|
252
|
+
## Planning handoff contract
|
|
253
|
+
|
|
254
|
+
When planning a routed subtree:
|
|
255
|
+
|
|
256
|
+
1. Tag policy scope with `route:model-routing-v1`.
|
|
257
|
+
2. Tag executable nodes with task/depth/budget intent.
|
|
258
|
+
3. Record any hard constraints (modality/context) in issue body or forum packet.
|
|
259
|
+
4. Optionally add root `ROUTE_POLICY` preferences.
|
|
260
|
+
5. Ensure DAG remains valid under `orchestration` invariants:
|
|
261
|
+
- `mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty`
|
|
262
|
+
- `mu issues validate <root-id>`
|
|
263
|
+
|
|
264
|
+
## Subagents/heartbeat execution contract
|
|
265
|
+
|
|
266
|
+
Per orchestrator tick:
|
|
267
|
+
|
|
268
|
+
1. Read tree + ready set + latest route packet on target issue.
|
|
269
|
+
2. Read harness snapshot once per pass.
|
|
270
|
+
3. Select one routing transition from the table above.
|
|
271
|
+
4. Apply one bounded mutation bundle (recommend/fallback/ask/execute-start).
|
|
272
|
+
5. Verify with:
|
|
273
|
+
- `mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty`
|
|
274
|
+
- `mu issues validate <root-id>`
|
|
275
|
+
6. Update HUD state.
|
|
276
|
+
7. Post one concise `ORCH_PASS` status update.
|
|
277
|
+
8. If root is final, disable supervising heartbeat.
|
|
278
|
+
|
|
279
|
+
Reusable heartbeat prompt fragment:
|
|
280
|
+
|
|
281
|
+
```text
|
|
282
|
+
Use skills orchestration, model-routing, subagents, and hud.
|
|
283
|
+
For root <root-id>, enforce route:model-routing-v1.
|
|
284
|
+
Run exactly one bounded routing/orchestration transition pass: compute or validate
|
|
285
|
+
one issue's model recommendation from live `mu control harness` capabilities,
|
|
286
|
+
apply one action, verify DAG state, post one ORCH_PASS, then stop.
|
|
287
|
+
If validate is final, disable the supervising heartbeat and report completion.
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Failure + fallback policy
|
|
291
|
+
|
|
292
|
+
1. **Provider/model unavailable or auth drift**
|
|
293
|
+
- post `ROUTE_FALLBACK`
|
|
294
|
+
- move to next alternate
|
|
295
|
+
|
|
296
|
+
2. **Thinking level unsupported for selected model**
|
|
297
|
+
- clamp to nearest supported lower level
|
|
298
|
+
- post rationale in fallback packet
|
|
299
|
+
|
|
300
|
+
3. **No candidates satisfy hard constraints**
|
|
301
|
+
- create `kind:ask` escalation with clear options:
|
|
302
|
+
- authenticate provider X
|
|
303
|
+
- relax modality/context/depth constraint
|
|
304
|
+
- approve default-model execution
|
|
305
|
+
|
|
306
|
+
4. **Auditability requirement**
|
|
307
|
+
- every route change emits forum packet (`ROUTE_RECOMMENDATION`,
|
|
308
|
+
`ROUTE_FALLBACK`, `ROUTE_DEGRADED`)
|
|
309
|
+
|
|
310
|
+
## HUD visibility and teardown
|
|
311
|
+
|
|
312
|
+
HUD usage is not optional for active model-routing execution.
|
|
313
|
+
|
|
314
|
+
- If subagents HUD is active, publish routing state there (selected model,
|
|
315
|
+
alternates remaining, last fallback reason).
|
|
316
|
+
- If running model-routing standalone, own `hud_id:"model-routing"`.
|
|
317
|
+
- Update HUD each bounded pass before ORCH_PASS output.
|
|
318
|
+
- Follow `hud` skill ownership/teardown protocol on completion or handoff.
|
|
319
|
+
|
|
320
|
+
## Evaluation scenarios
|
|
321
|
+
|
|
322
|
+
1. **Coding leaf selects deep coding model**
|
|
323
|
+
- Setup: `route:task:code`, `route:depth:deep`, authenticated coding provider.
|
|
324
|
+
- Expected: recommendation picks a deep reasoning coding model and starts work.
|
|
325
|
+
|
|
326
|
+
2. **Docs leaf prefers writing model**
|
|
327
|
+
- Setup: `route:task:docs` with root `ROUTE_POLICY` preference for docs.
|
|
328
|
+
- Expected: recommendation uses preferred docs model when available, otherwise fallback.
|
|
329
|
+
|
|
330
|
+
3. **Auth/provider drift fallback**
|
|
331
|
+
- Setup: selected provider becomes unauthenticated mid-run.
|
|
332
|
+
- Expected: `ROUTE_FALLBACK` packet and alternate selection in next bounded pass.
|
|
333
|
+
|
|
334
|
+
4. **Hard requirement escalation**
|
|
335
|
+
- Setup: issue requires image input but no authenticated image-capable models.
|
|
336
|
+
- Expected: `kind:ask` node created; downstream remains blocked until user action.
|
|
@@ -179,6 +179,7 @@ mu cron --help
|
|
|
179
179
|
When work is multi-step and issue-graph driven, use `planning` to shape the DAG,
|
|
180
180
|
then `hud` for canonical HUD behavior, then `orchestration` to keep DAG
|
|
181
181
|
semantics consistent, then `control-flow` for explicit loop/termination policy,
|
|
182
|
+
then `model-routing` for per-issue provider/model/thinking selection overlays,
|
|
182
183
|
then `subagents` for durable execution.
|
|
183
184
|
For REPL-driven exploration and context compression, use `code-mode`.
|
|
184
185
|
For persistent terminal sessions and worker fan-out mechanics, use `tmux`.
|
|
@@ -206,6 +207,7 @@ For wall-clock schedules (one-shot, interval, cron-expression), use `crons`.
|
|
|
206
207
|
- HUD contract/state updates across surfaces: **`hud`**
|
|
207
208
|
- Shared DAG semantics for planning + execution: **`orchestration`**
|
|
208
209
|
- Loop/termination policy overlays (review gates, retries, escalation): **`control-flow`**
|
|
210
|
+
- Per-issue model/provider/thinking selection overlays: **`model-routing`**
|
|
209
211
|
- Live REPL execution and context engineering via tmux: **`code-mode`**
|
|
210
212
|
- Persistent tmux session management + worker fan-out primitives: **`tmux`**
|
|
211
213
|
- Durable multi-agent orchestration: **`subagents`**
|
|
@@ -13,7 +13,7 @@ This skill supersedes the previous `hierarchical-work-protocol` skill name.
|
|
|
13
13
|
|
|
14
14
|
- [Protocol identity](#protocol-identity)
|
|
15
15
|
- [Canonical tags and node roles](#canonical-tags-and-node-roles)
|
|
16
|
-
- [
|
|
16
|
+
- [Policy overlays](#policy-overlays)
|
|
17
17
|
- [Protocol primitives](#protocol-primitives)
|
|
18
18
|
- [Required invariants](#required-invariants)
|
|
19
19
|
- [Planning handoff contract](#planning-handoff-contract)
|
|
@@ -65,19 +65,24 @@ Node role rules:
|
|
|
65
65
|
- Must include: `proto:hierarchical-work-v1`, `kind:ask`, `ctx:human`, `actor:user`
|
|
66
66
|
- Must be non-executable (`node:agent` removed)
|
|
67
67
|
|
|
68
|
-
##
|
|
68
|
+
## Policy overlays
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
primitives or `kind:*` semantics.
|
|
70
|
+
Policy overlays are layered on top of this protocol and should not redefine
|
|
71
|
+
protocol primitives or `kind:*` semantics.
|
|
72
72
|
|
|
73
73
|
- Keep orchestration protocol tags/kinds as source-of-truth for structure.
|
|
74
|
-
- Represent policy-specific behavior
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
- Represent policy-specific behavior with overlay tags/metadata:
|
|
75
|
+
- loop/termination policy (for example review gates, retry rounds,
|
|
76
|
+
escalation thresholds): `flow:*`
|
|
77
|
+
- per-issue model/provider/thinking routing policy: `route:*`
|
|
78
|
+
- Compile overlay decisions into existing primitives (`spawn`, `fork`, `expand`,
|
|
79
|
+
`ask`, `complete`, `serial`) and per-turn/per-session model overrides
|
|
80
|
+
(`mu exec` / `mu turn` with `--provider --model --thinking`) instead of
|
|
81
|
+
introducing ad-hoc mutations.
|
|
82
|
+
|
|
83
|
+
Current compositional overlay skills:
|
|
80
84
|
- `control-flow` (for example `flow:review-gated-v1` behavior)
|
|
85
|
+
- `model-routing` (for example `route:model-routing-v1` behavior)
|
|
81
86
|
|
|
82
87
|
## Protocol primitives
|
|
83
88
|
|
|
@@ -61,6 +61,11 @@ If the user asks for explicit loop/termination behavior (for example review-gate
|
|
|
61
61
|
retry rounds), load **`control-flow`** and encode policy via `flow:*` overlays
|
|
62
62
|
without changing orchestration protocol semantics.
|
|
63
63
|
|
|
64
|
+
If the user asks for per-issue model/provider/thinking recommendations based on
|
|
65
|
+
live harness capabilities, load **`model-routing`** and encode policy via
|
|
66
|
+
`route:*` overlays plus route packets (for example `ROUTE_POLICY`) without
|
|
67
|
+
changing orchestration protocol semantics.
|
|
68
|
+
|
|
64
69
|
## Core contract
|
|
65
70
|
|
|
66
71
|
1. **Investigate first**
|
|
@@ -71,6 +76,7 @@ without changing orchestration protocol semantics.
|
|
|
71
76
|
- Create root and child issues that comply with `hierarchical-work.protocol/v1`.
|
|
72
77
|
- Encode dependencies so the DAG reflects execution order and synth fan-in.
|
|
73
78
|
- Add clear titles, scope, acceptance criteria, and protocol tags.
|
|
79
|
+
- When model specialization is required, attach explicit `route:*` intent tags/constraints to executable nodes.
|
|
74
80
|
|
|
75
81
|
3. **Drive communication through the planning HUD**
|
|
76
82
|
- Load `hud` and use its canonical `mu_hud`/`HudDoc` contract.
|
|
@@ -234,4 +240,5 @@ Required HUD updates during the loop:
|
|
|
234
240
|
- Keep tasks small enough to complete in one focused pass.
|
|
235
241
|
- Explicitly call out uncertain assumptions for user confirmation.
|
|
236
242
|
- Prefer reversible plans and incremental checkpoints.
|
|
243
|
+
- If `model-routing` is in scope, route intent/constraints are explicit and non-conflicting.
|
|
237
244
|
- HUD state must be fresh, accurate, and aligned with user-visible status updates.
|
|
@@ -10,6 +10,7 @@ description: "Orchestrates issue-driven subagent execution with heartbeat superv
|
|
|
10
10
|
- [Purpose (what this skill is for)](#purpose-what-this-skill-is-for)
|
|
11
11
|
- [Shared protocol dependency](#shared-protocol-dependency)
|
|
12
12
|
- [Control-flow dependency](#control-flow-dependency)
|
|
13
|
+
- [Model-routing dependency](#model-routing-dependency)
|
|
13
14
|
- [HUD skill dependency](#hud-skill-dependency)
|
|
14
15
|
- [tmux skill dependency](#tmux-skill-dependency)
|
|
15
16
|
- [When to use](#when-to-use)
|
|
@@ -58,6 +59,19 @@ an overlay on orchestration primitives.
|
|
|
58
59
|
- Compile control-flow decisions into protocol primitives (`spawn`, `expand`,
|
|
59
60
|
`ask`, `complete`, `serial`), not ad-hoc mutations.
|
|
60
61
|
|
|
62
|
+
## Model-routing dependency
|
|
63
|
+
|
|
64
|
+
When a subtree declares per-issue model/provider/thinking policy (for example
|
|
65
|
+
`route:model-routing-v1`), load **`model-routing`** and apply routing transitions
|
|
66
|
+
as an overlay on orchestration primitives.
|
|
67
|
+
|
|
68
|
+
- Keep DAG structure protocol-valid (`orchestration` remains source-of-truth).
|
|
69
|
+
- Drive recommendations from live harness capabilities (`mu control harness --json`).
|
|
70
|
+
- Apply route selections with per-turn/per-session overrides (`mu exec`/`mu turn`
|
|
71
|
+
`--provider --model --thinking`) instead of mutating workspace-global defaults.
|
|
72
|
+
- Emit auditable route packets (`ROUTE_RECOMMENDATION`, `ROUTE_FALLBACK`,
|
|
73
|
+
`ROUTE_DEGRADED`) in forum topics.
|
|
74
|
+
|
|
61
75
|
## HUD skill dependency
|
|
62
76
|
|
|
63
77
|
Before emitting or mutating subagent HUD state, load **`hud`** and follow its canonical contract.
|
|
@@ -142,6 +156,7 @@ For claimed issue `<issue-id>` under `<root-id>`:
|
|
|
142
156
|
|
|
143
157
|
1. Run `read_tree`.
|
|
144
158
|
2. Choose one primitive:
|
|
159
|
+
- route policy present and no valid route decision -> apply one `model-routing` transition
|
|
145
160
|
- missing input -> `ask`
|
|
146
161
|
- needs decomposition -> `expand`
|
|
147
162
|
- directly solvable -> `complete`
|
|
@@ -171,7 +186,7 @@ mu heartbeats create \
|
|
|
171
186
|
--title "hierarchical-work-v1 <root-id>" \
|
|
172
187
|
--reason orchestration_v1 \
|
|
173
188
|
--every-ms 15000 \
|
|
174
|
-
--prompt "Use skills subagents, orchestration, control-flow, and hud for root <root-id>. Run exactly one bounded orchestration pass: inspect the proto:hierarchical-work-v1 queue, perform exactly one corrective orchestration action (including in_progress-without-worker drift recovery) or claim/work-start one ready issue, then verify state. If flow:* policy tags are present, apply one control-flow transition from the control-flow skill in this pass. Report human-facing progress as a titled status note plus one concise paragraph that explains project context, milestone moved, impact, overall progress, and next high-level step; avoid low-level orchestration internals unless diagnosing a blocker/anomaly. Post a matching ORCH_PASS update to issue:<root-id>. Stop when 'mu issues validate <root-id>' is final."
|
|
189
|
+
--prompt "Use skills subagents, orchestration, control-flow, model-routing, and hud for root <root-id>. Run exactly one bounded orchestration pass: inspect the proto:hierarchical-work-v1 queue, perform exactly one corrective orchestration action (including in_progress-without-worker drift recovery) or claim/work-start one ready issue, then verify state. If flow:* policy tags are present, apply one control-flow transition from the control-flow skill in this pass. If route:* policy tags are present, apply one model-routing transition from the model-routing skill in this pass using live `mu control harness` capabilities and per-turn provider/model/thinking overrides. Report human-facing progress as a titled status note plus one concise paragraph that explains project context, milestone moved, impact, overall progress, and next high-level step; avoid low-level orchestration internals unless diagnosing a blocker/anomaly. Post a matching ORCH_PASS update to issue:<root-id>. Stop when 'mu issues validate <root-id>' is final."
|
|
175
190
|
```
|
|
176
191
|
|
|
177
192
|
Reusable status-voice add-on for heartbeat prompts (copy/paste):
|
|
@@ -191,7 +206,7 @@ run_id="$(date +%Y%m%d-%H%M%S)"
|
|
|
191
206
|
for issue_id in $(mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --json | jq -r '.[].id' | head -n 3); do
|
|
192
207
|
session="mu-sub-${run_id}-${issue_id}"
|
|
193
208
|
tmux new-session -d -s "$session" \
|
|
194
|
-
"cd '$PWD' && mu exec 'Use skills subagents, orchestration, control-flow, and hud. Work issue ${issue_id} using hierarchical-work.protocol/v1. If flow:* policy tags are present, apply the control-flow overlay before selecting the next primitive. Claim first, then run one full control loop.' ; rc=\$?; echo __MU_DONE__:\$rc"
|
|
209
|
+
"cd '$PWD' && mu exec 'Use skills subagents, orchestration, control-flow, model-routing, and hud. Work issue ${issue_id} using hierarchical-work.protocol/v1. If flow:* policy tags are present, apply the control-flow overlay before selecting the next primitive. If route:* policy tags are present, apply the model-routing overlay using live harness capabilities before selecting the next primitive. Claim first, then run one full control loop.' ; rc=\$?; echo __MU_DONE__:\$rc"
|
|
195
210
|
done
|
|
196
211
|
```
|
|
197
212
|
|
|
@@ -233,6 +248,10 @@ Tool: `mu_hud`
|
|
|
233
248
|
- Setup: worker encounters missing critical input.
|
|
234
249
|
- Expected: skill applies protocol `ask` semantics, creates a human-input node, and downstream work remains blocked until the answer issue closes.
|
|
235
250
|
|
|
251
|
+
4. **Model-routing overlay with fallback**
|
|
252
|
+
- Setup: ready issue tagged `route:model-routing-v1` and selected model fails at launch.
|
|
253
|
+
- Expected: one bounded pass emits `ROUTE_FALLBACK`, selects alternate/provider fallback deterministically, and continues execution without violating DAG protocol rules.
|
|
254
|
+
|
|
236
255
|
## Reconciliation
|
|
237
256
|
|
|
238
257
|
- Run `mu issues validate <root-id>` before declaring completion.
|