maestro-flow 0.5.34 → 0.5.36

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 (325) hide show
  1. package/.agents/agents/cli-explore-agent.md +71 -68
  2. package/.agents/agents/workflow-analyzer.md +1 -0
  3. package/.agents/agents/workflow-collab-planner.md +1 -0
  4. package/.agents/agents/workflow-debugger.md +1 -0
  5. package/.agents/agents/workflow-executor.md +1 -0
  6. package/.agents/agents/workflow-planner.md +2 -0
  7. package/.agents/skills/domain-add/SKILL.md +71 -0
  8. package/.agents/skills/maestro/SKILL.md +7 -6
  9. package/.agents/skills/maestro-amend/SKILL.md +0 -2
  10. package/.agents/skills/maestro-analyze/SKILL.md +9 -0
  11. package/.agents/skills/maestro-brainstorm/SKILL.md +10 -1
  12. package/.agents/skills/maestro-collab/SKILL.md +14 -1
  13. package/.agents/skills/maestro-help/SKILL.md +1 -1
  14. package/.agents/skills/maestro-help/index/catalog.json +0 -1
  15. package/.agents/skills/maestro-help/phases/01-parse-intent.md +1 -1
  16. package/.agents/skills/maestro-next/SKILL.md +15 -4
  17. package/.agents/skills/maestro-overlay/SKILL.md +4 -3
  18. package/.agents/skills/maestro-plan/SKILL.md +15 -4
  19. package/.agents/skills/maestro-ralph/SKILL.md +135 -31
  20. package/.agents/skills/maestro-ralph-execute/SKILL.md +51 -10
  21. package/.agents/skills/maestro-tools-register/SKILL.md +0 -6
  22. package/.agents/skills/maestro-ui-codify/SKILL.md +0 -2
  23. package/.agents/skills/manage-kg-extractors/SKILL.md +0 -2
  24. package/.agents/skills/quality-test/SKILL.md +25 -1
  25. package/.agents/skills/spec-load/SKILL.md +0 -1
  26. package/.agents/skills/spec-setup/SKILL.md +0 -1
  27. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +13 -7
  28. package/.agents/skills/team-quality-assurance/roles/scout/role.md +15 -11
  29. package/.agents/skills/team-tech-debt/roles/scanner/role.md +1 -1
  30. package/.agents/skills/team-ultra-analyze/roles/explorer/role.md +23 -16
  31. package/.agy/agents/cli-explore-agent.md +71 -68
  32. package/.agy/agents/workflow-analyzer.md +1 -0
  33. package/.agy/agents/workflow-collab-planner.md +1 -0
  34. package/.agy/agents/workflow-debugger.md +1 -0
  35. package/.agy/agents/workflow-executor.md +1 -0
  36. package/.agy/agents/workflow-planner.md +2 -0
  37. package/.agy/skills/domain-add/SKILL.md +68 -0
  38. package/.agy/skills/maestro/SKILL.md +7 -6
  39. package/.agy/skills/maestro-amend/SKILL.md +0 -2
  40. package/.agy/skills/maestro-analyze/SKILL.md +9 -0
  41. package/.agy/skills/maestro-brainstorm/SKILL.md +10 -1
  42. package/.agy/skills/maestro-collab/SKILL.md +14 -1
  43. package/.agy/skills/maestro-help/SKILL.md +1 -1
  44. package/.agy/skills/maestro-help/index/catalog.json +0 -1
  45. package/.agy/skills/maestro-help/phases/01-parse-intent.md +1 -1
  46. package/.agy/skills/maestro-next/SKILL.md +15 -4
  47. package/.agy/skills/maestro-overlay/SKILL.md +4 -3
  48. package/.agy/skills/maestro-plan/SKILL.md +15 -4
  49. package/.agy/skills/maestro-ralph/SKILL.md +135 -31
  50. package/.agy/skills/maestro-ralph-execute/SKILL.md +51 -10
  51. package/.agy/skills/maestro-tools-register/SKILL.md +0 -6
  52. package/.agy/skills/maestro-ui-codify/SKILL.md +0 -2
  53. package/.agy/skills/manage-kg-extractors/SKILL.md +0 -2
  54. package/.agy/skills/quality-test/SKILL.md +25 -1
  55. package/.agy/skills/spec-load/SKILL.md +0 -1
  56. package/.agy/skills/spec-setup/SKILL.md +0 -1
  57. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +13 -7
  58. package/.agy/skills/team-quality-assurance/roles/scout/role.md +15 -11
  59. package/.agy/skills/team-tech-debt/roles/scanner/role.md +1 -1
  60. package/.agy/skills/team-ultra-analyze/roles/explorer/role.md +23 -16
  61. package/.claude/agents/cli-explore-agent.md +71 -68
  62. package/.claude/agents/workflow-analyzer.md +1 -0
  63. package/.claude/agents/workflow-collab-planner.md +1 -0
  64. package/.claude/agents/workflow-debugger.md +1 -0
  65. package/.claude/agents/workflow-executor.md +1 -0
  66. package/.claude/agents/workflow-planner.md +2 -0
  67. package/.claude/commands/domain-add.md +69 -0
  68. package/.claude/commands/maestro-amend.md +0 -2
  69. package/.claude/commands/maestro-analyze.md +9 -0
  70. package/.claude/commands/maestro-brainstorm.md +10 -1
  71. package/.claude/commands/maestro-collab.md +14 -1
  72. package/.claude/commands/maestro-next.md +15 -4
  73. package/.claude/commands/maestro-overlay.md +4 -3
  74. package/.claude/commands/maestro-plan.md +15 -4
  75. package/.claude/commands/maestro-ralph-execute.md +51 -10
  76. package/.claude/commands/maestro-ralph.md +135 -31
  77. package/.claude/commands/maestro-tools-register.md +0 -6
  78. package/.claude/commands/maestro-ui-codify.md +0 -2
  79. package/.claude/commands/maestro.md +7 -6
  80. package/.claude/commands/manage-kg-extractors.md +0 -2
  81. package/.claude/commands/quality-test.md +25 -1
  82. package/.claude/commands/spec-load.md +0 -1
  83. package/.claude/commands/spec-setup.md +0 -1
  84. package/.claude/skills/maestro-help/SKILL.md +1 -1
  85. package/.claude/skills/maestro-help/index/catalog.json +0 -1
  86. package/.claude/skills/maestro-help/phases/01-parse-intent.md +1 -1
  87. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +13 -7
  88. package/.claude/skills/team-quality-assurance/roles/scout/role.md +15 -11
  89. package/.claude/skills/team-tech-debt/roles/scanner/role.md +1 -1
  90. package/.claude/skills/team-ultra-analyze/roles/explorer/role.md +23 -16
  91. package/.codex/skills/domain-add/SKILL.md +79 -0
  92. package/.codex/skills/domain-discover/SKILL.md +43 -0
  93. package/.codex/skills/domain-list/SKILL.md +38 -0
  94. package/.codex/skills/learn-follow/SKILL.md +0 -3
  95. package/.codex/skills/learn-investigate/SKILL.md +0 -3
  96. package/.codex/skills/learn-retro/SKILL.md +0 -2
  97. package/.codex/skills/maestro/SKILL.md +34 -13
  98. package/.codex/skills/maestro-amend/SKILL.md +0 -2
  99. package/.codex/skills/maestro-analyze/SKILL.md +36 -6
  100. package/.codex/skills/maestro-blueprint/SKILL.md +0 -4
  101. package/.codex/skills/maestro-brainstorm/SKILL.md +46 -6
  102. package/.codex/skills/maestro-collab/SKILL.md +14 -1
  103. package/.codex/skills/maestro-companion/SKILL.md +0 -2
  104. package/.codex/skills/maestro-execute/SKILL.md +25 -3
  105. package/.codex/skills/maestro-fork/SKILL.md +0 -2
  106. package/.codex/skills/maestro-grill/SKILL.md +9 -1
  107. package/.codex/skills/maestro-next/SKILL.md +12 -5
  108. package/.codex/skills/maestro-plan/SKILL.md +43 -5
  109. package/.codex/skills/maestro-ralph/SKILL.md +10 -3
  110. package/.codex/skills/maestro-ralph-execute/SKILL.md +51 -10
  111. package/.codex/skills/maestro-roadmap/SKILL.md +30 -3
  112. package/.codex/skills/manage-wiki/SKILL.md +0 -2
  113. package/.codex/skills/odyssey-debug/SKILL.md +0 -2
  114. package/.codex/skills/odyssey-improve/SKILL.md +0 -6
  115. package/.codex/skills/odyssey-review-test-fix/SKILL.md +0 -3
  116. package/.codex/skills/odyssey-ui/SKILL.md +0 -3
  117. package/.codex/skills/quality-review/SKILL.md +9 -0
  118. package/.codex/skills/spec-setup/SKILL.md +0 -2
  119. package/.codex/skills/team-coordinate/SKILL.md +0 -3
  120. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +0 -2
  121. package/README.md +28 -5
  122. package/README.zh-CN.md +28 -5
  123. package/chains/_intent-map.json +36 -0
  124. package/chains/blueprint-driven.json +49 -0
  125. package/chains/grill-driven.json +51 -0
  126. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js +4 -0
  127. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js.map +1 -1
  128. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.d.ts +6 -0
  129. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js +36 -0
  130. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js.map +1 -0
  131. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.d.ts +1 -1
  132. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
  133. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.d.ts +82 -0
  134. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +444 -0
  135. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -0
  136. package/dashboard/dist-server/dashboard/src/server/wiki/search.d.ts +47 -1
  137. package/dashboard/dist-server/dashboard/src/server/wiki/search.js +426 -19
  138. package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
  139. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +16 -0
  140. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
  141. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +11 -0
  142. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +492 -1
  143. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  144. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +18 -0
  145. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +192 -9
  146. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  147. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.test.js +42 -0
  148. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.test.js.map +1 -1
  149. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
  150. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  151. package/dashboard/dist-server/shared/agent-types.d.ts +1 -1
  152. package/dashboard/dist-server/src/commands/hooks.d.ts +3 -0
  153. package/dashboard/dist-server/src/commands/hooks.js +60 -9
  154. package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
  155. package/dashboard/dist-server/src/graph/kg/extraction/code/code-extractor.js +1 -1
  156. package/dashboard/dist-server/src/graph/kg/extraction/code/code-extractor.js.map +1 -1
  157. package/dashboard/dist-server/src/graph/kg/extraction/knowledge/domain-extractor.js +4 -2
  158. package/dashboard/dist-server/src/graph/kg/extraction/knowledge/domain-extractor.js.map +1 -1
  159. package/dashboard/dist-server/src/graph/kg/extraction/knowledge-extractor-registry.js +6 -1
  160. package/dashboard/dist-server/src/graph/kg/extraction/knowledge-extractor-registry.js.map +1 -1
  161. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +2 -6
  162. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  163. package/dashboard/dist-server/src/hooks/session-context.js +37 -1
  164. package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
  165. package/dashboard/dist-server/src/search/daemon.d.ts +42 -0
  166. package/dashboard/dist-server/src/search/daemon.js +180 -0
  167. package/dashboard/dist-server/src/search/daemon.js.map +1 -0
  168. package/dashboard/dist-server/src/tools/domain-loader.d.ts +4 -1
  169. package/dashboard/dist-server/src/tools/domain-loader.js +56 -25
  170. package/dashboard/dist-server/src/tools/domain-loader.js.map +1 -1
  171. package/dashboard/dist-server/src/tools/domain-schema.d.ts +1 -1
  172. package/dashboard/dist-server/src/tools/domain-schema.js +1 -1
  173. package/dist/shared/agent-types.d.ts +1 -1
  174. package/dist/shared/agent-types.d.ts.map +1 -1
  175. package/dist/src/agents/api-explore/agent-loop.d.ts +14 -0
  176. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -0
  177. package/dist/src/agents/api-explore/agent-loop.js +86 -0
  178. package/dist/src/agents/api-explore/agent-loop.js.map +1 -0
  179. package/dist/src/agents/api-explore/config.d.ts +42 -0
  180. package/dist/src/agents/api-explore/config.d.ts.map +1 -0
  181. package/dist/src/agents/api-explore/config.js +99 -0
  182. package/dist/src/agents/api-explore/config.js.map +1 -0
  183. package/dist/src/agents/api-explore/index.d.ts +2 -0
  184. package/dist/src/agents/api-explore/index.d.ts.map +1 -0
  185. package/dist/src/agents/api-explore/index.js +102 -0
  186. package/dist/src/agents/api-explore/index.js.map +1 -0
  187. package/dist/src/agents/api-explore/llm.d.ts +28 -0
  188. package/dist/src/agents/api-explore/llm.d.ts.map +1 -0
  189. package/dist/src/agents/api-explore/llm.js +48 -0
  190. package/dist/src/agents/api-explore/llm.js.map +1 -0
  191. package/dist/src/agents/api-explore/prompt-parser.d.ts +23 -0
  192. package/dist/src/agents/api-explore/prompt-parser.d.ts.map +1 -0
  193. package/dist/src/agents/api-explore/prompt-parser.js +73 -0
  194. package/dist/src/agents/api-explore/prompt-parser.js.map +1 -0
  195. package/dist/src/agents/api-explore/runner.d.ts +65 -0
  196. package/dist/src/agents/api-explore/runner.d.ts.map +1 -0
  197. package/dist/src/agents/api-explore/runner.js +196 -0
  198. package/dist/src/agents/api-explore/runner.js.map +1 -0
  199. package/dist/src/agents/api-explore/session.d.ts +23 -0
  200. package/dist/src/agents/api-explore/session.d.ts.map +1 -0
  201. package/dist/src/agents/api-explore/session.js +57 -0
  202. package/dist/src/agents/api-explore/session.js.map +1 -0
  203. package/dist/src/agents/api-explore/stream-json-emitter.d.ts +10 -0
  204. package/dist/src/agents/api-explore/stream-json-emitter.d.ts.map +1 -0
  205. package/dist/src/agents/api-explore/stream-json-emitter.js +19 -0
  206. package/dist/src/agents/api-explore/stream-json-emitter.js.map +1 -0
  207. package/dist/src/agents/api-explore/system-prompt.d.ts +2 -0
  208. package/dist/src/agents/api-explore/system-prompt.d.ts.map +1 -0
  209. package/dist/src/agents/api-explore/system-prompt.js +31 -0
  210. package/dist/src/agents/api-explore/system-prompt.js.map +1 -0
  211. package/dist/src/agents/api-explore/tools.d.ts +11 -0
  212. package/dist/src/agents/api-explore/tools.d.ts.map +1 -0
  213. package/dist/src/agents/api-explore/tools.js +168 -0
  214. package/dist/src/agents/api-explore/tools.js.map +1 -0
  215. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  216. package/dist/src/agents/cli-agent-runner.js +3 -0
  217. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  218. package/dist/src/cli.js +4 -0
  219. package/dist/src/cli.js.map +1 -1
  220. package/dist/src/commands/domain.d.ts.map +1 -1
  221. package/dist/src/commands/domain.js +5 -4
  222. package/dist/src/commands/domain.js.map +1 -1
  223. package/dist/src/commands/explore.d.ts +7 -0
  224. package/dist/src/commands/explore.d.ts.map +1 -0
  225. package/dist/src/commands/explore.js +201 -0
  226. package/dist/src/commands/explore.js.map +1 -0
  227. package/dist/src/commands/hooks.d.ts +3 -0
  228. package/dist/src/commands/hooks.d.ts.map +1 -1
  229. package/dist/src/commands/hooks.js +60 -9
  230. package/dist/src/commands/hooks.js.map +1 -1
  231. package/dist/src/commands/install.d.ts.map +1 -1
  232. package/dist/src/commands/install.js +42 -9
  233. package/dist/src/commands/install.js.map +1 -1
  234. package/dist/src/commands/search.d.ts +26 -4
  235. package/dist/src/commands/search.d.ts.map +1 -1
  236. package/dist/src/commands/search.js +359 -93
  237. package/dist/src/commands/search.js.map +1 -1
  238. package/dist/src/commands/update.d.ts.map +1 -1
  239. package/dist/src/commands/update.js +37 -21
  240. package/dist/src/commands/update.js.map +1 -1
  241. package/dist/src/commands/workspace.d.ts.map +1 -1
  242. package/dist/src/commands/workspace.js +9 -3
  243. package/dist/src/commands/workspace.js.map +1 -1
  244. package/dist/src/config/cli-tools-defaults.json +2 -1
  245. package/dist/src/core/install-executor.d.ts.map +1 -1
  246. package/dist/src/core/install-executor.js +6 -3
  247. package/dist/src/core/install-executor.js.map +1 -1
  248. package/dist/src/graph/kg/extraction/code/code-extractor.js +1 -1
  249. package/dist/src/graph/kg/extraction/code/code-extractor.js.map +1 -1
  250. package/dist/src/graph/kg/extraction/knowledge/domain-extractor.d.ts.map +1 -1
  251. package/dist/src/graph/kg/extraction/knowledge/domain-extractor.js +4 -2
  252. package/dist/src/graph/kg/extraction/knowledge/domain-extractor.js.map +1 -1
  253. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.d.ts.map +1 -1
  254. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.js +6 -1
  255. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.js.map +1 -1
  256. package/dist/src/graph/kg/extraction/orchestrator.d.ts.map +1 -1
  257. package/dist/src/graph/kg/extraction/orchestrator.js +2 -6
  258. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  259. package/dist/src/graph/kg/surface/cli.d.ts.map +1 -1
  260. package/dist/src/graph/kg/surface/cli.js +5 -2
  261. package/dist/src/graph/kg/surface/cli.js.map +1 -1
  262. package/dist/src/hooks/session-context.d.ts.map +1 -1
  263. package/dist/src/hooks/session-context.js +37 -1
  264. package/dist/src/hooks/session-context.js.map +1 -1
  265. package/dist/src/ralph/cmd-next.d.ts.map +1 -1
  266. package/dist/src/ralph/cmd-next.js +66 -4
  267. package/dist/src/ralph/cmd-next.js.map +1 -1
  268. package/dist/src/ralph/status-schema.d.ts +1 -0
  269. package/dist/src/ralph/status-schema.d.ts.map +1 -1
  270. package/dist/src/search/daemon.d.ts +43 -0
  271. package/dist/src/search/daemon.d.ts.map +1 -0
  272. package/dist/src/search/daemon.js +180 -0
  273. package/dist/src/search/daemon.js.map +1 -0
  274. package/dist/src/tools/__tests__/domain-search-debug.js +3 -1
  275. package/dist/src/tools/__tests__/domain-search-debug.js.map +1 -1
  276. package/dist/src/tools/domain-loader.d.ts +4 -1
  277. package/dist/src/tools/domain-loader.d.ts.map +1 -1
  278. package/dist/src/tools/domain-loader.js +56 -25
  279. package/dist/src/tools/domain-loader.js.map +1 -1
  280. package/dist/src/tools/domain-schema.d.ts +1 -1
  281. package/dist/src/tools/domain-schema.js +1 -1
  282. package/dist/src/utils/update-notices.js +12 -0
  283. package/dist/src/utils/update-notices.js.map +1 -1
  284. package/package.json +5 -1
  285. package/shared/agent-types.ts +1 -1
  286. package/templates/search-tools.md +22 -6
  287. package/workflows/agy-instructions.md +0 -4
  288. package/workflows/analyze.md +2 -2
  289. package/workflows/boundary-grill.md +50 -0
  290. package/workflows/brainstorm.md +6 -5
  291. package/workflows/claude-instructions.md +29 -2
  292. package/workflows/codebase-rebuild.md +0 -1
  293. package/workflows/codex-instructions.md +97 -14
  294. package/workflows/command-authoring.md +1 -1
  295. package/workflows/debug.md +0 -4
  296. package/workflows/domain-add.md +115 -0
  297. package/workflows/execute.md +7 -0
  298. package/workflows/explore-usage.md +128 -0
  299. package/workflows/finish-work.md +2 -6
  300. package/workflows/fork.md +0 -4
  301. package/workflows/grill.md +14 -1
  302. package/workflows/harvest.md +0 -3
  303. package/workflows/impeccable/audit.md +0 -2
  304. package/workflows/impeccable/codex.md +0 -4
  305. package/workflows/init.md +9 -0
  306. package/workflows/interview-mechanics.md +3 -2
  307. package/workflows/issue-analyze.md +0 -5
  308. package/workflows/issue-gaps-analyze.codex.md +0 -6
  309. package/workflows/knowledge-audit.md +0 -4
  310. package/workflows/learn.md +0 -6
  311. package/workflows/maestro.codex.md +0 -4
  312. package/workflows/maestro.md +31 -18
  313. package/workflows/merge.md +0 -4
  314. package/workflows/milestone-complete.md +0 -4
  315. package/workflows/overlays.md +0 -10
  316. package/workflows/plan.md +2 -3
  317. package/workflows/roadmap-common.md +0 -4
  318. package/workflows/tdd.md +0 -2
  319. package/workflows/tools-spec.md +1 -7
  320. package/workflows/ui-codify-extract.md +0 -2
  321. package/workflows/ui-codify-package.md +0 -2
  322. package/.agents/skills/maestro-ralph-beta/SKILL.md +0 -882
  323. package/.agy/skills/maestro-ralph-beta/SKILL.md +0 -878
  324. package/.claude/commands/maestro-ralph-beta.md +0 -880
  325. package/.codex/skills/maestro-ralph-beta/SKILL.md +0 -883
