maestro-flow 0.5.39 → 0.5.41

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 (139) hide show
  1. package/.agents/skills/odyssey-debug/SKILL.md +109 -143
  2. package/.agents/skills/odyssey-improve/SKILL.md +127 -141
  3. package/.agents/skills/odyssey-planex/SKILL.md +140 -231
  4. package/.agents/skills/odyssey-review-test-fix/SKILL.md +136 -90
  5. package/.agents/skills/odyssey-ui/SKILL.md +123 -143
  6. package/.agy/skills/odyssey-debug/SKILL.md +109 -143
  7. package/.agy/skills/odyssey-improve/SKILL.md +127 -141
  8. package/.agy/skills/odyssey-planex/SKILL.md +140 -231
  9. package/.agy/skills/odyssey-review-test-fix/SKILL.md +136 -90
  10. package/.agy/skills/odyssey-ui/SKILL.md +123 -143
  11. package/.claude/commands/odyssey-debug.md +109 -143
  12. package/.claude/commands/odyssey-improve.md +127 -141
  13. package/.claude/commands/odyssey-planex.md +140 -231
  14. package/.claude/commands/odyssey-review-test-fix.md +136 -90
  15. package/.claude/commands/odyssey-ui.md +123 -143
  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 +176 -150
  52. package/.codex/skills/odyssey-improve/SKILL.md +210 -177
  53. package/.codex/skills/odyssey-planex/SKILL.md +162 -242
  54. package/.codex/skills/odyssey-review-test-fix/SKILL.md +96 -90
  55. package/.codex/skills/odyssey-ui/SKILL.md +211 -179
  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/src/commands/install-backend.js +19 -0
  71. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  72. package/dashboard/dist-server/src/core/manifest.d.ts +5 -0
  73. package/dashboard/dist-server/src/core/manifest.js.map +1 -1
  74. package/dashboard/dist-server/src/core/plugin-bridge.d.ts +59 -0
  75. package/dashboard/dist-server/src/core/plugin-bridge.js +355 -0
  76. package/dashboard/dist-server/src/core/plugin-bridge.js.map +1 -0
  77. package/dashboard/dist-server/src/tools/spec-loader.js +27 -19
  78. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  79. package/dashboard/dist-server/src/tools/spec-seeds.d.ts +8 -0
  80. package/dashboard/dist-server/src/tools/spec-seeds.js +114 -0
  81. package/dashboard/dist-server/src/tools/spec-seeds.js.map +1 -1
  82. package/dist/src/cli.js +19 -1
  83. package/dist/src/cli.js.map +1 -1
  84. package/dist/src/commands/install-backend.d.ts.map +1 -1
  85. package/dist/src/commands/install-backend.js +19 -0
  86. package/dist/src/commands/install-backend.js.map +1 -1
  87. package/dist/src/commands/install.d.ts.map +1 -1
  88. package/dist/src/commands/install.js +17 -1
  89. package/dist/src/commands/install.js.map +1 -1
  90. package/dist/src/commands/plugin.d.ts +3 -0
  91. package/dist/src/commands/plugin.d.ts.map +1 -0
  92. package/dist/src/commands/plugin.js +137 -0
  93. package/dist/src/commands/plugin.js.map +1 -0
  94. package/dist/src/commands/spec.d.ts.map +1 -1
  95. package/dist/src/commands/spec.js +13 -3
  96. package/dist/src/commands/spec.js.map +1 -1
  97. package/dist/src/commands/update.d.ts.map +1 -1
  98. package/dist/src/commands/update.js +23 -0
  99. package/dist/src/commands/update.js.map +1 -1
  100. package/dist/src/core/install-executor.d.ts +1 -1
  101. package/dist/src/core/install-executor.d.ts.map +1 -1
  102. package/dist/src/core/install-executor.js +27 -0
  103. package/dist/src/core/install-executor.js.map +1 -1
  104. package/dist/src/core/install-profile.d.ts +5 -0
  105. package/dist/src/core/install-profile.d.ts.map +1 -1
  106. package/dist/src/core/install-profile.js +8 -0
  107. package/dist/src/core/install-profile.js.map +1 -1
  108. package/dist/src/core/manifest.d.ts +5 -0
  109. package/dist/src/core/manifest.d.ts.map +1 -1
  110. package/dist/src/core/manifest.js.map +1 -1
  111. package/dist/src/core/plugin-bridge.d.ts +60 -0
  112. package/dist/src/core/plugin-bridge.d.ts.map +1 -0
  113. package/dist/src/core/plugin-bridge.js +355 -0
  114. package/dist/src/core/plugin-bridge.js.map +1 -0
  115. package/dist/src/tools/spec-init.d.ts +4 -3
  116. package/dist/src/tools/spec-init.d.ts.map +1 -1
  117. package/dist/src/tools/spec-init.js +9 -5
  118. package/dist/src/tools/spec-init.js.map +1 -1
  119. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  120. package/dist/src/tools/spec-loader.js +27 -19
  121. package/dist/src/tools/spec-loader.js.map +1 -1
  122. package/dist/src/tools/spec-seeds.d.ts +8 -0
  123. package/dist/src/tools/spec-seeds.d.ts.map +1 -1
  124. package/dist/src/tools/spec-seeds.js +114 -0
  125. package/dist/src/tools/spec-seeds.js.map +1 -1
  126. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  127. package/dist/src/tui/install-ui/InstallFlow.js +43 -14
  128. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  129. package/dist/src/tui/install-ui/types.d.ts +2 -0
  130. package/dist/src/tui/install-ui/types.d.ts.map +1 -1
  131. package/dist/src/tui/install-ui/types.js.map +1 -1
  132. package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
  133. package/dist/src/tui/install-ui/useInstallFlowState.js +13 -1
  134. package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
  135. package/dist/src/utils/update-notices.js +11 -0
  136. package/dist/src/utils/update-notices.js.map +1 -1
  137. package/package.json +1 -1
  138. package/workflows/odyssey-base-codex.md +306 -0
  139. package/workflows/shell-exec-protocol.md +30 -0
