maestro-flow 0.5.37 → 0.5.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/maestro/SKILL.md +11 -5
- package/.agents/skills/maestro-ralph/SKILL.md +80 -12
- package/.agents/skills/maestro-ralph-execute/SKILL.md +17 -6
- package/.agents/skills/manage-drift-realign/SKILL.md +153 -0
- package/.agy/skills/maestro/SKILL.md +11 -5
- package/.agy/skills/maestro-ralph/SKILL.md +80 -12
- package/.agy/skills/maestro-ralph-execute/SKILL.md +17 -6
- package/.agy/skills/manage-drift-realign/SKILL.md +153 -0
- package/.claude/commands/maestro-ralph-execute.md +17 -6
- package/.claude/commands/maestro-ralph.md +80 -12
- package/.claude/commands/maestro.md +11 -5
- package/.claude/commands/manage-drift-realign.md +151 -0
- package/.codex/skills/maestro/SKILL.md +16 -8
- package/.codex/skills/maestro-ralph/SKILL.md +138 -11
- package/.codex/skills/maestro-ralph-execute/SKILL.md +17 -6
- package/.codex/skills/manage-drift-realign/SKILL.md +471 -0
- package/README.md +25 -8
- package/README.zh-CN.md +6 -6
- package/dashboard/dist-server/src/commands/install-backend.d.ts +10 -0
- package/dashboard/dist-server/src/commands/install-backend.js +69 -0
- package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
- package/dashboard/dist-server/src/core/component-defs.d.ts +11 -0
- package/dashboard/dist-server/src/core/component-defs.js +34 -2
- package/dashboard/dist-server/src/core/component-defs.js.map +1 -1
- package/dist/src/cli.js +3 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/install-backend.d.ts +10 -0
- package/dist/src/commands/install-backend.d.ts.map +1 -1
- package/dist/src/commands/install-backend.js +69 -0
- package/dist/src/commands/install-backend.js.map +1 -1
- package/dist/src/commands/install.js +1 -0
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/ralph.d.ts.map +1 -1
- package/dist/src/commands/ralph.js +8 -0
- package/dist/src/commands/ralph.js.map +1 -1
- package/dist/src/commands/timeline.d.ts +14 -0
- package/dist/src/commands/timeline.d.ts.map +1 -0
- package/dist/src/commands/timeline.js +377 -0
- package/dist/src/commands/timeline.js.map +1 -0
- package/dist/src/core/component-defs.d.ts +11 -0
- package/dist/src/core/component-defs.d.ts.map +1 -1
- package/dist/src/core/component-defs.js +34 -2
- package/dist/src/core/component-defs.js.map +1 -1
- package/dist/src/core/install-executor.d.ts.map +1 -1
- package/dist/src/core/install-executor.js +11 -1
- package/dist/src/core/install-executor.js.map +1 -1
- package/dist/src/core/install-profile.d.ts.map +1 -1
- package/dist/src/core/install-profile.js +52 -17
- package/dist/src/core/install-profile.js.map +1 -1
- package/dist/src/i18n/locales/en.d.ts.map +1 -1
- package/dist/src/i18n/locales/en.js +4 -1
- package/dist/src/i18n/locales/en.js.map +1 -1
- package/dist/src/i18n/locales/zh.d.ts.map +1 -1
- package/dist/src/i18n/locales/zh.js +4 -1
- package/dist/src/i18n/locales/zh.js.map +1 -1
- package/dist/src/i18n/types.d.ts +3 -0
- package/dist/src/i18n/types.d.ts.map +1 -1
- package/dist/src/ralph/cmd-complete.d.ts +4 -0
- package/dist/src/ralph/cmd-complete.d.ts.map +1 -1
- package/dist/src/ralph/cmd-complete.js +8 -0
- package/dist/src/ralph/cmd-complete.js.map +1 -1
- package/dist/src/ralph/cmd-next.js +58 -8
- package/dist/src/ralph/cmd-next.js.map +1 -1
- package/dist/src/ralph/status-schema.d.ts +29 -2
- package/dist/src/ralph/status-schema.d.ts.map +1 -1
- package/dist/src/ralph/status-schema.js +1 -1
- package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ComponentGrid.js +71 -38
- package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -1
- package/dist/src/tui/install-ui/ComponentGrid.logic.d.ts +12 -3
- package/dist/src/tui/install-ui/ComponentGrid.logic.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ComponentGrid.logic.js +21 -4
- package/dist/src/tui/install-ui/ComponentGrid.logic.js.map +1 -1
- package/dist/src/tui/install-ui/CyberItem.d.ts +3 -1
- package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -1
- package/dist/src/tui/install-ui/CyberItem.js +6 -5
- package/dist/src/tui/install-ui/CyberItem.js.map +1 -1
- package/dist/src/tui/install-ui/GroupedHub.d.ts +9 -0
- package/dist/src/tui/install-ui/GroupedHub.d.ts.map +1 -1
- package/dist/src/tui/install-ui/GroupedHub.js +54 -47
- package/dist/src/tui/install-ui/GroupedHub.js.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +54 -5
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/types.d.ts +1 -0
- package/dist/src/tui/install-ui/types.d.ts.map +1 -1
- package/dist/src/tui/install-ui/types.js.map +1 -1
- package/dist/src/tui/install-ui/useInstallFlowState.d.ts +8 -2
- package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
- package/dist/src/tui/install-ui/useInstallFlowState.js +145 -15
- package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
- package/dist/src/utils/update-notices.js +12 -0
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +1 -1
- package/workflows/agy-instructions.md +127 -88
- package/workflows/analyze.md +2 -2
- package/workflows/auto-test.md +7 -1
- package/workflows/blueprint.md +22 -19
- package/workflows/brainstorm.md +11 -3
- package/workflows/business-test.md +4 -0
- package/workflows/codebase-rebuild.md +8 -1
- package/workflows/codebase-refresh.md +7 -1
- package/workflows/codex-instructions.md +1 -1
- package/workflows/debug.md +5 -2
- package/workflows/domain-add.md +6 -0
- package/workflows/drift-realign.md +396 -0
- package/workflows/execute.md +5 -4
- package/workflows/explore-usage.md +2 -2
- package/workflows/finish-work.md +6 -6
- package/workflows/fork.md +2 -2
- package/workflows/grill.md +6 -5
- package/workflows/harvest.md +2 -2
- package/workflows/impeccable.md +3 -2
- package/workflows/init.md +7 -7
- package/workflows/integration-test.md +1 -0
- package/workflows/issue-gaps-analyze.codex.md +2 -0
- package/workflows/issue-gaps-analyze.md +4 -4
- package/workflows/issue-plan.md +1 -1
- package/workflows/knowhow.md +7 -1
- package/workflows/knowledge-audit.md +1 -1
- package/workflows/maestro-super.md +2 -2
- package/workflows/maestro.md +3 -3
- package/workflows/map.md +2 -2
- package/workflows/milestone-audit.md +1 -1
- package/workflows/milestone-complete.md +1 -1
- package/workflows/plan.md +7 -6
- package/workflows/quick.md +8 -6
- package/workflows/ralph-amend-goal.md +177 -0
- package/workflows/refactor.md +2 -0
- package/workflows/retrospective.md +7 -3
- package/workflows/review.md +6 -4
- package/workflows/roadmap-common.md +3 -3
- package/workflows/roadmap.md +8 -5
- package/workflows/spec-generate.md +23 -18
- package/workflows/specs-load.md +1 -1
- package/workflows/specs-setup.md +2 -0
- package/workflows/sync.md +4 -2
- package/workflows/test-gen.md +1 -1
- package/workflows/test.md +1 -1
- package/workflows/ui-codify-extract.md +1 -0
- package/workflows/ui-codify-knowhow.md +1 -1
- package/workflows/ui-codify-package.md +1 -1
- package/workflows/ui-codify.md +9 -7
- package/workflows/ui-design.md +9 -7
- package/workflows/ui-style.md +6 -4
- package/workflows/verify.md +4 -4
- package/workflows/wiki-connect.md +2 -0
- package/workflows/wiki-digest.md +5 -3
- package/workflows/wiki-manage.md +4 -0
- package/workflows/maestro.codex.md +0 -365
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: maestro-ralph
|
|
3
3
|
description: Use when the optimal command sequence is unclear and needs automated state-based determination
|
|
4
|
-
argument-hint: "<intent> [-y] | status [session-id] | continue [session-id]"
|
|
4
|
+
argument-hint: "<intent> [-y] | status [session-id] | continue [session-id] | --amend [change]"
|
|
5
5
|
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
6
|
---
|
|
7
7
|
<purpose>
|
|
@@ -48,15 +48,20 @@ Mutual invocation with `$maestro-ralph-execute` forms a self-perpetuating work l
|
|
|
48
48
|
```
|
|
49
49
|
</purpose>
|
|
50
50
|
|
|
51
|
+
<deferred_reading>
|
|
52
|
+
- [ralph-amend-goal.md](~/.maestro/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
|
|
53
|
+
</deferred_reading>
|
|
54
|
+
|
|
51
55
|
<context>
|
|
52
56
|
$ARGUMENTS — intent text, flags, or keywords.
|
|
53
57
|
|
|
54
58
|
**Parse:**
|
|
55
59
|
```
|
|
56
60
|
-y flag → auto_confirm = true
|
|
61
|
+
--amend / -a → amend_mode = true (running session 存在时触发目标修改流程)
|
|
57
62
|
.md/.txt path → input_doc (supplementary context only, NEVER substitutes lifecycle stages)
|
|
58
63
|
status|continue + session-id → 当 intent ∈ {status,continue} 且后续 token 匹配 ralph-*|maestro-* → target_session_id
|
|
59
|
-
Remaining → intent
|
|
64
|
+
Remaining → intent (amend_mode 时为 change_request)
|
|
60
65
|
```
|
|
61
66
|
|
|
62
67
|
**State files:**
|
|
@@ -100,6 +105,7 @@ S_CONFIRM — 用户确认 PERSIST: —
|
|
|
100
105
|
S_DISPATCH — 移交 maestro-ralph-execute PERSIST: —
|
|
101
106
|
S_DECISION_EVAL — 委托评估质量门 PERSIST: —
|
|
102
107
|
S_APPLY_VERDICT — 应用裁决 + 插入命令 PERSIST: session.steps[], session.passed_gates[]
|
|
108
|
+
S_AMEND_GOAL — 修改 running session 目标 PERSIST: session.task_decomposition, .boundary_contract, .goal_changelog, .steps[]
|
|
103
109
|
S_FALLBACK — 请求用户输入 PERSIST: —
|
|
104
110
|
</states>
|
|
105
111
|
|
|
@@ -108,6 +114,8 @@ S_FALLBACK — 请求用户输入 PERSIST: —
|
|
|
108
114
|
S_PARSE_ROUTE:
|
|
109
115
|
→ S_STATUS WHEN: intent == "status"
|
|
110
116
|
→ S_CONTINUE WHEN: intent == "continue"
|
|
117
|
+
→ S_AMEND_GOAL WHEN: amend_mode == true AND running session exists
|
|
118
|
+
→ S_FALLBACK WHEN: amend_mode == true AND no running session DO: Display: "无 running session,--amend 需要活跃 session"
|
|
111
119
|
→ S_DECISION_EVAL WHEN: running session with decision step in "running" status
|
|
112
120
|
→ S_RESOLVE_PHASE WHEN: intent is non-empty ← phase 必须先于 position
|
|
113
121
|
→ S_FALLBACK WHEN: no intent AND no running session
|
|
@@ -168,6 +176,8 @@ S_DECISION_EVAL: (decision 节点 == `step.decision` 非空,下述 gate 名取
|
|
|
168
176
|
DO: A_GOAL_AUDIT_EVALUATE
|
|
169
177
|
→ S_APPLY_VERDICT WHEN: scope-gate (post-analyze-scope)
|
|
170
178
|
DO: A_SCOPE_EVALUATE
|
|
179
|
+
→ S_APPLY_VERDICT WHEN: reground-gate (post-reground)
|
|
180
|
+
DO: A_REGROUND_EVALUATE
|
|
171
181
|
→ S_APPLY_VERDICT WHEN: structural (post-milestone, post-debug-escalate)
|
|
172
182
|
DO: A_STRUCTURAL_EVALUATE
|
|
173
183
|
|
|
@@ -182,12 +192,21 @@ S_APPLY_VERDICT:
|
|
|
182
192
|
→ END WHEN: post-milestone + standard + no next milestone DO: mark completed
|
|
183
193
|
→ END WHEN: post-milestone + adhoc DO: mark completed (adhoc self-contained)
|
|
184
194
|
→ END WHEN: post-debug-escalate (always STOP) DO: A_PAUSE_ESCALATE
|
|
195
|
+
→ END WHEN: post-reground + drifted + confidence_score >= 60 DO: A_REGROUND_HALT
|
|
196
|
+
→ S_DISPATCH WHEN: post-reground + aligned DO: A_APPLY_PROCEED
|
|
197
|
+
→ S_DISPATCH WHEN: post-reground + drifted + confidence_score < 60 DO: A_APPLY_PROCEED (标 LOW CONFIDENCE)
|
|
198
|
+
GUARD: post-reground + drifted + confidence_score >= 60 → A_REGROUND_HALT(漂移熔断,auto_confirm 不跳过)
|
|
185
199
|
GUARD: retry_count >= max_retries → force escalate
|
|
186
200
|
GUARD: confidence_score < 60 AND proceed → override to fix
|
|
187
201
|
GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
|
|
188
202
|
GUARD: auto_confirm → skip user prompt, apply adjusted verdict
|
|
189
203
|
GUARD: not auto_confirm → request_user_input with override options
|
|
190
204
|
|
|
205
|
+
S_AMEND_GOAL:
|
|
206
|
+
→ S_DISPATCH WHEN: change applied + user confirmed DO: A_AMEND_GOAL
|
|
207
|
+
→ END WHEN: user cancels
|
|
208
|
+
GUARD: RISK_LEVEL=high → auto_confirm 无效,强制用户确认
|
|
209
|
+
|
|
191
210
|
S_FALLBACK:
|
|
192
211
|
→ S_PARSE_ROUTE WHEN: user provides input DO: request_user_input
|
|
193
212
|
→ END WHEN: user cancels
|
|
@@ -244,7 +263,7 @@ resolve_milestone(phase_number):
|
|
|
244
263
|
|
|
245
264
|
| Pattern | Position |
|
|
246
265
|
|---------|----------|
|
|
247
|
-
| 压力测试 / 拷问 / 验证假设 / grill / stress-test | `grill`(**auto_confirm=true
|
|
266
|
+
| 压力测试 / 拷问 / 验证假设 / grill / stress-test | `grill`(**auto_confirm=true 时透传 `-y`,grill Auto mode 代码代答,不跳过**) |
|
|
248
267
|
| brainstorm / 头脑风暴 / 探索 / ideate / 设计思路 | `brainstorm` |
|
|
249
268
|
| blueprint / 规格 / 正式文档 / spec-generate / 7-phase | `blueprint` |
|
|
250
269
|
| broad/medium intent 无数字 phase (重构/全面/重写/迁移/新功能 X) | `analyze-macro` |
|
|
@@ -381,7 +400,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
|
|
|
381
400
|
|
|
382
401
|
| Stage | Skill (independent) | Skill (unified) | Decision after | quality_mode |
|
|
383
402
|
|-------|---------------------|-----------------|----------------|--------------|
|
|
384
|
-
| grill | `maestro-grill "{intent}"` | *(same)* | — | all (**
|
|
403
|
+
| grill | `maestro-grill "{intent}"` | *(same)* | — | all (**auto_confirm → 透传 `-y`,不跳过**) |
|
|
385
404
|
| brainstorm | `maestro-brainstorm "{intent}" --from grill:{grill_id}` *(if grill ran)* / `maestro-brainstorm "{intent}"` *(otherwise)* | *(same)* | — | all |
|
|
386
405
|
| blueprint | `maestro-blueprint "{intent}"` | *(same)* | — | all |
|
|
387
406
|
| init | `maestro-init` | *(same)* | — | all |
|
|
@@ -406,9 +425,14 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
|
|
|
406
425
|
1. **起点**:从 `session.lifecycle_position` 开始
|
|
407
426
|
2. **跳过已完成**:跳过当前 milestone+phase 下已有 completed artifact 的 stage(按 `session.phase` 过滤);unified 按 milestone 过滤
|
|
408
427
|
3. **quality_mode 过滤**:按 `session.quality_mode` 排除不匹配 stage
|
|
409
|
-
3.5. **grill auto_confirm
|
|
428
|
+
3.5. **grill auto_confirm 透传**:`auto_confirm == true` 时为 `grill` step args 追加 `-y`(grill 自身 Auto mode 用代码代答);保留 `grill` stage 与 brainstorm 的 `--from grill:*`
|
|
410
429
|
4. **决策节点**:每个 Decision after 非空的 stage 之后插入 `{ decision: "<gate>", retry_count: 0, max_retries: 2, command_scope: null, command_path: null }`
|
|
411
430
|
5. **goal-audit 插入**:`task_decomposition` 存在时,在最后一个 evidence-producing stage(verify/review/test)之后、`milestone-complete` 之前插入 `decision:post-goal-audit`
|
|
431
|
+
5.5. **re-grounding 插入**:WHEN `task_decomposition` 存在 AND 执行 step(不含 decision)≥3
|
|
432
|
+
- 从第 3 个执行 step 起每隔 3 个插入 `{ decision: "post-reground", retry_count: 0, max_retries: 0, command_scope: null, command_path: null }`
|
|
433
|
+
- 不在最后一个执行 step 后插入(由 goal-audit 覆盖)
|
|
434
|
+
- 不与已有 quality-gate decision 节点相邻(顺延到下一个 3-step 边界)
|
|
435
|
+
- fix-loop 动态插入的 step **纳入**计数(从插入点起重新计算 3-step 间隔)
|
|
412
436
|
6. **终点硬约束**:`session.milestone` 存在时 chain 以 `milestone-complete` 结尾;`session.milestone=null`(standalone)时跳过 `milestone-audit` + `milestone-complete` stage,chain 以最后一个质量门 stage 结尾
|
|
413
437
|
7. **goal_ref 传播**:`task_decomposition` 存在时,每个 step 按 `step.stage ∈ g.lifecycle` 匹配 `step.goal_ref = g.id`(多匹配取字典序最小);decision 节点不打 goal_ref
|
|
414
438
|
8. **占位符**:independent 保留 `{phase}` `{intent}`;unified 不带 `{phase}`
|
|
@@ -418,7 +442,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
|
|
|
418
442
|
- 命中 → `command_scope = "global" | "project"`,`command_path = <绝对 SKILL.md 路径>`
|
|
419
443
|
- 未命中 → `command_scope = "missing"`, `command_path = null`,A_CREATE_SESSION 报错 E006
|
|
420
444
|
- **不在 build 阶段读取 SKILL.md 内容**;`<required_reading>` / `<deferred_reading>` 解析与加载由 `maestro ralph next` CLI 在执行期完成
|
|
421
|
-
10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`, `deferred_reads: []`, `load: null`(由 `ralph next` 写入)
|
|
445
|
+
10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`, `completion_summary: null`, `completion_decisions: null`, `completion_caveats: null`, `completion_deferred: null`, `deferred_reads: []`, `load: null`(由 `ralph next` 写入)
|
|
422
446
|
11. **scope_verdict gating**(仅当 chain 起点 = `analyze-macro`):
|
|
423
447
|
- `scope_verdict ∈ {medium, small}` → 跳过 `roadmap` + `analyze` 两 stage;`plan` 选 standalone 列(`--from analyze:{analyze_macro_id}`),不带 `{phase}`
|
|
424
448
|
- `scope_verdict == large` → 保留 `roadmap` + `analyze`;`plan` 选 phase 列(`{phase}`)
|
|
@@ -582,12 +606,85 @@ Runs only when `task_decomposition` present.
|
|
|
582
606
|
2. Insert full lifecycle steps for next milestone
|
|
583
607
|
3. Reindex, write status.json
|
|
584
608
|
|
|
609
|
+
### A_REGROUND_EVALUATE
|
|
610
|
+
|
|
611
|
+
GUARD: `task_decomposition` 存在(周期触发,见 build rule 5.5)
|
|
612
|
+
|
|
613
|
+
1. Read status.json:
|
|
614
|
+
- `session.intent`, `session.boundary_contract`
|
|
615
|
+
- `steps[]` WHERE `status=="completed"` → 取 `completion_evidence`, `completion_summary`, `completion_decisions`, `completion_caveats`
|
|
616
|
+
- `task_decomposition[]` WHERE `status=="done"` → 取 `goal`, `done_when`
|
|
617
|
+
2. Delegate read-only audit (run_in_background, STOP, wait):
|
|
618
|
+
```
|
|
619
|
+
maestro delegate "PURPOSE: 意图保真检查 — 对照 intent 验证累积执行是否漂移
|
|
620
|
+
TASK:
|
|
621
|
+
1. 读取 intent + boundary_contract.definition_of_done
|
|
622
|
+
2. 读取已完成 steps 的 completion_summary + completion_decisions
|
|
623
|
+
3. 判定累积产出是否仍服务 intent;是否有 step 产出超出 in_scope 或触碰 out_of_scope
|
|
624
|
+
4. 输出 aligned / drifted
|
|
625
|
+
CONTEXT:
|
|
626
|
+
intent = {session.intent}
|
|
627
|
+
definition_of_done = {boundary_contract.definition_of_done}
|
|
628
|
+
in_scope = {boundary_contract.in_scope}
|
|
629
|
+
out_of_scope = {boundary_contract.out_of_scope}
|
|
630
|
+
completed_steps = [{index, skill, stage, completion_evidence, completion_summary, completion_decisions, completion_caveats}, ...]
|
|
631
|
+
done_goals = [{id, goal, done_when}, ...]
|
|
632
|
+
accumulated_deferred = [{from_step, item}, ...]
|
|
633
|
+
goal_changelog = {session.goal_changelog ?? []}
|
|
634
|
+
EXPECTED:
|
|
635
|
+
---VERDICT---
|
|
636
|
+
STATUS=aligned|drifted
|
|
637
|
+
DRIFT_DESCRIPTION=<空或具体描述>
|
|
638
|
+
CORRECTIVE_ACTION=<空或建议>
|
|
639
|
+
CONFIDENCE_SCORE=0-100
|
|
640
|
+
---END---
|
|
641
|
+
CONSTRAINTS:
|
|
642
|
+
- 只评估不修改
|
|
643
|
+
- aligned 阈值:≥80% 已完成产出直接服务 intent
|
|
644
|
+
- 单个 step 触碰 out_of_scope → 直接判 drifted
|
|
645
|
+
- goal_changelog 存在 → 以最新 after.goals 为基准"
|
|
646
|
+
--role analyze --mode analysis
|
|
647
|
+
```
|
|
648
|
+
3. On callback: parse verdict
|
|
649
|
+
4. Append `{session_dir}/decisions.ndjson`:`{ "id": "DEC-{ts}", "type": "reground-gate", "source": "ralph", "node_id": "post-reground", "verdict": "{aligned|drifted}", "confidence_score": {N} }`
|
|
650
|
+
5. Verdict routing:`aligned` → A_APPLY_PROCEED;`drifted` + `confidence_score >= 60` → A_REGROUND_HALT;`drifted` + `confidence_score < 60` → A_APPLY_PROCEED(标 LOW CONFIDENCE)
|
|
651
|
+
|
|
652
|
+
### A_REGROUND_HALT
|
|
653
|
+
|
|
654
|
+
漂移熔断(安全门,auto_confirm 不跳过)。
|
|
655
|
+
|
|
656
|
+
1. Set `session.status = "paused"`,write status.json
|
|
657
|
+
2. Display:
|
|
658
|
+
```
|
|
659
|
+
⚠️ Re-grounding 检测失败 — 执行已偏离 intent。
|
|
660
|
+
Intent: {session.intent}
|
|
661
|
+
Drift: {drift_description}
|
|
662
|
+
建议回归: {corrective_action}
|
|
663
|
+
选项:1) $maestro-ralph continue 忽略漂移继续 2) 手动修正后 continue 3) $maestro-ralph status 查看后决定
|
|
664
|
+
```
|
|
665
|
+
3. GUARD: auto_confirm 对本动作无效——漂移熔断不可自动跳过
|
|
666
|
+
|
|
585
667
|
### A_PAUSE_ESCALATE
|
|
586
668
|
|
|
587
669
|
1. Set session status = "paused", write status.json
|
|
588
670
|
2. Display: ◆ 已达最大重试次数,debug 已执行。请人工介入。
|
|
589
671
|
3. Display: $maestro-ralph continue 恢复
|
|
590
672
|
|
|
673
|
+
### A_AMEND_GOAL
|
|
674
|
+
|
|
675
|
+
修改 running session 目标。详细流程由 `<deferred_reading>` 加载 `ralph-amend-goal.md`。
|
|
676
|
+
|
|
677
|
+
| Phase | 行为 | 产出 |
|
|
678
|
+
|-------|------|------|
|
|
679
|
+
| 1. 快照 | 读 `task_decomposition` + `boundary_contract` + 已完成 steps 的 `completion_summary` | Display: 目标列表 + 进度 |
|
|
680
|
+
| 2. 解析 | `change_request` 非空 → 直接用;为空 → request_user_input(修改/新增/移除/调整边界) | `change_type` + `change_request` |
|
|
681
|
+
| 3. Mini Grill | `maestro delegate --role analyze --mode analysis`:评估影响 | RISK_LEVEL + AFFECTED_GOALS + INVALIDATED_STEPS + NEW_GAPS |
|
|
682
|
+
| 4. 确认 | request_user_input:应用并继续 / 仅改目标 / 取消 | 用户选择 |
|
|
683
|
+
| 5. 应用 | 归档旧目标(`superseded`)→ 写入新目标(`origin: CHG-xxx`)→ 重建链路 → write status.json | handoff $maestro-ralph-execute |
|
|
684
|
+
|
|
685
|
+
GUARD: `RISK_LEVEL == high` → request_user_input 不跳过(auto_confirm 无效)
|
|
686
|
+
GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
|
|
687
|
+
|
|
591
688
|
</actions>
|
|
592
689
|
|
|
593
690
|
</state_machine>
|
|
@@ -600,7 +697,7 @@ Runs only when `task_decomposition` present.
|
|
|
600
697
|
{
|
|
601
698
|
"session_id": "ralph-{YYYYMMDD-HHmmss}",
|
|
602
699
|
"source": "ralph", "status": "running",
|
|
603
|
-
"ralph_protocol_version": "
|
|
700
|
+
"ralph_protocol_version": "2", // CLI-driven; absent/0 → legacy; "1" → basic CLI; "2" → structured completion + enhanced anchor
|
|
604
701
|
"active_step_index": null, // CLI-managed; only one step held at a time
|
|
605
702
|
"intent": "", "lifecycle_position": "",
|
|
606
703
|
"phase": null, "phase_is_new": false,
|
|
@@ -634,6 +731,10 @@ Runs only when `task_decomposition` present.
|
|
|
634
731
|
"completion_confirmed": false,
|
|
635
732
|
"completion_status": null,
|
|
636
733
|
"completion_evidence": null,
|
|
734
|
+
"completion_summary": null, // 一句话总结:做了什么(MUST on DONE)
|
|
735
|
+
"completion_decisions": null, // 本 step 做出的关键决策列表
|
|
736
|
+
"completion_caveats": null, // 后续 step 需注意的事项
|
|
737
|
+
"completion_deferred": null, // 被推迟到后续的工作列表
|
|
637
738
|
"completed_at": null,
|
|
638
739
|
"deferred_reads": [], // 由 ralph next CLI 解析 SKILL.md 时填充
|
|
639
740
|
"load": null // { loaded_at, required_files[], deferred_files[], resolve_version } —— 由 ralph next 写入
|
|
@@ -647,10 +748,22 @@ Runs only when `task_decomposition` present.
|
|
|
647
748
|
"execution_criteria": [],
|
|
648
749
|
"task_decomposition": [
|
|
649
750
|
{ "id": "G1", "goal": "", "boundary": "", "done_when": "",
|
|
650
|
-
"evidence": "", "lifecycle": [], "status": "pending|done",
|
|
651
|
-
"completion_confirmed": false, "completed_at": null
|
|
751
|
+
"evidence": "", "lifecycle": [], "status": "pending|done|superseded",
|
|
752
|
+
"completion_confirmed": false, "completed_at": null,
|
|
753
|
+
"superseded_by": null, "superseded_at": null, "origin": null }
|
|
652
754
|
],
|
|
653
|
-
"task_decomposition_all_done": false
|
|
755
|
+
"task_decomposition_all_done": false,
|
|
756
|
+
|
|
757
|
+
// goal_changelog: additive; absent → no amendments
|
|
758
|
+
"goal_changelog": [
|
|
759
|
+
{ "id": "CHG-001", "timestamp": "{ISO}",
|
|
760
|
+
"change_type": "modify|add|remove|boundary",
|
|
761
|
+
"reason": "变更描述",
|
|
762
|
+
"impact_assessment": { "risk_level": "low|medium|high",
|
|
763
|
+
"invalidated_steps": [], "new_steps_inserted": 0 },
|
|
764
|
+
"before": { "goals": [{"id":"G1","goal":"...","done_when":"..."}] },
|
|
765
|
+
"after": { "goals": [{"id":"G1v2","goal":"...","done_when":"..."}] } }
|
|
766
|
+
]
|
|
654
767
|
}
|
|
655
768
|
```
|
|
656
769
|
|
|
@@ -744,7 +857,7 @@ decision:post-goal-audit {retry+1}
|
|
|
744
857
|
- [ ] D-007 反查:phase 数字 → `session.milestone`,禁止读 current_milestone;写入 step.milestone_id
|
|
745
858
|
- [ ] phase_is_new=true → lifecycle_position 强制 `analyze`
|
|
746
859
|
- [ ] Intent overrides 识别 grill / brainstorm / blueprint / analyze-macro
|
|
747
|
-
- [ ] auto_confirm=true 时 grill stage
|
|
860
|
+
- [ ] auto_confirm=true 时 grill step args 追加 `-y`(Auto mode 代码代答,stage 不跳过)
|
|
748
861
|
- [ ] A_RESOLVE_SCOPE_VERDICT 读 macro analyze conclusions.scope_verdict,写入 session.scope_verdict + analyze_macro_id
|
|
749
862
|
- [ ] 链路起点 = analyze-macro 时:large→roadmap+analyze+plan(phase);medium/small→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
|
|
750
863
|
- [ ] post-analyze-scope decision 节点在 macro analyze 之后插入;A_SCOPE_EVALUATE/A_APPLY_SCOPE_VERDICT 重塑链路
|
|
@@ -768,5 +881,19 @@ decision:post-goal-audit {retry+1}
|
|
|
768
881
|
- [ ] Phase-level deferred chaining:plan/execute step 的 `--from`/`--dir` 注入由 A_RESOLVE_ARGS(ralph-execute)运行时完成;build 阶段标记意图,不预知 artifact ID
|
|
769
882
|
- [ ] Phase-level plan step 运行时获得 `--from analyze:{phase_analyze_id}`(由 ralph-execute 从 state.json 查找注入)
|
|
770
883
|
- [ ] Phase-level execute step 运行时获得 `source_artifact_ref = "plan:{id}"`
|
|
884
|
+
- [ ] 每个 step 含 `completion_summary` + `completion_decisions` + `completion_caveats` + `completion_deferred`(初始 null)
|
|
885
|
+
- [ ] `completion_summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(由 CLI `--summary` 参数传入)
|
|
886
|
+
- [ ] session_anchor 包含最近 5 个已完成 step 的 `completion_summary` + `completion_caveats`(滑动窗口)
|
|
887
|
+
- [ ] session_anchor 包含 task_decomposition 全局视图(仅 `status != "superseded"` 的目标)
|
|
888
|
+
- [ ] session_anchor 包含 Accumulated Signals(聚合所有 caveats + deferred)
|
|
889
|
+
- [ ] `--amend` 路由到 S_AMEND_GOAL(需 running session)
|
|
890
|
+
- [ ] A_AMEND_GOAL 执行 5 阶段(快照→解析→mini grill→确认→应用),每阶段产出可审计
|
|
891
|
+
- [ ] 旧目标标 `superseded`(`superseded_by` + `superseded_at`),新目标标 `origin: "CHG-xxx"`
|
|
892
|
+
- [ ] `goal_changelog` 记录完整 before/after 快照 + impact_assessment
|
|
893
|
+
- [ ] `RISK_LEVEL=high` 时 amend 不跳过 auto_confirm
|
|
894
|
+
- [ ] re-grounding 完成 steps 信息含 completion_summary/decisions/caveats
|
|
895
|
+
- [ ] fix-loop 动态插入 step 纳入 re-grounding 3-step 计数
|
|
896
|
+
- [ ] post-reground + drifted + confidence >= 60 → A_REGROUND_HALT(auto_confirm 不跳过)
|
|
897
|
+
- [ ] session_anchor boundary_contract 不截断(capAnchorList n=8)
|
|
771
898
|
|
|
772
899
|
</appendix>
|
|
@@ -181,7 +181,9 @@ Write enriched args + source_artifact_ref back to status.json.
|
|
|
181
181
|
- 退出码 2 → 交给 S_LOCATE
|
|
182
182
|
- 退出码 3 → active_step_index 已被占用
|
|
183
183
|
- 退出码 1 → pause session
|
|
184
|
-
2. **Goal context pre-injection
|
|
184
|
+
2. **Goal context pre-injection**:
|
|
185
|
+
- GUARD: `ralph_protocol_version >= "2"` → skip(session_anchor 已含 goal context)
|
|
186
|
+
- WHEN `ralph_protocol_version < "2"` 或缺失 AND `step.goal_ref` 非空 → 在 stdout 顶部前置:
|
|
185
187
|
```
|
|
186
188
|
<goal_context>
|
|
187
189
|
Sub-goal: {goal.id} — {goal.goal}
|
|
@@ -191,13 +193,19 @@ Write enriched args + source_artifact_ref back to status.json.
|
|
|
191
193
|
Execution criteria: {session.execution_criteria joined by '; '}
|
|
192
194
|
</goal_context>
|
|
193
195
|
```
|
|
194
|
-
|
|
195
|
-
3. **Inline execution** — 按 stdout(含 goal_context 前置)执行;deferred_reading 按需 Read
|
|
196
|
+
3. **Inline execution** — 按 stdout 执行;deferred_reading 按需 Read
|
|
196
197
|
4. **Complete**:
|
|
197
|
-
- `Bash("maestro ralph complete N --status DONE [--evidence <path>]")`
|
|
198
|
-
- `Bash("maestro ralph complete N --status DONE_WITH_CONCERNS --concerns \"...\"")`
|
|
198
|
+
- `Bash("maestro ralph complete N --status DONE --summary \"...\" [--evidence <path>] [--decisions \"...\"] [--caveats \"...\"] [--deferred \"...\"]")`
|
|
199
|
+
- `Bash("maestro ralph complete N --status DONE_WITH_CONCERNS --summary \"...\" --concerns \"...\"")`
|
|
199
200
|
- `Bash("maestro ralph retry N")`
|
|
200
201
|
- `Bash("maestro ralph complete N --status BLOCKED --reason \"...\"")`
|
|
202
|
+
|
|
203
|
+
| Flag | 规则 | 示例 |
|
|
204
|
+
|------|------|------|
|
|
205
|
+
| `--summary` | MUST。动词开头,≤100 字 | `"实现搜索 API 分页,新增 3 端点"` |
|
|
206
|
+
| `--decisions` | SHOULD。每条一个决策,可多次 | `"选择 ELK 而非 dagre"` |
|
|
207
|
+
| `--caveats` | SHOULD。后续 step 需注意 | `"e2e 未覆盖新端点"` |
|
|
208
|
+
| `--deferred` | SHOULD。推迟工作,可多次 | `"性能优化留到 review 后"` |
|
|
201
209
|
5. **Propagate context signals** — 关键信号 (`PHASE: N` / `scratch_dir: path` / `BLP-xxx`) 写入 `status.json.context`
|
|
202
210
|
|
|
203
211
|
完成后 S_LOCATE 触发 `$maestro-ralph-execute` 直调自调用。
|
|
@@ -278,8 +286,11 @@ Display: `[{index}/{total}] ✗ {step.skill} 失败,会话已暂停。$maestro
|
|
|
278
286
|
- [ ] 只处理 session.platform == "codex" 的会话
|
|
279
287
|
- [ ] --from auto-injection:phase-level plan step 运行时从 state.json 查找同 phase+milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `source_artifact_ref`
|
|
280
288
|
- [ ] --from auto-injection:phase-level execute step 运行时查找同 phase+milestone 最新 completed plan artifact → 注入 `--dir`,写 `source_artifact_ref`
|
|
281
|
-
- [ ] Goal context injection
|
|
289
|
+
- [ ] Goal context injection:`ralph_protocol_version < "2"` → 前置 `<goal_context>` block;`>= "2"` → skip(session_anchor 覆盖)
|
|
282
290
|
- [ ] Goal context 包含 sub-goal description、done_when、boundary、evidence、execution_criteria
|
|
283
291
|
- [ ] 已有 `--from` 或 `--dir` 的 step 不被 auto-injection 覆盖
|
|
292
|
+
- [ ] `--summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(动词开头,≤100 字)
|
|
293
|
+
- [ ] `--decisions`/`--caveats`/`--deferred` 为 SHOULD;存在关键决策/注意事项/推迟工作时填写
|
|
294
|
+
- [ ] 结构化总结由 CLI 写入 status.json,session_anchor 自动聚合注入下游 step
|
|
284
295
|
|
|
285
296
|
</appendix>
|