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,7 +1,7 @@
1
1
  ---
2
2
  name: odyssey-improve
3
3
  description: Long-running codebase improvement cycle — multi-dimensional audit, deep diagnosis, targeted fix, verify, generalize, and engineering knowledge persistence
4
- argument-hint: "<target> [--dimensions <list>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c]"
4
+ argument-hint: "<target> [--dimensions <list>] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
@@ -12,6 +12,8 @@ allowed-tools:
12
12
  - Agent
13
13
  - AskUserQuestion
14
14
  ---
15
+ <base>@~/.maestro/workflows/odyssey-base.md</base>
16
+
15
17
  <purpose>
16
18
  Deep codebase improvement: survey → 6-dimension audit → diagnose → fix → verify → generalize → discover → persist.
17
19
  Baseline-first approach with exhaustive iteration until zero remaining actionable findings.
@@ -24,31 +26,6 @@ Baseline-first approach with exhaustive iteration until zero remaining actionabl
24
26
  **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.
25
27
  </boundary>
26
28
 
27
- <execution_discipline>
28
- **三条铁律(所有阶段适用):**
29
-
30
- 1. **Phase auto-commit** — 每个阶段完成后**自动** `git commit`,无需用户确认
31
- - 代码变更 + understanding.md → `git add` → `git commit -m "odyssey-improve({slug}): {phase} — {摘要}"`
32
- - session.json / evidence.ndjson 为运行时状态,不纳入 commit
33
-
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
-
44
- 3. **多 CLI 辅助** — 利用 `maestro delegate` 调用多个 CLI 工具交叉验证
45
- - survey 阶段: `--role explore` 发现依赖/复杂度热点
46
- - audit/diagnose: `--role analyze` 获取多视角分析
47
- - fix 前后: `--role review` 确认改进正确性
48
-
49
- 4. **禁止以上下文消耗为由中断** — harness 自动处理 context compression,以"上下文不足"或"已执行 N 个阶段"为由中断属于纪律违反;必须完整走完状态机直到 S_RECORD → END
50
- </execution_discipline>
51
-
52
29
  <context>
53
30
  $ARGUMENTS — target and optional flags.
54
31
 
@@ -70,6 +47,7 @@ $ARGUMENTS — target and optional flags.
70
47
  | `--auto` | CLI delegates without confirmation | false |
71
48
  | `-y` | Auto-confirm all decisions (see appendix) | false |
72
49
  | `-c` | Resume most recent session | — |
50
+ | `--heartbeat` | Enable /loop heartbeat protocol (see base) | false |
73
51
 
74
52
  **Dimensions (6):**
75
53
  1. **performance** — hot paths, N+1 queries, memory allocation, cache efficiency, bundle size, lazy loading
@@ -81,37 +59,11 @@ $ARGUMENTS — target and optional flags.
81
59
 
