maestro-flow 0.3.9 → 0.3.11

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 (281) hide show
  1. package/.claude/agents/workflow-collab-planner.md +1 -1
  2. package/.claude/agents/workflow-executor.md +1 -1
  3. package/.claude/agents/workflow-plan-checker.md +1 -1
  4. package/.claude/agents/workflow-planner.md +1 -1
  5. package/.claude/commands/learn-decompose.md +176 -176
  6. package/.claude/commands/learn-follow.md +167 -167
  7. package/.claude/commands/learn-retro.md +1 -1
  8. package/.claude/commands/maestro-analyze.md +46 -3
  9. package/.claude/commands/maestro-coordinate.md +1 -3
  10. package/.claude/commands/maestro-execute.md +14 -0
  11. package/.claude/commands/maestro-plan.md +16 -0
  12. package/.claude/commands/manage-harvest.md +131 -131
  13. package/.claude/commands/manage-issue-discover.md +2 -2
  14. package/.claude/commands/manage-issue.md +5 -5
  15. package/.claude/commands/spec-add.md +67 -56
  16. package/.claude/commands/spec-load.md +66 -64
  17. package/.claude/commands/spec-setup.md +5 -9
  18. package/.codex/skills/learn-decompose/SKILL.md +119 -0
  19. package/.codex/skills/learn-follow/SKILL.md +83 -0
  20. package/.codex/skills/learn-investigate/SKILL.md +83 -0
  21. package/.codex/skills/learn-retro/SKILL.md +83 -0
  22. package/.codex/skills/learn-second-opinion/SKILL.md +86 -0
  23. package/.codex/skills/maestro/SKILL.md +335 -0
  24. package/.codex/skills/maestro-analyze/SKILL.md +84 -75
  25. package/.codex/skills/maestro-brainstorm/SKILL.md +452 -463
  26. package/.codex/skills/maestro-chain/SKILL.md +233 -0
  27. package/.codex/skills/maestro-coordinate/SKILL.md +167 -278
  28. package/.codex/skills/maestro-execute/SKILL.md +435 -438
  29. package/.codex/skills/maestro-fork/SKILL.md +68 -0
  30. package/.codex/skills/maestro-init/SKILL.md +171 -167
  31. package/.codex/skills/maestro-learn/SKILL.md +80 -0
  32. package/.codex/skills/maestro-link-coordinate/SKILL.md +224 -220
  33. package/.codex/skills/maestro-merge/SKILL.md +62 -0
  34. package/.codex/skills/maestro-milestone-audit/SKILL.md +108 -103
  35. package/.codex/skills/maestro-milestone-complete/SKILL.md +155 -149
  36. package/.codex/skills/maestro-milestone-release/SKILL.md +70 -0
  37. package/.codex/skills/maestro-overlay/SKILL.md +188 -185
  38. package/.codex/skills/maestro-plan/SKILL.md +66 -69
  39. package/.codex/skills/maestro-quick/SKILL.md +26 -23
  40. package/.codex/skills/maestro-roadmap/SKILL.md +65 -73
  41. package/.codex/skills/maestro-spec-generate/SKILL.md +66 -74
  42. package/.codex/skills/maestro-ui-design/SKILL.md +34 -31
  43. package/.codex/skills/maestro-verify/SKILL.md +556 -566
  44. package/.codex/skills/manage-codebase-rebuild/SKILL.md +397 -405
  45. package/.codex/skills/manage-codebase-refresh/SKILL.md +93 -82
  46. package/.codex/skills/manage-harvest/SKILL.md +82 -0
  47. package/.codex/skills/manage-issue/SKILL.md +80 -65
  48. package/.codex/skills/manage-issue-discover/SKILL.md +491 -503
  49. package/.codex/skills/manage-learn/SKILL.md +190 -186
  50. package/.codex/skills/manage-memory/SKILL.md +95 -72
  51. package/.codex/skills/manage-memory-capture/SKILL.md +99 -86
  52. package/.codex/skills/manage-status/SKILL.md +102 -89
  53. package/.codex/skills/quality-business-test/SKILL.md +228 -223
  54. package/.codex/skills/quality-debug/SKILL.md +54 -66
  55. package/.codex/skills/quality-integration-test/SKILL.md +532 -544
  56. package/.codex/skills/quality-refactor/SKILL.md +197 -191
  57. package/.codex/skills/quality-retrospective/SKILL.md +512 -505
  58. package/.codex/skills/quality-review/SKILL.md +93 -105
  59. package/.codex/skills/quality-sync/SKILL.md +101 -89
  60. package/.codex/skills/quality-test/SKILL.md +202 -198
  61. package/.codex/skills/quality-test-gen/SKILL.md +93 -104
  62. package/.codex/skills/spec-add/SKILL.md +58 -39
  63. package/.codex/skills/spec-load/SKILL.md +45 -40
  64. package/.codex/skills/spec-map/SKILL.md +180 -182
  65. package/.codex/skills/spec-setup/SKILL.md +94 -76
  66. package/.codex/skills/team-coordinate/SKILL.md +346 -357
  67. package/.codex/skills/team-executor/SKILL.md +70 -112
  68. package/.codex/skills/team-lifecycle-v4/SKILL.md +311 -299
  69. package/.codex/skills/team-quality-assurance/SKILL.md +234 -227
  70. package/.codex/skills/team-review/SKILL.md +232 -225
  71. package/.codex/skills/team-tech-debt/SKILL.md +78 -100
  72. package/.codex/skills/team-testing/SKILL.md +242 -235
  73. package/.codex/skills/wiki-connect/SKILL.md +75 -0
  74. package/.codex/skills/wiki-digest/SKILL.md +87 -0
  75. package/README.md +14 -11
  76. package/README.zh-CN.md +14 -11
  77. package/chains/issue-lifecycle.json +13 -13
  78. package/chains/singles/issue-analyze.json +3 -3
  79. package/chains/singles/issue-execute.json +3 -3
  80. package/chains/singles/issue-plan.json +3 -3
  81. package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +2 -2
  82. package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
  83. package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js +3 -3
  84. package/dashboard/dist-server/dashboard/src/server/coordinator/chain-map.js.map +1 -1
  85. package/dashboard/dist-server/dashboard/src/server/routes/issues.js +34 -0
  86. package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
  87. package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +1 -1
  88. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +75 -30
  89. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  90. package/dashboard/dist-server/dashboard/src/server/state/event-bus.d.ts +5 -0
  91. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js +5 -0
  92. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js.map +1 -1
  93. package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +2 -3
  94. package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
  95. package/dashboard/dist-server/dashboard/src/shared/constants.js +5 -0
  96. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  97. package/dashboard/dist-server/dashboard/src/shared/issue-types.d.ts +5 -0
  98. package/dashboard/dist-server/dashboard/src/shared/issue-types.js.map +1 -1
  99. package/dashboard/dist-server/dashboard/src/shared/normalize-task.d.ts +2 -0
  100. package/dashboard/dist-server/dashboard/src/shared/normalize-task.js +75 -0
  101. package/dashboard/dist-server/dashboard/src/shared/normalize-task.js.map +1 -0
  102. package/dashboard/dist-server/dashboard/src/shared/team-types.d.ts +21 -0
  103. package/dashboard/dist-server/dashboard/src/shared/team-types.js.map +1 -1
  104. package/dashboard/dist-server/dashboard/src/shared/types.d.ts +3 -2
  105. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.d.ts +1 -1
  106. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.js.map +1 -1
  107. package/dashboard/dist-server/src/hooks/constants.d.ts +92 -12
  108. package/dashboard/dist-server/src/hooks/constants.js +151 -16
  109. package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
  110. package/dashboard/dist-server/src/types/index.d.ts +5 -0
  111. package/dist/src/commands/collab.d.ts +1 -34
  112. package/dist/src/commands/collab.d.ts.map +1 -1
  113. package/dist/src/commands/collab.js +8 -76
  114. package/dist/src/commands/collab.js.map +1 -1
  115. package/dist/src/commands/hooks.d.ts +5 -1
  116. package/dist/src/commands/hooks.d.ts.map +1 -1
  117. package/dist/src/commands/hooks.js +115 -10
  118. package/dist/src/commands/hooks.js.map +1 -1
  119. package/dist/src/commands/install-ui/InstallConfirm.d.ts +3 -1
  120. package/dist/src/commands/install-ui/InstallConfirm.d.ts.map +1 -1
  121. package/dist/src/commands/install-ui/InstallConfirm.js +3 -1
  122. package/dist/src/commands/install-ui/InstallConfirm.js.map +1 -1
  123. package/dist/src/commands/install-ui/InstallExecution.d.ts.map +1 -1
  124. package/dist/src/commands/install-ui/InstallExecution.js +5 -1
  125. package/dist/src/commands/install-ui/InstallExecution.js.map +1 -1
  126. package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
  127. package/dist/src/commands/install-ui/InstallFlow.js +7 -3
  128. package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
  129. package/dist/src/commands/install-ui/StatuslineConfig.d.ts +6 -1
  130. package/dist/src/commands/install-ui/StatuslineConfig.d.ts.map +1 -1
  131. package/dist/src/commands/install-ui/StatuslineConfig.js +27 -5
  132. package/dist/src/commands/install-ui/StatuslineConfig.js.map +1 -1
  133. package/dist/src/commands/spec.d.ts.map +1 -1
  134. package/dist/src/commands/spec.js +7 -2
  135. package/dist/src/commands/spec.js.map +1 -1
  136. package/dist/src/hooks/__tests__/statusline-visual-test.d.ts +7 -0
  137. package/dist/src/hooks/__tests__/statusline-visual-test.d.ts.map +1 -0
  138. package/dist/src/hooks/__tests__/statusline-visual-test.js +236 -0
  139. package/dist/src/hooks/__tests__/statusline-visual-test.js.map +1 -0
  140. package/dist/src/hooks/constants.d.ts +92 -12
  141. package/dist/src/hooks/constants.d.ts.map +1 -1
  142. package/dist/src/hooks/constants.js +151 -16
  143. package/dist/src/hooks/constants.js.map +1 -1
  144. package/dist/src/hooks/guards/index.d.ts +2 -0
  145. package/dist/src/hooks/guards/index.d.ts.map +1 -1
  146. package/dist/src/hooks/guards/index.js +2 -0
  147. package/dist/src/hooks/guards/index.js.map +1 -1
  148. package/dist/src/hooks/guards/preflight-guard.d.ts +29 -0
  149. package/dist/src/hooks/guards/preflight-guard.d.ts.map +1 -0
  150. package/dist/src/hooks/guards/preflight-guard.js +95 -0
  151. package/dist/src/hooks/guards/preflight-guard.js.map +1 -0
  152. package/dist/src/hooks/guards/spec-validator.d.ts +25 -0
  153. package/dist/src/hooks/guards/spec-validator.d.ts.map +1 -0
  154. package/dist/src/hooks/guards/spec-validator.js +66 -0
  155. package/dist/src/hooks/guards/spec-validator.js.map +1 -0
  156. package/dist/src/hooks/index.d.ts +1 -0
  157. package/dist/src/hooks/index.d.ts.map +1 -1
  158. package/dist/src/hooks/index.js +1 -0
  159. package/dist/src/hooks/index.js.map +1 -1
  160. package/dist/src/hooks/keyword-spec-injector.d.ts +21 -0
  161. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -0
  162. package/dist/src/hooks/keyword-spec-injector.js +96 -0
  163. package/dist/src/hooks/keyword-spec-injector.js.map +1 -0
  164. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts +2 -1
  165. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  166. package/dist/src/hooks/plugins/spec-injection-plugin.js +21 -12
  167. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  168. package/dist/src/hooks/preflight-core.d.ts +37 -0
  169. package/dist/src/hooks/preflight-core.d.ts.map +1 -0
  170. package/dist/src/hooks/preflight-core.js +86 -0
  171. package/dist/src/hooks/preflight-core.js.map +1 -0
  172. package/dist/src/hooks/spec-bridge.d.ts +40 -0
  173. package/dist/src/hooks/spec-bridge.d.ts.map +1 -0
  174. package/dist/src/hooks/spec-bridge.js +97 -0
  175. package/dist/src/hooks/spec-bridge.js.map +1 -0
  176. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  177. package/dist/src/hooks/spec-injector.js +18 -12
  178. package/dist/src/hooks/spec-injector.js.map +1 -1
  179. package/dist/src/hooks/statusline.d.ts +8 -17
  180. package/dist/src/hooks/statusline.d.ts.map +1 -1
  181. package/dist/src/hooks/statusline.js +269 -112
  182. package/dist/src/hooks/statusline.js.map +1 -1
  183. package/dist/src/i18n/locales/en.d.ts.map +1 -1
  184. package/dist/src/i18n/locales/en.js +5 -0
  185. package/dist/src/i18n/locales/en.js.map +1 -1
  186. package/dist/src/i18n/locales/zh.d.ts.map +1 -1
  187. package/dist/src/i18n/locales/zh.js +5 -0
  188. package/dist/src/i18n/locales/zh.js.map +1 -1
  189. package/dist/src/i18n/types.d.ts +5 -0
  190. package/dist/src/i18n/types.d.ts.map +1 -1
  191. package/dist/src/team/phase-orchestrator.d.ts +52 -0
  192. package/dist/src/team/phase-orchestrator.d.ts.map +1 -0
  193. package/dist/src/team/phase-orchestrator.js +165 -0
  194. package/dist/src/team/phase-orchestrator.js.map +1 -0
  195. package/dist/src/team/phase-types.d.ts +51 -0
  196. package/dist/src/team/phase-types.d.ts.map +1 -0
  197. package/dist/src/team/phase-types.js +41 -0
  198. package/dist/src/team/phase-types.js.map +1 -0
  199. package/dist/src/tools/collab-adapter.d.ts +17 -0
  200. package/dist/src/tools/collab-adapter.d.ts.map +1 -1
  201. package/dist/src/tools/collab-adapter.js +138 -0
  202. package/dist/src/tools/collab-adapter.js.map +1 -1
  203. package/dist/src/tools/index.d.ts.map +1 -1
  204. package/dist/src/tools/index.js +6 -0
  205. package/dist/src/tools/index.js.map +1 -1
  206. package/dist/src/tools/merge-validator.d.ts +24 -0
  207. package/dist/src/tools/merge-validator.d.ts.map +1 -0
  208. package/dist/src/tools/merge-validator.js +220 -0
  209. package/dist/src/tools/merge-validator.js.map +1 -0
  210. package/dist/src/tools/spec-entry-parser.d.ts +56 -0
  211. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -0
  212. package/dist/src/tools/spec-entry-parser.js +196 -0
  213. package/dist/src/tools/spec-entry-parser.js.map +1 -0
  214. package/dist/src/tools/spec-init.d.ts.map +1 -1
  215. package/dist/src/tools/spec-init.js +66 -92
  216. package/dist/src/tools/spec-init.js.map +1 -1
  217. package/dist/src/tools/spec-keyword-index.d.ts +30 -0
  218. package/dist/src/tools/spec-keyword-index.d.ts.map +1 -0
  219. package/dist/src/tools/spec-keyword-index.js +101 -0
  220. package/dist/src/tools/spec-keyword-index.js.map +1 -0
  221. package/dist/src/tools/spec-loader.d.ts +3 -3
  222. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  223. package/dist/src/tools/spec-loader.js +49 -23
  224. package/dist/src/tools/spec-loader.js.map +1 -1
  225. package/dist/src/tools/team-agents.d.ts +27 -0
  226. package/dist/src/tools/team-agents.d.ts.map +1 -0
  227. package/dist/src/tools/team-agents.js +362 -0
  228. package/dist/src/tools/team-agents.js.map +1 -0
  229. package/dist/src/tools/team-mailbox.d.ts +40 -0
  230. package/dist/src/tools/team-mailbox.d.ts.map +1 -0
  231. package/dist/src/tools/team-mailbox.js +384 -0
  232. package/dist/src/tools/team-mailbox.js.map +1 -0
  233. package/dist/src/tools/team-msg.d.ts +17 -8
  234. package/dist/src/tools/team-msg.d.ts.map +1 -1
  235. package/dist/src/tools/team-msg.js +110 -13
  236. package/dist/src/tools/team-msg.js.map +1 -1
  237. package/dist/src/tools/team-tasks-mcp.d.ts +27 -0
  238. package/dist/src/tools/team-tasks-mcp.d.ts.map +1 -0
  239. package/dist/src/tools/team-tasks-mcp.js +408 -0
  240. package/dist/src/tools/team-tasks-mcp.js.map +1 -0
  241. package/dist/src/types/index.d.ts +5 -0
  242. package/dist/src/types/index.d.ts.map +1 -1
  243. package/package.json +2 -1
  244. package/templates/cli/prompts/workflow-skill-conflict-patterns.txt +3 -3
  245. package/templates/cli/prompts/workflow-skill-lessons-learned.txt +3 -3
  246. package/templates/search-tools.md +1 -1
  247. package/workflows/analyze.md +816 -816
  248. package/workflows/brainstorm.md +471 -471
  249. package/workflows/cli-tools-usage.md +44 -27
  250. package/workflows/codebase-rebuild.md +332 -332
  251. package/workflows/codebase-refresh.md +240 -240
  252. package/workflows/delegate-usage.md +3 -3
  253. package/workflows/execute.md +1 -1
  254. package/workflows/harvest.md +420 -420
  255. package/workflows/integration-test.md +343 -343
  256. package/workflows/issue-analyze.md +6 -2
  257. package/workflows/issue-discover.md +414 -414
  258. package/workflows/issue-execute.md +6 -3
  259. package/workflows/issue-plan.md +5 -2
  260. package/workflows/maestro-coordinate.codex.md +281 -470
  261. package/workflows/maestro-coordinate.md +14 -14
  262. package/workflows/maestro-link-coordinate.md +2 -2
  263. package/workflows/maestro.codex.md +710 -0
  264. package/workflows/maestro.md +10 -11
  265. package/workflows/map.md +111 -111
  266. package/workflows/milestone-complete.md +176 -176
  267. package/workflows/plan.md +1 -1
  268. package/workflows/quick.md +497 -497
  269. package/workflows/refactor.md +300 -300
  270. package/workflows/retrospective.md +1 -1
  271. package/workflows/roadmap.md +335 -335
  272. package/workflows/spec-generate.md +640 -640
  273. package/workflows/specs-add.md +46 -81
  274. package/workflows/specs-load.md +15 -17
  275. package/workflows/specs-setup.md +40 -161
  276. package/.claude/commands/manage-issue-analyze.md +0 -62
  277. package/.claude/commands/manage-issue-execute.md +0 -73
  278. package/.claude/commands/manage-issue-plan.md +0 -62
  279. package/.codex/skills/manage-issue-analyze/SKILL.md +0 -207
  280. package/.codex/skills/manage-issue-execute/SKILL.md +0 -200
  281. package/.codex/skills/manage-issue-plan/SKILL.md +0 -186
