maestro-flow 0.5.40 → 0.5.42

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 (101) hide show
  1. package/.agents/skills/maestro-analyze/SKILL.md +0 -42
  2. package/.agents/skills/maestro-blueprint/SKILL.md +0 -22
  3. package/.agents/skills/maestro-brainstorm/SKILL.md +4 -24
  4. package/.agents/skills/maestro-execute/SKILL.md +1 -1
  5. package/.agents/skills/maestro-grill/SKILL.md +0 -16
  6. package/.agents/skills/maestro-milestone-audit/SKILL.md +0 -15
  7. package/.agents/skills/maestro-plan/SKILL.md +5 -62
  8. package/.agents/skills/maestro-roadmap/SKILL.md +0 -8
  9. package/.agents/skills/odyssey-debug/SKILL.md +109 -143
  10. package/.agents/skills/odyssey-improve/SKILL.md +127 -141
  11. package/.agents/skills/odyssey-planex/SKILL.md +140 -231
  12. package/.agents/skills/odyssey-review-test-fix/SKILL.md +136 -90
  13. package/.agents/skills/odyssey-ui/SKILL.md +123 -143
  14. package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  15. package/.agents/skills/team-coordinate/specs/role-spec-template.md +197 -198
  16. package/.agents/skills/team-roadmap-dev/SKILL.md +164 -164
  17. package/.agents/skills/team-roadmap-dev/specs/team-config.json +1 -1
  18. package/.agents/skills/team-swarm/roles/analyst/role.md +172 -176
  19. package/.agy/skills/maestro-analyze/SKILL.md +0 -42
  20. package/.agy/skills/maestro-blueprint/SKILL.md +0 -22
  21. package/.agy/skills/maestro-brainstorm/SKILL.md +4 -24
  22. package/.agy/skills/maestro-execute/SKILL.md +1 -1
  23. package/.agy/skills/maestro-grill/SKILL.md +0 -16
  24. package/.agy/skills/maestro-milestone-audit/SKILL.md +0 -15
  25. package/.agy/skills/maestro-plan/SKILL.md +5 -62
  26. package/.agy/skills/maestro-roadmap/SKILL.md +0 -8
  27. package/.agy/skills/odyssey-debug/SKILL.md +109 -143
  28. package/.agy/skills/odyssey-improve/SKILL.md +127 -141
  29. package/.agy/skills/odyssey-planex/SKILL.md +140 -231
  30. package/.agy/skills/odyssey-review-test-fix/SKILL.md +136 -90
  31. package/.agy/skills/odyssey-ui/SKILL.md +123 -143
  32. package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  33. package/.agy/skills/team-coordinate/specs/role-spec-template.md +197 -198
  34. package/.agy/skills/team-roadmap-dev/SKILL.md +141 -153
  35. package/.agy/skills/team-roadmap-dev/specs/team-config.json +1 -1
  36. package/.agy/skills/team-swarm/roles/analyst/role.md +172 -176
  37. package/.claude/commands/maestro-analyze.md +0 -42
  38. package/.claude/commands/maestro-blueprint.md +0 -22
  39. package/.claude/commands/maestro-brainstorm.md +4 -24
  40. package/.claude/commands/maestro-execute.md +1 -1
  41. package/.claude/commands/maestro-grill.md +0 -16
  42. package/.claude/commands/maestro-milestone-audit.md +0 -15
  43. package/.claude/commands/maestro-plan.md +5 -62
  44. package/.claude/commands/maestro-roadmap.md +0 -8
  45. package/.claude/commands/odyssey-debug.md +109 -143
  46. package/.claude/commands/odyssey-improve.md +127 -141
  47. package/.claude/commands/odyssey-planex.md +140 -231
  48. package/.claude/commands/odyssey-review-test-fix.md +136 -90
  49. package/.claude/commands/odyssey-ui.md +123 -143
  50. package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  51. package/.claude/skills/team-coordinate/specs/role-spec-template.md +197 -198
  52. package/.claude/skills/team-roadmap-dev/SKILL.md +169 -169
  53. package/.claude/skills/team-roadmap-dev/specs/team-config.json +1 -1
  54. package/.claude/skills/team-swarm/roles/analyst/role.md +181 -185
  55. package/.codex/skills/odyssey-debug/SKILL.md +114 -169
  56. package/.codex/skills/odyssey-improve/SKILL.md +144 -188
  57. package/.codex/skills/odyssey-planex/SKILL.md +162 -242
  58. package/.codex/skills/odyssey-review-test-fix/SKILL.md +96 -90
  59. package/.codex/skills/odyssey-ui/SKILL.md +128 -173
  60. package/dashboard/dist-server/src/commands/install-backend.js +31 -16
  61. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  62. package/dashboard/dist-server/src/core/component-defs.js +25 -0
  63. package/dashboard/dist-server/src/core/component-defs.js.map +1 -1
  64. package/dashboard/dist-server/src/tools/spec-loader.js +32 -20
  65. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  66. package/dashboard/dist-server/src/tools/spec-seeds.d.ts +8 -0
  67. package/dashboard/dist-server/src/tools/spec-seeds.js +114 -0
  68. package/dashboard/dist-server/src/tools/spec-seeds.js.map +1 -1
  69. package/dist/src/commands/install-backend.d.ts.map +1 -1
  70. package/dist/src/commands/install-backend.js +31 -16
  71. package/dist/src/commands/install-backend.js.map +1 -1
  72. package/dist/src/commands/spec.d.ts.map +1 -1
  73. package/dist/src/commands/spec.js +13 -3
  74. package/dist/src/commands/spec.js.map +1 -1
  75. package/dist/src/core/component-defs.d.ts.map +1 -1
  76. package/dist/src/core/component-defs.js +25 -0
  77. package/dist/src/core/component-defs.js.map +1 -1
  78. package/dist/src/tools/spec-init.d.ts +4 -3
  79. package/dist/src/tools/spec-init.d.ts.map +1 -1
  80. package/dist/src/tools/spec-init.js +9 -5
  81. package/dist/src/tools/spec-init.js.map +1 -1
  82. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  83. package/dist/src/tools/spec-loader.js +32 -20
  84. package/dist/src/tools/spec-loader.js.map +1 -1
  85. package/dist/src/tools/spec-seeds.d.ts +8 -0
  86. package/dist/src/tools/spec-seeds.d.ts.map +1 -1
  87. package/dist/src/tools/spec-seeds.js +114 -0
  88. package/dist/src/tools/spec-seeds.js.map +1 -1
  89. package/dist/src/utils/update-notices.js +11 -0
  90. package/dist/src/utils/update-notices.js.map +1 -1
  91. package/package.json +1 -1
  92. package/workflows/agy-instructions.md +147 -161
  93. package/workflows/claude-instructions.md +100 -48
  94. package/workflows/codex-instructions.md +147 -161
  95. package/workflows/execute.md +4 -3
  96. package/workflows/explore-usage.md +41 -81
  97. package/workflows/grill.md +11 -0
  98. package/workflows/milestone-audit.md +8 -0
  99. package/workflows/odyssey-base-codex.md +305 -0
  100. package/workflows/odyssey-base.md +89 -91
  101. package/workflows/plan.md +6 -0