82
60
  **Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-improve-odyssey-{slug}/`
83
61
 
84
- **Output 3 files:**
85
- ```
86
- SESSION_DIR/
87
- ├── session.json # state + audit_result + diagnoses + patterns + phase_goals
88
- ├── evidence.ndjson # append-only (phase: survey|audit|diagnosis|fix|discovery|decision|self-iteration)
89
- └── understanding.md # 9-section evolving narrative
90
- ```
91
-
92
- **session.json schema:**
93
- ```json
94
- {
95
- "session_id": "improve-odyssey-{YYYYMMDD-HHmmss}",
96
- "target": "", "dimensions": [],
97
- "flags": { "skip_fix": false, "skip_generalize": false, "auto": false, "auto_confirm": false },
98
- "current_state": "S_INTAKE",
99
- "baseline_metrics": {},
100
- "audit_result": { "dimensions_audited": [], "finding_count": 0, "severity_distribution": {} },
101
- "diagnoses": [],
102
- "patterns": [],
103
- "confirmation": null,
104
- "generalization_stats": null,
105
- "phase_goals": [], "phase_goals_all_done": false,
106
- "self_iteration_log": [],
107
- "cross_phase_loops": 0, "max_loops": 5,
108
- "created_at": "", "updated_at": ""
109
- }
110
- ```
111
-
112
- **evidence.ndjson unified schema:** `{"ts":"","phase":"<phase>","type":"<type>","dimension":"","title":"","severity":"","file":"","line":0,"description":"","suggestion":"","measurement":""}`
113
-
114
- Phase-specific fields:
62
+ **Output:** `session.json` (state + audit + diagnoses + patterns + goals) | `evidence.ndjson` (append-only) | `understanding.md` (9-section narrative)
63
+
64
+ **session.json unique fields:** `target`, `dimensions`, `baseline_metrics`, `audit_result`, `diagnoses`, `confirmation`, `generalization_stats` (`progress_metrics`, `directions_tried` from base)
65
+
66
+ **evidence.ndjson phase-specific fields:**
115
67
  - `survey`: `category` (dependency|complexity|coverage|error_pattern), `detail`
116
68
  - `audit`: `dimension`, `severity`, `measurement`
117
69
  - `diagnosis`: `finding_ref`, `hypothesis`, `result` (confirmed|disproved|inconclusive), `root_cause`
@@ -131,8 +83,6 @@ Phase-specific fields:
131
83
  | G6 | Discoveries triaged | S_DISCOVER | skip_generalize |
132
84
  | G7 | Learnings persisted | S_RECORD | — |
133
85
 
134
- Lifecycle: `pending → done | skipped | failed` (all set `completion_confirmed`)
135
-
136
86
  **understanding.md — 9 sections (written by owning phase):**
137
87
  1. Target & Baseline ← S_INTAKE | 2. Current State Survey ← S_SURVEY | 3. Audit Findings ← S_AUDIT
138
88
  4. Root Cause Diagnosis ← S_DIAGNOSE | 5. Fix & Verification ← S_FIX+S_VERIFY
@@ -140,15 +90,9 @@ Lifecycle: `pending → done | skipped | failed` (all set `completion_confirmed`
140
90
  8. Improvement Metrics ← S_RECORD (before/after) | 9. Engineering Learnings ← S_RECORD
141
91
 
142
92
  ### Pre-load(可选,缺失不阻塞)
143
-
144
- | 层级 | 命令 | 作用 |
145
- |------|------|------|
146
- | Codebase docs | Read `.workflow/codebase/ARCHITECTURE.md` | 模块边界,作为分析上下文 |
147
- | Wiki search | `maestro search "<target keywords>" --json` | 先前优化、相关决策(取 top 5) |
148
- | Coding specs | `maestro load --type spec --category coding` | 编码规范 |
149
- | Debug specs | `maestro load --type spec --category debug` | 已知性能/安全模式 |
150
- | Role knowledge | `maestro search --category coding` → 选相关 → `maestro load --type knowhow --id <id>` | 累积领域知识 |
151
- | Prior sessions | `Glob(".workflow/scratch/*-improve-odyssey-*")` | 相关会话 |
93
+ - ARCHITECTURE.md → 模块边界 | `maestro search "<target>" --json` → 先前优化(top 5)
94
+ - `maestro load --type spec --category coding` + `--category debug` → 编码规范 + 已知模式
95
+ - `maestro search --category coding` → knowhow | `Glob(".workflow/scratch/*-improve-odyssey-*")` → 先前会话
152
96
 
153
97
  ### Knowledge Persistence(S_RECORD 中写入产出文件)
154
98
 
@@ -160,25 +104,9 @@ S_RECORD 阶段将可沉淀知识 **写入 understanding.md §9 Learnings**,
160
104
  | 安全规则 | 漏洞类别 + 修复 + 预防方法 | `/spec-add debug "..."` |
161
105
  | 架构约束 | 违反描述 + 正确边界 + 检查方法 | `/spec-add arch "..."` |
162
106
  | 可靠性 pattern | 故障模式 + 处理策略 + 验证手段 | `/spec-add coding "..."` |
163
-
164
- **两步模式:** 执行中写入产出文件(临时记录)→ 任务完成后用户通过 next_step_routing 沉淀为永久知识。执行过程中不调用外部 Skill。
165
107
  </context>
166
108
 
167
- <self_iteration>
168
- **Quality Gate** — auto-evaluate after each analytical phase. Insufficient → re-enter (max **3 rounds**).
169
-
170
- | Dimension | Sufficient | Insufficient |
171
- |-----------|-----------|-------------|
172
- | Coverage | All target files/modules analyzed across dimensions | Missed files discoverable via grep/glob |
173
- | Depth | ≥80% findings have file:line evidence + measurement | Most findings lack specifics |
174
- | Actionability | Each conclusion has concrete fix or issue action | "Consider reviewing" without action |
175
-
176
- **Expansion:** Round 1 = widen scope (more modules, deeper import chain, extra delegate angles). Round 2 = shift perspective (different CLI tool, reverse dependency trace, manual code reading). Round 3 = combine both + targeted deep-dive on remaining gaps.
177
-
178
- **Log:** `evidence.ndjson ← {"phase":"self-iteration","type":"quality-gate","stage":"S_XXX","round":N,"assessment":{},"expansion":""}`
179
-
180
- **Applicable stages:** S_SURVEY, S_AUDIT, S_DIAGNOSE, S_GENERALIZE
181
- </self_iteration>
109
+ Self-iteration 适用阶段: S_SURVEY, S_AUDIT, S_DIAGNOSE, S_GENERALIZE
182
110
 
183
111
  <state_machine>
184
112
 
@@ -252,38 +180,14 @@ Find latest session via Glob → read `session.json` → display summary → jum
252
180
  ### A_SURVEY
253
181
  Current state survey — understand what exists before proposing changes.
254
182
 
255
- 1. **Dependency audit**: Read package.json/lock files, scan for outdated/vulnerable deps
256
- 2. **Complexity scan**: Identify high-complexity files (file size, function count, nesting depth)
257
- 3. **Test coverage map**: Which modules have coverage, which don't
258
- 4. **Error handling scan**: Grep for empty catch, unhandled promise, missing error boundaries
259
- 5. **CLI-assisted survey** (optional):
260
- ```bash
261
- maestro delegate "PURPOSE: Survey codebase health of: {target}
262
- TASK: Dependency health | Complexity hotspots | Test coverage gaps | Error handling patterns
263
- MODE: analysis
264
- CONTEXT: @{target_files}
265
- EXPECTED: JSON {dependency_health, complexity_hotspots, coverage_gaps, error_patterns}
266
- CONSTRAINTS: Focus on runtime quality, not style
267
- " --role analyze --mode analysis
268
- ```
269
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
270
-
271
- 6. Append evidence.ndjson (phase: "survey"). Update `understanding.md` §2. Mark G1 done.
183
+ 1. Dependency audit (package.json/lock), complexity scan (size/nesting), test coverage map, error handling scan (empty catch, unhandled promise)
184
+ 2. **CLI-assisted** (optional): `maestro delegate` with `--role analyze --mode analysis` for dependency health, complexity hotspots, coverage gaps, error patterns. Execute `run_in_background: true`.
185
+ 3. Append evidence.ndjson (phase: "survey"). Update `understanding.md` §2. Mark G1 done.
272
186
 
273
187
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): SURVEY — 现状调查"`
274
188
 
