maestro-flow 0.5.44 → 0.5.46

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 (126) hide show
  1. package/.agents/agents/ralph-executor.md +93 -0
  2. package/.agents/skills/maestro-ralph-cli/SKILL.md +21 -16
  3. package/.agents/skills/maestro-ralph-v2/SKILL.md +923 -0
  4. package/.agents/skills/odyssey-debug/SKILL.md +338 -253
  5. package/.agents/skills/odyssey-improve/SKILL.md +367 -281
  6. package/.agents/skills/odyssey-planex/SKILL.md +490 -420
  7. package/.agents/skills/odyssey-review-test-fix/SKILL.md +336 -251
  8. package/.agents/skills/odyssey-ui/SKILL.md +332 -247
  9. package/.agy/agents/ralph-executor.md +91 -0
  10. package/.agy/skills/maestro-ralph-cli/SKILL.md +21 -16
  11. package/.agy/skills/maestro-ralph-v2/SKILL.md +935 -0
  12. package/.agy/skills/odyssey-debug/SKILL.md +338 -253
  13. package/.agy/skills/odyssey-improve/SKILL.md +367 -281
  14. package/.agy/skills/odyssey-planex/SKILL.md +490 -420
  15. package/.agy/skills/odyssey-review-test-fix/SKILL.md +336 -251
  16. package/.agy/skills/odyssey-ui/SKILL.md +332 -247
  17. package/.claude/agents/ralph-executor.md +91 -0
  18. package/.claude/commands/maestro-ralph-cli.md +21 -16
  19. package/.claude/commands/maestro-ralph-v2.md +921 -0
  20. package/.claude/commands/odyssey-debug.md +352 -267
  21. package/.claude/commands/odyssey-improve.md +381 -295
  22. package/.claude/commands/odyssey-planex.md +504 -434
  23. package/.claude/commands/odyssey-review-test-fix.md +350 -265
  24. package/.claude/commands/odyssey-ui.md +346 -261
  25. package/.codex/skills/maestro-next/SKILL.md +1 -1
  26. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +3 -3
  27. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  28. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +4 -4
  29. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  30. package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +6 -0
  31. package/dashboard/dist-server/src/graph/kg/db/queries.js +141 -19
  32. package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
  33. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  34. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  35. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  36. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  37. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  38. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  39. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  40. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  41. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +2 -2
  42. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  43. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js +1 -1
  44. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js.map +1 -1
  45. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js +35 -0
  46. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js.map +1 -1
  47. package/dashboard/dist-server/src/hooks/spec-analytics.d.ts +1 -0
  48. package/dashboard/dist-server/src/hooks/spec-analytics.js.map +1 -1
  49. package/dashboard/dist-server/src/hooks/wiki-search-bridge.d.ts +32 -0
  50. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js +71 -0
  51. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js.map +1 -0
  52. package/dist/src/agents/api-explore/agent-loop.d.ts +15 -2
  53. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -1
  54. package/dist/src/agents/api-explore/agent-loop.js +6 -5
  55. package/dist/src/agents/api-explore/agent-loop.js.map +1 -1
  56. package/dist/src/agents/api-explore/config.d.ts +56 -0
  57. package/dist/src/agents/api-explore/config.d.ts.map +1 -1
  58. package/dist/src/agents/api-explore/config.js +34 -0
  59. package/dist/src/agents/api-explore/config.js.map +1 -1
  60. package/dist/src/agents/api-explore/llm.d.ts +5 -1
  61. package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
  62. package/dist/src/agents/api-explore/llm.js +10 -8
  63. package/dist/src/agents/api-explore/llm.js.map +1 -1
  64. package/dist/src/agents/api-explore/moa-cache.d.ts +12 -0
  65. package/dist/src/agents/api-explore/moa-cache.d.ts.map +1 -0
  66. package/dist/src/agents/api-explore/moa-cache.js +50 -0
  67. package/dist/src/agents/api-explore/moa-cache.js.map +1 -0
  68. package/dist/src/agents/api-explore/moa-loop.d.ts +49 -0
  69. package/dist/src/agents/api-explore/moa-loop.d.ts.map +1 -0
  70. package/dist/src/agents/api-explore/moa-loop.js +43 -0
  71. package/dist/src/agents/api-explore/moa-loop.js.map +1 -0
  72. package/dist/src/agents/api-explore/moa-pipeline.d.ts +43 -0
  73. package/dist/src/agents/api-explore/moa-pipeline.d.ts.map +1 -0
  74. package/dist/src/agents/api-explore/moa-pipeline.js +276 -0
  75. package/dist/src/agents/api-explore/moa-pipeline.js.map +1 -0
  76. package/dist/src/agents/api-explore/runner.d.ts +3 -0
  77. package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
  78. package/dist/src/agents/api-explore/runner.js +24 -7
  79. package/dist/src/agents/api-explore/runner.js.map +1 -1
  80. package/dist/src/agents/api-explore/session.d.ts +15 -0
  81. package/dist/src/agents/api-explore/session.d.ts.map +1 -1
  82. package/dist/src/agents/api-explore/session.js.map +1 -1
  83. package/dist/src/cli.js +1 -0
  84. package/dist/src/cli.js.map +1 -1
  85. package/dist/src/commands/explore.d.ts.map +1 -1
  86. package/dist/src/commands/explore.js +16 -1
  87. package/dist/src/commands/explore.js.map +1 -1
  88. package/dist/src/commands/moa.d.ts +3 -0
  89. package/dist/src/commands/moa.d.ts.map +1 -0
  90. package/dist/src/commands/moa.js +202 -0
  91. package/dist/src/commands/moa.js.map +1 -0
  92. package/dist/src/graph/kg/db/queries.d.ts +6 -0
  93. package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
  94. package/dist/src/graph/kg/db/queries.js +141 -19
  95. package/dist/src/graph/kg/db/queries.js.map +1 -1
  96. package/dist/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  97. package/dist/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  98. package/dist/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  99. package/dist/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  100. package/dist/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  101. package/dist/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  102. package/dist/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  103. package/dist/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  104. package/dist/src/graph/kg/extraction/orchestrator.js +2 -2
  105. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  106. package/dist/src/graph/kg/surface/hook-injector.js +1 -1
  107. package/dist/src/graph/kg/surface/hook-injector.js.map +1 -1
  108. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  109. package/dist/src/hooks/keyword-spec-injector.js +35 -0
  110. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  111. package/dist/src/hooks/spec-analytics.d.ts +1 -0
  112. package/dist/src/hooks/spec-analytics.d.ts.map +1 -1
  113. package/dist/src/hooks/spec-analytics.js.map +1 -1
  114. package/dist/src/hooks/wiki-search-bridge.d.ts +33 -0
  115. package/dist/src/hooks/wiki-search-bridge.d.ts.map +1 -0
  116. package/dist/src/hooks/wiki-search-bridge.js +71 -0
  117. package/dist/src/hooks/wiki-search-bridge.js.map +1 -0
  118. package/dist/src/utils/update-notices.js +12 -0
  119. package/dist/src/utils/update-notices.js.map +1 -1
  120. package/package.json +1 -1
  121. package/.agents/skills/maestro-ralph-agent/SKILL.md +0 -697
  122. package/.agents/skills/maestro-ralph-agent-execute/SKILL.md +0 -461
  123. package/.agy/skills/maestro-ralph-agent/SKILL.md +0 -696
  124. package/.agy/skills/maestro-ralph-agent-execute/SKILL.md +0 -457
  125. package/.claude/commands/maestro-ralph-agent-execute.md +0 -459
  126. package/.claude/commands/maestro-ralph-agent.md +0 -695
