maestro-flow 0.3.46 → 0.3.47

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 (241) hide show
  1. package/.claude/agents/ui-design-agent.md +1 -0
  2. package/.claude/agents/workflow-executor.md +3 -0
  3. package/.claude/commands/learn-decompose.md +91 -146
  4. package/.claude/commands/learn-follow.md +102 -137
  5. package/.claude/commands/learn-investigate.md +102 -167
  6. package/.claude/commands/learn-retro.md +100 -243
  7. package/.claude/commands/learn-second-opinion.md +95 -135
  8. package/.claude/commands/maestro-amend.md +95 -232
  9. package/.claude/commands/maestro-analyze.md +1 -6
  10. package/.claude/commands/maestro-collab.md +104 -265
  11. package/.claude/commands/maestro-composer.md +113 -293
  12. package/.claude/commands/maestro-execute.md +10 -17
  13. package/.claude/commands/maestro-impeccable.md +89 -0
  14. package/.claude/commands/maestro-plan.md +1 -6
  15. package/.claude/commands/maestro-player.md +111 -340
  16. package/.claude/commands/maestro-quick.md +9 -0
  17. package/.claude/commands/maestro-ralph-execute.md +167 -210
  18. package/.claude/commands/maestro-ralph.md +245 -426
  19. package/.claude/commands/maestro-ui-codify.md +13 -0
  20. package/.claude/commands/maestro-ui-craft.md +364 -0
  21. package/.claude/commands/maestro-ui-design.md +12 -1
  22. package/.claude/commands/maestro-verify.md +12 -13
  23. package/.claude/commands/maestro.md +142 -72
  24. package/.claude/commands/manage-knowhow-capture.md +45 -170
  25. package/.claude/commands/quality-auto-test.md +9 -0
  26. package/.claude/commands/quality-debug.md +11 -25
  27. package/.claude/commands/quality-refactor.md +9 -0
  28. package/.claude/commands/quality-review.md +5 -14
  29. package/.claude/commands/spec-add.md +1 -1
  30. package/.claude/commands/spec-load.md +3 -2
  31. package/.claude/skills/maestro-impeccable/SKILL.md +169 -0
  32. package/.codex/skills/learn-decompose/SKILL.md +1 -1
  33. package/.codex/skills/learn-investigate/SKILL.md +2 -1
  34. package/.codex/skills/maestro/SKILL.md +278 -313
  35. package/.codex/skills/maestro-analyze/SKILL.md +126 -417
  36. package/.codex/skills/maestro-brainstorm/SKILL.md +129 -451
  37. package/.codex/skills/maestro-collab/SKILL.md +134 -547
  38. package/.codex/skills/maestro-execute/SKILL.md +3 -1
  39. package/.codex/skills/maestro-impeccable/SKILL.md +112 -0
  40. package/.codex/skills/maestro-plan/SKILL.md +88 -437
  41. package/.codex/skills/maestro-player/SKILL.md +191 -333
  42. package/.codex/skills/maestro-quick/SKILL.md +2 -0
  43. package/.codex/skills/maestro-ralph/SKILL.md +307 -710
  44. package/.codex/skills/maestro-roadmap/SKILL.md +201 -518
  45. package/.codex/skills/maestro-ui-codify/SKILL.md +1 -0
  46. package/.codex/skills/maestro-ui-craft/SKILL.md +341 -0
  47. package/.codex/skills/maestro-ui-design/SKILL.md +10 -0
  48. package/.codex/skills/maestro-verify/SKILL.md +116 -409
  49. package/.codex/skills/quality-auto-test/SKILL.md +145 -443
  50. package/.codex/skills/quality-refactor/SKILL.md +1 -1
  51. package/.codex/skills/quality-test/SKILL.md +229 -517
  52. package/.codex/skills/spec-add/SKILL.md +1 -1
  53. package/README.md +4 -1
  54. package/README.zh-CN.md +3 -1
  55. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +3 -0
  56. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  57. package/dashboard/dist-server/dashboard/src/server/routes/install.js +110 -1
  58. package/dashboard/dist-server/dashboard/src/server/routes/install.js.map +1 -1
  59. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +56 -0
  60. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  61. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +2 -0
  62. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  63. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +2 -2
  64. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +2 -0
  66. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  67. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +3 -1
  68. package/dashboard/dist-server/dashboard/src/shared/constants.d.ts +2 -0
  69. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
  70. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  71. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  72. package/dist/src/agents/cli-agent-runner.js +1 -3
  73. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  74. package/dist/src/agents/cli-history-store.d.ts +5 -0
  75. package/dist/src/agents/cli-history-store.d.ts.map +1 -1
  76. package/dist/src/agents/cli-history-store.js +65 -13
  77. package/dist/src/agents/cli-history-store.js.map +1 -1
  78. package/dist/src/cli.js +13 -0
  79. package/dist/src/cli.js.map +1 -1
  80. package/dist/src/commands/command-help.d.ts +3 -0
  81. package/dist/src/commands/command-help.d.ts.map +1 -0
  82. package/dist/src/commands/command-help.js +60 -0
  83. package/dist/src/commands/command-help.js.map +1 -0
  84. package/dist/src/commands/config.d.ts.map +1 -1
  85. package/dist/src/commands/config.js +17 -0
  86. package/dist/src/commands/config.js.map +1 -1
  87. package/dist/src/commands/delegate.d.ts.map +1 -1
  88. package/dist/src/commands/delegate.js +12 -2
  89. package/dist/src/commands/delegate.js.map +1 -1
  90. package/dist/src/commands/impeccable.d.ts +10 -0
  91. package/dist/src/commands/impeccable.d.ts.map +1 -0
  92. package/dist/src/commands/impeccable.js +181 -0
  93. package/dist/src/commands/impeccable.js.map +1 -0
  94. package/dist/src/commands/spec.js +1 -1
  95. package/dist/src/commands/spec.js.map +1 -1
  96. package/dist/src/commands/wiki.d.ts.map +1 -1
  97. package/dist/src/commands/wiki.js +5 -1
  98. package/dist/src/commands/wiki.js.map +1 -1
  99. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  100. package/dist/src/config/cli-tools-config.js +10 -7
  101. package/dist/src/config/cli-tools-config.js.map +1 -1
  102. package/dist/src/core/addon-registry.d.ts +31 -0
  103. package/dist/src/core/addon-registry.d.ts.map +1 -0
  104. package/dist/src/core/addon-registry.js +28 -0
  105. package/dist/src/core/addon-registry.js.map +1 -0
  106. package/dist/src/hooks/plugins/spec-injection-plugin.js +2 -0
  107. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  108. package/dist/src/hooks/spec-injector.js +2 -2
  109. package/dist/src/hooks/spec-injector.js.map +1 -1
  110. package/dist/src/index.d.ts +2 -0
  111. package/dist/src/index.d.ts.map +1 -1
  112. package/dist/src/index.js +1 -0
  113. package/dist/src/index.js.map +1 -1
  114. package/dist/src/tools/impeccable/critique-storage.d.ts +28 -0
  115. package/dist/src/tools/impeccable/critique-storage.d.ts.map +1 -0
  116. package/dist/src/tools/impeccable/critique-storage.js +120 -0
  117. package/dist/src/tools/impeccable/critique-storage.js.map +1 -0
  118. package/dist/src/tools/impeccable/design-parser.d.ts +90 -0
  119. package/dist/src/tools/impeccable/design-parser.d.ts.map +1 -0
  120. package/dist/src/tools/impeccable/design-parser.js +696 -0
  121. package/dist/src/tools/impeccable/design-parser.js.map +1 -0
  122. package/dist/src/tools/impeccable/detect-csp.d.ts +6 -0
  123. package/dist/src/tools/impeccable/detect-csp.d.ts.map +1 -0
  124. package/dist/src/tools/impeccable/detect-csp.js +130 -0
  125. package/dist/src/tools/impeccable/detect-csp.js.map +1 -0
  126. package/dist/src/tools/impeccable/is-generated.d.ts +4 -0
  127. package/dist/src/tools/impeccable/is-generated.d.ts.map +1 -0
  128. package/dist/src/tools/impeccable/is-generated.js +56 -0
  129. package/dist/src/tools/impeccable/is-generated.js.map +1 -0
  130. package/dist/src/tools/impeccable/live/accept.d.ts +50 -0
  131. package/dist/src/tools/impeccable/live/accept.d.ts.map +1 -0
  132. package/dist/src/tools/impeccable/live/accept.js +556 -0
  133. package/dist/src/tools/impeccable/live/accept.js.map +1 -0
  134. package/dist/src/tools/impeccable/live/bootstrap.d.ts +2 -0
  135. package/dist/src/tools/impeccable/live/bootstrap.d.ts.map +1 -0
  136. package/dist/src/tools/impeccable/live/bootstrap.js +244 -0
  137. package/dist/src/tools/impeccable/live/bootstrap.js.map +1 -0
  138. package/dist/src/tools/impeccable/live/complete.d.ts +7 -0
  139. package/dist/src/tools/impeccable/live/complete.d.ts.map +1 -0
  140. package/dist/src/tools/impeccable/live/complete.js +67 -0
  141. package/dist/src/tools/impeccable/live/complete.js.map +1 -0
  142. package/dist/src/tools/impeccable/live/completion.d.ts +24 -0
  143. package/dist/src/tools/impeccable/live/completion.d.ts.map +1 -0
  144. package/dist/src/tools/impeccable/live/completion.js +26 -0
  145. package/dist/src/tools/impeccable/live/completion.js.map +1 -0
  146. package/dist/src/tools/impeccable/live/inject.d.ts +41 -0
  147. package/dist/src/tools/impeccable/live/inject.d.ts.map +1 -0
  148. package/dist/src/tools/impeccable/live/inject.js +394 -0
  149. package/dist/src/tools/impeccable/live/inject.js.map +1 -0
  150. package/dist/src/tools/impeccable/live/poll.d.ts +24 -0
  151. package/dist/src/tools/impeccable/live/poll.d.ts.map +1 -0
  152. package/dist/src/tools/impeccable/live/poll.js +180 -0
  153. package/dist/src/tools/impeccable/live/poll.js.map +1 -0
  154. package/dist/src/tools/impeccable/live/resume.d.ts +5 -0
  155. package/dist/src/tools/impeccable/live/resume.d.ts.map +1 -0
  156. package/dist/src/tools/impeccable/live/resume.js +30 -0
  157. package/dist/src/tools/impeccable/live/resume.js.map +1 -0
  158. package/dist/src/tools/impeccable/live/server.d.ts +6 -0
  159. package/dist/src/tools/impeccable/live/server.d.ts.map +1 -0
  160. package/dist/src/tools/impeccable/live/server.js +867 -0
  161. package/dist/src/tools/impeccable/live/server.js.map +1 -0
  162. package/dist/src/tools/impeccable/live/session-store.d.ts +72 -0
  163. package/dist/src/tools/impeccable/live/session-store.d.ts.map +1 -0
  164. package/dist/src/tools/impeccable/live/session-store.js +281 -0
  165. package/dist/src/tools/impeccable/live/session-store.js.map +1 -0
  166. package/dist/src/tools/impeccable/live/static/live-browser-session.js +123 -0
  167. package/dist/src/tools/impeccable/live/static/live-browser.js +4860 -0
  168. package/dist/src/tools/impeccable/live/static/modern-screenshot.umd.js +14 -0
  169. package/dist/src/tools/impeccable/live/status.d.ts +2 -0
  170. package/dist/src/tools/impeccable/live/status.d.ts.map +1 -0
  171. package/dist/src/tools/impeccable/live/status.js +52 -0
  172. package/dist/src/tools/impeccable/live/status.js.map +1 -0
  173. package/dist/src/tools/impeccable/live/wrap.d.ts +33 -0
  174. package/dist/src/tools/impeccable/live/wrap.d.ts.map +1 -0
  175. package/dist/src/tools/impeccable/live/wrap.js +572 -0
  176. package/dist/src/tools/impeccable/live/wrap.js.map +1 -0
  177. package/dist/src/tools/impeccable/load-context.d.ts +13 -0
  178. package/dist/src/tools/impeccable/load-context.d.ts.map +1 -0
  179. package/dist/src/tools/impeccable/load-context.js +79 -0
  180. package/dist/src/tools/impeccable/load-context.js.map +1 -0
  181. package/dist/src/tools/impeccable/paths.d.ts +34 -0
  182. package/dist/src/tools/impeccable/paths.d.ts.map +1 -0
  183. package/dist/src/tools/impeccable/paths.js +102 -0
  184. package/dist/src/tools/impeccable/paths.js.map +1 -0
  185. package/dist/src/tools/spec-entry-parser.d.ts +1 -1
  186. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  187. package/dist/src/tools/spec-entry-parser.js +1 -1
  188. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  189. package/dist/src/tools/spec-init.d.ts.map +1 -1
  190. package/dist/src/tools/spec-init.js +26 -1
  191. package/dist/src/tools/spec-init.js.map +1 -1
  192. package/dist/src/tools/spec-loader.d.ts +1 -1
  193. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  194. package/dist/src/tools/spec-loader.js +2 -0
  195. package/dist/src/tools/spec-loader.js.map +1 -1
  196. package/package.json +2 -2
  197. package/workflows/claude-instructions.md +17 -5
  198. package/workflows/cli-tools-usage.md +10 -3
  199. package/workflows/delegate-usage.md +3 -2
  200. package/workflows/impeccable/adapt.md +190 -0
  201. package/workflows/impeccable/animate.md +175 -0
  202. package/workflows/impeccable/audit.md +133 -0
  203. package/workflows/impeccable/bolder.md +113 -0
  204. package/workflows/impeccable/brand.md +118 -0
  205. package/workflows/impeccable/clarify.md +174 -0
  206. package/workflows/impeccable/codex.md +105 -0
  207. package/workflows/impeccable/cognitive-load.md +106 -0
  208. package/workflows/impeccable/color-and-contrast.md +105 -0
  209. package/workflows/impeccable/colorize.md +154 -0
  210. package/workflows/impeccable/craft.md +123 -0
  211. package/workflows/impeccable/critique.md +261 -0
  212. package/workflows/impeccable/delight.md +302 -0
  213. package/workflows/impeccable/distill.md +111 -0
  214. package/workflows/impeccable/document.md +439 -0
  215. package/workflows/impeccable/extract.md +69 -0
  216. package/workflows/impeccable/harden.md +347 -0
  217. package/workflows/impeccable/heuristics-scoring.md +234 -0
  218. package/workflows/impeccable/interaction-design.md +195 -0
  219. package/workflows/impeccable/layout.md +141 -0
  220. package/workflows/impeccable/live.md +622 -0
  221. package/workflows/impeccable/motion-design.md +109 -0
  222. package/workflows/impeccable/onboard.md +234 -0
  223. package/workflows/impeccable/optimize.md +258 -0
  224. package/workflows/impeccable/overdrive.md +130 -0
  225. package/workflows/impeccable/personas.md +179 -0
  226. package/workflows/impeccable/polish.md +242 -0
  227. package/workflows/impeccable/product.md +62 -0
  228. package/workflows/impeccable/quieter.md +99 -0
  229. package/workflows/impeccable/responsive-design.md +114 -0
  230. package/workflows/impeccable/shape.md +165 -0
  231. package/workflows/impeccable/spatial-design.md +100 -0
  232. package/workflows/impeccable/teach.md +168 -0
  233. package/workflows/impeccable/typeset.md +124 -0
  234. package/workflows/impeccable/typography.md +159 -0
  235. package/workflows/impeccable/ux-writing.md +107 -0
  236. package/workflows/impeccable.md +164 -0
  237. package/workflows/maestro.md +7 -3
  238. package/workflows/skill-authoring.md +265 -0
  239. package/workflows/specs-add.md +3 -2
  240. package/workflows/specs-load.md +2 -1
  241. package/workflows/specs-setup.md +21 -1