@@ -17,40 +17,38 @@ allowed-tools:
17
17
  <base>@~/.maestro/workflows/odyssey-base.md</base>
18
18
 
19
19
  <purpose>
20
- Closed-loop deep debugging: archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
21
- Treats every bug as a learning signal with exhaustive iteration until root cause confirmed or INCONCLUSIVE.
20
+ archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
21
+ Exhaustive iteration until root cause confirmed or INCONCLUSIVE.
22
22
  </purpose>
23
23
 
24
24
  <boundary>
25
- **范围内:** 单一 bug/issue 的完整闭环 — 考古 → 探索 → 诊断 → 修复 → 确认 → 泛化同类 → 沉淀
26
- **范围外:** 新功能开发 → `/odyssey-planex` | 代码质量审查 → `/odyssey-review-test-fix` | UI 视觉优化 → `/odyssey-ui` | 架构重设计 → `/maestro-plan`
27
- **探索自由度:** 边界内自由探索 — 可追踪任意调用链、分析任意历史、测试任意假设。泛化阶段可扫描全项目寻找同类问题。
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>` 从预定义调查策略启动:
30
-
31
- | Template | 调查策略 | 适用场景 |
32
- |----------|---------|---------|
33
- | `performance` | profilinghot pathallocation cache | 性能劣化 |
34
- | `memory-leak` | heap snapshot retention chainlifecycle | 内存泄漏 |
35
- | `race-condition` | timelineconcurrent accesslock analysis | 竞态条件 |
36
- | `regression` | git bisectdiff analysisboundary check | 回归问题 |
37
- | `crash` | stack trace → null chain → error propagation | 崩溃/异常 |
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 chainlifecycle | Memory leaks |
34
+ | `race-condition` | timelineconcurrent accesslock analysis | Race conditions |
35
+ | `regression` | git bisect diff analysisboundary check | Regressions |
36
+ | `crash` | stack tracenull chainerror propagation | Crashes / exceptions |
38
37
  </boundary>
39
38
 
40
39
  <context>
41
- $ARGUMENTS — issue description and optional flags.
40
+ $ARGUMENTS
42
41
 
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
42
+ **Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
44
43
 
45
- **Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
44
+ **Session**: `.workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
46
45
  **Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
