maestro-flow 0.4.5 → 0.4.7
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/.codex/skills/maestro-collab/SKILL.md +218 -117
- package/.codex/skills/maestro-execute/SKILL.md +13 -11
- package/.codex/skills/maestro-milestone-audit/SKILL.md +12 -10
- package/.codex/skills/maestro-ralph/SKILL.md +16 -4
- package/.codex/skills/maestro-ui-codify/SKILL.md +18 -16
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +20 -13
- package/.codex/skills/manage-issue-discover/SKILL.md +19 -17
- package/.codex/skills/quality-debug/SKILL.md +35 -31
- package/.codex/skills/quality-refactor/SKILL.md +20 -12
- package/.codex/skills/quality-review/SKILL.md +21 -17
- package/.codex/skills/team-coordinate/SKILL.md +462 -235
- package/.codex/skills/team-coordinate/specs/role-catalog.md +132 -0
- package/.codex/skills/team-lifecycle-v4/SKILL.md +445 -191
- package/.codex/skills/team-quality-assurance/SKILL.md +205 -161
- package/.codex/skills/team-review/SKILL.md +198 -159
- package/.codex/skills/team-tech-debt/SKILL.md +214 -144
- package/.codex/skills/team-testing/SKILL.md +210 -158
- package/package.json +1 -1
- package/.codex/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +0 -247
- package/.codex/skills/team-coordinate/roles/coordinator/commands/dispatch.md +0 -126
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +0 -265
- package/.codex/skills/team-coordinate/roles/coordinator/role.md +0 -403
- package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +0 -113
- package/.codex/skills/team-coordinate/specs/pipelines.md +0 -97
- package/.codex/skills/team-coordinate/specs/quality-gates.md +0 -112
- package/.codex/skills/team-coordinate/specs/role-spec-template.md +0 -192
- package/.codex/skills/team-executor/SKILL.md +0 -116
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +0 -213
- package/.codex/skills/team-executor/roles/executor/role.md +0 -173
- package/.codex/skills/team-executor/specs/session-schema.md +0 -230
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +0 -56
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +0 -61
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +0 -113
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +0 -189
- package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +0 -100
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +0 -204
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +0 -72
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +0 -108
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +0 -163
- package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +0 -177
- package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +0 -71
- package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +0 -90
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +0 -135
- package/.codex/skills/team-review/roles/coordinator/role.md +0 -176
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +0 -47
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +0 -163
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +0 -133
- package/.codex/skills/team-tech-debt/roles/coordinator/role.md +0 -173
- package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +0 -70
- package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +0 -106
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +0 -156
- package/.codex/skills/team-testing/roles/coordinator/role.md +0 -185
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
# Command: dispatch
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Create task chains from dynamic dependency graphs. Builds pipelines from the task-analysis.json produced by Phase 1. Workers are spawned as team_worker agents with role-spec paths.
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
| Trigger | Condition |
|
|
10
|
-
|---------|-----------|
|
|
11
|
-
| After analysis | Phase 1 complete, task-analysis.json exists |
|
|
12
|
-
| After adapt | handleAdapt created new roles, needs new tasks |
|
|
13
|
-
| Re-dispatch | Pipeline restructuring (rare) |
|
|
14
|
-
|
|
15
|
-
## Strategy
|
|
16
|
-
|
|
17
|
-
- **Delegation**: Inline execution (coordinator processes directly)
|
|
18
|
-
- **Inputs**: task-analysis.json + team-session.json
|
|
19
|
-
- **Output**: tasks.json with dependency chains
|
|
20
|
-
|
|
21
|
-
## Phase 2: Context Loading
|
|
22
|
-
|
|
23
|
-
| Input | Source | Required |
|
|
24
|
-
|-------|--------|----------|
|
|
25
|
-
| Task analysis | `<session-folder>/task-analysis.json` | Yes |
|
|
26
|
-
| Session file | `<session-folder>/team-session.json` | Yes |
|
|
27
|
-
| Role registry | `team-session.json#roles` | Yes |
|
|
28
|
-
| Scope | User requirements description | Yes |
|
|
29
|
-
|
|
30
|
-
## Phase 3: Task Chain Creation
|
|
31
|
-
|
|
32
|
-
### Workflow
|
|
33
|
-
|
|
34
|
-
1. **Read dependency graph** from `task-analysis.json#dependency_graph`
|
|
35
|
-
2. **Topological sort** tasks to determine creation order
|
|
36
|
-
3. **Validate** all task roles exist in role registry
|
|
37
|
-
4. **Build tasks array** (in topological order):
|
|
38
|
-
|
|
39
|
-
```json
|
|
40
|
-
[
|
|
41
|
-
{
|
|
42
|
-
"id": "<PREFIX>-<NNN>",
|
|
43
|
-
"title": "<PREFIX>-<NNN>",
|
|
44
|
-
"description": "PURPOSE: <goal> | Success: <success_criteria>\nTASK:\n - <step 1>\n - <step 2>\n - <step 3>\nCONTEXT:\n - Session: <session-folder>\n - Upstream artifacts: <artifact-1.md>, <artifact-2.md>\n - Key files: <file1>, <file2>\n - Shared state: team_msg(operation=\"get_state\", session_id=<session-id>)\nEXPECTED: <deliverable path> + <quality criteria>\nCONSTRAINTS: <scope limits>\n---\nInnerLoop: <true|false>\nRoleSpec: <session-folder>/role-specs/<role-name>.md",
|
|
45
|
-
"status": "pending",
|
|
46
|
-
"role": "<role-name>",
|
|
47
|
-
"prefix": "<PREFIX>",
|
|
48
|
-
"deps": ["<dependency-list from graph>"],
|
|
49
|
-
"findings": "",
|
|
50
|
-
"error": ""
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
5. **Write tasks.json** with the complete array
|
|
56
|
-
6. **Update team-session.json** with pipeline and tasks_total
|
|
57
|
-
7. **Validate** created chain
|
|
58
|
-
|
|
59
|
-
### Task Description Template
|
|
60
|
-
|
|
61
|
-
Every task description includes structured fields for clarity:
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
PURPOSE: <goal from task-analysis.json#tasks[].goal> | Success: <success_criteria from task-analysis.json#tasks[].success_criteria>
|
|
65
|
-
TASK:
|
|
66
|
-
- <step 1 from task-analysis.json#tasks[].steps[]>
|
|
67
|
-
- <step 2 from task-analysis.json#tasks[].steps[]>
|
|
68
|
-
- <step 3 from task-analysis.json#tasks[].steps[]>
|
|
69
|
-
CONTEXT:
|
|
70
|
-
- Session: <session-folder>
|
|
71
|
-
- Upstream artifacts: <comma-separated list from task-analysis.json#tasks[].upstream_artifacts[]>
|
|
72
|
-
- Key files: <comma-separated list from task-analysis.json#tasks[].key_files[]>
|
|
73
|
-
- Shared state: team_msg(operation="get_state", session_id=<session-id>)
|
|
74
|
-
EXPECTED: <artifact path from task-analysis.json#capabilities[].artifacts[]> + <quality criteria based on capability type>
|
|
75
|
-
CONSTRAINTS: <constraints from task-analysis.json#tasks[].constraints>
|
|
76
|
-
---
|
|
77
|
-
InnerLoop: <true|false>
|
|
78
|
-
RoleSpec: <session-folder>/role-specs/<role-name>.md
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**Field Mapping**:
|
|
82
|
-
- `PURPOSE`: From `task-analysis.json#capabilities[].tasks[].goal` + `success_criteria`
|
|
83
|
-
- `TASK`: From `task-analysis.json#capabilities[].tasks[].steps[]`
|
|
84
|
-
- `CONTEXT.Upstream artifacts`: From `task-analysis.json#capabilities[].tasks[].upstream_artifacts[]`
|
|
85
|
-
- `CONTEXT.Key files`: From `task-analysis.json#capabilities[].tasks[].key_files[]`
|
|
86
|
-
- `EXPECTED`: From `task-analysis.json#capabilities[].artifacts[]` + quality criteria
|
|
87
|
-
- `CONSTRAINTS`: From `task-analysis.json#capabilities[].tasks[].constraints`
|
|
88
|
-
|
|
89
|
-
### InnerLoop Flag Rules
|
|
90
|
-
|
|
91
|
-
| Condition | InnerLoop |
|
|
92
|
-
|-----------|-----------|
|
|
93
|
-
| Role has 2+ serial same-prefix tasks | true |
|
|
94
|
-
| Role has 1 task | false |
|
|
95
|
-
| Tasks are parallel (no dependency between them) | false |
|
|
96
|
-
|
|
97
|
-
### Dependency Validation
|
|
98
|
-
|
|
99
|
-
| Check | Criteria |
|
|
100
|
-
|-------|----------|
|
|
101
|
-
| No orphan tasks | Every task is reachable from at least one root |
|
|
102
|
-
| No circular deps | Topological sort succeeds without cycle |
|
|
103
|
-
| All roles valid | Every task role exists in team-session.json#roles |
|
|
104
|
-
| All deps valid | Every deps entry references an existing task id |
|
|
105
|
-
| Session reference | Every task description contains `Session: <session-folder>` |
|
|
106
|
-
| RoleSpec reference | Every task description contains `RoleSpec: <path>` |
|
|
107
|
-
|
|
108
|
-
## Phase 4: Validation
|
|
109
|
-
|
|
110
|
-
| Check | Criteria |
|
|
111
|
-
|-------|----------|
|
|
112
|
-
| Task count | Matches dependency_graph node count |
|
|
113
|
-
| Dependencies | Every deps entry references an existing task id |
|
|
114
|
-
| Role assignment | Each task role is in role registry |
|
|
115
|
-
| Session reference | Every task description contains `Session:` |
|
|
116
|
-
| Pipeline integrity | No disconnected subgraphs (warn if found) |
|
|
117
|
-
|
|
118
|
-
## Error Handling
|
|
119
|
-
|
|
120
|
-
| Scenario | Resolution |
|
|
121
|
-
|----------|------------|
|
|
122
|
-
| Circular dependency detected | Report cycle, halt task creation |
|
|
123
|
-
| Role not in role registry | Error, coordinator must fix roles first |
|
|
124
|
-
| Task creation fails | Log error, report to coordinator |
|
|
125
|
-
| Duplicate task id | Skip creation, log warning |
|
|
126
|
-
| Empty dependency graph | Error, task analysis may have failed |
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
# Command: monitor
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Event-driven pipeline coordination with Spawn-and-Stop pattern. Role names are read from `team-session.json#roles`. Workers are spawned as `team_worker` agents with role-spec paths. Includes `handleComplete` for pipeline completion action and `handleAdapt` for mid-pipeline capability gap handling.
|
|
6
|
-
|
|
7
|
-
## When to Use
|
|
8
|
-
|
|
9
|
-
| Trigger | Condition |
|
|
10
|
-
|---------|-----------|
|
|
11
|
-
| Worker result | Result from wait_agent contains [role-name] from session roles |
|
|
12
|
-
| User command | "check", "status", "resume", "continue" |
|
|
13
|
-
| Capability gap | Worker reports capability_gap |
|
|
14
|
-
| Pipeline spawn | After dispatch, initial spawn needed |
|
|
15
|
-
| Pipeline complete | All tasks done |
|
|
16
|
-
|
|
17
|
-
## Strategy
|
|
18
|
-
|
|
19
|
-
- **Delegation**: Inline execution with handler routing
|
|
20
|
-
- **Beat model**: ONE_STEP_PER_INVOCATION -- one handler then STOP
|
|
21
|
-
- **Workers**: Spawned as team_worker via spawn_agent
|
|
22
|
-
|
|
23
|
-
## Constants
|
|
24
|
-
|
|
25
|
-
| Constant | Value | Description |
|
|
26
|
-
|----------|-------|-------------|
|
|
27
|
-
| SPAWN_MODE | spawn_agent | All workers spawned via `spawn_agent` |
|
|
28
|
-
| ONE_STEP_PER_INVOCATION | true | Coordinator does one operation then STOPS |
|
|
29
|
-
| FAST_ADVANCE_AWARE | true | Workers may skip coordinator for simple linear successors |
|
|
30
|
-
| WORKER_AGENT | team_worker | All workers spawned as team_worker agents |
|
|
31
|
-
|
|
32
|
-
## Phase 2: Context Loading
|
|
33
|
-
|
|
34
|
-
| Input | Source | Required |
|
|
35
|
-
|-------|--------|----------|
|
|
36
|
-
| Session file | `<session-folder>/team-session.json` | Yes |
|
|
37
|
-
| Task list | Read tasks.json | Yes |
|
|
38
|
-
| Active workers | session.active_workers[] | Yes |
|
|
39
|
-
| Role registry | session.roles[] | Yes |
|
|
40
|
-
|
|
41
|
-
**Dynamic role resolution**: Known worker roles are loaded from `session.roles[].name`. Role-spec paths are in `session.roles[].role_spec`.
|
|
42
|
-
|
|
43
|
-
## Phase 3: Handler Routing
|
|
44
|
-
|
|
45
|
-
### Wake-up Source Detection
|
|
46
|
-
|
|
47
|
-
Parse `$ARGUMENTS` to determine handler:
|
|
48
|
-
|
|
49
|
-
| Priority | Condition | Handler |
|
|
50
|
-
|----------|-----------|---------|
|
|
51
|
-
| 1 | Message contains `[<role-name>]` from session roles | handleCallback |
|
|
52
|
-
| 2 | Contains "capability_gap" | handleAdapt |
|
|
53
|
-
| 3 | Contains "check" or "status" | handleCheck |
|
|
54
|
-
| 4 | Contains "resume", "continue", or "next" | handleResume |
|
|
55
|
-
| 5 | Pipeline detected as complete | handleComplete |
|
|
56
|
-
| 6 | None of the above (initial spawn after dispatch) | handleSpawnNext |
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
### Handler: handleCallback
|
|
61
|
-
|
|
62
|
-
Worker completed a task. Verify completion, update state, auto-advance.
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
Match worker by role -> route:
|
|
66
|
-
progress_update (not final) -> update state, keep in active_workers -> STOP
|
|
67
|
-
completed -> remove from active_workers, close_agent, -> handleSpawnNext
|
|
68
|
-
not_completed -> log progress -> STOP
|
|
69
|
-
no_match -> scan all workers for completions -> process any found -> handleSpawnNext, else STOP
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**Fast-advance reconciliation**: On any callback/resume, sync `fast_advance` messages from team_msg into `active_workers`. Skip spawning tasks already `in_progress` via fast-advance.
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
### Handler: handleCheck
|
|
77
|
-
|
|
78
|
-
Read-only status report with progress milestones. No pipeline advancement.
|
|
79
|
-
|
|
80
|
-
1. Read tasks.json + team_msg (type="progress", last=50) + team_msg (type="blocker", last=10)
|
|
81
|
-
2. Aggregate latest milestone per active worker
|
|
82
|
-
|
|
83
|
-
**Output format**:
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
[coordinator] Pipeline Status
|
|
87
|
-
[coordinator] Progress: <completed>/<total> (<percent>%)
|
|
88
|
-
|
|
89
|
-
[coordinator] Execution Graph:
|
|
90
|
-
<visual representation of dependency graph with status icons>
|
|
91
|
-
|
|
92
|
-
done=completed >>>=running o=pending .=not created
|
|
93
|
-
|
|
94
|
-
[coordinator] Active Workers:
|
|
95
|
-
> <subject> (<role>) - <milestone_phase> <pct>% - running <elapsed>
|
|
96
|
-
...
|
|
97
|
-
|
|
98
|
-
[coordinator] Blockers: <count or "none">
|
|
99
|
-
<task_id>: <blocker_detail> ← only if blockers exist
|
|
100
|
-
|
|
101
|
-
[coordinator] Ready to spawn: <subjects>
|
|
102
|
-
[coordinator] Commands: 'resume' to advance | 'check' to refresh
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
**CLI equivalent for human monitoring** (works while coordinator is blocked):
|
|
106
|
-
```bash
|
|
107
|
-
maestro agent-msg list -s "<session_id>" --type progress --last 10
|
|
108
|
-
maestro agent-msg list -s "<session_id>" --type blocker
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Then STOP.
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
### Handler: handleResume
|
|
116
|
-
|
|
117
|
-
**Agent Health Check** (v4): Cross-check `list_agents()` against session `active_workers`. Any agent not actually running -> reset task to pending, remove from active_workers.
|
|
118
|
-
|
|
119
|
-
Check active worker completion, process results, advance pipeline.
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
Load active_workers -> route:
|
|
123
|
-
none -> handleSpawnNext
|
|
124
|
-
has workers -> classify each: completed | in_progress | failed(reset to pending)
|
|
125
|
-
some completed -> handleSpawnNext
|
|
126
|
-
all running -> report status -> STOP
|
|
127
|
-
all failed -> handleSpawnNext (retry)
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
### Handler: handleSpawnNext
|
|
133
|
-
|
|
134
|
-
Find all ready tasks, spawn team_worker agents, update session, STOP.
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
Classify tasks: completed | in_progress | ready (pending + all deps completed)
|
|
138
|
-
|
|
139
|
-
Ready tasks -> route:
|
|
140
|
-
none + in_progress exists -> report waiting -> STOP
|
|
141
|
-
none + nothing in_progress -> PIPELINE_COMPLETE -> handleComplete
|
|
142
|
-
has ready -> for each:
|
|
143
|
-
skip if Inner Loop role already has active_worker
|
|
144
|
-
else: set status="in_progress", log task_unblocked, spawn team_worker, add to active_workers
|
|
145
|
-
Update session -> output summary -> STOP
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**Cross-Agent Supplementary Context** (v4): When spawning later-phase workers, use `send_message` (not `followup_task`) to deliver upstream results to already-running downstream workers as non-interrupting supplementary context.
|
|
149
|
-
|
|
150
|
-
**Spawn worker call** (one per ready task):
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
spawn_agent({ agent_type: "team_worker", task_name: taskId, message: <role-assignment> })
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**Role assignment message template**:
|
|
157
|
-
```
|
|
158
|
-
## Role Assignment
|
|
159
|
-
role: <role> | role_spec: <session-folder>/role-specs/<role>.md
|
|
160
|
-
session: <session-folder> | session_id: <session-id> | team_name: <team-name>
|
|
161
|
-
requirement: <task-description> | inner_loop: <true|false>
|
|
162
|
-
Read role_spec for Phase 2-4 instructions.
|
|
163
|
-
## Progress Milestones
|
|
164
|
-
Report progress via team_msg at phase boundaries. Blockers via type="blocker". Completion via type="task_complete" after report_agent_job_result.
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**Result collection**: `wait_agent({ timeout_ms: 1800000 })` (30 min), drain progress from team_msg.
|
|
168
|
-
|
|
169
|
-
**Timeout escalation**: STATUS_CHECK (3 min) -> FINALIZE with interrupt (3 min) -> mark timed_out with last progress context, close_agent. Normal completion -> process result, close_agent (use task_name, not agentId).
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
### Handler: handleComplete
|
|
174
|
-
|
|
175
|
-
**Cleanup Verification** (v4): `list_agents()` -> close any still-running team agents.
|
|
176
|
-
|
|
177
|
-
Pipeline complete. Execute completion action based on session configuration.
|
|
178
|
-
|
|
179
|
-
```
|
|
180
|
-
Generate summary: deliverables + stats + verdicts
|
|
181
|
-
|
|
182
|
-
Route by session.completion_action:
|
|
183
|
-
"interactive" -> request_user_input with options:
|
|
184
|
-
"Archive & Clean" -> status="completed", cleanup, output artifact paths
|
|
185
|
-
"Keep Active" -> status="paused", output resume command
|
|
186
|
-
"Export Results" -> prompt for target dir, copy deliverables, then Archive & Clean
|
|
187
|
-
"auto_archive" -> Archive & Clean without prompt
|
|
188
|
-
"auto_keep" -> Keep Active without prompt
|
|
189
|
-
|
|
190
|
-
Fallback: default to Keep Active on failure.
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
### Handler: handleAdapt
|
|
196
|
-
|
|
197
|
-
Handle mid-pipeline capability gap discovery. A worker reports `capability_gap` when it encounters work outside its scope.
|
|
198
|
-
|
|
199
|
-
**CONSTRAINT**: Maximum 5 worker roles per session. handleAdapt MUST enforce this limit.
|
|
200
|
-
|
|
201
|
-
```
|
|
202
|
-
Extract: gap_description, requesting_role, suggested_capability
|
|
203
|
-
Validate: existing role covers gap? -> redirect -> STOP
|
|
204
|
-
Enforce MAX 5 ROLES: count >= 5 -> attempt merge, else PAUSE for user
|
|
205
|
-
Generate role-spec from template -> write to role-specs/<new-role>.md -> add to session.roles
|
|
206
|
-
Create task(s) in tasks.json -> update session -> spawn team_worker -> STOP
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
### Worker Failure Handling
|
|
212
|
-
|
|
213
|
-
When a worker has unexpected status (not completed, not in_progress):
|
|
214
|
-
|
|
215
|
-
1. Reset task -> pending in tasks.json
|
|
216
|
-
2. Log via team_msg (type: error)
|
|
217
|
-
3. Report to user: task reset, will retry on next resume
|
|
218
|
-
|
|
219
|
-
### Fast-Advance Failure Recovery
|
|
220
|
-
|
|
221
|
-
When coordinator detects a fast-advanced task has failed:
|
|
222
|
-
|
|
223
|
-
```
|
|
224
|
-
Detect: task in_progress with no active_worker (stale fast-advance)
|
|
225
|
-
-> reset to pending, remove stale entry, log error, -> handleSpawnNext
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Fast-Advance State Sync
|
|
229
|
-
|
|
230
|
-
On every coordinator wake (handleCallback, handleResume, handleCheck):
|
|
231
|
-
1. Read team_msg entries with `type="fast_advance"` since last coordinator wake
|
|
232
|
-
2. For each entry: sync `active_workers` with the spawned successor
|
|
233
|
-
3. This ensures coordinator's state reflects fast-advance decisions even before the successor's callback arrives
|
|
234
|
-
|
|
235
|
-
### Consensus-Blocked Handling
|
|
236
|
-
|
|
237
|
-
```
|
|
238
|
-
Route by consensus_blocked severity:
|
|
239
|
-
HIGH -> create REVISION task (max 1 per task, else PAUSE + escalate)
|
|
240
|
-
MEDIUM -> proceed with warning, log to wisdom/issues.md, -> handleSpawnNext
|
|
241
|
-
LOW -> proceed normally, treat as consensus_reached with notes
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
## Phase 4: Validation
|
|
245
|
-
|
|
246
|
-
| Check | Criteria |
|
|
247
|
-
|-------|----------|
|
|
248
|
-
| Session state consistent | active_workers matches tasks.json in_progress tasks |
|
|
249
|
-
| No orphaned tasks | Every in_progress task has an active_worker entry |
|
|
250
|
-
| Dynamic roles valid | All task roles exist in session.roles |
|
|
251
|
-
| Completion detection | readySubjects=0 + inProgressSubjects=0 -> PIPELINE_COMPLETE |
|
|
252
|
-
| Fast-advance tracking | Detect tasks already in_progress via fast-advance, sync to active_workers |
|
|
253
|
-
|
|
254
|
-
## Error Handling
|
|
255
|
-
|
|
256
|
-
| Scenario | Resolution |
|
|
257
|
-
|----------|------------|
|
|
258
|
-
| Session file not found | Error, suggest re-initialization |
|
|
259
|
-
| Worker callback from unknown role | Log info, scan for other completions |
|
|
260
|
-
| All workers still running on resume | Report status, suggest check later |
|
|
261
|
-
| Pipeline stall (no ready, no running) | Check for missing tasks, report to user |
|
|
262
|
-
| Fast-advance conflict | Coordinator reconciles, no duplicate spawns |
|
|
263
|
-
| Dynamic role-spec file not found | Error, coordinator must regenerate from task-analysis |
|
|
264
|
-
| capability_gap when role limit (5) reached | Attempt merge, else pause for user |
|
|
265
|
-
| Completion action fails | Default to Keep Active, log warning |
|