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