@@ -75,7 +75,12 @@ S_COLLECT:
75
75
  GUARD: 1+ succeeded → continue with partial results (W001)
76
76
 
77
77
  S_CROSS_VERIFY:
78
- S_SYNTHESIZE DO: A_CLASSIFY_FINDINGS
78
+ S_BOUNDARY_GRILL DO: A_CLASSIFY_FINDINGS
79
+
80
+ S_BOUNDARY_GRILL:
81
+ → S_SYNTHESIZE WHEN: no boundary conflicts detected DO: —
82
+ → S_SYNTHESIZE WHEN: conflicts detected + resolved DO: A_BOUNDARY_GRILL
83
+ GUARD: max 3 conflicts × 3 questions; non-blocking
79
84
 
80
85
  S_SYNTHESIZE:
81
86
  → S_REGISTER DO: A_GENERATE_OUTPUTS
@@ -136,6 +141,12 @@ Read all per-tool outputs. For each finding:
136
141
  consensus_level = consensus_count / total_findings * 100.
137
142
  If consensus_level < 40%: W003.
138
143
 
144
+ ### A_BOUNDARY_GRILL
145
+
146
+ Run boundary grill per `~/.maestro/workflows/boundary-grill.md`.
147
+ Input: classified CONFLICT findings + per-tool outputs. Check upstream scope if `--from` used.
148
+ IF conflicts → tag with resolution, feed into A_GENERATE_OUTPUTS. No conflicts → pass through.
149
+
139
150
  ### A_GENERATE_OUTPUTS