275
189
  ### A_AUDIT
276
- Spawn 6 parallel Agents (one per dimension, or `--dimensions` subset):
277
-
278
- | Agent | Dimension | Focus |
279
- |-------|-----------|-------|
280
- | Performance | performance | Hot paths, N+1 queries, memory allocation, cache efficiency, bundle size, lazy loading |
281
- | Security | security | OWASP Top 10, injection, auth bypass, data exposure, dependency vulns, secrets |
282
- | Architecture | architecture | Layer violations, circular deps, coupling, interface contracts, SRP violations |
283
- | Reliability | reliability | Error handling gaps, retry logic, timeout handling, graceful degradation, cleanup |
284
- | Observability | observability | Logging coverage, metric gaps, trace propagation, error reporting, health checks |
285
- | Maintainability | maintainability | Cyclomatic complexity, dead code, test coverage gaps, documentation debt |
286
-
190
+ Spawn 6 parallel Agents (one per dimension from Dimensions list above, or `--dimensions` subset).
287
191
  Each returns: `[{title, severity, dimension, file, line, description, suggestion, measurement}]`
288
192
 
289
193
  Merge → evidence.ndjson (phase: "audit"). Write `session.json.audit_result`.
@@ -294,25 +198,10 @@ Update `understanding.md` §3 (findings by dimension + severity matrix). Mark G2
294
198
  ### A_DIAGNOSE
295
199
  Root cause analysis for critical/high findings — don't fix symptoms.
296
200
 
297
- 1. Group findings by dimension, prioritize by severity
298
- 2. For each critical/high finding:
299
- - Form hypothesis about root cause
300
- - Test: trace code path, check git history, verify with evidence
301
- - Record to evidence.ndjson (phase: "diagnosis")
302
- 3. **Decision journal**: ambiguity → evidence (phase: "decision"); Normal: AskUserQuestion | `-y`: defer
303
- 4. **CLI-assisted diagnosis** for complex findings:
304
- ```bash
305
- maestro delegate "PURPOSE: Diagnose root cause of: {finding}
306
- TASK: Trace code path | Check for systemic pattern | Identify fix approach
307
- MODE: analysis
308
- CONTEXT: @{relevant_files} | Finding: {finding_detail}
309
- EXPECTED: JSON {root_cause, systemic, fix_approach, risk}
310
- CONSTRAINTS: Focus on root cause, not symptom
311
- " --role analyze --mode analysis
312
- ```
313
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
314
-
315
- 5. Write `session.json.diagnoses[]`. Update `understanding.md` §4. Mark G3 done.
201
+ 1. Group by dimension, prioritize by severity. For each: hypothesis → trace code path + git history → evidence.ndjson (phase: "diagnosis")
202
+ 2. **Decision journal**: ambiguity → evidence (phase: "decision"); Normal: AskUserQuestion | `-y`: defer
203
+ 3. **CLI-assisted** for complex findings: `maestro delegate --role analyze --mode analysis` to trace code path, check systemic pattern, identify fix approach. Execute `run_in_background: true`.
204
+ 4. Write `session.json.diagnoses[]`. Update `understanding.md` §4. Mark G3 done.
316
205
 
317
206
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): DIAGNOSE — 根因诊断"`
318
207
 
@@ -329,68 +218,21 @@ Skip if `--skip-fix`. Implement improvements for diagnosed root causes.
329
218
  📌 **Auto-commit**: `git add -A && git commit -m "odyssey-improve({slug}): FIX — 改进实现"`
330
219
 
331
220
  ### A_VERIFY
332
- Verify improvements with measurement comparison.
333
-
334
221
  1. Run tests covering modified areas