@@ -6,481 +6,188 @@ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request
6
6
  ---
7
7
 
8
8
  <purpose>
9
- Wave-based 3-layer Goal-Backward verification using `spawn_agents_on_csv`. Decomposes verification into staged parallel checks across three waves: truth + artifact existence (Wave 1), artifact substance + wiring (Wave 2), anti-pattern scan + Nyquist audit (Wave 3).
10
-
11
- **Core workflow**: Load Phase Artifacts -> Establish Must-Haves -> Decompose Checks -> Staged Parallel Verification -> Aggregate + Fix Plans
9
+ Wave-based 3-layer Goal-Backward verification using `spawn_agents_on_csv`.
10
+ Wave 1 (truth + artifact existence) -> Wave 2 (substance + wiring) -> Wave 3 (anti-pattern + Nyquist audit).
12
11
 
13
12
  **Core principle**: Task completion != Goal achievement. A task marked complete may contain stubs/placeholders. This verifier checks that goals are actually achieved.
14
-
15
- ```
16
- +-------------------------------------------------------------------------+
17
- | VERIFICATION CSV WAVE WORKFLOW |
18
- +-------------------------------------------------------------------------+
19
- | |
20
- | Phase 1: Phase Resolution -> CSV |
21
- | +-- Resolve phase directory from arguments |
22
- | +-- Load index.json, plan.json, TASK-*.json, summaries |
23
- | +-- Establish must-haves (truths, artifacts, key links) |
24
- | +-- Decompose into check tasks per layer |
25
- | +-- Assign waves based on layer dependencies |
26
- | +-- Generate tasks.csv with one row per check |
27
- | +-- User validates check breakdown (skip if -y) |
28
- | |
29
- | Phase 2: Wave Execution Engine |
30
- | +-- Wave 1: Truth Checks + Artifact Existence (parallel) |
31
- | | +-- Truth agents verify observable behaviors |
32
- | | +-- Artifact-exist agents check L1 (file exists on disk) |
33
- | | +-- Discoveries shared via board (gap patterns, stubs) |
34
- | | +-- Results: status + evidence + gaps_found per check |
35
- | +-- Wave 2: Artifact Substance + Wiring (parallel) |
36
- | | +-- Substance agents check L2 (real impl, not stub) |
37
- | | +-- Wiring agents check L3 (imported + used) |
38
- | | +-- Needs truth context from wave 1 |
39
- | | +-- Results: status + evidence + gaps_found per check |
40
- | +-- Wave 3: Anti-Pattern Scan + Nyquist Audit (parallel) |
41
- | | +-- Anti-pattern agent scans modified files (skip if flagged) |
42
- | | +-- Nyquist agent maps requirements to tests (skip if flagged) |
43
- | | +-- Needs artifact context from wave 2 |
44
- | | +-- Results: antipatterns[] + coverage gaps |
45
- | +-- discoveries.ndjson shared across all waves (append-only) |
46
- | |
47
- | Phase 3: Results Aggregation |
48
- | +-- Export results.csv |
49
- | +-- Build verification.json (must_haves, gaps, antipatterns, fixes) |
50
- | +-- Build validation.json (if Nyquist ran) |
51
- | +-- Generate context.md with all findings |
52
- | +-- Auto-create issues for gaps + blocker anti-patterns |
53
- | +-- Generate fix plans (cluster related gaps) |
54
- | +-- Update phase index.json with verification status |
55
- | +-- Display summary with next steps |
56
- | |
57
- +-------------------------------------------------------------------------+
58
- ```
59
-
60
13
  </purpose>