@@ -17,19 +17,19 @@ allowed-tools:
17
17
  <base>@~/.maestro/workflows/odyssey-base.md</base>
18
18
 
19
19
  <purpose>
20
- Deep codebase improvement: survey → 6-dimension audit → diagnose → fix → verify → generalize → discover → persist.
21
- Baseline-first approach with exhaustive iteration until zero remaining actionable findings.
20
+ survey → 6-dimension audit → diagnose → fix → verify → generalize → discover → persist.
21
+ Exhaustive iteration until zero remaining actionable findings.
22
22
  </purpose>
23
23
 
24
24
  <boundary>
25
- **范围内:** 目标代码的运行质量提升性能/安全/架构/可靠性/可观测性/可维护性多维度审查诊断修复泛化
26
- **范围外:** UI 视觉优化 → `/odyssey-ui` | 新功能实现 → `/odyssey-planex` | 单一 bug 调查 → `/odyssey-debug` | 代码风格审查 → `/odyssey-review-test-fix`
27
- **探索自由度:** 边界内自由探索 profiling、安全扫描、架构分析、依赖审计。在约束下尽可能发现深层问题。
28
- **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
+ **In scope:** Runtime quality improvement performance/security/architecture/reliability/observability/maintainability audit diagnosefixgeneralize.
26
+ **Out of scope:** UI visual → `/odyssey-ui` | New features → `/odyssey-planex` | Single bug → `/odyssey-debug` | Style review → `/odyssey-review-test-fix`
27
+ **Exploration freedom:** Free exploration within boundary profiling, security scanning, architecture analysis, dependency audit.
28
+ **Zero-residual:** 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.
29
29
  </boundary>
30
30
 
31
31
  <context>
32
- $ARGUMENTS — target and optional flags.
32
+ $ARGUMENTS
33
33
 
34
34
  **Target resolution:**
35
35
  | Input | Resolution |
@@ -39,17 +39,7 @@ $ARGUMENTS — target and optional flags.
39
39
  | Feature area keyword | Resolve to related files |
40
40
  | `--all` | Full project scan (use with caution) |
41
41
 
