maestro-flow 0.5.38 → 0.5.40

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.
Files changed (163) hide show
  1. package/.agents/skills/odyssey-debug/SKILL.md +90 -269
  2. package/.agents/skills/odyssey-improve/SKILL.md +39 -240
  3. package/.agents/skills/odyssey-planex/SKILL.md +21 -105
  4. package/.agents/skills/odyssey-review-test-fix/SKILL.md +98 -318
  5. package/.agents/skills/odyssey-ui/SKILL.md +82 -265
  6. package/.agy/skills/odyssey-debug/SKILL.md +90 -269
  7. package/.agy/skills/odyssey-improve/SKILL.md +39 -240
  8. package/.agy/skills/odyssey-planex/SKILL.md +21 -105
  9. package/.agy/skills/odyssey-review-test-fix/SKILL.md +98 -318
  10. package/.agy/skills/odyssey-ui/SKILL.md +82 -265
  11. package/.claude/commands/odyssey-debug.md +90 -269
  12. package/.claude/commands/odyssey-improve.md +39 -240
  13. package/.claude/commands/odyssey-planex.md +21 -105
  14. package/.claude/commands/odyssey-review-test-fix.md +98 -318
  15. package/.claude/commands/odyssey-ui.md +82 -265
  16. package/.codex/agents/cli-explore-agent.toml +181 -0
  17. package/.codex/agents/cross-role-reviewer.toml +165 -0
  18. package/.codex/agents/impeccable-agent.toml +89 -0
  19. package/.codex/agents/role-design-author.toml +213 -0
  20. package/.codex/agents/team-worker.toml +4 -7
  21. package/.codex/agents/ui-design-agent.toml +260 -0
  22. package/.codex/agents/workflow-analyzer.toml +106 -0
  23. package/.codex/agents/workflow-codebase-mapper.toml +69 -0
  24. package/.codex/agents/workflow-collab-planner.toml +140 -0
  25. package/.codex/agents/workflow-debugger.toml +95 -0
  26. package/.codex/agents/workflow-executor.toml +124 -0
  27. package/.codex/agents/workflow-external-researcher.toml +80 -0
  28. package/.codex/agents/workflow-integration-checker.toml +76 -0
  29. package/.codex/agents/workflow-nyquist-auditor.toml +77 -0
  30. package/.codex/agents/workflow-phase-researcher.toml +76 -0
  31. package/.codex/agents/workflow-plan-checker.toml +93 -0
  32. package/.codex/agents/workflow-planner.toml +192 -0
  33. package/.codex/agents/workflow-project-researcher.toml +65 -0
  34. package/.codex/agents/workflow-research-synthesizer.toml +65 -0
  35. package/.codex/agents/workflow-reviewer.toml +75 -0
  36. package/.codex/agents/workflow-roadmapper.toml +75 -0
  37. package/.codex/agents/workflow-verifier.toml +113 -0
  38. package/.codex/skills/maestro/SKILL.md +1 -0
  39. package/.codex/skills/maestro-analyze/SKILL.md +33 -15
  40. package/.codex/skills/maestro-brainstorm/SKILL.md +13 -10
  41. package/.codex/skills/maestro-collab/SKILL.md +30 -75
  42. package/.codex/skills/maestro-execute/SKILL.md +19 -12
  43. package/.codex/skills/maestro-grill/SKILL.md +12 -11
  44. package/.codex/skills/maestro-next/SKILL.md +3 -3
  45. package/.codex/skills/maestro-overlay/SKILL.md +1 -1
  46. package/.codex/skills/maestro-plan/SKILL.md +17 -8
  47. package/.codex/skills/maestro-ralph/SKILL.md +3 -0
  48. package/.codex/skills/maestro-ralph-execute/SKILL.md +1 -0
  49. package/.codex/skills/maestro-roadmap/SKILL.md +14 -8
  50. package/.codex/skills/manage-learn/SKILL.md +1 -1
  51. package/.codex/skills/odyssey-debug/SKILL.md +185 -275
  52. package/.codex/skills/odyssey-improve/SKILL.md +216 -308
  53. package/.codex/skills/odyssey-planex/SKILL.md +317 -159
  54. package/.codex/skills/odyssey-review-test-fix/SKILL.md +137 -255
  55. package/.codex/skills/odyssey-ui/SKILL.md +183 -247
  56. package/.codex/skills/quality-review/SKILL.md +17 -10
  57. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +6 -12
  58. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +6 -14
  59. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +2 -6
  60. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +6 -14
  61. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +3 -7
  62. package/.codex/skills/team-quality-assurance/roles/scout/role.md +2 -5
  63. package/.codex/skills/team-review/roles/reviewer/role.md +2 -5
  64. package/.codex/skills/team-review/roles/scanner/role.md +2 -5
  65. package/.codex/skills/team-tech-debt/roles/executor/role.md +3 -7
  66. package/.codex/skills/team-tech-debt/roles/scanner/role.md +2 -5
  67. package/.codex/skills/team-tech-debt/roles/validator/role.md +3 -7
  68. package/.codex/skills/team-testing/roles/executor/role.md +3 -7
  69. package/.codex/skills/team-testing/roles/generator/role.md +3 -7
  70. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +23 -2
  71. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +242 -26
  72. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  73. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +2 -0
  74. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +92 -29
  75. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  76. package/dashboard/dist-server/src/commands/hooks.d.ts +2 -1
  77. package/dashboard/dist-server/src/commands/hooks.js +16 -9
  78. package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
  79. package/dashboard/dist-server/src/commands/install-backend.js +19 -0
  80. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  81. package/dashboard/dist-server/src/core/manifest.d.ts +5 -0
  82. package/dashboard/dist-server/src/core/manifest.js.map +1 -1
  83. package/dashboard/dist-server/src/core/plugin-bridge.d.ts +59 -0
  84. package/dashboard/dist-server/src/core/plugin-bridge.js +355 -0
  85. package/dashboard/dist-server/src/core/plugin-bridge.js.map +1 -0
  86. package/dashboard/dist-server/src/hooks/kg-sync-hook.js +5 -0
  87. package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
  88. package/dashboard/dist-server/src/hooks/session-context.js +276 -3
  89. package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
  90. package/dashboard/dist-server/src/search/daemon-client.d.ts +8 -3
  91. package/dashboard/dist-server/src/search/daemon-client.js +20 -0
  92. package/dashboard/dist-server/src/search/daemon-client.js.map +1 -1
  93. package/dist/src/cli.js +19 -1
  94. package/dist/src/cli.js.map +1 -1
  95. package/dist/src/commands/domain.d.ts.map +1 -1
  96. package/dist/src/commands/domain.js +12 -3
  97. package/dist/src/commands/domain.js.map +1 -1
  98. package/dist/src/commands/hooks.d.ts +2 -1
  99. package/dist/src/commands/hooks.d.ts.map +1 -1
  100. package/dist/src/commands/hooks.js +16 -9
  101. package/dist/src/commands/hooks.js.map +1 -1
  102. package/dist/src/commands/install-backend.d.ts.map +1 -1
  103. package/dist/src/commands/install-backend.js +19 -0
  104. package/dist/src/commands/install-backend.js.map +1 -1
  105. package/dist/src/commands/install.d.ts.map +1 -1
  106. package/dist/src/commands/install.js +50 -3
  107. package/dist/src/commands/install.js.map +1 -1
  108. package/dist/src/commands/plugin.d.ts +3 -0
  109. package/dist/src/commands/plugin.d.ts.map +1 -0
  110. package/dist/src/commands/plugin.js +137 -0
  111. package/dist/src/commands/plugin.js.map +1 -0
  112. package/dist/src/commands/search.d.ts.map +1 -1
  113. package/dist/src/commands/search.js +59 -6
  114. package/dist/src/commands/search.js.map +1 -1
  115. package/dist/src/commands/spec.d.ts.map +1 -1
  116. package/dist/src/commands/spec.js +15 -0
  117. package/dist/src/commands/spec.js.map +1 -1
  118. package/dist/src/commands/update.d.ts.map +1 -1
  119. package/dist/src/commands/update.js +23 -0
  120. package/dist/src/commands/update.js.map +1 -1
  121. package/dist/src/core/install-executor.d.ts +1 -1
  122. package/dist/src/core/install-executor.d.ts.map +1 -1
  123. package/dist/src/core/install-executor.js +27 -0
  124. package/dist/src/core/install-executor.js.map +1 -1
  125. package/dist/src/core/install-profile.d.ts +5 -0
  126. package/dist/src/core/install-profile.d.ts.map +1 -1
  127. package/dist/src/core/install-profile.js +8 -0
  128. package/dist/src/core/install-profile.js.map +1 -1
  129. package/dist/src/core/manifest.d.ts +5 -0
  130. package/dist/src/core/manifest.d.ts.map +1 -1
  131. package/dist/src/core/manifest.js.map +1 -1
  132. package/dist/src/core/plugin-bridge.d.ts +60 -0
  133. package/dist/src/core/plugin-bridge.d.ts.map +1 -0
  134. package/dist/src/core/plugin-bridge.js +355 -0
  135. package/dist/src/core/plugin-bridge.js.map +1 -0
  136. package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
  137. package/dist/src/hooks/kg-sync-hook.js +5 -0
  138. package/dist/src/hooks/kg-sync-hook.js.map +1 -1
  139. package/dist/src/hooks/session-context.d.ts.map +1 -1
  140. package/dist/src/hooks/session-context.js +276 -3
  141. package/dist/src/hooks/session-context.js.map +1 -1
  142. package/dist/src/search/daemon-client.d.ts +8 -3
  143. package/dist/src/search/daemon-client.d.ts.map +1 -1
  144. package/dist/src/search/daemon-client.js +20 -0
  145. package/dist/src/search/daemon-client.js.map +1 -1
  146. package/dist/src/search/daemon.d.ts +3 -3
  147. package/dist/src/search/daemon.d.ts.map +1 -1
  148. package/dist/src/search/daemon.js +9 -3
  149. package/dist/src/search/daemon.js.map +1 -1
  150. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  151. package/dist/src/tui/install-ui/InstallFlow.js +43 -14
  152. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  153. package/dist/src/tui/install-ui/types.d.ts +2 -0
  154. package/dist/src/tui/install-ui/types.d.ts.map +1 -1
  155. package/dist/src/tui/install-ui/types.js.map +1 -1
  156. package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
  157. package/dist/src/tui/install-ui/useInstallFlowState.js +13 -1
  158. package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
  159. package/dist/src/utils/update-notices.js +11 -0
  160. package/dist/src/utils/update-notices.js.map +1 -1
  161. package/package.json +1 -1
  162. package/workflows/odyssey-base.md +258 -0
  163. package/workflows/shell-exec-protocol.md +30 -0
