maestro-flow 0.5.44 → 0.5.45
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/agents/ralph-executor.md +48 -0
- package/.agents/skills/maestro-ralph-cli/SKILL.md +21 -16
- package/.agents/skills/{maestro-ralph-agent → maestro-ralph-v2}/SKILL.md +337 -174
- package/.agy/agents/ralph-executor.md +44 -0
- package/.agy/skills/maestro-ralph-cli/SKILL.md +21 -16
- package/.agy/skills/{maestro-ralph-agent → maestro-ralph-v2}/SKILL.md +351 -174
- package/.claude/agents/ralph-executor.md +46 -0
- package/.claude/commands/maestro-ralph-cli.md +21 -16
- package/.claude/commands/{maestro-ralph-agent.md → maestro-ralph-v2.md} +337 -174
- package/.codex/skills/maestro-next/SKILL.md +1 -1
- package/package.json +1 -1
- package/.agents/skills/maestro-ralph-agent-execute/SKILL.md +0 -461
- package/.agy/skills/maestro-ralph-agent-execute/SKILL.md +0 -457
- package/.claude/commands/maestro-ralph-agent-execute.md +0 -459
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: maestro-ralph-
|
|
3
|
-
description:
|
|
2
|
+
name: maestro-ralph-v2
|
|
3
|
+
description: Adaptive lifecycle orchestrator — compose, dispatch ralph-executor agent, evaluate decision, loop
|
|
4
4
|
argument-hint: "<intent> [-y] [--amend [change]] [--roadmap] | status | continue"
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- Read
|
|
@@ -14,11 +14,9 @@ allowed-tools:
|
|
|
14
14
|
- Agent
|
|
15
15
|
---
|
|
16
16
|
<purpose>
|
|
17
|
-
|
|
17
|
+
Adaptive lifecycle orchestrator: locate step → resolve args → load context → dispatch Agent(ralph-executor) per step (agent 调 `ralph next` + 执行) → extract signals → drift check → ralph complete → evaluate decision → next step → loop.
|
|
18
18
|
|
|
19
|
-
Session: `.workflow/.maestro/ralph-
|
|
20
|
-
|
|
21
|
-
Chain building(A_RESOLVE_PHASE → A_INFER_POSITION → A_BUILD_STEPS)、session schema、decomposition(A_DECOMPOSE_TASKS)逻辑同 ralph。
|
|
19
|
+
Session: `.workflow/.maestro/ralph-v2-{YYYYMMDD-HHmmss}/status.json`
|
|
22
20
|
</purpose>
|
|
23
21
|
|
|
24
22
|
<deferred_reading>
|
|
@@ -40,25 +38,31 @@ Remaining → intent (amend_mode 时为 change_request)
|
|
|
40
38
|
|
|
41
39
|
**State files**:
|
|
42
40
|
- `.workflow/state.json` — artifact registry
|
|
43
|
-
- `.workflow/.maestro/ralph-
|
|
41
|
+
- `.workflow/.maestro/ralph-v2-*/status.json` — session state
|
|
44
42
|
</context>
|
|
45
43
|
|
|
46
44
|
<invariants>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
1. **Ralph-v2 owns the full loop** — locate step → resolve args → load context → dispatch agent → extract signals → drift → complete,全部在本命令内完成
|
|
46
|
+
2. **One agent per step** — 每个执行 step 派发一个 executor agent,agent 执行完返回,主流程解析结果后决定下一步
|
|
47
|
+
3. **Agent is a thin wrapper** — executor agent 调 `ralph next` 获取 skill prompt 并执行,返回输出;arg resolution、context loading、signal extraction、drift analysis、ralph complete 均由主流程完成
|
|
48
|
+
4. **Synchronous dispatch** — Agent() 调用是同步的(等待返回),不需要 STOP/callback 模式
|
|
49
|
+
5. **主流程调 `ralph complete`** — 每个 step 完成后由主流程调 `maestro ralph complete`,非 agent 上报
|
|
50
|
+
6. **Decision evaluation inline** — decision 节点不 handoff,通过 `Agent()` 启动分析 Agent 在本循环内评估
|
|
51
|
+
7. **No CLI delegation** — 本命令不使用 `maestro delegate`;执行和评估均通过 Agent() 完成
|
|
52
|
+
8. **Decision delegates read-only** — 评估 Agent 通过 prompt 中的 CONSTRAINTS 约束为只读
|
|
53
|
+
9. **执行 step 通过 `maestro ralph next` CLI 加载并内联执行**(由 execute Agent 完成)
|
|
54
|
+
10. **status.json 是唯一真源** — 不生成 markdown 清单或侧文件
|
|
55
|
+
11. **每个 step 必须 `completion_confirmed: true`** — 由 `maestro ralph complete N --status DONE`(或 DONE_WITH_CONCERNS)写入;CLI 是唯一合法写入路径
|
|
56
|
+
12. **command_path 在 A_BUILD_STEPS 解析** — 通过 `maestro ralph skills --platform claude --json --quiet` 预校验
|
|
57
|
+
13. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成
|
|
58
|
+
14. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻
|
|
59
|
+
15. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → 含 `{phase}`
|
|
60
|
+
16. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop
|
|
61
|
+
17. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作
|
|
62
|
+
18. **Evaluate fallback 必须标记** — 评估 Agent 解析 verdict 失败时 fallback 为 "fix",MUST 在 decisions.ndjson 记录 `"parse_failed": true, "confidence_score": 0`
|
|
63
|
+
19. **auto_confirm 单一来源** — `auto_confirm` 仅由用户 `-y` 标志设定
|
|
64
|
+
20. **分解契约单一所有者** — `boundary_contract` / `task_decomposition` 由 session 创建者拥有
|
|
65
|
+
21. **控制权优先级(范式治理)** — FSM 独占 session 生命周期 + step 排序 + retry/fix/escalate + cross-step decision 节点
|
|
62
66
|
</invariants>
|
|
63
67
|
|
|
64
68
|
<state_machine>
|
|
@@ -79,8 +83,12 @@ S_BUILD_CHAIN — 构建步骤链(build rules 0-14)
|
|
|
79
83
|
S_CREATE_SESSION — 写 status.json PERSIST: session (全量)
|
|
80
84
|
S_CONFIRM — 用户确认
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
S_STEP_LOCATE — 找下一个 pending step PERSIST: —
|
|
87
|
+
S_STEP_RESOLVE — 解析占位符 + 丰富参数 PERSIST: step.args (enriched)
|
|
88
|
+
S_STEP_DISPATCH — 组装上下文 + 派发 executor agent 执行单步 PERSIST: step.agent_exec_name, step.status = "running"
|
|
89
|
+
S_STEP_ANALYZE — 提取信号 + 组装 completion 参数 PERSIST: —
|
|
90
|
+
S_STEP_DRIFT — 产物 vs 目标偏离分析 PERSIST: step.drift_score
|
|
91
|
+
S_STEP_COMPLETE — 调 `ralph complete` 上报 PERSIST: step.completion_*
|
|
84
92
|
S_DECISION_EVAL — 启动分析 Agent 评估质量门 PERSIST: —
|
|
85
93
|
S_APPLY_VERDICT — 应用裁决 PERSIST: session.steps[]
|
|
86
94
|
S_SESSION_DONE — 所有 step 完成 PERSIST: session.status
|
|
@@ -104,31 +112,48 @@ S_STATUS:
|
|
|
104
112
|
→ END DO: A_SHOW_STATUS
|
|
105
113
|
|
|
106
114
|
S_CONTINUE:
|
|
107
|
-
→
|
|
115
|
+
→ S_STEP_LOCATE WHEN: running session found
|
|
108
116
|
→ S_FALLBACK WHEN: no running session
|
|
109
117
|
|
|
110
118
|
S_AMEND_GOAL:
|
|
111
|
-
→
|
|
119
|
+
→ S_STEP_LOCATE WHEN: change applied + user confirmed DO: A_AMEND_GOAL
|
|
112
120
|
→ END WHEN: user cancels
|
|
113
121
|
GUARD: RISK_LEVEL=high → auto_confirm 无效
|
|
114
122
|
|
|
115
123
|
S_CREATE_SESSION:
|
|
116
|
-
→ S_CONFIRM
|
|
117
|
-
→
|
|
124
|
+
→ S_CONFIRM WHEN: not auto_confirm
|
|
125
|
+
→ S_STEP_LOCATE WHEN: auto_confirm
|
|
118
126
|
|
|
119
127
|
S_CONFIRM:
|
|
120
|
-
→
|
|
121
|
-
→ S_BUILD_CHAIN
|
|
122
|
-
→ END
|
|
128
|
+
→ S_STEP_LOCATE WHEN: user confirms
|
|
129
|
+
→ S_BUILD_CHAIN WHEN: user edits
|
|
130
|
+
→ END WHEN: user cancels
|
|
131
|
+
|
|
132
|
+
S_STEP_LOCATE:
|
|
133
|
+
→ S_STEP_RESOLVE WHEN: pending execution step found (step.decision == null)
|
|
134
|
+
→ S_DECISION_EVAL WHEN: pending decision step found (step.decision != null)
|
|
135
|
+
→ S_SESSION_DONE WHEN: no pending steps (all completed/skipped)
|
|
136
|
+
→ S_HANDLE_FAIL WHEN: has failed step and no pending
|
|
137
|
+
→ S_FALLBACK WHEN: no running session
|
|
138
|
+
|
|
139
|
+
S_STEP_RESOLVE:
|
|
140
|
+
→ S_STEP_DISPATCH DO: A_STEP_RESOLVE_ARGS
|
|
123
141
|
|
|
124
|
-
|
|
125
|
-
→
|
|
142
|
+
S_STEP_DISPATCH:
|
|
143
|
+
→ S_STEP_ANALYZE WHEN: agent returned output DO: A_STEP_DISPATCH
|
|
144
|
+
→ S_HANDLE_FAIL WHEN: agent returned error/null DO: A_STEP_DISPATCH
|
|
126
145
|
|
|
127
|
-
|
|
128
|
-
→
|
|
129
|
-
→
|
|
130
|
-
|
|
131
|
-
|
|
146
|
+
S_STEP_ANALYZE:
|
|
147
|
+
→ S_STEP_DRIFT WHEN: STATUS == DONE|DONE_WITH_CONCERNS DO: A_STEP_EXTRACT
|
|
148
|
+
→ S_HANDLE_FAIL WHEN: STATUS == NEEDS_RETRY|BLOCKED DO: A_STEP_EXTRACT
|
|
149
|
+
|
|
150
|
+
S_STEP_DRIFT:
|
|
151
|
+
→ S_STEP_COMPLETE WHEN: ALIGNED|MINOR_DRIFT DO: A_STEP_DRIFT_ANALYZE
|
|
152
|
+
→ S_STEP_DISPATCH WHEN: MAJOR_DRIFT + not retried DO: A_STEP_DRIFT_ANALYZE (ralph retry + re-execute)
|
|
153
|
+
→ S_STEP_COMPLETE WHEN: MAJOR_DRIFT + retried DO: A_STEP_DRIFT_ANALYZE (DONE_WITH_CONCERNS)
|
|
154
|
+
|
|
155
|
+
S_STEP_COMPLETE:
|
|
156
|
+
→ S_STEP_LOCATE DO: A_STEP_COMPLETE (loop to next step)
|
|
132
157
|
|
|
133
158
|
S_DECISION_EVAL: (decision 节点 == `step.decision` 非空)
|
|
134
159
|
→ S_APPLY_VERDICT WHEN: quality-gate (post-execute, post-business-test, post-review, post-test, post-frontend-verify)
|
|
@@ -143,20 +168,20 @@ S_DECISION_EVAL: (decision 节点 == `step.decision` 非空)
|
|
|
143
168
|
DO: A_STRUCTURAL_EVALUATE
|
|
144
169
|
|
|
145
170
|
S_APPLY_VERDICT:
|
|
146
|
-
→
|
|
147
|
-
→
|
|
148
|
-
→
|
|
171
|
+
→ S_STEP_LOCATE WHEN: verdict == "proceed" DO: A_APPLY_PROCEED
|
|
172
|
+
→ S_STEP_LOCATE WHEN: post-goal-audit + has_unmet DO: A_APPLY_GOAL_FIX
|
|
173
|
+
→ S_STEP_LOCATE WHEN: post-goal-audit + all_met + INTENT_ALIGNED=true DO: A_APPLY_GOAL_DONE
|
|
149
174
|
→ END WHEN: post-goal-audit + all_met + INTENT_ALIGNED=false DO: A_REGROUND_HALT
|
|
150
|
-
→
|
|
151
|
-
→
|
|
152
|
-
→
|
|
153
|
-
→
|
|
175
|
+
→ S_STEP_LOCATE WHEN: post-analyze-scope DO: A_APPLY_SCOPE_VERDICT
|
|
176
|
+
→ S_STEP_LOCATE WHEN: verdict == "fix" DO: A_APPLY_FIX
|
|
177
|
+
→ S_STEP_LOCATE WHEN: verdict == "escalate" DO: A_APPLY_ESCALATE
|
|
178
|
+
→ S_STEP_LOCATE WHEN: post-milestone + standard + next milestone DO: A_ADVANCE_MILESTONE
|
|
154
179
|
→ END WHEN: post-milestone + standard + no next milestone
|
|
155
180
|
→ END WHEN: post-milestone + adhoc DO: mark completed (set current_milestone = null)
|
|
156
181
|
→ END WHEN: post-debug-escalate DO: A_PAUSE_ESCALATE
|
|
157
182
|
→ END WHEN: post-reground + drifted + confidence >= 60 DO: A_REGROUND_HALT
|
|
158
|
-
→
|
|
159
|
-
→
|
|
183
|
+
→ S_STEP_LOCATE WHEN: post-reground + aligned DO: A_APPLY_PROCEED
|
|
184
|
+
→ S_STEP_LOCATE WHEN: post-reground + drifted + confidence < 60 DO: A_APPLY_PROCEED (标 LOW CONFIDENCE)
|
|
160
185
|
GUARD: retry_count >= max_retries → force escalate
|
|
161
186
|
GUARD: confidence_score < 60 AND proceed → override to fix
|
|
162
187
|
GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
|
|
@@ -165,10 +190,10 @@ S_APPLY_VERDICT:
|
|
|
165
190
|
GUARD: post-reground + drifted + confidence >= 60 → A_REGROUND_HALT(auto_confirm 不跳过)
|
|
166
191
|
|
|
167
192
|
S_HANDLE_FAIL:
|
|
168
|
-
→
|
|
193
|
+
→ S_STEP_LOCATE WHEN: auto + not retried DO: A_RETRY
|
|
169
194
|
→ END WHEN: auto + retried DO: A_PAUSE_SESSION
|
|
170
|
-
→
|
|
171
|
-
→
|
|
195
|
+
→ S_STEP_LOCATE WHEN: interactive + retry
|
|
196
|
+
→ S_STEP_LOCATE WHEN: interactive + skip
|
|
172
197
|
→ END WHEN: interactive + abort
|
|
173
198
|
|
|
174
199
|
S_SESSION_DONE:
|
|
@@ -179,19 +204,109 @@ S_SESSION_DONE:
|
|
|
179
204
|
<actions>
|
|
180
205
|
|
|
181
206
|
### A_CREATE_SESSION
|
|
182
|
-
1. `session_id` format: `ralph-
|
|
207
|
+
1. `session_id` format: `ralph-v2-{YYYYMMDD-HHmmss}`
|
|
183
208
|
2. Additional fields: `execution_mode: "agent"`,无 `cli_tool` 字段
|
|
184
|
-
3. Each step: `agent_exec_name: null
|
|
209
|
+
3. Each step: `agent_exec_name: null`(执行 Agent 名称标识)
|
|
185
210
|
4. Step mode/role/rule assigned per stage (see Stage Mapping table)
|
|
186
211
|
|
|
187
|
-
###
|
|
212
|
+
### A_STEP_RESOLVE_ARGS
|
|
213
|
+
|
|
214
|
+
解析占位符 + 丰富参数。在 `ralph next` 之前执行。
|
|
215
|
+
|
|
216
|
+
**1. Placeholder substitution:**
|
|
188
217
|
|
|
189
|
-
|
|
218
|
+
| Placeholder | Source |
|
|
219
|
+
|-------------|--------|
|
|
220
|
+
| `{phase}` | session.phase |
|
|
221
|
+
| `{milestone}` | session.milestone |
|
|
222
|
+
| `{intent}` | session.intent |
|
|
223
|
+
| `{description}` | session.intent (alias) |
|
|
224
|
+
| `{scratch_dir}` | session.context.scratch_dir or latest artifact path |
|
|
225
|
+
| `{plan_dir}` | session.context.plan_dir |
|
|
226
|
+
| `{analysis_dir}` | session.context.analysis_dir |
|
|
227
|
+
| `{issue_id}` | session.context.issue_id |
|
|
228
|
+
| `{milestone_num}` | session.context.milestone_num |
|
|
190
229
|
|
|
191
|
-
|
|
192
|
-
2. Resolve agent name: `{stage_prefix}-{session_id_short}-{HHmmss}`
|
|
230
|
+
**2. Per-skill enrichment** (when args empty or minimal):
|
|
193
231
|
|
|
194
|
-
|
|
232
|
+
| Skill | Required context | Source |
|
|
233
|
+
|-------|-----------------|--------|
|
|
234
|
+
| maestro-brainstorm | topic | `"{intent}"` |
|
|
235
|
+
| maestro-roadmap | description | `"{intent}"` |
|
|
236
|
+
| maestro-analyze | phase or topic | `{phase}` or `"{intent}"` |
|
|
237
|
+
| maestro-plan | phase, --from, or --dir | see --from auto-injection below |
|
|
238
|
+
| maestro-execute | phase or --dir | see --from auto-injection below |
|
|
239
|
+
| quality-debug | gap context | Read previous step's error/gap |
|
|
240
|
+
| quality-* | phase | `{phase}` |
|
|
241
|
+
|
|
242
|
+
**3. --from auto-injection (phase-level artifact chaining):**
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
Read state.json.artifacts(含 milestone_history 内归档 artifacts)
|
|
246
|
+
→ filter by milestone={session.milestone} + phase={session.phase} + status=="completed"
|
|
247
|
+
|
|
248
|
+
plan step(含 {phase} 占位符,args 无 --from 且无 --dir):
|
|
249
|
+
1. 查同 phase+milestone 最新 completed type=="analyze" artifact → id = ANL-xxx
|
|
250
|
+
2. 命中 → args 追加 --from analyze:{id}
|
|
251
|
+
3. 写 step.source_artifact_ref = "analyze:{id}"
|
|
252
|
+
|
|
253
|
+
execute step(含 {phase} 占位符,args 无 --dir):
|
|
254
|
+
1. 查同 phase+milestone 最新 completed type=="plan" artifact → id = PLN-xxx, path = scratch/...
|
|
255
|
+
2. 命中 → args 追加 --dir .workflow/scratch/{path}
|
|
256
|
+
3. 写 step.source_artifact_ref = "plan:{id}"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
兜底:查询无结果 → 不注入,由命令自身 discovery 逻辑处理。已有 `--from` 或 `--dir` 的 step 不覆盖。
|
|
260
|
+
|
|
261
|
+
**4. Goal context injection:**
|
|
262
|
+
|
|
263
|
+
当 `step.goal_ref` 非空且 `session.task_decomposition` 存在时:
|
|
264
|
+
```
|
|
265
|
+
goal = session.task_decomposition.find(g => g.id == step.goal_ref)
|
|
266
|
+
if goal:
|
|
267
|
+
goal_snippet = { id: goal.id, goal: goal.goal, done_when: goal.done_when,
|
|
268
|
+
boundary: goal.boundary, evidence: goal.evidence }
|
|
269
|
+
→ 传递给 A_STEP_DISPATCH 注入 agent prompt
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**5. Write** enriched args + source_artifact_ref back to status.json.
|
|
273
|
+
|
|
274
|
+
### A_STEP_DISPATCH
|
|
275
|
+
|
|
276
|
+
加载前序产出 + 组装上下文 + 派发 executor agent 执行单步。Agent 内部调 `maestro ralph next` 获取 skill prompt 并执行。
|
|
277
|
+
|
|
278
|
+
**1. Load previous step context:**
|
|
279
|
+
|
|
280
|
+
- 读前一 completed step 的 `completion_summary` + `completion_caveats` + `completion_decisions` + `completion_deferred`
|
|
281
|
+
- 按 `session.context` 中的路径逐个 Read,提取与当前 step 相关的内容:
|
|
282
|
+
|
|
283
|
+
| 当前 stage | 加载什么 | Source |
|
|
284
|
+
|-----------|---------|--------|
|
|
285
|
+
| plan | analysis conclusions + scope_verdict | `{context.analysis_dir}/conclusions.json` |
|
|
286
|
+
| execute | task list + wave assignments | `{context.plan_dir}/TASK-*.json` |
|
|
287
|
+
| review | changed files + verification results | `{context.scratch_dir}/verification.json` |
|
|
288
|
+
| test | review findings | `review.json` |
|
|
289
|
+
| debug | error traces + failing test details | 前一 step 的 `completion_evidence` |
|
|
290
|
+
| brainstorm | grill report | `{context.grill_id}` report |
|
|
291
|
+
|
|
292
|
+
- Explore if needed — 产物指向代码位置但缺少上下文 → `maestro explore` 补充(仅 execute/debug/test 且有文件路径引用时)
|
|
293
|
+
- Accumulated signals — 遍历 ALL completed steps → 聚合 caveats + deferred
|
|
294
|
+
|
|
295
|
+
**2. Goal context pre-injection:**
|
|
296
|
+
|
|
297
|
+
- GUARD: `ralph_protocol_version >= "2"` → skip(session_anchor 已含 goal context)
|
|
298
|
+
- WHEN `ralph_protocol_version < "2"` 或缺失 AND `step.goal_ref` 非空 → 组装 `<goal_context>` 块注入 prompt:
|
|
299
|
+
```
|
|
300
|
+
<goal_context>
|
|
301
|
+
Sub-goal: {goal.id} — {goal.goal}
|
|
302
|
+
Done when: {goal.done_when}
|
|
303
|
+
Boundary: {goal.boundary}
|
|
304
|
+
Evidence target: {goal.evidence}
|
|
305
|
+
Execution criteria: {session.execution_criteria joined by '; '}
|
|
306
|
+
</goal_context>
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**3. Resolve agent name:** `{stage_prefix}-{session_id_short}-{HHmmss}`
|
|
195
310
|
|
|
196
311
|
| Stage | Prefix |
|
|
197
312
|
|-------|--------|
|
|
@@ -206,97 +321,160 @@ S_SESSION_DONE:
|
|
|
206
321
|
| debug | `dbg` |
|
|
207
322
|
| Other | `run` |
|
|
208
323
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
```xml
|
|
212
|
-
<execution_context>
|
|
213
|
-
<intent>{session.intent}</intent>
|
|
214
|
-
<phase>{session.phase}</phase>
|
|
215
|
-
<milestone>{session.milestone}</milestone>
|
|
216
|
-
<boundary_contract>
|
|
217
|
-
<in_scope>{boundary_contract.in_scope}</in_scope>
|
|
218
|
-
<out_of_scope>{boundary_contract.out_of_scope}</out_of_scope>
|
|
219
|
-
<definition_of_done>{boundary_contract.definition_of_done}</definition_of_done>
|
|
220
|
-
</boundary_contract>
|
|
221
|
-
<execution_criteria>{session.execution_criteria}</execution_criteria>
|
|
222
|
-
<active_goals>{task_decomposition WHERE status != "superseded"; superseded 目标仅一行标注}</active_goals>
|
|
223
|
-
<prior_step_context>
|
|
224
|
-
{最近 5 个已完成 step 的 completion_summary + completion_caveats}
|
|
225
|
-
</prior_step_context>
|
|
226
|
-
<accumulated_signals>
|
|
227
|
-
{聚合所有已完成 step 的 caveats + deferred}
|
|
228
|
-
</accumulated_signals>
|
|
229
|
-
<stage_context>
|
|
230
|
-
{按下一个 pending step 的目标 skill 类型选择性注入,见下表;仅在有实际内容时加入}
|
|
231
|
-
</stage_context>
|
|
232
|
-
</execution_context>
|
|
324
|
+
**4. Dispatch:**
|
|
325
|
+
|
|
233
326
|
```
|
|
327
|
+
Agent({
|
|
328
|
+
subagent_type: "ralph-executor",
|
|
329
|
+
name: "{resolved_agent_name}",
|
|
330
|
+
description: "执行 step {index}: {step.skill}",
|
|
331
|
+
prompt: `Session: {session_id}
|
|
234
332
|
|
|
235
|
-
|
|
333
|
+
{goal_context 块,仅 protocol < 2 时}
|
|
236
334
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
| execute | task list + dependencies + wave + caveats from plan |
|
|
242
|
-
| review | changed files + verification results + execution decisions |
|
|
243
|
-
| test | review findings + execution artifacts + coverage data |
|
|
244
|
-
| debug | error details + failing tests + execution trace |
|
|
245
|
-
| brainstorm/grill | challenged assumptions + risks + prior findings |
|
|
335
|
+
{loaded_step_context}
|
|
336
|
+
`
|
|
337
|
+
})
|
|
338
|
+
```
|
|
246
339
|
|
|
247
|
-
|
|
340
|
+
Agent 内部调 `maestro ralph next --session {session_id}` 获取 skill prompt 并执行。
|
|
341
|
+
|
|
342
|
+
5. Write `step.agent_exec_name` to status.json
|
|
343
|
+
6. Display: `[{index}/{total}] ⟶ {step.skill} → Agent:{name}`
|
|
344
|
+
7. Agent 同步返回 → `agent_output` = 返回文本;返回 null → STATUS=BLOCKED
|
|
248
345
|
|
|
249
|
-
|
|
250
|
-
Agent({
|
|
251
|
-
name: "{resolved_agent_name}",
|
|
252
|
-
description: "执行 ralph session steps",
|
|
253
|
-
prompt: `执行 ralph-agent session {session_id} 的 pending steps。
|
|
346
|
+
### A_STEP_EXTRACT
|
|
254
347
|
|
|
255
|
-
|
|
256
|
-
maestro-ralph-agent-execute 会自动循环执行 pending 执行 step,遇到 decision/完成/失败时返回。
|
|
348
|
+
从 agent 返回的执行输出中提取结构化信号,用于 completion 参数组装。
|
|
257
349
|
|
|
258
|
-
|
|
350
|
+
**1. Stage-specific signal extraction:**
|
|
259
351
|
|
|
260
|
-
|
|
352
|
+
| Stage | 提取什么 | 写入字段 |
|
|
353
|
+
|-------|---------|---------|
|
|
354
|
+
| analyze | `conclusions.json` scope_verdict + key_findings | `--summary`, context.analysis_dir |
|
|
355
|
+
| plan | TASK-*.json 数量 + 主要模块 + 波次 | `--summary`, context.plan_dir |
|
|
356
|
+
| execute | 修改文件数 + verification passed/failed | `--summary`, `--evidence`, context.scratch_dir |
|
|
357
|
+
| review | verdict + findings 数量 + severity | `--summary`, `--decisions` |
|
|
358
|
+
| test | pass/fail 统计 | `--summary`, `--evidence` |
|
|
359
|
+
| debug | root cause + 修复内容 | `--summary`, `--decisions` |
|
|
360
|
+
| grill | 核心质疑点数量 | `--summary`, `--caveats`, context.grill_id |
|
|
361
|
+
| brainstorm | 候选方案数 + 推荐方案 | `--summary`, `--decisions`, context.brainstorm_dir |
|
|
261
362
|
|
|
262
|
-
|
|
363
|
+
**2. Artifact scanning** — Use Glob 查找执行期间新增/修改的产物:
|
|
263
364
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
365
|
+
| Pattern | Signal |
|
|
366
|
+
|---------|--------|
|
|
367
|
+
| `conclusions.json` | `analysis_dir` |
|
|
368
|
+
| `TASK-*.json` | `plan_dir` |
|
|
369
|
+
| `verification.json` | `scratch_dir` |
|
|
370
|
+
| `review.json` | review stage |
|
|
371
|
+
| `test-results.json`, `uat.md` | test stage |
|
|
372
|
+
| `grill-report.md` | `grill_id` |
|
|
373
|
+
| `.brainstorming/*` | `brainstorm_dir` |
|
|
374
|
+
|
|
375
|
+
**3. Output text signal extraction** — 从执行输出文本中提取:
|
|
376
|
+
|
|
377
|
+
| Signal pattern | 写入 |
|
|
378
|
+
|----------------|------|
|
|
379
|
+
| `ANL-xxx` (artifact ID) | `session.analyze_macro_id` |
|
|
380
|
+
| `PLN-xxx` (artifact ID) | `context.plan_dir` |
|
|
381
|
+
| `BLP-xxx` (artifact ID) | `session.blueprint_id` |
|
|
382
|
+
| `scratch_dir:` 或 `.workflow/scratch/` 路径 | `context.scratch_dir` |
|
|
383
|
+
| `plan_dir:` 路径 | `context.plan_dir` |
|
|
384
|
+
| `PHASE: N` | `session.context.phase` |
|
|
385
|
+
|
|
386
|
+
**4. STATUS determination:**
|
|
273
387
|
|
|
274
|
-
|
|
275
|
-
|
|
388
|
+
| 条件 | STATUS |
|
|
389
|
+
|------|--------|
|
|
390
|
+
| Skill 正常完成 + 有产物 | `DONE` |
|
|
391
|
+
| 完成但有 warnings/concerns | `DONE_WITH_CONCERNS` |
|
|
392
|
+
| 执行出错但可重试(临时错误、网络问题) | `NEEDS_RETRY` |
|
|
393
|
+
| 执行出错且无法重试(schema 错误、command_path 不可达) | `BLOCKED` |
|
|
394
|
+
| Agent 返回 null(崩溃/超时) | `BLOCKED` |
|
|
276
395
|
|
|
277
|
-
|
|
396
|
+
**5. Compose completion params:**
|
|
278
397
|
|
|
279
|
-
|
|
398
|
+
| Param | 规则 | 组装方法 |
|
|
399
|
+
|-------|------|---------|
|
|
400
|
+
| `--summary` | MUST。动词开头,≤100 字 | `"<动词><做了什么>,<量化结果>"` |
|
|
401
|
+
| `--decisions` | SHOULD。每条一个架构/技术决策 | 从执行中做出的非显而易见的选择 |
|
|
402
|
+
| `--caveats` | SHOULD。后续 step 须知 | 发现但不属于本步解决的问题 |
|
|
403
|
+
| `--deferred` | SHOULD。推迟工作项 | 被主动推迟的项 |
|
|
404
|
+
| `--evidence` | SHOULD。验证产物路径 | 指向验证结果文件 |
|
|
405
|
+
| `--concerns` | COND。仅 DONE_WITH_CONCERNS 时 | CAVEATS 内容同时映射为 --concerns |
|
|
280
406
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
407
|
+
### A_STEP_DRIFT_ANALYZE
|
|
408
|
+
|
|
409
|
+
产物 vs 目标偏离分析。A_STEP_EXTRACT 后、A_STEP_COMPLETE 前执行。
|
|
410
|
+
|
|
411
|
+
**1. 收集对照基准:**
|
|
412
|
+
|
|
413
|
+
| 基准来源 | 取值 |
|
|
414
|
+
|---------|------|
|
|
415
|
+
| `step.goal_ref` → goal.done_when | 子目标完成条件 |
|
|
416
|
+
| `session.boundary_contract.definition_of_done` | 全局验收标准 |
|
|
417
|
+
| `session.execution_criteria` | 执行准则 |
|
|
418
|
+
| `session.intent` | 原始意图 |
|
|
419
|
+
|
|
420
|
+
**2. 对比评分:**
|
|
421
|
+
|
|
422
|
+
| 维度 | 检查 |
|
|
423
|
+
|------|------|
|
|
424
|
+
| 覆盖度 | 产物是否覆盖 goal.done_when 每个条件 |
|
|
425
|
+
| 方向性 | decisions 是否与 intent/boundary 一致 |
|
|
426
|
+
| 完整性 | 预期产物类型是否齐全 |
|
|
427
|
+
|
|
428
|
+
**drift_score:**
|
|
429
|
+
- `ALIGNED` — 全部维度通过
|
|
430
|
+
- `MINOR_DRIFT` — 小缺口,不影响后续
|
|
431
|
+
- `MAJOR_DRIFT` — 方向性偏离或关键产物缺失
|
|
432
|
+
|
|
433
|
+
**3. 修正动作:**
|
|
434
|
+
|
|
435
|
+
| drift_score | 动作 |
|
|
436
|
+
|-------------|------|
|
|
437
|
+
| ALIGNED | 正常进入 S_STEP_COMPLETE |
|
|
438
|
+
| MINOR_DRIFT | 偏离项追加到 caveats,正常 complete |
|
|
439
|
+
| MAJOR_DRIFT + 未重试 | `Bash("maestro ralph retry {index}")` → 回到 S_STEP_DISPATCH 重执行(drift_correction 作修正上下文注入 prompt) |
|
|
440
|
+
| MAJOR_DRIFT + 已重试 | 以 DONE_WITH_CONCERNS complete |
|
|
441
|
+
|
|
442
|
+
**4. 写入:** `step.drift_score`, `step.drift_correction`
|
|
443
|
+
|
|
444
|
+
### A_STEP_COMPLETE
|
|
445
|
+
|
|
446
|
+
调 `ralph complete` 上报 + 传播上下文信号 + 循环。
|
|
447
|
+
|
|
448
|
+
1. 使用 A_STEP_EXTRACT 组装的参数调用 `ralph complete`:
|
|
449
|
+
```
|
|
450
|
+
Bash("maestro ralph complete {index} --status DONE --summary \"{SUMMARY}\" [--evidence ...] [--decisions ...] [--caveats ...] [--deferred ...]")
|
|
451
|
+
```
|
|
452
|
+
DONE_WITH_CONCERNS 时 caveats 同时映射 `--concerns`。BLOCKED 时用 `--reason`。
|
|
453
|
+
|
|
454
|
+
2. **Context signals propagation** — 将关键信号写入 `status.json.context`:
|
|
455
|
+
|
|
456
|
+
| Signal | 写入字段 |
|
|
457
|
+
|--------|---------|
|
|
458
|
+
| `analysis_dir` | `context.analysis_dir` |
|
|
459
|
+
| `plan_dir` | `context.plan_dir` |
|
|
460
|
+
| `scratch_dir` | `context.scratch_dir` |
|
|
461
|
+
| `grill_id` | `context.grill_id` |
|
|
462
|
+
| `brainstorm_dir` | `context.brainstorm_dir` |
|
|
463
|
+
| `blueprint_dir` | `context.blueprint_dir` |
|
|
464
|
+
| `ANL-xxx` | `session.analyze_macro_id` |
|
|
465
|
+
| `BLP-xxx` | `session.blueprint_id` |
|
|
466
|
+
| `phase` | `session.context.phase` |
|
|
467
|
+
|
|
468
|
+
3. Display: `[{index}/{total}] ✓ {step.skill} → {SUMMARY}`
|
|
469
|
+
4. Loop back to S_STEP_LOCATE
|
|
292
470
|
|
|
293
471
|
### A_AGENT_EVALUATE
|
|
294
472
|
|
|
295
|
-
通过 Agent
|
|
473
|
+
通过 Agent 在本循环内评估质量门。
|
|
296
474
|
|
|
297
475
|
1. Resolve artifact dir: `.workflow/scratch/{artifact.path}/` with fallback glob
|
|
298
476
|
2. Parse decision metadata: `{ decision, retry_count, max_retries }`
|
|
299
|
-
3. Map result files
|
|
477
|
+
3. Map result files:
|
|
300
478
|
|
|
301
479
|
| Decision | Files |
|
|
302
480
|
|----------|-------|
|
|
@@ -327,11 +505,11 @@ FAILURE_REASON: {仅 step_failed 时}
|
|
|
327
505
|
CONSTRAINTS: 只评估不修改文件 | 置信度<60%倾向 fix | retry {n}/{max} 达上限必须 escalate"
|
|
328
506
|
})
|
|
329
507
|
```
|
|
330
|
-
5. On return: parse `---VERDICT---` block — STATUS must match strict enum `PASS|FAIL|PARTIAL|BLOCKED`; parse failure → fallback STATUS="fix", `parse_failed: true`, `confidence_score: 0` (invariant
|
|
508
|
+
5. On return: parse `---VERDICT---` block — STATUS must match strict enum `PASS|FAIL|PARTIAL|BLOCKED`; parse failure → fallback STATUS="fix", `parse_failed: true`, `confidence_score: 0` (invariant 18)
|
|
331
509
|
6. Confidence adjustment: <60 + proceed → fix; >95 + fix + retry>0 → suggest proceed
|
|
332
510
|
7. **Decision log**: Append to `{session_dir}/decisions.ndjson`:
|
|
333
511
|
```json
|
|
334
|
-
{ "id": "DEC-{timestamp}", "timestamp": "{ISO}", "source": "ralph-
|
|
512
|
+
{ "id": "DEC-{timestamp}", "timestamp": "{ISO}", "source": "ralph-v2",
|
|
335
513
|
"node_id": "{step.decision}", "type": "quality-gate",
|
|
336
514
|
"verdict": "{adjusted_verdict}", "confidence_score": {N},
|
|
337
515
|
"parse_failed": false,
|
|
@@ -340,7 +518,7 @@ FAILURE_REASON: {仅 step_failed 时}
|
|
|
340
518
|
|
|
341
519
|
### A_AGENT_GOAL_AUDIT
|
|
342
520
|
|
|
343
|
-
通过 Agent
|
|
521
|
+
通过 Agent 审计子目标完成情况。
|
|
344
522
|
|
|
345
523
|
1. Read `session.task_decomposition` from status.json
|
|
346
524
|
2. Dispatch audit Agent:
|
|
@@ -377,7 +555,7 @@ FAILURE_REASON: {仅 step_failed 时}
|
|
|
377
555
|
|
|
378
556
|
### A_AGENT_REGROUND
|
|
379
557
|
|
|
380
|
-
通过 Agent
|
|
558
|
+
通过 Agent 执行意图保真检查。
|
|
381
559
|
|
|
382
560
|
1. Read status.json:intent, boundary_contract, completed steps, done goals
|
|
383
561
|
2. Dispatch reground Agent:
|
|
@@ -419,7 +597,7 @@ FAILURE_REASON: {仅 step_failed 时}
|
|
|
419
597
|
1. 定位刚完成的 macro analyze artifact → `analyze_macro_id`, `conclusions_path`
|
|
420
598
|
2. 读取 `conclusions.scope_verdict`(`large | medium | small`),缺失 → `unknown`
|
|
421
599
|
3. 写入 `session.scope_verdict` + `session.analyze_macro_id`
|
|
422
|
-
4. Append `{session_dir}/decisions.ndjson`:`{ "type": "scope-gate", "source": "ralph-
|
|
600
|
+
4. Append `{session_dir}/decisions.ndjson`:`{ "type": "scope-gate", "source": "ralph-v2", "verdict": "{scope_verdict}", "analyze_macro_id": "{ANL_ID}" }`
|
|
423
601
|
|
|
424
602
|
### A_STRUCTURAL_EVALUATE
|
|
425
603
|
|
|
@@ -432,7 +610,7 @@ FAILURE_REASON: {仅 step_failed 时}
|
|
|
432
610
|
|
|
433
611
|
### A_SHOW_STATUS
|
|
434
612
|
|
|
435
|
-
1. Find latest `ralph-
|
|
613
|
+
1. Find latest `ralph-v2-*` session(by created_at)
|
|
436
614
|
2. Display: Session, Status, Position, Progress, Current step
|
|
437
615
|
3. List steps: [✓] confirmed, [▸] current, [ ] pending, [◆] decision;执行 step 附 `command_scope` + `command_path`
|
|
438
616
|
4. If `task_decomposition` present → 显示 sub-goals 进度(done/total)
|
|
@@ -476,7 +654,7 @@ FAILURE_REASON: {仅 step_failed 时}
|
|
|
476
654
|
|-------|------|------|
|
|
477
655
|
| 1. 快照 | 读 `task_decomposition` + `boundary_contract` + 已完成 steps 的 `completion_summary` | Display: 目标列表 + 进度 |
|
|
478
656
|
| 2. 解析 | `change_request` 非空 → 直接用;为空 → AskUserQuestion(修改/新增/移除/调整边界) | `change_type` + `change_request` |
|
|
479
|
-
| 3. Mini Grill | Agent
|
|
657
|
+
| 3. Mini Grill | Agent 评估影响 | RISK_LEVEL + AFFECTED_GOALS + INVALIDATED_STEPS + NEW_GAPS |
|
|
480
658
|
| 4. 确认 | AskUserQuestion:应用并继续 / 仅改目标 / 取消 | 用户选择 |
|
|
481
659
|
| 5. 应用 | 归档旧目标(`superseded`)→ 写入新目标(`origin: CHG-xxx`)→ 重建链路 → write status.json | re-dispatch |
|
|
482
660
|
|
|
@@ -513,9 +691,9 @@ GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
|
|
|
513
691
|
|
|
514
692
|
### A_RETRY / A_PAUSE_SESSION / A_COMPLETE_SESSION
|
|
515
693
|
|
|
516
|
-
- **A_RETRY**: `Bash("maestro ralph retry {index}")` —
|
|
517
|
-
- **A_PAUSE_SESSION**: `ralph complete N --status BLOCKED --reason "..."` —
|
|
518
|
-
- **A_COMPLETE_SESSION**: 校验所有 step `completion_confirmed == true` + `task_decomposition_all_done == true
|
|
694
|
+
- **A_RETRY**: `Bash("maestro ralph retry {index}")` — CLI 设 `step.retried = true`, `step.status = "pending"`, 清 `active_step_index`
|
|
695
|
+
- **A_PAUSE_SESSION**: `ralph complete N --status BLOCKED --reason "..."` — CLI 写 `session.status = "paused"`
|
|
696
|
+
- **A_COMPLETE_SESSION**: 校验所有 step `completion_confirmed == true` + `task_decomposition_all_done == true`(若存在),通过后写 `session.status = "completed"`
|
|
519
697
|
|
|
520
698
|
</actions>
|
|
521
699
|
|
|
@@ -523,21 +701,9 @@ GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
|
|
|
523
701
|
|
|
524
702
|
<appendix>
|
|
525
703
|
|
|
526
|
-
### Agent vs CLI-Delegate 对照
|
|
527
|
-
|
|
528
|
-
| 维度 | ralph-cli (CLI-delegate) | ralph-agent (Agent) |
|
|
529
|
-
|------|-------------------------|---------------------|
|
|
530
|
-
| 执行分发 | `maestro delegate` (Bash bg) | `Agent()` (同步) |
|
|
531
|
-
| 执行包装器 | `maestro-ralph-cli-execute` (delegate 加载) | `maestro-ralph-agent-execute` (Agent 内 Skill 加载) |
|
|
532
|
-
| 结果通信 | `---RESULT---` 文本块 (从 delegate output 解析) | Agent 返回文本 + `---AGENT-STATUS---` 块 |
|
|
533
|
-
| 回调模式 | STOP → re-invocation callback | 同步等待 Agent 返回(无 STOP) |
|
|
534
|
-
| 决策评估 | `maestro delegate --mode analysis` (Bash bg + STOP) | `Agent()` 同步分析(无 STOP) |
|
|
535
|
-
| 完成上报 | 编排器调 `ralph complete`(解析 RESULT 后) | 执行 Agent 内调 `ralph complete`(agent 上报) |
|
|
536
|
-
| session 字段 | `execution_mode: "cli-delegate"`, `cli_tool`, `delegate_exec_id` | `execution_mode: "agent"`, `agent_exec_name` |
|
|
537
|
-
|
|
538
704
|
### Stage Mapping
|
|
539
705
|
|
|
540
|
-
|
|
706
|
+
执行 Agent 始终拥有完整工具集(read + write),由 skill 自身约束行为。Decision 评估 Agent 通过 prompt 中的 CONSTRAINTS 约束为只读。
|
|
541
707
|
|
|
542
708
|
| Stage | Skill (independent) | Skill (unified) | Decision after | quality_mode |
|
|
543
709
|
|-------|---------------------|-----------------|----------------|--------------|
|
|
@@ -566,7 +732,7 @@ Build rules 0-14 全部适用,包括 spec-setup 预检(rule 0.5)、grill a
|
|
|
566
732
|
|
|
567
733
|
```json
|
|
568
734
|
{
|
|
569
|
-
"session_id": "ralph-
|
|
735
|
+
"session_id": "ralph-v2-{YYYYMMDD-HHmmss}",
|
|
570
736
|
"source": "ralph", "status": "running",
|
|
571
737
|
"execution_mode": "agent",
|
|
572
738
|
"ralph_protocol_version": "2",
|
|
@@ -645,7 +811,7 @@ Build rules 0-14 全部适用,包括 spec-setup 预检(rule 0.5)、grill a
|
|
|
645
811
|
|
|
646
812
|
### Fix-Loop Templates
|
|
647
813
|
|
|
648
|
-
6 套 fix-loop templates(post-execute / post-business-test / post-review / post-test / post-frontend-verify / post-goal-audit
|
|
814
|
+
6 套 fix-loop templates(post-execute / post-business-test / post-review / post-test / post-frontend-verify / post-goal-audit)。插入的 step 通过 A_STEP_DISPATCH 派发 executor agent 逐步执行,由主流程调 `ralph complete` 上报。
|
|
649
815
|
|
|
650
816
|
### Error Codes
|
|
651
817
|
|
|
@@ -654,29 +820,30 @@ E001–E006, W001–W004 适用。Agent 新增:
|
|
|
654
820
|
| Code | Severity | Description | Recovery |
|
|
655
821
|
|------|----------|-------------|----------|
|
|
656
822
|
| E014 | error | Agent execution failed (Agent returned null) | Retry once, then BLOCKED |
|
|
657
|
-
| E015 | error | `---AGENT-STATUS---` block not found | Fallback: re-read status.json 推断 |
|
|
658
823
|
| E016 | error | Evaluation Agent verdict parse failed | Fallback fix + parse_failed: true |
|
|
659
824
|
|
|
660
825
|
### Success Criteria
|
|
661
826
|
|
|
662
|
-
- [ ] ralph-
|
|
663
|
-
- [ ]
|
|
664
|
-
- [ ] Agent
|
|
827
|
+
- [ ] ralph-v2 owns full step loop: locate → resolve → dispatch → extract → drift → complete → next
|
|
828
|
+
- [ ] One agent per step — `Agent({ subagent_type: "ralph-executor" })` 每步派发一个
|
|
829
|
+
- [ ] Agent 内调 `maestro ralph next` 获取 skill prompt 并执行,返回执行输出
|
|
830
|
+
- [ ] 主流程调 `maestro ralph complete` 上报(非 agent 上报)
|
|
831
|
+
- [ ] 主流程负责 arg resolution、context loading、signal extraction、drift analysis
|
|
832
|
+
- [ ] Agent 返回执行输出文本,主流程从中提取信号和状态
|
|
833
|
+
- [ ] Agent 崩溃(返回 null)→ STATUS=BLOCKED,转 S_HANDLE_FAIL
|
|
665
834
|
- [ ] 无 STOP/callback 模式 — Agent() 同步等待返回
|
|
666
|
-
- [ ]
|
|
667
|
-
- [ ] 执行 Agent 内部调 `maestro ralph complete` 上报(agent 上报,非编排器上报)
|
|
668
|
-
- [ ] A_PARSE_AGENT_RETURN 验证 status.json:agent 上报写入确认 + session.status 一致性
|
|
669
|
-
- [ ] Decision evaluation 通过 Agent() 同步完成(非 maestro delegate)
|
|
835
|
+
- [ ] Decision evaluation 通过 Agent() 同步完成
|
|
670
836
|
- [ ] Verdict 解析保持 `---VERDICT---` 格式,parse 失败 → fallback fix + parse_failed: true
|
|
671
|
-
- [ ] decisions.ndjson 追加:source 字段为 `"ralph-
|
|
672
|
-
- [ ] Session schema: `execution_mode: "agent"`,`agent_exec_name
|
|
673
|
-
- [ ] Chain building(S_RESOLVE_PHASE through S_BUILD_CHAIN
|
|
674
|
-
- [ ]
|
|
675
|
-
- [ ] execution_context 中 boundary_contract 不截断;superseded 目标仅一行标注
|
|
837
|
+
- [ ] decisions.ndjson 追加:source 字段为 `"ralph-v2"`
|
|
838
|
+
- [ ] Session schema: `execution_mode: "agent"`,`agent_exec_name`(执行 Agent 名称标识),含 `artifacts_produced`
|
|
839
|
+
- [ ] Chain building(S_RESOLVE_PHASE through S_BUILD_CHAIN)自包含执行
|
|
840
|
+
- [ ] A_STEP_DISPATCH 含前序产出加载(滑动窗口 5 step + accumulated signals + stage-specific artifacts)
|
|
676
841
|
- [ ] Agent name 含 stage prefix(grl/brn/anm/ana/pln/exe/rev/tst/dbg)
|
|
677
|
-
- [ ]
|
|
678
|
-
- [ ]
|
|
679
|
-
- [ ]
|
|
842
|
+
- [ ] `--summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(动词开头,≤100 字)
|
|
843
|
+
- [ ] CAVEATS 在 DONE_WITH_CONCERNS 时同时映射 --concerns
|
|
844
|
+
- [ ] A_STEP_EXTRACT 从 agent 输出提取 artifact IDs、path signals、phase signals
|
|
845
|
+
- [ ] A_STEP_DRIFT_ANALYZE:ALIGNED/MINOR_DRIFT → complete;MAJOR_DRIFT+未重试 → retry;MAJOR_DRIFT+已重试 → DONE_WITH_CONCERNS
|
|
846
|
+
- [ ] A_STEP_COMPLETE 将 context signals 写入 status.json.context
|
|
680
847
|
- [ ] A_AMEND_GOAL:完整 5 步流程 + deferred_reading ralph-amend-goal.md + Agent mini grill 含完整 prompt
|
|
681
848
|
- [ ] 旧目标标 superseded(superseded_by + superseded_at),新目标 origin: "CHG-xxx"
|
|
682
849
|
- [ ] goal_changelog 含完整 before/after + impact_assessment
|
|
@@ -684,12 +851,8 @@ E001–E006, W001–W004 适用。Agent 新增:
|
|
|
684
851
|
- [ ] spec-setup 预检(build rule 0.5)
|
|
685
852
|
- [ ] post-milestone adhoc 分支:mark completed + set current_milestone = null
|
|
686
853
|
- [ ] post-reground + drifted + confidence < 60 → A_APPLY_PROCEED (LOW CONFIDENCE)
|
|
687
|
-
- [ ] Fix-loop 插入的 step 通过
|
|
854
|
+
- [ ] Fix-loop 插入的 step 通过 A_STEP_DISPATCH 逐步执行
|
|
688
855
|
- [ ] re-grounding 3-step 插入规则(build rule 5.5)不变
|
|
689
856
|
- [ ] A_REGROUND_HALT 漂移熔断(auto_confirm 不跳过)不变
|
|
690
|
-
- [ ] `---AGENT-STATUS---` 块缺失时 fallback:re-read status.json 推断状态
|
|
691
|
-
- [ ] Agent 超时/崩溃 → A_PARSE_AGENT_RETURN fallback 推断 + S_HANDLE_FAIL 路径
|
|
692
857
|
|
|
693
858
|
</appendix>
|
|
694
|
-
</output>
|
|
695
|
-
</output>
|