42
- **Flags:**
43
- | Flag | Effect | Default |
44
- |------|--------|---------|
45
- | `--dimensions <list>` | Comma-separated subset of 6 dimensions | all 6 |
46
- | `--fix-threshold <severity>` | 修复到哪个 severity 为止(all = 全部修复)| all |
47
- | `--skip-fix` | Audit + diagnose only, no code changes | false |
48
- | `--skip-generalize` | Skip S_GENERALIZE and S_DISCOVER | false |
49
- | `--auto` | CLI delegates without confirmation | false |
50
- | `-y` | Auto-confirm all decisions (see appendix) | false |
51
- | `-c` | Resume most recent session | — |
52
- | `--heartbeat` | Enable /loop heartbeat protocol (see base) | false |
42
+ **Flags:** `--dimensions <list>` dimension subset | `--fix-threshold <severity>` fix cutoff (default: all) | `--skip-fix` audit+diagnose only | `--skip-generalize` skip S_GENERALIZE+S_DISCOVER | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
53
43
 
54
44
  **Dimensions (6):**
55
45
  1. **performance** — hot paths, N+1 queries, memory allocation, cache efficiency, bundle size, lazy loading
@@ -59,13 +49,17 @@ $ARGUMENTS — target and optional flags.
59
49
  5. **observability** — logging coverage, metric gaps, trace propagation, error reporting, health checks
60
50
  6. **maintainability** — code complexity (cyclomatic), dead code, test coverage gaps, documentation debt
61
51
 