61
14
 
62
15
  <context>
63
- ```bash
64
- $maestro-verify "3"
65
- $maestro-verify -c 4 "3 --skip-tests"
66
- $maestro-verify -y "3 --skip-antipattern"
67
- $maestro-verify --continue "20260318-verify-P3-auth"
68
- ```
16
+ $ARGUMENTS -- phase number and optional flags.
69
17
 
70
18
  **Flags**:
71
- - `-y, --yes`: Skip all confirmations (auto mode)
72
- - `-c, --concurrency N`: Max concurrent agents within each wave (default: 4)
19
+ - `-y, --yes`: Skip all confirmations
20
+ - `-c, --concurrency N`: Max concurrent agents per wave (default: 4)
73
21
  - `--continue`: Resume existing session
22
+ - `--skip-tests`: Skip Nyquist test coverage audit in wave 3
23
+ - `--skip-antipattern`: Skip anti-pattern scan in wave 3
74
24
 
75
- When `--yes` or `-y`: Auto-confirm check decomposition, skip interactive validation, use defaults for layer detection.
76
-
77
- **Output Directory**: `.workflow/.csv-wave/{session-id}/`
78
- **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report) + `verification.json` (structured verification output) + `validation.json` (test coverage output, if Nyquist ran)
25
+ **Session**: `.workflow/.csv-wave/{YYYYMMDD}-verify-P{N}-{slug}/`
26
+ **Output**: tasks.csv, results.csv, discoveries.ndjson, context.md, verification.json, validation.json (if Nyquist ran)
79
27
  </context>
