maestro-flow 0.5.37 → 0.5.39
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/.agents/skills/odyssey-debug/SKILL.md +90 -269
- package/.agents/skills/odyssey-improve/SKILL.md +39 -240
- package/.agents/skills/odyssey-planex/SKILL.md +21 -105
- package/.agents/skills/odyssey-review-test-fix/SKILL.md +98 -318
- package/.agents/skills/odyssey-ui/SKILL.md +82 -265
- 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/.agy/skills/odyssey-debug/SKILL.md +90 -269
- package/.agy/skills/odyssey-improve/SKILL.md +39 -240
- package/.agy/skills/odyssey-planex/SKILL.md +21 -105
- package/.agy/skills/odyssey-review-test-fix/SKILL.md +98 -318
- package/.agy/skills/odyssey-ui/SKILL.md +82 -265
- 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/.claude/commands/odyssey-debug.md +90 -269
- package/.claude/commands/odyssey-improve.md +39 -240
- package/.claude/commands/odyssey-planex.md +21 -105
- package/.claude/commands/odyssey-review-test-fix.md +98 -318
- package/.claude/commands/odyssey-ui.md +82 -265
- 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/.codex/skills/odyssey-debug/SKILL.md +167 -338
- package/.codex/skills/odyssey-improve/SKILL.md +226 -395
- package/.codex/skills/odyssey-planex/SKILL.md +317 -159
- package/.codex/skills/odyssey-review-test-fix/SKILL.md +137 -255
- package/.codex/skills/odyssey-ui/SKILL.md +197 -338
- package/README.md +25 -8
- package/README.zh-CN.md +6 -6
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +23 -2
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +242 -26
- package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +92 -29
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/src/commands/hooks.d.ts +2 -1
- package/dashboard/dist-server/src/commands/hooks.js +16 -9
- package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
- 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/dashboard/dist-server/src/hooks/kg-sync-hook.js +5 -0
- package/dashboard/dist-server/src/hooks/kg-sync-hook.js.map +1 -1
- package/dashboard/dist-server/src/hooks/session-context.js +276 -3
- package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
- package/dashboard/dist-server/src/search/daemon-client.d.ts +8 -3
- package/dashboard/dist-server/src/search/daemon-client.js +20 -0
- package/dashboard/dist-server/src/search/daemon-client.js.map +1 -1
- package/dist/src/cli.js +3 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/domain.d.ts.map +1 -1
- package/dist/src/commands/domain.js +12 -3
- package/dist/src/commands/domain.js.map +1 -1
- package/dist/src/commands/hooks.d.ts +2 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +16 -9
- package/dist/src/commands/hooks.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 +34 -2
- 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/search.d.ts.map +1 -1
- package/dist/src/commands/search.js +59 -6
- package/dist/src/commands/search.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +15 -0
- package/dist/src/commands/spec.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/hooks/kg-sync-hook.d.ts.map +1 -1
- package/dist/src/hooks/kg-sync-hook.js +5 -0
- package/dist/src/hooks/kg-sync-hook.js.map +1 -1
- package/dist/src/hooks/session-context.d.ts.map +1 -1
- package/dist/src/hooks/session-context.js +276 -3
- package/dist/src/hooks/session-context.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/search/daemon-client.d.ts +8 -3
- package/dist/src/search/daemon-client.d.ts.map +1 -1
- package/dist/src/search/daemon-client.js +20 -0
- package/dist/src/search/daemon-client.js.map +1 -1
- package/dist/src/search/daemon.d.ts +3 -3
- package/dist/src/search/daemon.d.ts.map +1 -1
- package/dist/src/search/daemon.js +9 -3
- package/dist/src/search/daemon.js.map +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/odyssey-base.md +258 -0
- 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
|
@@ -48,7 +48,7 @@ $ARGUMENTS — user intent text, or special keywords.
|
|
|
48
48
|
8. **Grill `-y` 透传** — `-y` auto mode 透传 `-y` 到 grill args(grill 自身 Auto mode 用代码代答),不删除 grill stage;grill 仍产出 grill-report/terminology/context-package 供下游 brainstorm
|
|
49
49
|
9. **D-007 milestone 反查** — 数字 phase 的 `milestone_id` 由 `state.json.milestones[].phase_slugs` 反查
|
|
50
50
|
10. **每个 step 必须 `completion_confirmed: true`** — 由 `maestro ralph complete N --status DONE|DONE_WITH_CONCERNS` 写入
|
|
51
|
-
11. **schema** — `ralph_protocol_version: "
|
|
51
|
+
11. **schema** — `ralph_protocol_version: "2"` 标记 CLI-driven session;新增字段全部可选
|
|
52
52
|
12. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作,不可绕过。特别是 invariant 1(dispatch via ralph-execute)和 invariant 2(session before execution)和 invariant 10(completion_confirmed 由 CLI 写入)为硬约束。
|
|
53
53
|
14. **禁止以上下文消耗为由中断执行** — harness 自动处理 context compression,以"上下文不足"或"避免 context overflow"为由中断属于 invariant violation
|
|
54
54
|
13. **Classification evidence** — S_CLASSIFY 的 chain 选择决策 MUST 记录到 status.json 的 `classification_rationale` 字段:匹配了哪个 pattern、排除了哪些备选、confidence level。无记录的分类不可进入 S_CREATE。
|
|
@@ -175,7 +175,7 @@ S_FALLBACK:
|
|
|
175
175
|
```json
|
|
176
176
|
{
|
|
177
177
|
"session_id", "source": "maestro", "intent", "task_type", "chain_name",
|
|
178
|
-
"ralph_protocol_version": "
|
|
178
|
+
"ralph_protocol_version": "2", "active_step_index": null,
|
|
179
179
|
"phase", "phase_is_new": false, "milestone": "",
|
|
180
180
|
"scope_verdict": null, "analyze_macro_id": null, "blueprint_id": null,
|
|
181
181
|
"auto_mode": false, "decomposition_owner": "maestro", "cli_tool": "claude",
|
|
@@ -188,12 +188,18 @@ S_FALLBACK:
|
|
|
188
188
|
"milestone_id": null, "source_artifact_ref": null,
|
|
189
189
|
"status": "pending", "goal_ref": null,
|
|
190
190
|
"completion_confirmed": false, "completion_status": null,
|
|
191
|
-
"completion_evidence": null,
|
|
191
|
+
"completion_evidence": null,
|
|
192
|
+
"completion_summary": null, "completion_decisions": null,
|
|
193
|
+
"completion_caveats": null, "completion_deferred": null,
|
|
194
|
+
"completed_at": null,
|
|
192
195
|
"deferred_reads": [], "load": null
|
|
193
196
|
}],
|
|
194
197
|
"waves": [], "current_step": 0, "status": "running",
|
|
195
198
|
"boundary_contract": {}, "execution_criteria": [],
|
|
196
|
-
"task_decomposition": [
|
|
199
|
+
"task_decomposition": [{ "status": "pending|done|superseded",
|
|
200
|
+
"superseded_by": null, "superseded_at": null, "origin": null }],
|
|
201
|
+
"task_decomposition_all_done": false,
|
|
202
|
+
"goal_changelog": []
|
|
197
203
|
}
|
|
198
204
|
```
|
|
199
205
|
3. Validate: 所有 step 的 `command_scope != "missing"`,否则 raise E005 列出缺失 skill
|
|
@@ -234,7 +240,7 @@ S_FALLBACK:
|
|
|
234
240
|
- [ ] Session dir created with status.json before execution; decomposition fields additive-only
|
|
235
241
|
- [ ] 执行 step 含 `command_scope` + `command_path` + `completion_confirmed`;decision step 由 `step.decision` 标识
|
|
236
242
|
- [ ] `command_scope`/`command_path` 由 `maestro ralph skills --platform agent --json --quiet` 预校验(project 覆盖 global)
|
|
237
|
-
- [ ] Session schema 含 `ralph_protocol_version: "
|
|
243
|
+
- [ ] Session schema 含 `ralph_protocol_version: "2"` + `active_step_index: null` + step.load 占位
|
|
238
244
|
- [ ] 用户传入 `-y` 时透传到 skill args
|
|
239
245
|
- [ ] All chains dispatched via maestro-ralph-execute
|
|
240
246
|
- [ ] Low-complexity intents routed to maestro-quick
|
|
@@ -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 | continue"
|
|
4
|
+
argument-hint: "<intent> [-y] | status | continue | --amend [change]"
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- read_file
|
|
7
7
|
- write_file
|
|
@@ -19,6 +19,10 @@ Closed-loop decision engine: read project state → infer position → build ada
|
|
|
19
19
|
Ralph builds/evaluates; ralph-execute runs steps. Session: `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json`.
|
|
20
20
|
</purpose>
|
|
21
21
|
|
|
22
|
+
<deferred_reading>
|
|
23
|
+
- [ralph-amend-goal.md](~/.maestro/workflows/ralph-amend-goal.md) — read when `--amend` flag active for goal amendment flow
|
|
24
|
+
</deferred_reading>
|
|
25
|
+
|
|
22
26
|
<context>
|
|
23
27
|
$ARGUMENTS — intent text, flags, or keywords.
|
|
24
28
|
|
|
@@ -26,8 +30,9 @@ $ARGUMENTS — intent text, flags, or keywords.
|
|
|
26
30
|
```
|
|
27
31
|
-y flag → auto_confirm = true # 唯一来源:用户显式传入;ralph 不内部推断(invariant 14)
|
|
28
32
|
--roadmap → wants_roadmap = true (强制多发布 roadmap 路径;roadmap 默认 opt-in)
|
|
33
|
+
--amend / -a → amend_mode = true (running session 存在时触发目标修改流程)
|
|
29
34
|
.md/.txt path → input_doc (supplementary context only, NEVER substitutes lifecycle stages)
|
|
30
|
-
Remaining → intent
|
|
35
|
+
Remaining → intent (amend_mode 时为 change_request)
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
**State files:**
|
|
@@ -73,6 +78,7 @@ S_CONFIRM — 用户确认 PERSIST: —
|
|
|
73
78
|
S_DISPATCH — 移交 maestro-ralph-execute PERSIST: —
|
|
74
79
|
S_DECISION_EVAL — 委托评估质量门 PERSIST: —
|
|
75
80
|
S_APPLY_VERDICT — 应用裁决 + 插入命令 PERSIST: session.steps[], session.passed_gates[]
|
|
81
|
+
S_AMEND_GOAL — 修改 running session 目标 PERSIST: session.task_decomposition, .boundary_contract, .goal_changelog, .steps[]
|
|
76
82
|
S_FALLBACK — 请求用户输入 PERSIST: —
|
|
77
83
|
</states>
|
|
78
84
|
|
|
@@ -81,6 +87,8 @@ S_FALLBACK — 请求用户输入 PERSIST: —
|
|
|
81
87
|
S_PARSE_ROUTE:
|
|
82
88
|
→ S_STATUS WHEN: intent == "status"
|
|
83
89
|
→ S_CONTINUE WHEN: intent == "continue"
|
|
90
|
+
→ S_AMEND_GOAL WHEN: amend_mode == true AND running session exists
|
|
91
|
+
→ S_FALLBACK WHEN: amend_mode == true AND no running session DO: Display: "无运行中的 ralph 会话,--amend 需要活跃 session"
|
|
84
92
|
→ S_DECISION_EVAL WHEN: running session with decision step in "running" status
|
|
85
93
|
→ S_RESOLVE_PHASE WHEN: intent is non-empty ← phase 必须先于 position
|
|
86
94
|
→ S_FALLBACK WHEN: no intent AND no running session
|
|
@@ -167,6 +175,11 @@ S_APPLY_VERDICT:
|
|
|
167
175
|
GUARD: not auto_confirm → ask_user with override options
|
|
168
176
|
GUARD: post-reground + drifted + confidence_score >= 60 → A_REGROUND_HALT(漂移熔断为安全门,auto_confirm 不跳过)
|
|
169
177
|
|
|
178
|
+
S_AMEND_GOAL:
|
|
179
|
+
→ S_DISPATCH WHEN: change applied + user confirmed DO: A_AMEND_GOAL
|
|
180
|
+
→ END WHEN: user cancels
|
|
181
|
+
GUARD: RISK_LEVEL=high → auto_confirm 无效,必须 ask_user
|
|
182
|
+
|
|
170
183
|
S_FALLBACK:
|
|
171
184
|
→ S_PARSE_ROUTE WHEN: user provides input DO: ask_user
|
|
172
185
|
→ END WHEN: user cancels
|
|
@@ -406,7 +419,11 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
|
|
|
406
419
|
3.6. **frontend-verify UI 门控**:仅当当前 phase 交付前端(检出 `dashboard/` 目录,或 phase 目标/计划含 UI 关键词 `landing|page|dashboard|frontend|UI|component|界面`)时保留 `frontend-verify` stage + `post-frontend-verify` decision;纯后端 phase 删除该 stage
|
|
407
420
|
4. **决策节点**:每个 Decision after 非空的 stage 之后插入 `{ decision: "<gate>", retry_count: 0, max_retries: 2, command_scope: null, command_path: null }`
|
|
408
421
|
5. **goal-audit 插入**:`task_decomposition` 存在时,在最后一个 evidence-producing stage(execute/review/test)之后、`milestone-complete` 之前插入 `decision:post-goal-audit`
|
|
409
|
-
5.5. **re-grounding
|
|
422
|
+
5.5. **re-grounding 插入**:WHEN `task_decomposition` 存在 AND 执行 step(不含 decision)≥3
|
|
423
|
+
- 从第 3 个执行 step 起每隔 3 个插入 `{ decision: "post-reground", retry_count: 0, max_retries: 0, command_scope: null, command_path: null }`
|
|
424
|
+
- 不在最后一个执行 step 后插入(由 goal-audit 覆盖)
|
|
425
|
+
- 不与已有 quality-gate decision 节点相邻(顺延到下一个 3-step 边界)
|
|
426
|
+
- fix-loop 动态插入的 step **纳入**计数(从插入点起重新计算 3-step 间隔)
|
|
410
427
|
6. **终点硬约束**:`session.milestone` 存在时 chain 以 `milestone-complete` 结尾;`session.milestone=null`(standalone)时跳过 `milestone-audit` + `milestone-complete` stage,chain 以最后一个质量门 stage 结尾
|
|
411
428
|
7. **goal_ref 传播**:`task_decomposition` 存在时,每个 step 按 `step.stage ∈ g.lifecycle` 匹配 `step.goal_ref = g.id`(多匹配取字典序最小);decision 节点不打 goal_ref
|
|
412
429
|
8. **占位符**:independent 保留 `{phase}` `{intent}`;unified 不带 `{phase}`
|
|
@@ -417,7 +434,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`(`sess
|
|
|
417
434
|
- 命中 skills → 同上(type=skill)
|
|
418
435
|
- 未命中 → `command_scope = "missing"`, `command_path = null`,A_CREATE_SESSION 报错 E006
|
|
419
436
|
- **不在 build 阶段读取 .md 内容**;`<required_reading>` / `<deferred_reading>` 解析与加载由 `maestro ralph next` CLI 在执行期完成
|
|
420
|
-
10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`, `deferred_reads: []`, `load: null`(由 `ralph next` 写入)
|
|
437
|
+
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` 写入)
|
|
421
438
|
11. **scope_verdict gating**(仅当 chain 起点 = `analyze-macro`):
|
|
422
439
|
- `scope_verdict == large` **且** `wants_roadmap` → 保留 `roadmap` + `analyze`;`plan` 选 phase 列(`{phase}`)
|
|
423
440
|
- 其余(`medium` / `small`,或 `large` 但非 `wants_roadmap`)→ 跳过 `roadmap` + `analyze` 两 stage;`plan` 选 standalone 列(`--from analyze:{analyze_macro_id}`),不带 `{phase}`
|
|
@@ -542,9 +559,12 @@ Runs only when `task_decomposition` present.
|
|
|
542
559
|
|
|
543
560
|
### A_REGROUND_EVALUATE
|
|
544
561
|
|
|
545
|
-
|
|
562
|
+
GUARD: `task_decomposition` 存在(周期触发,见 build rule 5.5)
|
|
546
563
|
|
|
547
|
-
1.
|
|
564
|
+
1. Read status.json:
|
|
565
|
+
- `session.intent`, `session.boundary_contract`
|
|
566
|
+
- `steps[]` WHERE `status=="completed"` → 取 `completion_evidence`, `completion_summary`, `completion_decisions`, `completion_caveats`
|
|
567
|
+
- `task_decomposition[]` WHERE `status=="done"` → 取 `goal`, `done_when`
|
|
548
568
|
2. Delegate read-only audit (run_in_background, STOP, wait):
|
|
549
569
|
```
|
|
550
570
|
maestro delegate "PURPOSE: 意图保真检查 — 对照 intent 验证累积执行是否漂移
|
|
@@ -558,8 +578,10 @@ Runs only when `task_decomposition` present.
|
|
|
558
578
|
definition_of_done = {boundary_contract.definition_of_done}
|
|
559
579
|
in_scope = {boundary_contract.in_scope}
|
|
560
580
|
out_of_scope = {boundary_contract.out_of_scope}
|
|
561
|
-
completed_steps = [{index, skill, stage, completion_evidence}, ...]
|
|
581
|
+
completed_steps = [{index, skill, stage, completion_evidence, completion_summary, completion_decisions, completion_caveats}, ...]
|
|
562
582
|
done_goals = [{id, goal, done_when}, ...]
|
|
583
|
+
accumulated_deferred = [{from_step, item}, ...]
|
|
584
|
+
goal_changelog = {session.goal_changelog ?? []}
|
|
563
585
|
EXPECTED:
|
|
564
586
|
---VERDICT---
|
|
565
587
|
STATUS=aligned|drifted
|
|
@@ -570,7 +592,8 @@ Runs only when `task_decomposition` present.
|
|
|
570
592
|
CONSTRAINTS:
|
|
571
593
|
- 只评估,不修改文件
|
|
572
594
|
- aligned 阈值:≥80% 已完成产出直接服务 intent
|
|
573
|
-
- 单个 step 触碰 out_of_scope → 直接判 drifted
|
|
595
|
+
- 单个 step 触碰 out_of_scope → 直接判 drifted
|
|
596
|
+
- goal_changelog 存在 → 以最新 after.goals 为基准"
|
|
574
597
|
--role analyze --mode analysis
|
|
575
598
|
```
|
|
576
599
|
3. On callback: parse verdict
|
|
@@ -648,6 +671,21 @@ Runs only when `task_decomposition` present.
|
|
|
648
671
|
2. Display: ◆ 已达最大重试次数,debug 已执行。请人工介入。
|
|
649
672
|
3. Display: /maestro-ralph continue 恢复
|
|
650
673
|
|
|
674
|
+
### A_AMEND_GOAL
|
|
675
|
+
|
|
676
|
+
运行中 session 的目标热修改。详细流程由 `<deferred_reading>` 加载 `ralph-amend-goal.md`。
|
|
677
|
+
|
|
678
|
+
| Phase | 行为 | 产出 |
|
|
679
|
+
|-------|------|------|
|
|
680
|
+
| 1. 快照 | 读 `task_decomposition` + `boundary_contract` + 已完成 steps 的 `completion_summary` | Display: 目标列表 + 进度 |
|
|
681
|
+
| 2. 解析 | `change_request` 非空 → 直接用;为空 → ask_user(修改/新增/移除/调整边界) | `change_type` + `change_request` |
|
|
682
|
+
| 3. Mini Grill | `maestro delegate --role analyze --mode analysis`:评估影响 | RISK_LEVEL + AFFECTED_GOALS + INVALIDATED_STEPS + NEW_GAPS |
|
|
683
|
+
| 4. 确认 | ask_user:应用并继续 / 仅改目标 / 取消 | 用户选择 |
|
|
684
|
+
| 5. 应用 | 归档旧目标(`superseded`)→ 写入新目标(`origin: CHG-xxx`)→ 重建链路 → write status.json | handoff ralph-execute |
|
|
685
|
+
|
|
686
|
+
GUARD: `RISK_LEVEL == high` → ask_user 不跳过(auto_confirm 无效)
|
|
687
|
+
GUARD: 已完成(`status: "done"`)的目标不可 supersede(skip + warn)
|
|
688
|
+
|
|
651
689
|
</actions>
|
|
652
690
|
|
|
653
691
|
</state_machine>
|
|
@@ -660,7 +698,7 @@ Runs only when `task_decomposition` present.
|
|
|
660
698
|
{
|
|
661
699
|
"session_id": "ralph-{YYYYMMDD-HHmmss}",
|
|
662
700
|
"source": "ralph", "status": "running",
|
|
663
|
-
"ralph_protocol_version": "
|
|
701
|
+
"ralph_protocol_version": "2", // CLI-driven; absent/0 → legacy; "1" → basic CLI; "2" → structured completion + enhanced anchor
|
|
664
702
|
"active_step_index": null, // CLI-managed; only one step held at a time
|
|
665
703
|
"intent": "", "lifecycle_position": "",
|
|
666
704
|
"phase": null, "phase_is_new": false,
|
|
@@ -695,6 +733,10 @@ Runs only when `task_decomposition` present.
|
|
|
695
733
|
"completion_confirmed": false,
|
|
696
734
|
"completion_status": null,
|
|
697
735
|
"completion_evidence": null,
|
|
736
|
+
"completion_summary": null, // 一句话总结:做了什么(MUST on DONE)
|
|
737
|
+
"completion_decisions": null, // 本 step 做出的关键决策列表
|
|
738
|
+
"completion_caveats": null, // 后续 step 需注意的事项
|
|
739
|
+
"completion_deferred": null, // 被推迟到后续的工作列表
|
|
698
740
|
"completed_at": null,
|
|
699
741
|
"deferred_reads": [], // 由 ralph next CLI 解析 .md 时填充
|
|
700
742
|
"load": null // { loaded_at, required_files[], deferred_files[], resolve_version } —— 由 ralph next 写入
|
|
@@ -708,10 +750,22 @@ Runs only when `task_decomposition` present.
|
|
|
708
750
|
"execution_criteria": [],
|
|
709
751
|
"task_decomposition": [
|
|
710
752
|
{ "id": "G1", "goal": "", "boundary": "", "done_when": "",
|
|
711
|
-
"evidence": "", "lifecycle": [], "status": "pending|done",
|
|
712
|
-
"completion_confirmed": false, "completed_at": null
|
|
753
|
+
"evidence": "", "lifecycle": [], "status": "pending|done|superseded",
|
|
754
|
+
"completion_confirmed": false, "completed_at": null,
|
|
755
|
+
"superseded_by": null, "superseded_at": null, "origin": null }
|
|
713
756
|
],
|
|
714
|
-
"task_decomposition_all_done": false
|
|
757
|
+
"task_decomposition_all_done": false,
|
|
758
|
+
|
|
759
|
+
// goal_changelog: additive; absent → no amendments
|
|
760
|
+
"goal_changelog": [
|
|
761
|
+
{ "id": "CHG-001", "timestamp": "{ISO}",
|
|
762
|
+
"change_type": "modify|add|remove|boundary",
|
|
763
|
+
"reason": "变更描述",
|
|
764
|
+
"impact_assessment": { "risk_level": "low|medium|high",
|
|
765
|
+
"invalidated_steps": [], "new_steps_inserted": 0 },
|
|
766
|
+
"before": { "goals": [{"id":"G1","goal":"...","done_when":"..."}] },
|
|
767
|
+
"after": { "goals": [{"id":"G1v2","goal":"...","done_when":"..."}] } }
|
|
768
|
+
]
|
|
715
769
|
}
|
|
716
770
|
```
|
|
717
771
|
|
|
@@ -843,5 +897,19 @@ decision:post-goal-audit {retry+1}
|
|
|
843
897
|
- [ ] Phase-level deferred chaining:plan/execute step 的 `--from`/`--dir` 注入由 A_RESOLVE_ARGS(ralph-execute)运行时完成;build 阶段标记意图,不预知 artifact ID
|
|
844
898
|
- [ ] Phase-level plan step 运行时获得 `--from analyze:{phase_analyze_id}`(由 ralph-execute 从 state.json 查找注入)
|
|
845
899
|
- [ ] Phase-level execute step 运行时获得 `source_artifact_ref = "plan:{id}"`
|
|
900
|
+
- [ ] 每个 step 含 `completion_summary` + `completion_decisions` + `completion_caveats` + `completion_deferred`(初始 null)
|
|
901
|
+
- [ ] `completion_summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(由 CLI `--summary` 参数传入)
|
|
902
|
+
- [ ] session_anchor 包含最近 5 个已完成 step 的 `completion_summary` + `completion_caveats`(滑动窗口)
|
|
903
|
+
- [ ] session_anchor 包含 task_decomposition 全局视图(仅 `status != "superseded"` 的目标)
|
|
904
|
+
- [ ] session_anchor boundary_contract 不截断(`capAnchorList` n=8)
|
|
905
|
+
- [ ] session_anchor 包含 Accumulated Signals(聚合所有 caveats + deferred)
|
|
906
|
+
- [ ] re-grounding 完成 steps 信息含 completion_summary/decisions/caveats
|
|
907
|
+
- [ ] fix-loop 动态插入的 step 纳入 re-grounding 3-step 计数
|
|
908
|
+
- [ ] `--amend` 路由到 S_AMEND_GOAL(需 running session)
|
|
909
|
+
- [ ] A_AMEND_GOAL:5 步流程(快照→解析→mini grill→确认→应用)
|
|
910
|
+
- [ ] 旧目标标 `superseded`(`superseded_by` + `superseded_at`),新目标标 `origin: "CHG-xxx"`
|
|
911
|
+
- [ ] `goal_changelog` 记录完整 before/after 快照 + impact_assessment
|
|
912
|
+
- [ ] `RISK_LEVEL=high` 时 amend 不跳过 auto_confirm
|
|
913
|
+
- [ ] session_anchor 中 superseded 目标仅占一行标注,不展开细节
|
|
846
914
|
|
|
847
915
|
</appendix>
|
|
@@ -189,7 +189,9 @@ Write enriched args + source_artifact_ref back to status.json.
|
|
|
189
189
|
- 退出码 2 → 交给 S_LOCATE
|
|
190
190
|
- 退出码 3 → active_step_index 已被占用
|
|
191
191
|
- 退出码 1 → pause session
|
|
192
|
-
2. **Goal context pre-injection
|
|
192
|
+
2. **Goal context pre-injection**:
|
|
193
|
+
- GUARD: `ralph_protocol_version >= "2"` → skip(session_anchor 已含 goal context)
|
|
194
|
+
- WHEN `ralph_protocol_version < "2"` 或缺失 AND `step.goal_ref` 非空 → 在 stdout 顶部前置:
|
|
193
195
|
```
|
|
194
196
|
<goal_context>
|
|
195
197
|
Sub-goal: {goal.id} — {goal.goal}
|
|
@@ -199,13 +201,19 @@ Write enriched args + source_artifact_ref back to status.json.
|
|
|
199
201
|
Execution criteria: {session.execution_criteria joined by '; '}
|
|
200
202
|
</goal_context>
|
|
201
203
|
```
|
|
202
|
-
|
|
203
|
-
3. **Inline execution** — 按 stdout(含 goal_context 前置)执行;deferred_reading 按需 Read
|
|
204
|
+
3. **Inline execution** — 按 stdout 执行;deferred_reading 按需 Read
|
|
204
205
|
4. **Complete**:
|
|
205
|
-
- `shell("maestro ralph complete N --status DONE [--evidence <path>]")`
|
|
206
|
-
- `shell("maestro ralph complete N --status DONE_WITH_CONCERNS --concerns \"...\"")`
|
|
206
|
+
- `shell("maestro ralph complete N --status DONE --summary \"...\" [--evidence <path>] [--decisions \"...\"] [--caveats \"...\"] [--deferred \"...\"]")`
|
|
207
|
+
- `shell("maestro ralph complete N --status DONE_WITH_CONCERNS --summary \"...\" --concerns \"...\"")`
|
|
207
208
|
- `shell("maestro ralph retry N")`
|
|
208
209
|
- `shell("maestro ralph complete N --status BLOCKED --reason \"...\"")`
|
|
210
|
+
|
|
211
|
+
| Param | 必填 | 格式 | 示例 |
|
|
212
|
+
|-------|------|------|------|
|
|
213
|
+
| `--summary` | MUST | 动词开头,≤100 字 | `"实现搜索 API 分页逻辑,新增 3 端点"` |
|
|
214
|
+
| `--decisions` | SHOULD(可多次) | 每条一个决策 | `"选择 ELK 布局而非 dagre"` |
|
|
215
|
+
| `--caveats` | SHOULD | 后续注意事项 | `"X 模块 e2e 暂未覆盖新端点"` |
|
|
216
|
+
| `--deferred` | SHOULD(可多次) | 推迟工作 | `"性能优化留到 review 后"` |
|
|
209
217
|
5. **Propagate context signals** — 关键信号 (`PHASE: N` / `scratch_dir: path` / `BLP-xxx`) 写入 `status.json.context`
|
|
210
218
|
|
|
211
219
|
完成后 S_LOCATE 触发 `invoke_skill({ skill: "maestro-ralph-execute" })` 自调用。
|
|
@@ -284,8 +292,11 @@ Display: `[{index}/{total}] ✗ {step.skill} 失败,会话已暂停。/maestro
|
|
|
284
292
|
- [ ] 自调用持续到全部 completion_confirmed 或 paused
|
|
285
293
|
- [ ] --from auto-injection:phase-level plan step 运行时从 state.json 查找同 phase+milestone 最新 completed analyze artifact → 注入 `--from analyze:{id}`,写 `source_artifact_ref`
|
|
286
294
|
- [ ] --from auto-injection:phase-level execute step 运行时查找同 phase+milestone 最新 completed plan artifact → 注入 `--dir`,写 `source_artifact_ref`
|
|
287
|
-
- [ ] Goal context injection
|
|
295
|
+
- [ ] Goal context injection:`ralph_protocol_version < "2"` → 前置 `<goal_context>` block;`>= "2"` → skip(session_anchor 覆盖)
|
|
288
296
|
- [ ] Goal context 包含 sub-goal description、done_when、boundary、evidence、execution_criteria
|
|
289
297
|
- [ ] 已有 `--from` 或 `--dir` 的 step 不被 auto-injection 覆盖
|
|
298
|
+
- [ ] `--summary` 在 DONE/DONE_WITH_CONCERNS 时为 MUST(动词开头,≤100 字)
|
|
299
|
+
- [ ] `--decisions`/`--caveats`/`--deferred` 为 SHOULD;存在关键决策/注意事项/推迟工作时填写
|
|
300
|
+
- [ ] 结构化总结由 CLI 写入 status.json,session_anchor 自动聚合注入下游 step
|
|
290
301
|
|
|
291
302
|
</appendix>
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: manage-drift-realign
|
|
3
|
+
description: Detect and realign .workflow/ artifact drift against code reality after refactoring
|
|
4
|
+
argument-hint: "--scope <roadmap|spec|codebase|state|issue|knowhow|project|all> [--since YYYY-MM-DD|commit|HEAD~N] [--depth shallow|deep] [--dry-run] [--report] [--auto-archive] [--interactive]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- read_file
|
|
7
|
+
- write_file
|
|
8
|
+
- edit_file
|
|
9
|
+
- shell
|
|
10
|
+
- find_files
|
|
11
|
+
- search
|
|
12
|
+
- delegate_subagent
|
|
13
|
+
- ask_user
|
|
14
|
+
---
|
|
15
|
+
<!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
|
|
16
|
+
|
|
17
|
+
<purpose>
|
|
18
|
+
检测代码重构/增量变更后,代码现实与 .workflow/ 文档之间的漂移。互补于 `manage-knowledge-audit`(检测知识存储内部矛盾)。本命令通过 git 时间线 + session 历史检测 code↔document 漂移。
|
|
19
|
+
</purpose>
|
|
20
|
+
|
|
21
|
+
<required_reading>
|
|
22
|
+
@~/.maestro/workflows/drift-realign.md
|
|
23
|
+
</required_reading>
|
|
24
|
+
|
|
25
|
+
<deferred_reading>
|
|
26
|
+
- ~/.maestro/workflows/knowledge-audit.md (交叉引用已有审计发现)
|
|
27
|
+
- ~/.maestro/workflows/sync.md (codebase 文档严重漂移时自动触发)
|
|
28
|
+
- ~/.maestro/workflows/codebase-rebuild.md (sync 不足时的回退方案)
|
|
29
|
+
</deferred_reading>
|
|
30
|
+
|
|
31
|
+
<context>
|
|
32
|
+
Arguments: $ARGUMENTS
|
|
33
|
+
|
|
34
|
+
**Scope:** `roadmap` | `spec` | `codebase` | `state` | `issue` | `knowhow` | `project` | `all`(默认 `all`)
|
|
35
|
+
|
|
36
|
+
**`--since`:** 分析起始点。支持日期(`YYYY-MM-DD`)、commit ref(`abc1234`)、相对引用(`HEAD~N`)。默认自动检测:优先读 `state.json` 的 `last_drift_realign` 或 `last_pruned` 时间戳,回退 90 天。
|
|
37
|
+
|
|
38
|
+
**`--depth`:** `shallow`(mtime + 引用检查)vs `deep`(LLM 语义分析)。默认 `shallow`。
|
|
39
|
+
|
|
40
|
+
**`--dry-run`:** 预览模式,不执行任何写入。
|
|
41
|
+
|
|
42
|
+
**`--report`:** 仅生成报告,不进入交互分诊。
|
|
43
|
+
|
|
44
|
+
**`--auto-archive`:** 自动归档陈旧项,跳过逐项确认。
|
|
45
|
+
|
|
46
|
+
**`--interactive`:** 逐项交互分诊(默认)。
|
|
47
|
+
|
|
48
|
+
**互斥规则:** `--report` 覆盖 `--interactive`;`--auto-archive` 覆盖 `--interactive`。
|
|
49
|
+
|
|
50
|
+
**状态文件读取:**
|
|
51
|
+
- `.workflow/state.json`
|
|
52
|
+
- `.workflow/roadmap.md`
|
|
53
|
+
- `.workflow/specs/*.md`
|
|
54
|
+
- `.workflow/codebase/*.md`
|
|
55
|
+
- `.workflow/issues/issues.jsonl`
|
|
56
|
+
- `.workflow/knowhow/*.md`
|
|
57
|
+
- `.workflow/project.md`
|
|
58
|
+
|
|
59
|
+
使用 `maestro timeline` CLI 构建统一的 git+session 时间线。
|
|
60
|
+
</context>
|
|
61
|
+
|
|
62
|
+
<execution>
|
|
63
|
+
Follow `~/.maestro/workflows/drift-realign.md` Stages 1-9 in order.
|
|
64
|
+
|
|
65
|
+
### Phase Gates (MANDATORY, BLOCKING)
|
|
66
|
+
|
|
67
|
+
**GATE 1: Parse → Timeline** (Stages 1-2)
|
|
68
|
+
- REQUIRED: `.workflow/` 存在,scope 解析通过,`--since` 已解析。
|
|
69
|
+
- REQUIRED: `maestro timeline --since <date> --json` 产出有效时间线。
|
|
70
|
+
- BLOCKED if `.workflow/` 缺失 (E001)、scope 非法 (E002)、git 不可用 (E003)。
|
|
71
|
+
|
|
72
|
+
**GATE 2: Timeline → Scan** (Stages 2-3 → Stage 4)
|
|
73
|
+
- REQUIRED: `timeline.json` 已生成且包含事件。
|
|
74
|
+
- REQUIRED: `drift_score` 已计算(LOW/MODERATE/SEVERE)。
|
|
75
|
+
- REQUIRED: 若 SEVERE 且 `--depth shallow`,发出 W002 建议 `--depth deep`。
|
|
76
|
+
- BLOCKED if 时间线为空(`--since` 之后无变更)。
|
|
77
|
+
|
|
78
|
+
**GATE 3: Scan → Triage** (Stage 4 → Stages 5-6)
|
|
79
|
+
- REQUIRED: 4 个并行漂移扫描 agent 全部返回结果(或 W003 部分覆盖)。
|
|
80
|
+
- REQUIRED: `DriftFinding[]` 已合并、去重、按严重度排序。
|
|
81
|
+
- BLOCKED if 所有 agent 均失败。
|
|
82
|
+
|
|
83
|
+
**GATE 4: Triage → Apply** (Stages 6-7 → Stage 8)
|
|
84
|
+
- REQUIRED: 备份 tarball 生成于 `.workflow/.trash/drift-realign-{timestamp}/`。
|
|
85
|
+
- REQUIRED: 所有用户决策已记录(或 `--auto-archive`/`--report` 已生效)。
|
|
86
|
+
- REQUIRED: codebase scope 的 rebuild 动作自动触发 `/quality-sync --full`。
|
|
87
|
+
- BLOCKED if 备份失败 (E005)。
|
|
88
|
+
|
|
89
|
+
### Execution Constraints
|
|
90
|
+
|
|
91
|
+
- **Code-as-Truth**: 代码是唯一真理源。当文档说 X 但代码做 Y 时,文档漂移。
|
|
92
|
+
- **Parallel scan**: Stage 4 在单条消息中派发 4 个 agent(roadmap-scanner、spec-scanner、codebase-scanner、artifact-scanner)。
|
|
93
|
+
- **Auto-rebuild**: 当 codebase-scanner 检测到严重漂移(3+ P0 finding)时,分诊后自动触发 `/quality-sync --full`。若 sync 报告重大结构变更,建议 `/manage-codebase-rebuild`。
|
|
94
|
+
- **Long gap handling**: 当 `drift_window` > 180 天时,自动升级为 `--depth deep` 并警告用户 (W002)。
|
|
95
|
+
|
|
96
|
+
### Platform Inquiry(Stage 2a,交互式)
|
|
97
|
+
|
|
98
|
+
当 `session_summary.by_platform` 包含多个平台且 session 总量 > 20 时,使用 ask_user 询问用户修改主要在哪个平台进行。用户选择后以 `--platform` 参数重新获取 timeline,缩小后续分析范围。
|
|
99
|
+
|
|
100
|
+
### Session 详情加载策略(Stage 2b)
|
|
101
|
+
|
|
102
|
+
`maestro timeline` 每条 session 事件已包含:`summary`(用户提问摘要)、`edited_files`、`code_paths`、`platform`。这些信息在 `--depth shallow` 模式下足以支撑漂移检测。
|
|
103
|
+
|
|
104
|
+
当 `--depth deep` 时,对与 cold_workflow_files 有 edited_files 交集的 session,通过 `maestro load --type session --id <id> --json` 按需加载完整 body 和 related 字段:
|
|
105
|
+
- 仅加载 edited_files 与 cold_workflow_files 有交集的 session
|
|
106
|
+
- 最多加载 10 个(按交集文件数降序排序)
|
|
107
|
+
- 结果写入 `.workflow/.drift-realign/session-details-{date}.json`
|
|
108
|
+
- scanner agent 在 deep 模式下同时接收 timeline.json + session-details.json
|
|
109
|
+
</execution>
|
|
110
|
+
|
|
111
|
+
<completion>
|
|
112
|
+
### Next-step routing
|
|
113
|
+
|
|
114
|
+
| Condition | Suggestion |
|
|
115
|
+
|-----------|-----------|
|
|
116
|
+
| codebase 文档已重建 | `/manage-status` |
|
|
117
|
+
| spec 标记待更新 | 手动编辑标记的 spec 文件 |
|
|
118
|
+
| roadmap 已过时 | `/maestro-roadmap` 重新生成 |
|
|
119
|
+
| state.json 需清理 | `/manage-knowledge-audit --scope artifact` |
|
|
120
|
+
| 需要完整同步 | `/quality-sync --full` |
|
|
121
|
+
| project.md 已过时 | 编辑 `.workflow/project.md` |
|
|
122
|
+
</completion>
|
|
123
|
+
|
|
124
|
+
<error_codes>
|
|
125
|
+
| Code | Severity | Condition | Recovery |
|
|
126
|
+
|------|----------|-----------|----------|
|
|
127
|
+
| E001 | error | `.workflow/` 未初始化 | 先跑 `/maestro-init` |
|
|
128
|
+
| E002 | error | `--scope` 非法 | 提供有效 scope: roadmap/spec/codebase/state/issue/knowhow/project/all |
|
|
129
|
+
| E003 | error | git 不可用(非 git 仓库) | 初始化 git |
|
|
130
|
+
| E004 | error | `--since` 无法解析 | 检查日期格式或 commit ref |
|
|
131
|
+
| E005 | error | 备份失败 | 检查磁盘空间 |
|
|
132
|
+
| W001 | warning | session 历史不可用(wiki 未索引) | 运行 `maestro wiki rebuild` |
|
|
133
|
+
| W002 | warning | `drift_window` > 180 天 | 建议使用 `--depth deep` |
|
|
134
|
+
| W003 | warning | 部分 scanner agent 失败 | 以部分覆盖继续 |
|
|
135
|
+
| W004 | warning | git log > 1000 commits | 自动截断至最近 1000 条 |
|
|
136
|
+
</error_codes>
|
|
137
|
+
|
|
138
|
+
<success_criteria>
|
|
139
|
+
- [ ] Scope 正确解析,互斥标志校验通过
|
|
140
|
+
- [ ] `maestro timeline` 已调用,`timeline.json` 已生成
|
|
141
|
+
- [ ] `drift_score` 已计算(LOW/MODERATE/SEVERE 已展示)
|
|
142
|
+
- [ ] 4 个并行 scanner agent 已派发
|
|
143
|
+
- [ ] `DriftFinding[]` 已合并并按 P0 > P1 > P2 排序
|
|
144
|
+
- [ ] 如 `--interactive`:用户已分诊所有 finding
|
|
145
|
+
- [ ] 变更前备份 tarball 已生成
|
|
146
|
+
- [ ] archive 动作已将文件移入 `.trash/`
|
|
147
|
+
- [ ] update 动作已注入 TODO 标记及提示
|
|
148
|
+
- [ ] rebuild 动作已自动触发 `/quality-sync --full`
|
|
149
|
+
- [ ] `state.json` 已更新 `last_drift_realign` 时间戳
|
|
150
|
+
- [ ] `drift-report-{date}.md` 已生成
|
|
151
|
+
- [ ] `drift-log.jsonl` 已追加
|
|
152
|
+
- [ ] 摘要展示及下一步路由已输出
|
|
153
|
+
</success_criteria>
|