@@ -1,12 +1,14 @@
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: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
6
  ---
7
+ <base>@~/.maestro/workflows/odyssey-base.md</base>
7
8
 
8
9
  <purpose>
9
- Closed-loop deep debugging: archaeology (what changed) → explore (call chains, error gaps) → diagnose (hypothesis-driven) → fix & confirm → generalize (举一反三) → discover siblings → persist learnings.
10
+ Closed-loop deep debugging: archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
11
+ Treats every bug as a learning signal with exhaustive iteration until root cause confirmed or INCONCLUSIVE.
10
12
 
11
13
  Core philosophy:
12
14
  - **Archaeology before hypothesis** — look at what changed before guessing why
@@ -21,139 +23,81 @@ Core philosophy:
21
23
  </purpose>
22
24
 
23
25
  <boundary>
24
- **范围内:** 单一 bug/issue 的完整闭环 — 考古 → 探索 → 诊断 → 修复 → 确认 → 泛化 → 沉淀
25
- **范围外:** 新功能 → `$odyssey-planex` | 代码审查 → `$odyssey-review-test-fix` | UI 优化 → `$odyssey-ui`
26
- **探索自由度:** 边界内自由可追踪任意调用链、分析任意历史、测试任意假设
27
- **Zero-residual principle:** Every finding MUST have a concrete action (fix / issue / decision). "Report and shelve" is not allowed. "Pre-existing issue" is not a valid skip reason — if discovered within scope, it must be addressed.
28
- **模板:** `--template <name>` — performance | memory-leak | race-condition | regression | crash
26
+ **范围内:** 单一 bug/issue 的完整闭环 — 考古 → 探索 → 诊断 → 修复 → 确认 → 泛化同类 → 沉淀
27
+ **范围外:** 新功能开发 → `$odyssey-planex` | 代码质量审查 → `$odyssey-review-test-fix` | UI 视觉优化 → `$odyssey-ui` | 架构重设计 → `/maestro-plan`
28
+ **探索自由度:** 边界内自由探索可追踪任意调用链、分析任意历史、测试任意假设。泛化阶段可扫描全项目寻找同类问题。
29
+ **Zero-residual principle:** Every finding MUST have a concrete action (fix / issue / decision). "Pre-existing issue" is not a valid skip reason.
30
+ **模板支持:** `--template <name>` 从预定义调查策略启动:
31
+
32
+ | Template | 调查策略 | 适用场景 |
33
+ |----------|---------|---------|
34
+ | `performance` | profiling → hot path → allocation → cache | 性能劣化 |
35
+ | `memory-leak` | heap snapshot → retention chain → lifecycle | 内存泄漏 |
36
+ | `race-condition` | timeline → concurrent access → lock analysis | 竞态条件 |
37
+ | `regression` | git bisect → diff analysis → boundary check | 回归问题 |
38
+ | `crash` | stack trace → null chain → error propagation | 崩溃/异常 |
29
39
  </boundary>