@@ -1,697 +0,0 @@
1
- ---
2
- name: maestro-ralph-agent
3
- description: Agent-orchestrated lifecycle — compose, dispatch Agent, evaluate decision, loop
4
- argument-hint: "<intent> [-y] [--amend [change]] [--roadmap] | status | continue"
5
- allowed-tools:
6
- - read_file
7
- - write_file
8
- - edit_file
9
- - shell
10
- - find_files
11
- - search
12
- - invoke_skill
13
- - ask_user
14
- - delegate_subagent
15
- ---
16
- <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
17
-
18
- <purpose>
19
- Agent-orchestrated variant of maestro-ralph. Same chain-building logic — but execution via Claude Agent instead of CLI delegation: compose prompt → dispatch delegate_subagent(maestro-ralph-agent-execute) → agent runs step loop → returns on decision/complete/fail → evaluate decision inline via Agent → re-dispatch → loop.
20
-
21
- Session: `.workflow/.maestro/ralph-agent-{YYYYMMDD-HHmmss}/status.json`
22
-
23
- Chain building(A_RESOLVE_PHASE → A_INFER_POSITION → A_BUILD_STEPS)、session schema、decomposition(A_DECOMPOSE_TASKS)逻辑同 ralph。
24
- </purpose>
25
-
26
- <deferred_reading>
27
- - [ralph-amend-goal.md](~/.maestro/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
28
- </deferred_reading>
29
-
30
- <context>
31
- $ARGUMENTS — intent text, flags, or keywords.
32
-
33
- **Parse:**
34
- ```
35
- -y flag → auto_confirm = true
36
- --roadmap → wants_roadmap = true
37
- --amend / -a → amend_mode = true
38
- .md/.txt path → input_doc
39
- status|continue → route keyword
40
- Remaining → intent (amend_mode 时为 change_request)
41
- ```
42
-
43
- **State files**:
44
- - `.workflow/state.json` — artifact registry
45
- - `.workflow/.maestro/ralph-agent-*/status.json` — session state
46
- </context>
47
-
48
- <invariants>
49
- All ralph invariants (1-16) apply, with the following overrides:
50
-
51
- - **Invariant 1 Agent 语义**: ralph-agent 不直接执行 step 内容;执行由 delegate_subagent(maestro-ralph-agent-execute) 完成
52
- - **Invariant 2 覆盖**: ralph-agent 不调用 `invoke_skill("maestro-ralph-execute")`;invariant 17-24 替代 handoff 机制,ralph-agent 持有完整循环
53
-
54
- Additionally:
55
-
56
- 17. **ralph-agent owns the loop** — dispatch Agent → wait → verify → decide → re-dispatch 全部在本命令内完成;execute Agent 是被委派的执行者
57
- 18. **Dispatch via delegate_subagent()** — 使用 `delegate_subagent({ name, description, prompt })` 启动执行 Agent,Agent 内部调用 `invoke_skill("maestro-ralph-agent-execute", "--session {session_id}")` 加载执行命令
58
- 19. **Synchronous dispatch** — delegate_subagent() 调用是同步的(等待返回),不需要 STOP/callback 模式
59
- 20. **Execute Agent 自治执行** — 执行 Agent 自主循环处理所有 pending 执行 step,遇到 decision 节点时停止并返回;执行 Agent 内部调用 `maestro ralph complete` 上报(agent 上报)
60
- 21. **Decision evaluation inline** — decision 节点不 handoff,通过 `delegate_subagent()` 启动分析 Agent 在本循环内评估
61
- 22. **Agent return 解析** — 从 Agent 返回文本中解析执行结果(`---AGENT-STATUS---` 块),替代 `---RESULT---` 解析
62
- 23. **No CLI delegation** — 本命令不使用 `maestro delegate`;执行和评估均通过 delegate_subagent() 完成
63
- 24. **No inline skill execution** — 本命令不执行 skill 逻辑;执行由 delegate_subagent(maestro-ralph-agent-execute) 完成
64
- </invariants>
65
-
66
- <state_machine>
67
-
68
- Chain-building states + 执行循环 states:
69
-
70
- <states>
71
- S_PARSE_ROUTE — 解析参数、路由入口
72
- S_STATUS — 显示 session 进度
73
- S_CONTINUE — 恢复执行
74
- S_RESOLVE_PHASE — 解析 phase + phase_is_new + milestone PERSIST: session.phase, session.phase_is_new, session.milestone
75
- S_INFER — 推断 lifecycle_position PERSIST: session.lifecycle_position, session.wants_roadmap
76
- S_RESOLVE_SCOPE — 读 macro analyze conclusions.scope_verdict PERSIST: session.scope_verdict, session.analyze_macro_id
77
- S_QUALITY_MODE — 决定质量管线模式 PERSIST: session.quality_mode
78
- S_PLANNING_MODE — 决定统一/独立规划模式 PERSIST: session.planning_mode
79
- S_DECOMPOSE — 边界澄清 + 执行准则 + 子目标清单 PERSIST: session.boundary_contract, .execution_criteria, .task_decomposition
80
- S_BUILD_CHAIN — 构建步骤链(build rules 0-14) PERSIST: session.steps[]
81
- S_CREATE_SESSION — 写 status.json PERSIST: session (全量)
82
- S_CONFIRM — 用户确认
83
-
84
- S_AGENT_DISPATCH — 启动执行 Agent PERSIST: session.active_agent_name
85
- S_AGENT_RECEIVE — 接收 Agent 返回、解析状态 PERSIST: —
86
- S_DECISION_EVAL — 启动分析 Agent 评估质量门 PERSIST: —
87
- S_APPLY_VERDICT — 应用裁决 PERSIST: session.steps[]
88
- S_SESSION_DONE — 所有 step 完成 PERSIST: session.status
89
- S_HANDLE_FAIL — 处理失败 PERSIST: step.status
90
- S_AMEND_GOAL — 修改 running session 目标 PERSIST: session.task_decomposition, .boundary_contract, .goal_changelog, .steps[]
91
- S_FALLBACK — 请求用户输入 PERSIST: —
92
- </states>
93
-
94
- <transitions>
95
-
96
- S_PARSE_ROUTE:
97
- → S_STATUS WHEN: intent == "status"
98
- → S_CONTINUE WHEN: intent == "continue"
99
- → S_AMEND_GOAL WHEN: amend_mode == true AND running session exists
100
- → S_FALLBACK WHEN: amend_mode == true AND no running session
101
- → S_DECISION_EVAL WHEN: running session with decision step in "running" status
102
- → S_RESOLVE_PHASE WHEN: intent is non-empty
103
- → S_FALLBACK WHEN: no intent AND no running session
104
-
105
- S_STATUS:
106
- → END DO: A_SHOW_STATUS
107
-
108
- S_CONTINUE:
109
- → S_AGENT_DISPATCH WHEN: running session found
110
- → S_FALLBACK WHEN: no running session
111
-
112
- S_AMEND_GOAL:
113
- → S_AGENT_DISPATCH WHEN: change applied + user confirmed DO: A_AMEND_GOAL
114
- → END WHEN: user cancels
115
- GUARD: RISK_LEVEL=high → auto_confirm 无效
116
-
117
- S_CREATE_SESSION:
118
- → S_CONFIRM WHEN: not auto_confirm
119
- → S_AGENT_DISPATCH WHEN: auto_confirm
120
-
121
- S_CONFIRM:
122
- → S_AGENT_DISPATCH WHEN: user confirms
123
- → S_BUILD_CHAIN WHEN: user edits
124
- → END WHEN: user cancels
125
-
126
- S_AGENT_DISPATCH:
127
- → S_AGENT_RECEIVE DO: A_DISPATCH_EXECUTE_AGENT
128
-
129
- S_AGENT_RECEIVE:
130
- → S_DECISION_EVAL WHEN: Agent returned "decision_pending" DO: A_PARSE_AGENT_RETURN
131
- → S_SESSION_DONE WHEN: Agent returned "session_complete" DO: A_PARSE_AGENT_RETURN
132
- → S_HANDLE_FAIL WHEN: Agent returned "step_failed" DO: A_PARSE_AGENT_RETURN
133
- → S_HANDLE_FAIL WHEN: Agent returned null (agent error) DO: A_PARSE_AGENT_RETURN
134
-
135
- S_DECISION_EVAL: (decision 节点 == `step.decision` 非空)
136
- → S_APPLY_VERDICT WHEN: quality-gate (post-execute, post-business-test, post-review, post-test, post-frontend-verify)
137
- DO: A_AGENT_EVALUATE
138
- → S_APPLY_VERDICT WHEN: goal-gate (post-goal-audit)
139
- DO: A_AGENT_GOAL_AUDIT
140
- → S_APPLY_VERDICT WHEN: scope-gate (post-analyze-scope)
141
- DO: A_SCOPE_EVALUATE
142
- → S_APPLY_VERDICT WHEN: reground-gate (post-reground)
143
- DO: A_AGENT_REGROUND
144
- → S_APPLY_VERDICT WHEN: structural (post-milestone, post-debug-escalate)
145
- DO: A_STRUCTURAL_EVALUATE
146
-
147
- S_APPLY_VERDICT:
148
- → S_AGENT_DISPATCH WHEN: verdict == "proceed" DO: A_APPLY_PROCEED
149
- → S_AGENT_DISPATCH WHEN: post-goal-audit + has_unmet DO: A_APPLY_GOAL_FIX
150
- → S_AGENT_DISPATCH WHEN: post-goal-audit + all_met + INTENT_ALIGNED=true DO: A_APPLY_GOAL_DONE
151
- → END WHEN: post-goal-audit + all_met + INTENT_ALIGNED=false DO: A_REGROUND_HALT
152
- → S_AGENT_DISPATCH WHEN: post-analyze-scope DO: A_APPLY_SCOPE_VERDICT
153
- → S_AGENT_DISPATCH WHEN: verdict == "fix" DO: A_APPLY_FIX
154
- → S_AGENT_DISPATCH WHEN: verdict == "escalate" DO: A_APPLY_ESCALATE
155
- → S_AGENT_DISPATCH WHEN: post-milestone + standard + next milestone DO: A_ADVANCE_MILESTONE
156
- → END WHEN: post-milestone + standard + no next milestone
157
- → END WHEN: post-milestone + adhoc DO: mark completed (set current_milestone = null)
158
- → END WHEN: post-debug-escalate DO: A_PAUSE_ESCALATE
159
- → END WHEN: post-reground + drifted + confidence >= 60 DO: A_REGROUND_HALT
160
- → S_AGENT_DISPATCH WHEN: post-reground + aligned DO: A_APPLY_PROCEED
161
- → S_AGENT_DISPATCH WHEN: post-reground + drifted + confidence < 60 DO: A_APPLY_PROCEED (标 LOW CONFIDENCE)
162
- GUARD: retry_count >= max_retries → force escalate
163
- GUARD: confidence_score < 60 AND proceed → override to fix
164
- GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
165
- GUARD: auto_confirm → skip user prompt, apply adjusted verdict
166
- GUARD: not auto_confirm → ask_user with override options
167
- GUARD: post-reground + drifted + confidence >= 60 → A_REGROUND_HALT(auto_confirm 不跳过)
168
-
169
- S_HANDLE_FAIL:
170
- → S_AGENT_DISPATCH WHEN: auto + not retried DO: A_RETRY
171
- → END WHEN: auto + retried DO: A_PAUSE_SESSION
172
- → S_AGENT_DISPATCH WHEN: interactive + retry
173
- → S_AGENT_DISPATCH WHEN: interactive + skip
174
- → END WHEN: interactive + abort
175
-
176
- S_SESSION_DONE:
177
- → END DO: A_COMPLETE_SESSION
178
-
179
- </transitions>
180
-
181
- <actions>
182
-
183
- ### A_CREATE_SESSION
184
- 1. `session_id` format: `ralph-agent-{YYYYMMDD-HHmmss}`
185
- 2. Additional fields: `execution_mode: "agent"`,无 `cli_tool` 字段
186
- 3. Each step: `agent_exec_name: null`(替代 `delegate_exec_id`)
187
- 4. Step mode/role/rule assigned per stage (see Stage Mapping table)
188
-
189
- ### A_DISPATCH_EXECUTE_AGENT
190
-
191
- 启动执行 Agent 处理 pending 执行 step。Agent 自主循环直到遇到 decision/完成/失败。
192
-
193
- 1. Read status.json → 确认有 pending step
194
- 2. Resolve agent name: `{stage_prefix}-{session_id_short}-{HHmmss}`
195
-
196
- **Agent Name Prefix (by stage):**
197
-
198
- | Stage | Prefix |
199
- |-------|--------|
200
- | grill | `grl` |
201
- | brainstorm | `brn` |
202
- | analyze-macro | `anm` |
203
- | analyze | `ana` |
204
- | plan | `pln` |
205
- | execute | `exe` |
206
- | review | `rev` |
207
- | test | `tst` |
208
- | debug | `dbg` |
209
- | Other | `run` |
210
-
211
- 3. Compose `<execution_context>` block:
212
-
213
- ```xml
214
- <execution_context>
215
- <intent>{session.intent}</intent>
216
- <phase>{session.phase}</phase>
217
- <milestone>{session.milestone}</milestone>
218
- <boundary_contract>
219
- <in_scope>{boundary_contract.in_scope}</in_scope>
220
- <out_of_scope>{boundary_contract.out_of_scope}</out_of_scope>
221
- <definition_of_done>{boundary_contract.definition_of_done}</definition_of_done>
222
- </boundary_contract>
223
- <execution_criteria>{session.execution_criteria}</execution_criteria>
224
- <active_goals>{task_decomposition WHERE status != "superseded"; superseded 目标仅一行标注}</active_goals>
225
- <prior_step_context>
226
- {最近 5 个已完成 step 的 completion_summary + completion_caveats}
227
- </prior_step_context>
228
- <accumulated_signals>
229
- {聚合所有已完成 step 的 caveats + deferred}
230
- </accumulated_signals>
231
- <stage_context>
232
- {按下一个 pending step 的目标 skill 类型选择性注入,见下表;仅在有实际内容时加入}
233
- </stage_context>
234
- </execution_context>
235
- ```
236
-
237
- **Stage-specific `<stage_context>` injection:**
238
-
239
- | 目标 skill 类型 | 注入重点 |
240
- |----------------|---------|
241
- | analyze | intent + scope + boundary |
242
- | plan | analysis findings + scope_verdict + recommendations |
243
- | execute | task list + dependencies + wave + caveats from plan |
244
- | review | changed files + verification results + execution decisions |
245
- | test | review findings + execution artifacts + coverage data |
246
- | debug | error details + failing tests + execution trace |
247
- | brainstorm/grill | challenged assumptions + risks + prior findings |
248
-
249
- 4. Dispatch Agent:
250
-
251
- ```
252
- delegate_subagent({
253
- name: "{resolved_agent_name}",
254
- description: "执行 ralph session steps",
255
- prompt: `执行 ralph-agent session {session_id} 的 pending steps。
256
-
257
- 调用 invoke_skill("maestro-ralph-agent-execute", "--session {session_id}") 执行步骤。
258
- maestro-ralph-agent-execute 会自动循环执行 pending 执行 step,遇到 decision/完成/失败时返回。
259
-
260
- {execution_context}
261
-
262
- 执行 Agent 内部调用 maestro ralph complete 上报。你只需确保 Skill 调用完成后输出 ---AGENT-STATUS--- 块。
263
-
264
- 最后必须输出以下状态块:
265
-
266
- ---AGENT-STATUS---
267
- RESULT: decision_pending|session_complete|step_failed|steps_completed
268
- LAST_STEP_INDEX: {N}
269
- DECISION_NODE: {gate name, 仅 decision_pending 时}
270
- COMPLETED_STEPS: {本次完成的 step 数量}
271
- FAILURE_REASON: {仅 step_failed 时}
272
- ---END---`
273
- })
274
- ```
275
-
276
- 5. Write `session.active_agent_name` to status.json
277
- 6. Display: `⟶ Agent:{name} dispatched for session {session_id}`
278
-
279
- ### A_PARSE_AGENT_RETURN
280
-
281
- 从 Agent 返回文本中解析 `---AGENT-STATUS---` 块,并验证 session 状态一致性。
282
-
283
- 1. Extract RESULT field → route to next state
284
- 2. Extract metadata: LAST_STEP_INDEX, DECISION_NODE, COMPLETED_STEPS, FAILURE_REASON
285
- 3. If no `---AGENT-STATUS---` block → fallback: re-read status.json 推断状态
286
- - 有 pending decision step → `decision_pending`
287
- - 全部 completed → `session_complete`
288
- - 有 failed step → `step_failed`
289
- 4. **Verify agent reporting** — re-read status.json 验证 agent 上报是否成功写入:
290
- - 检查 LAST_STEP_INDEX 对应的 step 是否 `completion_confirmed == true`
291
- - 若 Agent 返回 COMPLETED_STEPS > 0 但 status.json 中对应 step 未 completed → 标记 `agent_report_mismatch = true`,RESULT 降级为 `step_failed`,FAILURE_REASON = "agent 上报未写入 status.json"
292
- - 检查 `session.status` 是否仍为 "running"(agent 崩溃可能导致 paused)
293
- 5. Display: `[Agent返回] {RESULT} — 完成 {COMPLETED_STEPS} 步`
294
-
295
- ### A_AGENT_EVALUATE
296
-
297
- 通过 Agent 在本循环内评估质量门。替代 `maestro delegate --mode analysis`。
298
-
299
- 1. Resolve artifact dir: `.workflow/scratch/{artifact.path}/` with fallback glob
300
- 2. Parse decision metadata: `{ decision, retry_count, max_retries }`
301
- 3. Map result files(同 ralph A_DELEGATE_EVALUATE):
302
-
303
- | Decision | Files |
304
- |----------|-------|
305
- | post-execute | verification.json |
306
- | post-business-test | .tests/auto-test/report.json |
307
- | post-review | review.json |
308
- | post-test | uat.md, .tests/test-results.json |
309
- | post-frontend-verify | e2e-results.json |
310
-
311
- 4. Dispatch evaluation Agent:
312
- ```
313
- delegate_subagent({
314
- name: "eval-{decision}-{timestamp}",
315
- description: "评估 {decision} 质量门",
316
- prompt: "PURPOSE: 评估 {decision} 质量门结果
317
- TASK: 读取以下结果文件 | 分析状态 | 评估严重性 | 给出建议
318
- FILES: {result_file_paths}
319
- SESSION: {session_dir}/status.json
320
- EXPECTED: 输出以下格式:
321
- ---VERDICT---
322
- STATUS: PASS|FAIL|PARTIAL|BLOCKED
323
- REASON: <一句话原因>
324
- GAP_SUMMARY: <差距摘要>
325
- CONFIDENCE: high|medium|low
326
- CONFIDENCE_SCORE: 0-100
327
- WEAKEST_DIMENSION: <最弱维度>
328
- ---END---
329
- CONSTRAINTS: 只评估不修改文件 | 置信度<60%倾向 fix | retry {n}/{max} 达上限必须 escalate"
330
- })
331
- ```
332
- 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 13)
333
- 6. Confidence adjustment: <60 + proceed → fix; >95 + fix + retry>0 → suggest proceed
334
- 7. **Decision log**: Append to `{session_dir}/decisions.ndjson`:
335
- ```json
336
- { "id": "DEC-{timestamp}", "timestamp": "{ISO}", "source": "ralph-agent",
337
- "node_id": "{step.decision}", "type": "quality-gate",
338
- "verdict": "{adjusted_verdict}", "confidence_score": {N},
339
- "parse_failed": false,
340
- "close_call": {N>=50 && N<=70}, "summary": "{REASON}" }
341
- ```
342
-
343
- ### A_AGENT_GOAL_AUDIT
344
-
345
- 通过 Agent 审计子目标完成情况。替代 `maestro delegate --mode analysis` 的 goal audit。
346
-
347
- 1. Read `session.task_decomposition` from status.json
348
- 2. Dispatch audit Agent:
349
- ```
350
- delegate_subagent({
351
- name: "goal-audit-{timestamp}",
352
- description: "审计子目标完成情况",
353
- prompt: "PURPOSE: 审计未完成子目标,判定 met / unmet
354
- TASK:
355
- 1. 读取 {session_dir}/status.json 中 task_decomposition 的 status!=done 子目标
356
- 2. 打开 evidence 产物,对照 done_when 严格判定
357
- 3. 输出 met / unmet,unmet 给出 gap + target_phase
358
- 4. 对照 intent + definition_of_done 判定意图保真
359
- CONTEXT:
360
- status.json = {session_dir}/status.json
361
- intent = {session.intent}
362
- definition_of_done = {boundary_contract.definition_of_done}
363
- execution_criteria = {execution_criteria}
364
- boundary_contract = {boundary_contract}
365
- EXPECTED:
366
- ---VERDICT---
367
- STATUS: all_met|has_unmet
368
- INTENT_ALIGNED: true|false
369
- UNMET: [{id:G2,gap:'...',target_phase:execute}, ...]
370
- CONFIDENCE_SCORE: 0-100
371
- ---END---
372
- CONSTRAINTS: 只评估不修改文件 | 严格按 done_when 判定 | evidence 缺失→unmet"
373
- })
374
- ```
375
- 3. On return: parse verdict, update task_decomposition status
376
- 4. Append `{session_dir}/decisions.ndjson`:`{ "type": "goal-gate", "unmet_count": N, "unmet_ids": [...] }`
377
- 5. Verdict routing: `all_met` + `INTENT_ALIGNED=true` → A_APPLY_GOAL_DONE;`all_met` + `INTENT_ALIGNED=false` → A_REGROUND_HALT;`has_unmet` → A_APPLY_GOAL_FIX
378
- GUARD: retry_count >= max_retries AND still unmet → A_APPLY_ESCALATE
379
-
380
- ### A_AGENT_REGROUND
381
-
382
- 通过 Agent 执行意图保真检查。替代 `maestro delegate --mode analysis` 的 reground。
383
-
384
- 1. Read status.json:intent, boundary_contract, completed steps, done goals
385
- 2. Dispatch reground Agent:
386
- ```
387
- delegate_subagent({
388
- name: "reground-{timestamp}",
389
- description: "意图保真检查",
390
- prompt: "PURPOSE: 意图保真检查 — 对照 intent 验证累积执行是否漂移
391
- TASK:
392
- 1. 读取 intent + boundary_contract.definition_of_done
393
- 2. 读取已完成 steps 的 completion_evidence + 已 done 子目标
394
- 3. 判定累积产出是否仍服务 intent
395
- 4. 输出 aligned / drifted + drift_description + corrective_action
396
- CONTEXT:
397
- status.json = {session_dir}/status.json
398
- intent = {session.intent}
399
- definition_of_done = {boundary_contract.definition_of_done}
400
- in_scope = {boundary_contract.in_scope}
401
- out_of_scope = {boundary_contract.out_of_scope}
402
- goal_changelog = {session.goal_changelog ?? []}
403
- EXPECTED:
404
- ---VERDICT---
405
- STATUS: aligned|drifted
406
- DRIFT_DESCRIPTION: <空或具体描述>
407
- CORRECTIVE_ACTION: <空或建议>
408
- CONFIDENCE_SCORE: 0-100
409
- ---END---
410
- CONSTRAINTS: 只评估不修改文件 | aligned 阈值≥80% | 单个 step 触碰 out_of_scope→直接 drifted"
411
- })
412
- ```
413
- 3. On return: parse verdict
414
- 4. Append `{session_dir}/decisions.ndjson`
415
- 5. Verdict routing:aligned → A_APPLY_PROCEED;drifted + confidence >= 60 → A_REGROUND_HALT;drifted + confidence < 60 → A_APPLY_PROCEED (LOW CONFIDENCE)
416
-
417
- ### A_SCOPE_EVALUATE
418
-
419
- 仅由 `post-analyze-scope` 决策节点触发。
420
-
421
- 1. 定位刚完成的 macro analyze artifact → `analyze_macro_id`, `conclusions_path`
422
- 2. 读取 `conclusions.scope_verdict`(`large | medium | small`),缺失 → `unknown`
423
- 3. 写入 `session.scope_verdict` + `session.analyze_macro_id`
424
- 4. Append `{session_dir}/decisions.ndjson`:`{ "type": "scope-gate", "source": "ralph-agent", "verdict": "{scope_verdict}", "analyze_macro_id": "{ANL_ID}" }`
425
-
426
- ### A_STRUCTURAL_EVALUATE
427
-
428
- **post-milestone:**
429
- 1. Read state.json → resolve milestone type(default `"standard"`)
430
- 2. Standard milestone:next milestone exists → insert lifecycle steps / complete
431
- 3. Adhoc milestone(`type == "adhoc"`):always END,set `current_milestone = null`
432
-
433
- **post-debug-escalate:** always → A_PAUSE_ESCALATE
434
-
435
- ### A_SHOW_STATUS
436
-
437
- 1. Find latest `ralph-agent-*` session(by created_at)
438
- 2. Display: Session, Status, Position, Progress, Current step
439
- 3. List steps: [✓] confirmed, [▸] current, [ ] pending, [◆] decision;执行 step 附 `command_scope` + `command_path`
440
- 4. If `task_decomposition` present → 显示 sub-goals 进度(done/total)
441
-
442
- ### A_APPLY_PROCEED / A_APPLY_FIX / A_APPLY_ESCALATE
443
-
444
- - **A_APPLY_PROCEED**: Mark decision completed, write status.json
445
- - **A_APPLY_FIX**: Insert fix-loop steps after current step(见 Fix-Loop Templates),reindex,increment retry_count
446
- - **A_APPLY_ESCALATE**: Insert `[quality-debug "{gap_summary}", decision:post-debug-escalate]`,reindex
447
-
448
- ### A_APPLY_SCOPE_VERDICT
449
-
450
- 依据 `session.scope_verdict` + `session.wants_roadmap` 重塑下游链路:
451
-
452
- 1. 路径 A(`large` 且 `wants_roadmap`):保持 roadmap+analyze,`plan` 选 phase 列
453
- 2. 路径 B(`medium`/`small`,或 `large` 非 `wants_roadmap`):删除未完成的 `roadmap` + `analyze` step,`plan` 改为 `--from analyze:{ANL_ID}`
454
- 3. 路径 C(`unknown`):非 auto_confirm → ask_user;auto_confirm → 默认路径 B
455
- 4. Reindex steps,标 decision completed
456
-
457
- ### A_APPLY_GOAL_FIX / A_APPLY_GOAL_DONE
458
-
459
- - **A_APPLY_GOAL_FIX**: 对每个 unmet 子目标插入 scoped mini-loop(plan --gaps + execute),`goal_ref` 标注,重新追加 `decision:post-goal-audit {retry+1}`
460
- - **A_APPLY_GOAL_DONE**: set `task_decomposition[*].status="done"`, `completion_confirmed=true`, `task_decomposition_all_done=true`
461
-
462
- ### A_ADVANCE_MILESTONE
463
-
464
- 1. Update session: milestone, phase, reset passed_gates
465
- 2. Insert full lifecycle steps for next milestone
466
- 3. Reindex, write status.json
467
-
468
- ### A_REGROUND_HALT / A_PAUSE_ESCALATE
469
-
470
- - **A_REGROUND_HALT**: set `session.status = "paused"`,display drift warning + 恢复选项。auto_confirm 不跳过
471
- - **A_PAUSE_ESCALATE**: set session paused,display "请人工介入",suggest continue
472
-
473
- ### A_AMEND_GOAL
474
-
475
- 运行中 session 的目标热修改。详细流程由 `<deferred_reading>` 加载 `ralph-amend-goal.md`。
476
-
477
- | Phase | 行为 | 产出 |
478
- |-------|------|------|
479
- | 1. 快照 | 读 `task_decomposition` + `boundary_contract` + 已完成 steps 的 `completion_summary` | Display: 目标列表 + 进度 |
480
- | 2. 解析 | `change_request` 非空 → 直接用;为空 → ask_user(修改/新增/移除/调整边界) | `change_type` + `change_request` |
481
- | 3. Mini Grill | Agent 评估影响(替代 maestro delegate) | RISK_LEVEL + AFFECTED_GOALS + INVALIDATED_STEPS + NEW_GAPS |
482
- | 4. 确认 | ask_user:应用并继续 / 仅改目标 / 取消 | 用户选择 |
483
- | 5. 应用 | 归档旧目标(`superseded`)→ 写入新目标(`origin: CHG-xxx`)→ 重建链路 → write status.json | re-dispatch |
484
-
485
- **Phase 3 Agent prompt:**
486
- ```
487
- delegate_subagent({
488
- name: "amend-grill-{timestamp}",
489
- description: "Amend impact analysis",
490
- prompt: "PURPOSE: 评估目标修改对 running session 的影响
491
- TASK:
492
- 1. 读取 {session_dir}/status.json 的 task_decomposition + boundary_contract + 已完成 steps
493
- 2. 分析 change_request 对既有目标/步骤的影响
494
- 3. 判定 RISK_LEVEL (low/medium/high)
495
- 4. 列出 AFFECTED_GOALS / INVALIDATED_STEPS / NEW_GAPS
496
- CONTEXT:
497
- change_request = {change_request}
498
- change_type = {change_type}
499
- session = {session_dir}/status.json
500
- EXPECTED:
501
- ---AMEND-VERDICT---
502
- RISK_LEVEL: low|medium|high
503
- AFFECTED_GOALS: [G1, G2, ...]
504
- INVALIDATED_STEPS: [step indices]
505
- NEW_GAPS: [gap descriptions]
506
- RECOMMENDATION: <建议>
507
- ---END---
508
- CONSTRAINTS: 只评估不修改文件"
509
- })
510
- ```
511
-
512
- GUARD: `RISK_LEVEL == high` → ask_user 不跳过(auto_confirm 无效)
513
- GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
514
- 旧目标标 `superseded`(`superseded_by` + `superseded_at`),新目标标 `origin: "CHG-xxx"`。`goal_changelog` 含完整 `before/after` + `impact_assessment`。
515
-
516
- ### A_RETRY / A_PAUSE_SESSION / A_COMPLETE_SESSION
517
-
518
- - **A_RETRY**: `shell("maestro ralph retry {index}")` — 同 ralph
519
- - **A_PAUSE_SESSION**: `ralph complete N --status BLOCKED --reason "..."` — 同 ralph
520
- - **A_COMPLETE_SESSION**: 校验所有 step `completion_confirmed == true` + `task_decomposition_all_done == true`,写 `session.status = "completed"` — 同 ralph
521
-
522
- </actions>
523
-
524
- </state_machine>
525
-
526
- <appendix>
527
-
528
- ### Agent vs CLI-Delegate 对照
529
-
530
- | 维度 | ralph-cli (CLI-delegate) | ralph-agent (Agent) |
531
- |------|-------------------------|---------------------|
532
- | 执行分发 | `maestro delegate` (Bash bg) | `delegate_subagent()` (同步) |
533
- | 执行包装器 | `maestro-ralph-cli-execute` (delegate 加载) | `maestro-ralph-agent-execute` (Agent 内 Skill 加载) |
534
- | 结果通信 | `---RESULT---` 文本块 (从 delegate output 解析) | Agent 返回文本 + `---AGENT-STATUS---` 块 |
535
- | 回调模式 | STOP → re-invocation callback | 同步等待 Agent 返回(无 STOP) |
536
- | 决策评估 | `maestro delegate --mode analysis` (Bash bg + STOP) | `delegate_subagent()` 同步分析(无 STOP) |
537
- | 完成上报 | 编排器调 `ralph complete`(解析 RESULT 后) | 执行 Agent 内调 `ralph complete`(agent 上报) |
538
- | session 字段 | `execution_mode: "cli-delegate"`, `cli_tool`, `delegate_exec_id` | `execution_mode: "agent"`, `agent_exec_name` |
539
-
540
- ### Stage Mapping
541
-
542
- Agent 版无 `delegate_mode`/`delegate_rule` 字段。执行 Agent 始终拥有完整工具集(read + write),由 skill 自身约束行为。Decision 评估 Agent 通过 prompt 中的 CONSTRAINTS 约束为只读。
543
-
544
- | Stage | invoke_skill(independent) | invoke_skill(unified) | Decision after | quality_mode |
545
- |-------|---------------------|-----------------|----------------|--------------|
546
- | grill | `maestro-grill "{intent}"` | *(same)* | — | all |
547
- | brainstorm | `maestro-brainstorm "{intent}"` | *(same)* | — | all |
548
- | blueprint | `maestro-blueprint "{intent}"` | *(same)* | — | all |
549
- | init | `maestro-init` | *(same)* | — | all |
550
- | spec-setup | `spec-setup` | *(same)* | — | all |
551
- | analyze-macro | `maestro-analyze "{intent}"` | *(same)* | `post-analyze-scope` | all |
552
- | roadmap | `maestro-roadmap --from analyze:{id}` | *(same)* | — | all |
553
- | analyze | `maestro-analyze {phase}` | `maestro-analyze` | — | all |
554
- | plan | `maestro-plan {phase}` | `maestro-plan` | — | all |
555
- | execute | `maestro-execute {phase}` | `maestro-execute` | `post-execute` | all |
556
- | business-test | `quality-auto-test {phase}` | `quality-auto-test` | `post-business-test` | full only |
557
- | review | `quality-review {phase}` | `quality-review` | `post-review` | all |
558
- | test-gen | `quality-auto-test {phase}` | `quality-auto-test` | — | full / standard |
559
- | test | `quality-test {phase}` | `quality-test` | `post-test` | full, standard |
560
- | frontend-verify | `quality-test {phase} --frontend-verify` | `quality-test --frontend-verify` | `post-frontend-verify` | all (UI only) |
561
- | milestone-audit | `maestro-milestone-audit` | *(same)* | — | all |
562
- | goal-audit | *(decision-only)* | *(same)* | `post-goal-audit` | all |
563
- | milestone-complete | `maestro-milestone-complete` | *(same)* | `post-milestone` | all |
564
-
565
- Build rules 0-14 全部适用,包括 spec-setup 预检(rule 0.5)、grill auto_confirm 透传(rule 3.5)、frontend-verify UI 门控(rule 3.6)、re-grounding 插入(rule 5.5)等。
566
-
567
- ### Session Schema
568
-
569
- ```json
570
- {
571
- "session_id": "ralph-agent-{YYYYMMDD-HHmmss}",
572
- "source": "ralph", "status": "running",
573
- "execution_mode": "agent",
574
- "ralph_protocol_version": "2",
575
- "active_step_index": null,
576
- "active_agent_name": null,
577
- "intent": "", "lifecycle_position": "",
578
- "phase": null, "phase_is_new": false,
579
- "milestone": "",
580
- "auto_mode": false,
581
- "decomposition_owner": "ralph",
582
-
583
- "quality_mode": "standard",
584
- "planning_mode": "independent",
585
- "scope_verdict": null,
586
- "wants_roadmap": false,
587
- "analyze_macro_id": null,
588
- "blueprint_id": null,
589
- "passed_gates": [],
590
- "context": { "issue_id": null, "scratch_dir": null, "plan_dir": null,
591
- "analysis_dir": null, "brainstorm_dir": null, "blueprint_dir": null },
592
- "steps": [{
593
- "index": 0,
594
- "skill": "",
595
- "args": "",
596
- "stage": "",
597
- "scope": null,
598
- "decision": null,
599
- "retry_count": 0,
600
- "max_retries": 2,
601
- "command_scope": "global|project|missing|null",
602
- "command_path": "<absolute path> | null",
603
- "milestone_id": null,
604
- "source_artifact_ref": null,
605
- "status": "pending|running|completed|skipped|failed",
606
- "goal_ref": null,
607
- "completion_confirmed": false,
608
- "completion_status": null,
609
- "completion_evidence": null,
610
- "completion_summary": null,
611
- "completion_decisions": null,
612
- "completion_caveats": null,
613
- "completion_deferred": null,
614
- "completed_at": null,
615
- "deferred_reads": [],
616
- "load": null,
617
- "agent_exec_name": null,
618
- "artifacts_produced": [],
619
- "drift_score": null,
620
- "drift_correction": null
621
- }],
622
- "waves": [], "current_step": 0,
623
-
624
- "boundary_contract": {
625
- "in_scope": [], "out_of_scope": [], "constraints": [], "definition_of_done": ""
626
- },
627
- "execution_criteria": [],
628
- "task_decomposition": [
629
- { "id": "G1", "goal": "", "boundary": "", "done_when": "",
630
- "evidence": "", "lifecycle": [], "status": "pending|done|superseded",
631
- "completion_confirmed": false, "completed_at": null,
632
- "superseded_by": null, "superseded_at": null, "origin": null }
633
- ],
634
- "task_decomposition_all_done": false,
635
-
636
- "goal_changelog": [
637
- { "id": "CHG-001", "timestamp": "{ISO}",
638
- "change_type": "modify|add|remove|boundary",
639
- "reason": "",
640
- "impact_assessment": { "risk_level": "low|medium|high",
641
- "invalidated_steps": [], "new_steps_inserted": 0 },
642
- "before": { "goals": [{"id":"G1","goal":"...","done_when":"..."}] },
643
- "after": { "goals": [{"id":"G1v2","goal":"...","done_when":"..."}] } }
644
- ]
645
- }
646
- ```
647
-
648
- ### Fix-Loop Templates
649
-
650
- 6 套 fix-loop templates(post-execute / post-business-test / post-review / post-test / post-frontend-verify / post-goal-audit),结构同 ralph。插入的 step 通过 Agent dispatch 执行,由 execute Agent 内调 `ralph complete` 上报。
651
-
652
- ### Error Codes
653
-
654
- E001–E006, W001–W004 适用。Agent 新增:
655
-
656
- | Code | Severity | Description | Recovery |
657
- |------|----------|-------------|----------|
658
- | E014 | error | Agent execution failed (Agent returned null) | Retry once, then BLOCKED |
659
- | E015 | error | `---AGENT-STATUS---` block not found | Fallback: re-read status.json 推断 |
660
- | E016 | error | Evaluation Agent verdict parse failed | Fallback fix + parse_failed: true |
661
-
662
- ### Success Criteria
663
-
664
- - [ ] ralph-agent owns full loop: dispatch Agent → wait → verify → decide → re-dispatch
665
- - [ ] 执行通过 `delegate_subagent()` 分发,Agent 内调 `invoke_skill("maestro-ralph-agent-execute", "--session {id}")` 执行
666
- - [ ] Agent 返回文本含 `---AGENT-STATUS---` 块(RESULT/LAST_STEP_INDEX/DECISION_NODE/COMPLETED_STEPS/FAILURE_REASON)
667
- - [ ] 无 STOP/callback 模式 — delegate_subagent() 同步等待返回
668
- - [ ] 执行 Agent 自主循环执行 step,遇 decision 停止返回
669
- - [ ] 执行 Agent 内部调 `maestro ralph complete` 上报(agent 上报,非编排器上报)
670
- - [ ] A_PARSE_AGENT_RETURN 验证 status.json:agent 上报写入确认 + session.status 一致性
671
- - [ ] Decision evaluation 通过 delegate_subagent() 同步完成(非 maestro delegate)
672
- - [ ] Verdict 解析保持 `---VERDICT---` 格式,parse 失败 → fallback fix + parse_failed: true
673
- - [ ] decisions.ndjson 追加:source 字段为 `"ralph-agent"`
674
- - [ ] Session schema: `execution_mode: "agent"`,`agent_exec_name` 替代 `delegate_exec_id`,含 `artifacts_produced`
675
- - [ ] Chain building(S_RESOLVE_PHASE through S_BUILD_CHAIN)逻辑同 ralph,本文件自包含执行
676
- - [ ] execution_context 块含 prior_step_context(滑动窗口 5 step)+ accumulated_signals + stage_context
677
- - [ ] execution_context 中 boundary_contract 不截断;superseded 目标仅一行标注
678
- - [ ] Agent name 含 stage prefix(grl/brn/anm/ana/pln/exe/rev/tst/dbg)
679
- - [ ] Stage Mapping 表内联适配(无 delegate_mode/delegate_rule,Agent 始终 read+write,评估 Agent prompt 约束只读)
680
- - [ ] completion_summary 在 DONE/DONE_WITH_CONCERNS 时为 MUST(由 execute Agent 的 ralph complete --summary 写入)
681
- - [ ] CAVEATS 在 DONE_WITH_CONCERNS 时同时映射 --concerns(execute Agent 负责)
682
- - [ ] A_AMEND_GOAL:完整 5 步流程 + deferred_reading ralph-amend-goal.md + Agent mini grill 含完整 prompt
683
- - [ ] 旧目标标 superseded(superseded_by + superseded_at),新目标 origin: "CHG-xxx"
684
- - [ ] goal_changelog 含完整 before/after + impact_assessment
685
- - [ ] blueprint_id session 字段支持 --from blueprint:{BLP_ID} 路径
686
- - [ ] spec-setup 预检(build rule 0.5)
687
- - [ ] post-milestone adhoc 分支:mark completed + set current_milestone = null
688
- - [ ] post-reground + drifted + confidence < 60 → A_APPLY_PROCEED (LOW CONFIDENCE)
689
- - [ ] Fix-loop 插入的 step 通过 Agent dispatch 执行,`agent_exec_name` 初始化为 null
690
- - [ ] re-grounding 3-step 插入规则(build rule 5.5)不变
691
- - [ ] A_REGROUND_HALT 漂移熔断(auto_confirm 不跳过)不变
692
- - [ ] `---AGENT-STATUS---` 块缺失时 fallback:re-read status.json 推断状态
693
- - [ ] Agent 超时/崩溃 → A_PARSE_AGENT_RETURN fallback 推断 + S_HANDLE_FAIL 路径
694
-
695
- </appendix>
696
- </output>
697
- </output>