maestro-flow 0.5.39 → 0.5.41

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 (139) hide show
  1. package/.agents/skills/odyssey-debug/SKILL.md +109 -143
  2. package/.agents/skills/odyssey-improve/SKILL.md +127 -141
  3. package/.agents/skills/odyssey-planex/SKILL.md +140 -231
  4. package/.agents/skills/odyssey-review-test-fix/SKILL.md +136 -90
  5. package/.agents/skills/odyssey-ui/SKILL.md +123 -143
  6. package/.agy/skills/odyssey-debug/SKILL.md +109 -143
  7. package/.agy/skills/odyssey-improve/SKILL.md +127 -141
  8. package/.agy/skills/odyssey-planex/SKILL.md +140 -231
  9. package/.agy/skills/odyssey-review-test-fix/SKILL.md +136 -90
  10. package/.agy/skills/odyssey-ui/SKILL.md +123 -143
  11. package/.claude/commands/odyssey-debug.md +109 -143
  12. package/.claude/commands/odyssey-improve.md +127 -141
  13. package/.claude/commands/odyssey-planex.md +140 -231
  14. package/.claude/commands/odyssey-review-test-fix.md +136 -90
  15. package/.claude/commands/odyssey-ui.md +123 -143
  16. package/.codex/agents/cli-explore-agent.toml +181 -0
  17. package/.codex/agents/cross-role-reviewer.toml +165 -0
  18. package/.codex/agents/impeccable-agent.toml +89 -0
  19. package/.codex/agents/role-design-author.toml +213 -0
  20. package/.codex/agents/team-worker.toml +4 -7
  21. package/.codex/agents/ui-design-agent.toml +260 -0
  22. package/.codex/agents/workflow-analyzer.toml +106 -0
  23. package/.codex/agents/workflow-codebase-mapper.toml +69 -0
  24. package/.codex/agents/workflow-collab-planner.toml +140 -0
  25. package/.codex/agents/workflow-debugger.toml +95 -0
  26. package/.codex/agents/workflow-executor.toml +124 -0
  27. package/.codex/agents/workflow-external-researcher.toml +80 -0
  28. package/.codex/agents/workflow-integration-checker.toml +76 -0
  29. package/.codex/agents/workflow-nyquist-auditor.toml +77 -0
  30. package/.codex/agents/workflow-phase-researcher.toml +76 -0
  31. package/.codex/agents/workflow-plan-checker.toml +93 -0
  32. package/.codex/agents/workflow-planner.toml +192 -0
  33. package/.codex/agents/workflow-project-researcher.toml +65 -0
  34. package/.codex/agents/workflow-research-synthesizer.toml +65 -0
  35. package/.codex/agents/workflow-reviewer.toml +75 -0
  36. package/.codex/agents/workflow-roadmapper.toml +75 -0
  37. package/.codex/agents/workflow-verifier.toml +113 -0
  38. package/.codex/skills/maestro/SKILL.md +1 -0
  39. package/.codex/skills/maestro-analyze/SKILL.md +33 -15
  40. package/.codex/skills/maestro-brainstorm/SKILL.md +13 -10
  41. package/.codex/skills/maestro-collab/SKILL.md +30 -75
  42. package/.codex/skills/maestro-execute/SKILL.md +19 -12
  43. package/.codex/skills/maestro-grill/SKILL.md +12 -11
  44. package/.codex/skills/maestro-next/SKILL.md +3 -3
  45. package/.codex/skills/maestro-overlay/SKILL.md +1 -1
  46. package/.codex/skills/maestro-plan/SKILL.md +17 -8
  47. package/.codex/skills/maestro-ralph/SKILL.md +3 -0
  48. package/.codex/skills/maestro-ralph-execute/SKILL.md +1 -0
  49. package/.codex/skills/maestro-roadmap/SKILL.md +14 -8
  50. package/.codex/skills/manage-learn/SKILL.md +1 -1
  51. package/.codex/skills/odyssey-debug/SKILL.md +176 -150
  52. package/.codex/skills/odyssey-improve/SKILL.md +210 -177
  53. package/.codex/skills/odyssey-planex/SKILL.md +162 -242
  54. package/.codex/skills/odyssey-review-test-fix/SKILL.md +96 -90
  55. package/.codex/skills/odyssey-ui/SKILL.md +211 -179
  56. package/.codex/skills/quality-review/SKILL.md +17 -10
  57. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +6 -12
  58. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +6 -14
  59. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +2 -6
  60. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +6 -14
  61. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +3 -7
  62. package/.codex/skills/team-quality-assurance/roles/scout/role.md +2 -5
  63. package/.codex/skills/team-review/roles/reviewer/role.md +2 -5
  64. package/.codex/skills/team-review/roles/scanner/role.md +2 -5
  65. package/.codex/skills/team-tech-debt/roles/executor/role.md +3 -7
  66. package/.codex/skills/team-tech-debt/roles/scanner/role.md +2 -5
  67. package/.codex/skills/team-tech-debt/roles/validator/role.md +3 -7
  68. package/.codex/skills/team-testing/roles/executor/role.md +3 -7
  69. package/.codex/skills/team-testing/roles/generator/role.md +3 -7
  70. package/dashboard/dist-server/src/commands/install-backend.js +19 -0
  71. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  72. package/dashboard/dist-server/src/core/manifest.d.ts +5 -0
  73. package/dashboard/dist-server/src/core/manifest.js.map +1 -1
  74. package/dashboard/dist-server/src/core/plugin-bridge.d.ts +59 -0
  75. package/dashboard/dist-server/src/core/plugin-bridge.js +355 -0
  76. package/dashboard/dist-server/src/core/plugin-bridge.js.map +1 -0
  77. package/dashboard/dist-server/src/tools/spec-loader.js +27 -19
  78. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  79. package/dashboard/dist-server/src/tools/spec-seeds.d.ts +8 -0
  80. package/dashboard/dist-server/src/tools/spec-seeds.js +114 -0
  81. package/dashboard/dist-server/src/tools/spec-seeds.js.map +1 -1
  82. package/dist/src/cli.js +19 -1
  83. package/dist/src/cli.js.map +1 -1
  84. package/dist/src/commands/install-backend.d.ts.map +1 -1
  85. package/dist/src/commands/install-backend.js +19 -0
  86. package/dist/src/commands/install-backend.js.map +1 -1
  87. package/dist/src/commands/install.d.ts.map +1 -1
  88. package/dist/src/commands/install.js +17 -1
  89. package/dist/src/commands/install.js.map +1 -1
  90. package/dist/src/commands/plugin.d.ts +3 -0
  91. package/dist/src/commands/plugin.d.ts.map +1 -0
  92. package/dist/src/commands/plugin.js +137 -0
  93. package/dist/src/commands/plugin.js.map +1 -0
  94. package/dist/src/commands/spec.d.ts.map +1 -1
  95. package/dist/src/commands/spec.js +13 -3
  96. package/dist/src/commands/spec.js.map +1 -1
  97. package/dist/src/commands/update.d.ts.map +1 -1
  98. package/dist/src/commands/update.js +23 -0
  99. package/dist/src/commands/update.js.map +1 -1
  100. package/dist/src/core/install-executor.d.ts +1 -1
  101. package/dist/src/core/install-executor.d.ts.map +1 -1
  102. package/dist/src/core/install-executor.js +27 -0
  103. package/dist/src/core/install-executor.js.map +1 -1
  104. package/dist/src/core/install-profile.d.ts +5 -0
  105. package/dist/src/core/install-profile.d.ts.map +1 -1
  106. package/dist/src/core/install-profile.js +8 -0
  107. package/dist/src/core/install-profile.js.map +1 -1
  108. package/dist/src/core/manifest.d.ts +5 -0
  109. package/dist/src/core/manifest.d.ts.map +1 -1
  110. package/dist/src/core/manifest.js.map +1 -1
  111. package/dist/src/core/plugin-bridge.d.ts +60 -0
  112. package/dist/src/core/plugin-bridge.d.ts.map +1 -0
  113. package/dist/src/core/plugin-bridge.js +355 -0
  114. package/dist/src/core/plugin-bridge.js.map +1 -0
  115. package/dist/src/tools/spec-init.d.ts +4 -3
  116. package/dist/src/tools/spec-init.d.ts.map +1 -1
  117. package/dist/src/tools/spec-init.js +9 -5
  118. package/dist/src/tools/spec-init.js.map +1 -1
  119. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  120. package/dist/src/tools/spec-loader.js +27 -19
  121. package/dist/src/tools/spec-loader.js.map +1 -1
  122. package/dist/src/tools/spec-seeds.d.ts +8 -0
  123. package/dist/src/tools/spec-seeds.d.ts.map +1 -1
  124. package/dist/src/tools/spec-seeds.js +114 -0
  125. package/dist/src/tools/spec-seeds.js.map +1 -1
  126. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  127. package/dist/src/tui/install-ui/InstallFlow.js +43 -14
  128. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  129. package/dist/src/tui/install-ui/types.d.ts +2 -0
  130. package/dist/src/tui/install-ui/types.d.ts.map +1 -1
  131. package/dist/src/tui/install-ui/types.js.map +1 -1
  132. package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
  133. package/dist/src/tui/install-ui/useInstallFlowState.js +13 -1
  134. package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
  135. package/dist/src/utils/update-notices.js +11 -0
  136. package/dist/src/utils/update-notices.js.map +1 -1
  137. package/package.json +1 -1
  138. package/workflows/odyssey-base-codex.md +306 -0
  139. package/workflows/shell-exec-protocol.md +30 -0