30
40
 
31
- <execution_discipline>
32
- **三条铁律(所有阶段适用):**
33
- 1. **Phase auto-commit** — 阶段完成后**自动** `git commit`,无需用户确认(session.json/evidence.ndjson 不纳入)
34
- 2. **Confident edits only, but must attempt** — only modify what you're confident about; record decisions only when genuinely requiring human judgment
35
- - Confident → edit code directly, commit
36
- - Needs decision → record `evidence.ndjson {"phase":"decision","status":"pending"}`, don't touch code
37
- - No speculative changes
38
- - ⚠️ **Decision gate** — ONLY these qualify as decisions (not fixes):
39
- - Cross-module architectural tradeoffs requiring human direction
40
- - Ambiguous business semantics where the fix could alter intended behavior
41
- - Requires new dependency or breaking API change
42
- - ❌ "Unsure how to fix", "Large scope", "Pre-existing issue" are NOT valid decision reasons — either fix it, or explain specifically why it's unfixable
43
- 3. **多 CLI 辅助** — `maestro delegate` 多 `--role`(analyze/review/explore)交叉验证关键判断
44
- </execution_discipline>
45
-
46
41
  <context>
47
42
  $ARGUMENTS — issue description and optional flags.
48
43
 
49
- **Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` 预定义策略 | `--auto` no delegate confirmation | `-y` auto-confirm all decisions | `-c` resume last session
44
+ **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
50
45
 
51
46
  **Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
47
+ **Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
52
48
 
53
- **Output 4 files:**
54
- ```
55
- SESSION_DIR/
56
- ├── session.json # state + confirmation + patterns + phase_goals
57
- ├── evidence.ndjson # append-only evidence trail (phase field distinguishes origin)
58
- ├── explore.json # structured CLI exploration snapshot
59
- └── understanding.md # evolving narrative — 9 sections
60
- ```
61
-
62
- **evidence.ndjson — unified trail:**
49
+ **session.json unique fields:**
63
50
  ```json
