maestro-flow 0.5.44 → 0.5.46
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/.agents/agents/ralph-executor.md +93 -0
- package/.agents/skills/maestro-ralph-cli/SKILL.md +21 -16
- package/.agents/skills/maestro-ralph-v2/SKILL.md +923 -0
- package/.agents/skills/odyssey-debug/SKILL.md +338 -253
- package/.agents/skills/odyssey-improve/SKILL.md +367 -281
- package/.agents/skills/odyssey-planex/SKILL.md +490 -420
- package/.agents/skills/odyssey-review-test-fix/SKILL.md +336 -251
- package/.agents/skills/odyssey-ui/SKILL.md +332 -247
- package/.agy/agents/ralph-executor.md +91 -0
- package/.agy/skills/maestro-ralph-cli/SKILL.md +21 -16
- package/.agy/skills/maestro-ralph-v2/SKILL.md +935 -0
- package/.agy/skills/odyssey-debug/SKILL.md +338 -253
- package/.agy/skills/odyssey-improve/SKILL.md +367 -281
- package/.agy/skills/odyssey-planex/SKILL.md +490 -420
- package/.agy/skills/odyssey-review-test-fix/SKILL.md +336 -251
- package/.agy/skills/odyssey-ui/SKILL.md +332 -247
- package/.claude/agents/ralph-executor.md +91 -0
- package/.claude/commands/maestro-ralph-cli.md +21 -16
- package/.claude/commands/maestro-ralph-v2.md +921 -0
- package/.claude/commands/odyssey-debug.md +352 -267
- package/.claude/commands/odyssey-improve.md +381 -295
- package/.claude/commands/odyssey-planex.md +504 -434
- package/.claude/commands/odyssey-review-test-fix.md +350 -265
- package/.claude/commands/odyssey-ui.md +346 -261
- package/.codex/skills/maestro-next/SKILL.md +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +3 -3
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +6 -0
- package/dashboard/dist-server/src/graph/kg/db/queries.js +141 -19
- package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js +2 -2
- package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +2 -2
- package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
- package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js +1 -1
- package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js.map +1 -1
- package/dashboard/dist-server/src/hooks/keyword-spec-injector.js +35 -0
- package/dashboard/dist-server/src/hooks/keyword-spec-injector.js.map +1 -1
- package/dashboard/dist-server/src/hooks/spec-analytics.d.ts +1 -0
- package/dashboard/dist-server/src/hooks/spec-analytics.js.map +1 -1
- package/dashboard/dist-server/src/hooks/wiki-search-bridge.d.ts +32 -0
- package/dashboard/dist-server/src/hooks/wiki-search-bridge.js +71 -0
- package/dashboard/dist-server/src/hooks/wiki-search-bridge.js.map +1 -0
- package/dist/src/agents/api-explore/agent-loop.d.ts +15 -2
- package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -1
- package/dist/src/agents/api-explore/agent-loop.js +6 -5
- package/dist/src/agents/api-explore/agent-loop.js.map +1 -1
- package/dist/src/agents/api-explore/config.d.ts +56 -0
- package/dist/src/agents/api-explore/config.d.ts.map +1 -1
- package/dist/src/agents/api-explore/config.js +34 -0
- package/dist/src/agents/api-explore/config.js.map +1 -1
- package/dist/src/agents/api-explore/llm.d.ts +5 -1
- package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
- package/dist/src/agents/api-explore/llm.js +10 -8
- package/dist/src/agents/api-explore/llm.js.map +1 -1
- package/dist/src/agents/api-explore/moa-cache.d.ts +12 -0
- package/dist/src/agents/api-explore/moa-cache.d.ts.map +1 -0
- package/dist/src/agents/api-explore/moa-cache.js +50 -0
- package/dist/src/agents/api-explore/moa-cache.js.map +1 -0
- package/dist/src/agents/api-explore/moa-loop.d.ts +49 -0
- package/dist/src/agents/api-explore/moa-loop.d.ts.map +1 -0
- package/dist/src/agents/api-explore/moa-loop.js +43 -0
- package/dist/src/agents/api-explore/moa-loop.js.map +1 -0
- package/dist/src/agents/api-explore/moa-pipeline.d.ts +43 -0
- package/dist/src/agents/api-explore/moa-pipeline.d.ts.map +1 -0
- package/dist/src/agents/api-explore/moa-pipeline.js +276 -0
- package/dist/src/agents/api-explore/moa-pipeline.js.map +1 -0
- package/dist/src/agents/api-explore/runner.d.ts +3 -0
- package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
- package/dist/src/agents/api-explore/runner.js +24 -7
- package/dist/src/agents/api-explore/runner.js.map +1 -1
- package/dist/src/agents/api-explore/session.d.ts +15 -0
- package/dist/src/agents/api-explore/session.d.ts.map +1 -1
- package/dist/src/agents/api-explore/session.js.map +1 -1
- package/dist/src/cli.js +1 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/explore.d.ts.map +1 -1
- package/dist/src/commands/explore.js +16 -1
- package/dist/src/commands/explore.js.map +1 -1
- package/dist/src/commands/moa.d.ts +3 -0
- package/dist/src/commands/moa.d.ts.map +1 -0
- package/dist/src/commands/moa.js +202 -0
- package/dist/src/commands/moa.js.map +1 -0
- package/dist/src/graph/kg/db/queries.d.ts +6 -0
- package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
- package/dist/src/graph/kg/db/queries.js +141 -19
- package/dist/src/graph/kg/db/queries.js.map +1 -1
- package/dist/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
- package/dist/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
- package/dist/src/graph/kg/extraction/code/tree-sitter.js +2 -2
- package/dist/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
- package/dist/src/graph/kg/extraction/code/vue-extractor.js +1 -1
- package/dist/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
- package/dist/src/graph/kg/extraction/code/wasm-stability.js +1 -1
- package/dist/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
- package/dist/src/graph/kg/extraction/orchestrator.js +2 -2
- package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
- package/dist/src/graph/kg/surface/hook-injector.js +1 -1
- package/dist/src/graph/kg/surface/hook-injector.js.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/keyword-spec-injector.js +35 -0
- package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
- package/dist/src/hooks/spec-analytics.d.ts +1 -0
- package/dist/src/hooks/spec-analytics.d.ts.map +1 -1
- package/dist/src/hooks/spec-analytics.js.map +1 -1
- package/dist/src/hooks/wiki-search-bridge.d.ts +33 -0
- package/dist/src/hooks/wiki-search-bridge.d.ts.map +1 -0
- package/dist/src/hooks/wiki-search-bridge.js +71 -0
- package/dist/src/hooks/wiki-search-bridge.js.map +1 -0
- package/dist/src/utils/update-notices.js +12 -0
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +1 -1
- package/.agents/skills/maestro-ralph-agent/SKILL.md +0 -697
- package/.agents/skills/maestro-ralph-agent-execute/SKILL.md +0 -461
- package/.agy/skills/maestro-ralph-agent/SKILL.md +0 -696
- package/.agy/skills/maestro-ralph-agent-execute/SKILL.md +0 -457
- package/.claude/commands/maestro-ralph-agent-execute.md +0 -459
- package/.claude/commands/maestro-ralph-agent.md +0 -695
|
@@ -14,256 +14,341 @@ allowed-tools:
|
|
|
14
14
|
---
|
|
15
15
|
<!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
|
|
16
16
|
|
|
17
|
-
<base>@~/.maestro/workflows/odyssey-base.md</base>
|
|
18
|
-
|
|
19
|
-
<purpose>
|
|
20
|
-
archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
|
|
21
|
-
Exhaustive iteration until root cause confirmed or INCONCLUSIVE.
|
|
22
|
-
</purpose>
|
|
23
|
-
|
|
24
|
-
<boundary>
|
|
25
|
-
**In scope:** Single bug/issue full loop.
|
|
26
|
-
**Out of scope:** Features → `/odyssey-planex` | Quality review → `/odyssey-review-test-fix` | UI → `/odyssey-ui` | Architecture → `/maestro-plan`
|
|
27
|
-
|
|
28
|
-
**`--template <name>`:**
|
|
29
|
-
|
|
30
|
-
| Template | Strategy | Use case |
|
|
31
|
-
|----------|----------|----------|
|
|
32
|
-
| `performance` | profiling → hot path → allocation → cache | Performance degradation |
|
|
33
|
-
| `memory-leak` | heap snapshot → retention chain → lifecycle | Memory leaks |
|
|
34
|
-
| `race-condition` | timeline → concurrent access → lock analysis | Race conditions |
|
|
35
|
-
| `regression` | git bisect → diff analysis → boundary check | Regressions |
|
|
36
|
-
| `crash` | stack trace → null chain → error propagation | Crashes / exceptions |
|
|
37
|
-
</boundary>
|
|
38
|
-
|
|
39
|
-
<context>
|
|
40
|
-
$ARGUMENTS
|
|
41
|
-
|
|
42
|
-
**Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
|
|
43
|
-
|
|
44
|
-
**Session**: `.workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
|
|
45
|
-
**Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
|
|
46
|
-
|
|
47
|
-
**session.json — debug-specific fields:**
|
|
48
|
-
```json
|
|
49
|
-
{ "issue": "", "diagnosis_retries": 0, "root_cause": null, "confirmation": null,
|
|
50
|
-
"patterns": [], "generalization_stats": null }
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
**evidence.ndjson phases:** `archaeology|explore|diagnosis|discovery|decision|self-iteration`
|
|
54
|
-
- `archaeology`: `sha`, `author`, `date`, `message`, `relevance`
|
|
55
|
-
- `explore`: `category` (call_chain|recent_change|error_gap|similar_pattern), `detail`
|
|
56
|
-
- `diagnosis`: `hypothesis`, `result` (confirmed|disproved|inconclusive)
|
|
57
|
-
- `discovery`: `file`, `line`, `classification` (safe|risk|bug), `action` (fix|issue|decision|skip)
|
|
58
|
-
- `decision`: `question`, `options`, `context`, `status`, `resolution`
|
|
59
|
-
- `self-iteration`: `stage`, `round`, `assessment`, `expansion`
|
|
60
|
-
|
|
61
|
-
**explore.json**: `{call_chains, recent_changes, error_gaps, similar_patterns, cli_tool, timestamp}`
|
|
62
|
-
|
|
63
|
-
**phase_goals[]:**
|
|
64
|
-
|
|
65
|
-
| ID | Goal | done_when | phase | skip_when |
|
|
66
|
-
|----|------|-----------|-------|-----------|
|
|
67
|
-
| G1 | Root cause identified | phase=diagnosis result=confirmed | S_DIAGNOSE | — |
|
|
68
|
-
| G2 | Explore context gathered | explore.json ≥1 category | S_EXPLORE | — |
|
|
69
|
-
| G3 | Fix applied and confirmed | confirmation.overall == confirmed | S_CONFIRM | skip_fix |
|
|
70
|
-
| G4 | Pattern generalized | patterns[] ≥1 entry | S_GENERALIZE | skip_generalize |
|
|
71
|
-
| G5 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
|
|
72
|
-
| G6 | Learnings persisted | spec entries created OR none actionable | S_RECORD | — |
|
|
73
|
-
|
|
74
|
-
**understanding.md — 9 sections:**
|
|
75
|
-
1. Issue & Scope ← S_INTAKE | 2. Archaeology ← S_ARCHAEOLOGY | 3. Exploration ← S_EXPLORE
|
|
76
|
-
4. Hypotheses ← S_DIAGNOSE | 5. Root Cause ← S_DIAGNOSE | 6. Fix & Confirmation ← S_FIX+S_CONFIRM
|
|
77
|
-
7. Generalization ← S_GENERALIZE | 8. Discoveries ← S_DISCOVER | 9. Learnings ← S_RECORD
|
|
78
|
-
|
|
79
|
-
**Knowledge Persistence categories (§9):**
|
|
80
|
-
|
|
81
|
-
| Category | Content | Follow-up |
|
|
82
|
-
|----------|---------|-----------|
|
|
83
|
-
| Recurring root cause pattern | Type + triggers + fix + detection | `/spec-add debug` |
|
|
84
|
-
| Non-obvious workaround | Problem + steps + why obvious fix fails | `/spec-add learning` |
|
|
85
|
-
| Architecture boundary violation | Violation + correct boundary + verification | `/spec-add arch` |
|
|
86
|
-
| Reusable generalization pattern | Signature + risk + fix template + scope | `/spec-add coding` |
|
|
87
|
-
</context>
|
|
88
|
-
|
|
89
|
-
<invariants>
|
|
90
|
-
1. **Evidence append-only** — never delete or overwrite evidence.ndjson entries
|
|
91
|
-
2. **Phase goal tracking** — mark goal done/failed before transition; no silent skips
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
S_INTAKE →
|
|
107
|
-
S_INTAKE →
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
S_EXPLORE
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
S_DIAGNOSE →
|
|
114
|
-
S_DIAGNOSE →
|
|
115
|
-
S_DIAGNOSE →
|
|
116
|
-
S_DIAGNOSE →
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
S_CONFIRM →
|
|
121
|
-
S_CONFIRM →
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
S_GENERALIZE →
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
S_DISCOVER →
|
|
128
|
-
S_DISCOVER →
|
|
129
|
-
S_DISCOVER → S_RECORD :
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
17
|
+
<base>@~/.maestro/workflows/odyssey-base.md</base>
|
|
18
|
+
|
|
19
|
+
<purpose>
|
|
20
|
+
archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
|
|
21
|
+
Exhaustive iteration until root cause confirmed or INCONCLUSIVE.
|
|
22
|
+
</purpose>
|
|
23
|
+
|
|
24
|
+
<boundary>
|
|
25
|
+
**In scope:** Single bug/issue full loop.
|
|
26
|
+
**Out of scope:** Features → `/odyssey-planex` | Quality review → `/odyssey-review-test-fix` | UI → `/odyssey-ui` | Architecture → `/maestro-plan`
|
|
27
|
+
|
|
28
|
+
**`--template <name>`:**
|
|
29
|
+
|
|
30
|
+
| Template | Strategy | Use case |
|
|
31
|
+
|----------|----------|----------|
|
|
32
|
+
| `performance` | profiling → hot path → allocation → cache | Performance degradation |
|
|
33
|
+
| `memory-leak` | heap snapshot → retention chain → lifecycle | Memory leaks |
|
|
34
|
+
| `race-condition` | timeline → concurrent access → lock analysis | Race conditions |
|
|
35
|
+
| `regression` | git bisect → diff analysis → boundary check | Regressions |
|
|
36
|
+
| `crash` | stack trace → null chain → error propagation | Crashes / exceptions |
|
|
37
|
+
</boundary>
|
|
38
|
+
|
|
39
|
+
<context>
|
|
40
|
+
$ARGUMENTS
|
|
41
|
+
|
|
42
|
+
**Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
|
|
43
|
+
|
|
44
|
+
**Session**: `.workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
|
|
45
|
+
**Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
|
|
46
|
+
|
|
47
|
+
**session.json — debug-specific fields:**
|
|
48
|
+
```json
|
|
49
|
+
{ "issue": "", "diagnosis_retries": 0, "root_cause": null, "confirmation": null,
|
|
50
|
+
"patterns": [], "generalization_stats": null }
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**evidence.ndjson phases:** `archaeology|explore|diagnosis|discovery|decision|self-iteration`
|
|
54
|
+
- `archaeology`: `sha`, `author`, `date`, `message`, `relevance`
|
|
55
|
+
- `explore`: `category` (call_chain|recent_change|error_gap|similar_pattern), `detail`
|
|
56
|
+
- `diagnosis`: `hypothesis`, `result` (confirmed|disproved|inconclusive)
|
|
57
|
+
- `discovery`: `file`, `line`, `classification` (safe|risk|bug), `action` (fix|issue|decision|skip)
|
|
58
|
+
- `decision`: `question`, `options`, `context`, `status`, `resolution`
|
|
59
|
+
- `self-iteration`: `stage`, `round`, `assessment`, `expansion`
|
|
60
|
+
|
|
61
|
+
**explore.json**: `{call_chains, recent_changes, error_gaps, similar_patterns, cli_tool, timestamp}`
|
|
62
|
+
|
|
63
|
+
**phase_goals[]:**
|
|
64
|
+
|
|
65
|
+
| ID | Goal | done_when | phase | skip_when |
|
|
66
|
+
|----|------|-----------|-------|-----------|
|
|
67
|
+
| G1 | Root cause identified | phase=diagnosis result=confirmed | S_DIAGNOSE | — |
|
|
68
|
+
| G2 | Explore context gathered | explore.json ≥1 category | S_EXPLORE | — |
|
|
69
|
+
| G3 | Fix applied and confirmed | confirmation.overall == confirmed | S_CONFIRM | skip_fix |
|
|
70
|
+
| G4 | Pattern generalized | patterns[] ≥1 entry | S_GENERALIZE | skip_generalize |
|
|
71
|
+
| G5 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
|
|
72
|
+
| G6 | Learnings persisted | spec entries created OR none actionable | S_RECORD | — |
|
|
73
|
+
|
|
74
|
+
**understanding.md — 9 sections:**
|
|
75
|
+
1. Issue & Scope ← S_INTAKE | 2. Archaeology ← S_ARCHAEOLOGY | 3. Exploration ← S_EXPLORE
|
|
76
|
+
4. Hypotheses ← S_DIAGNOSE | 5. Root Cause ← S_DIAGNOSE | 6. Fix & Confirmation ← S_FIX+S_CONFIRM
|
|
77
|
+
7. Generalization ← S_GENERALIZE | 8. Discoveries ← S_DISCOVER | 9. Learnings ← S_RECORD
|
|
78
|
+
|
|
79
|
+
**Knowledge Persistence categories (§9):**
|
|
80
|
+
|
|
81
|
+
| Category | Content | Follow-up |
|
|
82
|
+
|----------|---------|-----------|
|
|
83
|
+
| Recurring root cause pattern | Type + triggers + fix + detection | `/spec-add debug` |
|
|
84
|
+
| Non-obvious workaround | Problem + steps + why obvious fix fails | `/spec-add learning` |
|
|
85
|
+
| Architecture boundary violation | Violation + correct boundary + verification | `/spec-add arch` |
|
|
86
|
+
| Reusable generalization pattern | Signature + risk + fix template + scope | `/spec-add coding` |
|
|
87
|
+
</context>
|
|
88
|
+
|
|
89
|
+
<invariants>
|
|
90
|
+
1. **Evidence append-only** — never delete or overwrite evidence.ndjson entries
|
|
91
|
+
2. **Phase goal tracking** — mark goal done/failed before transition; no silent skips
|
|
92
|
+
3. **Generalize is mandatory** — S_GENERALIZE and S_DISCOVER execute unless `skip_generalize == true`. "No findings" from prior phases, convergence signals, or context pressure are NOT valid reasons to skip. The phase itself determines whether patterns exist.
|
|
93
|
+
</invariants>
|
|
94
|
+
|
|
95
|
+
<self_iteration>
|
|
96
|
+
Applies to: **S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE**. Logic in base.
|
|
97
|
+
</self_iteration>
|
|
98
|
+
|
|
99
|
+
<state_machine>
|
|
100
|
+
|
|
101
|
+
<states>
|
|
102
|
+
S_INTAKE → S_ARCHAEOLOGY → S_EXPLORE → S_DIAGNOSE → S_FIX → S_CONFIRM → S_GENERALIZE → S_DISCOVER → S_RECORD → END
|
|
103
|
+
</states>
|
|
104
|
+
|
|
105
|
+
<transitions>
|
|
106
|
+
S_INTAKE → S_INTAKE : -c + session found → A_RESUME_SESSION
|
|
107
|
+
S_INTAKE → S_ARCHAEOLOGY : issue parsed → A_INTAKE
|
|
108
|
+
S_INTAKE → S_INTAKE : no issue, no session → ask_user
|
|
109
|
+
|
|
110
|
+
S_ARCHAEOLOGY → S_EXPLORE : complete
|
|
111
|
+
S_EXPLORE → S_DIAGNOSE : complete
|
|
112
|
+
|
|
113
|
+
S_DIAGNOSE → S_FIX : confirmed, !skip_fix
|
|
114
|
+
S_DIAGNOSE → S_GENERALIZE : confirmed, skip_fix, !skip_generalize
|
|
115
|
+
S_DIAGNOSE → S_RECORD : confirmed, skip_fix, skip_generalize
|
|
116
|
+
S_DIAGNOSE → S_DIAGNOSE : all hypotheses failed, retries < 3 → A_ESCALATE_DIAGNOSIS
|
|
117
|
+
S_DIAGNOSE → S_RECORD : retries >= 3 → INCONCLUSIVE
|
|
118
|
+
|
|
119
|
+
S_FIX → S_CONFIRM : fix implemented
|
|
120
|
+
S_CONFIRM → S_GENERALIZE : confirmed, !skip_generalize
|
|
121
|
+
S_CONFIRM → S_RECORD : confirmed, skip_generalize
|
|
122
|
+
S_CONFIRM → S_FIX : needs_rework
|
|
123
|
+
|
|
124
|
+
S_GENERALIZE → S_DISCOVER : similar code found
|
|
125
|
+
S_GENERALIZE → S_RECORD : all 3 layers scanned with evidence, total_hits == 0
|
|
126
|
+
|
|
127
|
+
S_DISCOVER → S_DIAGNOSE : new bug → cross_phase_loops++
|
|
128
|
+
S_DISCOVER → S_FIX : same-pattern bug + fix_template, !skip_fix → cross_phase_loops++
|
|
129
|
+
S_DISCOVER → S_RECORD : remaining_actionable == 0
|
|
130
|
+
S_DISCOVER → S_RECORD : loops >= max_loops → log per-item reasons
|
|
131
|
+
|
|
132
|
+
S_RECORD → END : complete
|
|
133
|
+
</transitions>
|
|
134
|
+
|
|
135
|
+
<actions>
|
|
136
|
+
|
|
137
|
+
### A_INTAKE
|
|
138
|
+
1. Parse arguments, generate slug, create SESSION_DIR
|
|
139
|
+
2. `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
|
|
140
|
+
3. Derive `phase_goals[]` from flags
|
|
141
|
+
4. Write `session.json` + `understanding.md` §1, emit Goal Prompt
|
|
142
|
+
|
|
143
|
+
Commit: `"odyssey-debug({slug}): INTAKE — parse target and load context"`
|
|
144
|
+
|
|
145
|
+
### A_RESUME_SESSION
|
|
146
|
+
Glob latest session → read `session.json` → jump to `current_state`.
|
|
147
|
+
|
|
148
|
+
### A_ARCHAEOLOGY
|
|
149
|
+
2 parallel Agents: Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 files `git blame -L {region}`). Evidence phase=archaeology.
|
|
150
|
+
|
|
151
|
+
`maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
|
|
152
|
+
- PURPOSE: Review recent modifications related to {issue}
|
|
153
|
+
- EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
|
|
154
|
+
|
|
155
|
+
Update §2. Commit: `"odyssey-debug({slug}): ARCHAEOLOGY — git history analysis"`
|
|
156
|
+
|
|
157
|
+
### A_EXPLORE
|
|
158
|
+
Skip if no CLI tools (W006).
|
|
159
|
+
|
|
160
|
+
`maestro delegate --role explore --mode analysis` (`run_in_background: true`):
|
|
161
|
+
- PURPOSE: Call chains, recent changes, error gaps, similar patterns
|
|
162
|
+
- EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
|
|
163
|
+
|
|
164
|
+
Write `explore.json` + evidence phase=explore. Update §3. Mark G2. Commit: `"odyssey-debug({slug}): EXPLORE — codebase exploration"`
|
|
165
|
+
|
|
166
|
+
### A_DIAGNOSE
|
|
167
|
+
1. Hypotheses from evidence, ranked [HIGH]/[MEDIUM]/[LOW] → §4
|
|
168
|
+
2. Test each → evidence phase=diagnosis
|
|
169
|
+
3. Ambiguity → evidence phase=decision; Normal: ask_user | `-y`: defer
|
|
170
|
+
4. Confirmed → `session.json.root_cause` + §5. Mark G1.
|
|
171
|
+
|
|
172
|
+
Commit: `"odyssey-debug({slug}): DIAGNOSE — root cause confirmed"`
|
|
173
|
+
|
|
174
|
+
### A_ESCALATE_DIAGNOSIS
|
|
175
|
+
`diagnosis_retries++`. < 3: `maestro delegate --role analyze`, new hypotheses, → S_DIAGNOSE. >= 3: Normal → ask_user | `-y` → INCONCLUSIVE → S_RECORD.
|
|
176
|
+
|
|
177
|
+
### A_FIX
|
|
178
|
+
1. Present root cause + proposed fix. Normal: ask_user | `-y`: auto proceed
|
|
179
|
+
2. Implement fix, evidence phase=decision
|
|
180
|
+
|
|
181
|
+
Commit: `"odyssey-debug({slug}): FIX — {summary}"`
|
|
182
|
+
|
|
183
|
+
### A_CONFIRM
|
|
184
|
+
1. Run covering tests
|
|
185
|
+
2. `maestro delegate --role review --mode analysis` (`run_in_background: true`):
|
|
186
|
+
- EXPECTED: JSON {verdict, findings [{severity, description, suggestion}], regression_risk}
|
|
187
|
+
3. `session.json.confirmation`: `{test_result, cli_review, overall: "confirmed|needs_rework"}`
|
|
188
|
+
4. Update §6. `needs_rework` → S_FIX. `confirmed` → mark G3.
|
|
189
|
+
|
|
190
|
+
Commit: `"odyssey-debug({slug}): CONFIRM — fix verified"`
|
|
191
|
+
|
|
192
|
+
### A_GENERALIZE
|
|
193
|
+
|
|
194
|
+
**MANDATORY — executes unless `skip_generalize == true`. Prior-phase convergence, "no findings," or context pressure are NOT valid skip reasons.**
|
|
195
|
+
|
|
196
|
+
Pattern source: confirmed root cause + applied fix.
|
|
197
|
+
|
|
198
|
+
**Step 1 — 3-layer pattern extraction:**
|
|
199
|
+
|
|
200
|
+
| Layer | Method | Targets |
|
|
201
|
+
|-------|--------|---------|
|
|
202
|
+
| Syntax | Build regex from fix diff → Grep | Missing `await`, unchecked null, wrong comparison, identical error-handling gap |
|
|
203
|
+
| Semantic | Understand anti-pattern that caused the bug → Agent scan | Same async-without-catch, same boundary assumption, race on shared state |
|
|
204
|
+
| Structural | Find files with same module shape / import graph | Sibling handlers, parallel service implementations, same-shape error handlers |
|
|
205
|
+
|
|
206
|
+
Write `session.json.patterns[]`: `[{id, source, layer, signature, description, risk, fix_template, confidence}]`
|
|
207
|
+
|
|
208
|
+
**Thoroughness floor:** ALL 3 layers must be attempted and logged. Each layer records search method, scope, hit count in evidence phase=generalization. "No hits" requires all 3 layers to return 0 with logged evidence — a single-layer quick grep does NOT satisfy.
|
|
209
|
+
|
|
210
|
+
**Step 2 — 4-agent concurrent scan** (single message, 4 Agents):
|
|
211
|
+
|
|
212
|
+
| Agent | Strategy | Scope |
|
|
213
|
+
|-------|----------|-------|
|
|
214
|
+
| Syntax grep | Grep regex from pattern signatures | Full project |
|
|
215
|
+
| Semantic scan | Anti-pattern understanding → scan same bug class | Related modules |
|
|
216
|
+
| Structural match | Find structurally similar files to buggy file | Full project |
|
|
217
|
+
| Historical grep | `git log -S` for pattern signatures | Git history |
|
|
218
|
+
|
|
219
|
+
**Step 3 — Cross-layer dedup:** multi-layer hit → boost | single-layer → `needs_review` | historically fixed → `regression_risk`
|
|
220
|
+
|
|
221
|
+
**Step 4 — Iterative deepening:** Module with ≥3 hits → targeted deep scan (max 1 round).
|
|
222
|
+
|
|
223
|
+
**Step 5 — Persist:** Update understanding.md §7 + write `session.json.generalization_stats`:
|
|
224
|
+
```json
|
|
225
|
+
{"patterns_extracted": 0, "total_hits": 0, "cross_layer_confirmed": 0, "regression_risks": 0, "by_layer": {"syntax": 0, "semantic": 0, "structural": 0}, "deepening_triggered": false}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Transition guard:** `S_GENERALIZE → S_RECORD` requires `by_layer` has entries for all 3 layers with search evidence logged. Mark G4 done.
|
|
229
|
+
|
|
230
|
+
Commit: `"odyssey-debug({slug}): GENERALIZE — pattern scan complete"`
|
|
231
|
+
|
|
232
|
+
### A_DISCOVER
|
|
233
|
+
|
|
234
|
+
**Executes whenever `total_hits > 0`. Cannot be skipped without `skip_generalize == true`.**
|
|
235
|
+
|
|
236
|
+
1. **Triage** each hit with ±10 lines context → classify:
|
|
237
|
+
- `bug` — same defect pattern confirmed
|
|
238
|
+
- `risk` — potential issue needing guard
|
|
239
|
+
- `safe` — false positive (must log individual reason — blanket "pre-existing" forbidden)
|
|
240
|
+
|
|
241
|
+
2. **Route:**
|
|
242
|
+
|
|
243
|
+
| Classification | Action |
|
|
244
|
+
|---------------|--------|
|
|
245
|
+
| bug + fix_template applicable | Immediate fix → back to S_FIX |
|
|
246
|
+
| bug + cross-module or no template | Create issue (fix suggestion + impact) |
|
|
247
|
+
| risk + guard addable directly | Fix directly |
|
|
248
|
+
| risk + complex | Create issue |
|
|
249
|
+
| safe | Skip with logged per-item reason |
|
|
250
|
+
|
|
251
|
+
Normal: ask_user per hit | `-y`: auto-fix bugs with fix_template, create issue for rest
|
|
252
|
+
|
|
253
|
+
3. **Cross-phase loops:** `cross_phase_loops++` on fix/diagnose return. `loops >= max_loops` → must log per-item reasons.
|
|
254
|
+
|
|
255
|
+
4. Append evidence phase=discovery. Update understanding.md §8. Mark G5 done.
|
|
256
|
+
|
|
257
|
+
Commit: `"odyssey-debug({slug}): DISCOVER — sibling triage complete"`
|
|
258
|
+
|
|
259
|
+
### A_RECORD
|
|
260
|
+
|
|
261
|
+
1. Finalize understanding.md §9 — learnings by Knowledge Persistence categories:
|
|
262
|
+
- Recurring root cause pattern → `/spec-add debug`
|
|
263
|
+
- Non-obvious workaround → `/spec-add learning`
|
|
264
|
+
- Architecture boundary violation → `/spec-add arch`
|
|
265
|
+
- Reusable generalization pattern → `/spec-add coding`
|
|
266
|
+
|
|
267
|
+
2. Mark G6 done. Pending decisions: Normal → ask_user | `-y` → skip (show deferred count).
|
|
268
|
+
|
|
269
|
+
3. **Goal audit (hardened):**
|
|
270
|
+
- `done` → confirmed
|
|
271
|
+
- `skipped` → confirmed ONLY if corresponding `skip_when` flag is true
|
|
272
|
+
- **Hard rule:** G4 and G5 CANNOT be `skipped` unless `skip_generalize == true`. Pending without flag → `failed` (Normal: ask_user | `-y`: record `failed`)
|
|
273
|
+
- `phase_goals_all_done = true` only when all goals pass this audit
|
|
274
|
+
|
|
275
|
+
4. `current_state = "COMPLETED"`, emit completion summary.
|
|
276
|
+
|
|
277
|
+
**Completion summary:**
|
|
278
|
+
```
|
|
279
|
+
--- DEBUG ODYSSEY COMPLETE ---
|
|
280
|
+
Issue: {issue}
|
|
281
|
+
Root cause: {root_cause.hypothesis}
|
|
282
|
+
Fix: {applied|skipped|inconclusive}
|
|
283
|
+
Patterns: {patterns_extracted} ({by_layer})
|
|
284
|
+
Scan hits: {total_hits} ({cross_layer_confirmed} confirmed)
|
|
285
|
+
Issues: {N} created
|
|
286
|
+
Decisions: {N} resolved, {M} pending, {K} deferred
|
|
287
|
+
Learnings: {N} persisted
|
|
288
|
+
Self-iter: {N} rounds across {M} stages
|
|
289
|
+
Goals: {done}/{total} ({skipped} skipped)
|
|
290
|
+
---
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Commit: `"odyssey-debug({slug}): RECORD — summary and knowledge persistence"`
|
|
294
|
+
|
|
295
|
+
</actions>
|
|
296
|
+
|
|
297
|
+
<appendix>
|
|
298
|
+
|
|
299
|
+
### `-y` debug-specific points
|
|
300
|
+
|
|
301
|
+
| Decision Point | Normal | `-y` |
|
|
302
|
+
|---------------|--------|------|
|
|
303
|
+
| A_DIAGNOSE ambiguity | ask_user | deferred |
|
|
304
|
+
| A_ESCALATE 3-strike | ask_user | INCONCLUSIVE |
|
|
305
|
+
| A_FIX direction | ask_user | auto proceed |
|
|
306
|
+
| A_DISCOVER hit routing | ask_user | auto-fix bugs with template, create issue for rest |
|
|
307
|
+
|
|
308
|
+
### Goal Prompt convergence rules
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
Stop when root cause confirmed (or INCONCLUSIVE), fix verified,
|
|
312
|
+
generalization exhausted, phase_goals_all_done=true.
|
|
313
|
+
All sibling bugs fixed or issued — no leftovers.
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
</appendix>
|
|
317
|
+
|
|
318
|
+
</state_machine>
|
|
319
|
+
|
|
320
|
+
<error_codes>
|
|
321
|
+
| Code | Severity | Condition | Recovery |
|
|
322
|
+
|------|----------|-----------|----------|
|
|
323
|
+
| E001 | error | No issue, no session | Provide issue or -c |
|
|
324
|
+
| W001 | warning | No relevant git history | Proceed |
|
|
325
|
+
| W002 | warning | 3 retries exhausted | INCONCLUSIVE |
|
|
326
|
+
| W003 | warning | Partial archaeology agent failure (Timeline or Blame) | Proceed with available results, log failed agent |
|
|
327
|
+
| W005 | warning | Pending decisions | Filter evidence phase=decision |
|
|
328
|
+
| W006 | warning | No CLI tools | Skip explore |
|
|
329
|
+
| W007 | warning | Generalization 0 hits after full 3-layer scan | Advance to S_RECORD (requires all 3 layers attempted with evidence) |
|
|
330
|
+
</error_codes>
|
|
331
|
+
|
|
332
|
+
<success_criteria>
|
|
333
|
+
- [ ] Session + 4 output files + prior knowledge searched
|
|
334
|
+
- [ ] Archaeology + CLI review → evidence phase=archaeology
|
|
335
|
+
- [ ] CLI exploration → explore.json + evidence phase=explore
|
|
336
|
+
- [ ] Hypotheses tested, root cause with evidence refs
|
|
337
|
+
- [ ] understanding.md 9 sections progressive
|
|
338
|
+
- [ ] Fix + confirmed (unless --skip-fix)
|
|
339
|
+
- [ ] Generalization + scan (unless --skip-generalize)
|
|
340
|
+
- [ ] Discoveries classified; unfixed findings individually justified
|
|
341
|
+
- [ ] phase_goals + goal audit + resumable via -c
|
|
342
|
+
- [ ] Completion summary
|
|
343
|
+
</success_criteria>
|
|
344
|
+
|
|
345
|
+
<next_step_routing>
|
|
346
|
+
| Condition | Next |
|
|
347
|
+
|-----------|------|
|
|
348
|
+
| Discovery issues | `/manage-issue list --source debug-odyssey` |
|
|
349
|
+
| Document pattern | `/learn-decompose <module>` |
|
|
350
|
+
| Formal review | `/quality-review <phase>` |
|
|
351
|
+
| Second opinion | `/learn-second-opinion <understanding.md>` |
|
|
352
|
+
| Related question | `/learn-investigate "<question>"` |
|
|
353
|
+
| Pending decisions | Filter evidence phase=decision status=pending |
|
|
354
|
+
</next_step_routing>
|