335
- 2. **Measure improvement**: re-capture metrics, compare with `session.json.baseline_metrics`
336
- 3. **CLI-assisted verification**:
337
- ```bash
338
- maestro delegate "PURPOSE: Verify improvements for: {target}
339
- TASK: Check fix correctness | Test regressions | Measure impact | Compare with baseline
340
- MODE: analysis
341
- CONTEXT: @{modified_files} | Baseline: {baseline_metrics} | Fixes: {fix_summary}
342
- EXPECTED: JSON {verdict, metrics_improved, regressions, remaining_issues}
343
- CONSTRAINTS: Focus on correctness and measurable improvement
344
- " --role review --mode analysis
345
- ```
346
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
347
-
222
+ 2. Re-capture metrics, compare with `session.json.baseline_metrics`
223
+ 3. **CLI-assisted**: `maestro delegate --role review --mode analysis` to check fix correctness, test regressions, measure impact vs baseline. Execute `run_in_background: true`.
348
224
  4. `needs_rework` → S_FIX. `verified` → mark G4 done, advance.
349
225
  5. Write `session.json.confirmation`. Update `understanding.md` §5 (before/after metrics table).
350
226
 
351
227
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): VERIFY — 改进验证"`
352
228
 
353
229
  ### A_GENERALIZE
354
- Multi-layer pattern extraction from diagnoses + fixes 4-agent scan → cross-layer dedup.
355
-
356
- **Pattern extraction** from root causes + improvements:
357
-
358
- | Layer | Method | Example |
359
- |-------|--------|---------|
360
- | Syntax | Regex → direct Grep | Missing `await`, unclosed resource, empty catch, `eval(` |
361
- | Semantic | Agent understands anti-pattern → scans | Unhandled async errors, missing retry, N+1 query |
362
- | Structural | File/module structure similarity | Same import pattern, missing error boundary |
363
- | Historical | `git log -S "{pattern}"` | When similar issues were introduced/fixed |
364
-
365
- Write `session.json.patterns[]`: `[{id, source_finding, layer, signature, description, risk, fix_template, confidence}]`
366
-
367
- **4-agent parallel scan** (single message):
368
-
369
- | Agent | Strategy | Scope |
370
- |-------|----------|-------|
371
- | Syntax grep | Grep patterns matching found issues | Full project |
372
- | Semantic scan | Find modules with same anti-pattern | Related modules |
373
- | Structural match | Find structurally similar files | Full project |
374
- | Historical grep | `git log -S "{pattern}"` | Git history |
375
-
376
- **Cross-layer dedup**: Multi-layer hit → boost confidence. Single-layer → `needs_review`. Historical match on fixed code → `regression_risk`.
377
-
378
- **Iterative deepening**: Module with ≥3 hits → targeted deep scan (max 1 round).
379
-
380
- Update `understanding.md` §6. Write `session.json.generalization_stats`. Mark G5 done.
230
+ base A_GENERALIZE 执行。Pattern 来源: diagnoses + fixes。Mark G5 done.
381
231
 
382
232
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): GENERALIZE — 泛化扫描"`
383
233
 
384
234
  ### A_DISCOVER
385
- 1. **Triage** each hit: read ±10 lines context → classify `safe`/`risk`/`issue`
386
- 2. **Route**:
387
- - `issue` + directly fixable → **fix immediately** → back to S_FIX
388
- - `issue` + requires cross-module/architectural decision → create issue (with fix suggestion + impact analysis)
389
- - `risk` → evaluate if guard/validation can mitigate directly; if yes, fix it
390
- - `safe` → mark skip
391
- **Normal**: AskUserQuestion for routing ambiguity. **`-y`**: auto-fix what's fixable, create issue for rest.
392
- 3. **Cross-phase loops**: new critical issue → S_DIAGNOSE; same-pattern fix → S_FIX.
393
- 4. Append evidence (phase: "discovery" + "decision"). Update `understanding.md` §7. Mark G6 done.
235
+ base A_DISCOVER 执行。Mark G6 done.
394
236
 
395
237
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): DISCOVER — 发现分类"`
396
238
 
@@ -398,26 +240,8 @@ Update `understanding.md` §6. Write `session.json.generalization_stats`. Mark G
398
240
  1. **understanding.md §8**: Improvement metrics — before/after comparison table from baseline_metrics vs current
399
241
  2. **understanding.md §9**: Engineering learnings — 按 Knowledge Persistence 表分类记录(临时),completion summary 列出建议的 `/spec-add` 命令
400
242
  3. Mark G7 done. Pending decisions: **Normal** → AskUserQuestion. **`-y`** → skip, show deferred count.
401
- 4. **Goal audit**: all `phase_goals[*].completion_confirmed` true → `phase_goals_all_done = true`. Any false: **Normal** → AskUserQuestion (回退/跳过/接受) | **`-y`** → auto accept.
402
- 5. `current_state = "COMPLETED"`. Emit completion summary:
403
- ```
404
- --- IMPROVE ODYSSEY COMPLETE ---
405
- Target: {target}
406
- Dimensions: {dimensions_audited}
407
- Findings: {C}C {H}H {M}M {L}L
408
- Diagnosed: {diagnosed_count} root causes identified
409
- Fix: {fixed_count} improvements, verified={yes|skipped}
410
- Metrics: {improved} improved, {regressed} regressed
411
- Patterns: {extracted} ({by_layer} distribution)
412
- Scan hits: {total} ({cross_layer} cross-layer confirmed)
413
- Issues: {N} created
414
- Decisions: {N} resolved, {M} pending, {K} deferred
415
- Learnings: {N} entries in understanding.md §9
416
- Self-iter: {N} quality gate rounds across {M} stages
417
- Cross-loops: {cross_phase_loops}/{max_loops} used
418
- Goals: {done}/{total} ({skipped} skipped)
419
- ---
420
- ```
243
+ 4. 其余按 base A_RECORD 执行。
244
+ 5. `current_state = "COMPLETED"`. Emit completion summary: Target, Dimensions, Findings (C/H/M/L), Diagnosed count, Fix count + verified, Metrics (improved/regressed), Patterns (count + layer distribution), Scan hits (cross-layer), Issues created, Decisions (resolved/pending/deferred), Learnings count, Self-iter rounds, Cross-loops used, Goals (done/total/skipped).
421
245
 