64
- {"ts":"","phase":"archaeology|explore|diagnosis|discovery|decision|self-iteration","type":"","source":"","content":"","note":""}
51
+ { "issue": "", "diagnosis_retries": 0, "root_cause": null, "confirmation": null,
52
+ "patterns": [], "generalization_stats": null, "cross_phase_loops": 0, "max_loops": 5 }
65
53
  ```
66
- Phase-specific fields:
67
- - `archaeology`: `sha`, `author`, `date`, `message`, `relevance` (high|medium|low)
54
+ 共有字段(`progress_metrics`, `directions_tried` 等)见 base。
55
+
56
+ **evidence.ndjson phases:** `archaeology|explore|diagnosis|discovery|decision|self-iteration`
57
+ - `archaeology`: `sha`, `author`, `date`, `message`, `relevance`
68
58
  - `explore`: `category` (call_chain|recent_change|error_gap|similar_pattern), `detail`
69
59
  - `diagnosis`: `hypothesis`, `result` (confirmed|disproved|inconclusive)
70
- - `discovery`: `file`, `line`, `classification` (safe|risk|bug), `action`
71
- - `decision`: `question`, `options`, `context`, `status` (pending|resolved|deferred), `resolution`
60
+ - `discovery`: `file`, `line`, `classification` (safe|risk|bug), `action` (fix|issue|decision|skip)
61
+ - `decision`: `question`, `options`, `context`, `status`, `resolution`
62
+ - `self-iteration`: `stage`, `round`, `assessment`, `expansion`
72
63
 
73
- **explore.json schema:**
74
- ```json
75
- {
76
- "call_chains": [{"entry":"","chain":["file:line"]}],
77
- "recent_changes": [{"file":"","commits":[{"sha":"","message":"","date":""}]}],
78
- "error_gaps": [{"file":"","line":0,"description":""}],
79
- "similar_patterns": [{"file":"","line":0,"description":""}],
80
- "cli_tool": "", "timestamp": ""
81
- }
82
- ```
64
+ **explore.json**: `{call_chains, recent_changes, error_gaps, similar_patterns, cli_tool, timestamp}`
83
65
 
84
- **session.json schema:**
85
- ```json
86
- {
87
- "session_id": "debug-odyssey-{YYYYMMDD-HHmmss}", "issue": "",
88
- "flags": { "skip_fix": false, "skip_generalize": false, "auto": false, "auto_confirm": false },
89
- "current_state": "S_INTAKE", "diagnosis_retries": 0,
90
- "root_cause": null, "patterns": [], "confirmation": null,
91
- "phase_goals": [], "phase_goals_all_done": false, "self_iteration_log": [],
92
- "cross_phase_loops": 0, "max_loops": 5,
93
- "generalization_stats": null,
94
- "created_at": "", "updated_at": ""
95
- }
96
- ```
97
-
98
- **phase_goals[] — auto-derived from flags:**
66
+ **phase_goals[]:**
99
67
 
100
68
  | ID | Goal | done_when | phase | skip_when |
101
69
  |----|------|-----------|-------|-----------|
102
- | G1 | Root cause identified | evidence.ndjson has phase=diagnosis result=confirmed | S_DIAGNOSE | — |
103
- | G2 | Explore context gathered | explore.json ≥1 category populated | S_EXPLORE | — |
70
+ | G1 | Root cause identified | phase=diagnosis result=confirmed | S_DIAGNOSE | — |
71
+ | G2 | Explore context gathered | explore.json ≥1 category | S_EXPLORE | — |
104
72
  | G3 | Fix applied and confirmed | confirmation.overall == confirmed | S_CONFIRM | skip_fix |
105
73
  | G4 | Pattern generalized | patterns[] ≥1 entry | S_GENERALIZE | skip_generalize |
106
74
  | G5 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
107
- | G6 | Learnings persisted | spec entries created OR no actionable learnings | S_RECORD | — |
108
-
109
- When `flags[skip_when] == true` → auto set `status: "skipped"`, `completion_confirmed: true`.
75
+ | G6 | Learnings persisted | spec entries created OR none actionable | S_RECORD | — |
110
76
 
111
- **understanding.md — 9 sections (written by owning phase):**
77
+ **understanding.md — 9 sections:**
112
78
  1. Issue & Scope ← S_INTAKE | 2. Archaeology ← S_ARCHAEOLOGY | 3. Exploration ← S_EXPLORE
113
79
  4. Hypotheses ← S_DIAGNOSE | 5. Root Cause ← S_DIAGNOSE | 6. Fix & Confirmation ← S_FIX+S_CONFIRM
114
80
  7. Generalization ← S_GENERALIZE | 8. Discoveries ← S_DISCOVER | 9. Learnings ← S_RECORD
115
81
 
116
82
  ### Pre-load(可选,缺失不阻塞)
117
83
 
118
- | 层级 | 命令 | 作用 |
119
- |------|------|------|
120
- | Codebase docs | Read `.workflow/codebase/ARCHITECTURE.md` | 模块边界 |
121
- | Wiki search | `maestro search "<issue keywords>" --json` | 先前调查(top 5) |
122
- | Specs + tools | `maestro load --type spec --category debug --keyword "<symptom>"` | 已知 issue/workaround |
123
- | Role knowledge | `maestro search --category debug` 选相关 `maestro load --type knowhow --id <id>` | 领域知识 |
124
- | Prior sessions | `Glob(".workflow/scratch/*-debug-odyssey-*")` | 相关会话 |
125
-
126
- ### Knowledge Persistence(S_RECORD 中写入产出文件)
127
-
128
- S_RECORD 将可沉淀知识 **写入 understanding.md §9 Learnings**,按分类结构化:
129
-
130
- | 分类 | 写入内容 | 后续建议命令 |
131
- |------|---------|-------------|
132
- | 反复根因模式 | 模式描述 + 触发条件 + 修复模板 | `$spec-add debug "..."` |
133
- | 非显而易见 workaround | 问题场景 + 解决方案 + 适用范围 | `$spec-add learning "..."` |
134
- | 架构边界违反 | 违反描述 + 正确边界 + 检查方法 | `$spec-add arch "..."` |
135
- | 可复用泛化 pattern | pattern 签名 + 风险说明 + fix 模板 | `$spec-add coding "..."` |
136
-
137
- **两步模式:** 执行中写入产出文件(临时记录)→ 任务完成后用户沉淀为永久知识。执行过程中不调用外部 skill。
84
+ | 命令 | 作用 |
85
+ |------|------|
86
+ | Read `.workflow/codebase/ARCHITECTURE.md` | 模块边界 |
87
+ | `maestro search "<issue keywords>" --json` | 先前调查(top 5) |
88
+ | `maestro load --type spec --category debug --keyword "<symptom>"` | 已知 issue/workaround |
89
+ | `Glob(".workflow/scratch/*-debug-odyssey-*")` | 相关 odyssey 会话 |
90
+
91
+ ### Knowledge Persistence(S_RECORD → understanding.md §9)
92
+
93
+ | 分类 | 后续建议命令 |
94
+ |------|-------------|
95
+ | 反复根因模式 | `/spec-add debug "..."` |
96
+ | 非显而易见 workaround | `/spec-add learning "..."` |
97
+ | 架构边界违反 | `/spec-add arch "..."` |
98
+ | 可复用泛化 pattern | `/spec-add coding "..."` |
138
99
  </context>
139
100
 
140
- <self_iteration>
141
- **Quality Gate (适用: S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE)**
142
-
143
- | 维度 | sufficient | insufficient |
144
- |------|-----------|-------------|
145
- | Coverage | 已知相关文件/模块均已分析 | 遗漏 grep/git log 可发现的目标 |
146
- | Depth | ≥80% 发现有 file:line 级证据 | 多数仅泛泛描述 |
147
- | Actionability | 每条结论有具体后续动作 | 仅"建议关注"类无操作性结论 |
148
-
149
- **Rules:** Phase complete → evaluate 3 dimensions → any insufficient → re-enter (max **3 rounds** per phase).
150
- - Round 1: Broaden scope — add directories, git log depth ×2, add delegate angles
151
- - Round 2: Switch perspective — different CLI tool, reverse tracing, manual code reading
152
- - Round 3: Combine both + targeted deep-dive on remaining gaps
153
-
154
- **Exit:** All sufficient → advance | 3-round limit → record gaps and continue. Log to `evidence.ndjson` + `session.json.self_iteration_log[]`.
155
- </self_iteration>
156
-
157
101
  <csv_schema>
158
102
  ### Shared Output Schema (all waves)
159
103
  ```json