140
151
 
141
152
  Resolve conflicts via evidence-weighted voting:
@@ -162,6 +173,8 @@ Write 3 files:
162
173
  <success_criteria>
163
174
  - [ ] All delegates launched in parallel via run_command(run_in_background: true), STOP after launch
164
175
  - [ ] Cross-verification: consensus/conflict/unique classification with consensus_level
176
+ - [ ] Boundary grill executed on CONFLICT items (skip if no boundary conflicts detected)
177
+ - [ ] Boundary grill results written to collab-report.md § Boundary Grill Results (if conflicts found)
165
178
  - [ ] 3 output files produced (collab-report.md, context.md, conclusions.json)
166
179
  - [ ] CLB artifact registered in state.json
167
180
  - [ ] Partial degradation: continued if 1+ tools succeeded
@@ -272,7 +272,7 @@ Odyssey 长周期循环(独立路径)
272
272
  odyssey-debug / odyssey-improve / odyssey-review-test-fix / odyssey-planex / odyssey-ui
273
273
 
274
274
  自适应引擎(高级)
275
- ralph / ralph-beta → 自运行决策循环
275
+ ralph → 自运行决策循环
276
276
  swarm-workflow / universal-workflow → 多 agent 并行执行
277
277
  ```
278
278
 
@@ -68,7 +68,6 @@
68
68
 
69
69
  {"name": "maestro-ralph", "command": "/maestro-ralph", "category": "ralph", "description": "Ralph 引擎 — 自适应生命周期决策节点管理", "source": "../../commands/maestro-ralph.md"},
70
70
  {"name": "maestro-ralph-execute", "command": "/maestro-ralph-execute", "category": "ralph", "description": "Ralph 执行 — 运行自适应决策链", "source": "../../commands/maestro-ralph-execute.md"},
71
- {"name": "maestro-ralph-beta", "command": "/maestro-ralph-beta", "category": "ralph", "description": "Ralph Beta — 自运行循环控制器,单 skill 完成 build/tick/decide", "source": "../../commands/maestro-ralph-beta.md"},
72
71
 
73
72
  {"name": "maestro-impeccable", "command": "/maestro-impeccable", "category": "ui", "description": "UI 生产 — 设计系统生成 + impeccable 链式编排 + 质量门控", "source": "../../commands/maestro-impeccable.md"},
74
73
  {"name": "maestro-ui-codify", "command": "/maestro-ui-codify", "category": "ui", "description": "UI 固化 — 将设计产出转化为知识资产", "source": "../../commands/maestro-ui-codify.md"},
@@ -61,7 +61,7 @@ const knownCommands = [
61
61
  "maestro", "analyze", "plan", "execute", "init", "roadmap",
62
62
  "brainstorm", "blueprint", "quick", "overlay", "amend", "fork", "merge", "collab",
63
63
  "milestone-audit", "milestone-complete", "milestone-release",
64
- "composer", "guard", "player", "ralph", "ralph-execute", "ralph-beta",
64
+ "composer", "guard", "player", "ralph", "ralph-execute",
65
65
  "grill", "next", "swarm-workflow", "universal-workflow", "companion",
66
66
  "impeccable", "ui-codify", "update",
67
67
  "tools-register", "tools-execute",
@@ -90,9 +90,9 @@ S_FALLBACK:
90
90
  读 project state 推断 `lifecycle_position`(核心信号):
91
91
 
92
92
  ```bash