@@ -40,7 +40,10 @@ $ARGUMENTS -- phase number, topic text, and optional flags.
40
40
  </context>
41
41
 
42
42
  <interview_protocol>
43
- Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `-y/--yes`, `--continue`, or input is already specific (explicit phase number or unambiguous topic).
43
+ Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip ONLY when `-y/--yes` or `--continue` is set.
44
+
45
+ **Numeric phase argument**: interview still runs but scope is pre-resolved to "phase" — skip the scope decision, start from depth.
46
+ **Text topic**: always interview from scope onward — text topics are never auto-classified as "unambiguous".
44
47
 
45
48
  - One decision per turn via request_user_input with 2–4 options + a (Recommended) default. The user controls termination — keep interviewing until convergence; they can interrupt naturally at any time.
46
49
  - Search-first when uncertain: before asking, resolve via `state.json`, `roadmap.md`, `issues.jsonl`, `maestro load --type spec`, `maestro search`, Grep, Read, or — for open-ended multi-file scans — `maestro delegate ... --role explore`. Never ask what code or memory can verify; never bounce your own ambiguity back to the user — search first, then ask only what truly needs human judgment.
@@ -94,7 +97,7 @@ Available exploration dimensions: architecture, implementation, performance, sec
94
97
  9. **D-007 milestone resolution**: numeric scope MUST reverse-lookup `state.json.milestones[].phase_slugs`. NEVER read `current_milestone` directly for phase-scoped artifact registration.
95
98
  10. **scope_verdict mandatory** (D-003): macro/adhoc/standalone scopes MUST produce `scope_verdict ∈ {small, medium, large}` in conclusions.json. Drives downstream chain (roadmap vs plan).
96
99
  11. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Do NOT bypass for "efficiency" or "clear intent" reasons.
97
- 12. **Evidence required on decisions** — every decision in context.md MUST cite evidence from Wave 1 exploration findings or Wave 2 scores. Decisions citing only orchestrator's manual file reading are flagged LOW CONFIDENCE.
100
+ 12. **Evidence required on decisions** — every decision in context.md MUST cite evidence from Wave 1 exploration findings or Wave 2 scores. Decisions citing only orchestrator's manual file reading are flagged LOW CONFIDENCE. **Degradation exception**: when invariant 7 activates and evidence is incomplete, decisions MAY proceed but MUST inherit LOW CONFIDENCE flag per invariant 13 — this is not a violation of the MUST, it is the defined degraded behavior.
98
101
  13. **Degradation must be marked** — when graceful degradation (invariant 7) activates, ALL downstream outputs inherit a LOW CONFIDENCE flag. Record in discoveries.ndjson: `{ type: "degradation_event", data: { wave, failed_tasks, impact } }`.
99
102
  </invariants>
100
103
 
@@ -149,13 +152,18 @@ S_WAVE_1:
149
152
  -> ERROR WHEN: all failed
150
153
 
151
154
  S_WAVE_2:
152
- -> S_BOUNDARY_GRILL DO: A_SPAWN_WAVE_2
155
+ -> S_BOUNDARY_GRILL WHEN: 1+ completed DO: A_SPAWN_WAVE_2
156
+ -> S_WAVE_3_DEGRADED WHEN: all failed, retry exhausted DO: flag LOW CONFIDENCE on all downstream, record degradation_event
157
+ -> S_WAVE_2 (retry) WHEN: all failed, retry available DO: retry once
153
158
 
154
159
  S_BOUNDARY_GRILL:
155
160
  -> S_WAVE_3 WHEN: no boundary conflicts detected DO: —
156
161
  -> S_WAVE_3 WHEN: conflicts detected + resolved DO: A_BOUNDARY_GRILL
157
162
  GUARD: max 3 conflicts × 3 questions; non-blocking (see boundary-grill.md)
158
163
 
164
+ S_WAVE_3_DEGRADED:
165
+ -> S_AGGREGATE DO: A_SPAWN_WAVE_3 with degraded=true (decision-only context.md, ALL decisions flagged LOW CONFIDENCE)
166
+
159
167
  S_WAVE_3:
160
168
  -> S_AGGREGATE DO: A_SPAWN_WAVE_3
161
169
 