@@ -184,35 +128,60 @@ id,title,description,task_type,deps,wave,status,findings,evidence,error
184
128
  - Single-agent stages (explore, diagnose, fix, confirm) remain inline
185
129
  </csv_schema>
186
130
 
187
- <invariants>
188
- 1. **Iron Law**: NO FIX without root cause evidence
189
- 2. **Archaeology first**: git history MUST precede any hypothesis
190
- 3. **Evidence append-only**: never modify/delete evidence.ndjson entries
191
- 4. **Session is source of truth**: session.json holds all state
192
- 5. **Phase goal tracking**: each phase MUST mark its goal on completion
193
- 6. **Decision journal integrity**: all human-judgment items recorded phase=decision
194
- 7. **`-y` defers, never drops**: auto-confirm records "deferred", never silently skips
195
- 8. **CLI delegate is background**: all `maestro delegate` → `run_in_background: true`, wait for callback (do NOT halt the Odyssey flow)
196
- 9. **Resumable state**: current_state saved at every transition
197
- 10. **Goal is outcome-oriented**: `/goal` user-bound; odyssey outputs prompt then continues
198
- 11. **Violation = BLOCK**: violating any invariant blocks the operation
199
- </invariants>
200
-
201
- <execution>
202
-
203
- ### Stage 1: Intake (S_INTAKE)
204
- 1. Parse arguments: issue description, flags
205
- 2. Generate slug, create `SESSION_DIR`
206
- 3. Search: `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
207
- 4. Derive `phase_goals[]` from flags (apply `skip_when`)
208
- 5. Write `session.json` + `understanding.md` §1
209
- 6. Display Goal Prompt (Appendix), continue without blocking
210
-
211
- **Resume (`-c`):** Glob latest session read `session.json` → restore `current_state` → jump.
212
-
213
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): S_INTAKE — 目标解析"`
214
-
215
- ### Stage 2: Archaeology (S_ARCHAEOLOGY)
131
+ <self_iteration>
132
+ 适用阶段: S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE
133
+ </self_iteration>
134
+
135
+ <state_machine>
136
+
137
+ <states>
138
+ S_INTAKE S_ARCHAEOLOGY S_EXPLORE S_DIAGNOSE S_FIX S_CONFIRM → S_GENERALIZE → S_DISCOVER → S_RECORD → END
139
+ </states>
140
+
141
+ <transitions>
142
+ S_INTAKE S_INTAKE : -c + session found A_RESUME_SESSION
143
+ S_INTAKE → S_ARCHAEOLOGY : issue parsed → A_INTAKE
144
+ S_INTAKE → S_INTAKE : no issue, no session → request_user_input
145
+
146
+ S_ARCHAEOLOGY → S_EXPLORE : A_ARCHAEOLOGY complete
147
+ S_EXPLORE → S_DIAGNOSE : A_EXPLORE complete
148
+
149
+ S_DIAGNOSE S_FIX : root cause confirmed, !skip_fix
150
+ S_DIAGNOSE → S_GENERALIZE : root cause confirmed, skip_fix, !skip_generalize
151
+ S_DIAGNOSE S_RECORD : root cause confirmed, skip_fix, skip_generalize
152
+ S_DIAGNOSE S_DIAGNOSE : all hypotheses failed, retries < 3 → A_ESCALATE_DIAGNOSIS
153
+ S_DIAGNOSE S_RECORD : retries >= 3 mark INCONCLUSIVE
154
+
155
+ S_FIX S_CONFIRM : fix implemented
156
+ S_CONFIRM → S_GENERALIZE : confirmed, !skip_generalize
157
+ S_CONFIRM S_RECORD : confirmed, skip_generalize
158
+ S_CONFIRM → S_FIX : needs_rework
159
+
160
+ S_GENERALIZE → S_DISCOVER : similar code found
161
+ S_GENERALIZE → S_RECORD : no similar code
162
+
163
+ S_DISCOVER → S_DIAGNOSE : new bug worth investigating → cross_phase_loops++
164
+ S_DISCOVER → S_FIX : same-pattern bug, fix template applies, !skip_fix → cross_phase_loops++
165
+ S_DISCOVER → S_RECORD : triage complete, remaining_actionable == 0
166
+ S_DISCOVER → S_RECORD : loops >= max_loops → log each unfixed item with specific reason
167
+
168
+ S_RECORD → END : A_RECORD complete
169
+ </transitions>
170
+
171
+ <actions>
172
+
173
+ ### A_INTAKE
174
+ 1. Parse arguments, generate slug, create `SESSION_DIR`
175
+ 2. Search: `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
176
+ 3. Derive `phase_goals[]` from flags (apply `skip_when`)
177
+ 4. Write `session.json` + `understanding.md` §1, emit Goal Prompt
178
+
179
+ 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): INTAKE — 目标解析与上下文加载"`
180
+
181
+ ### A_RESUME_SESSION
182
+ Find latest session via Glob → read `session.json` → display summary → jump to `current_state`.
183
+
184
+ ### A_ARCHAEOLOGY
216
185
  **Step 1 — Git archaeology (spawn_agents_on_csv, Wave 1):**
217
186
 
218
187
  Write `tasks.csv` with Wave 1 rows:
@@ -231,86 +200,53 @@ spawn_agents_on_csv({ csv_path:"tasks.csv", id_column:"id",
231
200
 
232
201
  Merge results → evidence.ndjson (phase: "archaeology").
233
202
 
234
- **Step 2 — CLI change review:**
235
- ```bash
236
- maestro delegate "PURPOSE: Review recent modifications related to: {issue}
237
- TASK: Analyze intent | Identify risky modifications | Flag potential bug sources
238
- MODE: analysis
239
- CONTEXT: @{relevant_files} | Git log: {top_10_commits}
240
- EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
241
- CONSTRAINTS: Focus on behavioral changes, not formatting
242
- " --role analyze --mode analysis
243
- ```
244
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow). Append results.
203
+ **Step 2 — CLI change review** via `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
204
+ - PURPOSE: Review recent modifications related to {issue}
205
+ - EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
245
206
 
246
- **Step 3:** Update `understanding.md` §2.
207
+ Update §2.
247
208
 
248
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): S_ARCHAEOLOGY考古"`
209
+ 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): ARCHAEOLOGYgit 考古分析"`
249
210
 
250
- ### Stage 3: Exploration (S_EXPLORE)
211
+ ### A_EXPLORE
251
212
  Skip if no enabled CLI tools (W006).
252
213
 
253
- ```bash
254
- maestro delegate "PURPOSE: Gather codebase evidence for: {issue}
255
- TASK: Trace call chains | Find recent changes | Identify error gaps | Check similar patterns
256
- MODE: analysis
257
- CONTEXT: @**/*
258
- EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
259
- CONSTRAINTS: Max 20 entries/category | Symptom-related code paths
260
- Symptoms: {issue} Archaeology hints: {suspicious_commits}
261
- " --role explore --mode analysis
262
- ```
263
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
214
+ `maestro delegate --role explore --mode analysis` (`run_in_background: true`):
215
+ - PURPOSE: Gather codebase evidence call chains, recent changes, error gaps, similar patterns
216
+ - EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
264
217
 
265
218
  Parse → write `explore.json` + evidence (phase: "explore"). Update §3. Mark G2 done.
266
219
 
267
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): S_EXPLORE探索"`
220
+ 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): EXPLORE代码探索完成"`
268
221
 
269
- ### Stage 4: Diagnosis (S_DIAGNOSE)
270
- 1. **Form hypotheses** from evidence (archaeology + explore), ranked [HIGH]/[MEDIUM]/[LOW] → §4
271
- 2. **Test each** (rank order): design test → execute → evidence (phase: "diagnosis")
272
- 3. **Decision journal**: ambiguity → evidence (phase: "decision"); Normal: request_user_input | `-y`: defer
273
- 4. **Root cause**: confirmed → `session.json.root_cause` + §5. Mark G1 done.
222
+ ### A_DIAGNOSE
223
+ 1. Form hypotheses from evidence, ranked [HIGH]/[MEDIUM]/[LOW] → §4
224
+ 2. Test each: design test → execute → evidence (phase: "diagnosis")
225
+ 3. Decision journal: ambiguity → evidence (phase: "decision"); Normal: request_user_input | `-y`: defer
226
+ 4. Root cause confirmed → `session.json.root_cause` + §5. Mark G1 done.
274
227
 
275
- **Escalation (3-strike):**
276
- All hypotheses fail → increment `diagnosis_retries`.
277
- - < 3: broaden scope via `maestro delegate --role analyze`, form new hypotheses.
278
- - >= 3: Normal → request_user_input (broaden/new/INCONCLUSIVE) | `-y` → auto INCONCLUSIVE, proceed to S_RECORD.
228
+ 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): DIAGNOSE — 根因确认"`
279
229
 
280
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): S_DIAGNOSE — 诊断"`
281
-
282
- ### Stage 5: Fix (S_FIX)
283
- Skip if `--skip-fix`.
230
+ ### A_ESCALATE_DIAGNOSIS
231
+ Increment `diagnosis_retries`. < 3: broaden via `maestro delegate --role analyze`, new hypotheses, return S_DIAGNOSE. >= 3: Normal → request_user_input | `-y` → auto INCONCLUSIVE → S_RECORD.
284
232
 
233
+ ### A_FIX
285
234
  1. Present root cause + proposed fix. Normal: request_user_input | `-y`: auto proceed
286
- 2. Implement fix
287
- 3. Record in evidence (phase: "decision")
288
-
289
- 📌 **Auto-commit**: `git add -A && git commit -m "odyssey-debug({slug}): S_FIX — 修复"`
290
-
291
- ### Stage 6: Confirmation (S_CONFIRM)
292
- Skip if `--skip-fix`.
293
-
294
- 1. **Tests**: auto-detect framework, run covering tests
295
- 2. **CLI fix review**:
296
- ```bash
297
- maestro delegate "PURPOSE: Review fix for: {issue}
298
- TASK: Verify correctness | Check regressions | Assess completeness
299
- MODE: analysis
300
- CONTEXT: @{modified_files} | Root cause: {summary} | Diff: {git_diff}
301
- EXPECTED: JSON {verdict, findings [{severity, description, suggestion}], regression_risk}
302
- CONSTRAINTS: Focus on correctness, not style
303
- " --role review --mode analysis
304
- ```
305
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
235
+ 2. Implement fix, record evidence (phase: "decision")
306
236
 
307
- 3. Write `session.json.confirmation`: `{test_result, cli_review, overall, timestamp}`
308
- 4. Update §6. `needs_rework` → Stage 5. `confirmed` → mark G3 done, advance.
237
+ 📌 **Auto-commit**: `git add -A && git commit -m "odyssey-debug({slug}): FIX {修复摘要}"`
309
238
 
