maestro-flow 0.4.15 → 0.4.17

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 (104) hide show
  1. package/.agents/skills/maestro/SKILL.md +17 -17
  2. package/.agents/skills/maestro-init/SKILL.md +1 -1
  3. package/.agents/skills/maestro-plan/SKILL.md +10 -9
  4. package/.agents/skills/maestro-ralph/SKILL.md +21 -17
  5. package/.agents/skills/maestro-ralph-beta/SKILL.md +893 -0
  6. package/.agents/skills/maestro-ralph-execute/SKILL.md +54 -71
  7. package/.agents/skills/manage-knowledge-audit/SKILL.md +90 -0
  8. package/.agy/skills/maestro/SKILL.md +17 -17
  9. package/.agy/skills/maestro-init/SKILL.md +1 -1
  10. package/.agy/skills/maestro-plan/SKILL.md +10 -9
  11. package/.agy/skills/maestro-ralph/SKILL.md +21 -17
  12. package/.agy/skills/maestro-ralph-beta/SKILL.md +889 -0
  13. package/.agy/skills/maestro-ralph-execute/SKILL.md +54 -71
  14. package/.agy/skills/manage-knowledge-audit/SKILL.md +90 -0
  15. package/.claude/commands/maestro-init.md +1 -1
  16. package/.claude/commands/maestro-plan.md +10 -9
  17. package/.claude/commands/maestro-ralph-beta.md +891 -0
  18. package/.claude/commands/maestro-ralph-execute.md +54 -71
  19. package/.claude/commands/maestro-ralph.md +21 -17
  20. package/.claude/commands/maestro.md +17 -17
  21. package/.claude/commands/manage-knowledge-audit.md +88 -0
  22. package/.codex/skills/maestro-ralph/SKILL.md +93 -73
  23. package/.codex/skills/maestro-ralph-beta/SKILL.md +891 -0
  24. package/.codex/skills/maestro-ralph-execute/SKILL.md +243 -0
  25. package/dist/src/cli.js +1 -0
  26. package/dist/src/cli.js.map +1 -1
  27. package/dist/src/commands/font-guide.d.ts +13 -0
  28. package/dist/src/commands/font-guide.d.ts.map +1 -0
  29. package/dist/src/commands/font-guide.js +114 -0
  30. package/dist/src/commands/font-guide.js.map +1 -0
  31. package/dist/src/commands/install-backend.d.ts.map +1 -1
  32. package/dist/src/commands/install-backend.js +23 -4
  33. package/dist/src/commands/install-backend.js.map +1 -1
  34. package/dist/src/commands/install.d.ts.map +1 -1
  35. package/dist/src/commands/install.js +5 -0
  36. package/dist/src/commands/install.js.map +1 -1
  37. package/dist/src/commands/ralph.d.ts +6 -0
  38. package/dist/src/commands/ralph.d.ts.map +1 -0
  39. package/dist/src/commands/ralph.js +135 -0
  40. package/dist/src/commands/ralph.js.map +1 -0
  41. package/dist/src/core/manifest.d.ts +2 -0
  42. package/dist/src/core/manifest.d.ts.map +1 -1
  43. package/dist/src/core/manifest.js.map +1 -1
  44. package/dist/src/hooks/statusline.d.ts.map +1 -1
  45. package/dist/src/hooks/statusline.js +189 -81
  46. package/dist/src/hooks/statusline.js.map +1 -1
  47. package/dist/src/ralph/cmd-check.d.ts +9 -0
  48. package/dist/src/ralph/cmd-check.d.ts.map +1 -0
  49. package/dist/src/ralph/cmd-check.js +53 -0
  50. package/dist/src/ralph/cmd-check.js.map +1 -0
  51. package/dist/src/ralph/cmd-complete.d.ts +10 -0
  52. package/dist/src/ralph/cmd-complete.d.ts.map +1 -0
  53. package/dist/src/ralph/cmd-complete.js +91 -0
  54. package/dist/src/ralph/cmd-complete.js.map +1 -0
  55. package/dist/src/ralph/cmd-next.d.ts +5 -0
  56. package/dist/src/ralph/cmd-next.d.ts.map +1 -0
  57. package/dist/src/ralph/cmd-next.js +201 -0
  58. package/dist/src/ralph/cmd-next.js.map +1 -0
  59. package/dist/src/ralph/cmd-session.d.ts +5 -0
  60. package/dist/src/ralph/cmd-session.d.ts.map +1 -0
  61. package/dist/src/ralph/cmd-session.js +52 -0
  62. package/dist/src/ralph/cmd-session.js.map +1 -0
  63. package/dist/src/ralph/cmd-skills.d.ts +8 -0
  64. package/dist/src/ralph/cmd-skills.d.ts.map +1 -0
  65. package/dist/src/ralph/cmd-skills.js +62 -0
  66. package/dist/src/ralph/cmd-skills.js.map +1 -0
  67. package/dist/src/ralph/skill-resolver.d.ts +40 -0
  68. package/dist/src/ralph/skill-resolver.d.ts.map +1 -0
  69. package/dist/src/ralph/skill-resolver.js +162 -0
  70. package/dist/src/ralph/skill-resolver.js.map +1 -0
  71. package/dist/src/ralph/skill-scanner.d.ts +20 -0
  72. package/dist/src/ralph/skill-scanner.d.ts.map +1 -0
  73. package/dist/src/ralph/skill-scanner.js +137 -0
  74. package/dist/src/ralph/skill-scanner.js.map +1 -0
  75. package/dist/src/ralph/status-checker.d.ts +7 -0
  76. package/dist/src/ralph/status-checker.d.ts.map +1 -0
  77. package/dist/src/ralph/status-checker.js +139 -0
  78. package/dist/src/ralph/status-checker.js.map +1 -0
  79. package/dist/src/ralph/status-schema.d.ts +96 -0
  80. package/dist/src/ralph/status-schema.d.ts.map +1 -0
  81. package/dist/src/ralph/status-schema.js +9 -0
  82. package/dist/src/ralph/status-schema.js.map +1 -0
  83. package/dist/src/ralph/status-store.d.ts +20 -0
  84. package/dist/src/ralph/status-store.d.ts.map +1 -0
  85. package/dist/src/ralph/status-store.js +70 -0
  86. package/dist/src/ralph/status-store.js.map +1 -0
  87. package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -1
  88. package/dist/src/tui/install-ui/ExecutionView.js +1 -0
  89. package/dist/src/tui/install-ui/ExecutionView.js.map +1 -1
  90. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  91. package/dist/src/tui/install-ui/InstallExecution.js +2 -0
  92. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  93. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  94. package/dist/src/tui/install-ui/InstallFlow.js +28 -14
  95. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  96. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  97. package/dist/src/tui/install-ui/InstallResult.js +1 -1
  98. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  99. package/dist/src/utils/update-notices.js +12 -0
  100. package/dist/src/utils/update-notices.js.map +1 -1
  101. package/package.json +1 -1
  102. package/templates/config.json +21 -33
  103. package/workflows/init.md +11 -11
  104. package/workflows/knowledge-audit.md +358 -0