80
28
 
81
29
  <csv_schema>
82
30
 
83
- ### tasks.csv (Master State)
31
+ ### tasks.csv
84
32
 
85
33
  ```csv
86
34
  id,title,description,layer,phase_dir,check_type,deps,context_from,wave,status,findings,gaps_found,fix_plan,error
87
- "1","Truth: User can see existing messages","Verify observable behavior: user can see existing messages by checking supporting artifacts, API calls, and render logic.","truth",".workflow/scratch/plan-chat-2026/","observable_behavior","","","1","","","","",""
88
- "2","Truth: User can send new messages","Verify observable behavior: user can send new messages by checking form submission, API POST, and state update.","truth",".workflow/scratch/plan-chat-2026/","observable_behavior","","","1","","","","",""
89
- "3","Artifact Exists: src/components/Chat.tsx","Check L1 existence: verify file src/components/Chat.tsx exists on disk.","artifact",".workflow/scratch/plan-chat-2026/","exists","","","1","","","","",""
90
- "4","Artifact Exists: src/api/chat.ts","Check L1 existence: verify file src/api/chat.ts exists on disk.","artifact",".workflow/scratch/plan-chat-2026/","exists","","","1","","","","",""
91
- "5","Artifact Substance: src/components/Chat.tsx","Check L2 substance: verify src/components/Chat.tsx has real implementation (not stub/placeholder). Minimum logic threshold, no placeholder markers.","artifact",".workflow/scratch/plan-chat-2026/","substance","3","3","2","","","","",""
92
- "6","Artifact Substance: src/api/chat.ts","Check L2 substance: verify src/api/chat.ts has real implementation (not stub/placeholder).","artifact",".workflow/scratch/plan-chat-2026/","substance","4","4","2","","","","",""
93
- "7","Wiring: Chat.tsx -> /api/chat","Check L3 wiring: verify Chat.tsx imports and calls /api/chat endpoints. Check import statements and actual usage beyond imports.","wiring",".workflow/scratch/plan-chat-2026/","import_usage","3;4","3;4","2","","","","",""
94
- "8","Anti-Pattern Scan","Scan all modified files for TODO/FIXME/XXX/HACK, placeholder content, empty returns, log-only functions, hardcoded test data, disabled tests. Categorize as Blocker/Warning/Info.","antipattern",".workflow/scratch/plan-chat-2026/","pattern_scan","1;2;5;6;7","1;2;5;6;7","3","","","","",""
95
- "9","Nyquist Test Coverage Audit","Map requirements to test files. Classify each as COVERED/PARTIAL/MISSING. Detect test framework, run coverage if available.","nyquist",".workflow/scratch/plan-chat-2026/","test_coverage","1;2;5;6;7","1;2;5;6;7","3","","","","",""
96
- ```
97
-
98
- **Columns**:
99
-
100
- | Column | Phase | Description |
101
- |--------|-------|-------------|
102
- | `id` | Input | Unique task identifier (string) |
103
- | `title` | Input | Short check title |
104
- | `description` | Input | Detailed verification instructions for this check |
105
- | `layer` | Input | Verification layer: truth/artifact/wiring/antipattern/nyquist |
106
- | `phase_dir` | Input | Target directory path (e.g., `.workflow/scratch/plan-chat-2026/`) |
107
- | `check_type` | Input | Specific check type: observable_behavior/exists/substance/import_usage/pattern_scan/test_coverage |
108
- | `deps` | Input | Semicolon-separated dependency task IDs |
109
- | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
110
- | `wave` | Computed | Wave number (1 = truths + existence, 2 = substance + wiring, 3 = antipattern + nyquist) |
111
- | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
112
- | `findings` | Output | Key verification findings summary (max 500 chars) |
113
- | `gaps_found` | Output | JSON array of gap descriptions: `[{"id":"GAP-001","type":"missing_feature","severity":"critical","description":"...","fix_direction":"..."}]` |
114
- | `fix_plan` | Output | Suggested fix actions for identified gaps |
115
- | `error` | Output | Error message if failed |
116
-
117
- ### Per-Wave CSV (Temporary)
118
-
119
- Each wave generates `wave-{N}.csv` with extra `prev_context` column.
120
-
121
- ### Output Artifacts
122
-
123
- | File | Purpose | Lifecycle |
124
- |------|---------|-----------|
125
- | `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
126
- | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
127
- | `results.csv` | Final export of all task results | Created in Phase 3 |
128
- | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
129
- | `context.md` | Human-readable verification report | Created in Phase 3 |
130
- | `verification.json` | Structured verification output for downstream | Created in Phase 3 |
131
- | `validation.json` | Nyquist test coverage output (if ran) | Created in Phase 3 |
132
-
133
- ### Session Structure
134
-
135
- ```
136
- .workflow/.csv-wave/{YYYYMMDD}-verify-P{N}-{slug}/
137
- +-- tasks.csv
138
- +-- results.csv
139
- +-- discoveries.ndjson
140
- +-- context.md
141
- +-- verification.json
142
- +-- validation.json (if Nyquist ran)
143
- +-- wave-{N}.csv (temporary)
144
- ```
145
- </csv_schema>
146
-
147
- <invariants>
148
- 1. **Start Immediately**: First action is session initialization, then Phase 1
149
- 2. **Wave Order is Sacred**: Never execute wave 2 before wave 1 completes and results are merged
150
- 3. **CSV is Source of Truth**: Master tasks.csv holds all state
151
- 4. **Context Propagation**: prev_context built from master CSV, not from memory
152
- 5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
153
- 6. **Skip on Failure**: If artifact existence check failed, skip its substance/wiring checks
154
- 7. **Respect Skip Flags**: `--skip-tests` and `--skip-antipattern` mark wave 3 tasks as skipped, not removed
155
- 8. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
156
- 9. **DO NOT STOP**: Continuous execution until all waves complete
157
- 10. **Goal-Backward**: Verify goals are achieved, not just tasks completed
158
- </invariants>
159
-
160
- <execution>
161
-
162
- ### Session Initialization
163
-
164
- **Parse from `$ARGUMENTS`**:
165
-
166
- | Variable | Source | Default |
167
- |----------|--------|---------|
168
- | `AUTO_YES` | `--yes` or `-y` | false |
169
- | `continueMode` | `--continue` | false |
170
- | `maxConcurrency` | `--concurrency N` or `-c N` | 4 |
171
- | `skipTests` | `--skip-tests` | false |
172
- | `skipAntipattern` | `--skip-antipattern` | false |
173
- | `phaseArg` | remaining text after flag removal | — |
174
-
175
- **Session path** (UTC+8 date prefix): `.workflow/.csv-wave/{YYYYMMDD}-verify-P{phaseArg}-{phaseSlug}/`
176
-
177
- Create session directory.
178
-
179
- ### Pre-flight: Team Conflict Check
180
-
181
- Before starting verification, run:
182
- ```
183
- Bash("maestro collab preflight --phase <phase-number>")
35
+ "1","Truth: User can see messages","Verify observable behavior by checking artifacts, API, render logic.","truth","...","observable_behavior","","","1","","","","",""
36
+ "2","Artifact Exists: Chat.tsx","Check L1 existence on disk.","artifact","...","exists","","","1","","","","",""
37
+ "3","Artifact Substance: Chat.tsx","Check L2: real impl, not stub/placeholder.","artifact","...","substance","2","2","2","","","","",""
38
+ "4","Wiring: Chat.tsx -> /api/chat","Check L3: imported and actually used.","wiring","...","import_usage","2","2","2","","","","",""
39
+ "5","Anti-Pattern Scan","Scan modified files for TODO/FIXME/placeholder/disabled tests. Categorize Blocker/Warning/Info.","antipattern","...","pattern_scan","1;3;4","1;3;4","3","","","","",""
40
+ "6","Nyquist Test Coverage","Map requirements to tests. COVERED/PARTIAL/MISSING. Run coverage if available.","nyquist","...","test_coverage","1;3;4","1;3;4","3","","","","",""
184
41
  ```
185
- If exit code is 1, present warnings and ask whether to proceed.
186
-
187
- ### Phase 1: Phase Resolution -> CSV
188
-
189
- **Objective**: Resolve phase, load artifacts, establish must-haves, decompose into check tasks, generate tasks.csv.
190
42
 
191
- **Decomposition Rules**:
43
+ **Column semantics**:
44
+ - Input: id (unique string), title, description (detailed check instructions), layer (truth/artifact/wiring/antipattern/nyquist), phase_dir (target directory path), check_type (observable_behavior/exists/substance/import_usage/pattern_scan/test_coverage), deps (semicolon-sep IDs), context_from (IDs whose findings needed), wave (1=truth+exist, 2=substance+wiring, 3=antipattern+nyquist)
45
+ - Output: status (pending->completed/failed/skipped), findings (verification summary, max 500 chars), gaps_found (JSON array: `[{"id":"GAP-001","type":"missing_feature","severity":"critical","description":"...","fix_direction":"..."}]`), fix_plan (suggested fix actions), error
192
46
 
193
- 1. **Phase resolution**: Resolve `{phaseArg}` via artifact registry in `state.json` to `.workflow/scratch/{YYYYMMDD}-{type}-{slug}/`
194
- 2. **Artifact loading**: Read from phase directory:
195
- - `index.json` -- success_criteria (ground truth for verification)
196
- - `plan.json` -- original plan with task_ids
197
- - All `.task/TASK-{NNN}.json` -- task definitions with convergence.criteria
198
- - All `.summaries/TASK-{NNN}-summary.md` -- execution results
199
- - `uat.md` (if exists) -- human UAT gaps to incorporate
200
- - `.workflow/codebase/ARCHITECTURE.md` (if exists) -- module wiring expectations for Layer 3 checks
201
- - `maestro wiki search "architecture constraint" --json 2>/dev/null` -- documented invariants as additional truth checks (if available)
202
-
203
- 3. **Must-have establishment** (priority order):
204
- - **success_criteria from index.json** -- primary contract
205
- - **convergence.criteria from task JSON** -- per-task completion criteria
206
- - **Derived from phase goal** -- fallback: derive 3-7 observable behaviors
207
-
208
- 4. **Must-have decomposition** into 3 layers:
209
- - **Truths**: Observable behaviors (e.g., "User can see existing messages")
210
- - **Artifacts**: Concrete file paths that must exist and be substantive
211
- - **Key Links**: Critical wiring between artifacts (e.g., "Chat.tsx imports /api/chat")
212
-
213
- 5. **Check task generation**: For each must-have, generate check rows:
47
+ Wave 1: truth + artifact/exists (parallel). Wave 2: substance + wiring (parallel). Wave 3: antipattern + nyquist (parallel, skip-flaggable).
214
48
 
49
+ **Check type -> wave assignment**:
215
50
  | Layer | Check Types | Wave |
216
51
  |-------|-------------|------|
217
52
  | truth | observable_behavior | 1 |
218
53
  | artifact (exists) | exists | 1 |
219
54
  | artifact (substance) | substance | 2 |
220
55
  | wiring | import_usage | 2 |
221
- | antipattern | pattern_scan | 3 (skip if `--skip-antipattern`) |
222
- | nyquist | test_coverage | 3 (skip if `--skip-tests`) |
223
-
224
- 6. **Wave computation**: Assign waves based on layer dependency chain:
225
- - Wave 1: truth + artifact/exists (no predecessors, parallel)
226
- - Wave 2: artifact/substance + wiring (need existence confirmation from wave 1)
227
- - Wave 3: antipattern + nyquist (need substance/wiring context from wave 2)
228
-
229
- 7. **Specs loading**: `specs_content = maestro spec load --category review`
230
-
231
- 8. **CSV generation**: One row per check task.
232
-
233
- **User validation**: Display check breakdown (skip if AUTO_YES).
234
-
235
- ### Phase 2: Wave Execution Engine
236
-
237
- **Objective**: Execute verification checks wave-by-wave via spawn_agents_on_csv.
238
-
239
- #### Wave 1: Truth Checks + Artifact Existence (Parallel)
240
-
241
- Filter `wave == 1 && status == pending` from master CSV. No prev_context (no predecessors). Write `wave-1.csv`.
242
-
243
- ```javascript
244
- spawn_agents_on_csv({
245
- csv_path: `${sessionFolder}/wave-1.csv`,
246
- id_column: "id",
247
- instruction: buildVerifyInstruction(sessionFolder, "wave1"), // agent: ~/.codex/agents/workflow-verifier.toml
248
- max_concurrency: maxConcurrency,
249
- max_runtime_seconds: 3600,
250
- output_csv_path: `${sessionFolder}/wave-1-results.csv`,
251
- output_schema: { id, status: ["completed"|"failed"], findings, gaps_found, fix_plan, error }
252
- // required: id, status, findings
253
- })
254
- ```
255
-
256
- Merge results into master `tasks.csv`, delete `wave-1.csv`.
257
-
258
- **Truth check agent**: Identify supporting artifacts, check existence + substance + wiring indicators. Status: VERIFIED / FAILED / UNCERTAIN. Report gaps for FAILED with severity + fix direction.
259
-
260
- **Artifact existence agent**: Check file on disk. Missing = gap (severity=critical). Exists = note size + structure for wave 2.
261
-
262
- #### Wave 2: Artifact Substance + Wiring (Parallel)
263
-
264
- Filter `wave == 2 && status == pending`. Skip substance check if all wave 1 existence checks failed for that artifact. Build `prev_context` from wave 1 findings (format: `[Task N: Title] status - summary`). Write `wave-2.csv`, execute `spawn_agents_on_csv`, merge results, delete temp CSV.
265
-
266
- **Substance check agent**: <10 lines real logic or contains placeholder markers ("placeholder", "coming soon", "TODO: implement") = STUB. Otherwise SUBSTANTIVE.
267
-
268
- **Wiring check agent**: Grep for import statements + actual usage beyond imports. Status: WIRED / ORPHANED / NOT_WIRED.
269
-
270
- #### Wave 3: Anti-Pattern Scan + Nyquist Audit (Parallel)
271
-
272
- Filter `wave == 3 && status == pending`. Mark as `skipped` per skip flags (`--skip-antipattern`, `--skip-tests`). Build `prev_context` from wave 1 + wave 2 findings. Write `wave-3.csv`, execute `spawn_agents_on_csv`, merge results, delete temp CSV.
273
-
274
- **Anti-pattern scan agent**: Extract modified files from task summaries. Scan for TODO/FIXME/XXX/HACK, placeholder content, empty returns, log-only functions, hardcoded test data, disabled tests. Categorize: Blocker / Warning / Info. Report as JSON array in `gaps_found`.
275
-
276
- **Nyquist audit agent**: Detect test framework, map requirements to test files, classify COVERED / PARTIAL / MISSING. Run coverage if available. Report gaps + coverage percentage.
277
-
278
- ### Phase 3: Results Aggregation
279
-
280
- **Objective**: Generate final results, fix plans, and human-readable report.
281
-
282
- 1. Read final master `tasks.csv`
283
- 2. Export as `results.csv`
284
- 3. **Aggregate must_haves** from all check results:
285
-
286
- ```json
287
- {
288
- "truths": [
289
- { "claim": "User can see existing messages", "status": "verified", "evidence": "Chat.tsx renders from /api/chat GET" }
290
- ],
291
- "artifacts": [
292
- { "path": "src/components/Chat.tsx", "status": "exists", "substantive": true }
293
- ],
294
- "key_links": [
295
- { "from": "Chat.tsx -> /api/chat", "status": "wired" }
296
- ]
297
- }
298
- ```
299
-
300
- 4. **Collect all gaps** from all tasks' `gaps_found` columns + UAT gaps (if uat.md exists)
301
- 5. **Generate fix plans**: Cluster related gaps -> generate plan per cluster -> order by dependency
302
- 6. **Build verification.json**:
303
-
304
- ```json
305
- {
306
- "phase": "<phase>",
307
- "status": "passed|gaps_found|human_needed",
308
- "verified_at": "<ISO>",
309
- "verifier": "csv-wave-verifier",
310
- "must_haves": { "truths": [...], "artifacts": [...], "key_links": [...] },
311
- "gaps": [...],
312
- "antipatterns": [...],
313
- "fix_plans": [...],
314
- "human_verification": [...],
315
- "coverage_score": 0.85
316
- }
317
- ```
318
-
319
- 7. **Build validation.json** (if Nyquist ran):
320
-
321
- ```json
322
- {
323
- "phase": "<phase>",
324
- "status": "passed|gaps_found",
325
- "validated_at": "<ISO>",
326
- "test_framework": "vitest",
327
- "coverage": { "statements": 80, "branches": 72, "functions": 85, "lines": 78 },
328
- "requirement_coverage": [
329
- { "requirement": "REQ-001", "tests": ["auth.spec.ts"], "status": "covered" }
330
- ],
331
- "gaps": [...]
332
- }
333
- ```
334
-
335
- 8. **Generate context.md**:
336
-
337
- ```markdown
338
- # Verification Report -- Phase {phase}
56
+ | antipattern | pattern_scan | 3 (skip if --skip-antipattern) |
57
+ | nyquist | test_coverage | 3 (skip if --skip-tests) |
58
+ </csv_schema>
339
59
 