310
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): S_CONFIRM — 确认"`
239
+ ### A_CONFIRM
240
+ 1. Run covering tests (auto-detect framework)
241
+ 2. CLI fix review via `maestro delegate --role review --mode analysis` (`run_in_background: true`):
242
+ - EXPECTED: JSON {verdict, findings [{severity, description, suggestion}], regression_risk}
243
+ 3. Write `session.json.confirmation`: `{test_result, cli_review, overall: "confirmed|needs_rework"}`
244
+ 4. Update §6. `needs_rework` → S_FIX. `confirmed` → mark G3 done.
311
245
 
312
- ### Stage 7: Generalization (S_GENERALIZE)
313
- Skip if `--skip-generalize`. 举一反三: extract pattern, scan for siblings.
246
+ 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): CONFIRM — 修复验证"`
247
+
248
+ ### A_GENERALIZE
249
+ Skip if `--skip-generalize`. Pattern 来源: root cause + fix。
314
250
 
315
251
  **Step 1 — Multi-layer pattern extraction:**
316
252
 
@@ -345,35 +281,20 @@ spawn_agents_on_csv({ csv_path:"tasks.csv", id_column:"id",
345
281
 
346
282
  **Step 5 — Quality Gate** (self-iteration).
347
283
 
348
- **Step 6:** Write §7 + `session.json.generalization_stats`: `{patterns_extracted, total_hits, cross_layer_confirmed, regression_risks, by_layer, deepening_triggered}`. Mark G4 done.
349
-
350
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): S_GENERALIZE泛化"`
351
-
352
- ### Stage 8: Discovery (S_DISCOVER)
353
- Skip if no generalization hits.
354
-
355
- 1. **Triage** each hit: read ±10 lines classify `safe`/`risk`/`bug`
356
- 2. **Route** (explicit action required for each classification):
357
- - `bug` + directly fixable → **fix immediately** (not just log an issue) → back to S_FIX
358
- - `bug` + requires cross-module/architectural decision → create issue (with fix suggestion + impact analysis)
359
- - `risk` evaluate if guard/validation can mitigate directly; if yes, fix it
360
- - `safe` mark skip
361
- See Appendix `-y` behavior. Append evidence (phase: "discovery" + "decision")
362
- 3. **Cross-phase loop**:
363
- - discovery finds new bug → S_DIAGNOSE (cross_phase_loops++)
364
- - same-pattern bug + fix template → S_FIX
365
- - S_DISCOVER → S_RECORD: triage complete AND remaining_actionable == 0
366
- - S_DISCOVER → S_RECORD: loops >= max_loops → MUST log each unfixed item with specific reason (blanket "pre-existing" is forbidden)
367
- 4. Update §8. Mark G5 done.
368
-
369
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): S_DISCOVER — 发现"`
370
-
371
- ### Stage 9: Record (S_RECORD)
372
- 1. Finalize `understanding.md` §9
373
- 2. **Write learnings** to understanding.md §9: 按 Knowledge Persistence 表分类记录(临时),completion summary 列出建议的后续命令
374
- 3. Mark G6 done. Pending decisions: Normal → request_user_input | `-y` → show deferred count
375
- 4. **Goal audit**: all confirmed → `phase_goals_all_done = true`. Any false: Normal → request_user_input (回退/跳过/接受) | `-y` → auto accept
376
- 5. **Completion**: `current_state = "COMPLETED"`, emit summary:
284
+ **Step 6:** Write `session.json.generalization_stats`: `{patterns_extracted, total_hits, cross_layer_confirmed, regression_risks, by_layer, deepening_triggered}`. Update §7. Mark G4 done.
285
+
286
+ 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): GENERALIZE泛化扫描完成"`
287
+
288
+ ### A_DISCOVER
289
+ base A_DISCOVER 执行。Mark G5 done.
290
+
291
+ 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): DISCOVER — 发现分类完成"`
292
+
293
+ ### A_RECORD
294
+ 1. Finalize `understanding.md` §9,按 Knowledge Persistence 表分类记录
295
+ 2. Mark G6 done. Pending decisions: Normal request_user_input | `-y` skip (show deferred count)
296
+ 3. 其余按 base A_RECORD 执行
297
+ 4. **Completion summary**:
377
298
  ```
378
299
  --- DEBUG ODYSSEY COMPLETE ---
379
300
  Issue: {issue}
@@ -389,86 +310,75 @@ Goals: {done}/{total} confirmed ({skipped} skipped)
389
310
  ---
390
311
  ```
391
312
 
392
- Next steps: `$manage-issue list --source debug-odyssey`, `$learn-decompose <module>`,
393
- `$quality-review`, `$learn-second-opinion <understanding.md>`, `$learn-investigate "<question>"`
313
+ 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): RECORD — 会话总结与知识沉淀"`
394
314
 
395
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): S_RECORD — 总结"`
396
- </execution>
315
+ </actions>
397
316
 
398
317
  <appendix>
399
318
 
400
319
  ### Goal Prompt Template
401
320
 
402
- **时机守卫:仅在 Stage 1 完成后显示一次。Stage 9 完成时禁止重新显示。**
321
+ **时机守卫:仅在 A_INTAKE 完成后显示一次。** 机制见 base。
403
322
 
404
323
  ```
405
324
  📋 Debug Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件:
406
325
 
407
- /goal 穷尽迭代:直到根因确认(或明确 INCONCLUSIVE)且修复验证通过
326
+ /goal 完成以下目标:
327
+ {for each G in phase_goals where status != "skipped":}
328
+ - {G.id}: {G.goal} — 完成条件: {G.done_when}
329
+ {end for}
330
+ 穷尽迭代:直到根因确认(或明确 INCONCLUSIVE)且修复验证通过
408
331
  且泛化扫描穷尽且 phase_goals_all_done=true 才停。
409
- 假设失败时扩范围→换视角→升级工具,不轻易放弃。
410
332
  泛化发现的同类 bug 全部修复或创建 issue,不允许遗留。
411
333
  遇到 phase=decision 的 pending 必须 request_user_input,不得自行 resolve。
412
334
  ```
413
335
 