62
- **Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-improve-odyssey-{slug}/`
52
+ **Session**: `.workflow/scratch/{YYYYMMDD}-improve-odyssey-{slug}/`
53
+ **Output**: `session.json` | `evidence.ndjson` | `understanding.md`
63
54
 
64
- **Output:** `session.json` (state + audit + diagnoses + patterns + goals) | `evidence.ndjson` (append-only) | `understanding.md` (9-section narrative)
55
+ **session.json improve-specific fields:**
56
+ ```json
57
+ { "target": "", "dimensions": [], "baseline_metrics": {},
58
+ "audit_result": {}, "diagnoses": [], "confirmation": null,
59
+ "generalization_stats": null }
60
+ ```
65
61
 
66
- **session.json unique fields:** `target`, `dimensions`, `baseline_metrics`, `audit_result`, `diagnoses`, `confirmation`, `generalization_stats` (`progress_metrics`, `directions_tried` from base)
67
-
68
- **evidence.ndjson phase-specific fields:**
62
+ **evidence.ndjson phases:** `survey|audit|diagnosis|fix|discovery|decision|self-iteration`
69
63
  - `survey`: `category` (dependency|complexity|coverage|error_pattern), `detail`
70
64
  - `audit`: `dimension`, `severity`, `measurement`
71
65
  - `diagnosis`: `finding_ref`, `hypothesis`, `result` (confirmed|disproved|inconclusive), `root_cause`
@@ -75,92 +69,79 @@ $ARGUMENTS — target and optional flags.
75
69
  - `self-iteration`: `stage`, `round`, `assessment`, `expansion`
76
70
 
77
71
  **phase_goals[]:**
72
+
78
73
  | ID | Goal | Phase | skip_when |
79
74
  |----|------|-------|-----------|
80
75
  | G1 | Survey completed | S_SURVEY | — |
81
76
  | G2 | Audit completed | S_AUDIT | — |
82
77
  | G3 | Diagnosis completed | S_DIAGNOSE | — |
83
- | G4 | Zero remaining: all findings fixed and verified | `remaining_actionable == 0` within fix_threshold | S_VERIFY | skip_fix |
78
+ | G4 | Zero remaining: all findings fixed and verified | S_VERIFY | skip_fix |
84
79
  | G5 | Pattern generalized | S_GENERALIZE | skip_generalize |
85
80
  | G6 | Discoveries triaged | S_DISCOVER | skip_generalize |
86
81
  | G7 | Learnings persisted | S_RECORD | — |
87
82
 
88
- **understanding.md — 9 sections (written by owning phase):**
83
+ **understanding.md — 9 sections:**
89
84
  1. Target & Baseline ← S_INTAKE | 2. Current State Survey ← S_SURVEY | 3. Audit Findings ← S_AUDIT
90
85
  4. Root Cause Diagnosis ← S_DIAGNOSE | 5. Fix & Verification ← S_FIX+S_VERIFY
91
86
  6. Generalization ← S_GENERALIZE | 7. Discoveries ← S_DISCOVER
92
87
  8. Improvement Metrics ← S_RECORD (before/after) | 9. Engineering Learnings ← S_RECORD
93
88
 
94
- ### Pre-load(可选,缺失不阻塞)
95
- - ARCHITECTURE.md → 模块边界 | `maestro search "<target>" --json` → 先前优化(top 5)
96
- - `maestro load --type spec --category coding` + `--category debug` → 编码规范 + 已知模式
97
- - `maestro search --category coding` → knowhow | `find_files(".workflow/scratch/*-improve-odyssey-*")` → 先前会话
98
-
99
- ### Knowledge Persistence(S_RECORD 中写入产出文件)
89
+ **Knowledge Persistence categories (§9):**
100
90
 
101
- S_RECORD 阶段将可沉淀知识 **写入 understanding.md §9 Learnings**,按以下分类结构化:
102
-
103
- | 分类 | 写入内容 | 后续建议命令 |
104
- |------|---------|-------------|
105
- | 性能 pattern | 瓶颈类型 + 修复方案 + 度量方法 | `/spec-add coding "..."` |
106
- | 安全规则 | 漏洞类别 + 修复 + 预防方法 | `/spec-add debug "..."` |
107
- | 架构约束 | 违反描述 + 正确边界 + 检查方法 | `/spec-add arch "..."` |
108
- | 可靠性 pattern | 故障模式 + 处理策略 + 验证手段 | `/spec-add coding "..."` |
91
+ | Category | Content | Follow-up |
92
+ |----------|---------|-----------|
93
+ | Performance pattern | Bottleneck type + fix approach + measurement method | `/spec-add coding` |
94
+ | Security rule | Vulnerability class + fix + prevention method | `/spec-add debug` |
95
+ | Architecture constraint | Violation description + correct boundary + check method | `/spec-add arch` |
96
+ | Reliability pattern | Failure mode + handling strategy + verification method | `/spec-add coding` |
109
97
  </context>
110
98
 
111
- Self-iteration 适用阶段: S_SURVEY, S_AUDIT, S_DIAGNOSE, S_GENERALIZE
99
+ <invariants>
100
+ All invariants (evidence append-only, session-as-state, phase goal tracking, auto-commit, zero-residual) defined in base.
101
+ </invariants>
102
+
103
+ <self_iteration>
104
+ Applies to: **S_SURVEY, S_AUDIT, S_DIAGNOSE, S_GENERALIZE**. Logic in base.
105
+ </self_iteration>
112
106
 
113
107
  <state_machine>
114
108
 
115
109
  <states>
116
- S_INTAKE Parse target, load context, establish baseline metrics PERSIST: session.json + understanding.md §1
117
- S_SURVEY — Current state: dependency audit, complexity scan, coverage PERSIST: evidence.ndjson (survey) + understanding.md §2
118
- S_AUDIT — 6-dimension parallel deep audit PERSIST: evidence.ndjson (audit) + understanding.md §3
119
- S_DIAGNOSE — Root cause analysis for critical/high findings PERSIST: evidence.ndjson (diagnosis|decision) + understanding.md §4
120
- S_FIX — Implement improvements (skip if --skip-fix) PERSIST: code changes + evidence.ndjson (fix)
121
- S_VERIFY — Tests + measurement comparison (skip if --skip-fix) PERSIST: session.json.confirmation + understanding.md §5
122
- S_GENERALIZE — Pattern extraction + 4-agent scan (skip if --skip-gen) PERSIST: session.json.patterns + understanding.md §6
123
- S_DISCOVER — Classify hits, create issues (skip if --skip-gen) PERSIST: evidence.ndjson (discovery|decision) + understanding.md §7
124
- S_RECORD — Persist metrics + learnings + final report PERSIST: understanding.md §8-9 + spec entries
110
+ S_INTAKE S_SURVEY S_AUDIT S_DIAGNOSE S_FIX S_VERIFY → S_GENERALIZE → S_DISCOVER → S_RECORD → END
125
111
  </states>
126
112
 
127
113
  <transitions>
128
- S_INTAKE:
129
- S_INTAKE WHEN -c + session found DO A_RESUME
130
- S_SURVEY WHEN target resolved DO A_INTAKE
131
- → S_INTAKE WHEN no target DO ask_user
114
+ S_INTAKE → S_INTAKE : -c + session found → A_RESUME
115
+ S_INTAKE S_SURVEY : target resolved A_INTAKE
116
+ S_INTAKE S_INTAKE : no target ask_user
132
117
 
133
- S_SURVEY → S_AUDIT DO A_SURVEY
118
+ S_SURVEY → S_AUDIT : complete
134
119
 
135
- S_AUDIT:
136
- S_DIAGNOSE WHEN critical/high findings exist DO A_AUDIT
137
- S_GENERALIZE WHEN no critical/high AND !skip_gen DO A_AUDIT
138
- → S_RECORD WHEN no findings OR skip_gen DO A_AUDIT
120
+ S_AUDIT → S_DIAGNOSE : critical/high findings exist
121
+ S_AUDIT S_GENERALIZE : no critical/high, !skip_generalize
122
+ S_AUDIT S_RECORD : no findings OR skip_generalize
139
123
 
140
- S_DIAGNOSE:
141
- S_FIX WHEN root causes identified AND !skip_fix DO A_DIAGNOSE
142
- S_GENERALIZE WHEN root causes identified AND skip_fix AND !skip_gen DO A_DIAGNOSE
143
- S_RECORD WHEN root causes identified AND skip_fix AND skip_gen DO A_DIAGNOSE
144
- S_DIAGNOSE WHEN hypotheses failed AND retries < 3 DO A_ESCALATE_DIAGNOSIS
145
- → S_RECORD WHEN hypotheses failed AND retries >= 3 DO mark INCONCLUSIVE
124
+ S_DIAGNOSE → S_FIX : root causes identified, !skip_fix
125
+ S_DIAGNOSE S_GENERALIZE : root causes identified, skip_fix, !skip_generalize
126
+ S_DIAGNOSE S_RECORD : root causes identified, skip_fix, skip_generalize
127
+ S_DIAGNOSE S_DIAGNOSE : hypotheses failed, retries < 3 A_ESCALATE_DIAGNOSIS
128
+ S_DIAGNOSE S_RECORD : retries >= 3 → INCONCLUSIVE
146
129
 
147
- S_FIX → S_VERIFY DO A_FIX
130
+ S_FIX → S_VERIFY : fix implemented
148
131
 
149
- S_VERIFY:
150
- S_GENERALIZE WHEN verified AND !skip_gen DO A_VERIFY
151
- S_RECORD WHEN verified AND skip_gen DO A_VERIFY
152
- → S_FIX WHEN needs_rework DO A_VERIFY
132
+ S_VERIFY → S_GENERALIZE : verified, !skip_generalize
133
+ S_VERIFY S_RECORD : verified, skip_generalize
134
+ S_VERIFY S_FIX : needs_rework
153
135
 
154
- S_GENERALIZE:
155
- S_DISCOVER WHEN hits found DO A_GENERALIZE
156
- → S_RECORD WHEN no hits DO A_GENERALIZE
136
+ S_GENERALIZE → S_DISCOVER : hits found
137
+ S_GENERALIZE S_RECORD : no hits
157
138
 
158
- S_DISCOVER → S_DIAGNOSE : new critical issue found → cross_phase_loops++
139
+ S_DISCOVER → S_DIAGNOSE : new critical issue → cross_phase_loops++
159
140
  S_DISCOVER → S_FIX : same-pattern fix, !skip_fix → cross_phase_loops++
160
- S_DISCOVER → S_RECORD : triage complete AND remaining_actionable == 0
161
- S_DISCOVER → S_RECORD : loops >= max_loops → MUST log each unfixed item with specific reason (blanket "pre-existing" is forbidden)
141
+ S_DISCOVER → S_RECORD : remaining_actionable == 0
142
+ S_DISCOVER → S_RECORD : loops >= max_loops → MUST log per-item reasons
162
143
 
163
- S_RECORD → END DO A_RECORD
144
+ S_RECORD → END : complete
164
145
  </transitions>
165
146
 
166
147
  <actions>
@@ -170,108 +151,111 @@ S_RECORD → END DO A_RECORD
170
151
  2. Generate slug, create `SESSION_DIR`
171
152
  3. Search: `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + spec load coding/debug