340
- ## Summary
341
- - Truths: {verified}/{total} verified
342
- - Artifacts: {artifact_verified}/{artifact_total} (L1-L3)
343
- - Wiring: {links_wired}/{links_total} key links
344
- - Anti-patterns: {blocker_count} blockers, {warning_count} warnings
345
- - Nyquist: {coverage_pct}% coverage ({skipped|status})
60
+ <invariants>
61
+ 1. **Wave order sacred**: Never execute wave N+1 before wave N completes
62
+ 2. **CSV is source of truth**: Master tasks.csv holds all state
63
+ 3. **Context propagation**: prev_context from master CSV, not memory
64
+ 4. **Discovery board append-only**: Never modify/delete discoveries.ndjson
65
+ 5. **Skip on failure**: Artifact existence failed -> skip its substance/wiring checks
66
+ 6. **Respect skip flags**: --skip-tests and --skip-antipattern mark wave 3 tasks as skipped, not removed
67
+ 7. **Goal-backward**: Verify goals are achieved, not just tasks completed
68
+ </invariants>
346
69
 
347
- ## Overall Status: **{status}**
70
+ <state_machine>
348
71
 
349
- ## Must-Have Truths
350
- ### {truth_claim}
351
- Status: {VERIFIED|FAILED|UNCERTAIN}
352
- Evidence: {evidence}
72
+ <states>
73
+ S_PARSE -- 解析参数、解析 phase 目录 PERSIST: --
74
+ S_MUST_HAVE -- 建立 must-haves、分解 checks PERSIST: --
75
+ S_CSV_GEN -- 生成 tasks.csv PERSIST: tasks.csv
76
+ S_WAVE_1 -- Truth + Artifact Existence (parallel) PERSIST: findings + tasks.csv
77
+ S_WAVE_2 -- Substance + Wiring (parallel) PERSIST: findings + tasks.csv
78
+ S_WAVE_3 -- Anti-Pattern + Nyquist (parallel) PERSIST: findings + tasks.csv
79
+ S_AGGREGATE -- 生成报告、创建 issues、修复计划 PERSIST: verification.json + validation.json + context.md
80
+ </states>
353
81
 