414
- Odyssey 输出提示词后继续执行不阻塞。`/goal` 由用户任意时刻输入。
415
-
416
336
  ### `-y` Auto-Confirm Behavior
417
337
 
418
338
  | Decision Point | Normal | `-y` mode |
419
339
  |---------------|--------|-----------|
420
- | Stage 4 ambiguity | request_user_input blocks | record `deferred`, best-effort continue |
421
- | Stage 4 3-strike | request_user_input 3-way | auto INCONCLUSIVE |
422
- | Stage 5 fix direction | request_user_input confirm | auto proceed |
423
- | Stage 8 bug triage | request_user_input route | auto create issue |
424
- | Stage 8 ambiguous | request_user_input batch | all `deferred` |
425
- | Stage 9 decisions | request_user_input per-item | skip, show deferred count |
426
- | Stage 9 goal audit | request_user_input 3-way | auto accept current state |
427
-
428
- `deferred` items shown as "待决策" in summary; recoverable via `-c`.
429
-
430
- ### Phase Goal Lifecycle
431
-
432
- `pending → done (confirmed=true)` normal | `pending → skipped (confirmed=true)` flags/manual | `pending → failed (confirmed=false)` INCONCLUSIVE
433
-
434
- `phase_goals_all_done = true` only when ALL goals have `completion_confirmed == true`.
340
+ | A_DIAGNOSE ambiguity | request_user_input | `deferred`, best-effort continue |
341
+ | A_ESCALATE 3-strike | request_user_input 3-way | auto INCONCLUSIVE |
342
+ | A_FIX direction | request_user_input | auto proceed with suggested fix |
343
+ | A_DISCOVER bug triage | request_user_input | auto create issue |
344
+ | A_DISCOVER ambiguous | request_user_input batch | all `deferred` |
345
+ | A_RECORD decisions | request_user_input per-item | skip, show deferred count |
346
+ | A_RECORD goal audit | request_user_input 3-way | auto accept current state |
435
347
 
436
348
  </appendix>
437
349
 
350
+ </state_machine>
351
+
438
352
  <error_codes>
439
353
  | Code | Severity | Condition | Recovery |
440
354
  |------|----------|-----------|----------|
441
355
  | E001 | error | No issue and no session to resume | Provide issue or use -c |
442
- | E003 | error | Resume but no session found | Start new session |
443
- | E004 | error | Delegate execution failed | Retry or proceed without CLI |
444
356
  | W001 | warning | No relevant git history | Proceed with limited context |
445
357
  | W002 | warning | All hypotheses inconclusive after 3 retries | INCONCLUSIVE |
446
- | W003 | warning | Generalization scan 0 hits | Skip discovery |
447
- | W004 | warning | Delegate parse failed | Use raw output |
448
358
  | W005 | warning | Pending decisions unresolved | Filter evidence.ndjson phase=decision |
449
359
  | W006 | warning | CLI exploration skipped (no tools) | Proceed without explore.json |
450
360
  </error_codes>
451
361
 
452
362
  <success_criteria>
453
- - [ ] Session directory created with 4 output files
454
- - [ ] Prior knowledge searched (maestro search + sessions + architecture)
455
- - [ ] Git archaeology (spawn Wave 1) + CLI change review, evidence phase=archaeology
456
- - [ ] CLI exploration, explore.json written, evidence phase=explore
457
- - [ ] Hypotheses formed from archaeology + explore, tested and logged phase=diagnosis
458
- - [ ] Root cause declared with evidence refs
363
+ - [ ] Session created with 4 output files, prior knowledge searched
364
+ - [ ] Git archaeology + CLI change review evidence phase=archaeology
365
+ - [ ] CLI exploration explore.json + evidence phase=explore
366
+ - [ ] Hypotheses tested, root cause declared with evidence refs
459
367
  - [ ] understanding.md tracks all 9 sections progressively
460
- - [ ] Fix implemented + confirmed with test + CLI review (unless --skip-fix)
461
- - [ ] Multi-layer patterns extracted (syntax/semantic/structural) (unless --skip-generalize)
462
- - [ ] 4-agent scan (spawn Wave 2) + cross-layer dedup + iterative deepening
463
- - [ ] Discoveries classified and routed (fix/issue/decision/skip)
464
- - [ ] Decision journal: all human-judgment items in evidence.ndjson phase=decision
465
- - [ ] phase_goals derived from flags, skip_when applied, each phase marks its goal
466
- - [ ] Goal audit in Stage 9 — unmet goals surfaced, phase_goals_all_done set correctly
467
- - [ ] Goal Prompt displayed once after session creation
468
- - [ ] `-y`: all decisions auto-resolve/defer, deferred count in summary
469
- - [ ] State saved at each transition (resumable via -c)
470
- - [ ] Quality Gate self-iteration when insufficient, logged in self_iteration_log
471
- - [ ] Spec entries persisted for reusable learnings
368
+ - [ ] Fix implemented + confirmed (unless --skip-fix)
369
+ - [ ] Multi-layer generalization + scan (unless --skip-generalize)
370
+ - [ ] Discoveries classified and routed; every unfixed finding individually justified
371
+ - [ ] phase_goals derived, goal audit in A_RECORD, state resumable via -c
472
372
  - [ ] Completion summary with all stats
473
- - [ ] **Every unfixed finding has individual classification and reason** — blanket "pre-existing" labels are forbidden
474
373
  </success_criteria>
374
+
375
+ <next_step_routing>
376
+ | Condition | Next step |
377
+ |-----------|-----------|
378
+ | Issues from discoveries | `/manage-issue list --source debug-odyssey` |
379
+ | Pattern worth documenting | `/learn-decompose <module>` |
380
+ | Fix needs formal review | `/quality-review <phase>` |
381
+ | Second opinion on root cause | `/learn-second-opinion <understanding.md>` |
382
+ | Related question | `/learn-investigate "<question>"` |
383
+ | Decisions still pending | Filter evidence.ndjson phase=decision status=pending |
384
+ </next_step_routing>