172
153
  4. **Baseline capture**: Record current metrics (test pass rate, bundle size, dependency count, complexity hotspots) to `session.json.baseline_metrics`
173
- 5. Derive `phase_goals[]` from flags (apply `skip_when`)
174
- 6. Write `session.json` + `understanding.md` §1 (Target & Baseline)
175
- 7. Emit Goal Prompt (see Appendix)
154
+ 5. Derive `phase_goals[]` from flags
155
+ 6. Write `session.json` + `understanding.md` §1, emit Goal Prompt
176
156
 
177
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): INTAKE — 目标解析与基线采集"`
157
+ Commit: `"odyssey-improve({slug}): INTAKE — parse target and capture baseline"`
178
158
 
179
159
  ### A_RESUME
180
- Find latest session via Glob → read `session.json` → display summary → jump to `current_state`.
160
+ Glob latest session → read `session.json` → display summary → jump to `current_state`.
181
161
 
182
162
  ### A_SURVEY
183
163
  Current state survey — understand what exists before proposing changes.
184
164
 
185
165
  1. Dependency audit (package.json/lock), complexity scan (size/nesting), test coverage map, error handling scan (empty catch, unhandled promise)
186
- 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`.
187
- 3. Append evidence.ndjson (phase: "survey"). Update `understanding.md` §2. Mark G1 done.
166
+ 2. **CLI-assisted** (optional): `maestro delegate --role analyze --mode analysis` for dependency health, complexity hotspots, coverage gaps, error patterns. Execute `run_in_background: true`.
167
+ 3. Evidence phase=survey. Update §2. Mark G1.
188
168
 
189
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): SURVEY — 现状调查"`
169
+ Commit: `"odyssey-improve({slug}): SURVEY — current state analysis"`
190
170
 