422
246
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): RECORD — 指标总结与知识沉淀"`
423
247
 
@@ -426,22 +250,13 @@ Goals: {done}/{total} ({skipped} skipped)
426
250
  <appendix>
427
251
 
428
252
  ### Goal Prompt Template
429
- **⚠️ 时机守卫:仅在 A_INTAKE 完成后显示一次。A_RECORD 完成时禁止重新显示。**
253
+ **⚠️ 仅在 A_INTAKE 完成后显示一次,A_RECORD 完成时不重复。**
430
254
 
431
- ```
432
- 📋 Improve Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件:
433
-
434
- /goal 完成以下目标:
435
- {for each G in phase_goals where status != "skipped":}
436
- - {G.id}: {G.goal} — 完成条件: {G.done_when}
437
- {end for}
438
- 穷尽迭代:直到 session.json 的 audit_result 中所有 findings 均已处理(fix/issue/decision)
439
- 且 phase_goals_all_done=true 才停。修复按 severity 逐轮迭代,每轮修复后 re-verify 修改区域。
440
- Baseline metrics 必须在修复前采集,修复后必须与 baseline 对比确认改进。
441
- 遇到 phase=decision 的 pending 必须 AskUserQuestion。不允许"只报告不处理"。
442
- ```
443
-
444
- 完成时仅输出 completion summary,不重复此提示。
255
+ 列出所有非 skipped 的 phase_goals,附加收敛规则:
256
+ - 穷尽迭代至所有 findings 已处理(fix/issue/decision)且 `phase_goals_all_done=true`
257
+ - 修复按 severity 逐轮迭代,每轮 re-verify
258
+ - Baseline 修复前采集,修复后对比确认改进
259
+ - pending decision 必须 AskUserQuestion,不允许"只报告不处理"
445
260
 
446
261
  ### `-y` Auto-Confirm Behavior
447
262
  | Decision Point | Normal | `-y` |
@@ -456,11 +271,6 @@ Baseline metrics 必须在修复前采集,修复后必须与 baseline 对比
456
271
 
457
272
  `deferred` items shown as "待决策" in completion summary; recoverable via `-c`.
458
273
 
459
- ### Phase Goal Lifecycle
460
- `pending → done (confirmed=true)` normal | `pending → skipped (confirmed=true)` flags/manual | `pending → failed (confirmed=false)` exception
461
-
462
- `phase_goals_all_done = true` only when ALL goals have `completion_confirmed == true`.
463
-
464
274
  </appendix>
465
275
 
466
276
  </state_machine>
@@ -470,30 +280,19 @@ Baseline metrics 必须在修复前采集,修复后必须与 baseline 对比
470
280
  |------|----------|-----------|----------|
471
281
  | E001 | error | No target specified | Provide target or use -c |
472
282
  | E002 | error | Target path not found | Check path |
473
- | E003 | error | Resume but no session found | Start new session |
474
283
  | W001 | warning | No dependency manifest found | Proceed without dep audit |
475
284
  | W002 | warning | Some dimension agents failed | Partial audit coverage |
476
- | W003 | warning | Generalization 0 hits | Skip discovery |
477
- | W004 | warning | Delegate parse failed | Use raw output |
478
285
  </error_codes>
479
286
 
480
287
  <success_criteria>
481
- - [ ] Target resolved, baseline metrics captured in session.json
482
- - [ ] Dependency + complexity + coverage survey completed
483
- - [ ] All dimensions audited (6 parallel agents) with structured findings
484
- - [ ] Severity matrix produced
485
- - [ ] Root causes diagnosed for critical/high findings (hypothesis-driven)
288
+ - [ ] Target resolved, baseline metrics captured
289
+ - [ ] Survey + 6-dimension audit with structured findings and severity matrix
290
+ - [ ] Root causes diagnosed for critical/high findings
486
291
  - [ ] Improvements implemented and verified with before/after metrics (unless --skip-fix)
487
- - [ ] Multi-layer generalization scan + cross-layer dedup (unless --skip-generalize)
488
- - [ ] Cross-phase loops used when discoveries warrant
489
- - [ ] Quality Gate self-iteration triggered when insufficient
490
- - [ ] Discoveries classified and routed
491
- - [ ] **Every unfixed finding has individual classification and reason** — blanket "pre-existing" labels are forbidden
492
- - [ ] understanding.md §8: improvement metrics (before/after comparison)
493
- - [ ] understanding.md §9: engineering learnings
292
+ - [ ] Multi-layer generalization + cross-phase loops (unless --skip-generalize)
293
+ - [ ] Every unfixed finding has individual classification and reason
294
+ - [ ] understanding.md §8 (metrics) and §9 (learnings) completed
494
295
  - [ ] phase_goals G1-G7 tracked and audited
