maestro-flow 0.4.1 → 0.4.3
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/.claude/commands/maestro-analyze.md +1 -1
- package/.claude/commands/maestro-brainstorm.md +1 -1
- package/.claude/commands/maestro-collab.md +1 -1
- package/.claude/commands/maestro-execute.md +10 -1
- package/.claude/commands/maestro-guard.md +101 -0
- package/.claude/commands/maestro-impeccable.md +77 -74
- package/.claude/commands/maestro-plan.md +15 -2
- package/.claude/commands/maestro-ralph-execute.md +9 -2
- package/.claude/commands/maestro-ralph.md +8 -1
- package/.claude/commands/maestro-verify.md +15 -1
- package/.claude/commands/quality-auto-test.md +1 -1
- package/.claude/commands/quality-debug.md +1 -1
- package/.claude/commands/quality-refactor.md +1 -1
- package/.claude/commands/quality-retrospective.md +1 -1
- package/.claude/commands/quality-review.md +15 -1
- package/.claude/commands/quality-test.md +1 -1
- package/.claude/commands/security-audit.md +154 -0
- package/.claude/skills/maestro-help/index/catalog.json +2 -0
- package/.codex/skills/maestro-analyze/SKILL.md +18 -1
- package/.codex/skills/maestro-brainstorm/SKILL.md +17 -4
- package/.codex/skills/maestro-collab/SKILL.md +7 -1
- package/.codex/skills/maestro-execute/SKILL.md +365 -348
- package/.codex/skills/maestro-guard/SKILL.md +97 -0
- package/.codex/skills/maestro-impeccable/SKILL.md +76 -73
- package/.codex/skills/maestro-plan/SKILL.md +66 -7
- package/.codex/skills/maestro-ralph/SKILL.md +1 -1
- package/.codex/skills/maestro-verify/SKILL.md +18 -1
- package/.codex/skills/quality-auto-test/SKILL.md +13 -3
- package/.codex/skills/quality-debug/SKILL.md +362 -346
- package/.codex/skills/quality-refactor/SKILL.md +1 -1
- package/.codex/skills/quality-retrospective/SKILL.md +292 -292
- package/.codex/skills/quality-review/SKILL.md +374 -365
- package/.codex/skills/quality-test/SKILL.md +1 -1
- package/.codex/skills/security-audit/SKILL.md +154 -0
- package/bin/maestro-hook-runner.js +21 -1
- package/dashboard/dist-server/src/coordinator/output-parser.js +27 -0
- package/dashboard/dist-server/src/coordinator/output-parser.js.map +1 -1
- package/dist/src/commands/coordinate.d.ts.map +1 -1
- package/dist/src/commands/coordinate.js +2 -0
- package/dist/src/commands/coordinate.js.map +1 -1
- package/dist/src/commands/hooks.d.ts +49 -0
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +236 -33
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/install-backend.d.ts +2 -0
- package/dist/src/commands/install-backend.d.ts.map +1 -1
- package/dist/src/commands/install-backend.js +72 -0
- package/dist/src/commands/install-backend.js.map +1 -1
- package/dist/src/commands/install.d.ts.map +1 -1
- package/dist/src/commands/install.js +15 -2
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/coordinator/output-parser.d.ts.map +1 -1
- package/dist/src/coordinator/output-parser.js +27 -0
- package/dist/src/coordinator/output-parser.js.map +1 -1
- package/dist/src/hooks/delegate-monitor.d.ts +1 -0
- package/dist/src/hooks/delegate-monitor.d.ts.map +1 -1
- package/dist/src/hooks/delegate-monitor.js +1 -1
- package/dist/src/hooks/delegate-monitor.js.map +1 -1
- package/dist/src/hooks/guards/workflow-guard.d.ts +15 -0
- package/dist/src/hooks/guards/workflow-guard.d.ts.map +1 -1
- package/dist/src/hooks/guards/workflow-guard.js +61 -1
- package/dist/src/hooks/guards/workflow-guard.js.map +1 -1
- package/dist/src/hooks/plugins/decision-log-plugin.d.ts +19 -0
- package/dist/src/hooks/plugins/decision-log-plugin.d.ts.map +1 -0
- package/dist/src/hooks/plugins/decision-log-plugin.js +28 -0
- package/dist/src/hooks/plugins/decision-log-plugin.js.map +1 -0
- package/dist/src/hooks/plugins/index.d.ts +2 -0
- package/dist/src/hooks/plugins/index.d.ts.map +1 -1
- package/dist/src/hooks/plugins/index.js +1 -0
- package/dist/src/hooks/plugins/index.js.map +1 -1
- package/dist/src/hooks/session-context.d.ts +1 -0
- package/dist/src/hooks/session-context.d.ts.map +1 -1
- package/dist/src/hooks/session-context.js +1 -1
- package/dist/src/hooks/session-context.js.map +1 -1
- package/dist/src/hooks/skill-context.d.ts +1 -0
- package/dist/src/hooks/skill-context.d.ts.map +1 -1
- package/dist/src/hooks/skill-context.js +1 -1
- package/dist/src/hooks/skill-context.js.map +1 -1
- package/dist/src/hooks/spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/spec-injector.js +2 -0
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/i18n/locales/en.d.ts.map +1 -1
- package/dist/src/i18n/locales/en.js +13 -0
- package/dist/src/i18n/locales/en.js.map +1 -1
- package/dist/src/i18n/locales/zh.d.ts.map +1 -1
- package/dist/src/i18n/locales/zh.js +13 -0
- package/dist/src/i18n/locales/zh.js.map +1 -1
- package/dist/src/i18n/types.d.ts +7 -0
- package/dist/src/i18n/types.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.d.ts +5 -0
- package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.d.ts +2 -0
- package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.js +22 -3
- package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +25 -4
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.d.ts +5 -0
- package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.js +16 -0
- package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.js +1 -1
- package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
- package/package.json +1 -1
- package/workflows/debug.md +73 -0
- package/workflows/execute.md +27 -0
- package/workflows/plan.md +11 -0
- package/workflows/review.md +33 -1
- package/workflows/tdd.md +257 -0
- package/workflows/verify.md +57 -0
|
@@ -1,346 +1,362 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: quality-debug
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"[bug description] [--from-uat <phase>] [--parallel]\""
|
|
5
|
-
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<purpose>
|
|
9
|
-
Wave-based hypothesis-driven debugging using `spawn_agents_on_csv`. Wave 1 explores hypotheses in parallel, Wave 2 attempts fixes on confirmed hypotheses in parallel.
|
|
10
|
-
|
|
11
|
-
**Core workflow**: Gather Symptoms -> Generate Hypotheses -> Parallel Investigation -> Parallel Fix Attempts -> Unify Results
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
| +--
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
| +--
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
| +--
|
|
44
|
-
| +--
|
|
45
|
-
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
|
112
|
-
|
|
113
|
-
| `
|
|
114
|
-
| `wave
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
4.
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
|
295
|
-
|
|
296
|
-
|
|
|
297
|
-
|
|
|
298
|
-
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
|
321
|
-
|
|
322
|
-
|
|
|
323
|
-
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
1
|
+
---
|
|
2
|
+
name: quality-debug
|
|
3
|
+
description: Use when bugs, test failures, or unexpected behavior need systematic root cause investigation
|
|
4
|
+
argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"[bug description] [--from-uat <phase>] [--parallel]\""
|
|
5
|
+
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Wave-based hypothesis-driven debugging using `spawn_agents_on_csv`. Wave 1 explores hypotheses in parallel, Wave 2 attempts fixes on confirmed hypotheses in parallel.
|
|
10
|
+
|
|
11
|
+
**Core workflow**: Gather Symptoms -> Generate Hypotheses -> Parallel Investigation -> Parallel Fix Attempts -> Unify Results
|
|
12
|
+
|
|
13
|
+
## Iron Law
|
|
14
|
+
|
|
15
|
+
**NO FIX PROPOSALS WITHOUT ROOT CAUSE EVIDENCE.** Before proposing any fix, you MUST have reproduced/confirmed the symptom, gathered evidence, and identified the root cause with file:line references.
|
|
16
|
+
|
|
17
|
+
## Red Flags — These Thoughts Mean STOP
|
|
18
|
+
- "Quick fix for now, investigate later" / "I don't fully understand but this might work"
|
|
19
|
+
- "The fix is obvious, I don't need to reproduce it" / "Multiple changes at once will be faster"
|
|
20
|
+
- "I already know what the problem is" (without evidence)
|
|
21
|
+
All mean: **return to evidence gathering**.
|
|
22
|
+
|
|
23
|
+
## Escalation Rule
|
|
24
|
+
After **3 failed hypotheses**, STOP. Summarize failures, question architecture, present to user.
|
|
25
|
+
|
|
26
|
+
## Backward Tracing
|
|
27
|
+
Find where incorrect value appears → trace backward through call chain → fix at source, not symptom.
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
+---------------------------------------------------------------------------+
|
|
31
|
+
| DEBUG CSV WAVE WORKFLOW |
|
|
32
|
+
+---------------------------------------------------------------------------+
|
|
33
|
+
| |
|
|
34
|
+
| Phase 1: Input Resolution -> CSV |
|
|
35
|
+
| +-- Parse mode: standalone / --from-uat / --parallel |
|
|
36
|
+
| +-- Gather symptoms (interactive) or load UAT gaps (pre-filled) |
|
|
37
|
+
| +-- Cluster gaps by component (if from-uat) |
|
|
38
|
+
| +-- Generate 3-5 hypotheses per cluster/issue |
|
|
39
|
+
| +-- Generate tasks.csv with one row per hypothesis |
|
|
40
|
+
| +-- User validates hypothesis breakdown (skip if -y) |
|
|
41
|
+
| |
|
|
42
|
+
| Phase 2: Wave Execution Engine |
|
|
43
|
+
| +-- Wave 1: Hypothesis Investigation (parallel) |
|
|
44
|
+
| | +-- Each agent investigates one hypothesis |
|
|
45
|
+
| | +-- Agent searches code, logs evidence, confirms/refutes |
|
|
46
|
+
| | +-- Discoveries shared via board (code patterns, root causes) |
|
|
47
|
+
| | +-- Results: evidence_for + evidence_against per hypothesis |
|
|
48
|
+
| +-- Wave 2: Fix Attempts (parallel, confirmed hypotheses only) |
|
|
49
|
+
| | +-- Filter: only hypotheses with status=confirmed from wave 1 |
|
|
50
|
+
| | +-- Each agent attempts fix for its confirmed root cause |
|
|
51
|
+
| | +-- Agent applies fix, runs verification, logs result |
|
|
52
|
+
| | +-- Results: fix_applied + verified per fix task |
|
|
53
|
+
| +-- discoveries.ndjson shared across all waves (append-only) |
|
|
54
|
+
| |
|
|
55
|
+
| Phase 3: Results Aggregation |
|
|
56
|
+
| +-- Export results.csv with all investigation + fix outcomes |
|
|
57
|
+
| +-- Generate context.md with diagnosis summary |
|
|
58
|
+
| +-- Update UAT gaps with diagnosis (if --from-uat) |
|
|
59
|
+
| +-- Update issues.jsonl with diagnosis results |
|
|
60
|
+
| +-- Display summary with next steps |
|
|
61
|
+
| |
|
|
62
|
+
+---------------------------------------------------------------------------+
|
|
63
|
+
```
|
|
64
|
+
</purpose>
|
|
65
|
+
|
|
66
|
+
<context>
|
|
67
|
+
```bash
|
|
68
|
+
$quality-debug "Login button throws 500 error on click"
|
|
69
|
+
$quality-debug -y "JWT token not refreshed --from-uat 3"
|
|
70
|
+
$quality-debug -c 4 "Navigation crash --from-uat 3 --parallel"
|
|
71
|
+
$quality-debug -y "--from-auto-test 3"
|
|
72
|
+
$quality-debug --continue "20260318-debug-P3-jwt-expiry"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Flags**:
|
|
76
|
+
- `-y, --yes`: Skip all confirmations (auto mode)
|
|
77
|
+
- `-c, --concurrency N`: Max concurrent agents within each wave (default: 5)
|
|
78
|
+
- `--continue`: Resume existing session
|
|
79
|
+
- `--from-uat <phase>`: Load gaps from UAT uat.md as pre-filled symptoms
|
|
80
|
+
- `--from-auto-test <phase>`: Load code_defect failures from auto-test report.json as pre-filled symptoms
|
|
81
|
+
- `--parallel`: One agent per gap cluster (implies from-uat or from-auto-test)
|
|
82
|
+
|
|
83
|
+
When `--yes` or `-y`: Auto-confirm hypothesis selection, skip interactive symptom gathering (require bug description in args), use defaults for mode detection.
|
|
84
|
+
|
|
85
|
+
**Output Directory**: `.workflow/.csv-wave/{session-id}/`
|
|
86
|
+
**Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report)
|
|
87
|
+
</context>
|
|
88
|
+
|
|
89
|
+
<csv_schema>
|
|
90
|
+
|
|
91
|
+
### tasks.csv (Master State)
|
|
92
|
+
|
|
93
|
+
```csv
|
|
94
|
+
id,title,description,hypothesis,evidence_for,evidence_against,deps,context_from,wave,status,findings,fix_applied,verified,error
|
|
95
|
+
"H1","Null pointer in login handler","Investigate whether login handler crashes due to null user object after failed DB lookup","User object is null when DB returns empty result; login.ts:42 dereferences without null check","","","","","1","","","","",""
|
|
96
|
+
"H2","Missing error boundary","Investigate whether unhandled promise rejection in auth middleware propagates to 500","Auth middleware catches DB errors but not validation errors; middleware.ts:78 has no catch block","","","","","1","","","","",""
|
|
97
|
+
"H3","Stale session token","Investigate whether expired session tokens bypass refresh logic","Session refresh only triggers on 403 but server returns 401 for expired tokens; session.ts:15","","","","","1","","","","",""
|
|
98
|
+
"FIX-H1","Fix null pointer in login","Apply null check before user object dereference in login handler","","","","H1","H1","2","","","","",""
|
|
99
|
+
"FIX-H3","Fix session token refresh","Update refresh trigger to also handle 401 status codes","","","","H3","H3","2","","","","",""
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Columns**:
|
|
103
|
+
|
|
104
|
+
| Column | Phase | Description |
|
|
105
|
+
|--------|-------|-------------|
|
|
106
|
+
| `id` | Input | Unique task identifier: `H{N}` for hypotheses (wave 1), `FIX-H{N}` for fixes (wave 2) |
|
|
107
|
+
| `title` | Input | Short hypothesis or fix title |
|
|
108
|
+
| `description` | Input | Detailed investigation/fix instructions |
|
|
109
|
+
| `hypothesis` | Input | The hypothesis being tested (wave 1) or empty (wave 2) |
|
|
110
|
+
| `evidence_for` | Output | Evidence supporting the hypothesis |
|
|
111
|
+
| `evidence_against` | Output | Evidence refuting the hypothesis |
|
|
112
|
+
| `deps` | Input | Semicolon-separated dependency task IDs (wave 2 depends on wave 1) |
|
|
113
|
+
| `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
|
|
114
|
+
| `wave` | Computed | Wave number (1 = investigation, 2 = fix attempt) |
|
|
115
|
+
| `status` | Output | `pending` -> `confirmed` / `refuted` / `inconclusive` / `fixed` / `fix_failed` / `skipped` |
|
|
116
|
+
| `findings` | Output | Key findings summary (max 500 chars) |
|
|
117
|
+
| `fix_applied` | Output | Description of fix applied (wave 2 only) |
|
|
118
|
+
| `verified` | Output | `true` / `false` -- whether fix was verified to work (wave 2 only) |
|
|
119
|
+
| `error` | Output | Error message if failed |
|
|
120
|
+
|
|
121
|
+
### Per-Wave CSV (Temporary)
|
|
122
|
+
|
|
123
|
+
Each wave generates `wave-{N}.csv` with extra `prev_context` column.
|
|
124
|
+
|
|
125
|
+
### Output Artifacts
|
|
126
|
+
|
|
127
|
+
| File | Purpose | Lifecycle |
|
|
128
|
+
|------|---------|-----------|
|
|
129
|
+
| `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
|
|
130
|
+
| `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
|
|
131
|
+
| `results.csv` | Final export of all task results | Created in Phase 3 |
|
|
132
|
+
| `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
|
|
133
|
+
| `context.md` | Human-readable diagnosis report | Created in Phase 3 |
|
|
134
|
+
|
|
135
|
+
### Session Structure
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
.workflow/.csv-wave/{YYYYMMDD}-debug-P{N}-{slug}/
|
|
139
|
+
+-- tasks.csv
|
|
140
|
+
+-- results.csv
|
|
141
|
+
+-- discoveries.ndjson
|
|
142
|
+
+-- context.md
|
|
143
|
+
+-- wave-{N}.csv (temporary)
|
|
144
|
+
```
|
|
145
|
+
</csv_schema>
|
|
146
|
+
|
|
147
|
+
<invariants>
|
|
148
|
+
1. **Start Immediately**: First action is session initialization, then Phase 1
|
|
149
|
+
2. **Wave Order is Sacred**: Never execute wave 2 before wave 1 completes and results are merged
|
|
150
|
+
3. **CSV is Source of Truth**: Master tasks.csv holds all state
|
|
151
|
+
4. **Context Propagation**: prev_context built from master CSV, not from memory
|
|
152
|
+
5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
|
|
153
|
+
6. **Skip on Refuted**: Wave 2 fix tasks skip if their hypothesis was refuted or inconclusive
|
|
154
|
+
7. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
|
|
155
|
+
8. **DO NOT STOP**: Continuous execution until all waves complete
|
|
156
|
+
</invariants>
|
|
157
|
+
|
|
158
|
+
<execution>
|
|
159
|
+
|
|
160
|
+
### Session Initialization
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
Parse from $ARGUMENTS:
|
|
164
|
+
AUTO_YES ← --yes | -y
|
|
165
|
+
continueMode ← --continue
|
|
166
|
+
maxConcurrency ← --concurrency | -c N (default: 5)
|
|
167
|
+
fromUat ← --from-uat <phase> (default: null)
|
|
168
|
+
fromAutoTest ← --from-auto-test <phase> (default: null)
|
|
169
|
+
parallelMode ← --parallel
|
|
170
|
+
bugDescription ← remaining text after flag removal
|
|
171
|
+
|
|
172
|
+
Derive:
|
|
173
|
+
phaseRef ← fromUat || fromAutoTest || null
|
|
174
|
+
sourceType ← fromAutoTest ? "auto-test" : fromUat ? "uat" : "standalone"
|
|
175
|
+
slug ← bugDescription kebab-cased, max 40 chars
|
|
176
|
+
dateStr ← UTC+8 YYYYMMDD
|
|
177
|
+
sessionId ← phaseRef ? "{dateStr}-debug-P{phaseRef}-{slug}" : "{dateStr}-debug-{slug}"
|
|
178
|
+
sessionFolder ← ".workflow/.csv-wave/{sessionId}"
|
|
179
|
+
|
|
180
|
+
mkdir -p {sessionFolder}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Phase 1: Input Resolution -> CSV
|
|
184
|
+
|
|
185
|
+
**Objective**: Parse mode, gather symptoms or load UAT gaps, generate hypotheses, build tasks.csv.
|
|
186
|
+
|
|
187
|
+
**Decomposition Rules**:
|
|
188
|
+
|
|
189
|
+
1. **Mode detection**:
|
|
190
|
+
|
|
191
|
+
| Condition | Mode |
|
|
192
|
+
|-----------|------|
|
|
193
|
+
| `--from-uat` flag present | from-uat (load gaps from uat.md) |
|
|
194
|
+
| `--from-auto-test` flag present | from-auto-test (load code_defects from report.json) |
|
|
195
|
+
| `--parallel` flag present | parallel (implies from-uat or from-auto-test, one agent per gap cluster) |
|
|
196
|
+
| Neither flag | standalone (gather symptoms interactively) |
|
|
197
|
+
|
|
198
|
+
2. **Related session discovery**: Query `state.json.artifacts[]` for matching phase+milestone. Extract relevant outputs by type: execute -> .summaries/.task/, review -> review.json (guide hypotheses), debug -> understanding.md (avoid re-investigation), test -> uat.md + .tests/auto-test/report.json.
|
|
199
|
+
|
|
200
|
+
2b. **Load codebase + wiki context** (optional, informs hypothesis generation):
|
|
201
|
+
- If `.workflow/codebase/ARCHITECTURE.md` exists: read module boundaries to scope impact analysis
|
|
202
|
+
- Run `maestro wiki search "<symptom keywords>" --json 2>/dev/null`; if results: check for prior investigations on similar issues
|
|
203
|
+
- Run `maestro spec load --category debug --keyword "<symptom keywords>"`; if tools found: extract known issues, workarounds, and root-cause notes to inform hypotheses
|
|
204
|
+
- All are optional — proceed without if unavailable
|
|
205
|
+
|
|
206
|
+
3. **Symptom collection**:
|
|
207
|
+
|
|
208
|
+
| Mode | Source | Action |
|
|
209
|
+
|------|--------|--------|
|
|
210
|
+
| standalone | User input | Ask 5 questions: expected, actual, errors, timeline, reproduction |
|
|
211
|
+
| from-uat | test artifact's uat.md (via registry) | Parse Gaps section, cluster by component |
|
|
212
|
+
| from-auto-test | test artifact's `.tests/auto-test/report.json` (via registry) | Parse `failures[]` where `classification == "code_defect"`, cluster by target module |
|
|
213
|
+
| parallel | test artifact's uat.md or report.json (via registry) | Same as from-uat/from-auto-test, one investigation per cluster |
|
|
214
|
+
|
|
215
|
+
**from-auto-test specifics**: Each `code_defect` failure provides: `scenario_id`, `req_ref`, `description`, `expected`, `actual`, `fix_suggestion.file`, `fix_suggestion.line`, `fix_suggestion.direction`. Map these to symptoms: expected=failure.expected, actual=failure.actual, location=fix_suggestion.file:line, context=fix_suggestion.direction.
|
|
216
|
+
|
|
217
|
+
3. **Hypothesis generation**: Per symptom cluster, analyze affected code and generate 3-5 ranked hypotheses (each becomes a wave 1 row).
|
|
218
|
+
|
|
219
|
+
4. **Fix task generation**: Pre-generate wave 2 fix row per hypothesis (`deps`/`context_from` -> hypothesis ID). Only executes if hypothesis confirmed.
|
|
220
|
+
|
|
221
|
+
5. **CSV generation**: Hypothesis rows (wave 1) + fix rows (wave 2).
|
|
222
|
+
|
|
223
|
+
**Wave computation**: Simple 2-wave -- all hypothesis tasks = wave 1, all fix tasks = wave 2.
|
|
224
|
+
|
|
225
|
+
**User validation**: Display hypothesis breakdown (skip if AUTO_YES).
|
|
226
|
+
|
|
227
|
+
### Phase 2: Wave Execution Engine
|
|
228
|
+
|
|
229
|
+
**Objective**: Investigate hypotheses wave-by-wave via spawn_agents_on_csv.
|
|
230
|
+
|
|
231
|
+
#### Wave 1: Hypothesis Investigation (Parallel)
|
|
232
|
+
|
|
233
|
+
1. Extract wave 1 pending rows from master `tasks.csv` into `wave-1.csv` (no prev_context needed)
|
|
234
|
+
2. Execute:
|
|
235
|
+
|
|
236
|
+
```javascript
|
|
237
|
+
spawn_agents_on_csv({
|
|
238
|
+
csv_path: `${sessionFolder}/wave-1.csv`,
|
|
239
|
+
id_column: "id",
|
|
240
|
+
instruction: buildInvestigationInstruction(sessionFolder), // agent: ~/.codex/agents/workflow-debugger.toml
|
|
241
|
+
max_concurrency: maxConcurrency, max_runtime_seconds: 3600,
|
|
242
|
+
output_csv_path: `${sessionFolder}/wave-1-results.csv`,
|
|
243
|
+
output_schema: { id, status: [confirmed|refuted|inconclusive|failed], findings, evidence_for, evidence_against, error }
|
|
244
|
+
})
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
3. Merge results into master `tasks.csv`, delete `wave-1.csv`
|
|
248
|
+
4. **Filter for wave 2**: Mark fix tasks as `skipped` if their hypothesis was `refuted` or `inconclusive`
|
|
249
|
+
|
|
250
|
+
#### Wave 2: Fix Attempts (Parallel, Confirmed Only)
|
|
251
|
+
|
|
252
|
+
1. If no confirmed hypotheses remain, skip wave 2 entirely
|
|
253
|
+
2. Extract wave 2 pending rows, build `prev_context` from confirmed wave 1 findings
|
|
254
|
+
3. Write `wave-2.csv`, then execute:
|
|
255
|
+
|
|
256
|
+
```javascript
|
|
257
|
+
spawn_agents_on_csv({
|
|
258
|
+
csv_path: `${sessionFolder}/wave-2.csv`,
|
|
259
|
+
id_column: "id",
|
|
260
|
+
instruction: buildFixInstruction(sessionFolder), // agent: ~/.codex/agents/workflow-debugger.toml
|
|
261
|
+
max_concurrency: maxConcurrency, max_runtime_seconds: 3600,
|
|
262
|
+
output_csv_path: `${sessionFolder}/wave-2-results.csv`,
|
|
263
|
+
output_schema: { id, status: [fixed|fix_failed|failed], findings, fix_applied, verified, error }
|
|
264
|
+
})
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
4. Merge results into master `tasks.csv`, delete `wave-2.csv`
|
|
268
|
+
|
|
269
|
+
### Phase 3: Results Aggregation
|
|
270
|
+
|
|
271
|
+
**Objective**: Generate final results and human-readable report.
|
|
272
|
+
|
|
273
|
+
1. Export final `tasks.csv` as `results.csv`
|
|
274
|
+
|
|
275
|
+
2. **Generate context.md**: Debug report with summary (mode, hypothesis/confirmed/fixed/verified counts), per-hypothesis results (hypothesis, evidence for/against, findings, status), per-fix results (fix applied, verified, findings), aggregated root causes, and next steps.
|
|
276
|
+
|
|
277
|
+
2b. **Debug confidence scoring**:
|
|
278
|
+
|
|
279
|
+
Dimensions (4): hypothesis_quality, evidence_completeness, root_cause_isolation, fix_confidence. Factors (weights): evidence_depth(.30), evidence_strength(.25), coverage_breadth(.20), reproduction(.15), consistency(.10). Map to legacy: <40% = low, 40-70% = medium, >70% = high. Append confidence assessment to context.md.
|
|
280
|
+
|
|
281
|
+
3. **UAT update** (if --from-uat): Update `uat.md` gaps with `root_cause`, `fix_direction`, `affected_files` for confirmed hypotheses.
|
|
282
|
+
|
|
283
|
+
4. **Issue update**: If `issues.jsonl` exists, update matching issues with status `diagnosed`, add `context.suggested_fix` and `context.notes`.
|
|
284
|
+
|
|
285
|
+
5. **Register artifact** (phase-scoped only): Append to `state.json.artifacts[]` with `type: "debug"`, `id: DBG-NNN`, `depends_on: triggering_review_id || exec_art.id`.
|
|
286
|
+
|
|
287
|
+
6. **Post-debug Knowledge Inquiry**: Prompt user to capture knowledge when:
|
|
288
|
+
- Recurring root cause pattern detected -> `/spec-add debug`
|
|
289
|
+
- Non-obvious fix strategy used -> `/spec-add learning`
|
|
290
|
+
- Architectural gap identified -> `/spec-add arch`
|
|
291
|
+
|
|
292
|
+
8. **Next step routing**:
|
|
293
|
+
|
|
294
|
+
| Result | Suggestion |
|
|
295
|
+
|--------|------------|
|
|
296
|
+
| All fixes verified | Run tests: `Skill({ skill: "quality-test", args: "{phase}" })` |
|
|
297
|
+
| Fixes applied, not verified | Re-verify: `Skill({ skill: "maestro-verify", args: "{phase}" })` |
|
|
298
|
+
| Confirmed but no fix | Plan fixes: `Skill({ skill: "maestro-plan", args: "{phase} --gaps" })` |
|
|
299
|
+
| All inconclusive | Resume with more context or manual investigation |
|
|
300
|
+
| From UAT, all diagnosed | `Skill({ skill: "quality-test", args: "{phase} --auto-fix" })` |
|
|
301
|
+
|
|
302
|
+
9. Display summary.
|
|
303
|
+
|
|
304
|
+
### Shared Discovery Board Protocol
|
|
305
|
+
|
|
306
|
+
#### Standard Discovery Types
|
|
307
|
+
|
|
308
|
+
| Type | Dedup Key | Data Schema | Description |
|
|
309
|
+
|------|-----------|-------------|-------------|
|
|
310
|
+
| `code_pattern` | `data.name` | `{name, file, description}` | Reusable code pattern found |
|
|
311
|
+
| `integration_point` | `data.file` | `{file, description, exports[]}` | Module connection point |
|
|
312
|
+
| `convention` | singleton | `{naming, imports, formatting}` | Project code conventions |
|
|
313
|
+
| `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
|
|
314
|
+
| `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
|
|
315
|
+
|
|
316
|
+
#### Domain Discovery Types
|
|
317
|
+
|
|
318
|
+
| Type | Dedup Key | Data Schema | Description |
|
|
319
|
+
|------|-----------|-------------|-------------|
|
|
320
|
+
| `root_cause` | `data.location` | `{location, cause, severity, confidence_score, confidence_factors}` | Confirmed root cause |
|
|
321
|
+
| `hypothesis_evidence` | `data.hypothesis+data.location` | `{hypothesis, location, type, conclusion}` | Evidence for/against hypothesis |
|
|
322
|
+
| `affected_component` | `data.component` | `{component, files[], impact}` | Component affected by bug |
|
|
323
|
+
| `reproduction_path` | `data.trigger` | `{trigger, steps[], frequency}` | Bug reproduction path |
|
|
324
|
+
|
|
325
|
+
#### Protocol
|
|
326
|
+
|
|
327
|
+
Read `discoveries.ndjson` before investigation. Append-only: dedup by type+key before writing, never modify/delete.
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
echo '{"ts":"<ISO>","worker":"{id}","type":"root_cause","data":{"location":"src/auth/login.ts:42","cause":"null_dereference","severity":"high","confidence":"confirmed"}}' >> {session_folder}/discoveries.ndjson
|
|
331
|
+
```
|
|
332
|
+
</execution>
|
|
333
|
+
|
|
334
|
+
<error_codes>
|
|
335
|
+
|
|
336
|
+
| Error | Resolution |
|
|
337
|
+
|-------|------------|
|
|
338
|
+
| No bug description and no --from-uat/--from-auto-test | Abort with error: "Issue description required" |
|
|
339
|
+
| UAT file not found for --from-uat phase | Abort with error: "uat.md not found for phase {N}" |
|
|
340
|
+
| Auto-test report not found for --from-auto-test phase | Abort with error: "report.json not found for phase {N}" |
|
|
341
|
+
| No gaps in UAT file / no code_defects in report | Abort with error: "No failed gaps/defects found" |
|
|
342
|
+
| Hypothesis agent timeout | Mark as inconclusive, continue with remaining |
|
|
343
|
+
| All hypotheses refuted | Skip wave 2, suggest manual investigation |
|
|
344
|
+
| Fix agent timeout | Mark as fix_failed, report partial results |
|
|
345
|
+
| CSV parse error | Validate format, show line number |
|
|
346
|
+
| discoveries.ndjson corrupt | Ignore malformed lines |
|
|
347
|
+
| Continue mode: no session found | List available sessions |
|
|
348
|
+
| Existing debug session found | Offer resume (skip if AUTO_YES) |
|
|
349
|
+
</error_codes>
|
|
350
|
+
|
|
351
|
+
<success_criteria>
|
|
352
|
+
- [ ] Session folder created with valid tasks.csv
|
|
353
|
+
- [ ] Wave 1 hypotheses investigated in parallel
|
|
354
|
+
- [ ] Refuted/inconclusive hypotheses correctly skip wave 2 fix tasks
|
|
355
|
+
- [ ] Wave 2 fixes attempted only for confirmed hypotheses
|
|
356
|
+
- [ ] context.md produced with diagnosis summary
|
|
357
|
+
- [ ] Multi-factor confidence scored per hypothesis replacing simple high/medium/low
|
|
358
|
+
- [ ] Confidence assessment appended to context.md
|
|
359
|
+
- [ ] UAT gaps updated (if --from-uat)
|
|
360
|
+
- [ ] Issues updated with diagnosis results
|
|
361
|
+
- [ ] discoveries.ndjson append-only throughout
|
|
362
|
+
</success_criteria>
|