@femtomc/mu-agent 26.2.106 → 26.2.108
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 +41 -21
- package/assets/mu-tui-logo.png +0 -0
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/mu-command-dispatcher.d.ts +0 -1
- package/dist/extensions/mu-command-dispatcher.d.ts.map +1 -1
- package/dist/extensions/mu-command-dispatcher.js +5 -42
- package/dist/extensions/mu-operator.js +2 -2
- package/dist/extensions/mu-serve.js +2 -2
- package/dist/extensions/ui.d.ts +4 -0
- package/dist/extensions/ui.d.ts.map +1 -0
- package/dist/extensions/ui.js +1055 -0
- package/dist/operator.d.ts +93 -255
- package/dist/operator.d.ts.map +1 -1
- package/dist/operator.js +41 -32
- package/package.json +33 -33
- package/prompts/skills/automation/SKILL.md +25 -0
- package/prompts/skills/{crons → automation/crons}/SKILL.md +2 -2
- package/prompts/skills/{heartbeats → automation/heartbeats}/SKILL.md +2 -2
- package/prompts/skills/core/SKILL.md +28 -0
- package/prompts/skills/{code-mode → core/code-mode}/SKILL.md +1 -1
- package/prompts/skills/{memory → core/memory}/SKILL.md +2 -2
- package/prompts/skills/{mu → core/mu}/SKILL.md +52 -9
- package/prompts/skills/{tmux → core/tmux}/SKILL.md +1 -1
- package/prompts/skills/messaging/SKILL.md +27 -0
- package/prompts/skills/subagents/SKILL.md +93 -243
- package/prompts/skills/{control-flow → subagents/control-flow}/SKILL.md +122 -17
- package/prompts/skills/subagents/execution/SKILL.md +428 -0
- package/prompts/skills/{model-routing → subagents/model-routing}/SKILL.md +179 -19
- package/prompts/skills/subagents/planning/SKILL.md +393 -0
- package/prompts/skills/{orchestration → subagents/protocol}/SKILL.md +7 -10
- package/prompts/skills/writing/SKILL.md +3 -2
- package/dist/extensions/hud.d.ts +0 -4
- package/dist/extensions/hud.d.ts.map +0 -1
- package/dist/extensions/hud.js +0 -483
- package/prompts/skills/hud/SKILL.md +0 -205
- package/prompts/skills/planning/SKILL.md +0 -244
- /package/prompts/skills/{setup-discord → messaging/setup-discord}/SKILL.md +0 -0
- /package/prompts/skills/{setup-neovim → messaging/setup-neovim}/SKILL.md +0 -0
- /package/prompts/skills/{setup-slack → messaging/setup-slack}/SKILL.md +0 -0
- /package/prompts/skills/{setup-telegram → messaging/setup-telegram}/SKILL.md +0 -0
|
@@ -1,268 +1,118 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: subagents
|
|
3
|
-
description: "
|
|
3
|
+
description: "Meta-skill for protocol-driven planning and execution. Routes to planning, protocol, execution, control-flow, and model-routing with mu_ui-first communication."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# subagents
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Use this meta-skill when work should run through the full multi-agent DAG stack.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
- [Shared protocol dependency](#shared-protocol-dependency)
|
|
12
|
-
- [Control-flow dependency](#control-flow-dependency)
|
|
13
|
-
- [Model-routing dependency](#model-routing-dependency)
|
|
14
|
-
- [HUD skill dependency](#hud-skill-dependency)
|
|
15
|
-
- [tmux skill dependency](#tmux-skill-dependency)
|
|
16
|
-
- [When to use](#when-to-use)
|
|
17
|
-
- [Success condition](#success-condition)
|
|
18
|
-
- [Dispatch modes](#dispatch-modes)
|
|
19
|
-
- [Orchestration loops](#orchestration-loops)
|
|
20
|
-
- [Bootstrap and queue targeting](#bootstrap-and-queue-targeting)
|
|
21
|
-
- [Dispatch templates](#dispatch-templates)
|
|
22
|
-
- [Subagents HUD](#subagents-hud)
|
|
23
|
-
- [Evaluation scenarios](#evaluation-scenarios)
|
|
24
|
-
- [Reconciliation](#reconciliation)
|
|
25
|
-
- [Safety](#safety)
|
|
10
|
+
## Subskills
|
|
26
11
|
|
|
27
|
-
|
|
12
|
+
- `planning` — build/refine issue DAGs and approval loops.
|
|
13
|
+
- `protocol` — canonical DAG protocol contract and primitives.
|
|
14
|
+
- `execution` — durable orchestration/supervision loop over the DAG.
|
|
15
|
+
- `control-flow` — loop/termination overlays (`flow:*`) on top of protocol primitives.
|
|
16
|
+
- `model-routing` — provider/model/thinking overlays (`route:*`) from live harness capabilities.
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
over time, not just one-shot execution.
|
|
18
|
+
## Naming conventions
|
|
31
19
|
|
|
32
|
-
|
|
20
|
+
- Use `protocol` (not `orchestration`).
|
|
21
|
+
- Use `execution` for execution/supervision workflows.
|
|
33
22
|
|
|
34
|
-
|
|
35
|
-
- `tmux` + `mu exec` = parallel worker execution
|
|
36
|
-
- subagents HUD = operator observability/control board
|
|
23
|
+
## Recommended bundles
|
|
37
24
|
|
|
38
|
-
|
|
25
|
+
- Planning bundle: `planning` + `protocol`
|
|
26
|
+
- Execution bundle: `execution` + `protocol`
|
|
27
|
+
- Policy overlays: add `control-flow` and/or `model-routing` as needed
|
|
39
28
|
|
|
40
|
-
##
|
|
29
|
+
## Canonical mu_ui communication pattern
|
|
41
30
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Before orchestration begins, load that skill and enforce:
|
|
45
|
-
|
|
46
|
-
- Protocol ID/tag: `hierarchical-work.protocol/v1` + `proto:hierarchical-work-v1`
|
|
47
|
-
- Canonical node kinds, context tags, and invariants
|
|
48
|
-
- Primitive semantics (`read_tree`, `claim`, `spawn`, `fork`, `ask`, `expand`, `complete`, `serial`)
|
|
49
|
-
|
|
50
|
-
Do not run subagent orchestration against alternate protocol tags.
|
|
51
|
-
|
|
52
|
-
## Control-flow dependency
|
|
53
|
-
|
|
54
|
-
When a subtree declares explicit loop/termination policy (for example
|
|
55
|
-
`flow:review-gated-v1`), load **`control-flow`** and apply policy transitions as
|
|
56
|
-
an overlay on orchestration primitives.
|
|
57
|
-
|
|
58
|
-
- Keep DAG structure protocol-valid (`orchestration` remains source-of-truth).
|
|
59
|
-
- Compile control-flow decisions into protocol primitives (`spawn`, `expand`,
|
|
60
|
-
`ask`, `complete`, `serial`), not ad-hoc mutations.
|
|
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
|
-
|
|
75
|
-
## HUD skill dependency
|
|
76
|
-
|
|
77
|
-
Before emitting or mutating subagent HUD state, load **`hud`** and follow its canonical contract.
|
|
78
|
-
HUD usage is not optional for this skill.
|
|
79
|
-
|
|
80
|
-
- Treat `hud` as source-of-truth for generic `mu_hud` actions, `HudDoc` shape, and rendering constraints.
|
|
81
|
-
- This subagents skill defines orchestration-specific conventions only (for example `hud_id: "subagents"`, queue/activity semantics).
|
|
82
|
-
|
|
83
|
-
## tmux skill dependency
|
|
84
|
-
|
|
85
|
-
Before spawning/inspecting worker sessions, load **`tmux`** and follow its
|
|
86
|
-
canonical session lifecycle and bounded send/capture protocol.
|
|
87
|
-
|
|
88
|
-
- Treat `tmux` as source-of-truth for session ownership, completion markers, and teardown.
|
|
89
|
-
- This subagents skill defines orchestration semantics and queue policy.
|
|
90
|
-
|
|
91
|
-
## When to use
|
|
92
|
-
|
|
93
|
-
- Work is represented as issue-scoped deliverables with explicit outcomes.
|
|
94
|
-
- Dependencies may unblock over time.
|
|
95
|
-
- You want unattended progress between manual check-ins.
|
|
96
|
-
|
|
97
|
-
## Success condition
|
|
98
|
-
|
|
99
|
-
- Each executable issue is claimed, worked, and closed with an explicit outcome.
|
|
100
|
-
- Results are posted in `issue:<id>` forum topics.
|
|
101
|
-
- Root completion is validated via `mu issues validate <root-id>`.
|
|
102
|
-
|
|
103
|
-
## Dispatch modes
|
|
104
|
-
|
|
105
|
-
### 1) Heartbeat dispatch (orchestrator cadence)
|
|
106
|
-
|
|
107
|
-
Use when you want orchestration to continue over time.
|
|
108
|
-
|
|
109
|
-
Each heartbeat tick runs **one bounded orchestration pass**:
|
|
110
|
-
|
|
111
|
-
1. Read queue/tree state.
|
|
112
|
-
2. Select one protocol primitive/action.
|
|
113
|
-
3. Apply one bounded action.
|
|
114
|
-
4. Verify state + log progress.
|
|
115
|
-
5. Exit.
|
|
116
|
-
|
|
117
|
-
Heartbeat dispatch is the orchestrator clock. It should supervise/advance the graph,
|
|
118
|
-
not run unbounded worker sessions.
|
|
119
|
-
|
|
120
|
-
### 2) tmux dispatch (parallel workers)
|
|
121
|
-
|
|
122
|
-
Use when several ready leaves should execute concurrently now.
|
|
123
|
-
|
|
124
|
-
Spawn one tmux session per ready issue. Each worker claims one issue, executes one
|
|
125
|
-
full issue loop, then exits.
|
|
126
|
-
|
|
127
|
-
## Orchestration loops
|
|
128
|
-
|
|
129
|
-
### Orchestrator heartbeat tick loop
|
|
130
|
-
|
|
131
|
-
For root `<root-id>`:
|
|
132
|
-
|
|
133
|
-
1. Inspect queue and local protocol state:
|
|
31
|
+
Use `mu_ui` as the shared operator↔human surface during planning/execution passes.
|
|
134
32
|
|
|
135
33
|
```bash
|
|
136
|
-
mu
|
|
137
|
-
mu
|
|
138
|
-
mu
|
|
34
|
+
/mu ui status
|
|
35
|
+
/mu ui snapshot compact
|
|
36
|
+
/mu ui snapshot multiline
|
|
139
37
|
```
|
|
140
38
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
39
|
+
Status doc example (`ui:subagents`):
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"action": "set",
|
|
44
|
+
"doc": {
|
|
45
|
+
"v": 1,
|
|
46
|
+
"ui_id": "ui:subagents",
|
|
47
|
+
"title": "Subagents execution status",
|
|
48
|
+
"summary": "ready=2 · active=1 · blocked=0",
|
|
49
|
+
"components": [
|
|
50
|
+
{
|
|
51
|
+
"kind": "key_value",
|
|
52
|
+
"id": "queue",
|
|
53
|
+
"title": "Queue",
|
|
54
|
+
"rows": [
|
|
55
|
+
{ "key": "ready", "value": "2" },
|
|
56
|
+
{ "key": "active", "value": "1" },
|
|
57
|
+
{ "key": "blocked", "value": "0" }
|
|
58
|
+
],
|
|
59
|
+
"metadata": {}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"actions": [],
|
|
63
|
+
"revision": { "id": "subagents-status", "version": 3 },
|
|
64
|
+
"updated_at_ms": 1772060000000,
|
|
65
|
+
"metadata": {
|
|
66
|
+
"profile": {
|
|
67
|
+
"id": "subagents",
|
|
68
|
+
"variant": "status",
|
|
69
|
+
"snapshot": {
|
|
70
|
+
"compact": "ready=2 · active=1 · blocked=0",
|
|
71
|
+
"multiline": "ready: 2\nactive: 1\nblocked: 0"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
178
77
|
```
|
|
179
78
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
79
|
+
Interactive prompt example (`ui:subagents:handoff`):
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"action": "set",
|
|
84
|
+
"doc": {
|
|
85
|
+
"v": 1,
|
|
86
|
+
"ui_id": "ui:subagents:handoff",
|
|
87
|
+
"title": "Execution handoff decision",
|
|
88
|
+
"components": [
|
|
89
|
+
{ "kind": "text", "id": "question", "text": "Close root now?", "metadata": {} }
|
|
90
|
+
],
|
|
91
|
+
"actions": [
|
|
92
|
+
{
|
|
93
|
+
"id": "close-root",
|
|
94
|
+
"label": "Close root",
|
|
95
|
+
"kind": "primary",
|
|
96
|
+
"payload": {},
|
|
97
|
+
"metadata": { "command_text": "/answer close-root" }
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"revision": { "id": "subagents-handoff", "version": 1 },
|
|
101
|
+
"updated_at_ms": 1772060005000,
|
|
102
|
+
"metadata": { "profile": { "id": "subagents-handoff", "variant": "interactive" } }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
190
105
|
```
|
|
191
106
|
|
|
192
|
-
|
|
107
|
+
Teardown/handoff uses explicit removes:
|
|
193
108
|
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
project objective, milestone moved this pass, impact/precondition,
|
|
198
|
-
overall progress, and next high-level step.
|
|
199
|
-
Keep queue/worker/session internals out unless diagnosing a blocker.
|
|
109
|
+
```json
|
|
110
|
+
{"action":"remove","ui_id":"ui:subagents:handoff"}
|
|
111
|
+
{"action":"remove","ui_id":"ui:subagents"}
|
|
200
112
|
```
|
|
201
113
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
run_id="$(date +%Y%m%d-%H%M%S)"
|
|
206
|
-
for issue_id in $(mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --json | jq -r '.[].id' | head -n 3); do
|
|
207
|
-
session="mu-sub-${run_id}-${issue_id}"
|
|
208
|
-
tmux new-session -d -s "$session" \
|
|
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"
|
|
210
|
-
done
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
## Subagents HUD
|
|
214
|
-
|
|
215
|
-
HUD usage is required for this skill. Truth still lives in issues/forum.
|
|
216
|
-
|
|
217
|
-
```text
|
|
218
|
-
/mu hud on
|
|
219
|
-
/mu hud status
|
|
220
|
-
/mu hud snapshot
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
Tool: `mu_hud`
|
|
224
|
-
|
|
225
|
-
- Canonical contract: see skill `hud`
|
|
226
|
-
- Actions: `status`, `snapshot`, `on`, `off`, `toggle`, `set`, `update`, `replace`, `remove`, `clear`
|
|
227
|
-
- Subagents convention: maintain a HUD doc with `hud_id: "subagents"`
|
|
228
|
-
- Suggested subagents doc structure:
|
|
229
|
-
- chips: health, mode, paused
|
|
230
|
-
- sections: queue counts + recent activity lines
|
|
231
|
-
- actions: refresh/spawn command hooks (if desired)
|
|
232
|
-
- metadata: include `style_preset:"subagents"` for consistent renderer emphasis
|
|
233
|
-
- Example update:
|
|
234
|
-
- `{"action":"set", "doc": {"hud_id":"subagents", ...}}` (see `hud` skill for exact shape)
|
|
235
|
-
- Follow the HUD ownership and teardown protocol from `hud` skill for completion and handoff.
|
|
236
|
-
|
|
237
|
-
## Evaluation scenarios
|
|
238
|
-
|
|
239
|
-
1. **Heartbeat bounded-orchestration tick**
|
|
240
|
-
- Setup: root issue with multiple ready leaves tagged `proto:hierarchical-work-v1`.
|
|
241
|
-
- Expected: one heartbeat tick performs exactly one bounded orchestration action, verifies state, posts a high-level titled narrative status update, and exits.
|
|
242
|
-
|
|
243
|
-
2. **tmux fan-out on ready leaves**
|
|
244
|
-
- Setup: at least three independent ready issues under one root.
|
|
245
|
-
- Expected: one worker session per issue is spawned, each worker claims before work, and each writes `START`/`RESULT` packets to `issue:<id>`.
|
|
246
|
-
|
|
247
|
-
3. **Human-question blocking flow (`ask`)**
|
|
248
|
-
- Setup: worker encounters missing critical input.
|
|
249
|
-
- Expected: skill applies protocol `ask` semantics, creates a human-input node, and downstream work remains blocked until the answer issue closes.
|
|
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
|
-
|
|
255
|
-
## Reconciliation
|
|
256
|
-
|
|
257
|
-
- Run `mu issues validate <root-id>` before declaring completion.
|
|
258
|
-
- Merge synth-node outputs into one final user-facing result.
|
|
259
|
-
- Convert unresolved gaps into new child issues tagged `proto:hierarchical-work-v1`.
|
|
260
|
-
- Tear down temporary tmux sessions.
|
|
261
|
-
- Tear down/handoff `hud_id:"subagents"` ownership following the `hud` skill protocol.
|
|
262
|
-
|
|
263
|
-
## Safety
|
|
114
|
+
## Common patterns
|
|
264
115
|
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
- Never overwrite unrelated files across shards.
|
|
116
|
+
- **End-to-End Orchestration**: Route to `planning` to get a structured issue DAG, publish plan state in `ui:planning` (status) plus `ui:planning:approval` (interactive prompt) when needed, then route to `execution` to drive workers until DAG completion.
|
|
117
|
+
- **DAG Recovery / Unblocking**: If a DAG stalls, route to `protocol` to inspect `mu issues ready` constraints, followed by a bounded `execution` pass to claim and manually unblock the stalled task.
|
|
118
|
+
- **Differentiated Model Provisioning**: If different nodes need different abilities (for example specialized docs vs. complex refactoring), add `model-routing` to set `route:model-routing-v1` policies per issue. The `execution` worker shell will then launch the required model profiles based on those policies.
|
|
@@ -6,7 +6,7 @@ description: "Defines compositional control-flow policies for orchestration DAGs
|
|
|
6
6
|
# control-flow
|
|
7
7
|
|
|
8
8
|
Use this skill when work needs explicit loop/termination policy on top of the
|
|
9
|
-
shared
|
|
9
|
+
shared protocol.
|
|
10
10
|
|
|
11
11
|
## Contents
|
|
12
12
|
|
|
@@ -17,12 +17,12 @@ shared orchestration protocol.
|
|
|
17
17
|
- [Transition table](#transition-table)
|
|
18
18
|
- [Planning handoff contract](#planning-handoff-contract)
|
|
19
19
|
- [Subagents/heartbeat execution contract](#subagentsheartbeat-execution-contract)
|
|
20
|
-
- [
|
|
20
|
+
- [mu_ui visibility and handoff](#mu_ui-visibility-and-handoff)
|
|
21
21
|
- [Evaluation scenarios](#evaluation-scenarios)
|
|
22
22
|
|
|
23
23
|
## Purpose
|
|
24
24
|
|
|
25
|
-
Control-flow policies are overlays. They do not replace
|
|
25
|
+
Control-flow policies are overlays. They do not replace protocol
|
|
26
26
|
semantics; they guide which protocol primitive to apply next.
|
|
27
27
|
|
|
28
28
|
Examples:
|
|
@@ -34,10 +34,10 @@ Examples:
|
|
|
34
34
|
|
|
35
35
|
Load these skills before applying control-flow policies:
|
|
36
36
|
|
|
37
|
-
- `
|
|
38
|
-
- `
|
|
37
|
+
- `protocol` (protocol primitives/invariants)
|
|
38
|
+
- `execution` (durable execution runtime)
|
|
39
39
|
- `heartbeats` and/or `crons` (scheduler clock)
|
|
40
|
-
- `
|
|
40
|
+
- `mu` (for `/mu ui` inspection commands and communication checks)
|
|
41
41
|
|
|
42
42
|
## Core contract
|
|
43
43
|
|
|
@@ -128,29 +128,134 @@ Per orchestrator tick:
|
|
|
128
128
|
4. Verify with:
|
|
129
129
|
- `mu issues ready --root <root-id> --tag proto:hierarchical-work-v1 --pretty`
|
|
130
130
|
- `mu issues validate <root-id>`
|
|
131
|
-
5.
|
|
132
|
-
6.
|
|
131
|
+
5. Upsert control-flow visibility via `mu_ui` (`ui_id:"ui:subagents"` when orchestration is shared, or `ui_id:"ui:control-flow"` when standalone).
|
|
132
|
+
6. Post one concise ORCH_PASS update.
|
|
133
|
+
7. If final: disable heartbeat program.
|
|
133
134
|
|
|
134
135
|
Reusable bounded heartbeat prompt fragment:
|
|
135
136
|
|
|
136
137
|
```text
|
|
137
|
-
Use skills
|
|
138
|
+
Use skills subagents, protocol, execution, control-flow, and mu.
|
|
138
139
|
For root <root-id>, enforce flow:review-gated-v1 with spawn-per-attempt rounds.
|
|
139
|
-
Run exactly one bounded control-flow transition pass,
|
|
140
|
+
Run exactly one bounded control-flow transition pass, keep control-flow visibility
|
|
141
|
+
current via mu_ui (`ui:subagents` or `ui:control-flow`), verify DAG state,
|
|
140
142
|
post one ORCH_PASS, and stop. If validate is final, disable the supervising
|
|
141
143
|
heartbeat and report completion.
|
|
142
144
|
```
|
|
143
145
|
|
|
144
|
-
##
|
|
146
|
+
## mu_ui visibility and handoff
|
|
147
|
+
|
|
148
|
+
Use `mu_ui` as the primary communication surface for active control-flow
|
|
149
|
+
execution.
|
|
150
|
+
|
|
151
|
+
- Publish control-flow status in one status-profile doc:
|
|
152
|
+
- shared orchestration: `ui_id:"ui:subagents"`
|
|
153
|
+
- standalone control-flow loop: `ui_id:"ui:control-flow"`
|
|
154
|
+
- Set profile metadata for deterministic snapshots:
|
|
155
|
+
- `metadata.profile.id: "subagents"` or `"control-flow"`
|
|
156
|
+
- `metadata.profile.variant: "status"`
|
|
157
|
+
- `metadata.profile.snapshot.compact|multiline`
|
|
158
|
+
- Keep status docs non-interactive (`actions: []`).
|
|
159
|
+
- For user decisions (for example max-round escalation), publish a separate
|
|
160
|
+
interactive prompt doc (for example `ui_id:"ui:control-flow:escalation"`).
|
|
161
|
+
- Update status docs each bounded pass before posting `ORCH_PASS`.
|
|
162
|
+
- On completion or handoff, remove control-flow-owned docs with explicit
|
|
163
|
+
`mu_ui remove` actions. Prefer `remove` over `clear`.
|
|
164
|
+
|
|
165
|
+
### Canonical status doc (`ui:control-flow`)
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"action": "set",
|
|
170
|
+
"doc": {
|
|
171
|
+
"v": 1,
|
|
172
|
+
"ui_id": "ui:control-flow",
|
|
173
|
+
"title": "Control-flow status",
|
|
174
|
+
"summary": "policy=review-gated · round=2/3 · state=review_pending",
|
|
175
|
+
"components": [
|
|
176
|
+
{
|
|
177
|
+
"kind": "key_value",
|
|
178
|
+
"id": "policy",
|
|
179
|
+
"title": "Review gate",
|
|
180
|
+
"rows": [
|
|
181
|
+
{ "key": "policy", "value": "flow:review-gated-v1" },
|
|
182
|
+
{ "key": "round", "value": "2/3" },
|
|
183
|
+
{ "key": "attempt", "value": "mu-attempt-2" },
|
|
184
|
+
{ "key": "review", "value": "mu-review-2" },
|
|
185
|
+
{ "key": "next", "value": "Run review_2" }
|
|
186
|
+
],
|
|
187
|
+
"metadata": {}
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"actions": [],
|
|
191
|
+
"revision": { "id": "control-flow-status", "version": 5 },
|
|
192
|
+
"updated_at_ms": 1772067720000,
|
|
193
|
+
"metadata": {
|
|
194
|
+
"profile": {
|
|
195
|
+
"id": "control-flow",
|
|
196
|
+
"variant": "status",
|
|
197
|
+
"snapshot": {
|
|
198
|
+
"compact": "round=2/3 · state=review_pending",
|
|
199
|
+
"multiline": "policy: review-gated\nround: 2/3\nstate: review_pending\nnext: run review_2"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
145
206
|
|
|
146
|
-
|
|
207
|
+
### Canonical escalation prompt (`ui:control-flow:escalation`)
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"action": "set",
|
|
212
|
+
"doc": {
|
|
213
|
+
"v": 1,
|
|
214
|
+
"ui_id": "ui:control-flow:escalation",
|
|
215
|
+
"title": "Review rounds exhausted",
|
|
216
|
+
"summary": "Need user decision after max failed review rounds.",
|
|
217
|
+
"components": [
|
|
218
|
+
{
|
|
219
|
+
"kind": "text",
|
|
220
|
+
"id": "question",
|
|
221
|
+
"text": "Max review rounds were reached. Should execution open another attempt or stop for manual intervention?",
|
|
222
|
+
"metadata": {}
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"actions": [
|
|
226
|
+
{
|
|
227
|
+
"id": "open-extra-round",
|
|
228
|
+
"label": "Open one extra round",
|
|
229
|
+
"kind": "primary",
|
|
230
|
+
"payload": {},
|
|
231
|
+
"metadata": { "command_text": "/answer open-extra-round" }
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"id": "stop-and-handoff",
|
|
235
|
+
"label": "Stop and hand off",
|
|
236
|
+
"kind": "secondary",
|
|
237
|
+
"payload": {},
|
|
238
|
+
"metadata": { "command_text": "/answer stop-and-handoff" }
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"revision": { "id": "control-flow-escalation", "version": 1 },
|
|
242
|
+
"updated_at_ms": 1772067730000,
|
|
243
|
+
"metadata": {
|
|
244
|
+
"profile": {
|
|
245
|
+
"id": "control-flow-escalation",
|
|
246
|
+
"variant": "interactive"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
```
|
|
147
252
|
|
|
148
|
-
|
|
149
|
-
(for example policy mode, round counters, escalation state).
|
|
150
|
-
- If running control-flow standalone, own a dedicated `hud_id:"control-flow"` doc.
|
|
151
|
-
- Update HUD state each bounded pass before reporting ORCH_PASS output.
|
|
253
|
+
### Teardown / handoff
|
|
152
254
|
|
|
153
|
-
|
|
255
|
+
```json
|
|
256
|
+
{"action":"remove","ui_id":"ui:control-flow:escalation"}
|
|
257
|
+
{"action":"remove","ui_id":"ui:control-flow"}
|
|
258
|
+
```
|
|
154
259
|
|
|
155
260
|
## Evaluation scenarios
|
|
156
261
|
|