maestro-flow 0.4.15 → 0.4.16
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/maestro/SKILL.md +17 -17
- package/.agents/skills/maestro-plan/SKILL.md +10 -9
- package/.agents/skills/maestro-ralph/SKILL.md +21 -17
- package/.agents/skills/maestro-ralph-execute/SKILL.md +54 -71
- package/.agents/skills/manage-knowledge-audit/SKILL.md +90 -0
- package/.agy/skills/maestro/SKILL.md +17 -17
- package/.agy/skills/maestro-plan/SKILL.md +10 -9
- package/.agy/skills/maestro-ralph/SKILL.md +21 -17
- package/.agy/skills/maestro-ralph-execute/SKILL.md +54 -71
- package/.agy/skills/manage-knowledge-audit/SKILL.md +90 -0
- package/.claude/commands/maestro-plan.md +10 -9
- package/.claude/commands/maestro-ralph-execute.md +54 -71
- package/.claude/commands/maestro-ralph.md +21 -17
- package/.claude/commands/maestro.md +17 -17
- package/.claude/commands/manage-knowledge-audit.md +88 -0
- package/dist/src/cli.js +1 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/font-guide.d.ts +13 -0
- package/dist/src/commands/font-guide.d.ts.map +1 -0
- package/dist/src/commands/font-guide.js +114 -0
- package/dist/src/commands/font-guide.js.map +1 -0
- package/dist/src/commands/install.d.ts.map +1 -1
- package/dist/src/commands/install.js +5 -0
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/ralph.d.ts +6 -0
- package/dist/src/commands/ralph.d.ts.map +1 -0
- package/dist/src/commands/ralph.js +133 -0
- package/dist/src/commands/ralph.js.map +1 -0
- package/dist/src/core/manifest.d.ts +2 -0
- package/dist/src/core/manifest.d.ts.map +1 -1
- package/dist/src/core/manifest.js.map +1 -1
- package/dist/src/hooks/statusline.d.ts.map +1 -1
- package/dist/src/hooks/statusline.js +189 -81
- package/dist/src/hooks/statusline.js.map +1 -1
- package/dist/src/ralph/cmd-check.d.ts +9 -0
- package/dist/src/ralph/cmd-check.d.ts.map +1 -0
- package/dist/src/ralph/cmd-check.js +53 -0
- package/dist/src/ralph/cmd-check.js.map +1 -0
- package/dist/src/ralph/cmd-complete.d.ts +10 -0
- package/dist/src/ralph/cmd-complete.d.ts.map +1 -0
- package/dist/src/ralph/cmd-complete.js +91 -0
- package/dist/src/ralph/cmd-complete.js.map +1 -0
- package/dist/src/ralph/cmd-next.d.ts +5 -0
- package/dist/src/ralph/cmd-next.d.ts.map +1 -0
- package/dist/src/ralph/cmd-next.js +158 -0
- package/dist/src/ralph/cmd-next.js.map +1 -0
- package/dist/src/ralph/cmd-session.d.ts +5 -0
- package/dist/src/ralph/cmd-session.d.ts.map +1 -0
- package/dist/src/ralph/cmd-session.js +52 -0
- package/dist/src/ralph/cmd-session.js.map +1 -0
- package/dist/src/ralph/cmd-skills.d.ts +6 -0
- package/dist/src/ralph/cmd-skills.d.ts.map +1 -0
- package/dist/src/ralph/cmd-skills.js +55 -0
- package/dist/src/ralph/cmd-skills.js.map +1 -0
- package/dist/src/ralph/skill-resolver.d.ts +40 -0
- package/dist/src/ralph/skill-resolver.d.ts.map +1 -0
- package/dist/src/ralph/skill-resolver.js +162 -0
- package/dist/src/ralph/skill-resolver.js.map +1 -0
- package/dist/src/ralph/skill-scanner.d.ts +15 -0
- package/dist/src/ralph/skill-scanner.d.ts.map +1 -0
- package/dist/src/ralph/skill-scanner.js +122 -0
- package/dist/src/ralph/skill-scanner.js.map +1 -0
- package/dist/src/ralph/status-checker.d.ts +7 -0
- package/dist/src/ralph/status-checker.d.ts.map +1 -0
- package/dist/src/ralph/status-checker.js +139 -0
- package/dist/src/ralph/status-checker.js.map +1 -0
- package/dist/src/ralph/status-schema.d.ts +94 -0
- package/dist/src/ralph/status-schema.d.ts.map +1 -0
- package/dist/src/ralph/status-schema.js +9 -0
- package/dist/src/ralph/status-schema.js.map +1 -0
- package/dist/src/ralph/status-store.d.ts +20 -0
- package/dist/src/ralph/status-store.d.ts.map +1 -0
- package/dist/src/ralph/status-store.js +70 -0
- package/dist/src/ralph/status-store.js.map +1 -0
- package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ExecutionView.js +1 -0
- package/dist/src/tui/install-ui/ExecutionView.js.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.js +2 -0
- package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +28 -14
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.js +1 -1
- package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
- package/dist/src/utils/update-notices.js +12 -0
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +1 -1
- package/workflows/knowledge-audit.md +358 -0
|
@@ -51,11 +51,11 @@ $ARGUMENTS — user intent text, or special keywords.
|
|
|
51
51
|
3. **Auto flag pass-through** — 仅当用户传入 `-y` 时透传 `-y` 到 skill args
|
|
52
52
|
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`
|
|
53
53
|
5. **status.json 唯一真源** — 不生成 `goal-checklist.md` 或外部清单
|
|
54
|
-
6.
|
|
55
|
-
7. **Topology awareness** — chain catalog 含 brainstorm / blueprint / analyze-macro
|
|
56
|
-
8. **D-007 milestone 反查** — 数字 phase
|
|
57
|
-
9. **每个 step 必须 `completion_confirmed: true`** —
|
|
58
|
-
10. **schema
|
|
54
|
+
6. **执行步骤统一通过 `maestro ralph next` 加载** — `command_scope`/`command_path` 由 `maestro ralph skills --json --quiet` 预校验(project 覆盖 global);decision 节点不走 CLI,走 `invoke_skill("maestro-ralph")` handoff
|
|
55
|
+
7. **Topology awareness** — chain catalog 含 brainstorm / blueprint / analyze-macro / analyze / roadmap / plan(三路径) / execute / verify / ...;scope_verdict 由 ralph 在 `post-analyze-scope` 决定
|
|
56
|
+
8. **D-007 milestone 反查** — 数字 phase 的 `milestone_id` 由 `state.json.milestones[].phase_slugs` 反查
|
|
57
|
+
9. **每个 step 必须 `completion_confirmed: true`** — 由 `maestro ralph complete N --status DONE|DONE_WITH_CONCERNS` 写入
|
|
58
|
+
10. **schema** — `ralph_protocol_version: "1"` 标记 CLI-driven session;新增字段全部可选
|
|
59
59
|
</invariants>
|
|
60
60
|
|
|
61
61
|
<state_machine>
|
|
@@ -141,7 +141,7 @@ S_FALLBACK:
|
|
|
141
141
|
- 数字 phase 上下文 → `analyze {phase}` → `plan {phase}` → `execute {phase}` → `verify {phase}` → quality pipeline
|
|
142
142
|
- 已有 analyze artifact 想直达执行 → `plan --from analyze:{ANL_ID}` → execute → verify
|
|
143
143
|
- 已有 blueprint artifact → `plan --from blueprint:{BLP_ID}` → execute → verify
|
|
144
|
-
4. 执行 step
|
|
144
|
+
4. 执行 step:`shell("maestro ralph skills --json --quiet")` 预校验 skill 名,命中写绝对路径到 `command_path`,未命中标 `missing`;同时写 `step.stage` / `step.scope` / `step.source_artifact_ref`。decision 节点不解析 command_path
|
|
145
145
|
|
|
146
146
|
### A_CLARIFY
|
|
147
147
|
|
|
@@ -171,30 +171,28 @@ S_FALLBACK:
|
|
|
171
171
|
```json
|
|
172
172
|
{
|
|
173
173
|
"session_id", "source": "maestro", "intent", "task_type", "chain_name",
|
|
174
|
+
"ralph_protocol_version": "1", "active_step_index": null,
|
|
174
175
|
"phase", "phase_is_new": false, "milestone": "",
|
|
175
176
|
"scope_verdict": null, "analyze_macro_id": null, "blueprint_id": null,
|
|
176
|
-
"auto_mode": false, "cli_tool": "claude",
|
|
177
|
+
"auto_mode": false, "cli_tool": "claude",
|
|
177
178
|
"context": { "scratch_dir": null, "plan_dir": null, "analysis_dir": null,
|
|
178
179
|
"brainstorm_dir": null, "blueprint_dir": null, "issue_id": null },
|
|
179
180
|
"steps": [{
|
|
180
|
-
"index": 0,
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"decision": null, // 非 null → decision 节点;null → 执行节点
|
|
184
|
-
"command_scope": "global|project|missing|null",
|
|
185
|
-
"command_path": "~/.claude/commands/{name}.md | .claude/commands/{name}.md | null",
|
|
181
|
+
"index": 0, "skill": "", "args": "",
|
|
182
|
+
"stage": "", "scope": null, "decision": null,
|
|
183
|
+
"command_scope": "global|project|missing|null", "command_path": "<abs> | null",
|
|
186
184
|
"milestone_id": null, "source_artifact_ref": null,
|
|
187
185
|
"status": "pending", "goal_ref": null,
|
|
188
186
|
"completion_confirmed": false, "completion_status": null,
|
|
189
|
-
"completion_evidence": null, "completed_at": null
|
|
187
|
+
"completion_evidence": null, "completed_at": null,
|
|
188
|
+
"deferred_reads": [], "load": null
|
|
190
189
|
}],
|
|
191
190
|
"waves": [], "current_step": 0, "status": "running",
|
|
192
191
|
"boundary_contract": {}, "execution_criteria": [],
|
|
193
192
|
"task_decomposition": [], "task_decomposition_all_done": false
|
|
194
193
|
}
|
|
195
194
|
```
|
|
196
|
-
|
|
197
|
-
3. Validate: 所有 step 的 `command_scope != "missing"`;否则 raise E005 列出缺失 skill
|
|
195
|
+
3. Validate: 所有 step 的 `command_scope != "missing"`,否则 raise E005 列出缺失 skill
|
|
198
196
|
4. Initialize tracking via `track_tasks`
|
|
199
197
|
5. If `--super`: read `maestro-super.md`, follow it completely
|
|
200
198
|
|
|
@@ -228,7 +226,9 @@ S_FALLBACK:
|
|
|
228
226
|
- [ ] status.json 唯一真源;无 markdown 清单;post-goal-audit 节点在 decomposed 时追加;/goal 提示词以 status.json 为判据
|
|
229
227
|
- [ ] Chain selected and confirmed (or auto-confirmed)
|
|
230
228
|
- [ ] Session dir created with status.json before execution; decomposition fields additive-only
|
|
231
|
-
- [ ] 执行 step 含 `command_scope` + `command_path` + `completion_confirmed
|
|
229
|
+
- [ ] 执行 step 含 `command_scope` + `command_path` + `completion_confirmed`;decision step 由 `step.decision` 标识
|
|
230
|
+
- [ ] `command_scope`/`command_path` 由 `maestro ralph skills --json --quiet` 预校验(project 覆盖 global)
|
|
231
|
+
- [ ] Session schema 含 `ralph_protocol_version: "1"` + `active_step_index: null` + step.load 占位
|
|
232
232
|
- [ ] 用户传入 `-y` 时透传到 skill args
|
|
233
233
|
- [ ] All chains dispatched via maestro-ralph-execute
|
|
234
234
|
- [ ] Low-complexity intents routed to maestro-quick
|
|
@@ -136,18 +136,19 @@ Next steps:
|
|
|
136
136
|
/maestro-plan {phase} -- Re-plan with modifications
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
**Completion
|
|
139
|
+
**Completion (when invoked from ralph):**
|
|
140
|
+
End the step by calling the CLI (no `--- COMPLETION STATUS ---` text block):
|
|
140
141
|
```
|
|
141
|
-
|
|
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
|
-
|
|
149
|
-
- **DONE** — Plan created/revised and confirmed →
|
|
150
|
-
- **
|
|
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_user` 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
|
|
|
@@ -28,7 +28,7 @@ Entry points:
|
|
|
28
28
|
Initial decomposition (S_DECOMPOSE): boundary-clarified via ≤3 questions for broad intents (重构/全面/迁移/重写). 写入 status.json 的 `boundary_contract` / `execution_criteria` / `task_decomposition`,附 `/goal` prompt。
|
|
29
29
|
|
|
30
30
|
Step kinds:
|
|
31
|
-
- **执行 step**: ralph-execute `
|
|
31
|
+
- **执行 step**: ralph-execute 调 `shell("maestro ralph next")` 加载 command .md + required_reading 全文,按 stdout 内联执行
|
|
32
32
|
- **decision step**: `step.decision` 字段非空;回 ralph 评估(CLI 只读分析)
|
|
33
33
|
|
|
34
34
|
Key difference from maestro coordinator:
|
|
@@ -46,9 +46,9 @@ Mutual invocation with `/maestro-ralph-execute` forms a self-perpetuating work l
|
|
|
46
46
|
│ writes status.json
|
|
47
47
|
│ emits /goal prompt
|
|
48
48
|
▼
|
|
49
|
-
ralph-execute ◀─┐ 执行 step →
|
|
49
|
+
ralph-execute ◀─┐ 执行 step → `maestro ralph next` + inline + `ralph complete`
|
|
50
50
|
│ │ decision step → invoke_skill("maestro-ralph")
|
|
51
|
-
└─────────┘ writes step.completion_confirmed
|
|
51
|
+
└─────────┘ CLI writes step.completion_confirmed
|
|
52
52
|
loop until all completion_confirmed | paused
|
|
53
53
|
```
|
|
54
54
|
</purpose>
|
|
@@ -73,11 +73,11 @@ Remaining → intent
|
|
|
73
73
|
1. **Ralph never executes steps** — only creates sessions and evaluates decisions
|
|
74
74
|
2. **Handoff via invoke_skill("maestro-ralph-execute")** — 创建 session 后始终自动 handoff;decision 评估后始终 handoff
|
|
75
75
|
3. **Decision delegates read-only** — `maestro delegate --role analyze --mode analysis`
|
|
76
|
-
4. **执行 step 通过
|
|
76
|
+
4. **执行 step 通过 `maestro ralph next` CLI 加载并内联执行**(详见 invariant 8)
|
|
77
77
|
5. **status.json 是唯一真源** — 不生成 markdown 清单或侧文件
|
|
78
|
-
6. **每个 step 必须 `completion_confirmed: true`** —
|
|
79
|
-
7. **command_path 在 A_BUILD_STEPS 解析** —
|
|
80
|
-
8. **执行 step 加载契约** — ralph
|
|
78
|
+
6. **每个 step 必须 `completion_confirmed: true`** — 由 `maestro ralph complete N --status DONE`(或 DONE_WITH_CONCERNS)写入;CLI 是唯一合法写入路径
|
|
79
|
+
7. **command_path 在 A_BUILD_STEPS 解析** — 通过 `maestro ralph skills --json --quiet` 预校验(project 覆盖 global),命中即写绝对路径到 status.json;未命中标 `command_scope = "missing"`
|
|
80
|
+
8. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成:解析 frontmatter + `<required_reading>` + `<deferred_reading>`,自动读取 required 文件全文并拼入 prompt;缺失 required → 退出码 1(E007),pause session。ralph build 阶段只通过 `maestro ralph skills` 校验路径存在性,不读 .md 内容
|
|
81
81
|
9. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻;`/goal` 用户绑定,ralph 输出提示词后继续 handoff,用户可在执行过程中随时输入 `/goal`
|
|
82
82
|
10. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → 含 `{phase}`
|
|
83
83
|
11. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop;字段可选/累加,既有字段不删不改
|
|
@@ -399,7 +399,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
|
|
|
399
399
|
| goal-audit | *(decision-only)* | *(same)* | `post-goal-audit` | all (only if decomposed) |
|
|
400
400
|
| milestone-complete | `maestro-milestone-complete` | *(same)* | `post-milestone` | all |
|
|
401
401
|
|
|
402
|
-
> 所有执行 stage 统一通过
|
|
402
|
+
> 所有执行 stage 统一通过 `maestro ralph next` CLI 加载 + 内联执行;decision 节点单独作为独立 step 插入(见规则 4)。
|
|
403
403
|
|
|
404
404
|
**Build rules (按顺序应用):**
|
|
405
405
|
|
|
@@ -414,11 +414,12 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
|
|
|
414
414
|
8. **占位符**:independent 保留 `{phase}` `{intent}`;unified 不带 `{phase}`
|
|
415
415
|
9. **command_path 解析**(每个执行 step,decision 节点跳过):
|
|
416
416
|
- 取 skill 名(args 前的第一个 token)
|
|
417
|
-
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
417
|
+
- **预校验通过 `shell("maestro ralph skills --json --quiet")`** 一次性拉取所有可用 commands + skills(global + project,project 覆盖 global),匹配 skill 名得到:
|
|
418
|
+
- 命中 commands → `command_scope = "global" | "project"`,`command_path = <绝对路径>`
|
|
419
|
+
- 命中 skills → 同上(type=skill)
|
|
420
|
+
- 未命中 → `command_scope = "missing"`, `command_path = null`,A_CREATE_SESSION 报错 E006
|
|
421
|
+
- **不在 build 阶段读取 .md 内容**;`<required_reading>` / `<deferred_reading>` 解析与加载由 `maestro ralph next` CLI 在执行期完成
|
|
422
|
+
10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`, `deferred_reads: []`, `load: null`(由 `ralph next` 写入)
|
|
422
423
|
11. **scope_verdict gating**(仅当 chain 起点 = `analyze-macro`):
|
|
423
424
|
- `scope_verdict ∈ {medium, small}` → 跳过 `roadmap` + `analyze` 两 stage;`plan` 选 standalone 列(`--from analyze:{analyze_macro_id}`),不带 `{phase}`
|
|
424
425
|
- `scope_verdict == large` → 保留 `roadmap` + `analyze`;`plan` 选 phase 列(`{phase}`)
|
|
@@ -597,6 +598,8 @@ Runs only when `task_decomposition` present.
|
|
|
597
598
|
{
|
|
598
599
|
"session_id": "ralph-{YYYYMMDD-HHmmss}",
|
|
599
600
|
"source": "ralph", "status": "running",
|
|
601
|
+
"ralph_protocol_version": "1", // CLI-driven; absent/0 → legacy inline ralph-execute
|
|
602
|
+
"active_step_index": null, // CLI-managed; only one step held at a time
|
|
600
603
|
"intent": "", "lifecycle_position": "",
|
|
601
604
|
"phase": null, "phase_is_new": false,
|
|
602
605
|
"milestone": "", // D-007 反查结果,禁止读 current_milestone
|
|
@@ -619,7 +622,7 @@ Runs only when `task_decomposition` present.
|
|
|
619
622
|
"retry_count": 0, // decision 节点专用
|
|
620
623
|
"max_retries": 2, // decision 节点专用
|
|
621
624
|
"command_scope": "global|project|missing|null", // 执行 step;decision 节点固定 null
|
|
622
|
-
"command_path": "
|
|
625
|
+
"command_path": "<absolute path resolved by `maestro ralph skills --json --quiet`> | null",
|
|
623
626
|
"milestone_id": null, // D-007 反查注入;仅含 {phase} 占位符的 step 有
|
|
624
627
|
"source_artifact_ref": null, // "analyze:ANL-xxx" | "blueprint:BLP-xxx" | null
|
|
625
628
|
"status": "pending|running|completed|skipped|failed",
|
|
@@ -628,7 +631,8 @@ Runs only when `task_decomposition` present.
|
|
|
628
631
|
"completion_status": null,
|
|
629
632
|
"completion_evidence": null,
|
|
630
633
|
"completed_at": null,
|
|
631
|
-
"deferred_reads": []
|
|
634
|
+
"deferred_reads": [], // 由 ralph next CLI 解析 .md 时填充
|
|
635
|
+
"load": null // { loaded_at, required_files[], deferred_files[], resolve_version } —— 由 ralph next 写入
|
|
632
636
|
}],
|
|
633
637
|
"waves": [], "current_step": 0,
|
|
634
638
|
|
|
@@ -749,8 +753,8 @@ decision:post-goal-audit {retry+1}
|
|
|
749
753
|
- [ ] quality_mode 由 A_DETERMINE_QUALITY_MODE 决定,过滤 build steps
|
|
750
754
|
- [ ] Decomposition: broad intent ≤3 question clarify;narrow auto-derive
|
|
751
755
|
- [ ] status.json 唯一真源:boundary_contract + execution_criteria + task_decomposition;无外部清单
|
|
752
|
-
- [ ] 执行 step 含 `command_scope` + `command_path
|
|
753
|
-
- [ ] Ralph build
|
|
756
|
+
- [ ] 执行 step 含 `command_scope` + `command_path`(通过 `maestro ralph skills --json --quiet` 预校验,project 覆盖 global);decision step 通过 `step.decision` 字段标识
|
|
757
|
+
- [ ] Ralph build 阶段只通过 `ralph skills` 校验路径存在性,不读 .md 内容;`<required_reading>` 加载由 `maestro ralph next` CLI 完成
|
|
754
758
|
- [ ] 每个 step 含 `completion_confirmed` + `completion_status` + `completion_evidence` + `deferred_reads`(初始 false/null/[])
|
|
755
759
|
- [ ] 每个 sub-goal 含 `completion_confirmed`(初始 false)
|
|
756
760
|
- [ ] post-goal-audit decision 仅在 decomposed 时插入,位于 milestone-complete 之前
|
|
@@ -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` | `
|
|
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
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
- `
|
|
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. **执行 =
|
|
51
|
-
2. **Required reading
|
|
52
|
-
3. **Deferred reading recorded only** — `<deferred_reading>`
|
|
53
|
-
4.
|
|
54
|
-
5.
|
|
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
|
|
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 +
|
|
84
|
-
→ S_HANDLE_FAIL WHEN: step.decision == null +
|
|
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:
|
|
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[],
|
|
111
|
-
4.
|
|
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.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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.
|
|
196
|
-
2.
|
|
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
|
-
|
|
201
|
-
|
|
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
|
-
|
|
206
|
-
|
|
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
|
-
|
|
|
242
|
-
|
|
|
243
|
-
|
|
|
244
|
-
|
|
|
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
|
-
|
|
|
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
|
|
254
|
-
- [ ] 执行 step 通过
|
|
255
|
-
- [ ]
|
|
256
|
-
- [ ] `<deferred_reading>`
|
|
257
|
-
- [ ]
|
|
258
|
-
- [ ]
|
|
259
|
-
- [ ]
|
|
260
|
-
- [ ] step.completion_evidence
|
|
261
|
-
- [ ] Context signals
|
|
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.
|
|
54
|
-
7. **Topology awareness** — chain catalog 含 brainstorm / blueprint / analyze-macro
|
|
55
|
-
8. **D-007 milestone 反查** — 数字 phase
|
|
56
|
-
9. **每个 step 必须 `completion_confirmed: true`** —
|
|
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
|
|
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",
|
|
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
|
-
"
|
|
181
|
-
"
|
|
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
|
-
|
|
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
|
|
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
|
|
@@ -136,18 +136,19 @@ Next steps:
|
|
|
136
136
|
/maestro-plan {phase} -- Re-plan with modifications
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
**Completion
|
|
139
|
+
**Completion (when invoked from ralph):**
|
|
140
|
+
End the step by calling the CLI (no `--- COMPLETION STATUS ---` text block):
|
|
140
141
|
```
|
|
141
|
-
|
|
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
|
-
|
|
149
|
-
- **DONE** — Plan created/revised and confirmed →
|
|
150
|
-
- **
|
|
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
|
|