maestro-flow 0.5.38 → 0.5.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/odyssey-debug/SKILL.md +90 -269
- package/.agents/skills/odyssey-improve/SKILL.md +39 -240
- package/.agents/skills/odyssey-planex/SKILL.md +21 -105
- package/.agents/skills/odyssey-review-test-fix/SKILL.md +98 -318
- package/.agents/skills/odyssey-ui/SKILL.md +82 -265
- package/.agy/skills/odyssey-debug/SKILL.md +90 -269
- package/.agy/skills/odyssey-improve/SKILL.md +39 -240
- package/.agy/skills/odyssey-planex/SKILL.md +21 -105
- package/.agy/skills/odyssey-review-test-fix/SKILL.md +98 -318
- package/.agy/skills/odyssey-ui/SKILL.md +82 -265
- package/.claude/commands/odyssey-debug.md +90 -269
- package/.claude/commands/odyssey-improve.md +39 -240
- package/.claude/commands/odyssey-planex.md +21 -105
- package/.claude/commands/odyssey-review-test-fix.md +98 -318
- package/.claude/commands/odyssey-ui.md +82 -265
- package/.codex/skills/odyssey-debug/SKILL.md +167 -338
- package/.codex/skills/odyssey-improve/SKILL.md +226 -395
- package/.codex/skills/odyssey-planex/SKILL.md +317 -159
- package/.codex/skills/odyssey-review-test-fix/SKILL.md +137 -255
- package/.codex/skills/odyssey-ui/SKILL.md +197 -338
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +23 -2
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +242 -26
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +92 -29
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/src/commands/hooks.d.ts +2 -1
- package/dashboard/dist-server/src/commands/hooks.js +16 -9
- package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
- package/dashboard/dist-server/src/hooks/kg-sync-hook.js +5 -0
- package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
- package/dashboard/dist-server/src/hooks/session-context.js +276 -3
- package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
- package/dashboard/dist-server/src/search/daemon-client.d.ts +8 -3
- package/dashboard/dist-server/src/search/daemon-client.js +20 -0
- package/dashboard/dist-server/src/search/daemon-client.js.map +1 -1
- package/dist/src/commands/domain.d.ts.map +1 -1
- package/dist/src/commands/domain.js +12 -3
- package/dist/src/commands/domain.js.map +1 -1
- package/dist/src/commands/hooks.d.ts +2 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +16 -9
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/install.js +33 -2
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/search.d.ts.map +1 -1
- package/dist/src/commands/search.js +59 -6
- package/dist/src/commands/search.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +15 -0
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/hooks/kg-sync-hook.d.ts.map +1 -1
- package/dist/src/hooks/kg-sync-hook.js +5 -0
- package/dist/src/hooks/kg-sync-hook.js.map +1 -1
- package/dist/src/hooks/session-context.d.ts.map +1 -1
- package/dist/src/hooks/session-context.js +276 -3
- package/dist/src/hooks/session-context.js.map +1 -1
- package/dist/src/search/daemon-client.d.ts +8 -3
- package/dist/src/search/daemon-client.d.ts.map +1 -1
- package/dist/src/search/daemon-client.js +20 -0
- package/dist/src/search/daemon-client.js.map +1 -1
- package/dist/src/search/daemon.d.ts +3 -3
- package/dist/src/search/daemon.d.ts.map +1 -1
- package/dist/src/search/daemon.js +9 -3
- package/dist/src/search/daemon.js.map +1 -1
- package/package.json +1 -1
- package/workflows/odyssey-base.md +258 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Odyssey 共享基座
|
|
2
|
+
|
|
3
|
+
所有 Odyssey 命令(debug, improve, planex, review-test-fix, ui)共享此基座。
|
|
4
|
+
|
|
5
|
+
<execution_discipline>
|
|
6
|
+
**四条铁律:**
|
|
7
|
+
|
|
8
|
+
1. **Phase auto-commit** — 每个阶段完成后自动 `git commit`,无需用户确认
|
|
9
|
+
- 代码变更 + understanding.md → `git add` → `git commit -m "{command}({slug}): {phase} — {摘要}"`
|
|
10
|
+
- session.json / evidence.ndjson 为运行时状态,不纳入 commit
|
|
11
|
+
|
|
12
|
+
2. **Confident edits only, but must attempt** — 有把握才改代码;仅在真正需要人类判断时记录 decision
|
|
13
|
+
- Confident → edit + commit
|
|
14
|
+
- Needs decision → `evidence.ndjson {"phase":"decision","status":"pending"}`,不动代码
|
|
15
|
+
- ⚠️ **Decision gate** — 仅以下情形算 decision:跨模块架构权衡需人类方向 | 业务语义歧义修复可能改变意图 | 需引入新依赖或 breaking API
|
|
16
|
+
- ❌ "不确定怎么修"、"范围太大"、"历史遗留" 不是合法 decision 理由
|
|
17
|
+
|
|
18
|
+
3. **多 CLI 辅助** — `maestro delegate` 多角度交叉验证
|
|
19
|
+
- 不同阶段用不同 `--role`(analyze / review / explore)
|
|
20
|
+
- 所有 delegate 调用 `run_in_background: true`,等回调继续
|
|
21
|
+
|
|
22
|
+
4. **禁止以上下文消耗为由中断** — harness 自动 context compression;以"上下文不足"或"已执行 N 阶段"为由中断属纪律违反,必须完整走到 S_RECORD → END
|
|
23
|
+
|
|
24
|
+
**Zero-residual:** 每个发现必须有 action(fix / issue / decision)。"仅报告"和"历史遗留跳过"均禁止。
|
|
25
|
+
</execution_discipline>
|
|
26
|
+
|
|
27
|
+
<shared_schemas>
|
|
28
|
+
|
|
29
|
+
### session.json 标准字段(所有命令共有)
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"session_id": "{type}-odyssey-{YYYYMMDD-HHmmss}",
|
|
34
|
+
"current_state": "S_INTAKE",
|
|
35
|
+
"flags": { "skip_fix": false, "skip_generalize": false, "auto": false, "auto_confirm": false },
|
|
36
|
+
"phase_goals": [], "phase_goals_all_done": false,
|
|
37
|
+
"self_iteration_log": [],
|
|
38
|
+
"cross_phase_loops": 0, "max_loops": 5,
|
|
39
|
+
"created_at": "", "updated_at": ""
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
各命令在此基础上添加特有字段(如 `issue`, `target`, `requirement` 等)。
|
|
44
|
+
|
|
45
|
+
### evidence.ndjson 基础 schema(每行共有字段)
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{"ts":"","phase":"","type":"","source":"","content":"","note":""}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
各命令定义 phase-specific 扩展字段(如 `hypothesis`, `severity`, `dimension` 等)。
|
|
52
|
+
|
|
53
|
+
### generalization_stats schema
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"patterns_extracted": 0, "total_hits": 0,
|
|
58
|
+
"cross_layer_confirmed": 0, "regression_risks": 0,
|
|
59
|
+
"by_layer": {"syntax": 0, "semantic": 0, "structural": 0},
|
|
60
|
+
"deepening_triggered": false
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
</shared_schemas>
|
|
65
|
+
|
|
66
|
+
<anti_stall>
|
|
67
|
+
**防停滞机制**
|
|
68
|
+
|
|
69
|
+
### session.json 新增字段
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"progress_metrics": {
|
|
74
|
+
"phase_stats": {},
|
|
75
|
+
"stale_count": 0,
|
|
76
|
+
"last_productive_phase": "",
|
|
77
|
+
"convergence_trend": "unknown"
|
|
78
|
+
},
|
|
79
|
+
"directions_tried": []
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Progress Tracking
|
|
84
|
+
|
|
85
|
+
每个分析阶段结束时:
|
|
86
|
+
1. 统计 `new_findings`(去重后新发现)和 `repeated`(与已有 evidence 重复)
|
|
87
|
+
2. 写入 `progress_metrics.phase_stats[state_name]`
|
|
88
|
+
3. `new == 0` → `stale_count++`,`convergence_trend = "stalling"`
|
|
89
|
+
4. `new > 0` → `stale_count = 0`,更新 `last_productive_phase`
|
|
90
|
+
5. 连续 2 阶段 new 递减 → `convergence_trend = "diminishing"`
|
|
91
|
+
|
|
92
|
+
### Direction Diversity
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"phase": "S_DIAGNOSE", "round": 1,
|
|
97
|
+
"strategy_type": "scope_widen|perspective_shift|tool_switch|structural_pivot",
|
|
98
|
+
"strategy_desc": "扩展搜索到 utils/", "result": "2 new findings"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**去重规则:** 自迭代前检查同 phase 历史 → 新策略必须在 `strategy_type` 或 `strategy_desc` 上不同 → 4 种 type 均已尝试 → 强制升级 stale_count
|
|
103
|
+
|
|
104
|
+
### Stall Escalation Ladder
|
|
105
|
+
|
|
106
|
+
| stale_count | 策略 |
|
|
107
|
+
|-------------|------|
|
|
108
|
+
| 0 | 正常推进 |
|
|
109
|
+
| 1 | **换视角** — 不同 CLI 工具、反向追踪、手动阅读。方向必须与 directions_tried 不同 |
|
|
110
|
+
| 2 | **结构性转向** — 重定义搜索维度、换分析框架、拆解子问题。不是参数调优 |
|
|
111
|
+
| 3 | **人工升级** — AskUserQuestion / `-y` 自动 INCONCLUSIVE 并推进 |
|
|
112
|
+
|
|
113
|
+
### /loop Heartbeat(可选,`--heartbeat` 启用)
|
|
114
|
+
|
|
115
|
+
建议用户 `/loop 270s`。每阶段更新 `session.json.updated_at`。超 15 分钟未更新 → 告警 + stale_count。连续 2 次无更新 → 建议 `-c` resume。
|
|
116
|
+
</anti_stall>
|
|
117
|
+
|
|
118
|
+
<self_iteration>
|
|
119
|
+
**Quality Gate(进度感知版)**
|
|
120
|
+
|
|
121
|
+
| 维度 | sufficient | insufficient |
|
|
122
|
+
|------|-----------|-------------|
|
|
123
|
+
| Coverage | 已知相关文件/模块均已分析 | 遗漏 grep/git log 可发现的目标 |
|
|
124
|
+
| Depth | ≥80% 发现有 file:line 级证据 | 多数仅泛泛描述 |
|
|
125
|
+
| Actionability | 每条结论有具体后续动作 | 仅"建议关注"类无操作结论 |
|
|
126
|
+
|
|
127
|
+
**进度感知迭代(替代固定 3 轮):**
|
|
128
|
+
- phase complete → evaluate 3 dims + check `progress_metrics`
|
|
129
|
+
- any insufficient AND `stale_count < 3` → re-enter,expansion strategy 必须经 directions_tried 去重
|
|
130
|
+
- 按 Stall Escalation Ladder 选择策略类型
|
|
131
|
+
|
|
132
|
+
**Expansion strategies:**
|
|
133
|
+
- `scope_widen`: 更多目录、git log 深度 ×2、额外 delegate 角度
|
|
134
|
+
- `perspective_shift`: 不同 CLI 工具、反向追踪、手动阅读
|
|
135
|
+
- `tool_switch`: 切换到未使用的分析工具
|
|
136
|
+
- `structural_pivot`: 重定义问题框架、拆解子问题
|
|
137
|
+
|
|
138
|
+
**Exit:** all sufficient → advance | `stale_count >= 3` → log gaps, advance
|
|
139
|
+
|
|
140
|
+
**Log:** `evidence.ndjson {"phase":"self-iteration"}` + `session.json.self_iteration_log[]` + `directions_tried[]`
|
|
141
|
+
</self_iteration>
|
|
142
|
+
|
|
143
|
+
<shared_actions>
|
|
144
|
+
|
|
145
|
+
### A_GENERALIZE
|
|
146
|
+
|
|
147
|
+
3 层 pattern extraction → 4-agent 并发 scan → cross-layer dedup → iterative deepening。
|
|
148
|
+
|
|
149
|
+
**Pattern 来源:** 由各命令指定(root cause / audit findings / implementation patterns 等)。
|
|
150
|
+
|
|
151
|
+
**3 层提取:**
|
|
152
|
+
|
|
153
|
+
| Layer | Method | Example |
|
|
154
|
+
|-------|--------|---------|
|
|
155
|
+
| Syntax | Regex → Grep | `eval(`, missing `await`, inline styles |
|
|
156
|
+
| Semantic | Agent 理解反模式 → scan | 未处理异步错误、缺少校验 |
|
|
157
|
+
| Structural | 文件/模块结构相似性 | 同类导入结构、缺少 override |
|
|
158
|
+
|
|
159
|
+
Write `session.json.patterns[]`: `[{id, source, layer, signature, description, risk, fix_template, confidence}]`
|
|
160
|
+
|
|
161
|
+
**4-agent 并发 scan(单条消息):**
|
|
162
|
+
|
|
163
|
+
| Agent | Strategy | Scope |
|
|
164
|
+
|-------|----------|-------|
|
|
165
|
+
| Syntax grep | Grep regex | Full project |
|
|
166
|
+
| Semantic scan | 反模式检查 | Related modules |
|
|
167
|
+
| Structural match | 结构相似文件 | Full project |
|
|
168
|
+
| Historical grep | `git log -S` | Git history |
|
|
169
|
+
|
|
170
|
+
**Cross-layer dedup:** 多层命中 → boost | 单层 → `needs_review` | 历史已修 → `regression_risk`
|
|
171
|
+
|
|
172
|
+
**Iterative deepening:** module ≥3 hits → 定向深扫(max 1 round)
|
|
173
|
+
|
|
174
|
+
**Persist:** understanding.md 泛化 section + `session.json.generalization_stats`(schema 见 shared_schemas)
|
|
175
|
+
|
|
176
|
+
📌 Auto-commit: `"...({slug}): GENERALIZE — 泛化扫描完成"`
|
|
177
|
+
|
|
178
|
+
### A_DISCOVER
|
|
179
|
+
|
|
180
|
+
1. **Triage** 每个 hit ±10 行上下文 → 分类 `bug` / `risk` / `safe`
|
|
181
|
+
2. **Route:**
|
|
182
|
+
- bug + 可直接修 → **立即修复** → back to S_FIX
|
|
183
|
+
- bug + 需跨模块决策 → 创建 issue(含 fix 建议 + 影响分析)
|
|
184
|
+
- risk → 评估能否直接加 guard;能 → 修
|
|
185
|
+
- safe → skip
|
|
186
|
+
Normal: AskUserQuestion | `-y`: auto-fix 可修的,其余 create issue
|
|
187
|
+
3. **Cross-phase loops:** `cross_phase_loops++`。`loops >= max_loops` → 必须逐项记录原因(禁止笼统"历史遗留")
|
|
188
|
+
4. Append evidence + update understanding.md
|
|
189
|
+
|
|
190
|
+
📌 Auto-commit: `"...({slug}): DISCOVER — 发现分类完成"`
|
|
191
|
+
|
|
192
|
+
### A_RECORD
|
|
193
|
+
|
|
194
|
+
1. Finalize understanding.md 最后一节 — learnings 按各命令指定的分类表结构化
|
|
195
|
+
- **两步模式:** 执行中写产出文件(临时)→ 完成后用户通过 next_step_routing 沉淀永久知识
|
|
196
|
+
2. Mark record goal done。Pending decisions: Normal → AskUserQuestion | `-y` → skip (show deferred count)
|
|
197
|
+
3. **Goal audit:** all `completion_confirmed` → `phase_goals_all_done = true`。未完成: Normal → AskUserQuestion | `-y` → auto accept
|
|
198
|
+
4. `current_state = "COMPLETED"`,emit completion summary(格式由各命令定义)
|
|
199
|
+
|
|
200
|
+
📌 Auto-commit: `"...({slug}): RECORD — 会话总结与知识沉淀"`
|
|
201
|
+
|
|
202
|
+
</shared_actions>
|
|
203
|
+
|
|
204
|
+
<shared_appendix>
|
|
205
|
+
|
|
206
|
+
### Goal Prompt 机制
|
|
207
|
+
|
|
208
|
+
**⚠️ 时机守卫:仅 INTAKE 完成后显示一次。RECORD 完成时禁止重显。**
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
📋 {Command} Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件:
|
|
212
|
+
|
|
213
|
+
/goal 完成以下目标:
|
|
214
|
+
{for each G in phase_goals where status != "skipped":}
|
|
215
|
+
- {G.id}: {G.goal} — 完成条件: {G.done_when}
|
|
216
|
+
{end for}
|
|
217
|
+
{command-specific convergence rules}
|
|
218
|
+
遇到 phase=decision 的 pending 必须 AskUserQuestion,不得自行 resolve。
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
输出后继续执行不阻塞。
|
|
222
|
+
|
|
223
|
+
### `-y` 通用规则
|
|
224
|
+
|
|
225
|
+
- Decision pending → best-effort continue, record `deferred`
|
|
226
|
+
- 3-strike escalation → auto INCONCLUSIVE
|
|
227
|
+
- Discovery routing → auto create issue
|
|
228
|
+
- Record pending → skip, show deferred count
|
|
229
|
+
- Record goal audit → auto accept
|
|
230
|
+
|
|
231
|
+
`deferred` items 在 completion summary 显示为"待决策";可通过 `-c` 恢复。各命令在自身文件中列出特有 decision points。
|
|
232
|
+
|
|
233
|
+
### Phase Goal Lifecycle
|
|
234
|
+
|
|
235
|
+
`pending → done (confirmed=true)` | `pending → skipped (confirmed=true)` | `pending → failed (confirmed=false)`
|
|
236
|
+
|
|
237
|
+
`phase_goals_all_done = true` 仅当 ALL goals 有 `completion_confirmed == true`。
|
|
238
|
+
|
|
239
|
+
### Pre-load(可选,缺失不阻塞)
|
|
240
|
+
|
|
241
|
+
| 层级 | 命令 |
|
|
242
|
+
|------|------|
|
|
243
|
+
| Codebase docs | Read `.workflow/codebase/ARCHITECTURE.md` |
|
|
244
|
+
| Wiki search | `maestro search "<keywords>" --json`(top 5) |
|
|
245
|
+
| Specs | `maestro load --type spec --category <cat>` |
|
|
246
|
+
| Role knowledge | `maestro search --category <cat>` → `maestro load --type knowhow --id <id>` |
|
|
247
|
+
| Prior sessions | `Glob(".workflow/scratch/*-{type}-odyssey-*")` |
|
|
248
|
+
|
|
249
|
+
### Common Error Codes
|
|
250
|
+
|
|
251
|
+
| Code | Severity | Condition | Recovery |
|
|
252
|
+
|------|----------|-----------|----------|
|
|
253
|
+
| E003 | error | Resume but no session found | Start new |
|
|
254
|
+
| E004 | error | Delegate failed | Retry or proceed without |
|
|
255
|
+
| W003 | warning | Generalization 0 hits | Skip discovery |
|
|
256
|
+
| W004 | warning | Delegate parse failed | Use raw output |
|
|
257
|
+
|
|
258
|
+
</shared_appendix>
|