191
171
  ### A_AUDIT
192
- Spawn 6 parallel Agents (one per dimension from Dimensions list above, or `--dimensions` subset).
172
+ Spawn 6 parallel Agents (one per dimension, or `--dimensions` subset).
193
173
  Each returns: `[{title, severity, dimension, file, line, description, suggestion, measurement}]`
194
174
 
195
- Merge → evidence.ndjson (phase: "audit"). Write `session.json.audit_result`.
196
- Update `understanding.md` §3 (findings by dimension + severity matrix). Mark G2 done.
175
+ Merge → evidence phase=audit. Write `session.json.audit_result`.
176
+ Update §3 (findings by dimension + severity matrix). Mark G2.
197
177
 
198
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): AUDIT — 多维审查"`
178
+ Commit: `"odyssey-improve({slug}): AUDIT — multi-dimension review"`
199
179
 
200
180
  ### A_DIAGNOSE
201
181
  Root cause analysis for critical/high findings — don't fix symptoms.
202
182
 
203
- 1. Group by dimension, prioritize by severity. For each: hypothesis → trace code path + git history → evidence.ndjson (phase: "diagnosis")
204
- 2. **Decision journal**: ambiguity → evidence (phase: "decision"); Normal: ask_user | `-y`: defer
205
- 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`.
206
- 4. Write `session.json.diagnoses[]`. Update `understanding.md` §4. Mark G3 done.
183
+ 1. Group by dimension, prioritize by severity. For each: hypothesis → trace code path + git history → evidence phase=diagnosis
184
+ 2. Ambiguity → evidence phase=decision; Normal: ask_user | `-y`: defer
185
+ 3. CLI-assisted for complex findings: `maestro delegate --role analyze --mode analysis` (`run_in_background: true`)
186
+ 4. Write `session.json.diagnoses[]`. Update §4. Mark G3.
207
187
 
208
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): DIAGNOSE — 根因诊断"`
188
+ Commit: `"odyssey-improve({slug}): DIAGNOSE — root cause analysis"`
209
189
 
210
190
  ### A_ESCALATE_DIAGNOSIS