@@ -36,24 +36,24 @@ Also read `session.auto_mode` from status.json — if true, treat as `-y`.
36
36
  | Kind | Identifier | Execution | Flow after |
37
37
  |------|-----------|-----------|------------|
38
38
  | decision step | `step.decision` 非空 | `invoke_skill("maestro-ralph")` | Execution ends here |
39
- | 执行 step | `step.decision == null` | `read_file({file_path: step.command_path})` + 内联解释执行 | Self-invoke next |
39
+ | 执行 step | `step.decision == null` | `shell("maestro ralph next")` 内联按其 stdout 执行 → `shell("maestro ralph complete N --status ...")` | Self-invoke next |
40
40
 
41
41
  HARD RULES:
42
- - 执行 step:通过 `read_file({command_path})` 把命令 .md 加载进当前会话,再按内容执行
43
- - **必须遵循 `<required_reading>` / `<deferred_reading>` 标签**:命令 .md 通常采用"入口 + workflow"形式,主体逻辑放在 workflow 文件中并通过 `<required_reading>` 引用;缺失 required_reading 视为加载失败
44
- - decision step:A_EXEC_DECISION 通过 `invoke_skill({ skill: "maestro-ralph" })` handoff ralph 评估
45
- - `command_path` ralph A_BUILD_STEPS 写入 status.json(缺失 报错 E002)
46
- - 每个 step 必须产出 `--- COMPLETION STATUS ---` 块,否则视为 NEEDS_RETRY
42
+ - 执行 step:**统一通过 `maestro ralph next` CLI 加载**。CLI 负责读 command_path、解析 `<required_reading>` + `<deferred_reading>`、拼接 prompt、写 `step.load.*` + `active_step_index` + `step.status="running"`。不要再在会话里手动 Read + 解析 required_reading
43
+ - decision step:A_EXEC_DECISION 通过 `invoke_skill({ skill: "maestro-ralph" })` handoff ralph 评估(不走 CLI)
44
+ - `command_path` ralph A_BUILD_STEPS 写入 status.json(缺失 → ralph next 返回 E006/E007 并拒绝执行)
45
+ - 每个 step 结束必须调用 `maestro ralph complete N --status <S>` 或 `maestro ralph retry N`。STATUS 4 个合法值:`DONE | DONE_WITH_CONCERNS | NEEDS_RETRY | BLOCKED`(**`NEEDS_CONTEXT` 已废除**,context 容量由 harness 自动压缩处理)
47
46
  </context>
48
47
 
49
48
  <invariants>