@@ -215,8 +223,10 @@ Share via discovery board. Merge results -> master tasks.csv (map `result_status
215
223
 
216
224
  Filter `wave==2 AND status=="pending"` -> build prev_context from wave 1 findings -> write wave-2.csv -> spawn with `SCORING_INSTRUCTION + SHARED_TERMINATION_CONTRACT`.
217
225
 
226
+ **Failed-dependency handling**: when building prev_context, skip `context_from` IDs whose status is `failed`/`blocked`. If ALL `context_from` IDs failed, mark the scoring task as `blocked` (do not spawn). Append a `gap_note` to the scoring instruction listing which exploration dimensions are missing so the agent knows its evidence base is incomplete.
227
+
218
228
  **Scoring agent** (6 dimensions: feasibility, impact, risk, complexity, alignment, maintainability):
219
- Score 0-100 with specific evidence (code refs from exploration). Each score MUST reference exploration findings.
229
+ Score 0-100 with specific evidence (code refs from exploration). Each score MUST reference exploration findings. When exploration gaps exist (gap_note present), score MUST include a `confidence_penalty` and flag `evidence_incomplete=true`.
220
230
 
221
231
  Merge results -> master tasks.csv (map `result_status` → master `status`).
222
232
 
@@ -252,14 +262,23 @@ Non-blocking: conflicts produce warnings, pipeline continues.
252
262
 
253
263
  1. Export results.csv
254
264
  2. **Confidence scoring** (full mode): factors -- findings_depth(.30), evidence_strength(.25), coverage_breadth(.20), user_validation(.15), consistency(.10). Thresholds: <60% deeper, 60-80% optional, 80-95% converging, >95% converge.
255
- 3. Auto-create issues from Deferred items -> issues.jsonl
256
- 4. Spec enrichment: Locked decisions -> `maestro spec add arch "<title>" "<content>" --keywords <kw> --description "<summary>"`; code patterns -> `maestro spec add coding "<title>" "<content>" --keywords <kw> --description "<summary>"`
257
- 5. Register artifact in state.json (type: analyze, includes context_package field pointing to context-package.json)
258
- 6. Copy outputs to scratchDir, display summary
259
- 7. **Next-step routing** (D-003 §5.3 macro scope uses `scope_verdict` for downstream chain selection):
260
-
261
- | Scope | Condition | Next |
262
- |-------|-----------|------|
265
+ 3. Register artifact in state.json (type: analyze, includes context_package field pointing to context-package.json)
266
+ 4. Copy outputs to scratchDir, display summary
267
+
268
+ 5. **Side-effect confirmation gate** (skip when `-y/--yes`):
269
+ Before writing to external stores, present a summary to the user via `request_user_input` listing:
270
+ - Deferred items to create as issues (count + titles)
271
+ - Locked decisions to register as specs (count + titles)
272
+ The user can approve all, selectively exclude, or skip entirely.
273
+
274
+ 5a. **Issue creation** (approved items only): Deferred items -> issues.jsonl
275
+ 5b. **Spec enrichment** (approved items only): Locked decisions -> `maestro spec add arch "<title>" "<content>" --keywords <kw> --description "<summary>"`; code patterns -> `maestro spec add coding "<title>" "<content>" --keywords <kw> --description "<summary>"`
276
+
277
+ 6. **Next-step suggestion** (D-003 §5.3 — suggest only, NEVER auto-execute):
278
+ Display the recommended next command based on scope_verdict. The user decides whether to proceed.
279
+
280
+ | Scope | Condition | Suggested |
281
+ |-------|-----------|-----------|
263
282
  | Phase/Milestone | Go + UI work needed | `$maestro-impeccable build {target}` |
264
283
  | Phase/Milestone | Go + ready to plan | `$maestro-plan` or `$maestro-plan {phase}` |
265
284
  | Phase/Milestone | No-Go | `$maestro-brainstorm {topic}` |
@@ -324,12 +343,12 @@ Protocol: read before analysis, append-only, dedup by type+key.
324
343
  - [ ] Boundary grill executed between Wave 2 and Wave 3 (skip if no conflicts detected)
325
344
  - [ ] Boundary grill results written to analysis.md § Boundary Grill Results (if conflicts found)
326
345
  - [ ] Pressure pass completed ≥ 1 time on highest-risk dimension before synthesis
327
- - [ ] Deferred items auto-created as issues
346
+ - [ ] Deferred items created as issues (after user confirmation in interactive mode; auto in -y mode)
328
347
  - [ ] Scope creep redirected to Deferred section
329
348
  - [ ] Artifact registered in state.json (includes context_package field)
330
349
  - [ ] Upstream context loaded via `--from` when specified
331
350
  - [ ] discoveries.ndjson append-only throughout
332
- - [ ] Next step routed (plan for Go, brainstorm for No-Go, plan --gaps for Gaps)
351
+ - [ ] Next step suggested to user (plan for Go, brainstorm for No-Go, plan --gaps for Gaps) — never auto-executed
333
352
  - [ ] Session sealed via finish-work (archive.json written, optional spec/knowhow extraction)
334
353
  - [ ] Ralph-invoked: `maestro ralph complete <idx> --status {STATUS}` called with correct verdict
335
354
  </success_criteria>
@@ -345,4 +364,3 @@ Status verdicts: **DONE** (normal), **DONE_WITH_CONCERNS** (caveats; pass `--con
345
364
  <on_complete>
346
365
  @~/.maestro/workflows/finish-work.md — SESSION_DIR=OUTPUT_DIR, SESSION_TYPE=analyze, SESSION_ID={artifact_id}, LINKED_MILESTONE={target_milestone or null}
347
366
  </on_complete>
348
- </output>
@@ -54,7 +54,7 @@ When `--from` is absent, auto-discover from state.json: latest `type=grill` arti
54
54
  </context>
55
55
 
56
56
  <interview_protocol>
57
- Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `-y/--yes`, `--skip-questions`, `--continue` (existing session), or input is already specific.
57
+ Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip ONLY when `-y/--yes`, `--skip-questions`, or `--continue` (existing session) is set. Text topics always require at least mode + role confirmation — never auto-classify input as "specific enough" to skip.
58
58
 
59
59
  - One decision per turn via request_user_input with 2–4 options + a (Recommended) default. The user controls termination — keep interviewing until convergence; they can interrupt naturally at any time.
60
60
  - Search-first when uncertain: before asking, resolve via `state.json`, the session directory, `maestro load --type spec`, `maestro search`, `maestro explore` (preferred, fallback Glob/Grep/Read). Never ask what code or memory can verify; never bounce your own ambiguity back to the user — search first, then ask only what truly needs human judgment.
@@ -223,12 +223,12 @@ CONSTRAINTS:
223
223
  1. **Wave order sacred**: Guidance (W1) MUST complete before role design (W2); review (W3) MUST run only after all W2 rows complete.
224
224
  2. **CSV source of truth**: Master tasks.csv holds all state.
225
225
  3. **Discovery board append-only**: Never modify/delete discoveries.ndjson.
226
- 4. **Skip on failure**: Guidance fails → abort. All W2 roles fail → skip review.
226
+ 4. **Skip on failure**: Guidance fails → abort. All W2 roles fail → skip review, flag all downstream LOW CONFIDENCE.
227
227
  5. **9 valid roles only**: data-architect, product-manager, product-owner, scrum-master, subject-matter-expert, system-architect, test-strategist, ui-designer, ux-expert
228
228
  6. **Wave 3 is read-only at the agent boundary**: the reviewer emits structured findings (conflicts / gaps / synergies with `patch_targets[]`). The orchestrator (not the agent) applies the patches via Edit.
229
- 7. **DO NOT STOP**: Continuous until all waves complete; only pause at [CHECKPOINT] (skipped with -y).
230
- 8. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Do NOT bypass for "efficiency" or "clear intent" reasons.
231
- 9. **Evidence required** — role analysis findings in {role}/analysis.md §2 Decision Digest MUST cite concrete evidence: code references (file:line), API endpoints, data models from codebase exploration. Decisions without evidence are flagged LOW CONFIDENCE.
229
+ 7. **Pipeline continuity**: Continuous until all waves complete; only pause at [CHECKPOINT] (skipped with -y). When invariant 4 (skip on failure) activates, the pipeline continues in degraded mode — this is NOT a violation of invariant 8 but a defined degradation path.
230
+ 8. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Do NOT bypass for "efficiency" or "clear intent" reasons. Defined degradation paths (invariant 4) are not violations.
231
+ 9. **Evidence required** — role analysis findings in {role}/analysis.md §2 Decision Digest MUST cite concrete evidence: code references (file:line), API endpoints, data models from codebase exploration. Decisions without evidence are flagged LOW CONFIDENCE. **Degradation exception**: when invariant 4 activates and evidence is unavailable due to upstream failure, decisions MAY proceed but MUST inherit LOW CONFIDENCE flag.
232
232
  10. **Artifact verification before completion** — before reporting completion, verify ALL expected artifacts exist: guidance-specification.md, {role}/analysis.md (per selected role), {role}/analysis-F-*.md (per feature). If any missing: DO NOT report completion.
233
233
  </invariants>
234
234
 
@@ -308,16 +308,19 @@ S_CHECK_1 → END WHEN: user "Abort"
308
308
 
309
309
  S_DESIGN → S_WAVE_2 WHEN: DESIGN.md exists OR explore completed DO: A_DESIGN_EXPLORE
310
310
  S_DESIGN → S_WAVE_2 WHEN: DESIGN.md already exists (skip explore)
311
- S_DESIGN → S_WAVE_2 WHEN: explore failed → W004 → retry once. If still fails: flag downstream outputs as LOW CONFIDENCE, continue without
311
+ S_DESIGN → S_WAVE_2 WHEN: explore failed → W004 → retry once. If still fails: set session.design_degraded=true, record degradation_event in discoveries.ndjson, continue without. W2 ui-designer agent receives gap_note="DESIGN.md unavailable, design evidence incomplete" and outputs inherit LOW CONFIDENCE flag.
312
312
 
313
- S_WAVE_2 → S_CHECK_2 DO: spawn wave-2 (parallel), merge results — each agent writes {role}/analysis.md + sub-files
314
- S_WAVE_2 → S_AGGREGATE WHEN: all failed DO: skip review
313
+ S_WAVE_2 → S_CHECK_2 WHEN: 1+ completed DO: spawn wave-2 (parallel), merge results — each agent writes {role}/analysis.md + sub-files
314
+ S_WAVE_2 → S_WAVE_2 WHEN: all failed, retry available DO: retry once
315
+ S_WAVE_2 → S_AGGREGATE WHEN: all failed, retry exhausted DO: skip review, flag LOW CONFIDENCE on all downstream
315
316
 
316
317
  S_CHECK_2 → S_WAVE_3 WHEN: -y OR user "Proceed"
317
318
  S_CHECK_2 → S_WAVE_2 WHEN: user "Add Roles" DO: add new role rows, spawn only new
318
319
 
319
- S_WAVE_3 → S_BOUNDARY_GRILL DO: spawn wave-3, capture review_findings (conflicts/gaps/synergies with patch_targets)
320
+ S_WAVE_3 → S_BOUNDARY_GRILL WHEN: completed DO: spawn wave-3, capture review_findings (conflicts/gaps/synergies with patch_targets)
320
321
  S_WAVE_3 → S_AGGREGATE WHEN: zero findings DO: log "No cross-role issues detected", skip resolve
322
+ S_WAVE_3 → S_WAVE_3 WHEN: failed, retry available DO: retry once
323
+ S_WAVE_3 → S_AGGREGATE WHEN: failed, retry exhausted DO: use analysis files directly, no resolution writeback, flag LOW CONFIDENCE
321
324
 
322
325
  S_BOUNDARY_GRILL:
323
326
  → S_RESOLVE WHEN: no boundary conflicts detected DO: —
@@ -415,7 +418,7 @@ If zero findings, S_RESOLVE is bypassed and `guidance §12` is unchanged.
415
418
  2. Generate context.md (summary, guidance, per-role analyses, review_findings_count, resolutions_applied, patches_skipped, next steps)
416
419
  3. Confidence scoring: 5 dimensions (role_coverage, cross_role_consistency, feature_completeness, spec_quality, design_feasibility). Quality gate: cross_role_consistency < 0.4 → warn.
417
420
  4. Copy artifacts to target session directory (preserve `{role}/` subdirs).
418
- 5. Next-step routing: DESIGN.md established → `maestro-impeccable build <feature>`; else UI features detected → `maestro-impeccable build <feature>`; else → maestro-analyze / maestro-plan / maestro-roadmap
421
+ 5. **Next-step suggestion** (suggest only, NEVER auto-execute): Display the recommended next command. DESIGN.md established → `maestro-impeccable build <feature>`; else UI features detected → `maestro-impeccable build <feature>`; else → maestro-analyze / maestro-plan / maestro-roadmap. The user decides whether to proceed.
419
422
 
420
423
  </actions>
421
424
  </state_machine>
@@ -6,14 +6,14 @@ allowed-tools: Read, Write, Edit, Glob, Grep, request_user_input
6
6
  ---
7
7
 
8
8
  <purpose>
9
- Direct CLI fan-out collaboration via `exec_command`. Diamond topology:
10
- Fan-out (parallel `exec_command` → `maestro delegate --to <tool>`) → Cross-verify (coordinator) → Synthesize (coordinator).
9
+ Direct CLI fan-out collaboration via `shell_exec`. Diamond topology:
10
+ Fan-out (parallel `shell_exec` → `maestro delegate --to <tool>`) → Cross-verify (coordinator) → Synthesize (coordinator).
11
11
 
12
12
  Each CLI tool independently analyzes the requirement via `maestro delegate` shell call.
13
- Coordinator polls ALL CLI results to completion via delegate-protocol.codex.md,
13
+ Coordinator waits for ALL CLI results to completion via shell-exec-protocol.md,
14
14
  then cross-verifies for consensus/conflicts and synthesizes into unified report.
15
15
 
16
- NO spawn_agents_on_csv. NO spawn_agent. ALL CLI calls directly by coordinator via exec_command.
16
+ NO spawn_agents_on_csv. NO spawn_agent. ALL CLI calls directly by coordinator via shell_exec.
17
17
  </purpose>
18
18
 
19
19
 
@@ -62,12 +62,12 @@ $ARGUMENTS — requirement text and optional flags.
62
62
  </context>
63
63
 
64
64
  <invariants>
65
- 1. **ALL analysis via exec_command → maestro delegate** — coordinator NEVER performs analysis internally, NEVER spawns agents for analysis
66
- 2. **exec_command is the execution mechanism** — every delegate call: `exec_command({ cmd: "maestro delegate ..." })`
67
- 3. **delegate-protocol.codex.md governs lifecycle** — MUST follow exec_commandpoll write_stdin → parse for every delegate
68
- 4. **NEVER fire-and-forget** — every exec_command MUST be polled to completion via write_stdin, result consumed before proceeding
65
+ 1. **ALL analysis via shell_exec → maestro delegate** — coordinator NEVER performs analysis internally, NEVER spawns agents for analysis
66
+ 2. **shell_exec is the execution mechanism** — every delegate call: `shell_exec("maestro delegate ...", { timeout: N })`
67
+ 3. **shell-exec-protocol.md governs lifecycle** — MUST follow shell_execwait for completion → parse for every delegate
68
+ 4. **NEVER fire-and-forget** — every shell_exec MUST complete before proceeding, result consumed before next step
69
69
  5. **NEVER substitute internal reasoning** — if CLI fails, report failure; do NOT generate analysis yourself as replacement
70
- 6. **Indefinite wait** — polling has NO max timeout; continue polling until CLI returns regardless of elapsed time; NEVER abandon a running session
70
+ 6. **Indefinite wait** — shell_exec has NO max timeout; continue waiting until CLI returns regardless of elapsed time; NEVER abandon a running session
71
71
  6. **Same prompt, different --to** — fan-out delegates all use identical base prompt, only `--to <tool>` differs
72
72
  7. **Minimum 2 tools** — abort if fewer eligible
73
73
  8. **Partial degradation** — 1 tool fails → continue with remaining (minimum 2 results for cross-verify)
@@ -78,7 +78,7 @@ $ARGUMENTS — requirement text and optional flags.
78
78
  <states>
79
79
  S_PARSE — 解析参数、发现工具 PERSIST: —
80
80
  S_CONFIRM — 展示计划、用户确认(-y 跳过) PERSIST: —
81
- S_FAN_OUT — 并行 exec_command fan-out + 轮询等待 PERSIST: per-tool outputs
81
+ S_FAN_OUT — 并行 shell_exec fan-out + 等待完成 PERSIST: per-tool outputs
82
82
  S_CROSS_VERIFY — 交叉验证:共识/冲突/独特分类 PERSIST: cross-verify.md
83
83
  S_SYNTHESIZE — 生成最终报告 PERSIST: reports
84
84
  S_AGGREGATE — 注册 artifact、输出摘要 PERSIST: state.json
@@ -138,72 +138,27 @@ S_AGGREGATE:
138
138
 
139
139
  #### Phase 1: Parallel Launch
140
140
 
141
- Launch ALL delegate commands simultaneously via `multi_tool_use.parallel`:
141
+ Launch ALL delegate commands simultaneously in parallel:
142
142
 
143
143
  ```
144
- multi_tool_use.parallel({
145
- tool_uses: [
146
- {
147
- recipient_name: "functions.exec_command",
148
- parameters: {
149
- cmd: "maestro delegate \"<shared_prompt>\" --to agy --mode <mode> [--rule <rule>]",
150
- yield_time_ms: 30000,
151
- max_output_tokens: 6000
152
- }
153
- },
154
- {
155
- recipient_name: "functions.exec_command",
156
- parameters: {
157
- cmd: "maestro delegate \"<shared_prompt>\" --to claude --mode <mode> [--rule <rule>]",
158
- yield_time_ms: 30000,
159
- max_output_tokens: 6000
160
- }
161
- }
162
- // ... one entry per selected tool
163
- ]
164
- })
144
+ // Parallel fan-out — one shell_exec per selected tool:
145
+ shell_exec(`maestro delegate "<shared_prompt>" --to agy --mode <mode> [--rule <rule>]`, { timeout: 30000 })
146
+ shell_exec(`maestro delegate "<shared_prompt>" --to claude --mode <mode> [--rule <rule>]`, { timeout: 30000 })
147
+ // ... one call per selected tool
148
+ // Execution mapping: @~/.maestro/workflows/shell-exec-protocol.md
165
149
  ```
166
150
 
167
151
  #### Phase 2: Block Until ALL Complete
168
152
 
169
- For each result from Phase 1, check completion status:
153
+ Each `shell_exec` call blocks until its delegate completes. Save each result:
170
154
 
171
- - **Completed** (no session_id) → save output directly to `{scratchDir}/per-tool/{tool}-output.md`
172
- - **Running** (session_id returned) add to `pending_sessions[]`
155
+ - **Completed** → save output to `{scratchDir}/per-tool/{tool}-output.md`
156
+ - **Failed** log error for that tool
173
157
 
174
- **Blocking poll loop — runs until pending_sessions is empty:**
175
-
176
- ```
177
- pending_sessions = [{ tool, session_id }, ...]
178
-
179
- WHILE pending_sessions.length > 0:
180
- FOR EACH session IN pending_sessions:
181
- result = write_stdin({
182
- session_id: session.session_id,
183
- chars: "",
184
- yield_time_ms: 60000, // 60s per poll — no rush, wait for real output
185
- max_output_tokens: 6000
186
- })
187
-
188
- IF result indicates completed:
189
- save output → {scratchDir}/per-tool/{session.tool}-output.md
190
- REMOVE session FROM pending_sessions
191
- completed_count += 1
192
-
193
- IF result indicates failed/error:
194
- log error for session.tool
195
- REMOVE session FROM pending_sessions
196
- failed_count += 1
197
-
198
- // still running → stays in pending_sessions, poll again next round
199
- ```
200
-
201
- **Blocking guarantees:**
202
- - `yield_time_ms: 60000` — each poll waits up to 60s for output, no short-circuit
203
- - NO max retry count — loop continues indefinitely until CLI returns
204
- - NO timeout escalation — delegate can run as long as needed (30s to 10min+)
205
- - NO early exit — even if tool 1 and 2 are done, keep polling tool 3 until it completes
206
- - Round-robin ensures fair polling across all pending sessions
158
+ **Blocking guarantees (per shell-exec-protocol.md):**
159
+ - Each `shell_exec` waits until CLI returns — no short-circuit
160
+ - NO max timeout — delegate can run as long as needed
161
+ - NO early exit all tools must complete before proceeding
207
162
 
208
163
  #### Phase 3: Validate
209
164
 
@@ -212,9 +167,9 @@ WHILE pending_sessions.length > 0:
212
167
  - 1 tool failed but 2+ succeeded → W001, log failure, continue
213
168
 
214
169
  **Iron rules**:
215
- - NEVER skip polling — every session_id MUST be polled to completion
216
- - NEVER proceed to S_CROSS_VERIFY while pending_sessions is non-empty
217
- - NEVER set a max timeout or max retry count on the poll loop
170
+ - NEVER skip waiting — every shell_exec MUST complete before proceeding
171
+ - NEVER proceed to S_CROSS_VERIFY while any delegate is still running
172
+ - NEVER set a max timeout on shell_exec calls
218
173
  - NEVER generate analysis internally as substitute for CLI output
219
174
  - NEVER summarize or paraphrase — save raw CLI output verbatim
220
175
 
@@ -318,10 +273,10 @@ Generate 3 output files from cross-verify results:
318
273
  </error_codes>
319
274
 
320
275
  <success_criteria>
321
- - [ ] ALL analysis performed via exec_command → maestro delegate — zero internal analysis
322
- - [ ] multi_tool_use.parallel used for fan-out launch
323
- - [ ] Every exec_command polled to completion via write_stdin — no timeout cap, no max retries
324
- - [ ] Blocking poll loop ran until pending_sessions empty — no early exit
276
+ - [ ] ALL analysis performed via shell_exec → maestro delegate — zero internal analysis
277
+ - [ ] Parallel shell_exec calls used for fan-out launch
278
+ - [ ] Every shell_exec waited to completion — no timeout cap, no early exit
279
+ - [ ] All shell_exec calls waited to completion — no early exit
325
280
  - [ ] Per-tool raw outputs saved to {scratchDir}/per-tool/
326
281
  - [ ] Cross-verify: CONSENSUS/CONFLICT/UNIQUE classified, consensus_level computed
327
282
  - [ ] Boundary grill executed on CONFLICT items (skip if no boundary conflicts detected)
@@ -82,6 +82,7 @@ $maestro-execute --continue "20260318-execute-P3-phase3"
82
82
  - `--auto-commit`: Atomic git commit after each task completion
83
83
  - `--method agent|cli`: Override execution method (default: from config.json)
84
84
  - `--dir <path>`: Use arbitrary directory instead of phase resolution (scratch mode)
85
+ - `--skip-verify`: Skip Phase 2.5 verification gate
85
86
 
86
87
  When `--yes` or `-y`: Auto-confirm task breakdown, skip blocked-task prompts, auto-continue through all waves.
87
88
 
@@ -159,14 +160,14 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column populated fr
159
160
  3. **CSV is Source of Truth**: Master tasks.csv holds all execution state
160
161
  4. **Context Propagation**: prev_context built from master CSV findings, not from memory
161
162
  5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
162
- 6. **Cascading Skip on Failure**: If a task fails/blocks, all dependent tasks are skipped
163
+ 6. **Cascading Skip on Failure**: If a task fails/blocks, all dependent tasks are marked `skipped` with error referencing the failed dependency. Skipped tasks have no summaries — this is expected, not a violation of invariant 12/13.
163
164
  7. **Cleanup Temp Files**: Remove `wave-{N}.csv` AND `wave-{N}-results.csv` after results are merged
164
165
  8. **Max 3 Fix Attempts**: Per task, auto-fix convergence failures up to 3 times, then mark blocked
165
166
  9. **Breakpoint Resume**: Always detect completed tasks and skip them on re-run
166
- 10. **DO NOT STOP**: Continuous execution until all waves complete or user explicitly stops
167
- 11. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation.
168
- 12. **Evidence required in task summaries** — task summaries MUST include: files actually modified (not just planned targets), convergence criteria verification results (pass/fail with evidence), any deviations from plan with rationale. "Task completed successfully" without evidence is INVALID.
169
- 13. **Artifact verification before completion** — for each completed task, .summaries/TASK-{NNN}-summary.md MUST exist with concrete evidence. EXC artifact MUST be registered in state.json. If any missing: DO NOT report completion.
167
+ 10. **Pipeline continuity**: Continuous execution until all waves complete or user explicitly stops. When all tasks in a wave are blocked/failed, stop execution and report the blocked wave — this is a defined termination, not an invariant violation.
168
+ 11. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Defined termination (invariant 10) and cascading skips (invariant 6) are not violations.
169
+ 12. **Evidence required in task summaries** — task summaries MUST include: files actually modified (not just planned targets), convergence criteria verification results (pass/fail with evidence), any deviations from plan with rationale. "Task completed successfully" without evidence is INVALID. Does NOT apply to `skipped` tasks (invariant 6).
170
+ 13. **Artifact verification before completion** — for each completed task, .summaries/TASK-{NNN}-summary.md MUST exist with concrete evidence. EXC artifact MUST be registered in state.json. If any missing: DO NOT report completion. Skipped tasks are exempt (no summary expected).
170
171
  </invariants>
171
172
 
172
173
  <execution>
@@ -255,7 +256,7 @@ If exit code is 1, present warnings and ask whether to proceed.
255
256
  For each wave N in ascending order:
256
257
 
257
258
  1. Extract wave N pending rows from master `tasks.csv` (skip wave if none)
258
- 2. Build `prev_context` per task from completed predecessor findings
259
+ 2. Build `prev_context` per task from completed predecessor findings. For `context_from` IDs whose status is `failed`/`blocked`/`skipped`: exclude from prev_context and append gap_note listing missing task IDs so the executor knows its context is incomplete.
259
260
  3. Write `wave-{N}.csv` with `prev_context` column, then execute:
260
261
 
261
262
  ```javascript
@@ -365,13 +366,19 @@ Skip Phase 2.5 when `--skip-verify` flag present or task count == 0.
365
366
 
366
367
  2. **Update task files**: Write each task's status from CSV back to `.task/{id}.json`
367
368
 
368
- 3. **Issue status sync**: For tasks with `issue_id`, update `.workflow/issues/issues.jsonl`:
369
+ 3. **Register EXC artifact in state.json**: Find matching plan artifact, create `{ id: "EXC-{next_id}", type: "execute", milestone, phase, scope, path, status: "completed", depends_on: plan_artifact.id, harvested: false, created_at, completed_at }`. `milestone` MUST come from D-007 `phase_slugs` reverse lookup (numeric phase) — inherit from matching plan artifact if available, otherwise reverse-lookup directly.
370
+
371
+ 4. **Side-effect confirmation gate** (skip when `-y/--yes`):
372
+ Before writing to external stores, present a summary to the user via `request_user_input`:
373
+ - Issue status changes (count + IDs to resolve/update)
374
+ - Specs to extract (count + titles)
375
+ The user can approve all, selectively exclude, or skip entirely.
376
+
377
+ 4a. **Issue status sync** (approved items only): For tasks with `issue_id`, update `.workflow/issues/issues.jsonl`:
369
378
  - All task_refs completed -> `issue.status = "resolved"`; any failed -> `"in_progress"`
370
379
  - Append history entry: `{ action: "executed", at: <ISO>, by: "maestro-execute", summary: "TASK-{NNN} {status}" }`
371
380
 
372
- 4. **Register EXC artifact in state.json**: Find matching plan artifact, create `{ id: "EXC-{next_id}", type: "execute", milestone, phase, scope, path, status: "completed", depends_on: plan_artifact.id, harvested: false, created_at, completed_at }`. `milestone` MUST come from D-007 `phase_slugs` reverse lookup (numeric phase) — inherit from matching plan artifact if available, otherwise reverse-lookup directly.
373
-
374
- 5. **Extract incremental specs**: Read `.summaries/`, use `maestro spec add` CLI:
381
+ 4b. **Extract incremental specs** (approved items only): Read `.summaries/`, use `maestro spec add` CLI:
375
382
  - Learnings/pitfalls → `maestro spec add learning "<title>" "<content>" --keywords ... --description "<summary>" --source execute:{PLAN_DIR}`
376
383
  - Design rationale → `maestro spec add coding "<title>" "<content>" --keywords ... --description "<summary>"`
377
384
  - Root cause/workaround → `maestro spec add debug "<title>" "<content>" --keywords ... --description "<summary>"`
@@ -400,7 +407,7 @@ Skip Phase 2.5 when `--skip-verify` flag present or task count == 0.
400
407
 
401
408
  8. **Auto-sync** (if config.json.codebase.auto_sync_after_execute == true): detect changed files, trigger codebase doc update.
402
409
 
403
- 9. **Display completion report**: Phase, completed/blocked counts, wave progress, paths to `.summaries/` and `.task/`, next step suggestions (`quality-review`, `manage-status`).
410
+ 9. **Display completion report**: Phase, completed/blocked counts, wave progress, paths to `.summaries/` and `.task/`. **Next-step suggestion** (suggest only, NEVER auto-execute): display recommended next command (e.g., `quality-review`, `manage-status`). The user decides whether to proceed.
404
411
 
405
412
  ### Shared Discovery Board Protocol
406
413
 
@@ -435,7 +442,7 @@ echo '{"ts":"<ISO>","worker":"TASK-001","type":"code_pattern","data":{"name":"Re
435
442
  | Agent spawn fails | Retry once, then mark task as blocked with checkpoint |
436
443
  | Convergence criteria not met after 3 attempts | Mark task as blocked, write checkpoint |
437
444
  | Git commit fails (--auto-commit) | Log warning, continue (task still marked completed) |
438
- | All tasks in wave blocked | Stop execution, report blocked wave |
445
+ | All tasks in wave blocked | Stop execution, report blocked wave. Cascade-skip all tasks in subsequent waves. Proceed to Phase 3 aggregation with partial results. |
439
446
  | CSV parse error | Validate format, show line number |
440
447
  | discoveries.ndjson corrupt | Ignore malformed lines, continue |
441
448
  | Continue mode: no session found | List available sessions |
@@ -11,7 +11,7 @@ Socratic stress-testing of a plan, idea, or requirement against codebase reality
11
11
  Codex specifics:
12
12
  - **No agent spawning** — codebase exploration via `maestro explore` (preferred, fallback Glob/Grep/Read).
13
13
  - **request_user_input** replaces request_user_input for Socratic Q&A.
14
- - **CLI delegation** for auto mode: `exec_command("maestro delegate ... --role analyze --mode analysis")`.
14
+ - **CLI delegation** for auto mode: `shell_exec("maestro delegate ... --role analyze --mode analysis")`.
15
15
  </purpose>
16
16
 
17
17
  <required_reading>
@@ -70,22 +70,23 @@ Exit: When all depth-selected branches are fully walked (every question answered
70
70
  <execution>
71
71
  Follow '~/.maestro/workflows/grill.md' completely.
72
72
 
73
- **Next-step routing on completion:**
73
+ **Next-step suggestion** (suggest only, NEVER auto-execute):
74
+ Display the recommended next command based on grill outcomes. The user decides whether to proceed.
74
75
 
75
- Standard routing:
76
- - Need multi-role elaboration → `$maestro-brainstorm "{topic}" --from grill:{artifact_id}`
77
- - Need deep technical analysis `$maestro-analyze "{topic}" --from grill:{artifact_id}`
78
- - Scope is clear, ready for roadmap → `$maestro-roadmap --from grill:{artifact_id}`
79
- - Need formal spec package `$maestro-blueprint --from grill:{artifact_id}`
80
-
81
- Resume routing:
82
- - More branches to walk → `$maestro-grill "{topic}" -c`
76
+ | Condition | Suggested |
77
+ |-----------|-----------|
78
+ | Need multi-role elaboration | `$maestro-brainstorm "{topic}" --from grill:{artifact_id}` |
79
+ | Need deep technical analysis | `$maestro-analyze "{topic}" --from grill:{artifact_id}` |
80
+ | Scope is clear, ready for roadmap | `$maestro-roadmap --from grill:{artifact_id}` |
81
+ | Need formal spec package | `$maestro-blueprint --from grill:{artifact_id}` |
82
+ | More branches to walk | `$maestro-grill "{topic}" -c` |
83
83
  </execution>
84
84
 
85
85
  <invariants>
86
86
  1. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation.
87
87
  2. **Code-grounded questions required** — grill questions MUST reference specific code (file:line) when challenging the user's proposal. Generic questions without code grounding are INVALID. If codebase scan failed, flag ALL locked decisions as LOW CONFIDENCE.
88
- 3. **Artifact verification before completion** — verify grill-report.md (with Branch Log + Q&A + synthesis), terminology.md (≥5 terms), and context-package.json all exist before reporting completion. If any missing: DO NOT report completion.
88
+ 3. **Auto mode decisions are advisory** — in auto mode (`-y`), delegate-generated answers are recorded as decisions but MUST be tagged `source: "auto/delegate"` (not `source: "user"`). Downstream consumers SHOULD treat auto-sourced locked decisions with lower confidence than user-confirmed ones. The `context-package.json` MUST include `auto_mode: true` flag so downstream skills can distinguish.
89
+ 4. **Artifact verification before completion** — verify grill-report.md (with Branch Log + Q&A + synthesis), terminology.md (≥5 terms), and context-package.json all exist before reporting completion. If any missing: DO NOT report completion.
89
90
  </invariants>
90
91
 
91
92
  <error_codes>
@@ -44,7 +44,7 @@ $ARGUMENTS — 意图文本 + 可选 flags。
44
44
  3. **Skill 发现限定 codex 平台** — 通过 `maestro ralph skills --platform codex --json --quiet` 解析 `command_scope` + `command_path`(project 覆盖 global,限定 `.codex/skills/`);未命中即 E003
45
45
  4. **空 intent 或 "continue/next/go/继续/下一步/接下来"** → 直接采用 lifecycle_position 推断的自然下一步
46
46
  5. **字面命中路由表优先** — lifecycle 仅作加分;命中失败时 lifecycle 上升为决定性信号
47
- 6. **In-context invocation** — top pick 以 `$skill-name {args}` 形式在协调器上下文直接调用,**禁止** spawn_agent / spawn_agents_on_csv / exec_command 包装
47
+ 6. **In-context invocation** — top pick 以 `$skill-name {args}` 形式在协调器上下文直接调用,**禁止** spawn_agent / spawn_agents_on_csv / shell_exec 包装
48
48
  7. **参数传递** — 默认 intent 原文作为第一个 arg;用户可在 S_CONFIRM 修改;`-y` 仅当用户传入时透传到 skill args
49
49
  8. **`--list` 模式跳过 lifecycle 推断与评分**,仅按 workflow 簇分组列出全部候选
50
50
  </invariants>
@@ -234,7 +234,7 @@ brainstorm → blueprint → init → analyze-macro → roadmap
234
234
 
235
235
  ### A_INVOKE_SKILL
236
236
 
237
- 在协调器上下文以 `$skill-name {args}` 直接调用(**NO spawn_agent, NO exec_command 包装**):
237
+ 在协调器上下文以 `$skill-name {args}` 直接调用(**NO spawn_agent, NO shell_exec 包装**):
238
238
 
239
239
  1. 解析最终 args:
240
240
  - 默认:`{intent}`(原文,去除已识别的关键词如 "continue")
@@ -296,7 +296,7 @@ brainstorm → blueprint → init → analyze-macro → roadmap
296
296
  - [ ] `--dry-run` 仅展示,不执行
297
297
  - [ ] `-y` 自动执行 top pick;用户传入时透传到 skill args
298
298
  - [ ] 非自动模式通过 `request_user_input` 确认或选备选
299
- - [ ] 选定 skill 在协调器上下文以 `$skill {args}` 直调(NO spawn_agent / NO exec_command 包装)
299
+ - [ ] 选定 skill 在协调器上下文以 `$skill {args}` 直调(NO spawn_agent / NO shell_exec 包装)
300
300
  - [ ] 不创建 session / 不生成 status.json / 不调用 create_goal/update_plan / 不触发后续 chain
301
301
  - [ ] `--list` 模式按 workflow 簇分组展示,每项标 `[project|global]` scope
302
302
 
@@ -10,7 +10,7 @@ allowed-tools: Read, Write, Bash, Glob, Grep
10
10
 
11
11
  ```
12
12
  Parse Intent → Identify Targets → Draft JSON → Install + Report
13
- (or --list / (read command (apply_patch (exec_command +
13
+ (or --list / (read command (apply_patch (shell_exec +
14
14
  --remove) XML sections) to overlays/) banner)
15
15
  ```
16
16
 
@@ -90,7 +90,9 @@ Write resolved milestone into PLN artifact registration and `plan.json.milestone
90
90
 
91
91
  **Pre-load** (optional): context-package.json (via `--from`, takes precedence), context.md (prior analyze), conclusions.json, codebase ARCHITECTURE.md, `maestro search`, `maestro load --type spec --category arch`, team preflight `maestro collab preflight`.
92
92
 
93
- **D-008 Ad-hoc Milestone Auto-Creation**: When scope resolves to `standalone` via standard resolution (routes 6 or 7, NOT via `--from`), and `state.json.current_milestone == null`, auto-create an adhoc milestone:
93
+ **D-008 Ad-hoc Milestone Auto-Creation**: When scope resolves to `standalone` via standard resolution (routes 6 or 7, NOT via `--from`), and `state.json.current_milestone == null`:
94
+ - **Interactive mode**: prompt user via `request_user_input` — "No active milestone. Create ad-hoc milestone `ADH-{YYYYMMDD}-{slug}`?" with options: Create (Recommended) / Abort / Specify milestone name. Only write to state.json after user confirms.
95
+ - **Auto mode (`-y`)**: auto-create with log notification.
94
96
  ```
95
97
  milestone_id = "ADH-{YYYYMMDD}-{slug}"
96
98
  state.json.milestones.push({ id: milestone_id, name: "{intent slug}", type: "adhoc", status: "active", phase_slugs: [] })
@@ -114,10 +116,10 @@ Wave 1: N exploration rows (parallel). Wave 2: 1 planning row (sequential).
114
116
  1. **Wave order sacred**: Explorations (W1) before planning (W2)
115
117
  2. **CSV source of truth**: Master tasks.csv holds all state
116
118
  3. **Discovery board append-only**: Never modify/delete
117
- 4. **Skip on failure**: If all explorations fail, planner proceeds with available context
118
- 5. **DO NOT STOP**: Continuous until all waves complete
119
- 6. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation.
120
- 7. **Verifiable convergence criteria required** — every task MUST have convergence.criteria[] with grep-verifiable conditions (no subjective language like "well-structured" or "properly implemented"). If any task lacks verifiable criteria: DO NOT report completion — fix the criteria first.
119
+ 4. **Skip on failure**: If all explorations fail, planner proceeds with available context but ALL generated tasks inherit LOW CONFIDENCE flag. Record `degradation_event` in discoveries.ndjson. This is a defined degradation path, not an invariant violation.
120
+ 5. **Pipeline continuity**: Continuous until all waves complete. When invariant 4 (skip on failure) activates, the pipeline continues in degraded mode — this is NOT a violation of invariant 6.
121
+ 6. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Defined degradation paths (invariant 4) are not violations.
122
+ 7. **Verifiable convergence criteria required** — every task MUST have convergence.criteria[] with grep-verifiable conditions (no subjective language like "well-structured" or "properly implemented"). If any task lacks verifiable criteria: DO NOT report completion — fix the criteria first. **Degradation exception**: when invariant 4 is active (exploration failed), criteria that would normally reference exploration findings MAY use available context instead, but MUST be flagged LOW CONFIDENCE.
121
123
  8. **Artifact verification before completion** — plan.json and .task/TASK-*.json files MUST exist. PLN artifact MUST be registered in state.json. If any missing: DO NOT report completion.
122
124
  </invariants>
123
125
 
@@ -138,18 +140,21 @@ S_REGISTER — 注册 PLN artifact、更新 index.json PERSIST: sta
138
140
  <transitions>
139
141
  S_PARSE → S_RESUME WHEN: --continue
140
142
  S_PARSE → S_CONTEXT WHEN: phase/dir/--from resolved (D-007 reverse lookup for numeric)
141
- S_PARSE → S_CONTEXT WHEN: no args + no roadmap AND latest analyze artifact found in state.json (scope=standalone)
143
+ S_PARSE → S_CONTEXT WHEN: no args + no roadmap AND latest analyze artifact found in state.json (scope=standalone). Interactive mode: confirm the auto-discovered artifact with user ("Using analyze artifact ANL-xxx from {date}. Proceed?"). -y mode: auto-proceed with log.
142
144
  S_PARSE → ERROR WHEN: no args + no roadmap + no analyze artifact
143
145
 
144
146
  S_RESUME → S_WAVE_1 WHEN: W1 incomplete DO: load session, resume
145
147
  S_RESUME → S_WAVE_2 WHEN: W1 done, W2 pending
146
148
  S_RESUME → S_CHECK WHEN: W2 done, check pending
149
+ S_RESUME → ERROR WHEN: session file corrupted/missing or CSV parse failure
147
150
 
148
151
  S_CONTEXT → S_CSV_GEN DO: if --from: resolve context-package.json (precedence over context.md); load context.md, conclusions.json, specs, wiki, codebase docs
149
152
 
150
153
  S_CSV_GEN → S_WAVE_1 DO: pre-flight (`maestro collab preflight --phase N`; exit 1 → warn + ask), determine exploration angles, generate tasks.csv, user validates (skip -y)
151
154
 
152
- S_WAVE_1 → S_WAVE_2 DO: spawn parallel explorations, merge results, build prev_context
155
+ S_WAVE_1 → S_WAVE_2 WHEN: 1+ completed DO: spawn parallel explorations, merge results, build prev_context. For failed exploration tasks: exclude from prev_context and append gap_note to W2 planning instruction listing missing angles.
156
+ S_WAVE_1 → S_WAVE_1 WHEN: all failed, retry available DO: retry once
157
+ S_WAVE_1 → S_WAVE_2 WHEN: all failed, retry exhausted DO: proceed with available context only, flag LOW CONFIDENCE (invariant 4 degradation)
153
158
 
154
159
  S_WAVE_2 → S_CHECK DO: spawn planning agent, merge results
155
160
 
@@ -242,10 +247,14 @@ Confidence: 5-dimension factor model + readiness gate.
242
247
  Collision detection against same-milestone plans.
243
248
 
244
249
  ### A_REGISTER
250
+
251
+ **Note**: S_CONFIRM already gates user confirmation (or -y skip). The writes below execute only after S_CONFIRM passes.
252
+
245
253
  1. Register PLN artifact in state.json (scope, milestone, phase, depends_on)
246
254
  2. Update index.json with plan metadata
247
255
  3. If --gaps: link TASK files back to issues bidirectionally (task_refs[], task_plan_dir in issues.jsonl)
248
- 4. Display: phase, task count, wave count, check status, confidence, next steps
256
+ 4. Display: phase, task count, wave count, check status, confidence
257
+ 5. **Next-step suggestion** (suggest only, NEVER auto-execute): display recommended next command (e.g., `maestro-execute {phase}`). The user decides whether to proceed.
249
258
 
250
259
  </actions>
251
260
  </state_machine>
@@ -20,6 +20,8 @@ Reads project state → infers position → builds adaptive chain → delegates
20
20
 
21
21
  > 推进规则:**step 推进由 `$maestro-ralph-execute` 负责**;ralph 仅在 build / decision 评估时介入。decision 节点由 ralph-execute 自动 `$maestro-ralph` 直调 handoff,无需用户手动切换。
22
22
 
23
+ > **CLI vs Skill 边界**:`maestro` 作为 CLI 二进制只有结构化子命令(`ralph`、`delegate`、`explore` 等),不接受裸 intent。`Bash("maestro \"some intent\"")` 会报错退出。创建 session 和路由 intent 必须通过 `$maestro-ralph` 或 `$maestro` skill 调用。CLI 层仅用于 step 加载(`ralph next`)和完成标记(`ralph complete`)。
24
+
23
25
  Initial decomposition (S_DECOMPOSE): boundary-clarified via ≤3 questions for broad intents (重构/全面/迁移/重写). 写入 status.json 的 `boundary_contract` / `execution_criteria` / `task_decomposition`,附 `/goal` prompt。
24
26
 
25
27
  Step kinds:
@@ -85,6 +87,7 @@ Remaining → intent (amend_mode 时为 change_request)
85
87
  12. **Platform** — `session.platform = "codex"`;CLI 调用一律带 `--platform codex`
86
88
  13. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Do NOT bypass for "efficiency" or "clear intent" reasons. Especially invariants about ralph never executing steps and completion_confirmed by CLI.
87
89
  14. **Delegate fallback must be marked** — when A_DELEGATE_EVALUATE verdict parse fails and falls back to "fix", MUST record `parse_failed: true, confidence_score: 0` in decisions.ndjson. Subsequent steps inherit LOW CONFIDENCE flag.
90
+ 15. **CLI ≠ Skill** — `maestro` CLI binary 只提供结构化子命令(`ralph next|complete|skills|check|session`、`delegate`、`explore`、`search` 等),**不接受裸 intent**。Session 创建、intent 路由、decision 评估均为 skill 层操作:`$maestro-ralph "intent"` 或 `$maestro "intent"`。**严禁** `Bash("maestro \"intent text\"")` — CLI 会报错退出。
88
91
  </invariants>
89
92
 
90
93
  <state_machine>
@@ -48,6 +48,7 @@ HARD RULES:
48
48
  7. **status.json 每步骤后由 CLI 原子写盘** — resume-safe
49
49
  8. **STATUS 枚举受限** — 仅 `DONE | DONE_WITH_CONCERNS | NEEDS_RETRY | BLOCKED`
50
50
  9. **Platform binding** — 仅处理 `session.platform == "codex"` 的会话;platform 缺失视为 codex(向前兼容)
51
+ 10. **CLI ≠ Skill** — `maestro ralph next|complete|retry` 是 CLI 子命令(Bash 调用);`$maestro-ralph` / `$maestro-ralph-execute` 是 skill 直调。**严禁** `Bash("maestro \"intent\"")` 裸 intent 调用,CLI 不接受。
51
52
  </invariants>
52
53
 
53
54
  <state_machine>