47
46
 
48
- **session.json unique fields:**
47
+ **session.json debug-specific fields:**
49
48
  ```json
50
49
  { "issue": "", "diagnosis_retries": 0, "root_cause": null, "confirmation": null,
51
- "patterns": [], "generalization_stats": null, "cross_phase_loops": 0, "max_loops": 5 }
50
+ "patterns": [], "generalization_stats": null }
52
51
  ```
53
- 共有字段(`progress_metrics`, `directions_tried` 等)见 base。
54
52
 
55
53
  **evidence.ndjson phases:** `archaeology|explore|diagnosis|discovery|decision|self-iteration`
56
54
  - `archaeology`: `sha`, `author`, `date`, `message`, `relevance`
@@ -78,27 +76,23 @@ $ARGUMENTS — issue description and optional flags.
78
76
  4. Hypotheses ← S_DIAGNOSE | 5. Root Cause ← S_DIAGNOSE | 6. Fix & Confirmation ← S_FIX+S_CONFIRM
79
77
  7. Generalization ← S_GENERALIZE | 8. Discoveries ← S_DISCOVER | 9. Learnings ← S_RECORD
80
78
 
81
- ### Pre-load(可选,缺失不阻塞)
79
+ **Knowledge Persistence categories (§9):**
82
80
 
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
- | `grep_search(".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 "..."` |
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` |
98
87
  </context>
99
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
+ </invariants>
93
+
100
94
  <self_iteration>
101
- 适用阶段: S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE
95
+ Applies to: **S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE**. Logic in base.
102
96
  </self_iteration>
103
97
 
104
98
  <state_machine>
@@ -112,14 +106,14 @@ S_INTAKE → S_INTAKE : -c + session found → A_RESUME_SESSION
112
106
  S_INTAKE → S_ARCHAEOLOGY : issue parsed → A_INTAKE
113
107
  S_INTAKE → S_INTAKE : no issue, no session → ask_question
114
108
 
115
- S_ARCHAEOLOGY → S_EXPLORE : A_ARCHAEOLOGY complete
116
- S_EXPLORE → S_DIAGNOSE : A_EXPLORE complete
109
+ S_ARCHAEOLOGY → S_EXPLORE : complete
110
+ S_EXPLORE → S_DIAGNOSE : complete
117
111
 
118
- S_DIAGNOSE → S_FIX : root cause confirmed, !skip_fix
119
- S_DIAGNOSE → S_GENERALIZE : root cause confirmed, skip_fix, !skip_generalize
120
- S_DIAGNOSE → S_RECORD : root cause confirmed, skip_fix, skip_generalize
112
+ S_DIAGNOSE → S_FIX : confirmed, !skip_fix
113
+ S_DIAGNOSE → S_GENERALIZE : confirmed, skip_fix, !skip_generalize
114
+ S_DIAGNOSE → S_RECORD : confirmed, skip_fix, skip_generalize
121
115
  S_DIAGNOSE → S_DIAGNOSE : all hypotheses failed, retries < 3 → A_ESCALATE_DIAGNOSIS
122
- S_DIAGNOSE → S_RECORD : retries >= 3 → mark INCONCLUSIVE
116
+ S_DIAGNOSE → S_RECORD : retries >= 3 → INCONCLUSIVE
123
117
 
124
118
  S_FIX → S_CONFIRM : fix implemented
125
119
  S_CONFIRM → S_GENERALIZE : confirmed, !skip_generalize
@@ -129,140 +123,112 @@ S_CONFIRM → S_FIX : needs_rework
129
123
  S_GENERALIZE → S_DISCOVER : similar code found
130
124
  S_GENERALIZE → S_RECORD : no similar code
131
125
 
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
126
+ S_DISCOVER → S_DIAGNOSE : new bug → cross_phase_loops++
127
+ S_DISCOVER → S_FIX : same-pattern bug + fix_template, !skip_fix → cross_phase_loops++
128
+ S_DISCOVER → S_RECORD : remaining_actionable == 0
129
+ S_DISCOVER → S_RECORD : loops >= max_loops → log per-item reasons
136
130
 
137
- S_RECORD → END : A_RECORD complete
131
+ S_RECORD → END : complete
138
132
  </transitions>
139
133
 
140
134
  <actions>
141
135
 
142
136
  ### A_INTAKE
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`)
137
+ 1. Parse arguments, generate slug, create SESSION_DIR
138
+ 2. `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
139
+ 3. Derive `phase_goals[]` from flags
146
140
  4. Write `session.json` + `understanding.md` §1, emit Goal Prompt
147
141
 
148
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): INTAKE — 目标解析与上下文加载"`
142
+ Commit: `"odyssey-debug({slug}): INTAKE — parse target and load context"`
149
143
 