211
- Increment retries. If < 3: broaden scope via `maestro delegate --role analyze`, form new hypotheses, return to S_DIAGNOSE. If >= 3: Normal → ask_user (broaden/new/INCONCLUSIVE) | `-y` → auto INCONCLUSIVE, proceed to S_RECORD.
191
+ `retries++`. < 3: `maestro delegate --role analyze`, new hypotheses, S_DIAGNOSE. >= 3: Normal → ask_user | `-y` → INCONCLUSIVE S_RECORD.
212
192
 
213
193
  ### A_FIX
214
- Skip if `--skip-fix`. Implement improvements for diagnosed root causes.
194
+ 1. Exhaustive fix: ALL diagnosed issues by severity tier (critical → high → medium → low within fix_threshold), one dimension at a time. After each tier, re-verify — new findings append to current tier.
195
+ 2. For each fix: implement → evidence phase=fix
196
+ 3. Normal: ask_user per-fix confirmation | `-y`: auto-proceed, record `deferred`
215
197
 
216
- 1. **穷尽修复**: Fix ALL diagnosed issues by severity tier (critical → high → medium → low within fix_threshold), one dimension at a time. After each tier, re-verify modified area new findings append to current tier.
217
- 2. For each fix: implement → record evidence.ndjson (phase: "fix")
218
- 3. **Normal**: ask_user per-fix confirmation. **`-y`**: auto-proceed, record `deferred`.
219
-
220
- 📌 **Auto-commit**: `git add -A && git commit -m "odyssey-improve({slug}): FIX — 改进实现"`
198
+ Commit: `"odyssey-improve({slug}): FIXimprovements applied"`
221
199
 
222
200
  ### A_VERIFY
223
201
  1. Run tests covering modified areas
224
202
  2. Re-capture metrics, compare with `session.json.baseline_metrics`
225
- 3. **CLI-assisted**: `maestro delegate --role review --mode analysis` to check fix correctness, test regressions, measure impact vs baseline. Execute `run_in_background: true`.
226
- 4. `needs_rework` → S_FIX. `verified` → mark G4 done, advance.
227
- 5. Write `session.json.confirmation`. Update `understanding.md` §5 (before/after metrics table).
228
-
229
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): VERIFY — 改进验证"`
230
-
231
- ### A_GENERALIZE
232
- base A_GENERALIZE 执行。Pattern 来源: diagnoses + fixes。Mark G5 done.
233
-
234
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): GENERALIZE 泛化扫描"`
235
-
236
- ### A_DISCOVER
237
- 按 base A_DISCOVER 执行。Mark G6 done.
238
-
239
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): DISCOVER — 发现分类"`
240
-
241
- ### A_RECORD
242
- 1. **understanding.md §8**: Improvement metrics — before/after comparison table from baseline_metrics vs current
243
- 2. **understanding.md §9**: Engineering learnings — 按 Knowledge Persistence 表分类记录(临时),completion summary 列出建议的 `/spec-add` 命令
244
- 3. Mark G7 done. Pending decisions: **Normal** ask_user. **`-y`** → skip, show deferred count.
245
- 4. 其余按 base A_RECORD 执行。
246
- 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).
247
-
248
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): RECORD — 指标总结与知识沉淀"`
203
+ 3. CLI-assisted: `maestro delegate --role review --mode analysis` (`run_in_background: true`)
204
+ 4. `needs_rework` → S_FIX. `verified` → mark G4, advance.
205
+ 5. Write `session.json.confirmation`. Update §5 (before/after metrics table).
206
+
207
+ Commit: `"odyssey-improve({slug}): VERIFY — improvements verified"`
208
+
209
+ ### A_GENERALIZE, A_DISCOVER, A_RECORD
210
+ Base shared_actions. Improve overrides:
211
+ - **A_GENERALIZE** pattern source: diagnoses + fixes
212
+ - **A_RECORD** §8: improvement metrics (before/after comparison from baseline_metrics vs current). §9: learnings per Knowledge Persistence table. Completion summary lists suggested `/spec-add` commands.
213
+
214
+ **Completion summary:**
215
+ ```
216
+ --- IMPROVE ODYSSEY COMPLETE ---
217
+ Target: {target}
218
+ Dimensions: {dimensions}
219
+ Findings: {critical}C / {high}H / {medium}M / {low}L
220
+ Diagnosed: {count}
221
+ Fixed: {count} ({verified} verified)
222
+ Metrics: {improved} improved / {regressed} regressed
223
+ Patterns: {count} ({by_layer})
224
+ Scan hits: {total} ({cross_layer_confirmed} confirmed)
225
+ Issues: {N} created
226
+ Decisions: {N} resolved, {M} pending, {K} deferred
227
+ Learnings: {N} persisted
228
+ Self-iter: {N} rounds across {M} stages
229
+ Cross-loops: {N}
230
+ Goals: {done}/{total} ({skipped} skipped)
231
+ ---
232
+ ```
249
233
 