354
- ## Artifact Checks
355
- | Path | Exists | Substantive | Wired | Status |
356
- |------|--------|-------------|-------|--------|
82
+ <transitions>
357
83
 
358
- ## Key Links
359
- | Link | Status | Evidence |
84
+ S_PARSE:
85
+ -> S_MUST_HAVE WHEN: phase resolved DO: load index.json, plan.json, TASK-*.json, summaries, uat.md, ARCHITECTURE.md
86
+ -> ERROR WHEN: phase not found
360
87
 
361
- ## Gaps
362
- | ID | Type | Severity | Description | Fix Direction |
88
+ S_MUST_HAVE:
89
+ -> S_CSV_GEN DO: establish must-haves from success_criteria (primary), convergence.criteria (per-task), derived behaviors (fallback). Decompose into truth/artifact/wiring layers.
363
90
 
364
- ## Anti-Patterns
365
- | File:Line | Pattern | Severity | Description |
91
+ S_CSV_GEN:
92
+ -> S_WAVE_1 DO: load specs (`maestro spec load --category review`), generate check rows per must-have. Pre-flight: `maestro collab preflight --phase N`
366
93
 
367
- ## Fix Plans
368
- ### {cluster_name}
369
- Objective: {objective}
370
- Tasks: {task_list}
371
- Issue Refs: {issue_ids}
94
+ S_WAVE_1:
95
+ -> S_WAVE_2 DO: A_SPAWN_WAVE_1
372
96
 