150
144
  ### A_RESUME_SESSION
151
- Find latest session via Glob → read `session.json` → display summary → jump to `current_state`.
145
+ Glob latest session → read `session.json` → jump to `current_state`.
152
146
 
153
147
  ### A_ARCHAEOLOGY
154
- **2 parallel Agents:** Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 suspicious files `git blame -L {region}`). Append evidence (phase: "archaeology").
148
+ 2 parallel Agents: Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 files `git blame -L {region}`). Evidence phase=archaeology.
155
149
 
156
- **CLI change review** via `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
150
+ `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
157
151
  - PURPOSE: Review recent modifications related to {issue}
158
152
  - EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
159
153
 
160
- Update §2.
161
-
162
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): ARCHAEOLOGY — git 考古分析"`
154
+ Update §2. Commit: `"odyssey-debug({slug}): ARCHAEOLOGY — git history analysis"`
163
155
 
164
156
  ### A_EXPLORE
165
- Skip if no enabled CLI tools (W006).
157
+ Skip if no CLI tools (W006).
166
158
 
167
159
  `maestro delegate --role explore --mode analysis` (`run_in_background: true`):
168
- - PURPOSE: Gather codebase evidence — call chains, recent changes, error gaps, similar patterns
160
+ - PURPOSE: Call chains, recent changes, error gaps, similar patterns
169
161
  - EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
170
162
 
171
- Parse → write `explore.json` + evidence (phase: "explore"). Update §3. Mark G2 done.
172
-
173
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): EXPLORE — 代码探索完成"`
163
+ Write `explore.json` + evidence phase=explore. Update §3. Mark G2. Commit: `"odyssey-debug({slug}): EXPLORE — codebase exploration"`
174
164
 
175
165
  ### A_DIAGNOSE
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_question | `-y`: defer
179
- 4. Root cause confirmed → `session.json.root_cause` + §5. Mark G1 done.
166
+ 1. Hypotheses from evidence, ranked [HIGH]/[MEDIUM]/[LOW] → §4
167
+ 2. Test each → evidence phase=diagnosis
168
+ 3. Ambiguity → evidence phase=decision; Normal: ask_question | `-y`: defer
169
+ 4. Confirmed → `session.json.root_cause` + §5. Mark G1.
180
170
 
181
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): DIAGNOSE — 根因确认"`
171
+ Commit: `"odyssey-debug({slug}): DIAGNOSE — root cause confirmed"`
182
172
 
183
173
  ### A_ESCALATE_DIAGNOSIS
184
- Increment `diagnosis_retries`. < 3: broaden via `maestro delegate --role analyze`, new hypotheses, return S_DIAGNOSE. >= 3: Normal → ask_question | `-y` → auto INCONCLUSIVE → S_RECORD.
174
+ `diagnosis_retries++`. < 3: `maestro delegate --role analyze`, new hypotheses, S_DIAGNOSE. >= 3: Normal → ask_question | `-y` → INCONCLUSIVE → S_RECORD.
185
175
 
186
176
  ### A_FIX
187
177
  1. Present root cause + proposed fix. Normal: ask_question | `-y`: auto proceed
188
- 2. Implement fix, record evidence (phase: "decision")
178
+ 2. Implement fix, evidence phase=decision
189
179
 
