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.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: ralph-executor
3
+ description: Single-step executor — ralph next + inline skill execution, return output
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Edit
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - Skill
12
+ ---
13
+
14
+ # Ralph Executor
15
+
16
+ ## Role
17
+
18
+ Single-step skill executor. Call `maestro ralph next` to load the skill prompt, execute it inline, return execution output. You are a sandboxed executor — arg resolution, context assembly, signal extraction, drift analysis, and session management are handled by the orchestrator.
19
+
20
+ ## Process
21
+
22
+ 1. Call `Bash("maestro ralph next --session {session_id}")` — **全量捕获 stdout,严禁截断管道**
23
+ - Exit 0 → skill_prompt = stdout,继续执行
24
+ - Exit 1 → 返回错误信息(required_reading 缺失或 schema 错误)
25
+ - Exit 2 → 返回 "所有 step 已完成"
26
+ - Exit 3 → 返回 "并发冲突"
27
+ 2. Execute the skill prompt inline — follow all instructions faithfully
28
+ 3. Handle `<deferred_reading>` paths: Read files on demand during execution, do not batch-load upfront
29
+ 4. Return execution output as-is
30
+
31
+ ## Input
32
+
33
+ 从 dispatch prompt 中提取:
34
+
35
+ | Field | Required | Description |
36
+ |-------|----------|-------------|
37
+ | `session_id` | Yes | ralph session ID |
38
+ | execution context | No | 编排器注入的上下文(intent、boundary、goals、prior steps 等) |
39
+
40
+ ## Constraints
41
+
42
+ - Execute exactly one step per invocation
43
+ - Do not call `maestro ralph complete` — completion is handled by the orchestrator
44
+ - Do not read or modify `status.json` — session management is the orchestrator's responsibility
45
+ - Do not skip execution steps or short-circuit — execute the full skill content
46
+ - Do not insert/delete/reorder steps or evaluate decision nodes
@@ -13,11 +13,9 @@ allowed-tools:
13
13
  - AskUserQuestion
14
14
  ---
15
15
  <purpose>
16
- CLI-delegated variant of maestro-ralph. Same chain-building logic — but this command owns the full orchestration loop: compose prompt → delegate to CLI (via ralph-cli-execute wrapper) → STOP → callback → analyze structured result → mark complete → decide next → loop.
16
+ CLI-delegated lifecycle orchestrator: compose prompt → delegate to CLI (via ralph-cli-execute wrapper) → STOP → callback → analyze structured result → mark complete → decide next → loop.
17
17
 
18
18
  Session: `.workflow/.maestro/ralph-cli-{YYYYMMDD-HHmmss}/status.json`
19
-
20
- Chain building(A_RESOLVE_PHASE → A_INFER_POSITION → A_BUILD_STEPS)、session schema、decomposition(A_DECOMPOSE_TASKS)与 ralph 共用。
21
19
  </purpose>
22
20
 
23
21
  <context>
@@ -46,17 +44,26 @@ Remaining → intent (amend_mode 时为 change_request)
46
44
  </context>
47
45
 
48
46
  <invariants>
49
- All ralph invariants (1-16) apply, with the following overrides:
50
- - **Invariant 1 CLI 语义**: ralph-cli 不直接调用 `Skill()` 执行 step 内容;执行由 delegate cli-execute 完成
51
- - **Invariant 2 覆盖**: ralph-cli 不调用 `Skill("maestro-ralph-execute")`;invariant 17-21 替代 handoff 机制,ralph-cli 持有完整循环
52
-
53
- Additionally:
54
-
55
- 17. **ralph-cli owns the loop** — compose delegate → analyze → decide 全部在本命令内完成;ralph-cli-execute 只是被委托端的执行包装器
56
- 18. **Delegate via cli-execute** delegate prompt 首行为 cli-execute 调用,格式由目标工具决定(见 Invocation Notation)
57
- 19. **Parse ---RESULT--- block** delegate 返回后从输出中解析结构化结果块
58
- 20. **Decision evaluation inline** decision 节点不 handoff,直接在本循环内评估(仍用 `maestro delegate --to {session.cli_tool} --mode analysis` 做只读分析)
59
- 21. **No inline skill execution**本命令不执行 skill 逻辑;执行由委托端 cli-execute 完成
47
+ 1. **Ralph-cli never executes steps** — only creates sessions, composes delegation prompts, and evaluates decisions;执行由 delegate 端 cli-execute 完成
48
+ 2. **ralph-cli owns the loop** compose delegate analyze → decide 全部在本命令内完成;ralph-cli-execute 只是被委托端的执行包装器
49
+ 3. **Delegate via cli-execute** delegate prompt 首行为 cli-execute 调用,格式由目标工具决定(见 Invocation Notation)
50
+ 4. **Parse ---RESULT--- block** — delegate 返回后从输出中解析结构化结果块
51
+ 5. **Decision evaluation inline** — decision 节点不 handoff,直接在本循环内评估(用 `maestro delegate --to {session.cli_tool} --mode analysis` 做只读分析)
52
+ 6. **Decision delegates read-only** — `maestro delegate --to <tool> --mode analysis`
53
+ 7. **No inline skill execution** — 本命令不执行 skill 逻辑;执行由委托端 cli-execute 完成
54
+ 8. **执行 step 通过 `maestro ralph next` CLI 加载并内联执行**(由 cli-execute 端完成)
55
+ 9. **status.json 是唯一真源**不生成 markdown 清单或侧文件
56
+ 10. **每个 step 必须 `completion_confirmed: true`** `maestro ralph complete N --status DONE`(或 DONE_WITH_CONCERNS)写入;CLI 是唯一合法写入路径
57
+ 11. **command_path A_BUILD_STEPS 解析**通过 `maestro ralph skills --platform claude --json --quiet` 预校验
58
+ 12. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成
59
+ 13. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻
60
+ 14. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → 含 `{phase}`
61
+ 15. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop
62
+ 16. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作
63
+ 17. **Delegate fallback 必须标记** — A_DELEGATE_EVALUATE 解析 verdict 失败时 fallback 为 "fix",MUST 在 decisions.ndjson 记录 `"parse_failed": true, "confidence_score": 0`
64
+ 18. **auto_confirm 单一来源** — `auto_confirm` 仅由用户 `-y` 标志设定
65
+ 19. **分解契约单一所有者** — `boundary_contract` / `task_decomposition` 由 session 创建者拥有
66
+ 20. **控制权优先级(范式治理)** — FSM 独占 session 生命周期 + step 排序 + retry/fix/escalate + cross-step decision 节点
60
67
  </invariants>
61
68
 
62
69
  <state_machine>
@@ -621,8 +628,6 @@ E001–E006, W001–W004 适用。CLI 新增:
621
628
 
622
629
  ### Success Criteria
623
630
 
624
- Ralph success criteria 适用。CLI 新增:
625
-
626
631
  - [ ] ralph-cli owns full loop: compose → delegate → STOP → callback → parse → complete → next
627
632
  - [ ] Delegation prompt 首行为 cli-execute 调用(`--session {session_id}`,格式由 cli_tool 决定),后接 `<execution_context>`
628
633
  - [ ] A_PARSE_RESULT extracts STATUS/SUMMARY/ARTIFACTS/DECISIONS/CAVEATS/DEFERRED/SIGNALS from ---RESULT--- block