93
- cat .workflow/state.json 2>$null # phase / milestone / artifacts
94
- ls -la .workflow/scratch/ 2>$null | head -10 # 最近 artifact (mtime DESC)
95
- ls -la .workflow/.maestro/ 2>$null | head -5 # 进行中的 session
93
+ cat .workflow/state.json 2>/dev/null # phase / milestone / artifacts
94
+ ls -la .workflow/scratch/ 2>/dev/null | head -10 # 最近 artifact (mtime DESC)
95
+ ls -la .workflow/.maestro/ 2>/dev/null | head -5 # 进行中的 session
96
96
  ```
97
97
 
98
98
  **项目状态 → lifecycle_position → 自然下一步:**
@@ -108,7 +108,8 @@ ls -la .workflow/.maestro/ 2>$null | head -5 # 进行中的 session
108
108
  | 最新 artifact = plan | execute | `maestro-execute {phase}` |
109
109
  | 最新 artifact = execute | review | `quality-review {phase}` |
110
110
  | review verdict=PASS | test-gen | `quality-auto-test {phase}` |
111
- | 测试全绿 | milestone-audit | `maestro-milestone-audit` |
111
+ | 测试全绿 + current_milestone 存在 | milestone-audit | `maestro-milestone-audit` |
112
+ | 测试全绿 + current_milestone=null (standalone) | review-done | 回退到 `quality-review` 或 `manage-status`(无 milestone 上下文时不推荐 milestone 命令) |
112
113
  | 当前 milestone 全 phase 完成 | milestone-complete | `maestro-milestone-complete` |
113
114
  | 任一 stage 产物含 gaps/failed | debug | `quality-debug {gap}` |
114
115
 
@@ -131,6 +132,16 @@ brainstorm → blueprint → init → analyze-macro → roadmap
131
132
  | `name` 关键词命中 intent | 中 | intent 含 "test" → quality-test/quality-auto-test 加分 |
132
133
  | Workflow 簇匹配 | 中 | intent 涉及学习/知识/issue 等场景触发对应簇 |
133
134
  | Recent activity 反向避免 | 低 | 刚完成的 stage 短期内降权 |
135
+ | **前置条件不满足** | **禁止** | 候选命令的前置条件未满足时,直接从候选池移除(如 `maestro-milestone-*` 在 `current_milestone=null` 时移除) |
136
+
137
+ **前置条件检查(评分前执行,不满足则移除候选):**
138
+
139
+ | 命令 | 前置条件 |
140
+ |------|---------|
141
+ | `maestro-milestone-audit` | `current_milestone` 存在且非 null |
142
+ | `maestro-milestone-complete` | `current_milestone` 存在且非 null |
143
+ | `maestro-milestone-release` | `current_milestone` 存在且非 null |
144
+ | `maestro-merge` | 存在活跃的 fork 分支 |
134
145
 
135
146
  **特殊意图处理:**
136
147
 
@@ -20,7 +20,10 @@ Turn natural-language instructions into command overlays — JSON patch files th
20
20
  </required_reading>
21
21
 
22
22
  <context>
23
- **Overlay model** — an overlay is a JSON file with a `name`, one or more `targets` (command names without `.md`), and a list of `patches`. Each patch targets an XML section (`execution`, `required_reading`, `context`, `success_criteria`, etc.), a mode (`append`, `prepend`, `replace`, `new-section`), and `content`. On apply, the patcher wraps the content in hashed HTML-comment markers so re-apply is idempotent and removal is surgical.
23
+ **Overlay model**:
24
+ - JSON file: `name`, `targets[]` (command names), `patches[]`
25
+ - Patch: `section` (XML tag), `mode` (append/prepend/replace/new-section), `content`
26
+ - Apply: hashed HTML-comment markers (idempotent, surgical removal)
24
27
 
25
28
  **Where overlays live**
26
29
  - User overlays: `~/.maestro/overlays/*.json` — created by this skill
@@ -138,8 +141,6 @@ Run:
138
141
  maestro overlay add ~/.maestro/overlays/<slug>.json
139
142
  ```
140
143
 
141
- This validates the overlay, copies it into place (idempotent), and applies it across all known install scopes. On validation failure, fix the JSON and re-run.
142
-
143
144
  ### 5. Report
144
145
 
145
146
  Show the user:
@@ -27,6 +27,7 @@ Produces plan.json + TASK files; registers PLN artifact in state.json.
27
27
  - [plan.json](~/.maestro/templates/plan.json) — read when generating plan output
28
28
  - [task.json](~/.maestro/templates/task.json) — read when generating task files
29
29
  - [state.json](~/.maestro/templates/state.json) — read when registering artifact
30
+ - [boundary-grill.md](~/.maestro/workflows/boundary-grill.md) — read when boundary conflicts detected (in P4)
30
31
  </deferred_reading>
31
32
 
32
33
  <context>
@@ -52,7 +53,7 @@ Scope routing, base flags (`--collab`, `--spec`, `-y`, `--gaps`, `--dir`), outpu
52
53
 
53
54
  **Ad-hoc milestone (D-008):** When scope resolves to "standalone" via the standard standalone resolution (no `--from` source), and `current_milestone == null`, plan auto-creates an adhoc milestone (`type: "adhoc"`) in state.json before proceeding. This ensures downstream milestone-audit/complete have a valid milestone context. See workflow plan.md § "Ad-hoc Milestone Auto-Creation".
54
55
 
55
- **Exception (`--from analyze:ANL-xxx` / `blueprint:BLP-xxx`):** When scope is set to "standalone" by `--from`, skip adhoc milestone auto-creation — the upstream analyze/blueprint artifact already provides the milestone context (or is intentionally milestone-free). Adhoc creation in this path would conflict with the `--from` semantic of "this is a one-shot plan rooted in an existing artifact".
56
+ **`--from analyze:*` / `blueprint:*`**: scope=standalone skip adhoc milestone auto-creation.
56
57
 
57
58
  ### Role Knowledge
58
59
  `maestro search --category arch` → select relevant → `maestro wiki load`
@@ -86,11 +87,19 @@ Follow '~/.maestro/workflows/plan.md' completely.
86
87
  - REQUIRED: Main flow inline planning is FORBIDDEN (see P3 Agent Constraint below).
87
88
  - BLOCKED if missing: plan.json or TASK files not produced by planner agent — do not proceed to checking.
88
89
 
90
+ **GATE P3.5 → P4: Boundary Grill → Plan Check**
91
+ Run boundary grill per `~/.maestro/workflows/boundary-grill.md`.
92
+ Input: plan.json tasks + convergence criteria + upstream context. Scope guard: "only plan scope; do not re-analyze or re-scope".
93
+ IF conflicts → results to plan.json `boundary_grill` section + affected TASK files. DEC conflicts add `boundary_warning` to confidence.
94
+ NON-BLOCKING: warnings, not hard stops.
95
+
89
96
  **GATE P4 → P5: Plan Check → User Confirmation**
90
97
  - REQUIRED: Plan-checker passed (or minor issues acknowledged).
98
+ - REQUIRED: Boundary grill completed (conflicts resolved or accepted as risks).
91
99
  - REQUIRED: Confidence scored with 5-dimension factor model.
92
100
  - REQUIRED: Pressure pass completed on highest-complexity task.
93
- - BLOCKED if: plan-checker found critical issues fix plan before presenting to user.
101
+ - REQUIRED: If plan touches UI (检出 `dashboard/` UI 关键词 `landing|page|dashboard|frontend|UI|component|界面`), each delivery wave has ≥1 `[UI-observable]` convergence criterion (vertical-slice delivery, not backend-only).
102
+ - BLOCKED if: plan-checker found critical issues, OR UI plan missing `[UI-observable]` coverage — fix plan before presenting to user.
94
103
 
95
104
  **GATE P5 → Completion: User Confirmation → Done**
96
105
  - REQUIRED: User confirmation captured (execute/modify/cancel).
@@ -152,8 +161,6 @@ For each created TASK-{NNN}.json that has issue_id:
152
161
  Append history entry: { action: "planned", at: <ISO>, by: "maestro-plan", summary: "Linked to TASK-{NNN}" }
153
162
  ```
154
163
 
155
- This ensures issue → TASK traceability. The `task_refs[]` and `task_plan_dir` fields on the issue allow the dashboard to resolve and display associated TASK details.
156
-
157
164
  ### Mode: Revise / Check
158
165
 
159
166
  Follow workflow plan.md § "Revise Mode" and § "Check Mode" respectively. These modes bypass the standard P1-P5 create pipeline.
@@ -215,7 +222,11 @@ Status verdicts:
215
222
  - [ ] .task/TASK-*.json files created for each task
216
223
  - [ ] Every task has `read_first[]` with at least the file being modified + source of truth files
217
224
  - [ ] Every task has `convergence.criteria[]` with grep-verifiable conditions (no subjective language)
225
+ - [ ] UI plans: each delivery wave has ≥1 `[UI-observable]` convergence criterion (vertical slice; verified at runtime by ralph frontend-verify gate)
218
226
  - [ ] Every task `action` and `implementation` contain concrete values (no "align X with Y")
227
+ - [ ] Boundary grill executed in P3.5 (skip if no conflicts detected)
228
+ - [ ] Boundary grill results written to plan.json `boundary_grill` section (if conflicts found)
229
+ - [ ] DEC conflicts reflected in confidence `boundary_warning` factor
219
230
  - [ ] Plan confidence scored in P4 with 5-dimension factor model
220
231
  - [ ] Plan readiness gate checked before P4.5 collision detection
221
232
  - [ ] Pressure pass completed on highest-complexity task
@@ -20,7 +20,8 @@ $ARGUMENTS — intent text, flags, or keywords.
20
20
 
21
21
  **Parse:**
22
22
  ```
23
- -y flag → auto_confirm = true
23
+ -y flag → auto_confirm = true # 唯一来源:用户显式传入;ralph 不内部推断(invariant 14)
24
+ --roadmap → wants_roadmap = true (强制多发布 roadmap 路径;roadmap 默认 opt-in)
24
25
  .md/.txt path → input_doc (supplementary context only, NEVER substitutes lifecycle stages)
25
26
  Remaining → intent
26
27
  ```
@@ -45,6 +46,9 @@ Remaining → intent
45
46
  11. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop;字段可选/累加,既有字段不删不改
46
47
  12. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作。不得以 "效率" 或 "意图明确" 为由绕过。特别是 invariant 1(ralph 不执行 step)和 invariant 6(completion_confirmed 由 CLI 写入)不可隐性违反。
47
48
  13. **Delegate fallback 必须标记** — A_DELEGATE_EVALUATE 解析 verdict 失败时 fallback 为 "fix",但 MUST 在 decisions.ndjson 记录 `"parse_failed": true, "confidence_score": 0`,后续 step 继承 LOW CONFIDENCE 标记。
49
+ 14. **auto_confirm 单一来源** — `auto_confirm` 仅由用户 `-y` 标志设定;ralph 不得内部推断。`session.auto_mode` 仅反映用户输入。
50
+ 15. **分解契约单一所有者** — `boundary_contract` / `task_decomposition` 由 session 创建者拥有(`source=="ralph"` → `decomposition_owner="ralph"`;`source=="maestro"` → `"maestro"`)。contract 已存在时,后续 S_DECOMPOSE MUST 跳过 ask_question,仅做 shape 校验 + 缺省补齐;goal-audit 只更新 `task_decomposition[*].status/completion_confirmed/completed_at`,禁止改 `goal/done_when/boundary`。
51
+ 16. **控制权优先级(范式治理)** — FSM 独占 session 生命周期 + step 排序 + retry/fix/escalate + cross-step decision 节点;Pipeline 命令只拥有自身 artifact GATE(GATE 失败 → `maestro ralph complete <idx> --status BLOCKED|NEEDS_RETRY`,自身 GATE 全过 → DONE);Router 命令不得出现在 FSM step 内。
48
52
  </invariants>
49
53
 
50
54
  <state_machine>
@@ -54,7 +58,7 @@ S_PARSE_ROUTE — 解析参数、路由入口 PERSIST: —
54
58
  S_STATUS — 显示 session 进度 PERSIST: —
55
59
  S_CONTINUE — 恢复执行 PERSIST: —
56
60
  S_RESOLVE_PHASE — 解析 phase + phase_is_new + D-007 milestone PERSIST: session.phase, session.phase_is_new, session.milestone
57
- S_INFER — 基于已解析 phase 推断 lifecycle_position PERSIST: session.lifecycle_position
61
+ S_INFER — 基于已解析 phase 推断 lifecycle_position PERSIST: session.lifecycle_position, session.wants_roadmap
58
62
  S_RESOLVE_SCOPE — 读 macro analyze conclusions.scope_verdict PERSIST: session.scope_verdict, session.analyze_macro_id
59
63
  S_QUALITY_MODE — 决定质量管线模式 PERSIST: session.quality_mode
60
64
  S_PLANNING_MODE — 决定统一/独立规划模式 PERSIST: session.planning_mode
@@ -126,7 +130,7 @@ S_DISPATCH:
126
130
  → END DO: view_file(AbsolutePath="<agy-skills-dir>/maestro-ralph-execute/SKILL.md") + execute inline
127
131
 
128
132
  S_DECISION_EVAL: (decision 节点 == `step.decision` 非空,下述 gate 名取自该字段)
129
- → S_APPLY_VERDICT WHEN: quality-gate (post-execute, post-business-test, post-review, post-test)
133
+ → S_APPLY_VERDICT WHEN: quality-gate (post-execute, post-business-test, post-review, post-test, post-frontend-verify)
130
134
  DO: A_DELEGATE_EVALUATE
131
135
  → S_APPLY_VERDICT WHEN: goal-gate (post-goal-audit)
132
136
  DO: A_GOAL_AUDIT_EVALUATE
@@ -134,11 +138,14 @@ S_DECISION_EVAL: (decision 节点 == `step.decision` 非空,下述 gate 名取
134
138
  DO: A_SCOPE_EVALUATE
135
139
  → S_APPLY_VERDICT WHEN: structural (post-milestone, post-debug-escalate)
136
140
  DO: A_STRUCTURAL_EVALUATE
141
+ → S_APPLY_VERDICT WHEN: reground-gate (post-reground)
142
+ DO: A_REGROUND_EVALUATE
137
143
 
138
144
  S_APPLY_VERDICT:
139
145
  → S_DISPATCH WHEN: verdict == "proceed" DO: A_APPLY_PROCEED
140
- → S_DISPATCH WHEN: post-goal-audit + unmet sub-goals DO: A_APPLY_GOAL_FIX
141
- → S_DISPATCH WHEN: post-goal-audit + all sub-goals met DO: A_APPLY_GOAL_DONE
146
+ → S_DISPATCH WHEN: post-goal-audit + has_unmet DO: A_APPLY_GOAL_FIX
147
+ → S_DISPATCH WHEN: post-goal-audit + all_met + INTENT_ALIGNED=true DO: A_APPLY_GOAL_DONE
148
+ → END WHEN: post-goal-audit + all_met + INTENT_ALIGNED=false DO: A_REGROUND_HALT(尾部漂移熔断)
142
149
  → S_DISPATCH WHEN: post-analyze-scope DO: A_APPLY_SCOPE_VERDICT
143
150
  → S_DISPATCH WHEN: verdict == "fix" DO: A_APPLY_FIX
144
151
  → S_DISPATCH WHEN: verdict == "escalate" DO: A_APPLY_ESCALATE
@@ -146,11 +153,15 @@ S_APPLY_VERDICT:
146
153
  → END WHEN: post-milestone + standard + no next milestone DO: mark completed
147
154
  → END WHEN: post-milestone + adhoc DO: mark completed (adhoc self-contained)
148
155
  → END WHEN: post-debug-escalate (always STOP) DO: A_PAUSE_ESCALATE
156
+ → END WHEN: post-reground + drifted + confidence_score >= 60 DO: A_REGROUND_HALT
157
+ → S_DISPATCH WHEN: post-reground + aligned DO: A_APPLY_PROCEED
158
+ → S_DISPATCH WHEN: post-reground + drifted + confidence_score < 60 DO: A_APPLY_PROCEED (标 LOW CONFIDENCE)
149
159
  GUARD: retry_count >= max_retries → force escalate
150
160
  GUARD: confidence_score < 60 AND proceed → override to fix
151
161
  GUARD: confidence_score > 95 AND fix AND retry > 0 → suggest proceed
152
162
  GUARD: auto_confirm → skip user prompt, apply adjusted verdict
153
163
  GUARD: not auto_confirm → ask_question with override options
164
+ GUARD: post-reground + drifted + confidence_score >= 60 → A_REGROUND_HALT(漂移熔断为安全门,auto_confirm 不跳过)
154
165
 
155
166
  S_FALLBACK:
156
167
  → S_PARSE_ROUTE WHEN: user provides input DO: ask_question
@@ -208,11 +219,19 @@ resolve_milestone(phase_number):
208
219
 
209
220
  | Pattern | Position |
210
221
  |---------|----------|
211
- | 压力测试 / 拷问 / 验证假设 / grill / stress-test | `grill`(**auto_confirm=true 时跳过,直接 `brainstorm`**) |
222
+ | 压力测试 / 拷问 / 验证假设 / grill / stress-test | `grill`(**auto_confirm=true 时透传 `-y`,grill 以 Auto mode 代码代答,不跳过**) |
212
223
  | brainstorm / 头脑风暴 / 探索 / ideate / 设计思路 | `brainstorm` |
213
224
  | blueprint / 规格 / 正式文档 / spec-generate / 7-phase | `blueprint` |
214
225
  | broad/medium intent 无数字 phase (重构/全面/重写/迁移/新功能 X) | `analyze-macro` |
215
226
 
227
+ **Roadmap opt-in detection** (设 `session.wants_roadmap`,缺省 `false`):
228
+ ```
229
+ wants_roadmap = (--roadmap flag)
230
+ OR (intent 含多发布信号: 多发布|多版本|分阶段交付|按里程碑发布|v1.*v2|multi-release|roadmap)
231
+ OR (.workflow/roadmap.md 已存在) ← 向后兼容:既有 roadmap 项目行为不变
232
+ ```
233
+ 默认 `false` → large 项目走单一多波次 `plan --from analyze`,不引入 roadmap 横切层;roadmap 仅多发布场景 opt-in。
234
+
216
235
  **Bootstrap detection:**
217
236
 
218
237
  | Condition | Position |
@@ -227,7 +246,7 @@ resolve_milestone(phase_number):
227
246
  | Condition | Position |
228
247
  |-----------|----------|
229
248
  | `phase_is_new == true` (新 phase) | `analyze` |
230
- | no milestones AND no roadmap.md AND has analyze macro artifact | `roadmap` |
249
+ | no milestones AND no roadmap.md AND has analyze macro artifact | `roadmap` if `wants_roadmap` else `plan` (--from analyze) |
231
250
  | no milestones AND no roadmap.md AND no analyze artifact | `analyze-macro` |
232
251
  | `phase == null` (grill/brainstorm/blueprint/init/roadmap/analyze-macro override 已定) | n/a |
233
252
  | phase 已存在 + 无任何 artifact | `analyze` |
@@ -248,9 +267,9 @@ resolve_milestone(phase_number):
248
267
 
249
268
  | scope_verdict | 链路 |
250
269
  |---------------|------|
251
- | `large` | analyze-macro → roadmap → analyze → plan → execute → ... |
252
- | `medium` / `small` | analyze-macro → plan --from analyze:{ANL_ID} → execute → ...(跳过 roadmap + analyze-phase |
253
- | `unknown` | 默认走 large 路径,post-analyze-scope 决策节点再纠正 |
270
+ | `large` + `wants_roadmap` | analyze-macro → roadmap → analyze → plan → execute → ...(多发布 opt-in) |
271
+ | `large`(默认)/ `medium` / `small` | analyze-macro → plan --from analyze:{ANL_ID} → execute → ...(跳过 roadmap + analyze-phase;单一多波次计划) |
272
+ | `unknown` | 默认走 standalone(plan --from analyze)路径,post-analyze-scope 决策节点再纠正 |
254
273
 
255
274
  **Refine from post-execute results:**
256
275
 
@@ -262,7 +281,8 @@ resolve_milestone(phase_number):
262
281
  | passed==true, no review.json | `business-test` |
263
282
  | review.json: verdict=="BLOCK" | `review-failed` |
264
283
  | review.json: verdict!="BLOCK" | `test` |
265
- | uat.md: all passed | `milestone-audit` |
284
+ | uat.md: all passed + `session.milestone` 存在 | `milestone-audit` |
285
+ | uat.md: all passed + `session.milestone=null` (standalone) | 标记 session completed(无 milestone 可审计) |
266
286
  | uat.md: has failures | `test-failed` |
267
287
 
268
288
  ### A_DETERMINE_QUALITY_MODE
@@ -307,7 +327,9 @@ options:
307
327
 
308
328
  ### A_DECOMPOSE_TASKS
309
329
 
310
- Runs once before chain build; additive to status.json.
330
+ Runs once before chain build; additive to status.json. 设 `session.decomposition_owner = "ralph"`。
331
+
332
+ **0. Ownership guard** (invariant 15): 若 `session.boundary_contract` 或 `session.task_decomposition` 已非空(上游 maestro 已写入,`decomposition_owner == "maestro"`)→ MUST 跳过下述提问,仅做 shape 校验 + 缺省字段补齐,直接进入步骤 6。
311
333
 
312
334
  **1. Classify intent breadth:**
313
335
 
@@ -333,10 +355,10 @@ narrow → derive defaults from intent + codebase, skip questions.
333
355
  ```json
334
356
  { "id": "G1", "goal": "<deliverable>", "boundary": "<in/out note>",
335
357
  "done_when": "<objectively checkable condition>",
336
- "evidence": "verification.json|review.json|uat.md|<test path>",
358
+ "evidence": "verification.json|review.json|uat.md|e2e-results.json|<test path>",
337
359
  "lifecycle": ["analyze","execute"], "status": "pending" }
338
360
  ```
339
- `done_when` 必须客观可验证,且引用 ralph 已产出的 artifact;`lifecycle` 字段映射到产出 evidence 的生命周期 stage
361
+ `done_when` 必须客观可验证,且引用 ralph 已产出的 artifact;`lifecycle` 字段映射到产出 evidence 的生命周期 stage。涉及前端可用性的子目标,`done_when` 应引用 `e2e-results.json`(frontend-verify 门产出),不得仅以后端 API/build 证据判定可用。
340
362
 
341
363
  **5. Persist** (additive): `boundary_contract`, `execution_criteria`, `task_decomposition`。每个 sub-goal 含 `status: "pending"` + `completion_confirmed: false`。
342
364
 
@@ -344,11 +366,11 @@ narrow → derive defaults from intent + codebase, skip questions.
344
366
 
345
367
  ### A_BUILD_STEPS
346
368
 
347
- Generate steps from `session.lifecycle_position` to `milestone-complete`.
369
+ Generate steps from `session.lifecycle_position` to `milestone-complete`(`session.milestone` 存在时)或最后一个质量门(standalone 时)。
348
370
 
349
371
  | Stage | Skill (independent) | Skill (unified) | Decision after | quality_mode |
350
372
  |-------|---------------------|-----------------|----------------|--------------|
351
- | grill | `maestro-grill "{intent}"` | *(same)* | — | all (**skip when auto_confirm**) |
373
+ | grill | `maestro-grill "{intent}"` | *(same)* | — | all (**auto_confirm 透传 `-y` 到 grill args,不删除 stage**) |
352
374
  | brainstorm | `maestro-brainstorm "{intent}" --from grill:{grill_id}` *(if grill ran)* / `maestro-brainstorm "{intent}"` *(otherwise)* | *(same)* | — | all |
353
375
  | blueprint | `maestro-blueprint "{intent}"` | *(same)* | — | all |
354
376
  | init | `maestro-init` | *(same)* | — | all |
@@ -362,6 +384,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
362
384
  | review | `quality-review {phase}` | `quality-review` | `post-review` | all (quick: append `--tier quick`) |
363
385
  | test-gen | `quality-auto-test {phase}` | `quality-auto-test` | — | full / standard if coverage<80% |
364
386
  | test | `quality-test {phase}` | `quality-test` | `post-test` | full, standard |
387
+ | frontend-verify | `quality-test {phase} --frontend-verify` | `quality-test --frontend-verify` | `post-frontend-verify` | all(**仅当 phase 交付 UI 时插入**:检出 `dashboard/` 或 UI 关键词 `landing\|page\|dashboard\|frontend\|UI\|component\|界面`) |
365
388
  | milestone-audit | `maestro-milestone-audit` | *(same)* | — | all |
366
389
  | goal-audit | *(decision-only)* | *(same)* | `post-goal-audit` | all (only if decomposed) |
367
390
  | milestone-complete | `maestro-milestone-complete` | *(same)* | `post-milestone` | all |
@@ -375,10 +398,12 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
375
398
  1. **起点**:从 `session.lifecycle_position` 开始
376
399
  2. **跳过已完成**:跳过当前 milestone+phase 下已有 completed artifact 的 stage(按 `session.phase` 过滤);unified 按 milestone 过滤
377
400
  3. **quality_mode 过滤**:按 `session.quality_mode` 排除不匹配 stage
378
- 3.5. **grill auto_confirm 跳过**:`auto_confirm == true` 时删除 `grill` stage(grill 为交互式苏格拉底拷问,不支持自动模式);brainstorm args 不含 `--from grill:*`
401
+ 3.5. **grill auto_confirm 透传**:`auto_confirm == true` 时为 `grill` step args 追加 `-y`(grill 自身 Auto mode 用代码代答,见 maestro-grill `<context>` Mode selection);保留 `grill` stage 与 brainstorm `--from grill:*`(grill 仍产出 grill-report/terminology/context-package)
402
+ 3.6. **frontend-verify UI 门控**:仅当当前 phase 交付前端(检出 `dashboard/` 目录,或 phase 目标/计划含 UI 关键词 `landing|page|dashboard|frontend|UI|component|界面`)时保留 `frontend-verify` stage + `post-frontend-verify` decision;纯后端 phase 删除该 stage
379
403
  4. **决策节点**:每个 Decision after 非空的 stage 之后插入 `{ decision: "<gate>", retry_count: 0, max_retries: 2, command_scope: null, command_path: null }`
380
404
  5. **goal-audit 插入**:`task_decomposition` 存在时,在最后一个 evidence-producing stage(execute/review/test)之后、`milestone-complete` 之前插入 `decision:post-goal-audit`
381
- 6. **终点硬约束**:chain `milestone-complete` 结尾
405
+ 5.5. **re-grounding 插入**:当 `task_decomposition` 存在 **且** 链路含 ≥3 个执行 step(不含 decision 节点)时,从第 3 个执行 step 起每隔 3 个执行 step 后插入 `{ decision: "post-reground", retry_count: 0, max_retries: 0, command_scope: null, command_path: null }`。不在最后一个执行 step 之后插入(由 goal-audit 覆盖);不与已有 quality-gate decision 节点相邻(顺延到下一个 3-step 边界);fix-loop 动态插入的 step(index > 原始 chain 长度)不纳入计数
406
+ 6. **终点硬约束**:`session.milestone` 存在时 chain 以 `milestone-complete` 结尾;`session.milestone=null`(standalone)时跳过 `milestone-audit` + `milestone-complete` stage,chain 以最后一个质量门 stage 结尾
382
407
  7. **goal_ref 传播**:`task_decomposition` 存在时,每个 step 按 `step.stage ∈ g.lifecycle` 匹配 `step.goal_ref = g.id`(多匹配取字典序最小);decision 节点不打 goal_ref
383
408
  8. **占位符**:independent 保留 `{phase}` `{intent}`;unified 不带 `{phase}`
384
409
  9. **command_path 解析**(每个执行 step,decision 节点跳过):
@@ -390,13 +415,16 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
390
415
  - **不在 build 阶段读取 .md 内容**;`<required_reading>` / `<deferred_reading>` 解析与加载由 `maestro ralph next` CLI 在执行期完成
391
416
  10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`, `deferred_reads: []`, `load: null`(由 `ralph next` 写入)
392
417
  11. **scope_verdict gating**(仅当 chain 起点 = `analyze-macro`):
393
- - `scope_verdict {medium, small}` → 跳过 `roadmap` + `analyze` 两 stage;`plan` 选 standalone 列(`--from analyze:{analyze_macro_id}`),不带 `{phase}`
394
- - `scope_verdict == large` 保留 `roadmap` + `analyze`;`plan` 选 phase 列(`{phase}`)
395
- - `scope_verdict == unknown` → 默认 large 路径;由 `post-analyze-scope` 决策节点在 macro analyze 完成后纠正(A_APPLY_SCOPE_VERDICT)
418
+ - `scope_verdict == large` **且** `wants_roadmap`保留 `roadmap` + `analyze`;`plan` 选 phase 列(`{phase}`)
419
+ - 其余(`medium` / `small`,或 `large` 但非 `wants_roadmap`)→ 跳过 `roadmap` + `analyze` 两 stage;`plan` 选 standalone 列(`--from analyze:{analyze_macro_id}`),不带 `{phase}`
420
+ - `scope_verdict == unknown` → 默认 standalone(非 roadmap)路径;由 `post-analyze-scope` 决策节点在 macro analyze 完成后纠正(A_APPLY_SCOPE_VERDICT)
396
421
  12. **--from 自动注入**:
397
422
  - `analyze_macro_id` 存在且当前 step 是 `roadmap` → args 改为 `--from analyze:{analyze_macro_id}`
398
- - `analyze_macro_id` 存在且 `scope_verdict {medium, small}` 且当前 step `plan` args 改为 `--from analyze:{analyze_macro_id}`
423
+ - `analyze_macro_id` 存在且当前 `plan` step 处于 standalone 列(即非 wants_roadmap 路径:`medium`/`small`,或 `large` 但非 `wants_roadmap`)→ args 改为 `--from analyze:{analyze_macro_id}`
399
424
  - `blueprint_id` 存在 → 当前 step 是 `plan` → args 改为 `--from blueprint:{blueprint_id}`(优先级低于 phase 数字参数)
425
+ - **phase-level deferred chaining**(独立模式,step 含 `{phase}` 占位符):build 阶段前序 artifact 尚未产出,由 A_RESOLVE_ARGS(ralph-execute)运行时从 state.json 查找同 phase+milestone 最新 completed artifact 注入:
426
+ - `plan` step → `--from analyze:{phase_analyze_id}`,写 `source_artifact_ref`
427
+ - `execute` step → `--dir {plan_path}`(现有逻辑),写 `source_artifact_ref = "plan:{id}"`
400
428
  - 写入 `step.source_artifact_ref` 以便审计
401
429
  13. **D-007 Milestone-ref 标注**:每个含 `{phase}` 占位符的 step → `step.milestone_id = session.milestone`(由 A_RESOLVE_PHASE 反查得出),禁止读 `current_milestone`
402
430
  14. **动态插入步骤**(A_APPLY_*)同样应用规则 7-13
@@ -419,6 +447,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
419
447
  | post-business-test | .tests/auto-test/report.json |
420
448
  | post-review | review.json |
421
449
  | post-test | uat.md, .tests/test-results.json |
450
+ | post-frontend-verify | e2e-results.json |
422
451
  4. Check artifact for confidence section → include as signal
423
452
  5. Execute delegate (run_in_background, STOP, wait for callback):
424
453
  ```
@@ -477,14 +506,18 @@ Runs only when `task_decomposition` present.
477
506
  1. 读取 status.json.task_decomposition 中 status!=done 的子目标
478
507
  2. 打开 evidence 产物,对照 done_when 严格判定
479
508
  3. 输出 met / unmet,unmet 给出 gap + target_phase
509
+ 4. 对照 intent + definition_of_done 判定累积产出是否仍服务原始意图(意图保真检查)
480
510
  CONTEXT:
481
- status.json = {session_dir}/status.json
482
- evidence = {evidence artifacts}
511
+ status.json = {session_dir}/status.json
512
+ intent = {session.intent}
513
+ definition_of_done = {boundary_contract.definition_of_done}
514
+ evidence = {evidence artifacts}
483
515
  execution_criteria = {execution_criteria}
484
516
  boundary_contract = {boundary_contract}
485
517
  EXPECTED:
486
518
  ---VERDICT---
487
519
  STATUS=all_met|has_unmet
520
+ INTENT_ALIGNED=true|false
488
521
  UNMET=[{id:G2,gap:'...',target_phase:execute}, ...]
489
522
  CONFIDENCE_SCORE=0-100
490
523
  ---END---
@@ -497,9 +530,64 @@ Runs only when `task_decomposition` present.
497
530
  ```
498
531
  4. On callback: 对每个 met 子目标,set `task_decomposition[i].status="done"` + `completion_confirmed=true` + `completed_at=now`
499
532
  5. Append `{session_dir}/decisions.ndjson` with `"type": "goal-gate"`, `unmet_count`, `unmet_ids`
500
- 6. Verdict: `all_met` → A_APPLY_GOAL_DONE; `has_unmet` → A_APPLY_GOAL_FIX
533
+ 6. Verdict routing:
534
+ - `all_met` + `INTENT_ALIGNED=true` → A_APPLY_GOAL_DONE
535
+ - `all_met` + `INTENT_ALIGNED=false` → A_REGROUND_HALT(尾部漂移熔断,auto_confirm 不跳过)
536
+ - `has_unmet` → A_APPLY_GOAL_FIX
501
537
  GUARD: retry_count >= max_retries AND still unmet → A_APPLY_ESCALATE
502
538
 
539
+ ### A_REGROUND_EVALUATE
540
+
541
+ 仅当 `task_decomposition` 存在。周期触发(build rule 5.5)。
542
+
543
+ 1. 从 status.json 读取:`session.intent`、`session.boundary_contract`、`steps[]` 中 `status=="completed"` 的 step + `completion_evidence`、`task_decomposition` 中已 done 子目标的 `goal` + `done_when`
544
+ 2. Delegate read-only audit (run_in_background, STOP, wait):
545
+ ```
546
+ maestro delegate "PURPOSE: 意图保真检查 — 对照 intent 验证累积执行是否漂移
547
+ TASK:
548
+ 1. 读取 intent + boundary_contract.definition_of_done
549
+ 2. 读取已完成 steps 的 completion_evidence + 已 done 子目标 done_when
550
+ 3. 判定累积产出是否仍服务 intent;是否有 step 产出超出 in_scope 或触碰 out_of_scope
551
+ 4. 输出 aligned / drifted,drifted 给出 drift_description + corrective_action
552
+ CONTEXT:
553
+ intent = {session.intent}
554
+ definition_of_done = {boundary_contract.definition_of_done}
555
+ in_scope = {boundary_contract.in_scope}
556
+ out_of_scope = {boundary_contract.out_of_scope}
557
+ completed_steps = [{index, skill, stage, completion_evidence}, ...]
558
+ done_goals = [{id, goal, done_when}, ...]
559
+ EXPECTED:
560
+ ---VERDICT---
561
+ STATUS=aligned|drifted
562
+ DRIFT_DESCRIPTION=<空或具体描述>
563
+ CORRECTIVE_ACTION=<空或建议>
564
+ CONFIDENCE_SCORE=0-100
565
+ ---END---
566
+ CONSTRAINTS:
567
+ - 只评估,不修改文件
568
+ - aligned 阈值:≥80% 已完成产出直接服务 intent
569
+ - 单个 step 触碰 out_of_scope → 直接判 drifted"
570
+ --role analyze --mode analysis
571
+ ```
572
+ 3. On callback: parse verdict
573
+ 4. Append `{session_dir}/decisions.ndjson`:`{ "id": "DEC-{ts}", "type": "reground-gate", "source": "ralph", "node_id": "post-reground", "verdict": "{aligned|drifted}", "confidence_score": {N}, "drift_description": "...", "corrective_action": "..." }`
574
+ 5. Verdict routing:`aligned` → A_APPLY_PROCEED;`drifted` + `confidence_score >= 60` → A_REGROUND_HALT;`drifted` + `confidence_score < 60` → A_APPLY_PROCEED(标 LOW CONFIDENCE)
575
+
576
+ ### A_REGROUND_HALT
577
+
578
+ 漂移熔断(安全门,auto_confirm 不跳过)。
579
+
580
+ 1. Set `session.status = "paused"`,write status.json
581
+ 2. Display:
582
+ ```
583
+ ⚠️ Re-grounding 检测失败 — 执行已偏离 intent。
584
+ Intent: {session.intent}
585
+ Drift: {drift_description}
586
+ 建议回归: {corrective_action}
587
+ 选项:1) /maestro-ralph continue 忽略漂移继续 2) 手动修正后 continue 3) /maestro-ralph status 查看后决定
588
+ ```
589
+ 3. GUARD: auto_confirm 对本动作无效——漂移熔断不可自动跳过
590
+
503
591
  ### A_APPLY_PROCEED
504
592
 
505
593
  1. Mark decision completed, write status.json
@@ -520,14 +608,14 @@ Runs only when `task_decomposition` present.
520
608
 
521
609
  由 `post-analyze-scope` 触发,依据 `session.scope_verdict` 重塑下游链路。
522
610
 
523
- 1. 读 `session.scope_verdict`
524
- 2. 路径 A(`large`):保持当前链;为后续 `roadmap` step 注入 `--from analyze:{analyze_macro_id}`;为后续 `plan` step 选 phase 列;继续推进
525
- 3. 路径 B(`medium` / `small`):
611
+ 1. 读 `session.scope_verdict` + `session.wants_roadmap`
612
+ 2. 路径 A(`large` `wants_roadmap`):保持当前链(roadmap+analyze);为后续 `roadmap` step 注入 `--from analyze:{analyze_macro_id}`;为后续 `plan` step 选 phase 列;继续推进
613
+ 3. 路径 B(`medium` / `small`,或 `large` 但非 `wants_roadmap`):
526
614
  - 删除 `goal-audit` 之前所有未完成的 `roadmap` + `analyze` (phase) step
527
615
  - 把下一个未完成的 `plan` step 改为 `maestro-plan --from analyze:{analyze_macro_id}`,去掉 `{phase}`,`source_artifact_ref = analyze:{analyze_macro_id}`
528
616
  - 后续 `execute` 等沿用同一 standalone scope(不带 `{phase}`,由 plan 写出的 task 列表驱动)
529
617
  4. 路径 C(`unknown`):
530
- - 非 auto_confirm → ask_question 二选一(large / medium-small);auto_confirm → 默认 large
618
+ - 非 auto_confirm → ask_question 二选一(roadmap 多发布 / 单一计划);auto_confirm → 默认路径 B(单一计划,不引入 roadmap)
531
619
  5. Reindex steps,标 decision completed,write status.json
532
620
  6. Display: ◆ Scope verdict: {verdict} → {kept|collapsed to standalone via analyze:{ANL_ID}}
533
621
 
@@ -574,9 +662,12 @@ Runs only when `task_decomposition` present.
574
662
  "phase": null, "phase_is_new": false,
575
663
  "milestone": "", // D-007 反查结果,禁止读 current_milestone
576
664
  "auto_mode": false,
665
+ "decomposition_owner": "ralph", // 分解契约所有者(invariant 15);缺省按 source 推断
666
+
577
667
  "quality_mode": "standard", // "full" | "standard" | "quick"
578
668
  "planning_mode": "independent", // "unified" | "independent"
579
669
  "scope_verdict": null, // "large" | "medium" | "small" | "unknown" | null
670
+ "wants_roadmap": false, // roadmap opt-in:--roadmap | 多发布 intent | roadmap.md 已存在
580
671
  "analyze_macro_id": null, // "ANL-xxx" 来自最新 macro analyze
581
672
  "blueprint_id": null, // "BLP-xxx" 若存在
582
673
  "cli_tool": "claude", "passed_gates": [],
@@ -668,6 +759,15 @@ quality-test {phase}
668
759
  decision:post-test {retry+1}
669
760
  ```
670
761
 
762
+ **post-frontend-verify:** (UI 写端点未接线/不可用时)
763
+ ```
764
+ quality-debug --from-frontend-verify "{gap_summary}"
765
+ maestro-plan --gaps {phase}
766
+ maestro-execute {phase}
767
+ quality-test {phase} --frontend-verify
768
+ decision:post-frontend-verify {retry+1}
769
+ ```
770
+
671
771
  **post-goal-audit:** (per unmet sub-goal group)
672
772
  ```
673
773
  # for each unmet sub-goal G{n}, scoped to target_phase:
@@ -714,14 +814,15 @@ decision:post-goal-audit {retry+1}
714
814
  - [ ] D-007 反查:phase 数字 → `session.milestone`,禁止读 current_milestone;写入 step.milestone_id
715
815
  - [ ] phase_is_new=true → lifecycle_position 强制 `analyze`
716
816
  - [ ] Intent overrides 识别 grill / brainstorm / blueprint / analyze-macro
717
- - [ ] auto_confirm=true 时 grill stage 跳过(交互式拷问不支持自动模式)
817
+ - [ ] auto_confirm=true 时 grill step args 追加 `-y`(grill 以 Auto mode 执行,stage 不跳过,产出 grill-report/terminology/context-package)
718
818
  - [ ] A_RESOLVE_SCOPE_VERDICT 读 macro analyze conclusions.scope_verdict,写入 session.scope_verdict + analyze_macro_id
719
- - [ ] 链路起点 = analyze-macro 时:large→roadmap+analyze+plan(phase)medium/small→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
819
+ - [ ] 链路起点 = analyze-macro 时:large+wants_roadmap→roadmap+analyze+plan(phase);其余(含 large 默认/medium/small)→直跳 plan --from analyze:{ANL_ID}(跳过 roadmap+analyze)
720
820
  - [ ] post-analyze-scope decision 节点在 macro analyze 之后插入;A_SCOPE_EVALUATE/A_APPLY_SCOPE_VERDICT 重塑链路
721
821
  - [ ] plan step args 支持三路径:`{phase}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}`,写入 step.source_artifact_ref
722
822
  - [ ] roadmap step args 自动注入 `--from analyze:{analyze_macro_id}`(若存在)
723
823
  - [ ] artifact 过滤按 session.phase;unified 按 milestone
724
824
  - [ ] quality_mode 由 A_DETERMINE_QUALITY_MODE 决定,过滤 build steps
825
+ - [ ] frontend-verify stage 仅在 phase 交付 UI 时插入(test 后、milestone-audit 前);post-frontend-verify 走 quality-gate 评估,evidence=e2e-results.json
725
826
  - [ ] Decomposition: broad intent ≤3 question clarify;narrow auto-derive
726
827
  - [ ] status.json 唯一真源:boundary_contract + execution_criteria + task_decomposition;无外部清单
727
828
  - [ ] 执行 step 含 `command_scope` + `command_path`(通过 `maestro ralph skills --platform agy --json --quiet` 预校验,project 覆盖 global);decision step 通过 `step.decision` 字段标识
@@ -735,5 +836,8 @@ decision:post-goal-audit {retry+1}
735
836
  - [ ] Chain 必须以 `milestone-complete` 结尾
736
837
  - [ ] Decision nodes 由 maestro delegate --role analyze 评估
737
838
  - [ ] Ralph 不执行 step,只 evaluate;Skill("maestro-ralph-execute") handoff
839
+ - [ ] Phase-level deferred chaining:plan/execute step 的 `--from`/`--dir` 注入由 A_RESOLVE_ARGS(ralph-execute)运行时完成;build 阶段标记意图,不预知 artifact ID
840
+ - [ ] Phase-level plan step 运行时获得 `--from analyze:{phase_analyze_id}`(由 ralph-execute 从 state.json 查找注入)
841
+ - [ ] Phase-level execute step 运行时获得 `source_artifact_ref = "plan:{id}"`
738
842
 
739
843
  </appendix>