@@ -1,544 +1,532 @@
1
- ---
2
- name: quality-integration-test
3
- description: Self-iterating integration test cycle via CSV wave pipeline. Progressive L0-L3 layers in linear pipeline topology with reflection-driven adaptive strategy engine. Replaces quality-integration-test command.
4
- argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"<phase> [--max-iterations N] [--target-coverage N]\""
5
- allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
- ---
7
-
8
- ## Auto Mode
9
-
10
- When `--yes` or `-y`: Auto-confirm test plan, skip interactive validation, use defaults for layer detection.
11
-
12
- # Maestro Integration Test (CSV Wave)
13
-
14
- ## Usage
15
-
16
- ```bash
17
- $quality-integration-test "3"
18
- $quality-integration-test -c 4 "3 --max-iterations 8"
19
- $quality-integration-test -y "3 --target-coverage 90"
20
- $quality-integration-test --continue "integration-test-phase3-20260318"
21
- ```
22
-
23
- **Flags**:
24
- - `-y, --yes`: Skip all confirmations (auto mode)
25
- - `-c, --concurrency N`: Max concurrent agents within each wave (default: 4)
26
- - `--continue`: Resume existing session
27
-
28
- **Output Directory**: `.workflow/.csv-wave/{session-id}/`
29
- **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report) + `summary.json` (structured output for downstream)
30
-
31
- ---
32
-
33
- ## Overview
34
-
35
- Linear pipeline test execution using `spawn_agents_on_csv`. Progressive L0 → L1 → L2 → L3 layers where each layer depends on the previous passing. Self-iterating 6-phase cycle (Explore → Design → Develop → Test → Reflect → Adjust) with adaptive strategy engine.
36
-
37
- **Core workflow**: Explore Codebase Design Test Plan → Progressive Layer Execution → Reflect → Adjust Strategy → Iterate
38
-
39
- ```
40
- ┌─────────────────────────────────────────────────────────────────────────┐
41
- │ INTEGRATION TEST CSV WAVE WORKFLOW │
42
- ├─────────────────────────────────────────────────────────────────────────┤
43
- │ │
44
- │ Phase 1: Exploration CSV │
45
- │ ├─ Resolve phase directory from arguments │
46
- │ ├─ Explore codebase for integration points │
47
- ├─ Discover test infrastructure and existing tests │
48
- ├─ Load pre-generated tests from quality-test-gen │
49
- ├─ Design L0-L3 test plan │
50
- ├─ Generate tasks.csv with rows per layer + module │
51
- └─ User validates test plan (skip if -y) │
52
- │ │
53
- │ Phase 2: Wave Execution Engine (Linear Pipeline) │
54
- ├─ Wave 1: L0 Static Analysis │
55
- │ │ ├─ Type checking (tsc --noEmit) │
56
- │ │ ├─ Linting (eslint / ruff) │
57
- │ │ └─ Results: pass/fail per check │
58
- │ ├─ Wave 2: L1 Unit Tests (parallel per module) │
59
- │ │ ├─ Each module agent runs unit tests independently │
60
- │ │ ├─ Discoveries shared (test commands, fixtures) │
61
- │ │ └─ Results: tests_passed + tests_failed per module │
62
- │ ├─ Wave 3: L2 Integration Tests │
63
- │ │ ├─ Cross-module + API + DB tests │
64
- │ │ ├─ Uses L1 context for test commands and patterns │
65
- │ │ └─ Results: tests_passed + tests_failed + coverage │
66
- │ ├─ Wave 4: L3 E2E Tests │
67
- │ │ ├─ Full user flow tests │
68
- │ │ ├─ Uses L2 context for integration points │
69
- │ │ └─ Results: tests_passed + tests_failed + coverage │
70
- │ └─ discoveries.ndjson shared across all waves (append-only)
71
- │ │
72
- │ Phase 3: Reflect + Iterate │
73
- │ ├─ Calculate overall pass rate │
74
- │ ├─ Reflect on results (what worked, what failed, patterns) │
75
- │ ├─ Adjust strategy (conservative/aggressive/surgical/reflective) │
76
- │ ├─ If pass_rate < target: iterate (back to Phase 2)
77
- │ ├─ If pass_rate >= target OR max_iterations: finalize │
78
- │ ├─ Export results.csv + summary.json │
79
- │ ├─ Generate context.md + reflection-log.md │
80
- │ └─ Display summary with next steps │
81
- │ │
82
- └─────────────────────────────────────────────────────────────────────────┘
83
- ```
84
-
85
- ---
86
-
87
- ## CSV Schema
88
-
89
- ### tasks.csv (Master State)
90
-
91
- ```csv
92
- id,title,description,test_layer,test_scope,deps,context_from,wave,status,findings,tests_passed,tests_failed,coverage,error
93
- "1","L0 Type Check","Run TypeScript type checking with tsc --noEmit. Report all type errors with file:line references.","L0-static","src/**/*.ts","","","1","","","","","",""
94
- "2","L0 Lint","Run ESLint on all source files. Report errors and warnings with file:line references.","L0-static","src/**/*.ts","","","1","","","","","",""
95
- "3","L1 Auth Module","Run unit tests for auth module: token verification, session management, password hashing. Isolated tests with mocked dependencies.","L1-unit","src/auth/**/*.ts","1;2","1;2","2","","","","","",""
96
- "4","L1 API Module","Run unit tests for API module: route handlers, middleware, validators. Isolated tests with mocked DB.","L1-unit","src/api/**/*.ts","1;2","1;2","2","","","","","",""
97
- "5","L1 Utils Module","Run unit tests for utility functions: validation, formatting, helpers. Pure function tests.","L1-unit","src/utils/**/*.ts","1;2","1;2","2","","","","","",""
98
- "6","L2 API Integration","Run integration tests: API endpoints with real middleware chain, DB fixtures, cross-module data flow.","L2-integration","src/api/**/*.ts;src/auth/**/*.ts","3;4;5","3;4;5","3","","","","","",""
99
- "7","L2 DB Integration","Run integration tests: database queries, migrations, transaction handling with test DB.","L2-integration","src/db/**/*.ts","3;4;5","3;4;5","3","","","","","",""
100
- "8","L3 User Flows","Run E2E tests: login flow, CRUD operations, error handling. Full browser/process execution.","L3-e2e","src/**/*.ts","6;7","6;7","4","","","","","",""
101
- ```
102
-
103
- **Columns**:
104
-
105
- | Column | Phase | Description |
106
- |--------|-------|-------------|
107
- | `id` | Input | Unique task identifier (string) |
108
- | `title` | Input | Short task title |
109
- | `description` | Input | Detailed test execution instructions for this layer/scope |
110
- | `test_layer` | Input | Test layer: L0-static/L1-unit/L2-integration/L3-e2e |
111
- | `test_scope` | Input | Semicolon-separated file/module globs to test |
112
- | `deps` | Input | Semicolon-separated dependency task IDs (previous layer tasks) |
113
- | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
114
- | `wave` | Computed | Wave number: 1=L0, 2=L1, 3=L2, 4=L3 |
115
- | `status` | Output | `pending` `completed` / `failed` / `skipped` |
116
- | `findings` | Output | Key findings summary: failures, patterns, coverage notes (max 500 chars) |
117
- | `tests_passed` | Output | Count of passing tests |
118
- | `tests_failed` | Output | Count of failing tests |
119
- | `coverage` | Output | Coverage percentage for this scope (e.g., `87.5%`) |
120
- | `error` | Output | Error message if failed |
121
-
122
- ### Per-Wave CSV (Temporary)
123
-
124
- Each wave generates `wave-{N}.csv` with extra `prev_context` column populated from predecessor findings.
125
-
126
- ---
127
-
128
- ## Output Artifacts
129
-
130
- | File | Purpose | Lifecycle |
131
- |------|---------|-----------|
132
- | `tasks.csv` | Master state — all tasks with status/findings | Updated after each wave |
133
- | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
134
- | `results.csv` | Final export of all task results | Created in Phase 3 |
135
- | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
136
- | `context.md` | Human-readable integration test report | Created in Phase 3 |
137
- | `summary.json` | Structured output for downstream commands | Created in Phase 3 |
138
- | `reflection-log.md` | Per-iteration reflection history | Append-only across iterations |
139
-
140
- ---
141
-
142
- ## Session Structure
143
-
144
- ```
145
- .workflow/.csv-wave/integration-test-{phase}-{date}/
146
- ├── tasks.csv
147
- ├── results.csv
148
- ├── discoveries.ndjson
149
- ├── context.md
150
- ├── summary.json
151
- ├── reflection-log.md
152
- ├── state.json
153
- ├── iteration-{N}/
154
- │ ├── wave-{N}.csv (temporary)
155
- │ └── test-results.json
156
- └── wave-{N}.csv (temporary)
157
- ```
158
-
159
- ---
160
-
161
- ## Implementation
162
-
163
- ### Session Initialization
164
-
165
- ```javascript
166
- const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
167
-
168
- // Parse flags
169
- const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
170
- const continueMode = $ARGUMENTS.includes('--continue')
171
- const concurrencyMatch = $ARGUMENTS.match(/(?:--concurrency|-c)\s+(\d+)/)
172
- const maxConcurrency = concurrencyMatch ? parseInt(concurrencyMatch[1]) : 4
173
-
174
- // Parse integration-test-specific flags
175
- const maxIterMatch = $ARGUMENTS.match(/--max-iterations\s+(\d+)/)
176
- const maxIterations = maxIterMatch ? parseInt(maxIterMatch[1]) : 5
177
- const coverageMatch = $ARGUMENTS.match(/--target-coverage\s+(\d+)/)
178
- const targetCoverage = coverageMatch ? parseInt(coverageMatch[1]) : 95
179
-
180
- // Clean phase text
181
- const phaseArg = $ARGUMENTS
182
- .replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+|--max-iterations\s+\d+|--target-coverage\s+\d+/g, '')
183
- .trim()
184
-
185
- const dateStr = getUtc8ISOString().substring(0, 10).replace(/-/g, '')
186
- const sessionId = `integration-test-phase${phaseArg}-${dateStr}`
187
- const sessionFolder = `.workflow/.csv-wave/${sessionId}`
188
-
189
- Bash(`mkdir -p ${sessionFolder}`)
190
-
191
- // Initialize state.json
192
- const state = {
193
- phase: phaseArg,
194
- started_at: getUtc8ISOString(),
195
- current_iteration: 0,
196
- max_iterations: maxIterations,
197
- strategy: "conservative",
198
- current_layer: "L0",
199
- pass_rates: [],
200
- convergence_threshold: targetCoverage,
201
- status: "running"
202
- }
203
- Write(`${sessionFolder}/state.json`, JSON.stringify(state, null, 2))
204
-
205
- // Initialize reflection-log.md
206
- Write(`${sessionFolder}/reflection-log.md`,
207
- `# Integration Test Reflection Log\nPhase: ${phaseArg}\nStarted: ${getUtc8ISOString()}\n\n## Iterations\n`)
208
- ```
209
-
210
- ---
211
-
212
- ### Phase 1: Exploration CSV
213
-
214
- **Objective**: Explore codebase, discover integration points, design L0-L3 test plan, generate tasks.csv.
215
-
216
- **Decomposition Rules**:
217
-
218
- 1. **Phase resolution**: Resolve `{phaseArg}` to `.workflow/phases/{NN}-{slug}/`
219
-
220
- 2. **Codebase exploration**:
221
- - Cross-module imports and dependencies
222
- - API endpoints and route definitions
223
- - Database interactions and queries
224
- - External service integrations
225
- - Event flows and message passing
226
-
227
- 3. **Test infrastructure discovery**:
228
- - Detect frameworks (jest/vitest/pytest, playwright/cypress)
229
- - Find existing integration and E2E tests
230
- - Identify test utilities, fixtures, DB seed scripts
231
-
232
- 4. **Pre-generated test loading**:
233
- Check `{phase_dir}/.tests/test-gen-report.json` for tests from `quality-test-gen`. Merge integration/e2e tests into plan (execute but don't re-generate).
234
-
235
- 5. **Layer design**:
236
-
237
- | Layer | Wave | Tasks | Content |
238
- |-------|------|-------|---------|
239
- | L0 | 1 | 1-2 | Type check + lint commands |
240
- | L1 | 2 | 1 per module | Unit tests per discovered module (parallel) |
241
- | L2 | 3 | 1-3 | Integration tests (API, DB, cross-module) |
242
- | L3 | 4 | 1-2 | E2E tests (user flows) |
243
-
244
- 6. **Dependency wiring**: L1 depends on L0, L2 depends on L1, L3 depends on L2.
245
-
246
- 7. **CSV generation**: Rows for all layers with correct wave assignments and deps.
247
-
248
- **User validation**: Display layer breakdown with test counts (skip if AUTO_YES).
249
-
250
- ---
251
-
252
- ### Phase 2: Wave Execution Engine
253
-
254
- **Objective**: Execute test layers wave-by-wave via spawn_agents_on_csv. Progressive each layer requires previous to pass.
255
-
256
- #### Wave 1: L0 Static Analysis
257
-
258
- 1. Read master `tasks.csv`
259
- 2. Filter rows where `wave == 1` AND `status == pending`
260
- 3. No prev_context needed (first wave)
261
- 4. Write `wave-1.csv`
262
- 5. Execute:
263
-
264
- ```javascript
265
- spawn_agents_on_csv({
266
- csv_path: `${sessionFolder}/wave-1.csv`,
267
- id_column: "id",
268
- instruction: buildL0Instruction(sessionFolder),
269
- max_concurrency: maxConcurrency,
270
- max_runtime_seconds: 300,
271
- output_csv_path: `${sessionFolder}/wave-1-results.csv`,
272
- output_schema: {
273
- type: "object",
274
- properties: {
275
- id: { type: "string" },
276
- status: { type: "string", enum: ["completed", "failed"] },
277
- findings: { type: "string" },
278
- tests_passed: { type: "string" },
279
- tests_failed: { type: "string" },
280
- coverage: { type: "string" },
281
- error: { type: "string" }
282
- },
283
- required: ["id", "status", "findings"]
284
- }
285
- })
286
- ```
287
-
288
- 6. Read `wave-1-results.csv`, merge into master `tasks.csv`
289
- 7. Delete `wave-1.csv`
290
- 8. **Gate check**: If all L0 tasks failed, skip remaining waves for this iteration
291
-
292
- #### Wave 2: L1 Unit Tests (Parallel per Module)
293
-
294
- 1. Read master `tasks.csv`
295
- 2. Filter rows where `wave == 2` AND `status == pending`
296
- 3. Check deps all L0 tasks must be completed (not failed)
297
- 4. Build `prev_context` from L0 findings:
298
- ```
299
- [Task 1: L0 Type Check] Clean 0 type errors
300
- [Task 2: L0 Lint] 3 warnings in auth module (non-blocking)
301
- ```
302
- 5. Write `wave-2.csv` with `prev_context` column
303
- 6. Execute `spawn_agents_on_csv` for L1 agents (parallel per module)
304
- 7. Merge results into master `tasks.csv`
305
- 8. Delete `wave-2.csv`
306
- 9. **Gate check**: If all L1 tasks failed, skip L2 and L3
307
-
308
- #### Wave 3: L2 Integration Tests
309
-
310
- 1. Read master `tasks.csv`
311
- 2. Filter rows where `wave == 3` AND `status == pending`
312
- 3. Build `prev_context` from L1 findings (test commands used, failures found, coverage gaps)
313
- 4. Write `wave-3.csv` with `prev_context`
314
- 5. Execute `spawn_agents_on_csv` for L2 agents
315
- 6. Merge results, delete temp CSV
316
- 7. **Gate check**: If all L2 tasks failed, skip L3
317
-
318
- #### Wave 4: L3 E2E Tests
319
-
320
- 1. Read master `tasks.csv`
321
- 2. Filter rows where `wave == 4` AND `status == pending`
322
- 3. Build `prev_context` from L2 findings (integration points tested, coverage levels)
323
- 4. Write `wave-4.csv` with `prev_context`
324
- 5. Execute `spawn_agents_on_csv` for L3 agents
325
- 6. Merge results, delete temp CSV
326
-
327
- ---
328
-
329
- ### Phase 3: Reflect + Iterate
330
-
331
- **Objective**: Evaluate results, reflect, adjust strategy, iterate or finalize.
332
-
333
- #### Step 3a: Calculate Pass Rate
334
-
335
- Aggregate across all layers:
336
- ```
337
- overall_pass_rate = total_passed / (total_passed + total_failed) * 100
338
- ```
339
-
340
- Record in `state.json.pass_rates[]`.
341
-
342
- #### Step 3b: Reflect
343
-
344
- Analyze iteration results:
345
- - Which tests failed and why?
346
- - Is pass rate improving, plateauing, or regressing?
347
- - Are failures clustered in one layer/module or spread out?
348
- - Is the current strategy working?
349
-
350
- Append to `reflection-log.md`:
351
- ```markdown
352
- ## Iteration {N}
353
- Strategy: {strategy_name}
354
- Pass rate: {rate}% (previous: {prev_rate}%)
355
- Delta: {+/-}%
356
-
357
- ### What worked
358
- - {observation}
359
-
360
- ### What failed
361
- - {test}: {reason}
362
-
363
- ### Pattern detected
364
- - {pattern, e.g., "all failures in auth module"}
365
-
366
- ### Strategy assessment
367
- - Current strategy: {effective|ineffective|partially_effective}
368
- - Recommendation: {keep|switch_to_X}
369
- ```
370
-
371
- #### Step 3c: Adjust Strategy (Adaptive Strategy Engine)
372
-
373
- | Condition | Strategy | Behavior |
374
- |-----------|----------|----------|
375
- | Iteration 1-2 | Conservative | Fix obvious failures, don't refactor |
376
- | Pass rate >80% AND failures similar to previous | Aggressive | Batch-fix related failures together |
377
- | New regressions appeared | Surgical | Revert last changes, fix regression only |
378
- | Stuck 3+ iterations (rate not improving) | Reflective | Step back, re-analyze root cause pattern |
379
-
380
- **Strategy transitions**:
381
- ```
382
- Conservative -> (pass rate >80%) -> Aggressive
383
- Aggressive -> (regression) -> Surgical
384
- Surgical -> (regression fixed) -> Aggressive
385
- Any -> (stuck 3+ iters) -> Reflective
386
- Reflective -> (new insight) -> Conservative (restart approach)
387
- ```
388
-
389
- Update `state.json` with new strategy and iteration count.
390
-
391
- #### Step 3d: Convergence Check
392
-
393
- - If `overall_pass_rate >= target_coverage`: **CONVERGED** → finalize
394
- - If `iteration >= max_iterations`: **MAX_ITER_REACHED** → finalize
395
- - Otherwise: **ITERATE** → reset pending tasks for failing layers, go back to Phase 2
396
-
397
- #### Step 3e: Finalize
398
-
399
- 1. Read final master `tasks.csv`
400
- 2. Export as `results.csv`
401
- 3. Build `summary.json`:
402
-
403
- ```json
404
- {
405
- "phase": "<phase>",
406
- "completed_at": "<ISO>",
407
- "session_id": "<session-id>",
408
- "iterations": 3,
409
- "final_pass_rate": 97.5,
410
- "converged": true,
411
- "convergence_threshold": 95,
412
- "strategy_history": ["conservative", "conservative", "aggressive"],
413
- "layers": {
414
- "L0": { "status": "pass" },
415
- "L1": { "total": 15, "passed": 15, "failed": 0, "pass_rate": 100.0 },
416
- "L2": { "total": 8, "passed": 7, "failed": 1, "pass_rate": 87.5 },
417
- "L3": { "total": 4, "passed": 4, "failed": 0, "pass_rate": 100.0 }
418
- },
419
- "bugs_discovered": [],
420
- "regressions_fixed": []
421
- }
422
- ```
423
-
424
- 4. Generate `context.md`:
425
-
426
- ```markdown
427
- # Integration Test Report — Phase {phase}
428
-
429
- ## Summary
430
- - Iterations: {N}/{max_iter}
431
- - Converged: {yes/no} (threshold: {threshold}%)
432
- - Final pass rate: {rate}%
433
- - Strategy: {final_strategy} (transitioned {N} times)
434
-
435
- ## Layer Results
436
- | Layer | Status | Passed | Failed | Pass Rate | Coverage |
437
- |-------|--------|--------|--------|-----------|----------|
438
- | L0 Static | {pass/fail} | | | | |
439
- | L1 Unit | {status} | {P} | {F} | {rate}% | {cov}% |
440
- | L2 Integration | {status} | {P} | {F} | {rate}% | {cov}% |
441
- | L3 E2E | {status} | {P} | {F} | {rate}% | {cov}% |
442
-
443
- ## Iteration History
444
- | Iter | Strategy | Pass Rate | Delta | Action |
445
- |------|----------|-----------|-------|--------|
446
- | 1 | conservative | 72.0% | — | fixed 3 type errors |
447
- | 2 | conservative | 85.5% | +13.5% | fixed auth test fixtures |
448
- | 3 | aggressive | 97.5% | +12.0% | batch-fixed API tests |
449
-
450
- ## Reflection Summary
451
- {key insights from reflection-log.md}
452
-
453
- ## Bugs Discovered
454
- {list of bugs found during testing}
455
-
456
- ## Next Steps
457
- {suggested_next_command}
458
- ```
459
-
460
- 5. Copy `summary.json` to phase `.tests/integration/` directory.
461
-
462
- 6. Update `index.json` with integration test status.
463
-
464
- 7. Display summary.
465
-
466
- **Next step routing**:
467
-
468
- | Result | Suggestion |
469
- |--------|------------|
470
- | Converged (>=target%) | `maestro-verify {phase}` to update validation |
471
- | Max iter, >80% | `quality-test {phase}` for manual UAT on remaining gaps |
472
- | Max iter, <80% | `quality-debug` for deep investigation |
473
- | Bugs discovered | `maestro-plan {phase} --gaps` to plan fixes |
474
-
475
- ---
476
-
477
- ## Shared Discovery Board Protocol
478
-
479
- ### Standard Discovery Types
480
-
481
- | Type | Dedup Key | Data Schema | Description |
482
- |------|-----------|-------------|-------------|
483
- | `code_pattern` | `data.name` | `{name, file, description}` | Reusable code pattern found |
484
- | `integration_point` | `data.file` | `{file, description, exports[]}` | Module connection point |
485
- | `convention` | singleton | `{naming, imports, formatting}` | Project code conventions |
486
- | `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
487
- | `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
488
-
489
- ### Domain Discovery Types
490
-
491
- | Type | Dedup Key | Data Schema | Description |
492
- |------|-----------|-------------|-------------|
493
- | `test_command` | `data.layer` | `{layer, command, flags, cwd}` | Working test command for a layer |
494
- | `test_fixture` | `data.name` | `{name, file, setup, teardown}` | Shared test fixture or DB seed |
495
- | `coverage_gap` | `data.module` | `{module, layer, uncovered_areas[]}` | Coverage gap in a module |
496
- | `regression` | `data.test` | `{test, file, previous_status, current_status}` | Test that regressed |
497
- | `flaky_test` | `data.test` | `{test, file, fail_rate, pattern}` | Intermittently failing test |
498
-
499
- ### Protocol
500
-
501
- 1. **Read** `{session_folder}/discoveries.ndjson` before own test execution
502
- 2. **Skip covered**: If discovery of same type + dedup key exists, skip
503
- 3. **Write immediately**: Append findings as found
504
- 4. **Append-only**: Never modify or delete
505
- 5. **Deduplicate**: Check before writing
506
-
507
- ```bash
508
- echo '{"ts":"<ISO>","worker":"{id}","type":"test_command","data":{"layer":"L1","command":"npx vitest run --reporter=verbose","flags":"--testPathPattern=unit","cwd":"."}}' >> {session_folder}/discoveries.ndjson
509
- ```
510
-
511
- ---
512
-
513
- ## Error Handling
514
-
515
- | Error | Resolution |
516
- |-------|------------|
517
- | Phase directory not found | Abort with error: "Phase {N} not found" |
518
- | No test framework detected | Abort with error: "No test framework detected (E003)" |
519
- | L0 static analysis fails | Record failures, proceed to L1 (type errors are informational) |
520
- | All tasks in a layer failed | Gate check: skip subsequent layers for this iteration |
521
- | Agent timeout | Mark as failed, continue with remaining agents in wave |
522
- | Max iterations without convergence | Finalize with current results, warn (W001) |
523
- | Regression detected | Switch to Surgical strategy (W002) |
524
- | Stuck 3+ iterations | Switch to Reflective strategy (W003) |
525
- | CSV parse error | Validate format, show line number |
526
- | discoveries.ndjson corrupt | Ignore malformed lines |
527
- | Continue mode: no session found | List available sessions |
528
- | state.json missing on resume | Rebuild from tasks.csv status column |
529
-
530
- ---
531
-
532
- ## Core Rules
533
-
534
- 1. **Start Immediately**: First action is session initialization, then Phase 1
535
- 2. **Wave Order is Sacred**: Never execute wave N+1 before wave N completes and results are merged
536
- 3. **Progressive Layers**: L0 → L1 → L2 → L3 — each layer gates the next
537
- 4. **CSV is Source of Truth**: Master tasks.csv holds all state
538
- 5. **Context Propagation**: prev_context built from master CSV, not from memory
539
- 6. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
540
- 7. **Self-Iterating**: Loop until convergence or max iterations — do not stop after one pass
541
- 8. **Strategy is Adaptive**: Apply the strategy engine rules for transitions, never stay on a failing strategy
542
- 9. **Reflect Before Adjusting**: Always log reflection before changing strategy
543
- 10. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
544
- 11. **DO NOT STOP**: Continuous execution until convergence or max iterations reached
1
+ ---
2
+ name: quality-integration-test
3
+ description: Self-iterating integration test cycle via CSV wave pipeline. Progressive L0-L3 layers in linear pipeline topology with reflection-driven adaptive strategy engine. Replaces quality-integration-test command.
4
+ argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"<phase> [--max-iterations N] [--target-coverage N]\""
5
+ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
+ ---
7
+
8
+ <purpose>
9
+ Linear pipeline test execution using `spawn_agents_on_csv`. Progressive L0 -> L1 -> L2 -> L3 layers where each layer depends on the previous passing. Self-iterating 6-phase cycle (Explore -> Design -> Develop -> Test -> Reflect -> Adjust) with adaptive strategy engine.
10
+
11
+ **Core workflow**: Explore Codebase -> Design Test Plan -> Progressive Layer Execution -> Reflect -> Adjust Strategy -> Iterate
12
+
13
+ ```
14
+ +-------------------------------------------------------------------------+
15
+ | INTEGRATION TEST CSV WAVE WORKFLOW |
16
+ +-------------------------------------------------------------------------+
17
+ | |
18
+ | Phase 1: Exploration -> CSV |
19
+ | +-- Resolve phase directory from arguments |
20
+ | +-- Explore codebase for integration points |
21
+ | +-- Discover test infrastructure and existing tests |
22
+ | +-- Load pre-generated tests from quality-test-gen |
23
+ | +-- Design L0-L3 test plan |
24
+ | +-- Generate tasks.csv with rows per layer + module |
25
+ | +-- User validates test plan (skip if -y) |
26
+ | |
27
+ | Phase 2: Wave Execution Engine (Linear Pipeline) |
28
+ | +-- Wave 1: L0 Static Analysis |
29
+ | | +-- Type checking (tsc --noEmit) |
30
+ | | +-- Linting (eslint / ruff) |
31
+ | | +-- Results: pass/fail per check |
32
+ | +-- Wave 2: L1 Unit Tests (parallel per module) |
33
+ | | +-- Each module agent runs unit tests independently |
34
+ | | +-- Discoveries shared (test commands, fixtures) |
35
+ | | +-- Results: tests_passed + tests_failed per module |
36
+ | +-- Wave 3: L2 Integration Tests |
37
+ | | +-- Cross-module + API + DB tests |
38
+ | | +-- Uses L1 context for test commands and patterns |
39
+ | | +-- Results: tests_passed + tests_failed + coverage |
40
+ | +-- Wave 4: L3 E2E Tests |
41
+ | | +-- Full user flow tests |
42
+ | | +-- Uses L2 context for integration points |
43
+ | | +-- Results: tests_passed + tests_failed + coverage |
44
+ | +-- discoveries.ndjson shared across all waves (append-only) |
45
+ | |
46
+ | Phase 3: Reflect + Iterate |
47
+ | +-- Calculate overall pass rate |
48
+ | +-- Reflect on results (what worked, what failed, patterns) |
49
+ | +-- Adjust strategy (conservative/aggressive/surgical/reflective) |
50
+ | +-- If pass_rate < target: iterate (back to Phase 2) |
51
+ | +-- If pass_rate >= target OR max_iterations: finalize |
52
+ | +-- Export results.csv + summary.json |
53
+ | +-- Generate context.md + reflection-log.md |
54
+ | +-- Display summary with next steps |
55
+ | |
56
+ +-------------------------------------------------------------------------+
57
+ ```
58
+ </purpose>
59
+
60
+ <context>
61
+ ```bash
62
+ $quality-integration-test "3"
63
+ $quality-integration-test -c 4 "3 --max-iterations 8"
64
+ $quality-integration-test -y "3 --target-coverage 90"
65
+ $quality-integration-test --continue "integration-test-phase3-20260318"
66
+ ```
67
+
68
+ **Flags**:
69
+ - `-y, --yes`: Skip all confirmations (auto mode)
70
+ - `-c, --concurrency N`: Max concurrent agents within each wave (default: 4)
71
+ - `--continue`: Resume existing session
72
+
73
+ When `--yes` or `-y`: Auto-confirm test plan, skip interactive validation, use defaults for layer detection.
74
+
75
+ **Output Directory**: `.workflow/.csv-wave/{session-id}/`
76
+ **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report) + `summary.json` (structured output for downstream)
77
+ </context>
78
+
79
+ <csv_schema>
80
+ ### tasks.csv (Master State)
81
+
82
+ ```csv
83
+ id,title,description,test_layer,test_scope,deps,context_from,wave,status,findings,tests_passed,tests_failed,coverage,error
84
+ "1","L0 Type Check","Run TypeScript type checking with tsc --noEmit. Report all type errors with file:line references.","L0-static","src/**/*.ts","","","1","","","","","",""
85
+ "2","L0 Lint","Run ESLint on all source files. Report errors and warnings with file:line references.","L0-static","src/**/*.ts","","","1","","","","","",""
86
+ "3","L1 Auth Module","Run unit tests for auth module: token verification, session management, password hashing. Isolated tests with mocked dependencies.","L1-unit","src/auth/**/*.ts","1;2","1;2","2","","","","","",""
87
+ "4","L1 API Module","Run unit tests for API module: route handlers, middleware, validators. Isolated tests with mocked DB.","L1-unit","src/api/**/*.ts","1;2","1;2","2","","","","","",""
88
+ "5","L1 Utils Module","Run unit tests for utility functions: validation, formatting, helpers. Pure function tests.","L1-unit","src/utils/**/*.ts","1;2","1;2","2","","","","","",""
89
+ "6","L2 API Integration","Run integration tests: API endpoints with real middleware chain, DB fixtures, cross-module data flow.","L2-integration","src/api/**/*.ts;src/auth/**/*.ts","3;4;5","3;4;5","3","","","","","",""
90
+ "7","L2 DB Integration","Run integration tests: database queries, migrations, transaction handling with test DB.","L2-integration","src/db/**/*.ts","3;4;5","3;4;5","3","","","","","",""
91
+ "8","L3 User Flows","Run E2E tests: login flow, CRUD operations, error handling. Full browser/process execution.","L3-e2e","src/**/*.ts","6;7","6;7","4","","","","","",""
92
+ ```
93
+
94
+ **Columns**:
95
+
96
+ | Column | Phase | Description |
97
+ |--------|-------|-------------|
98
+ | `id` | Input | Unique task identifier (string) |
99
+ | `title` | Input | Short task title |
100
+ | `description` | Input | Detailed test execution instructions for this layer/scope |
101
+ | `test_layer` | Input | Test layer: L0-static/L1-unit/L2-integration/L3-e2e |
102
+ | `test_scope` | Input | Semicolon-separated file/module globs to test |
103
+ | `deps` | Input | Semicolon-separated dependency task IDs (previous layer tasks) |
104
+ | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
105
+ | `wave` | Computed | Wave number: 1=L0, 2=L1, 3=L2, 4=L3 |
106
+ | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
107
+ | `findings` | Output | Key findings summary: failures, patterns, coverage notes (max 500 chars) |
108
+ | `tests_passed` | Output | Count of passing tests |
109
+ | `tests_failed` | Output | Count of failing tests |
110
+ | `coverage` | Output | Coverage percentage for this scope (e.g., `87.5%`) |
111
+ | `error` | Output | Error message if failed |
112
+
113
+ ### Per-Wave CSV (Temporary)
114
+
115
+ Each wave generates `wave-{N}.csv` with extra `prev_context` column populated from predecessor findings.
116
+
117
+ ### Output Artifacts
118
+
119
+ | File | Purpose | Lifecycle |
120
+ |------|---------|-----------|
121
+ | `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
122
+ | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
123
+ | `results.csv` | Final export of all task results | Created in Phase 3 |
124
+ | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
125
+ | `context.md` | Human-readable integration test report | Created in Phase 3 |
126
+ | `summary.json` | Structured output for downstream commands | Created in Phase 3 |
127
+ | `reflection-log.md` | Per-iteration reflection history | Append-only across iterations |
128
+
129
+ ### Session Structure
130
+
131
+ ```
132
+ .workflow/.csv-wave/integration-test-{phase}-{date}/
133
+ +-- tasks.csv
134
+ +-- results.csv
135
+ +-- discoveries.ndjson
136
+ +-- context.md
137
+ +-- summary.json
138
+ +-- reflection-log.md
139
+ +-- state.json
140
+ +-- iteration-{N}/
141
+ | +-- wave-{N}.csv (temporary)
142
+ | +-- test-results.json
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 N+1 before wave N completes and results are merged
150
+ 3. **Progressive Layers**: L0 -> L1 -> L2 -> L3 -- each layer gates the next
151
+ 4. **CSV is Source of Truth**: Master tasks.csv holds all state
152
+ 5. **Context Propagation**: prev_context built from master CSV, not from memory
153
+ 6. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
154
+ 7. **Self-Iterating**: Loop until convergence or max iterations -- do not stop after one pass
155
+ 8. **Strategy is Adaptive**: Apply the strategy engine rules for transitions, never stay on a failing strategy
156
+ 9. **Reflect Before Adjusting**: Always log reflection before changing strategy
157
+ 10. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
158
+ 11. **DO NOT STOP**: Continuous execution until convergence or max iterations reached
159
+ </invariants>
160
+
161
+ <execution>
162
+
163
+ ### Session Initialization
164
+
165
+ ```javascript
166
+ const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
167
+
168
+ // Parse flags
169
+ const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
170
+ const continueMode = $ARGUMENTS.includes('--continue')
171
+ const concurrencyMatch = $ARGUMENTS.match(/(?:--concurrency|-c)\s+(\d+)/)
172
+ const maxConcurrency = concurrencyMatch ? parseInt(concurrencyMatch[1]) : 4
173
+
174
+ // Parse integration-test-specific flags
175
+ const maxIterMatch = $ARGUMENTS.match(/--max-iterations\s+(\d+)/)
176
+ const maxIterations = maxIterMatch ? parseInt(maxIterMatch[1]) : 5
177
+ const coverageMatch = $ARGUMENTS.match(/--target-coverage\s+(\d+)/)
178
+ const targetCoverage = coverageMatch ? parseInt(coverageMatch[1]) : 95
179
+
180
+ // Clean phase text
181
+ const phaseArg = $ARGUMENTS
182
+ .replace(/--yes|-y|--continue|--concurrency\s+\d+|-c\s+\d+|--max-iterations\s+\d+|--target-coverage\s+\d+/g, '')
183
+ .trim()
184
+
185
+ const dateStr = getUtc8ISOString().substring(0, 10).replace(/-/g, '')
186
+ const sessionId = `integration-test-phase${phaseArg}-${dateStr}`
187
+ const sessionFolder = `.workflow/.csv-wave/${sessionId}`
188
+
189
+ Bash(`mkdir -p ${sessionFolder}`)
190
+
191
+ // Initialize state.json
192
+ const state = {
193
+ phase: phaseArg,
194
+ started_at: getUtc8ISOString(),
195
+ current_iteration: 0,
196
+ max_iterations: maxIterations,
197
+ strategy: "conservative",
198
+ current_layer: "L0",
199
+ pass_rates: [],
200
+ convergence_threshold: targetCoverage,
201
+ status: "running"
202
+ }
203
+ Write(`${sessionFolder}/state.json`, JSON.stringify(state, null, 2))
204
+
205
+ // Initialize reflection-log.md
206
+ Write(`${sessionFolder}/reflection-log.md`,
207
+ `# Integration Test Reflection Log\nPhase: ${phaseArg}\nStarted: ${getUtc8ISOString()}\n\n## Iterations\n`)
208
+ ```
209
+
210
+ ### Phase 1: Exploration -> CSV
211
+
212
+ **Objective**: Explore codebase, discover integration points, design L0-L3 test plan, generate tasks.csv.
213
+
214
+ **Decomposition Rules**:
215
+
216
+ 1. **Phase resolution**: Resolve `{phaseArg}` to `.workflow/phases/{NN}-{slug}/`
217
+
218
+ 2. **Codebase exploration**:
219
+ - Cross-module imports and dependencies
220
+ - API endpoints and route definitions
221
+ - Database interactions and queries
222
+ - External service integrations
223
+ - Event flows and message passing
224
+
225
+ 3. **Test infrastructure discovery**:
226
+ - Detect frameworks (jest/vitest/pytest, playwright/cypress)
227
+ - Find existing integration and E2E tests
228
+ - Identify test utilities, fixtures, DB seed scripts
229
+
230
+ 4. **Pre-generated test loading**:
231
+ Check `{phase_dir}/.tests/test-gen-report.json` for tests from `quality-test-gen`. Merge integration/e2e tests into plan (execute but don't re-generate).
232
+
233
+ 5. **Layer design**:
234
+
235
+ | Layer | Wave | Tasks | Content |
236
+ |-------|------|-------|---------|
237
+ | L0 | 1 | 1-2 | Type check + lint commands |
238
+ | L1 | 2 | 1 per module | Unit tests per discovered module (parallel) |
239
+ | L2 | 3 | 1-3 | Integration tests (API, DB, cross-module) |
240
+ | L3 | 4 | 1-2 | E2E tests (user flows) |
241
+
242
+ 6. **Dependency wiring**: L1 depends on L0, L2 depends on L1, L3 depends on L2.
243
+
244
+ 7. **CSV generation**: Rows for all layers with correct wave assignments and deps.
245
+
246
+ **User validation**: Display layer breakdown with test counts (skip if AUTO_YES).
247
+
248
+ ### Phase 2: Wave Execution Engine
249
+
250
+ **Objective**: Execute test layers wave-by-wave via spawn_agents_on_csv. Progressive -- each layer requires previous to pass.
251
+
252
+ #### Wave 1: L0 Static Analysis
253
+
254
+ 1. Read master `tasks.csv`
255
+ 2. Filter rows where `wave == 1` AND `status == pending`
256
+ 3. No prev_context needed (first wave)
257
+ 4. Write `wave-1.csv`
258
+ 5. Execute:
259
+
260
+ ```javascript
261
+ spawn_agents_on_csv({
262
+ csv_path: `${sessionFolder}/wave-1.csv`,
263
+ id_column: "id",
264
+ instruction: buildL0Instruction(sessionFolder),
265
+ max_concurrency: maxConcurrency,
266
+ max_runtime_seconds: 300,
267
+ output_csv_path: `${sessionFolder}/wave-1-results.csv`,
268
+ output_schema: {
269
+ type: "object",
270
+ properties: {
271
+ id: { type: "string" },
272
+ status: { type: "string", enum: ["completed", "failed"] },
273
+ findings: { type: "string" },
274
+ tests_passed: { type: "string" },
275
+ tests_failed: { type: "string" },
276
+ coverage: { type: "string" },
277
+ error: { type: "string" }
278
+ },
279
+ required: ["id", "status", "findings"]
280
+ }
281
+ })
282
+ ```
283
+
284
+ 6. Read `wave-1-results.csv`, merge into master `tasks.csv`
285
+ 7. Delete `wave-1.csv`
286
+ 8. **Gate check**: If all L0 tasks failed, skip remaining waves for this iteration
287
+
288
+ #### Wave 2: L1 Unit Tests (Parallel per Module)
289
+
290
+ 1. Read master `tasks.csv`
291
+ 2. Filter rows where `wave == 2` AND `status == pending`
292
+ 3. Check deps -- all L0 tasks must be completed (not failed)
293
+ 4. Build `prev_context` from L0 findings:
294
+ ```
295
+ [Task 1: L0 Type Check] Clean -- 0 type errors
296
+ [Task 2: L0 Lint] 3 warnings in auth module (non-blocking)
297
+ ```
298
+ 5. Write `wave-2.csv` with `prev_context` column
299
+ 6. Execute `spawn_agents_on_csv` for L1 agents (parallel per module)
300
+ 7. Merge results into master `tasks.csv`
301
+ 8. Delete `wave-2.csv`
302
+ 9. **Gate check**: If all L1 tasks failed, skip L2 and L3
303
+
304
+ #### Wave 3: L2 Integration Tests
305
+
306
+ 1. Read master `tasks.csv`
307
+ 2. Filter rows where `wave == 3` AND `status == pending`
308
+ 3. Build `prev_context` from L1 findings (test commands used, failures found, coverage gaps)
309
+ 4. Write `wave-3.csv` with `prev_context`
310
+ 5. Execute `spawn_agents_on_csv` for L2 agents
311
+ 6. Merge results, delete temp CSV
312
+ 7. **Gate check**: If all L2 tasks failed, skip L3
313
+
314
+ #### Wave 4: L3 E2E Tests
315
+
316
+ 1. Read master `tasks.csv`
317
+ 2. Filter rows where `wave == 4` AND `status == pending`
318
+ 3. Build `prev_context` from L2 findings (integration points tested, coverage levels)
319
+ 4. Write `wave-4.csv` with `prev_context`
320
+ 5. Execute `spawn_agents_on_csv` for L3 agents
321
+ 6. Merge results, delete temp CSV
322
+
323
+ ### Phase 3: Reflect + Iterate
324
+
325
+ **Objective**: Evaluate results, reflect, adjust strategy, iterate or finalize.
326
+
327
+ #### Step 3a: Calculate Pass Rate
328
+
329
+ Aggregate across all layers:
330
+ ```
331
+ overall_pass_rate = total_passed / (total_passed + total_failed) * 100
332
+ ```
333
+
334
+ Record in `state.json.pass_rates[]`.
335
+
336
+ #### Step 3b: Reflect
337
+
338
+ Analyze iteration results:
339
+ - Which tests failed and why?
340
+ - Is pass rate improving, plateauing, or regressing?
341
+ - Are failures clustered in one layer/module or spread out?
342
+ - Is the current strategy working?
343
+
344
+ Append to `reflection-log.md`:
345
+ ```markdown
346
+ ## Iteration {N}
347
+ Strategy: {strategy_name}
348
+ Pass rate: {rate}% (previous: {prev_rate}%)
349
+ Delta: {+/-}%
350
+
351
+ ### What worked
352
+ - {observation}
353
+
354
+ ### What failed
355
+ - {test}: {reason}
356
+
357
+ ### Pattern detected
358
+ - {pattern, e.g., "all failures in auth module"}
359
+
360
+ ### Strategy assessment
361
+ - Current strategy: {effective|ineffective|partially_effective}
362
+ - Recommendation: {keep|switch_to_X}
363
+ ```
364
+
365
+ #### Step 3c: Adjust Strategy (Adaptive Strategy Engine)
366
+
367
+ | Condition | Strategy | Behavior |
368
+ |-----------|----------|----------|
369
+ | Iteration 1-2 | Conservative | Fix obvious failures, don't refactor |
370
+ | Pass rate >80% AND failures similar to previous | Aggressive | Batch-fix related failures together |
371
+ | New regressions appeared | Surgical | Revert last changes, fix regression only |
372
+ | Stuck 3+ iterations (rate not improving) | Reflective | Step back, re-analyze root cause pattern |
373
+
374
+ **Strategy transitions**:
375
+ ```
376
+ Conservative -> (pass rate >80%) -> Aggressive
377
+ Aggressive -> (regression) -> Surgical
378
+ Surgical -> (regression fixed) -> Aggressive
379
+ Any -> (stuck 3+ iters) -> Reflective
380
+ Reflective -> (new insight) -> Conservative (restart approach)
381
+ ```
382
+
383
+ Update `state.json` with new strategy and iteration count.
384
+
385
+ #### Step 3d: Convergence Check
386
+
387
+ - If `overall_pass_rate >= target_coverage`: **CONVERGED** -> finalize
388
+ - If `iteration >= max_iterations`: **MAX_ITER_REACHED** -> finalize
389
+ - Otherwise: **ITERATE** -> reset pending tasks for failing layers, go back to Phase 2
390
+
391
+ #### Step 3e: Finalize
392
+
393
+ 1. Read final master `tasks.csv`
394
+ 2. Export as `results.csv`
395
+ 3. Build `summary.json`:
396
+
397
+ ```json
398
+ {
399
+ "phase": "<phase>",
400
+ "completed_at": "<ISO>",
401
+ "session_id": "<session-id>",
402
+ "iterations": 3,
403
+ "final_pass_rate": 97.5,
404
+ "converged": true,
405
+ "convergence_threshold": 95,
406
+ "strategy_history": ["conservative", "conservative", "aggressive"],
407
+ "layers": {
408
+ "L0": { "status": "pass" },
409
+ "L1": { "total": 15, "passed": 15, "failed": 0, "pass_rate": 100.0 },
410
+ "L2": { "total": 8, "passed": 7, "failed": 1, "pass_rate": 87.5 },
411
+ "L3": { "total": 4, "passed": 4, "failed": 0, "pass_rate": 100.0 }
412
+ },
413
+ "bugs_discovered": [],
414
+ "regressions_fixed": []
415
+ }
416
+ ```
417
+
418
+ 4. Generate `context.md`:
419
+
420
+ ```markdown
421
+ # Integration Test Report -- Phase {phase}
422
+
423
+ ## Summary
424
+ - Iterations: {N}/{max_iter}
425
+ - Converged: {yes/no} (threshold: {threshold}%)
426
+ - Final pass rate: {rate}%
427
+ - Strategy: {final_strategy} (transitioned {N} times)
428
+
429
+ ## Layer Results
430
+ | Layer | Status | Passed | Failed | Pass Rate | Coverage |
431
+ |-------|--------|--------|--------|-----------|----------|
432
+ | L0 Static | {pass/fail} | -- | -- | -- | -- |
433
+ | L1 Unit | {status} | {P} | {F} | {rate}% | {cov}% |
434
+ | L2 Integration | {status} | {P} | {F} | {rate}% | {cov}% |
435
+ | L3 E2E | {status} | {P} | {F} | {rate}% | {cov}% |
436
+
437
+ ## Iteration History
438
+ | Iter | Strategy | Pass Rate | Delta | Action |
439
+ |------|----------|-----------|-------|--------|
440
+ | 1 | conservative | 72.0% | -- | fixed 3 type errors |
441
+ | 2 | conservative | 85.5% | +13.5% | fixed auth test fixtures |
442
+ | 3 | aggressive | 97.5% | +12.0% | batch-fixed API tests |
443
+
444
+ ## Reflection Summary
445
+ {key insights from reflection-log.md}
446
+
447
+ ## Bugs Discovered
448
+ {list of bugs found during testing}
449
+
450
+ ## Next Steps
451
+ {suggested_next_command}
452
+ ```
453
+
454
+ 5. Copy `summary.json` to phase `.tests/integration/` directory.
455
+
456
+ 6. Update `index.json` with integration test status.
457
+
458
+ 7. Display summary.
459
+
460
+ **Next step routing**:
461
+
462
+ | Result | Suggestion |
463
+ |--------|------------|
464
+ | Converged (>=target%) | `maestro-verify {phase}` to update validation |
465
+ | Max iter, >80% | `quality-test {phase}` for manual UAT on remaining gaps |
466
+ | Max iter, <80% | `quality-debug` for deep investigation |
467
+ | Bugs discovered | `maestro-plan {phase} --gaps` to plan fixes |
468
+
469
+ ### Shared Discovery Board Protocol
470
+
471
+ #### Standard Discovery Types
472
+
473
+ | Type | Dedup Key | Data Schema | Description |
474
+ |------|-----------|-------------|-------------|
475
+ | `code_pattern` | `data.name` | `{name, file, description}` | Reusable code pattern found |
476
+ | `integration_point` | `data.file` | `{file, description, exports[]}` | Module connection point |
477
+ | `convention` | singleton | `{naming, imports, formatting}` | Project code conventions |
478
+ | `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
479
+ | `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
480
+
481
+ #### Domain Discovery Types
482
+
483
+ | Type | Dedup Key | Data Schema | Description |
484
+ |------|-----------|-------------|-------------|
485
+ | `test_command` | `data.layer` | `{layer, command, flags, cwd}` | Working test command for a layer |
486
+ | `test_fixture` | `data.name` | `{name, file, setup, teardown}` | Shared test fixture or DB seed |
487
+ | `coverage_gap` | `data.module` | `{module, layer, uncovered_areas[]}` | Coverage gap in a module |
488
+ | `regression` | `data.test` | `{test, file, previous_status, current_status}` | Test that regressed |
489
+ | `flaky_test` | `data.test` | `{test, file, fail_rate, pattern}` | Intermittently failing test |
490
+
491
+ #### Protocol
492
+
493
+ 1. **Read** `{session_folder}/discoveries.ndjson` before own test execution
494
+ 2. **Skip covered**: If discovery of same type + dedup key exists, skip
495
+ 3. **Write immediately**: Append findings as found
496
+ 4. **Append-only**: Never modify or delete
497
+ 5. **Deduplicate**: Check before writing
498
+
499
+ ```bash
500
+ echo '{"ts":"<ISO>","worker":"{id}","type":"test_command","data":{"layer":"L1","command":"npx vitest run --reporter=verbose","flags":"--testPathPattern=unit","cwd":"."}}' >> {session_folder}/discoveries.ndjson
501
+ ```
502
+ </execution>
503
+
504
+ <error_codes>
505
+
506
+ | Error | Resolution |
507
+ |-------|------------|
508
+ | Phase directory not found | Abort with error: "Phase {N} not found" |
509
+ | No test framework detected | Abort with error: "No test framework detected (E003)" |
510
+ | L0 static analysis fails | Record failures, proceed to L1 (type errors are informational) |
511
+ | All tasks in a layer failed | Gate check: skip subsequent layers for this iteration |
512
+ | Agent timeout | Mark as failed, continue with remaining agents in wave |
513
+ | Max iterations without convergence | Finalize with current results, warn (W001) |
514
+ | Regression detected | Switch to Surgical strategy (W002) |
515
+ | Stuck 3+ iterations | Switch to Reflective strategy (W003) |
516
+ | CSV parse error | Validate format, show line number |
517
+ | discoveries.ndjson corrupt | Ignore malformed lines |
518
+ | Continue mode: no session found | List available sessions |
519
+ | state.json missing on resume | Rebuild from tasks.csv status column |
520
+ </error_codes>
521
+
522
+ <success_criteria>
523
+ - [ ] Session initialized with state.json and reflection-log.md
524
+ - [ ] tasks.csv generated with correct layer/wave assignments and dependencies
525
+ - [ ] All waves executed sequentially (L0 -> L1 -> L2 -> L3) with gate checks
526
+ - [ ] Reflection logged after each iteration with strategy assessment
527
+ - [ ] Strategy engine transitions applied correctly based on pass rates
528
+ - [ ] Convergence reached or max iterations exhausted
529
+ - [ ] results.csv, summary.json, and context.md generated
530
+ - [ ] Temporary wave-{N}.csv files cleaned up after merge
531
+ - [ ] discoveries.ndjson maintained as append-only across all waves
532
+ </success_criteria>