190
- 📌 **Auto-commit**: `git add -A && git commit -m "odyssey-debug({slug}): FIX — {修复摘要}"`
180
+ Commit: `"odyssey-debug({slug}): FIX — {summary}"`
191
181
 
192
182
  ### A_CONFIRM
193
- 1. Run covering tests (auto-detect framework)
194
- 2. CLI fix review via `maestro delegate --role review --mode analysis` (`run_in_background: true`):
183
+ 1. Run covering tests
184
+ 2. `maestro delegate --role review --mode analysis` (`run_in_background: true`):
195
185
  - 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.
198
-
199
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): CONFIRM — 修复验证"`
186
+ 3. `session.json.confirmation`: `{test_result, cli_review, overall: "confirmed|needs_rework"}`
187
+ 4. Update §6. `needs_rework` → S_FIX. `confirmed` → mark G3.
200
188
 
201
- ### A_GENERALIZE
202
- 按 base A_GENERALIZE 执行。Pattern 来源: root cause + fix。统计写入 `session.json.generalization_stats`。Mark G4 done.
189
+ Commit: `"odyssey-debug({slug}): CONFIRM — fix verified"`
203
190
 
204
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): GENERALIZE — 泛化扫描完成"`
191
+ ### A_GENERALIZE, A_DISCOVER, A_RECORD
192
+ Base shared_actions. Debug overrides:
193
+ - **A_GENERALIZE** pattern source: root cause + fix
194
+ - **A_RECORD** learnings per Knowledge Persistence table
205
195
 
206
- ### A_DISCOVER
207
- 按 base A_DISCOVER 执行。Mark G5 done.
208
-
209
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): DISCOVER — 发现分类完成"`
210
-
211
- ### A_RECORD
212
- 1. Finalize `understanding.md` §9,按 Knowledge Persistence 表分类记录
213
- 2. Mark G6 done. Pending decisions: Normal → ask_question | `-y` → skip (show deferred count)
214
- 3. 其余按 base A_RECORD 执行
215
- 4. **Completion summary**:
196
+ **Completion summary:**
216
197
  ```
217
198
  --- DEBUG ODYSSEY COMPLETE ---
218
199
  Issue: {issue}
219
200
  Root cause: {root_cause.hypothesis}
220
201
  Fix: {applied|skipped|inconclusive}
221
- Patterns: {patterns_extracted} ({by_layer} distribution)
222
- Scan hits: {total_hits} ({cross_layer_confirmed} cross-layer confirmed)
202
+ Patterns: {patterns_extracted} ({by_layer})
203
+ Scan hits: {total_hits} ({cross_layer_confirmed} confirmed)
223
204
  Issues: {N} created
224
205
  Decisions: {N} resolved, {M} pending, {K} deferred
225
- Learnings: {N} spec entries persisted
226
- Self-iter: {N} quality gate rounds across {M} stages
227
- Goals: {done}/{total} confirmed ({skipped} skipped)
206
+ Learnings: {N} persisted
207
+ Self-iter: {N} rounds across {M} stages
208
+ Goals: {done}/{total} ({skipped} skipped)
228
209
  ---
229
210
  ```
230
211
 
231
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): RECORD — 会话总结与知识沉淀"`
232
-
233
212
  </actions>
234
213
 
235
214
  <appendix>
236
215
 
237
- ### Goal Prompt Template
216
+ ### `-y` debug-specific points
238
217
 
239
- **时机守卫:仅在 A_INTAKE 完成后显示一次。** 机制见 base。
218
+ | Decision Point | Normal | `-y` |
219
+ |---------------|--------|------|
220
+ | A_DIAGNOSE ambiguity | ask_question | deferred |
221
+ | A_ESCALATE 3-strike | ask_question | INCONCLUSIVE |
222
+ | A_FIX direction | ask_question | auto proceed |
223
+
224
+ ### Goal Prompt convergence rules
240
225
 
241
226
  ```
242
- 📋 Debug Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件:
243
-
244
- /goal 完成以下目标:
245
- {for each G in phase_goals where status != "skipped":}
246
- - {G.id}: {G.goal} — 完成条件: {G.done_when}
247
- {end for}
248
- 穷尽迭代:直到根因确认(或明确 INCONCLUSIVE)且修复验证通过
249
- 且泛化扫描穷尽且 phase_goals_all_done=true 才停。
250
- 泛化发现的同类 bug 全部修复或创建 issue,不允许遗留。
251
- 遇到 phase=decision 的 pending 必须 ask_question,不得自行 resolve。
227
+ Stop when root cause confirmed (or INCONCLUSIVE), fix verified,
228
+ generalization exhausted, phase_goals_all_done=true.
229
+ All sibling bugs fixed or issued — no leftovers.
252
230
  ```
