maestro-flow 0.5.38 → 0.5.39
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/skills/odyssey-debug/SKILL.md +90 -269
- package/.agents/skills/odyssey-improve/SKILL.md +39 -240
- package/.agents/skills/odyssey-planex/SKILL.md +21 -105
- package/.agents/skills/odyssey-review-test-fix/SKILL.md +98 -318
- package/.agents/skills/odyssey-ui/SKILL.md +82 -265
- package/.agy/skills/odyssey-debug/SKILL.md +90 -269
- package/.agy/skills/odyssey-improve/SKILL.md +39 -240
- package/.agy/skills/odyssey-planex/SKILL.md +21 -105
- package/.agy/skills/odyssey-review-test-fix/SKILL.md +98 -318
- package/.agy/skills/odyssey-ui/SKILL.md +82 -265
- package/.claude/commands/odyssey-debug.md +90 -269
- package/.claude/commands/odyssey-improve.md +39 -240
- package/.claude/commands/odyssey-planex.md +21 -105
- package/.claude/commands/odyssey-review-test-fix.md +98 -318
- package/.claude/commands/odyssey-ui.md +82 -265
- package/.codex/skills/odyssey-debug/SKILL.md +167 -338
- package/.codex/skills/odyssey-improve/SKILL.md +226 -395
- package/.codex/skills/odyssey-planex/SKILL.md +317 -159
- package/.codex/skills/odyssey-review-test-fix/SKILL.md +137 -255
- package/.codex/skills/odyssey-ui/SKILL.md +197 -338
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +23 -2
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +242 -26
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +92 -29
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/src/commands/hooks.d.ts +2 -1
- package/dashboard/dist-server/src/commands/hooks.js +16 -9
- package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
- package/dashboard/dist-server/src/hooks/kg-sync-hook.js +5 -0
- package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
- package/dashboard/dist-server/src/hooks/session-context.js +276 -3
- package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
- package/dashboard/dist-server/src/search/daemon-client.d.ts +8 -3
- package/dashboard/dist-server/src/search/daemon-client.js +20 -0
- package/dashboard/dist-server/src/search/daemon-client.js.map +1 -1
- package/dist/src/commands/domain.d.ts.map +1 -1
- package/dist/src/commands/domain.js +12 -3
- package/dist/src/commands/domain.js.map +1 -1
- package/dist/src/commands/hooks.d.ts +2 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +16 -9
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/install.js +33 -2
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/search.d.ts.map +1 -1
- package/dist/src/commands/search.js +59 -6
- package/dist/src/commands/search.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +15 -0
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
- package/dist/src/hooks/kg-sync-hook.js +5 -0
- package/dist/src/hooks/kg-sync-hook.js.map +1 -1
- package/dist/src/hooks/session-context.d.ts.map +1 -1
- package/dist/src/hooks/session-context.js +276 -3
- package/dist/src/hooks/session-context.js.map +1 -1
- package/dist/src/search/daemon-client.d.ts +8 -3
- package/dist/src/search/daemon-client.d.ts.map +1 -1
- package/dist/src/search/daemon-client.js +20 -0
- package/dist/src/search/daemon-client.js.map +1 -1
- package/dist/src/search/daemon.d.ts +3 -3
- package/dist/src/search/daemon.d.ts.map +1 -1
- package/dist/src/search/daemon.js +9 -3
- package/dist/src/search/daemon.js.map +1 -1
- package/package.json +1 -1
- package/workflows/odyssey-base.md +258 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: odyssey-debug
|
|
3
3
|
description: Long-running debug cycle — archaeology, diagnosis, fix, confirmation, generalization, discovery, and knowledge persistence
|
|
4
|
-
argument-hint: "<issue> [--skip-fix] [--skip-generalize] [--auto] [-y] [-c]"
|
|
4
|
+
argument-hint: "<issue> [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- read_file
|
|
7
7
|
- write_file
|
|
@@ -14,6 +14,8 @@ 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
|
+
|
|
17
19
|
<purpose>
|
|
18
20
|
Closed-loop deep debugging: archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
|
|
19
21
|
Treats every bug as a learning signal with exhaustive iteration until root cause confirmed or INCONCLUSIVE.
|
|
@@ -23,8 +25,8 @@ Treats every bug as a learning signal with exhaustive iteration until root cause
|
|
|
23
25
|
**范围内:** 单一 bug/issue 的完整闭环 — 考古 → 探索 → 诊断 → 修复 → 确认 → 泛化同类 → 沉淀
|
|
24
26
|
**范围外:** 新功能开发 → `/odyssey-planex` | 代码质量审查 → `/odyssey-review-test-fix` | UI 视觉优化 → `/odyssey-ui` | 架构重设计 → `/maestro-plan`
|
|
25
27
|
**探索自由度:** 边界内自由探索 — 可追踪任意调用链、分析任意历史、测试任意假设。泛化阶段可扫描全项目寻找同类问题。
|
|
26
|
-
**Zero-residual principle:** Every finding MUST have a concrete action (fix / issue / decision). "
|
|
27
|
-
**模板支持:** `--template <name>`
|
|
28
|
+
**Zero-residual principle:** Every finding MUST have a concrete action (fix / issue / decision). "Pre-existing issue" is not a valid skip reason.
|
|
29
|
+
**模板支持:** `--template <name>` 从预定义调查策略启动:
|
|
28
30
|
|
|
29
31
|
| Template | 调查策略 | 适用场景 |
|
|
30
32
|
|----------|---------|---------|
|
|
@@ -35,156 +37,74 @@ Treats every bug as a learning signal with exhaustive iteration until root cause
|
|
|
35
37
|
| `crash` | stack trace → null chain → error propagation | 崩溃/异常 |
|
|
36
38
|
</boundary>
|
|
37
39
|
|
|
38
|
-
<execution_discipline>
|
|
39
|
-
**三条铁律(所有阶段适用):**
|
|
40
|
-
|
|
41
|
-
1. **Phase auto-commit** — 每个阶段完成后**自动** `git commit`,无需用户确认
|
|
42
|
-
- 代码变更 + understanding.md → `git add` → `git commit -m "odyssey-debug({slug}): {phase} — {摘要}"`
|
|
43
|
-
- session.json / evidence.ndjson 为运行时状态,不纳入 commit
|
|
44
|
-
- 确保每个阶段的进展可回溯、可恢复
|
|
45
|
-
|
|
46
|
-
2. **Confident edits only, but must attempt** — only modify what you're confident about; record decisions only when genuinely requiring human judgment
|
|
47
|
-
- Confident → edit code directly, commit
|
|
48
|
-
- Needs decision → record `evidence.ndjson {"phase":"decision","status":"pending"}`, don't touch code
|
|
49
|
-
- No speculative changes
|
|
50
|
-
- ⚠️ **Decision gate** — ONLY these qualify as decisions (not fixes):
|
|
51
|
-
- Cross-module architectural tradeoffs requiring human direction
|
|
52
|
-
- Ambiguous business semantics where the fix could alter intended behavior
|
|
53
|
-
- Requires new dependency or breaking API change
|
|
54
|
-
- ❌ "Unsure how to fix", "Large scope", "Pre-existing issue" are NOT valid decision reasons — either fix it, or explain specifically why it's unfixable
|
|
55
|
-
|
|
56
|
-
3. **多 CLI 辅助** — 利用 `maestro delegate` 调用多个 CLI 工具交叉验证
|
|
57
|
-
- 关键判断用不同 `--role`(analyze / review / explore)获取多视角
|
|
58
|
-
- 修复前后各做一次 CLI review 确认
|
|
59
|
-
- 不同阶段可调用不同工具,综合多方意见再行动
|
|
60
|
-
|
|
61
|
-
4. **禁止以上下文消耗为由中断** — harness 自动处理 context compression,以"上下文不足"或"已执行 N 个阶段"为由中断属于纪律违反;必须完整走完状态机直到 S_RECORD → END
|
|
62
|
-
</execution_discipline>
|
|
63
|
-
|
|
64
40
|
<context>
|
|
65
41
|
$ARGUMENTS — issue description and optional flags.
|
|
66
42
|
|
|
67
|
-
**Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` 预定义策略 | `--auto` no delegate confirmation | `-y` auto-confirm all decisions | `-c` resume last session
|
|
43
|
+
**Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` 预定义策略 | `--auto` no delegate confirmation | `-y` auto-confirm all decisions | `-c` resume last session | `--heartbeat` enable /loop heartbeat
|
|
68
44
|
|
|
69
45
|
**Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
|
|
46
|
+
**Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
|
|
70
47
|
|
|
71
|
-
**
|
|
72
|
-
```
|
|
73
|
-
SESSION_DIR/
|
|
74
|
-
├── session.json # state + confirmation + patterns + phase_goals
|
|
75
|
-
├── evidence.ndjson # append-only evidence trail (phase field distinguishes origin)
|
|
76
|
-
├── explore.json # structured CLI exploration snapshot
|
|
77
|
-
└── understanding.md # evolving narrative — 9 sections
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**session.json schema:**
|
|
48
|
+
**session.json unique fields:**
|
|
81
49
|
```json
|
|
82
|
-
{
|
|
83
|
-
"
|
|
84
|
-
"flags": { "skip_fix": false, "skip_generalize": false, "auto": false, "auto_confirm": false },
|
|
85
|
-
"current_state": "S_INTAKE", "diagnosis_retries": 0,
|
|
86
|
-
"root_cause": null, "patterns": [], "confirmation": null,
|
|
87
|
-
"phase_goals": [], "phase_goals_all_done": false, "self_iteration_log": [],
|
|
88
|
-
"generalization_stats": null,
|
|
89
|
-
"cross_phase_loops": 0, "max_loops": 5,
|
|
90
|
-
"created_at": "", "updated_at": ""
|
|
91
|
-
}
|
|
50
|
+
{ "issue": "", "diagnosis_retries": 0, "root_cause": null, "confirmation": null,
|
|
51
|
+
"patterns": [], "generalization_stats": null, "cross_phase_loops": 0, "max_loops": 5 }
|
|
92
52
|
```
|
|
53
|
+
共有字段(`progress_metrics`, `directions_tried` 等)见 base。
|
|
93
54
|
|
|
94
|
-
**evidence.ndjson
|
|
95
|
-
|
|
96
|
-
{"ts":"","phase":"archaeology|explore|diagnosis|discovery|decision|self-iteration","type":"","source":"","content":"","note":""}
|
|
97
|
-
```
|
|
98
|
-
Phase-specific fields:
|
|
99
|
-
- `archaeology`: `sha`, `author`, `date`, `message`, `relevance` (high|medium|low)
|
|
55
|
+
**evidence.ndjson phases:** `archaeology|explore|diagnosis|discovery|decision|self-iteration`
|
|
56
|
+
- `archaeology`: `sha`, `author`, `date`, `message`, `relevance`
|
|
100
57
|
- `explore`: `category` (call_chain|recent_change|error_gap|similar_pattern), `detail`
|
|
101
58
|
- `diagnosis`: `hypothesis`, `result` (confirmed|disproved|inconclusive)
|
|
102
59
|
- `discovery`: `file`, `line`, `classification` (safe|risk|bug), `action` (fix|issue|decision|skip)
|
|
103
|
-
- `decision`: `question`, `options`, `context`, `status
|
|
60
|
+
- `decision`: `question`, `options`, `context`, `status`, `resolution`
|
|
104
61
|
- `self-iteration`: `stage`, `round`, `assessment`, `expansion`
|
|
105
62
|
|
|
106
|
-
**explore.json
|
|
107
|
-
```json
|
|
108
|
-
{
|
|
109
|
-
"call_chains": [{"entry":"","chain":["file:line"]}],
|
|
110
|
-
"recent_changes": [{"file":"","commits":[{"sha":"","message":"","date":""}]}],
|
|
111
|
-
"error_gaps": [{"file":"","line":0,"description":""}],
|
|
112
|
-
"similar_patterns": [{"file":"","line":0,"description":""}],
|
|
113
|
-
"cli_tool": "", "timestamp": ""
|
|
114
|
-
}
|
|
115
|
-
```
|
|
63
|
+
**explore.json**: `{call_chains, recent_changes, error_gaps, similar_patterns, cli_tool, timestamp}`
|
|
116
64
|
|
|
117
|
-
**phase_goals[]
|
|
65
|
+
**phase_goals[]:**
|
|
118
66
|
|
|
119
67
|
| ID | Goal | done_when | phase | skip_when |
|
|
120
68
|
|----|------|-----------|-------|-----------|
|
|
121
|
-
| G1 | Root cause identified |
|
|
122
|
-
| G2 | Explore context gathered | explore.json ≥1 category
|
|
69
|
+
| G1 | Root cause identified | phase=diagnosis result=confirmed | S_DIAGNOSE | — |
|
|
70
|
+
| G2 | Explore context gathered | explore.json ≥1 category | S_EXPLORE | — |
|
|
123
71
|
| G3 | Fix applied and confirmed | confirmation.overall == confirmed | S_CONFIRM | skip_fix |
|
|
124
72
|
| G4 | Pattern generalized | patterns[] ≥1 entry | S_GENERALIZE | skip_generalize |
|
|
125
73
|
| G5 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
|
|
126
|
-
| G6 | Learnings persisted | spec entries created OR
|
|
127
|
-
|
|
128
|
-
When `flags[skip_when] == true` → auto set `status: "skipped"`, `completion_confirmed: true`.
|
|
74
|
+
| G6 | Learnings persisted | spec entries created OR none actionable | S_RECORD | — |
|
|
129
75
|
|
|
130
|
-
**understanding.md — 9 sections
|
|
131
|
-
1. Issue & Scope ← S_INTAKE | 2. Archaeology
|
|
132
|
-
4. Hypotheses
|
|
133
|
-
7. Generalization ← S_GENERALIZE | 8. Discoveries
|
|
76
|
+
**understanding.md — 9 sections:**
|
|
77
|
+
1. Issue & Scope ← S_INTAKE | 2. Archaeology ← S_ARCHAEOLOGY | 3. Exploration ← S_EXPLORE
|
|
78
|
+
4. Hypotheses ← S_DIAGNOSE | 5. Root Cause ← S_DIAGNOSE | 6. Fix & Confirmation ← S_FIX+S_CONFIRM
|
|
79
|
+
7. Generalization ← S_GENERALIZE | 8. Discoveries ← S_DISCOVER | 9. Learnings ← S_RECORD
|
|
134
80
|
|
|
135
81
|
### Pre-load(可选,缺失不阻塞)
|
|
136
82
|
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|
|
151
|
-
|
|
|
152
|
-
| 非显而易见 workaround | 问题场景 + 解决方案 + 适用范围 | `/spec-add learning "..."` |
|
|
153
|
-
| 架构边界违反 | 违反描述 + 正确边界 + 检查方法 | `/spec-add arch "..."` |
|
|
154
|
-
| 可复用泛化 pattern | pattern 签名 + 风险说明 + fix 模板 | `/spec-add coding "..."` |
|
|
155
|
-
|
|
156
|
-
**两步模式:** 执行中写入产出文件(临时记录)→ 任务完成后用户通过 next_step_routing 沉淀为永久知识。执行过程中不调用外部 Skill。
|
|
83
|
+
| 命令 | 作用 |
|
|
84
|
+
|------|------|
|
|
85
|
+
| Read `.workflow/codebase/ARCHITECTURE.md` | 模块边界 |
|
|
86
|
+
| `maestro search "<issue keywords>" --json` | 先前调查(top 5) |
|
|
87
|
+
| `maestro load --type spec --category debug --keyword "<symptom>"` | 已知 issue/workaround |
|
|
88
|
+
| `find_files(".workflow/scratch/*-debug-odyssey-*")` | 相关 odyssey 会话 |
|
|
89
|
+
|
|
90
|
+
### Knowledge Persistence(S_RECORD → understanding.md §9)
|
|
91
|
+
|
|
92
|
+
| 分类 | 后续建议命令 |
|
|
93
|
+
|------|-------------|
|
|
94
|
+
| 反复根因模式 | `/spec-add debug "..."` |
|
|
95
|
+
| 非显而易见 workaround | `/spec-add learning "..."` |
|
|
96
|
+
| 架构边界违反 | `/spec-add arch "..."` |
|
|
97
|
+
| 可复用泛化 pattern | `/spec-add coding "..."` |
|
|
157
98
|
</context>
|
|
158
99
|
|
|
159
100
|
<self_iteration>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
| 维度 | sufficient | insufficient |
|
|
163
|
-
|------|-----------|-------------|
|
|
164
|
-
| Coverage | 已知相关文件/模块均已分析 | 遗漏 grep/git log 可发现的目标 |
|
|
165
|
-
| Depth | ≥80% 发现有 file:line 级证据 | 多数仅泛泛描述 |
|
|
166
|
-
| Actionability | 每条结论有具体后续动作 | 仅"建议关注"类无操作性结论 |
|
|
167
|
-
|
|
168
|
-
**Rules:** phase complete → evaluate 3 dimensions → any insufficient → re-enter (max **3 rounds** per stage).
|
|
169
|
-
- Round 1: widen scope — more dirs, git log depth ×2, extra delegate angles
|
|
170
|
-
- Round 2: shift perspective — different CLI tool, reverse trace, manual code reading
|
|
171
|
-
- Round 3: combine both + targeted deep-dive on remaining gaps
|
|
172
|
-
|
|
173
|
-
**Exit:** all sufficient → advance | 3-round cap → log remaining gaps and continue. Record to `evidence.ndjson` + `session.json.self_iteration_log[]`.
|
|
101
|
+
适用阶段: S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE
|
|
174
102
|
</self_iteration>
|
|
175
103
|
|
|
176
104
|
<state_machine>
|
|
177
105
|
|
|
178
106
|
<states>
|
|
179
|
-
S_INTAKE
|
|
180
|
-
S_ARCHAEOLOGY — 考古:git history + CLI 分析 PERSIST: evidence.ndjson (archaeology) + understanding.md §2
|
|
181
|
-
S_EXPLORE — CLI 探索:调用链、错误间隙、相似模式 PERSIST: explore.json + evidence.ndjson (explore) + understanding.md §3
|
|
182
|
-
S_DIAGNOSE — 假设驱动根因分析 PERSIST: evidence.ndjson (diagnosis|decision) + understanding.md §4-5
|
|
183
|
-
S_FIX — 实现修复 (skip_fix 时跳过) PERSIST: code changes + evidence.ndjson (decision)
|
|
184
|
-
S_CONFIRM — 测试 + CLI review 双重确认 (skip_fix 时跳过) PERSIST: session.json.confirmation + understanding.md §6
|
|
185
|
-
S_GENERALIZE — 举一反三:提取 pattern,扫描相似代码 PERSIST: session.json.patterns + understanding.md §7
|
|
186
|
-
S_DISCOVER — 评估发现,创建 issue / 记录决策 PERSIST: evidence.ndjson (discovery|decision) + understanding.md §8
|
|
187
|
-
S_RECORD — 知识沉淀 + 目标审计 PERSIST: understanding.md §9 + spec entries
|
|
107
|
+
S_INTAKE → S_ARCHAEOLOGY → S_EXPLORE → S_DIAGNOSE → S_FIX → S_CONFIRM → S_GENERALIZE → S_DISCOVER → S_RECORD → END
|
|
188
108
|
</states>
|
|
189
109
|
|
|
190
110
|
<transitions>
|
|
@@ -199,7 +119,7 @@ S_DIAGNOSE → S_FIX : root cause confirmed, !skip_fix
|
|
|
199
119
|
S_DIAGNOSE → S_GENERALIZE : root cause confirmed, skip_fix, !skip_generalize
|
|
200
120
|
S_DIAGNOSE → S_RECORD : root cause confirmed, skip_fix, skip_generalize
|
|
201
121
|
S_DIAGNOSE → S_DIAGNOSE : all hypotheses failed, retries < 3 → A_ESCALATE_DIAGNOSIS
|
|
202
|
-
S_DIAGNOSE → S_RECORD :
|
|
122
|
+
S_DIAGNOSE → S_RECORD : retries >= 3 → mark INCONCLUSIVE
|
|
203
123
|
|
|
204
124
|
S_FIX → S_CONFIRM : fix implemented
|
|
205
125
|
S_CONFIRM → S_GENERALIZE : confirmed, !skip_generalize
|
|
@@ -209,10 +129,10 @@ S_CONFIRM → S_FIX : needs_rework
|
|
|
209
129
|
S_GENERALIZE → S_DISCOVER : similar code found
|
|
210
130
|
S_GENERALIZE → S_RECORD : no similar code
|
|
211
131
|
|
|
212
|
-
S_DISCOVER → S_DIAGNOSE :
|
|
213
|
-
S_DISCOVER → S_FIX :
|
|
214
|
-
S_DISCOVER → S_RECORD : triage complete
|
|
215
|
-
S_DISCOVER → S_RECORD : loops >= max_loops →
|
|
132
|
+
S_DISCOVER → S_DIAGNOSE : new bug worth investigating → cross_phase_loops++
|
|
133
|
+
S_DISCOVER → S_FIX : same-pattern bug, fix template applies, !skip_fix → cross_phase_loops++
|
|
134
|
+
S_DISCOVER → S_RECORD : triage complete, remaining_actionable == 0
|
|
135
|
+
S_DISCOVER → S_RECORD : loops >= max_loops → log each unfixed item with specific reason
|
|
216
136
|
|
|
217
137
|
S_RECORD → END : A_RECORD complete
|
|
218
138
|
</transitions>
|
|
@@ -220,12 +140,10 @@ S_RECORD → END : A_RECORD complete
|
|
|
220
140
|
<actions>
|
|
221
141
|
|
|
222
142
|
### A_INTAKE
|
|
223
|
-
1. Parse arguments
|
|
224
|
-
2.
|
|
225
|
-
3.
|
|
226
|
-
4.
|
|
227
|
-
5. Write `session.json` + `understanding.md` §1
|
|
228
|
-
6. Emit Goal Prompt (see Appendix)
|
|
143
|
+
1. Parse arguments, generate slug, create `SESSION_DIR`
|
|
144
|
+
2. Search: `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
|
|
145
|
+
3. Derive `phase_goals[]` from flags (apply `skip_when`)
|
|
146
|
+
4. Write `session.json` + `understanding.md` §1, emit Goal Prompt
|
|
229
147
|
|
|
230
148
|
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): INTAKE — 目标解析与上下文加载"`
|
|
231
149
|
|
|
@@ -233,139 +151,68 @@ S_RECORD → END : A_RECORD complete
|
|
|
233
151
|
Find latest session via Glob → read `session.json` → display summary → jump to `current_state`.
|
|
234
152
|
|
|
235
153
|
### A_ARCHAEOLOGY
|
|
236
|
-
**
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
| Blame | Top 3 suspicious files: `git blame -L {region}` → critical paths |
|
|
242
|
-
|
|
243
|
-
Append findings to `evidence.ndjson` (phase: "archaeology").
|
|
244
|
-
|
|
245
|
-
**CLI-assisted change review:**
|
|
246
|
-
```bash
|
|
247
|
-
maestro delegate "PURPOSE: Review recent modifications related to: {issue}
|
|
248
|
-
TASK: Analyze intent behind changes | Identify risky modifications | Flag potential bug sources
|
|
249
|
-
MODE: analysis
|
|
250
|
-
CONTEXT: @{relevant_files} | Git log: {top_10_commits}
|
|
251
|
-
EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
|
|
252
|
-
CONSTRAINTS: Focus on behavioral changes, not formatting
|
|
253
|
-
" --role analyze --mode analysis
|
|
254
|
-
```
|
|
255
|
-
Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow). Append results to evidence.
|
|
154
|
+
**2 parallel Agents:** Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 suspicious files `git blame -L {region}`). Append evidence (phase: "archaeology").
|
|
155
|
+
|
|
156
|
+
**CLI change review** via `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
|
|
157
|
+
- PURPOSE: Review recent modifications related to {issue}
|
|
158
|
+
- EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
|
|
256
159
|
|
|
257
|
-
Update
|
|
160
|
+
Update §2.
|
|
258
161
|
|
|
259
162
|
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): ARCHAEOLOGY — git 考古分析"`
|
|
260
163
|
|
|
261
164
|
### A_EXPLORE
|
|
262
165
|
Skip if no enabled CLI tools (W006).
|
|
263
166
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
MODE: analysis
|
|
268
|
-
CONTEXT: @**/*
|
|
269
|
-
EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
|
|
270
|
-
CONSTRAINTS: Max 20 entries/category | Symptom-related code paths
|
|
271
|
-
Symptoms: {issue} Archaeology hints: {suspicious_commits}
|
|
272
|
-
" --role explore --mode analysis
|
|
273
|
-
```
|
|
274
|
-
Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
|
|
167
|
+
`maestro delegate --role explore --mode analysis` (`run_in_background: true`):
|
|
168
|
+
- PURPOSE: Gather codebase evidence — call chains, recent changes, error gaps, similar patterns
|
|
169
|
+
- EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
|
|
275
170
|
|
|
276
|
-
Parse → write `explore.json` +
|
|
171
|
+
Parse → write `explore.json` + evidence (phase: "explore"). Update §3. Mark G2 done.
|
|
277
172
|
|
|
278
173
|
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): EXPLORE — 代码探索完成"`
|
|
279
174
|
|
|
280
175
|
### A_DIAGNOSE
|
|
281
|
-
1.
|
|
282
|
-
2.
|
|
283
|
-
3.
|
|
284
|
-
4.
|
|
176
|
+
1. Form hypotheses from evidence, ranked [HIGH]/[MEDIUM]/[LOW] → §4
|
|
177
|
+
2. Test each: design test → execute → evidence (phase: "diagnosis")
|
|
178
|
+
3. Decision journal: ambiguity → evidence (phase: "decision"); Normal: ask_user | `-y`: defer
|
|
179
|
+
4. Root cause confirmed → `session.json.root_cause` + §5. Mark G1 done.
|
|
285
180
|
|
|
286
181
|
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): DIAGNOSE — 根因确认"`
|
|
287
182
|
|
|
288
183
|
### A_ESCALATE_DIAGNOSIS
|
|
289
|
-
Increment `diagnosis_retries`.
|
|
184
|
+
Increment `diagnosis_retries`. < 3: broaden via `maestro delegate --role analyze`, new hypotheses, return S_DIAGNOSE. >= 3: Normal → ask_user | `-y` → auto INCONCLUSIVE → S_RECORD.
|
|
290
185
|
|
|
291
186
|
### A_FIX
|
|
292
|
-
1. Present root cause + proposed fix. Normal: ask_user | `-y`: auto proceed
|
|
293
|
-
2. Implement fix
|
|
294
|
-
3. Record in evidence (phase: "decision")
|
|
187
|
+
1. Present root cause + proposed fix. Normal: ask_user | `-y`: auto proceed
|
|
188
|
+
2. Implement fix, record evidence (phase: "decision")
|
|
295
189
|
|
|
296
190
|
📌 **Auto-commit**: `git add -A && git commit -m "odyssey-debug({slug}): FIX — {修复摘要}"`
|
|
297
191
|
|
|
298
192
|
### A_CONFIRM
|
|
299
|
-
1.
|
|
300
|
-
2.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
MODE: analysis
|
|
305
|
-
CONTEXT: @{modified_files} | Root cause: {summary} | Diff: {git_diff}
|
|
306
|
-
EXPECTED: JSON {verdict, findings [{severity, description, suggestion}], regression_risk}
|
|
307
|
-
CONSTRAINTS: Focus on correctness, not style
|
|
308
|
-
" --role review --mode analysis
|
|
309
|
-
```
|
|
310
|
-
Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
|
|
311
|
-
|
|
312
|
-
3. Write `session.json.confirmation`: `{test_result, cli_review, overall: "confirmed|needs_rework", timestamp}`
|
|
313
|
-
4. Update §6. `needs_rework` → S_FIX. `confirmed` → mark G3 done, advance.
|
|
193
|
+
1. Run covering tests (auto-detect framework)
|
|
194
|
+
2. CLI fix review via `maestro delegate --role review --mode analysis` (`run_in_background: true`):
|
|
195
|
+
- EXPECTED: JSON {verdict, findings [{severity, description, suggestion}], regression_risk}
|
|
196
|
+
3. Write `session.json.confirmation`: `{test_result, cli_review, overall: "confirmed|needs_rework"}`
|
|
197
|
+
4. Update §6. `needs_rework` → S_FIX. `confirmed` → mark G3 done.
|
|
314
198
|
|
|
315
199
|
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): CONFIRM — 修复验证"`
|
|
316
200
|
|
|
317
201
|
### A_GENERALIZE
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
**Pattern extraction** from root cause + fix:
|
|
321
|
-
|
|
322
|
-
| Layer | Method | Example |
|
|
323
|
-
|-------|--------|---------|
|
|
324
|
-
| Syntax | Regex patterns (direct Grep) | `eval(`, missing `await`, unclosed resource |
|
|
325
|
-
| Semantic | Anti-pattern description (Agent-driven) | Unhandled async errors, unvalidated input |
|
|
326
|
-
| Structural | Architecture-level (file/module similarity) | Same import structure, missing override |
|
|
327
|
-
|
|
328
|
-
Write `session.json.patterns[]`: `[{id, source, layer, signature, description, risk, fix_template}]`
|
|
329
|
-
|
|
330
|
-
**4-agent parallel codebase scan:**
|
|
331
|
-
|
|
332
|
-
| Agent | Strategy | Input | Scope |
|
|
333
|
-
|-------|----------|-------|-------|
|
|
334
|
-
| Syntax grep | Grep syntax-layer regex | P*.signature | Full project |
|
|
335
|
-
| Semantic scan | Understand + check anti-pattern | P*.description | Related modules |
|
|
336
|
-
| Structural match | Find structurally similar files | Buggy file structure | Full project |
|
|
337
|
-
| Historical grep | `git log -S "{pattern}"` | P*.signature | Full git history |
|
|
338
|
-
|
|
339
|
-
Returns: `[{pattern_id, file, line, context, risk_level, layer, confidence}]`
|
|
340
|
-
|
|
341
|
-
**Cross-layer dedup**: same file:line multi-layer hit → boost confidence | single-layer → `needs_review` | historical hit on fixed record → `regression_risk`
|
|
342
|
-
|
|
343
|
-
**Iterative deepening**: module with ≥3 hits → targeted deep scan (max 1 round).
|
|
344
|
-
|
|
345
|
-
**Quality Gate** (self-iteration) → if insufficient, expand and re-scan.
|
|
346
|
-
|
|
347
|
-
Write §7 + `session.json.generalization_stats`: `{patterns_extracted, total_hits, cross_layer_confirmed, regression_risks, by_layer, deepening_triggered}`. Mark G4 done.
|
|
202
|
+
按 base A_GENERALIZE 执行。Pattern 来源: root cause + fix。统计写入 `session.json.generalization_stats`。Mark G4 done.
|
|
348
203
|
|
|
349
204
|
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): GENERALIZE — 泛化扫描完成"`
|
|
350
205
|
|
|
351
206
|
### A_DISCOVER
|
|
352
|
-
|
|
353
|
-
2. **Route**:
|
|
354
|
-
- `bug` + directly fixable → **fix immediately** (not just log an issue) → back to S_FIX
|
|
355
|
-
- `bug` + requires cross-module/architectural decision → create issue (with fix suggestion + impact analysis)
|
|
356
|
-
- `risk` → evaluate if guard/validation can mitigate directly; if yes, fix it
|
|
357
|
-
- `safe` → mark skip
|
|
358
|
-
See Appendix `-y` behavior table. Append evidence (phase: "discovery" + "decision")
|
|
359
|
-
3. Update §8. Mark G5 done.
|
|
207
|
+
按 base A_DISCOVER 执行。Mark G5 done.
|
|
360
208
|
|
|
361
209
|
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): DISCOVER — 发现分类完成"`
|
|
362
210
|
|
|
363
211
|
### A_RECORD
|
|
364
|
-
1. Finalize `understanding.md` §9
|
|
365
|
-
2.
|
|
366
|
-
3.
|
|
367
|
-
4. **
|
|
368
|
-
5. **Completion**: `current_state = "COMPLETED"`, emit summary:
|
|
212
|
+
1. Finalize `understanding.md` §9,按 Knowledge Persistence 表分类记录
|
|
213
|
+
2. Mark G6 done. Pending decisions: Normal → ask_user | `-y` → skip (show deferred count)
|
|
214
|
+
3. 其余按 base A_RECORD 执行
|
|
215
|
+
4. **Completion summary**:
|
|
369
216
|
```
|
|
370
217
|
--- DEBUG ODYSSEY COMPLETE ---
|
|
371
218
|
Issue: {issue}
|
|
@@ -389,7 +236,7 @@ Goals: {done}/{total} confirmed ({skipped} skipped)
|
|
|
389
236
|
|
|
390
237
|
### Goal Prompt Template
|
|
391
238
|
|
|
392
|
-
**时机守卫:仅在 A_INTAKE
|
|
239
|
+
**时机守卫:仅在 A_INTAKE 完成后显示一次。** 机制见 base。
|
|
393
240
|
|
|
394
241
|
```
|
|
395
242
|
📋 Debug Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件:
|
|
@@ -399,34 +246,23 @@ Goals: {done}/{total} confirmed ({skipped} skipped)
|
|
|
399
246
|
- {G.id}: {G.goal} — 完成条件: {G.done_when}
|
|
400
247
|
{end for}
|
|
401
248
|
穷尽迭代:直到根因确认(或明确 INCONCLUSIVE)且修复验证通过
|
|
402
|
-
|
|
403
|
-
假设失败时扩范围→换视角→升级工具,不轻易放弃。
|
|
249
|
+
且泛化扫描穷尽且 phase_goals_all_done=true 才停。
|
|
404
250
|
泛化发现的同类 bug 全部修复或创建 issue,不允许遗留。
|
|
405
251
|
遇到 phase=decision 的 pending 必须 ask_user,不得自行 resolve。
|
|
406
252
|
```
|
|
407
253
|
|
|
408
|
-
Odyssey 输出提示词后继续执行不阻塞。`/goal` 由用户任意时刻输入。
|
|
409
|
-
|
|
410
254
|
### `-y` Auto-Confirm Behavior
|
|
411
255
|
|
|
412
256
|
| Decision Point | Normal | `-y` mode |
|
|
413
257
|
|---------------|--------|-----------|
|
|
414
|
-
| A_DIAGNOSE ambiguity | ask_user
|
|
258
|
+
| A_DIAGNOSE ambiguity | ask_user | `deferred`, best-effort continue |
|
|
415
259
|
| A_ESCALATE 3-strike | ask_user 3-way | auto INCONCLUSIVE |
|
|
416
|
-
| A_FIX direction | ask_user
|
|
417
|
-
| A_DISCOVER bug triage | ask_user
|
|
260
|
+
| A_FIX direction | ask_user | auto proceed with suggested fix |
|
|
261
|
+
| A_DISCOVER bug triage | ask_user | auto create issue |
|
|
418
262
|
| A_DISCOVER ambiguous | ask_user batch | all `deferred` |
|
|
419
263
|
| A_RECORD decisions | ask_user per-item | skip, show deferred count |
|
|
420
264
|
| A_RECORD goal audit | ask_user 3-way | auto accept current state |
|
|
421
265
|
|
|
422
|
-
`deferred` items shown as "待决策" in completion summary; recoverable via `-c`.
|
|
423
|
-
|
|
424
|
-
### Phase Goal Lifecycle
|
|
425
|
-
|
|
426
|
-
`pending → done (confirmed=true)` normal | `pending → skipped (confirmed=true)` flags/manual | `pending → failed (confirmed=false)` INCONCLUSIVE
|
|
427
|
-
|
|
428
|
-
`phase_goals_all_done = true` only when ALL goals have `completion_confirmed == true`.
|
|
429
|
-
|
|
430
266
|
</appendix>
|
|
431
267
|
|
|
432
268
|
</state_machine>
|
|
@@ -435,37 +271,22 @@ Odyssey 输出提示词后继续执行不阻塞。`/goal` 由用户任意时刻
|
|
|
435
271
|
| Code | Severity | Condition | Recovery |
|
|
436
272
|
|------|----------|-----------|----------|
|
|
437
273
|
| E001 | error | No issue and no session to resume | Provide issue or use -c |
|
|
438
|
-
| E003 | error | Resume but no session found | Start new session |
|
|
439
|
-
| E004 | error | Delegate execution failed | Retry or proceed without CLI |
|
|
440
274
|
| W001 | warning | No relevant git history | Proceed with limited context |
|
|
441
275
|
| W002 | warning | All hypotheses inconclusive after 3 retries | INCONCLUSIVE |
|
|
442
|
-
| W003 | warning | Generalization scan 0 hits | Skip discovery |
|
|
443
|
-
| W004 | warning | Delegate parse failed | Use raw output |
|
|
444
276
|
| W005 | warning | Pending decisions unresolved | Filter evidence.ndjson phase=decision |
|
|
445
277
|
| W006 | warning | CLI exploration skipped (no tools) | Proceed without explore.json |
|
|
446
278
|
</error_codes>
|
|
447
279
|
|
|
448
280
|
<success_criteria>
|
|
449
|
-
- [ ] Session
|
|
450
|
-
- [ ]
|
|
451
|
-
- [ ]
|
|
452
|
-
- [ ]
|
|
453
|
-
- [ ] Hypotheses formed from archaeology + explore, tested and logged phase=diagnosis
|
|
454
|
-
- [ ] Root cause declared with evidence refs
|
|
281
|
+
- [ ] Session created with 4 output files, prior knowledge searched
|
|
282
|
+
- [ ] Git archaeology + CLI change review → evidence phase=archaeology
|
|
283
|
+
- [ ] CLI exploration → explore.json + evidence phase=explore
|
|
284
|
+
- [ ] Hypotheses tested, root cause declared with evidence refs
|
|
455
285
|
- [ ] understanding.md tracks all 9 sections progressively
|
|
456
|
-
- [ ] Fix implemented + confirmed
|
|
457
|
-
- [ ] Multi-layer
|
|
458
|
-
- [ ]
|
|
459
|
-
- [ ]
|
|
460
|
-
- [ ] **Every unfixed finding has individual classification and reason** — blanket "pre-existing" labels are forbidden
|
|
461
|
-
- [ ] Decision journal: all human-judgment items in evidence.ndjson phase=decision
|
|
462
|
-
- [ ] phase_goals derived from flags, skip_when applied, each phase marks its goal
|
|
463
|
-
- [ ] Goal audit in A_RECORD — unmet goals surfaced, phase_goals_all_done set correctly
|
|
464
|
-
- [ ] Goal Prompt displayed once after session creation
|
|
465
|
-
- [ ] `-y`: all decisions auto-resolve/defer, deferred count in summary
|
|
466
|
-
- [ ] State saved at each transition (resumable via -c)
|
|
467
|
-
- [ ] Quality Gate self-iteration when insufficient, logged in self_iteration_log
|
|
468
|
-
- [ ] Spec entries persisted for reusable learnings
|
|
286
|
+
- [ ] Fix implemented + confirmed (unless --skip-fix)
|
|
287
|
+
- [ ] Multi-layer generalization + scan (unless --skip-generalize)
|
|
288
|
+
- [ ] Discoveries classified and routed; every unfixed finding individually justified
|
|
289
|
+
- [ ] phase_goals derived, goal audit in A_RECORD, state resumable via -c
|
|
469
290
|
- [ ] Completion summary with all stats
|
|
470
291
|
</success_criteria>
|
|
471
292
|
|