50
- 1. **执行 = Read + inline**通过 Read 读取 `step.command_path`,按其指令在当前 session 内执行
51
- 2. **Required reading must be loaded**命令 .md 中的 `<required_reading>` 引用的所有文件必须立即 Read;缺一 视为加载失败,pause session(E007
52
- 3. **Deferred reading recorded only** — `<deferred_reading>` 列出的文件路径需记录,执行过程按需 Read;不在加载阶段读取
53
- 4. **Skill loaded confirmation** 所有 required_reading 加载完成后必须输出一行确认:`✓ skill {step.skill} 加载完成 (required: N, deferred: M)`
54
- 5. **必须显式 completion confirmation** — 每个 step 完成时需有 `STATUS: DONE` 且写入 `step.completion_confirmed = true`
49
+ 1. **执行 = `ralph next` + inline + `ralph complete`** `maestro ralph next` 拿到 skill 内容,按 stdout 内联执行
50
+ 2. **Required reading CLI 负责**`ralph next` 自动展开 + 加载 `<required_reading>` 引用的所有文件,缺失退出码 1(E007),不写 active_step_index,不进入执行
51
+ 3. **Deferred reading recorded only** — `<deferred_reading>` 路径由 CLI 记录到 `step.load.deferred_files`,执行阶段按需 Read
52
+ 4. **一致性取代锁**同一 session 同时最多一个 step `active_step_index`;CLI 校验失败直接退出码 3,不静默推进
53
+ 5. **Completion 通过 CLI 调用** — 每个 step 末尾调 `maestro ralph complete N --status <S>` 或 `maestro ralph retry N`,由 CLI 写 `completion_*` + `active_step_index`
55
54
  6. **Self-invocation chain** — 持续直到全部 `completion_confirmed` 或 paused
56
- 7. **status.json 每步骤后写盘** — resume-safe
55
+ 7. **status.json 每步骤后由 CLI 原子写盘** — resume-safe
56
+ 8. **STATUS 枚举受限** — 仅 `DONE | DONE_WITH_CONCERNS | NEEDS_RETRY | BLOCKED`;`NEEDS_CONTEXT` 已废除
57
57
  </invariants>
58
58
 
59
59
  <state_machine>
@@ -80,11 +80,12 @@ S_RESOLVE_ARGS:
80
80
 
81
81
  S_EXECUTE:
82
82
  → END WHEN: step.decision != null DO: A_EXEC_DECISION
83
- → S_POST_EXEC WHEN: step.decision == null + success DO: A_EXEC_STEP
84
- → S_HANDLE_FAIL WHEN: step.decision == null + failure DO: A_EXEC_STEP
83
+ → S_POST_EXEC WHEN: step.decision == null + ralph complete invoked with DONE|DONE_WITH_CONCERNS DO: A_EXEC_STEP
84
+ → S_HANDLE_FAIL WHEN: step.decision == null + ralph next exit≠0 OR ralph complete with NEEDS_RETRY|BLOCKED DO: A_EXEC_STEP
85
85
 
86
86
  S_POST_EXEC:
87
- → S_LOCATE DO: A_MARK_COMPLETE + invoke_skill("maestro-ralph-execute")
87
+ → S_LOCATE DO: shell("maestro ralph complete ...") + invoke_skill("maestro-ralph-execute")
88
+ NOTE: CLI 已写完 completion_*, status, active_step_index;无需额外写盘
88
89
 
89
90
  S_HANDLE_FAIL:
90
91
  → S_LOCATE WHEN: auto + not retried DO: A_RETRY
@@ -107,8 +108,8 @@ S_FALLBACK:
107
108
 
108
109
  1. If session_id provided → load `.workflow/.maestro/{session_id}/status.json`
109
110
  2. Else: scan `.workflow/.maestro/*/status.json`, filter `status == "running"`, sort DESC, take first
110
- 3. Extract: session_id, source, steps[], current_step, phase, milestone, intent, auto_mode, context, cli_tool
111
- 4. Find first step with `status == "pending"` next step
111
+ 3. Extract: session_id, source, steps[], phase, milestone, intent, auto_mode, context, cli_tool, active_step_index
112
+ 4. **不在此处选 pending step**——pending 选择由 `maestro ralph next` CLI 内部完成;A_LOCATE_SESSION 只确认 session 存在且 running,由 A_EXEC_STEP 调 CLI 推进
112
113
 
113
114
  ### A_RESOLVE_ARGS
114
115
 
@@ -156,54 +157,35 @@ Write enriched args back to status.json.
156
157
 
157
158
  ### A_EXEC_STEP
158
159
 
159
- 1. Validate `step.command_path != null`;否则 raise E002,pause session
160
- 2. Mark step running, write status.json
161
- 3. Display: `[{index}/{total}] {step.skill} [{step.command_scope}]`
162
- 4. `read_file({ file_path: step.command_path })` — 把命令 .md 全文加载进当前会话
163
- 5. **解析 reading 标签**("入口 + workflow"形式核心步骤):
164
- - 抽取 frontmatter `argument-hint` / `allowed-tools`
165
- - 抽取 `<required_reading>` 块的所有 `@path` 引用 → 立刻 `read_file({ file_path: <expanded path> })` 加载(`~/` / `@~/` 展开为用户主目录);任一文件缺失或读取失败 → raise E007,pause session
166
- - 抽取 `<deferred_reading>` 块的所有路径 仅记录到 `step.deferred_reads = [...]`,执行阶段按需 Read
167
- - 抽取 `<purpose>/<context>/<state_machine>/<execution>/<actions>` 等指令块
168
- 6. **加载完成确认**:required_reading 全部成功 Read 后,输出一行:
169
- ```
170
- skill {step.skill} 加载完成 (required: {N}, deferred: {M})
171
- ```
172
- 其中 N = required_reading 引用数,M = deferred_reading 路径数(缺省块按 0 计)
173
- 7. 计算 `effective_args`:`step.args` + (`auto ? " -y" : ""`)
174
- 8. 按读到的指令在本会话中**内联执行**:调用允许的工具完成命令所规定的工作;执行过程中如触发 deferred_reading 引用的资源 → 按需 Read
175
- 9. 执行结束:要求最后一段必须包含 `--- COMPLETION STATUS ---` 块(见 A_MARK_COMPLETE)
176
- 10. Return success / failure
177
-
178
- ### A_MARK_COMPLETE
179
-
180
- 1. 从 step 输出中提取 `--- COMPLETION STATUS ---` 块(required)
181
- 2. 解析并写入:
182
- - `STATUS: DONE` → `step.status = "completed"`, `step.completion_confirmed = true`, `step.completion_status = "DONE"`
183
- - `STATUS: DONE_WITH_CONCERNS` → `step.status = "completed"`, `step.completion_confirmed = true`, `step.completion_status = "DONE_WITH_CONCERNS"`, `step.concerns = <CONCERNS>`
184
- - `STATUS: NEEDS_RETRY` → `step.status = "pending"`, `step.retried = true`, `step.completion_confirmed = false`, → S_HANDLE_FAIL
185
- - `STATUS: BLOCKED` / `NEEDS_CONTEXT` → `session.status = "paused"`, `step.completion_status` 记录原因, `step.completion_confirmed = false`
186
- - 缺失 `--- COMPLETION STATUS ---` 块 → 视为 NEEDS_RETRY(不允许 heuristic fallback)
187
- 3. 写入 `step.completion_evidence`(artifact 路径 / 关键输出节选)
188
- 4. 扫描输出抓取 context 信号:`PHASE: N` → session.phase;`scratch_dir: path` → context.scratch_dir;`BLP-xxx` → context.blueprint_session_id
189
- 5. `step.completed_at = now`,写 status.json
190
- 6. **Sub-goal evidence 校验**(task_decomposition 存在时):若 `step.goal_ref` 对应子目标的 `lifecycle` 覆盖当前 stage 且 evidence artifact 已生成 → 暂不直接置 done,仍交由 post-goal-audit 决策;仅在 step 显式确认时更新 `task_decomposition[*].completion_confirmed = false` 占位(保持 pending)
191
- 7. Display: `[{index}/{total}] ✓ {step.skill} completed (confirmed)`
160
+ 1. **Load** `shell("maestro ralph next")`
161
+ - 退出码 0 stdout 内联执行
162
+ - 退出码 2 交给 S_LOCATE
163
+ - 退出码 3 active_step_index 已被占用
164
+ - 退出码 1 pause session
165
+ 2. **Inline execution** stdout 执行;deferred_reading 按需 Read
166
+ 3. **Complete**:
167
+ - `shell("maestro ralph complete N --status DONE [--evidence <path>]")`
168
+ - `shell("maestro ralph complete N --status DONE_WITH_CONCERNS --concerns \"...\"")`
169
+ - `shell("maestro ralph retry N")`
170
+ - `shell("maestro ralph complete N --status BLOCKED --reason \"...\"")`
171
+ 4. **Propagate context signals** — 关键信号 (`PHASE: N` / `scratch_dir: path` / `BLP-xxx`) 写入 `status.json.context`
172
+
173
+ 完成后 S_LOCATE 触发 `invoke_skill({ skill: "maestro-ralph-execute" })` 自调用。
192
174
 
193
175
  ### A_RETRY
194
176
 
195
- 1. `step.retried = true`, `step.status = "pending"`, `step.error = null`, `step.completion_confirmed = false`
196
- 2. Write status.json
177
+ 1. `shell("maestro ralph retry N")` — CLI 设 `step.retried = true`, `step.status = "pending"`, `step.completion_confirmed = false`, `active_step_index`
178
+ 2. Display: `[{index}/{total}] ↻ {step.skill} retry`
197
179
 
198
180
  ### A_SKIP_STEP
199
181
 
200
- 1. `step.status = "skipped"`, `step.completion_confirmed = false`
201
- 2. Write status.json
182
+ 跳过执行 step — 手动编辑 `status.json`:将该 step `status` 设为 `"skipped"`,`completion_confirmed` 设为 `false`,并清 `active_step_index`(若指向此 step)。
183
+ (不提供 CLI 子命令;跳过是非常规操作,避免自动化误用。)
202
184
 
203
185
  ### A_PAUSE_SESSION
204
186
 
205
- 1. `session.status = "paused"`, write status.json
206
- 2. Display: `[{index}/{total}] ✗ {step.skill} 失败,会话已暂停。/maestro-ralph continue 恢复。`
187
+ 通常由 `ralph complete N --status BLOCKED --reason "..."` 触发,CLI 已写 `session.status = "paused"`。手动 pause 场景下直接编辑 status.json
188
+ Display: `[{index}/{total}] ✗ {step.skill} 失败,会话已暂停。/maestro-ralph continue 恢复。`
207
189
 
208
190
  ### A_COMPLETE_SESSION
209
191
 
@@ -238,29 +220,30 @@ Write enriched args back to status.json.
238
220
  | Code | Severity | Description | Recovery |
239
221
  |------|----------|-------------|----------|
240
222
  | E001 | error | No running session found | Suggest /maestro or /maestro-ralph |
241
- | E002 | error | step.command_path missing for 执行 step | Pause, ask ralph to rebuild step |
242
- | E003 | error | status.json corrupt | Show path, manual check |
243
- | E005 | error | COMPLETION STATUS block missing | Trigger NEEDS_RETRY |
244
- | E007 | error | required_reading file 缺失或读取失败 | List missing paths, pause session |
223
+ | E006 | error | command_path missing/unreachable for 执行 step | `ralph next` 拒绝;编辑 status.json 或重 build |
224
+ | E007 | error | required_reading 引用文件缺失 | `ralph next` 拒绝;CLI stderr 列出缺失路径 |
225
+ | E008 | error | `ralph complete` idx active_step_index | 编辑 status.json 修正一致性 |
226
+ | E009 | error | `ralph complete` step.status ≠ running | 重复 complete 或非法跳跃;编辑 status.json |
227
+ | E010 | error | status.json schema 损坏 | `ralph check` 显示具体损坏字段 |
245
228
  | W001 | warning | Step completed with concerns | Log and continue |
246
- | W002 | warning | command .md `<required_reading>` 标签 | 直接执行 .md 主体,跳过加载阶段 |
229
+ | W005 | warning | active_step_index 指向已 completed step | `ralph next` 自动清理后继续 |
230
+ | W007 | warning | step.skill ≠ command .md frontmatter.name | 提示但不阻塞 |
247
231
 
248
232
  ### Success Criteria
249
233
 
250
234
  - [ ] Session discovery covers maestro-* and ralph-*
251
235
  - [ ] `-y` parsed from args 或 session.auto_mode;auto=true 时透传 `-y` 到 skill args
252
236
  - [ ] Placeholders resolved;per-skill enrichment 正确
253
- - [ ] Decision 节点(`step.decision != null`)invoke_skill("maestro-ralph") handoff
254
- - [ ] 执行 step 通过 read_file({step.command_path}) 内联执行
255
- - [ ] 执行 step Read 后必须解析并加载 `<required_reading>` 引用的文件;缺失 E007 pause
256
- - [ ] `<deferred_reading>` 仅记录路径到 `step.deferred_reads`,执行阶段按需 Read
257
- - [ ] required_reading 加载完成后输出 `✓ skill {name} 加载完成 (required: N, deferred: M)`
258
- - [ ] 每个 step 强制 `--- COMPLETION STATUS ---`;缺失 NEEDS_RETRY
259
- - [ ] step.completion_confirmed = true 仅在 STATUS: DONE/DONE_WITH_CONCERNS 时设置
260
- - [ ] step.completion_evidence 记录 artifact path / 输出节选
261
- - [ ] Context signals 传播 status.json
237
+ - [ ] Decision 节点(`step.decision != null`)走 invoke_skill("maestro-ralph") handoff(**不调 ralph next CLI**)
238
+ - [ ] 执行 step 通过 `shell("maestro ralph next")` 加载;CLI 返回拼好的 prompt + completion 协议
239
+ - [ ] required_reading CLI 自动加载并拼入 prompt;缺失CLI 退出码 1,pause session
240
+ - [ ] `<deferred_reading>` CLI 记录到 `step.load.deferred_files`,执行阶段按需 Read
241
+ - [ ] 每个 step 末尾必须调 `maestro ralph complete N --status <S>` 或 `maestro ralph retry N`
242
+ - [ ] STATUS 枚举仅 `DONE | DONE_WITH_CONCERNS | NEEDS_RETRY | BLOCKED`;CLI 拒绝 `NEEDS_CONTEXT`
243
+ - [ ] active_step_index 一致性由 CLI 维护;E008/E009 直接退出,不静默推进
244
+ - [ ] step.completion_evidence 通过 `--evidence` 传入并记录
245
+ - [ ] Context signals 由执行 step 显式写回 status.json.context(非 ralph-execute 内嵌扫描)
262
246
  - [ ] Auto mode: retry 一次后 pause;interactive 提供 retry/skip/abort
263
247
  - [ ] 自调用持续到全部 completion_confirmed 或 paused
264
- - [ ] A_COMPLETE_SESSION 校验全部 step confirmed + sub-goal all_done
265
248
 
266
249
  </appendix>
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: manage-knowledge-audit
3
+ description: Audit and prune knowledge across spec / knowhow / artifact stores
4
+ argument-hint: "--scope <spec|knowhow|artifact|all> [--level P0|P1|P2] [--timeline T1..T6] [--since YYYY-MM-DD] [--milestone <name>] [--include-archive] [--interactive] [--mark|--delete|--purge] [--dry-run] [--report]"
5
+ allowed-tools:
6
+ - read_file
7
+ - write_file
8
+ - edit_file
9
+ - shell
10
+ - find_files
11
+ - search
12
+ - delegate_subagent
13
+ - ask_user
14
+ ---
15
+ <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
16
+
17
+ <purpose>
18
+ 对称于 `manage-harvest`(写入入口)的知识淘汰入口。harvest 负责把 artifact 抽取为 spec/wiki/issue;audit 负责审查这三大存储中已积累的条目,识别矛盾、失效、老化、孤儿,并通过 keep/deprecate/delete 三态决策清理。
19
+
20
+ 覆盖 8 大场景类、28 子场景(显性/隐性矛盾、失效老化、元数据质量、Maestro 特化、时间线产物 T1-T6、knowhow 漂移、artifact 残留),定义见 workflow knowledge-audit.md。
21
+
22
+ **闭环**:harvest 写入 → audit 审查 → 三态淘汰;与 `harvest --prune`(物理 GC)互补:audit 做语义层判定,且删除未抽取的 artifact 前反向触发 harvest 抢救。
23
+ </purpose>
24
+
25
+ <required_reading>
26
+ @~/.maestro/workflows/knowledge-audit.md
27
+ </required_reading>
28
+
29
+ <deferred_reading>
30
+ - @~/.maestro/workflows/harvest.md (audit 检测的 artifact 是 harvest 的产物源)
31
+ - @~/.maestro/workflows/specs-add.md (deprecate 操作所需的 `<spec-entry>` 变形)
32
+ </deferred_reading>
33
+
34
+ <context>
35
+ Arguments: $ARGUMENTS
36
+
37
+ **Scope(必选):** `spec` | `knowhow` | `artifact` | `all`
38
+
39
+ **删除策略**默认 `--interactive`(三态面板逐项决策);非交互模式 `--mark`(仅打标)/ `--delete`(软删到 `.trash/`)/ `--purge`(物理擦除,仅 artifact 且需双重确认)。
40
+
41
+ Flag 全集、scope 对应的扫描路径、Stage 步骤、检测算法定义在 workflow knowledge-audit.md。
42
+ </context>
43
+
44
+ <execution>
45
+ Follow `~/.maestro/workflows/knowledge-audit.md` Stages 1-8 in order.
46
+
47
+ **Key invariants:**
48
+ 1. **Backup before mutate** — Stage 6 必须把待变更文件打包到 `.workflow/.trash/knowledge-audit-{timestamp}/`,备份失败禁止 Stage 7。
49
+ 2. **Deprecate over delete** — 文本存储(spec/knowhow)首选注入 `status="deprecated"` 保留历史;只有 artifact 物理残留才走 delete/purge。
50
+ 3. **Purge requires double confirmation** — `--purge` 仅作用于 artifact scope,且 Stage 5 必须显式 `[y/N]` 二次确认 + 输入 artifact id。
51
+ 4. **Rescue before delete** — 删除未抽取的 artifact 前(`harvest-log.jsonl` 无记录),强制提示 "是否先 `/manage-harvest`?"。
52
+
53
+ Scope 路径、8 类检测算法、三态决策面板、报告 schema 定义在 workflow knowledge-audit.md。
54
+
55
+ **Next-step routing on completion:**
56
+ - 复审淘汰记录 → `.workflow/.knowledge-audit/audit-report-{date}.md`
57
+ - 抢救未抽取 artifact → `/manage-harvest <artifact-id>`
58
+ - 验证 spec 现状 → `/spec-load --role implement`
59
+ - 周期巡检 → 每 milestone 结束跑 `--scope all --report`
60
+ </execution>
61
+
62
+ <error_codes>
63
+ | Code | Severity | Condition | Recovery |
64
+ |------|----------|-----------|----------|
65
+ | E001 | error | `.workflow/` 未初始化 | 先跑 `/maestro-init` |
66
+ | E002 | error | `--scope` 缺失或非法 | 提供 spec/knowhow/artifact/all |
67
+ | E003 | error | `--purge` 与 `--dry-run` 同用 | 二选一 |
68
+ | E004 | error | `--purge` 作用于非 artifact 范围 | purge 仅支持 artifact scope |
69
+ | E005 | error | 备份失败(`.trash/` 写入异常) | 检查磁盘空间与权限,重试 |
70
+ | W001 | warning | 检出冲突但用户选择 keep | 记入 report,不阻断 |
71
+ | W002 | warning | 待删 artifact 无 harvest-log 记录 | 提示先跑 manage-harvest |
72
+ | W003 | warning | 循环 supersedes 链 | 自动断环或交互选保留节点 |
73
+ | W004 | warning | 检测耗时 >120s(大规模 spec 库) | 建议加 `--scope` 收敛或 `--since` 增量 |
74
+ | W005 | warning | LLM detector 不可用 | 降级到正则+图算法子集,跳过 B/G 类语义场景 |
75
+ </error_codes>
76
+
77
+ <success_criteria>
78
+ - [ ] Scope 正确解析,互斥标志校验通过
79
+ - [ ] 三存储按 scope 加载完成,构建出统一 finding 池
80
+ - [ ] Stage 3 时间线索引建立(mtime ↔ session/milestone 状态)
81
+ - [ ] Stage 4 按 P0/P1/P2 输出 finding 列表
82
+ - [ ] 如非 `--report`:用户对每项做出三态决策
83
+ - [ ] 未 harvest 的 artifact 删除前触发抢救确认
84
+ - [ ] Stage 6 backup tarball 生成于 `.workflow/.trash/`
85
+ - [ ] `deprecate` 通过元数据注入完成(spec/knowhow 文件未被物理删除)
86
+ - [ ] `delete` 移动至 `.trash/`,索引同步更新
87
+ - [ ] `purge` 仅在双重确认通过后执行
88
+ - [ ] `audit-report-{date}.md` + `audit-log.jsonl` 写入完成
89
+ - [ ] 摘要展示三存储变更计数与下一步路由
90
+ </success_criteria>
@@ -50,11 +50,11 @@ $ARGUMENTS — user intent text, or special keywords.
50
50
  3. **Auto flag pass-through** — 仅当用户传入 `-y` 时透传 `-y` 到 skill args
51
51
  4. **Decomposition contract shared with maestro-ralph** — broad/lifecycle intents run S_DECOMPOSE producing the SAME additive block (`boundary_contract`, `execution_criteria`, `task_decomposition`)。Reference maestro-ralph `A_DECOMPOSE_TASKS`
52
52
  5. **status.json 唯一真源** — 不生成 `goal-checklist.md` 或外部清单
53
- 6. **执行步骤统一 Read .md 内联**chain 内每个执行 step 解析 `command_scope`/`command_path`(全局优先 `~/.claude/commands/{name}.md`,fallback 项目),由 ralph-execute `view_file({command_path})` 内联执行;CLI 仅在 decision 节点做只读分析
54
- 7. **Topology awareness** — chain catalog 含 brainstorm / blueprint / analyze-macro(text) / analyze(numeric phase) / roadmap / plan(三路径) / execute / verify / ...;scope_verdict 路由由 ralph 在 `post-analyze-scope` 决定
55
- 8. **D-007 milestone 反查** — 数字 phase 步骤的 `milestone_id` 由 `state.json.milestones[].phase_slugs` 反查得出
56
- 9. **每个 step 必须 `completion_confirmed: true`** — 基于 `--- COMPLETION STATUS ---` `STATUS: DONE`
57
- 10. **schema 向后兼容** 新增字段全部可选;既有字段名不删不改
53
+ 6. **执行步骤统一通过 `maestro ralph next` 加载** — `command_scope`/`command_path` `maestro ralph skills --json --quiet` 预校验(project 覆盖 global);decision 节点不走 CLI,走 `Skill("maestro-ralph")` handoff
54
+ 7. **Topology awareness** — chain catalog 含 brainstorm / blueprint / analyze-macro / analyze / roadmap / plan(三路径) / execute / verify / ...;scope_verdict ralph 在 `post-analyze-scope` 决定
55
+ 8. **D-007 milestone 反查** — 数字 phase `milestone_id` 由 `state.json.milestones[].phase_slugs` 反查
56
+ 9. **每个 step 必须 `completion_confirmed: true`** — `maestro ralph complete N --status DONE|DONE_WITH_CONCERNS` 写入
57
+ 10. **schema**`ralph_protocol_version: "1"` 标记 CLI-driven session;新增字段全部可选
58
58
  </invariants>
59
59
 
60
60
  <state_machine>
@@ -140,7 +140,7 @@ S_FALLBACK:
140
140
  - 数字 phase 上下文 → `analyze {phase}` → `plan {phase}` → `execute {phase}` → `verify {phase}` → quality pipeline
141
141
  - 已有 analyze artifact 想直达执行 → `plan --from analyze:{ANL_ID}` → execute → verify
142
142
  - 已有 blueprint artifact → `plan --from blueprint:{BLP_ID}` → execute → verify
143
- 4. 执行 step 解析 `command_scope` + `command_path`(全局优先 fallback 项目);写入 `step.stage` / `step.scope` / `step.source_artifact_ref`(如 `--from` 注入时)。decision 节点通过 `step.decision` 字段标识
143
+ 4. 执行 step:`run_command("maestro ralph skills --json --quiet")` 预校验 skill 名,命中写绝对路径到 `command_path`,未命中标 `missing`;同时写 `step.stage` / `step.scope` / `step.source_artifact_ref`。decision 节点不解析 command_path
144
144
 
145
145
  ### A_CLARIFY
146
146
 
@@ -170,30 +170,28 @@ S_FALLBACK:
170
170
  ```json
171
171
  {
172
172
  "session_id", "source": "maestro", "intent", "task_type", "chain_name",
173
+ "ralph_protocol_version": "1", "active_step_index": null,
173
174
  "phase", "phase_is_new": false, "milestone": "",
174
175
  "scope_verdict": null, "analyze_macro_id": null, "blueprint_id": null,
175
- "auto_mode": false, "cli_tool": "claude", // cli_tool: decision 节点 delegate 评估时的 CLI 工具
176
+ "auto_mode": false, "cli_tool": "claude",
176
177
  "context": { "scratch_dir": null, "plan_dir": null, "analysis_dir": null,
177
178
  "brainstorm_dir": null, "blueprint_dir": null, "issue_id": null },
178
179
  "steps": [{
179
- "index": 0,
180
- "skill": "", "args": "",
181
- "stage": "", "scope": null,
182
- "decision": null, // 非 null → decision 节点;null → 执行节点
183
- "command_scope": "global|project|missing|null",
184
- "command_path": "~/.claude/commands/{name}.md | .claude/commands/{name}.md | null",
180
+ "index": 0, "skill": "", "args": "",
181
+ "stage": "", "scope": null, "decision": null,
182
+ "command_scope": "global|project|missing|null", "command_path": "<abs> | null",
185
183
  "milestone_id": null, "source_artifact_ref": null,
186
184
  "status": "pending", "goal_ref": null,
187
185
  "completion_confirmed": false, "completion_status": null,
188
- "completion_evidence": null, "completed_at": null
186
+ "completion_evidence": null, "completed_at": null,
187
+ "deferred_reads": [], "load": null
189
188
  }],
190
189
  "waves": [], "current_step": 0, "status": "running",
191
190
  "boundary_contract": {}, "execution_criteria": [],
192
191
  "task_decomposition": [], "task_decomposition_all_done": false
193
192
  }
194
193
  ```
195
- Decomposition 字段仅在 A_DECOMPOSE_TASKS 产出时写入(additive)
196
- 3. Validate: 所有 step 的 `command_scope != "missing"`;否则 raise E005 列出缺失 skill
194
+ 3. Validate: 所有 step 的 `command_scope != "missing"`,否则 raise E005 列出缺失 skill
197
195
  4. Initialize tracking via `TodoWrite`
198
196
  5. If `--super`: read `maestro-super.md`, follow it completely
199
197
 
@@ -227,7 +225,9 @@ S_FALLBACK:
227
225
  - [ ] status.json 唯一真源;无 markdown 清单;post-goal-audit 节点在 decomposed 时追加;/goal 提示词以 status.json 为判据
228
226
  - [ ] Chain selected and confirmed (or auto-confirmed)
229
227
  - [ ] Session dir created with status.json before execution; decomposition fields additive-only
230
- - [ ] 执行 step 含 `command_scope` + `command_path` + `completion_confirmed` 字段;decision step 通过 `step.decision` 字段标识
228
+ - [ ] 执行 step 含 `command_scope` + `command_path` + `completion_confirmed`;decision step `step.decision` 标识
229
+ - [ ] `command_scope`/`command_path` 由 `maestro ralph skills --json --quiet` 预校验(project 覆盖 global)
230
+ - [ ] Session schema 含 `ralph_protocol_version: "1"` + `active_step_index: null` + step.load 占位
231
231
  - [ ] 用户传入 `-y` 时透传到 skill args
232
232
  - [ ] All chains dispatched via maestro-ralph-execute
233
233
  - [ ] Low-complexity intents routed to maestro-quick
@@ -73,7 +73,7 @@ Other commands:
73
73
  - [ ] Deep questioning completed (threads followed, not rushed) — or extracted from document/brainstorm
74
74
  - [ ] `.workflow/project.md` created with Core Value, Requirements (Validated/Active/Out of Scope), Key Decisions
75
75
  - [ ] `.workflow/state.json` created with artifacts[] array, initialized to idle state
76
- - [ ] `.workflow/config.json` created with user-selected granularity, workflow agents, gate preferences
76
+ - [ ] `.workflow/config.json` created with workflow / execution / git / gates / codebase / guard / collab / specInjection / dashboard segments
77
77
  - [ ] `.workflow/specs/` initialized with convention files
78
78
  - [ ] Research completed (if enabled) — 4 parallel agents spawned
79
79
  - [ ] User knows next step is `/maestro-roadmap` (light) or `/maestro-roadmap --mode full` (spec package)
@@ -136,18 +136,19 @@ Next steps:
136
136
  /maestro-plan {phase} -- Re-plan with modifications
137
137
  ```
138
138
 
139
- **Completion status:**
139
+ **Completion (when invoked from ralph):**
140
+ End the step by calling the CLI (no `--- COMPLETION STATUS ---` text block):
140
141
  ```
141
- --- COMPLETION STATUS ---
142
- STATUS: DONE|NEEDS_CONTEXT
143
- CONCERNS: {description if applicable}
144
- NEXT: /maestro-execute
145
- --- END STATUS ---
142
+ maestro ralph complete <idx> --status DONE [--evidence scratch/{YYYYMMDD}-plan-P{N}-{slug}/plan.json]
146
143
  ```
147
144
 
148
- Status mapping:
149
- - **DONE** — Plan created/revised and confirmed → NEXT: /maestro-execute
150
- - **NEEDS_CONTEXT** — Ambiguous requirements, insufficient context to produce plan
145
+ STATUS verdicts (CLI-enforced enum):
146
+ - **DONE** — Plan created/revised and confirmed → next step picks up automatically
147
+ - **DONE_WITH_CONCERNS** — Plan produced but with explicit caveats; pass `--concerns "..."`
148
+ - **NEEDS_RETRY** — Plan failed (tooling error, transient issue); ralph will retry
149
+ - **BLOCKED** — External hard blocker (e.g., upstream artifact missing, dependency unavailable); pass `--reason "..."`
150
+
151
+ > Ambiguous requirements are NOT a completion status — resolve them in-place via `ask_question` during planning (≤3 rounds), then proceed to DONE. `NEEDS_CONTEXT` has been removed; context shortage is handled by the harness's automatic compaction.
151
152
 
152
153
  ### Mode: Revise / Check
153
154
 
@@ -24,7 +24,7 @@ Entry points:
24
24
  Initial decomposition (S_DECOMPOSE): boundary-clarified via ≤3 questions for broad intents (重构/全面/迁移/重写). 写入 status.json 的 `boundary_contract` / `execution_criteria` / `task_decomposition`,附 `/goal` prompt。
25
25
 
26
26
  Step kinds:
27
- - **执行 step**: ralph-execute `view_file({command_path})` 命令 .md,按内容内联执行
27
+ - **执行 step**: ralph-execute `run_command("maestro ralph next")` 加载 command .md + required_reading 全文,按 stdout 内联执行
28
28
  - **decision step**: `step.decision` 字段非空;回 ralph 评估(CLI 只读分析)
29
29
 
30
30
  Key difference from maestro coordinator:
@@ -42,9 +42,9 @@ Mutual invocation with `/maestro-ralph-execute` forms a self-perpetuating work l
42
42
  │ writes status.json
43
43
  │ emits /goal prompt
44
44
 
45
- ralph-execute ◀─┐ 执行 step → view_file(command_path) inline
45
+ ralph-execute ◀─┐ 执行 step → `maestro ralph next` + inline + `ralph complete`
46
46
  │ │ decision step → Skill("maestro-ralph")
47
- └─────────┘ writes step.completion_confirmed
47
+ └─────────┘ CLI writes step.completion_confirmed
48
48
  loop until all completion_confirmed | paused
49
49
  ```
50
50
  </purpose>
@@ -69,11 +69,11 @@ Remaining → intent
69
69
  1. **Ralph never executes steps** — only creates sessions and evaluates decisions
70
70
  2. **Handoff via Skill("maestro-ralph-execute")** — 创建 session 后始终自动 handoff;decision 评估后始终 handoff
71
71
  3. **Decision delegates read-only** — `maestro delegate --role analyze --mode analysis`
72
- 4. **执行 step 通过 Read 命令 .md 内联执行**
72
+ 4. **执行 step 通过 `maestro ralph next` CLI 加载并内联执行**(详见 invariant 8)
73
73
  5. **status.json 是唯一真源** — 不生成 markdown 清单或侧文件
74
- 6. **每个 step 必须 `completion_confirmed: true`** — 基于 `--- COMPLETION STATUS ---` `STATUS: DONE`;缺失则视为未完成
75
- 7. **command_path 在 A_BUILD_STEPS 解析** — 全局优先 `~/.claude/commands/{name}.md`,fallback 项目 `.claude/commands/{name}.md`,写入 status.json
76
- 8. **执行 step 加载契约** — ralph-execute `command_path` 后,必须解析并加载该命令 `<required_reading>` 引用的所有文件("入口 + workflow"形式的核心),并把 `<deferred_reading>` 路径记录到 `step.deferred_reads`;加载完成后输出 `✓ skill {name} 加载完成`。ralph build 阶段只解析路径,不读 .md 内容
74
+ 6. **每个 step 必须 `completion_confirmed: true`** — `maestro ralph complete N --status DONE`(或 DONE_WITH_CONCERNS)写入;CLI 是唯一合法写入路径
75
+ 7. **command_path 在 A_BUILD_STEPS 解析** — 通过 `maestro ralph skills --json --quiet` 预校验(project 覆盖 global),命中即写绝对路径到 status.json;未命中标 `command_scope = "missing"`
76
+ 8. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成:解析 frontmatter + `<required_reading>` + `<deferred_reading>`,自动读取 required 文件全文并拼入 prompt;缺失 required 退出码 1(E007),pause session。ralph build 阶段只通过 `maestro ralph skills` 校验路径存在性,不读 .md 内容
77
77
  9. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻;`/goal` 用户绑定,ralph 输出提示词后继续 handoff,用户可在执行过程中随时输入 `/goal`
78
78
  10. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → 含 `{phase}`
79
79
  11. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop;字段可选/累加,既有字段不删不改
@@ -395,7 +395,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
395
395
  | goal-audit | *(decision-only)* | *(same)* | `post-goal-audit` | all (only if decomposed) |
396
396
  | milestone-complete | `maestro-milestone-complete` | *(same)* | `post-milestone` | all |
397
397
 
398
- > 所有执行 stage 统一通过 Read .md 内联执行;decision 节点单独作为独立 step 插入(见规则 4)。
398
+ > 所有执行 stage 统一通过 `maestro ralph next` CLI 加载 + 内联执行;decision 节点单独作为独立 step 插入(见规则 4)。
399
399
 
400
400
  **Build rules (按顺序应用):**
401
401
 
@@ -410,11 +410,12 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
410
410
  8. **占位符**:independent 保留 `{phase}` `{intent}`;unified 不带 `{phase}`
411
411
  9. **command_path 解析**(每个执行 step,decision 节点跳过):
412
412
  - 取 skill 名(args 前的第一个 token)
413
- - 全局优先:`~/.claude/commands/{name}.md` 存在 `command_scope = "global"`
414
- - Fallback:`.claude/commands/{name}.md` 存在 → `command_scope = "project"`
415
- - 两者都缺`command_scope = "missing"`, `command_path = null`,A_CREATE_SESSION 报错 E006
416
- - **不在 build 阶段读取 .md 内容**;`<required_reading>` / `<deferred_reading>` 解析与加载由 ralph-execute A_EXEC_STEP 负责(保持入口/工作流分离)
417
- 10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`, `deferred_reads: []`
413
+ - **预校验通过 `run_command("maestro ralph skills --json --quiet")`** 一次性拉取所有可用 commands + skills(global + project,project 覆盖 global),匹配 skill 名得到:
414
+ - 命中 commands → `command_scope = "global" | "project"`,`command_path = <绝对路径>`
415
+ - 命中 skills 同上(type=skill)
416
+ - 未命中 `command_scope = "missing"`, `command_path = null`,A_CREATE_SESSION 报错 E006
417
+ - **不在 build 阶段读取 .md 内容**;`<required_reading>` / `<deferred_reading>` 解析与加载由 `maestro ralph next` CLI 在执行期完成
418
+ 10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`, `deferred_reads: []`, `load: null`(由 `ralph next` 写入)
418
419
  11. **scope_verdict gating**(仅当 chain 起点 = `analyze-macro`):
419
420
  - `scope_verdict ∈ {medium, small}` → 跳过 `roadmap` + `analyze` 两 stage;`plan` 选 standalone 列(`--from analyze:{analyze_macro_id}`),不带 `{phase}`
420
421
  - `scope_verdict == large` → 保留 `roadmap` + `analyze`;`plan` 选 phase 列(`{phase}`)
@@ -593,6 +594,8 @@ Runs only when `task_decomposition` present.
593
594
  {
594
595
  "session_id": "ralph-{YYYYMMDD-HHmmss}",
595
596
  "source": "ralph", "status": "running",
597
+ "ralph_protocol_version": "1", // CLI-driven; absent/0 → legacy inline ralph-execute
598
+ "active_step_index": null, // CLI-managed; only one step held at a time
596
599
  "intent": "", "lifecycle_position": "",
597
600
  "phase": null, "phase_is_new": false,
598
601
  "milestone": "", // D-007 反查结果,禁止读 current_milestone
@@ -615,7 +618,7 @@ Runs only when `task_decomposition` present.
615
618
  "retry_count": 0, // decision 节点专用
616
619
  "max_retries": 2, // decision 节点专用
617
620
  "command_scope": "global|project|missing|null", // 执行 step;decision 节点固定 null
618
- "command_path": "~/.claude/commands/{name}.md | .claude/commands/{name}.md | null",
621
+ "command_path": "<absolute path resolved by `maestro ralph skills --json --quiet`> | null",
619
622
  "milestone_id": null, // D-007 反查注入;仅含 {phase} 占位符的 step 有
620
623
  "source_artifact_ref": null, // "analyze:ANL-xxx" | "blueprint:BLP-xxx" | null
621
624
  "status": "pending|running|completed|skipped|failed",
@@ -624,7 +627,8 @@ Runs only when `task_decomposition` present.
624
627
  "completion_status": null,
625
628
  "completion_evidence": null,
626
629
  "completed_at": null,
627
- "deferred_reads": [] // 由 ralph-execute A_EXEC_STEP 解析 .md 时填充
630
+ "deferred_reads": [], // 由 ralph next CLI 解析 .md 时填充
631
+ "load": null // { loaded_at, required_files[], deferred_files[], resolve_version } —— 由 ralph next 写入
628
632
  }],