373
- ## Nyquist Coverage
374
- {requirement_coverage_table}
375
- ```
97
+ S_WAVE_2:
98
+ -> S_WAVE_3 DO: A_SPAWN_WAVE_2
376
99
 
377
- 9. **Overall status determination**:
100
+ S_WAVE_3:
101
+ -> S_AGGREGATE DO: A_SPAWN_WAVE_3
378
102
 
379
- | Condition | Status |
380
- |-----------|--------|
381
- | All truths VERIFIED, all artifacts pass L1-L3, all key links WIRED, no blockers | passed |
382
- | Any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, or blocker found | gaps_found |
383
- | All automated checks pass but human verification items remain | human_needed |
103
+ S_AGGREGATE:
104
+ -> END DO: A_AGGREGATE_RESULTS
384
105
 
385
- 10. **Auto-create issues** from gaps + blocker anti-patterns (ID format: `ISS-YYYYMMDD-NNN`).
106
+ </transitions>
386
107
 
387
- 11. **Archive previous artifacts**: Move existing `verification.json`/`validation.json` in phase dir to `.history/`.
108
+ <actions>
388
109
 
389
- 12. **Copy outputs** to phase directory: `verification.json`, `validation.json` (if generated).
110
+ ### A_SPAWN_WAVE_1
390
111
 
391
- 13. **Update phase index.json** with verification status and timestamps.
112
+ Filter wave==1 -> write wave-1.csv -> spawn.
392
113
 
393
- 14. **Display summary**: Phase name, truths verified/total, artifacts L1-L3, wiring status, anti-pattern counts, Nyquist coverage, gaps by severity, fix plan count, issues created, human verification items, output file paths.
114
+ **Truth check agent**: Identify supporting artifacts, check existence + substance + wiring indicators. Status: VERIFIED / FAILED / UNCERTAIN. Report gaps with severity + fix direction.
115
+ **Artifact existence agent**: Check file on disk. Missing = gap (severity=critical). Exists = note size + structure for wave 2.
394
116
 
395
- 15. **Post-verify Knowledge Inquiry** (before next step routing):
117
+ ### A_SPAWN_WAVE_2
396
118
 
397
- | Signal | Prompt User | Spec Category | Target File |
398
- |--------|-------------|---------------|-------------|
399
- | Anti-pattern blockers found | "Verification found {N} anti-patterns. Update quality rules?" | `quality` | `quality-rules.md` |
400
- | Constraint/wiring violations | "Architecture constraint violations found. Update constraints?" | `arch` | `architecture-constraints.md` |
401
- | Recurring Nyquist coverage gaps | "Persistent test gap in {module}. Add to test conventions?" | `test` | `test-conventions.md` |
402
- | Stub/placeholder detected | "Stub artifacts found. Record as quality anti-pattern?" | `quality` | `quality-rules.md` |
403
- | Missing wiring (orphaned modules) | "Orphaned modules detected. Document wiring requirement?" | `arch` | `architecture-constraints.md` |
119
+ Filter wave==2, skip if existence failed for that artifact. Build prev_context from wave 1 -> spawn.
404
120
 
405
- On user confirm, invoke `maestro spec add <category> "<title>" "<content>" --keywords ... --source verify:{sessionId}`.
121
+ **Substance agent**: <10 lines real logic or placeholder markers = STUB. Otherwise SUBSTANTIVE.
122
+ **Wiring agent**: Grep for import + actual usage beyond imports. Status: WIRED / ORPHANED / NOT_WIRED.
406
123
 
407
- Use `request_user_input` for prompts:
408
- ```json
409
- { "questions": [{ "id": "knowledge-capture", "header": "Post-Verify Knowledge Capture", "question": "...", "options": [{ "label": "Yes", "description": "Record to specs" }, { "label": "Skip", "description": "Continue without recording" }] }] }
410
- ```
124
+ ### A_SPAWN_WAVE_3
411
125
 
412
- 16. **Next step routing**:
126
+ Filter wave==3. Mark skipped per --skip-antipattern / --skip-tests. Build prev_context from waves 1+2 -> spawn.
413
127
 
414
- | Result | Suggestion |
415
- |--------|------------|
416
- | All passed, no gaps | `$quality-review "{phase}"` for code review |
417
- | Critical gaps found | `$quality-debug` for investigation |
418
- | Minor gaps only | `$maestro-plan "{phase} --gaps"` -> `$maestro-execute` -> re-run `$maestro-verify` |
419
- | Low test coverage | `$quality-auto-test "{phase}"` to generate missing tests |
420
- | Human verification needed | `$quality-test "{phase}"` for interactive UAT |
128
+ **Anti-pattern agent**: Extract modified files from summaries. Scan for TODO/FIXME/XXX/HACK, placeholder, empty returns, disabled tests. Categorize: Blocker / Warning / Info.
129
+ **Nyquist agent**: Detect test framework, map requirements to test files, classify COVERED / PARTIAL / MISSING. Run coverage if available.
421
130
 
422
- ### Shared Discovery Board Protocol
131
+ ### A_AGGREGATE_RESULTS
423
132
 
424
- #### Standard Discovery Types
133
+ 1. Export results.csv
134
+ 2. Aggregate must_haves: truths[], artifacts[], key_links[] with status + evidence
135
+ 3. Collect all gaps from gaps_found + UAT gaps
136
+ 4. Generate fix plans: cluster related gaps -> plan per cluster -> order by dependency
137
+ 5. Build verification.json: `{ phase, status: passed|gaps_found|human_needed, must_haves, gaps, antipatterns, fix_plans, coverage_score }`
138
+ 6. Build validation.json (if Nyquist ran): `{ coverage, requirement_coverage[], gaps[] }`
139
+ 7. Generate context.md: summary, truths, artifact checks table, key links, gaps, anti-patterns, fix plans, Nyquist coverage
140
+ 8. Overall status: all pass + no blockers = passed; any fail/missing/blocker = gaps_found; automated pass but human items remain = human_needed
141
+ 9. Auto-create issues from gaps + blocker anti-patterns
142
+ 10. Archive previous verification/validation to .history/, copy outputs to phase dir
143
+ 11. Update phase index.json with verification status
144
+ 12. Post-verify knowledge inquiry: anti-pattern blockers -> quality spec; constraint violations -> arch spec; recurring test gaps -> test spec
145
+ 13. Next-step routing: all passed -> quality-review; critical gaps -> quality-debug; minor gaps -> plan --gaps; low coverage -> quality-auto-test; human needed -> quality-test
425
146
 
426
- | Type | Dedup Key | Data Schema | Description |
427
- |------|-----------|-------------|-------------|
428
- | `code_pattern` | `data.name` | `{name, file, description}` | Reusable code pattern found |
429
- | `integration_point` | `data.file` | `{file, description, exports[]}` | Module connection point |
430
- | `convention` | singleton | `{naming, imports, formatting}` | Project code conventions |
431
- | `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
432
- | `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
147
+ </actions>
433
148
 
434
- #### Domain Discovery Types
149
+ </state_machine>
435
150
 
436
- | Type | Dedup Key | Data Schema | Description |
437
- |------|-----------|-------------|-------------|
438
- | `verification_gap` | `data.gap_id` | `{gap_id, layer, severity, description}` | Verification gap found |
439
- | `stub_detected` | `data.file` | `{file, line, marker, content}` | Stub/placeholder file detected |
440
- | `broken_wiring` | `data.from+data.to` | `{from, to, expected, actual}` | Broken integration link |
441
- | `antipattern` | `data.location` | `{location, pattern, severity}` | Anti-pattern instance |
442
- | `test_gap` | `data.requirement` | `{requirement, status, suggested_test}` | Missing test coverage |
151
+ <discovery_board>
443
152
 
444
- #### Protocol
153
+ **Standard types** (shared across waves):
154
+ | Type | Dedup Key | Data |
155
+ |------|-----------|------|
156
+ | code_pattern | data.name | {name, file, description} |
157
+ | integration_point | data.file | {file, description, exports[]} |
158
+ | convention | singleton | {naming, imports, formatting} |
159
+ | blocker | data.issue | {issue, severity, impact} |
445
160
 
446
- 1. **Read** `{session_folder}/discoveries.ndjson` before own check
447
- 2. **Skip covered**: If discovery of same type + dedup key exists, skip
448
- 3. **Write immediately**: Append findings as found
449
- 4. **Append-only**: Never modify or delete
450
- 5. **Deduplicate**: Check before writing
161
+ **Domain types**:
162
+ | Type | Dedup Key | Data |
163
+ |------|-----------|------|
164
+ | verification_gap | data.gap_id | {gap_id, layer, severity, description} |
165
+ | stub_detected | data.file | {file, line, marker, content} |
166
+ | broken_wiring | data.from+data.to | {from, to, expected, actual} |
167
+ | antipattern | data.location | {location, pattern, severity} |
168
+ | test_gap | data.requirement | {requirement, status, suggested_test} |
451
169
 
452
- ```bash
453
- echo '{"ts":"<ISO>","worker":"{id}","type":"verification_gap","data":{"gap_id":"GAP-001","layer":"truth","severity":"critical","description":"User cannot send messages - form handler is a stub"}}' >> {session_folder}/discoveries.ndjson
454
- ```
455
- </execution>
170
+ Protocol: read before analysis, append-only, dedup by type+key.
171
+ </discovery_board>
456
172
 
457
173
  <error_codes>
458
-
459
- | Error | Resolution |
460
- |-------|------------|
461
- | Phase directory not found | Resolve via state.json artifact registry; abort if not found |
462
- | No execution results found | Abort with error: "No completed tasks found -- run execute first" |
463
- | No summaries found | Warn, proceed with task file analysis only |
174
+ | Condition | Recovery |
175
+ |-----------|----------|
176
+ | Phase directory not found | Resolve via state.json; abort if not found |
177
+ | No execution results found | Abort: "Run execute first" |
464
178
  | No success_criteria in index.json | Derive must-haves from phase goal (fallback) |
465
- | Truth check agent timeout | Mark as failed, continue remaining checks |
466
- | Substance check on missing artifact | Auto-skip (dep failed), mark as skipped |
467
- | Anti-pattern scan disabled | Mark as skipped, note in context.md |
468
- | Nyquist audit disabled | Mark as skipped, note in context.md |
469
- | Test framework not detected | Skip coverage calculation, warn user |
470
- | CSV parse error | Validate format, show line number |
471
- | discoveries.ndjson corrupt | Ignore malformed lines |
179
+ | Substance check on missing artifact | Auto-skip (dep failed) |
180
+ | Test framework not detected | Skip coverage calculation, warn |
472
181
  | Continue mode: no session found | List available sessions |
473
182
  </error_codes>
474
183
 
475
184
  <success_criteria>
476
- - [ ] Session folder created with valid tasks.csv
477
- - [ ] All 3 waves executed in order (with skip flags respected)
478
- - [ ] verification.json produced with must_haves, gaps, antipatterns
185
+ - [ ] All 3 waves executed (with skip flags respected)
186
+ - [ ] verification.json + context.md produced
479
187
  - [ ] validation.json produced (if Nyquist ran)
480
- - [ ] context.md produced with full report
481
188
  - [ ] Fix plans generated for gap clusters
482
189
  - [ ] Issues auto-created for gaps + blocker anti-patterns
483
- - [ ] Output files copied to phase directory
484
190
  - [ ] Phase index.json updated with verification status
485
191
  - [ ] discoveries.ndjson append-only throughout
486
192
  </success_criteria>
193
+ </output>