250
234
  </actions>
251
235
 
252
236
  <appendix>
253
237
 
254
- ### Goal Prompt Template
255
- **⚠️ 仅在 A_INTAKE 完成后显示一次,A_RECORD 完成时不重复。**
256
-
257
- 列出所有非 skipped 的 phase_goals,附加收敛规则:
258
- - 穷尽迭代至所有 findings 已处理(fix/issue/decision)且 `phase_goals_all_done=true`
259
- - 修复按 severity 逐轮迭代,每轮 re-verify
260
- - Baseline 修复前采集,修复后对比确认改进
261
- - pending decision 必须 ask_user,不允许"只报告不处理"
238
+ ### `-y` improve-specific points
262
239
 
263
- ### `-y` Auto-Confirm Behavior
264
240
  | Decision Point | Normal | `-y` |
265
241
  |---------------|--------|------|
266
242
  | A_FIX improvement confirmation | ask_user | auto-proceed, `deferred` |
267
243
  | A_DIAGNOSE ambiguity | ask_user | best-effort, `deferred` |
268
244
  | A_ESCALATE 3-strike | ask_user 3-way | auto INCONCLUSIVE |
269
- | A_DISCOVER hit routing | ask_user | auto create issue, `deferred` |
245
+ | A_DISCOVER hit routing | ask_user | auto create issue |
270
246
  | A_DISCOVER ambiguous items | ask_user | all `deferred` |
271
- | A_RECORD pending decisions | ask_user | skip, show deferred count |
272
- | A_RECORD goal audit | ask_user | auto accept |
273
247
 
274
- `deferred` items shown as "待决策" in completion summary; recoverable via `-c`.
248
+ `deferred` items shown in completion summary; recoverable via `-c`.
249
+
250
+ ### Goal Prompt convergence rules
251
+
252
+ ```
253
+ Exhaust iteration until all findings actioned (fix/issue/decision)
254
+ and phase_goals_all_done=true.
255
+ Fix by severity tiers, re-verify after each tier.
256
+ Baseline captured before fix, compared after to confirm improvement.
257
+ Pending decisions must ask_user — no silent resolve.
258
+ ```
275
259
 
276
260
  </appendix>
277
261
 
@@ -296,16 +280,18 @@ Skip if `--skip-fix`. Implement improvements for diagnosed root causes.
296
280
  - [ ] understanding.md §8 (metrics) and §9 (learnings) completed
297
281
  - [ ] phase_goals G1-G7 tracked and audited
298
282
  - [ ] Session resumable via -c
283
+ - [ ] Completion summary
299
284
  </success_criteria>
300
285
 
301
286
  <next_step_routing>
302
- | Condition | Next step |
303
- |-----------|-----------|
287
+ | Condition | Next |
288
+ |-----------|------|
304
289
  | Security findings need deep investigation | `/odyssey-debug "<finding>"` |
305
290
  | UI-related findings | `/odyssey-ui "<component>"` |
306
291
  | Issues created from discoveries | `/manage-issue list --source improve-odyssey` |
307
292
  | Architecture pattern to document | `/spec-add arch "..."` |
308
293
  | Performance pattern to persist | `/spec-add coding "..."` |
309
- | Want formal review of changes | `/odyssey-review-test-fix <changed-files>` |
310
- | Decisions still pending | Filter evidence.ndjson phase=decision status=pending |
294
+ | Formal review of changes | `/odyssey-review-test-fix <changed-files>` |
295
+ | Pending decisions | Filter evidence phase=decision status=pending |
311
296
  </next_step_routing>
297
+ </output>