629
633
  "waves": [], "current_step": 0,
630
634
 
@@ -745,8 +749,8 @@ decision:post-goal-audit {retry+1}
745
749
  - [ ] quality_mode 由 A_DETERMINE_QUALITY_MODE 决定,过滤 build steps
746
750
  - [ ] Decomposition: broad intent ≤3 question clarify;narrow auto-derive
747
751
  - [ ] status.json 唯一真源:boundary_contract + execution_criteria + task_decomposition;无外部清单
748
- - [ ] 执行 step 含 `command_scope` + `command_path`(全局优先 fallback 项目);decision step 通过 `step.decision` 字段标识
749
- - [ ] Ralph build 阶段只解析路径,不读 .md 内容;`<required_reading>` 加载由 ralph-execute A_EXEC_STEP 完成
752
+ - [ ] 执行 step 含 `command_scope` + `command_path`(通过 `maestro ralph skills --json --quiet` 预校验,project 覆盖 global);decision step 通过 `step.decision` 字段标识
753
+ - [ ] Ralph build 阶段只通过 `ralph skills` 校验路径存在性,不读 .md 内容;`<required_reading>` 加载由 `maestro ralph next` CLI 完成
750
754
  - [ ] 每个 step 含 `completion_confirmed` + `completion_status` + `completion_evidence` + `deferred_reads`(初始 false/null/[])
751
755
  - [ ] 每个 sub-goal 含 `completion_confirmed`(初始 false)
752
756
  - [ ] post-goal-audit decision 仅在 decomposed 时插入,位于 milestone-complete 之前