495
- - [ ] Goal Prompt displayed once
496
- - [ ] `-y`: no blocking prompts, deferred counted
497
296
  - [ ] Session resumable via -c
498
297
  </success_criteria>
499
298
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: odyssey-planex
3
3
  description: Requirement-driven iterative cycle — plan, execute, strict verify, fix loop until acceptance criteria met
4
- argument-hint: "<requirement> [--max-iterations N] [--skip-generalize] [--auto] [--method agent|cli|auto] [--executor <tool>] [--skip-verify] [-y] [-c]"
4
+ argument-hint: "<requirement> [--max-iterations N] [--skip-generalize] [--auto] [--method agent|cli|auto] [--executor <tool>] [--skip-verify] [--heartbeat] [-y] [-c]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
@@ -12,6 +12,8 @@ allowed-tools:
12
12
  - Agent
13
13
  - AskUserQuestion
14
14
  ---
15
+ <base>@~/.maestro/workflows/odyssey-base.md</base>
16
+
15
17
  <purpose>
16
18
  Requirement-to-delivery closed loop: parse requirement → define acceptance criteria →
17
19
  plan → execute → verify → fix gaps → iterate until ALL criteria pass.
@@ -21,7 +23,6 @@ plan → execute → verify → fix gaps → iterate until ALL criteria pass.
21
23
  **范围内:** 单一需求的实现闭环 — 从需求解析到验收标准全部通过 + 泛化同类场景
22
24
  **范围外:** 多需求编排 → `/maestro-roadmap` | 深度 debugging → `/odyssey-debug` | 代码审查 → `/odyssey-review-test-fix` | UI 优化 → `/odyssey-ui`
23
25
  **探索自由度:** 边界内自由探索 — 可自主分解任务、选择实现策略、迭代修复。verify→fix 循环内可尝试不同方案。
24
- **Zero-residual principle:** Every failing criterion MUST be fixed or explicitly escalated with specific reason. "Close enough" is not passing. "Pre-existing gap" is not a valid skip reason — if within scope, address it.
25
26
  **模板支持:** `--template <name>` 从预定义需求模板启动,自动生成匹配的验收标准和任务分解:
26
27
 
27
28
  | Template | 预设 criteria 模式 | 适用场景 |
@@ -33,31 +34,6 @@ plan → execute → verify → fix gaps → iterate until ALL criteria pass.
33
34
  | `api-endpoint` | 请求/响应契约 + 错误处理 + 权限校验 | API 开发 |
34
35
  </boundary>
35
36
 
36
- <execution_discipline>
37
- **三条铁律(所有阶段适用):**
38
-
39
- 1. **Phase auto-commit** — 每个阶段完成后**自动** `git commit`,无需用户确认
40
- - 代码变更 + understanding.md → `git add` → `git commit -m "odyssey-planex({slug}): {phase} — {摘要}"`
41
- - session.json / evidence.ndjson 为运行时状态,不纳入 commit
42
-
43
- 2. **Confident edits only, but must attempt** — only modify what you're confident about; record decisions only when genuinely requiring human judgment
44
- - Confident → edit code directly, commit
45
- - Needs decision → record `evidence.ndjson {"phase":"decision","status":"pending"}`, don't touch code
46
- - No speculative changes
47
- - ⚠️ **Decision gate** — ONLY these qualify as decisions (not fixes):
48
- - Cross-module architectural tradeoffs requiring human direction
49
- - Ambiguous business semantics where the fix could alter intended behavior
50
- - Requires new dependency or breaking API change
51
- - ❌ "Unsure how to fix", "Large scope", "Pre-existing issue" are NOT valid decision reasons — either fix it, or explain specifically why it's unfixable
52
-
53
- 3. **多 CLI 辅助** — 利用 `maestro delegate` 调用多个 CLI 工具交叉验证
54
- - 计划阶段: `--role analyze` 获取任务分解建议
55
- - 修复前后: `--role review` 确认无回归
56
- - verify 阶段: cli-review 类型标准自动 delegate
57
-
58
- 4. **禁止以上下文消耗为由中断** — harness 自动处理 context compression,以"上下文不足"或"已执行 N 个阶段"为由中断属于纪律违反;必须完整走完状态机直到 S_RECORD → END
59
- </execution_discipline>
60
-
61
37
  <context>
62
38
  $ARGUMENTS — requirement description and optional flags.
63
39
 
@@ -71,6 +47,7 @@ $ARGUMENTS — requirement description and optional flags.
71
47
  | `--method agent\|cli\|auto` | Execution method: Agent tool, CLI delegate, or auto-select | `auto` |
72
48
  | `--executor <tool>` | Explicit executor tool for CLI delegate mode | First enabled in config |
73
49
  | `--skip-verify` | Skip execution post-validation gate | false |
50
+ | `--heartbeat` | Enable periodic progress heartbeat | false |
74
51
  | `-y` | Auto-confirm — decisions recorded as `deferred` | false |