253
231
 
254
- ### `-y` Auto-Confirm Behavior
255
-
256
- | Decision Point | Normal | `-y` mode |
257
- |---------------|--------|-----------|
258
- | A_DIAGNOSE ambiguity | ask_question | `deferred`, best-effort continue |
259
- | A_ESCALATE 3-strike | ask_question 3-way | auto INCONCLUSIVE |
260
- | A_FIX direction | ask_question | auto proceed with suggested fix |
261
- | A_DISCOVER bug triage | ask_question | auto create issue |
262
- | A_DISCOVER ambiguous | ask_question batch | all `deferred` |
263
- | A_RECORD decisions | ask_question per-item | skip, show deferred count |
264
- | A_RECORD goal audit | ask_question 3-way | auto accept current state |
265
-
266
232
  </appendix>
267
233
 
268
234
  </state_machine>
@@ -270,33 +236,33 @@ Goals: {done}/{total} confirmed ({skipped} skipped)
270
236
  <error_codes>
271
237
  | Code | Severity | Condition | Recovery |
272
238
  |------|----------|-----------|----------|
273
- | E001 | error | No issue and no session to resume | Provide issue or use -c |
274
- | W001 | warning | No relevant git history | Proceed with limited context |
275
- | W002 | warning | All hypotheses inconclusive after 3 retries | INCONCLUSIVE |
276
- | W005 | warning | Pending decisions unresolved | Filter evidence.ndjson phase=decision |
277
- | W006 | warning | CLI exploration skipped (no tools) | Proceed without explore.json |
239
+ | E001 | error | No issue, no session | Provide issue or -c |
240
+ | W001 | warning | No relevant git history | Proceed |
241
+ | W002 | warning | 3 retries exhausted | INCONCLUSIVE |
242
+ | W005 | warning | Pending decisions | Filter evidence phase=decision |
243
+ | W006 | warning | No CLI tools | Skip explore |
278
244
  </error_codes>
279
245
 
280
246
  <success_criteria>
281
- - [ ] Session created with 4 output files, prior knowledge searched
282
- - [ ] Git archaeology + CLI change review → evidence phase=archaeology
247
+ - [ ] Session + 4 output files + prior knowledge searched
248
+ - [ ] Archaeology + CLI review → evidence phase=archaeology
283
249
  - [ ] CLI exploration → explore.json + evidence phase=explore
284
- - [ ] Hypotheses tested, root cause declared with evidence refs
285
- - [ ] understanding.md tracks all 9 sections progressively
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
290
- - [ ] Completion summary with all stats
250
+ - [ ] Hypotheses tested, root cause with evidence refs
251
+ - [ ] understanding.md 9 sections progressive
252
+ - [ ] Fix + confirmed (unless --skip-fix)
253
+ - [ ] Generalization + scan (unless --skip-generalize)
254
+ - [ ] Discoveries classified; unfixed findings individually justified
255
+ - [ ] phase_goals + goal audit + resumable via -c
256
+ - [ ] Completion summary
291
257
  </success_criteria>
292
258
 
293
259
  <next_step_routing>
294
- | Condition | Next step |
295
- |-----------|-----------|
296
- | Issues from discoveries | `/manage-issue list --source debug-odyssey` |
297
- | Pattern worth documenting | `/learn-decompose <module>` |
298
- | Fix needs formal review | `/quality-review <phase>` |
299
- | Second opinion on root cause | `/learn-second-opinion <understanding.md>` |
260
+ | Condition | Next |
261
+ |-----------|------|
262
+ | Discovery issues | `/manage-issue list --source debug-odyssey` |
263
+ | Document pattern | `/learn-decompose <module>` |
264
+ | Formal review | `/quality-review <phase>` |
265
+ | Second opinion | `/learn-second-opinion <understanding.md>` |
300
266
  | Related question | `/learn-investigate "<question>"` |
301
- | Decisions still pending | Filter evidence.ndjson phase=decision status=pending |
267
+ | Pending decisions | Filter evidence phase=decision status=pending |
302
268
  </next_step_routing>