75
52
  | `-c` | Resume most recent session | — |
76
53
 
@@ -114,6 +91,8 @@ SESSION_DIR/
114
91
  "phase_goals": [],
115
92
  "phase_goals_all_done": false,
116
93
  "self_iteration_log": [],
94
+ "progress_metrics": "→ base",
95
+ "directions_tried": "→ base",
117
96
  "cross_phase_loops": 0, "max_loops": 5,
118
97
  "created_at": "", "updated_at": ""
119
98
  }
@@ -155,24 +134,10 @@ S_RECORD 阶段将可沉淀知识 **写入 understanding.md §8 Learnings**,
155
134
  | 可复用实现模式 | 模式描述 + 适用场景 + 代码模板 | `/spec-add coding "..."` |
156
135
  | 验收标准模板 | 标准模板 + verify_method 建议 | `/spec-add review "..."` |
157
136
  | 泛化 pattern | pattern 签名 + 风险说明 + fix 模板 | `/spec-add coding "..."` |
158
-
159
- **两步模式:** 执行中写入产出文件(临时记录)→ 任务完成后用户通过 next_step_routing 沉淀为永久知识。执行过程中不调用外部 Skill。
160
137
  </context>
161
138
 
162
139
  <self_iteration>
163
- **Quality Gate** auto-evaluate after each analytical stage. Insufficient → re-enter with expanded strategy.
164
-
165
- | Dimension | Sufficient | Insufficient |
166
- |-----------|-----------|-------------|
167
- | Coverage | All known files/modules analyzed | Missed targets discoverable via grep/git log |
168
- | Depth | ≥80% findings have file:line evidence | Most findings lack specifics |
169
- | Actionability | Each conclusion has concrete next action | Only vague "consider" recommendations |
170
-
171
- **Rules:** stage complete → evaluate 3 dims → any insufficient → re-enter (max **3 rounds** per stage). Record to evidence.ndjson `{"phase":"self-iteration","type":"quality-gate","stage":"S_XXX","round":N,"assessment":{...},"expansion":"strategy"}`.
172
-
173
- **Expansion:** Round 1 = broaden scope (more dirs, more delegate angles). Round 2 = shift perspective (different CLI tool, reverse-trace from expected result). Round 3 = combine both + targeted deep-dive on remaining gaps.
174
-
175
- **Applies to:** S_PLAN, S_VERIFY, S_GENERALIZE
140
+ 适用阶段: S_PLAN, S_VERIFY, S_GENERALIZE
176
141
  </self_iteration>
177
142
 
178
143
  <state_machine>
@@ -261,7 +226,6 @@ AskUserQuestion({
261
226
  options: [
262
227
  { label: "Auto (Recommended)", description: "域路由: frontend→{frontendTool}, backend→{backendTool}, general→agent" },
263
228
  { label: "Agent", description: "Claude Code Agent 执行所有任务(最快)" },
264
- // 每个 enabled CLI tool 一个选项
265
229
  ...availableTools.map(t => ({ label: t, description: `${t} CLI 执行所有任务` }))
266
230
  ]
267
231
  },
@@ -302,13 +266,6 @@ Per-task domain routing (when method == "auto"):
302
266
 
303
267
  Resolution: `execution_config.domain_routing[domain]` → fallback `domain_routing.default` ("agent").
304
268
 
305
- Log routing per task:
306
- ```
307
- T1 [frontend] → agy
308
- T2 [backend] → codex
309
- T3 [general] → agent
310
- ```
311
-
312
269
  #### Step 3: Task Execution
313
270
 
314
271
  Execute tasks per plan order. Independent tasks (no cross-dependency) may run in parallel.
@@ -440,50 +397,20 @@ Update understanding.md §4 with pass/fail table.
440
397
 
441
398
  ### A_GENERALIZE
442
399
 
443
- Extract reusable patterns from implementation, scan codebase for similar sites.
444
-
445
- **Pattern extraction (3 layers):**
446
- | Layer | Method | Example |
447
- |-------|--------|---------|
448
- | Syntax | Code regex patterns | validation/error handling patterns |
449
- | Semantic | Logic pattern description | missing similar checks at other entry points |
450
- | Structural | File/module structure match | sibling modules lacking same treatment |
451
-
452
- **4-agent parallel scan** (spawn 4 Agents):
453
- | Agent | Strategy | Scope |
454
- |-------|----------|-------|
455
- | Syntax grep | Grep syntax-layer signatures | full project |
456
- | Semantic scan | Check for same anti-pattern in related modules | related modules |
457
- | Structural match | Find structurally similar files | full project |
458
- | Historical grep | `git log -S "{pattern}"` | full git history |
459
-
460
- Each returns: `[{pattern_id, file, line, context, risk_level, layer, confidence}]`
461
-
462
- **Cross-layer dedup:** multi-layer hit on same file:line → boost confidence. Historical hit with existing fix → `already_handled`. Single layer only → `needs_review`.
463
-
464
- **Quality Gate** (self-iteration) → evaluate coverage/depth/actionability.
465
-
466
- Write understanding.md §6, generalization_stats. Mark G5 done.
400
+ base A_GENERALIZE 执行。Pattern 来源: implementation patterns。Mark G5 done.
467
401
 
468
402
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): GENERALIZE — 泛化扫描"`
469
403
 
470
404
  ### A_DISCOVER
471
405
 
472
- 1. **Triage:** per hit, read context (+-10 lines), classify as `already_handled` | `needs_treatment` | `low_risk`
473
- 2. **Route:**
474
- | Classification | Normal | `-y` |
475
- |---------------|--------|------|
476
- | needs_treatment | AskUserQuestion: create issue / plan next iter | auto create issue, `deferred` |
477
- | low_risk | Record only | Record only |
478
- | already_handled | Skip | Skip |
479
- 3. Append evidence (discovery + decision), update understanding.md §7. Mark G6 done.
406
+ base A_DISCOVER 执行。Mark G6 done.
480
407
 
481
408
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): DISCOVER — 发现分类"`
482
409
 
483
410
  ### A_RECORD
484
411
 
485
412
  1. Finalize understanding.md §8 — iteration summary, what worked, what needed rework
486
- 2. Write learnings to understanding.md §8: 按 Knowledge Persistence 表分类记录(临时),completion summary 列出建议的 `/spec-add` 命令
413
+ 2. Write learnings to understanding.md §8: 按 Knowledge Persistence 表分类记录
487
414
  3. Pending decisions: **Normal** → AskUserQuestion. **`-y`** → display deferred count.
488
415
  4. Goal audit: check all phase_goals[*].completion_confirmed. Mark G7 done.
489
416
  5. Output completion summary:
@@ -501,6 +428,7 @@ Write understanding.md §6, generalization_stats. Mark G5 done.
501
428
  Status: {ALL_PASSED|PARTIAL|ESCALATED}
502
429
  ---
503
430
  ```
431
+ 6. 其余按 base A_RECORD 执行。
504
432
 
505
433
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): RECORD — 会话总结"`
506
434
 
@@ -566,35 +494,23 @@ Max iterations (default 3) prevents infinite loops. Each iteration records crite
566
494
  | Code | Severity | Condition | Recovery |
567
495
  |------|----------|-----------|----------|
568
496
  | E001 | error | No requirement provided | Provide requirement |
569
- | E003 | error | Resume but no session found | Start new |
570
- | E004 | error | Delegate failed | Retry or proceed without |
571
497
  | W001 | warning | No acceptance criteria derived | Manual definition needed |
572
498
  | W002 | warning | Max iterations reached, criteria still failing | Escalate to user |
573
499
  | W003 | warning | CLI review regression concern | Review before next iteration |
574
- | W004 | warning | Delegate parse failed | Use raw output |
575
500
  </error_codes>
576
501
 
577
502
  <success_criteria>
578
- - [ ] Requirement parsed and ≥1 acceptance criterion defined with verify_method
579
- - [ ] Plan created with tasks mapped to criteria
580
- - [ ] Execution options confirmed (executor/review/verify) before task dispatch
581
- - [ ] Tasks dispatched via resolved executor (agent/cli/auto domain routing)
582
- - [ ] Per-task deviation rule enforced (max 3 retries, fallback chain)
503
+ - [ ] Requirement parsed with ≥1 acceptance criterion (verify_method assigned)
504
+ - [ ] Plan tasks mapped to criteria; execution options confirmed
505
+ - [ ] Tasks dispatched via resolved executor with deviation rule (max 3 retries)
583
506
  - [ ] Post-execution validation gate run (unless --skip-verify)
584
- - [ ] Tasks executed with evidence logged (executor, attempt count, files_modified)
585
- - [ ] Every criterion verified by its method after each iteration
586
- - [ ] Failing criteria trigger targeted fix (not full re-implementation)
587
- - [ ] Iteration count tracked, max respected
588
- - [ ] **Every unfixed criterion has individual classification and reason** — blanket "pre-existing" labels are forbidden
589
- - [ ] understanding.md updated per phase (§1-§8)
590
- - [ ] Multi-layer generalization + 4-agent scan (unless --skip-generalize)
591
- - [ ] Discoveries classified and routed (unless --skip-generalize)
592
- - [ ] Quality Gate self-iteration triggered when insufficient, logged in self_iteration_log
593
- - [ ] phase_goals G1-G7 tracked and audited
594
- - [ ] Goal Prompt displayed once after intake
595
- - [ ] `-y` mode: no blocking prompts, deferred counted
596
- - [ ] Session resumable via -c
597
- - [ ] Completion summary with iteration stats
507
+ - [ ] Every criterion verified per method; failing targeted fix (not re-implementation)
508
+ - [ ] Iteration count tracked and max respected; unfixed criteria individually classified
509
+ - [ ] understanding.md §1-§8 updated per phase; phase_goals G1-G7 audited
510
+ - [ ] Generalization + discovery completed (unless --skip-generalize)
511
+ - [ ] Quality Gate self-iteration triggered when insufficient
512
+ - [ ] Goal Prompt displayed once after intake; `-y` mode: no blocking prompts
513
+ - [ ] Session resumable via -c; completion summary output
598
514
  </success_criteria>
599
515
 
600
516
  <next_step_routing>