maestro-flow 0.4.6 → 0.4.8

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 (105) hide show
  1. package/.claude/commands/maestro-ralph.md +548 -377
  2. package/.claude/commands/maestro.md +220 -191
  3. package/.codex/skills/maestro/SKILL.md +495 -462
  4. package/.codex/skills/maestro-collab/SKILL.md +218 -117
  5. package/.codex/skills/maestro-execute/SKILL.md +13 -11
  6. package/.codex/skills/maestro-milestone-audit/SKILL.md +12 -10
  7. package/.codex/skills/maestro-ralph/SKILL.md +491 -339
  8. package/.codex/skills/maestro-ui-codify/SKILL.md +18 -16
  9. package/.codex/skills/manage-codebase-rebuild/SKILL.md +20 -13
  10. package/.codex/skills/manage-issue-discover/SKILL.md +19 -17
  11. package/.codex/skills/quality-debug/SKILL.md +35 -31
  12. package/.codex/skills/quality-refactor/SKILL.md +20 -12
  13. package/.codex/skills/quality-review/SKILL.md +21 -17
  14. package/.codex/skills/team-coordinate/SKILL.md +462 -235
  15. package/.codex/skills/team-coordinate/specs/role-catalog.md +132 -0
  16. package/.codex/skills/team-lifecycle-v4/SKILL.md +445 -191
  17. package/.codex/skills/team-quality-assurance/SKILL.md +205 -161
  18. package/.codex/skills/team-review/SKILL.md +198 -159
  19. package/.codex/skills/team-tech-debt/SKILL.md +214 -144
  20. package/.codex/skills/team-testing/SKILL.md +210 -158
  21. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +25 -33
  22. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
  23. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js +9 -3
  24. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js.map +1 -1
  25. package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js +5 -2
  26. package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js.map +1 -1
  27. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +20 -8
  28. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  29. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js +6 -3
  30. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js.map +1 -1
  31. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js +7 -1
  32. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js.map +1 -1
  33. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.d.ts +2 -0
  34. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js +40 -15
  35. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js.map +1 -1
  36. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.d.ts +1 -0
  37. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js +59 -0
  38. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js.map +1 -0
  39. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.d.ts +1 -0
  40. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js +78 -0
  41. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js.map +1 -0
  42. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.d.ts +25 -0
  43. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js +40 -0
  44. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js.map +1 -0
  45. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.d.ts +1 -0
  46. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js +89 -0
  47. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js.map +1 -0
  48. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +19 -8
  49. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
  50. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.d.ts +6 -0
  51. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js +7 -1
  52. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js.map +1 -1
  53. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.d.ts +1 -0
  54. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js +46 -0
  55. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js.map +1 -0
  56. package/dashboard/dist-server/shared/agent-types.d.ts +6 -0
  57. package/dist/shared/agent-types.d.ts +6 -0
  58. package/dist/shared/agent-types.d.ts.map +1 -1
  59. package/dist/src/agents/cli-agent-runner.d.ts +3 -0
  60. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  61. package/dist/src/agents/cli-agent-runner.js +1 -0
  62. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  63. package/dist/src/commands/delegate.d.ts +2 -0
  64. package/dist/src/commands/delegate.d.ts.map +1 -1
  65. package/dist/src/commands/delegate.js +18 -0
  66. package/dist/src/commands/delegate.js.map +1 -1
  67. package/dist/src/config/cli-tools-config.d.ts +3 -0
  68. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  69. package/dist/src/config/cli-tools-config.js.map +1 -1
  70. package/package.json +1 -1
  71. package/shared/agent-types.ts +237 -231
  72. package/.codex/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +0 -247
  73. package/.codex/skills/team-coordinate/roles/coordinator/commands/dispatch.md +0 -126
  74. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +0 -265
  75. package/.codex/skills/team-coordinate/roles/coordinator/role.md +0 -403
  76. package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +0 -113
  77. package/.codex/skills/team-coordinate/specs/pipelines.md +0 -97
  78. package/.codex/skills/team-coordinate/specs/quality-gates.md +0 -112
  79. package/.codex/skills/team-coordinate/specs/role-spec-template.md +0 -192
  80. package/.codex/skills/team-executor/SKILL.md +0 -116
  81. package/.codex/skills/team-executor/roles/executor/commands/monitor.md +0 -213
  82. package/.codex/skills/team-executor/roles/executor/role.md +0 -173
  83. package/.codex/skills/team-executor/specs/session-schema.md +0 -230
  84. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +0 -56
  85. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +0 -61
  86. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +0 -113
  87. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +0 -189
  88. package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +0 -100
  89. package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +0 -204
  90. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +0 -72
  91. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +0 -108
  92. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +0 -163
  93. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +0 -177
  94. package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +0 -71
  95. package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +0 -90
  96. package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +0 -135
  97. package/.codex/skills/team-review/roles/coordinator/role.md +0 -176
  98. package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +0 -47
  99. package/.codex/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +0 -163
  100. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +0 -133
  101. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +0 -173
  102. package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +0 -70
  103. package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +0 -106
  104. package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +0 -156
  105. package/.codex/skills/team-testing/roles/coordinator/role.md +0 -185
@@ -68,15 +68,17 @@ $maestro-ui-codify "src/styles" --output-dir .workflow/packages --overwrite -y
68
68
  ### tasks.csv (Master State)
69
69
 
70
70
  ```csv
71
- id,wave,title,description,agent_type,deps,status,findings,output_path,error
72
- "discover-1","1","Discover design files","Scan source directory, categorize files by type (CSS/SCSS/JS/TS/HTML), build file inventory with import relationships","discover","","","","",""
73
- "style-1","2","Extract visual design tokens","Extract color, typography, spacing, border, shadow tokens from source files. Output design-tokens.json","extract-style","discover-1","","","",""
74
- "anim-1","2","Extract animation tokens","Extract animation/transition declarations: keyframes, durations, easings, motion patterns. Output animation-tokens.json","extract-animation","discover-1","","","",""
75
- "layout-1","2","Extract layout patterns","Extract component layout patterns: grid/flex systems, responsive breakpoints, container patterns. Output layout-templates.json","extract-layout","discover-1","","","",""
76
- "package-1","3","Generate reference package","Copy token JSONs to package dir, generate preview.html + preview.css interactive showcase","package","style-1;anim-1;layout-1","","","",""
77
- "knowhow-1","4","Build knowledge assets","Read token JSONs, build knowhow-manifest.json, write knowhow files + spec entries, cleanup temp workspace","knowhow","package-1","","","",""
71
+ id,wave,title,description,agent_type,deps
72
+ "discover-1","1","Discover design files","Scan source directory, categorize files by type (CSS/SCSS/JS/TS/HTML), build file inventory with import relationships","discover",""
73
+ "style-1","2","Extract visual design tokens","Extract color, typography, spacing, border, shadow tokens from source files. Output design-tokens.json","extract-style","discover-1"
74
+ "anim-1","2","Extract animation tokens","Extract animation/transition declarations: keyframes, durations, easings, motion patterns. Output animation-tokens.json","extract-animation","discover-1"
75
+ "layout-1","2","Extract layout patterns","Extract component layout patterns: grid/flex systems, responsive breakpoints, container patterns. Output layout-templates.json","extract-layout","discover-1"
76
+ "package-1","3","Generate reference package","Copy token JSONs to package dir, generate preview.html + preview.css interactive showcase","package","style-1;anim-1;layout-1"
77
+ "knowhow-1","4","Build knowledge assets","Read token JSONs, build knowhow-manifest.json, write knowhow files + spec entries, cleanup temp workspace","knowhow","package-1"
78
78
  ```
79
79
 
80
+ **Column separation rule**: Input columns and Output columns MUST NOT share names. Wave CSV only contains Input columns. Output columns are returned exclusively via output_schema.
81
+
80
82
  **Columns**:
81
83
 
82
84
  | Column | Phase | Description |
@@ -87,7 +89,7 @@ id,wave,title,description,agent_type,deps,status,findings,output_path,error
87
89
  | `description` | Input | Detailed instructions for this task |
88
90
  | `agent_type` | Input | Agent type: discover/extract-style/extract-animation/extract-layout/package/knowhow |
89
91
  | `deps` | Input | Semicolon-separated dependency task IDs |
90
- | `status` | Output | `pending` -> `completed` / `failed` |
92
+ | `result_status` | Output | `completed` / `failed` (returned via output_schema) |
91
93
  | `findings` | Output | Key findings summary (max 500 chars) |
92
94
  | `output_path` | Output | Path to generated artifact |
93
95
  | `error` | Output | Error message if failed |
@@ -272,11 +274,11 @@ spawn_agents_on_csv({
272
274
  max_concurrency: 1,
273
275
  max_runtime_seconds: 1800,
274
276
  output_csv_path: `${sessionFolder}/wave-1-results.csv`,
275
- output_schema: { id, status: ["completed"|"failed"], findings, output_path, error }
277
+ output_schema: { id, result_status: ["completed"|"failed"], findings, output_path, error }
276
278
  })
277
279
  ```
278
280
 
279
- Merge results into master `tasks.csv`, delete `wave-1.csv`.
281
+ Merge wave-1-results.csv into master `tasks.csv`: map `result_status` -> master `status` column, then delete `wave-1.csv` and `wave-1-results.csv`.
280
282
 
281
283
  #### Wave 2: Parallel Extraction (3 agents)
282
284
 
@@ -290,11 +292,11 @@ spawn_agents_on_csv({
290
292
  max_concurrency: 3,
291
293
  max_runtime_seconds: 3600,
292
294
  output_csv_path: `${sessionFolder}/wave-2-results.csv`,
293
- output_schema: { id, status: ["completed"|"failed"], findings, output_path, error }
295
+ output_schema: { id, result_status: ["completed"|"failed"], findings, output_path, error }
294
296
  })
295
297
  ```
296
298
 
297
- Merge results into master `tasks.csv`, delete `wave-2.csv`.
299
+ Merge wave-2-results.csv into master `tasks.csv`: map `result_status` -> master `status` column, then delete `wave-2.csv` and `wave-2-results.csv`.
298
300
 
299
301
  **Degradation**: If animation agent fails (W001), continue — animation is optional. If style or layout agent fails, warn but continue with available results.
300
302
 
@@ -310,11 +312,11 @@ spawn_agents_on_csv({
310
312
  max_concurrency: 1,
311
313
  max_runtime_seconds: 1800,
312
314
  output_csv_path: `${sessionFolder}/wave-3-results.csv`,
313
- output_schema: { id, status: ["completed"|"failed"], findings, output_path, error }
315
+ output_schema: { id, result_status: ["completed"|"failed"], findings, output_path, error }
314
316
  })
315
317
  ```
316
318
 
317
- Merge results into master `tasks.csv`, delete `wave-3.csv`.
319
+ Merge wave-3-results.csv into master `tasks.csv`: map `result_status` -> master `status` column, then delete `wave-3.csv` and `wave-3-results.csv`.
318
320
 
319
321
  #### Wave 4: Knowledge Assets (Barrier)
320
322
 
@@ -328,11 +330,11 @@ spawn_agents_on_csv({
328
330
  max_concurrency: 1,
329
331
  max_runtime_seconds: 1800,
330
332
  output_csv_path: `${sessionFolder}/wave-4-results.csv`,
331
- output_schema: { id, status: ["completed"|"failed"], findings, output_path, error }
333
+ output_schema: { id, result_status: ["completed"|"failed"], findings, output_path, error }
332
334
  })
333
335
  ```
334
336
 
335
- Merge results into master `tasks.csv`, delete `wave-4.csv`.
337
+ Merge wave-4-results.csv into master `tasks.csv`: map `result_status` -> master `status` column, then delete `wave-4.csv` and `wave-4-results.csv`.
336
338
 
337
339
  ### Step 5: Results & Completion
338
340
 
@@ -80,12 +80,12 @@ When `--yes` or `-y`: Auto-confirm rebuild (implies --force), skip all prompts.
80
80
  ### tasks.csv (Master State)
81
81
 
82
82
  ```csv
83
- id,title,description,doc_dimension,output_path,deps,context_from,wave,status,findings,error
84
- "1","Component Scanner","Scan all source directories for components: models, services, controllers, utils, types, config, middleware, core modules. For each component extract exported symbols, determine type, record code locations. Output JSON array of component entries with id (TC-NNN), name, type, code_locations, symbols.","components",".workflow/codebase/doc-index.json#components","","","1","","",""
85
- "2","Feature Mapper","Group discovered components by domain/functional area using directory proximity, naming patterns, and import relationships. Map features to requirements if .workflow/.spec/ exists. Output JSON array of feature entries with id (FT-NNN), name, status, component_ids, requirement_ids, phase.","features",".workflow/codebase/doc-index.json#features","","","1","","",""
86
- "3","Requirement Linker","If .workflow/.spec/ exists, scan SPEC-*/requirements/REQ-*.md files. Parse requirement metadata (title, priority, acceptance_criteria). Match requirements to features by keyword analysis. Also scan for ADR-*.md architecture decisions. Output JSON arrays for requirements and architecture_decisions.","requirements",".workflow/codebase/doc-index.json#requirements","","","1","","",""
87
- "4","Tech Registry Writer","For each component discovered, generate a markdown documentation file in .workflow/codebase/tech-registry/{slug}.md with: ID, type, features, code locations, exported symbols, dependencies. Generate _index.md with component table. Output file count and paths.","tech-registry",".workflow/codebase/tech-registry/","","","1","","",""
88
- "5","Feature Map Writer","For each feature discovered, generate a markdown documentation file in .workflow/codebase/feature-maps/{slug}.md with: ID, status, phase, requirements, component table. Generate _index.md with feature table. Output file count and paths.","feature-maps",".workflow/codebase/feature-maps/","","","1","","",""
83
+ id,title,description,doc_dimension,output_path,deps,context_from,wave
84
+ "1","Component Scanner","Scan all source directories for components: models, services, controllers, utils, types, config, middleware, core modules. For each component extract exported symbols, determine type, record code locations. Output JSON array of component entries with id (TC-NNN), name, type, code_locations, symbols.","components",".workflow/codebase/doc-index.json#components","","","1"
85
+ "2","Feature Mapper","Group discovered components by domain/functional area using directory proximity, naming patterns, and import relationships. Map features to requirements if .workflow/.spec/ exists. Output JSON array of feature entries with id (FT-NNN), name, status, component_ids, requirement_ids, phase.","features",".workflow/codebase/doc-index.json#features","","","1"
86
+ "3","Requirement Linker","If .workflow/.spec/ exists, scan SPEC-*/requirements/REQ-*.md files. Parse requirement metadata (title, priority, acceptance_criteria). Match requirements to features by keyword analysis. Also scan for ADR-*.md architecture decisions. Output JSON arrays for requirements and architecture_decisions.","requirements",".workflow/codebase/doc-index.json#requirements","","","1"
87
+ "4","Tech Registry Writer","For each component discovered, generate a markdown documentation file in .workflow/codebase/tech-registry/{slug}.md with: ID, type, features, code locations, exported symbols, dependencies. Generate _index.md with component table. Output file count and paths.","tech-registry",".workflow/codebase/tech-registry/","","","1"
88
+ "5","Feature Map Writer","For each feature discovered, generate a markdown documentation file in .workflow/codebase/feature-maps/{slug}.md with: ID, status, phase, requirements, component table. Generate _index.md with feature table. Output file count and paths.","feature-maps",".workflow/codebase/feature-maps/","","","1"
89
89
  ```
90
90
 
91
91
  **Columns**:
@@ -100,9 +100,16 @@ id,title,description,doc_dimension,output_path,deps,context_from,wave,status,fin
100
100
  | `deps` | Input | Empty (all independent) |
101
101
  | `context_from` | Input | Empty (no cross-task context needed) |
102
102
  | `wave` | Computed | Always 1 (single wave, independent parallel) |
103
- | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
104
- | `findings` | Output | Generation summary -- counts, paths, notes (max 500 chars) |
105
- | `error` | Output | Error message if failed |
103
+
104
+ **Output columns** (returned exclusively via `output_schema`, NOT in wave CSV):
105
+
106
+ | Column | Description |
107
+ |--------|-------------|
108
+ | `result_status` | `completed` / `failed` (mapped to master `status` on merge) |
109
+ | `result_findings` | Generation summary -- counts, paths, notes (max 500 chars) |
110
+ | `error` | Error message if failed |
111
+
112
+ **Column separation rule**: Input columns and Output columns MUST NOT share names. Wave CSV only contains Input columns + prev_context. Output columns are returned exclusively via output_schema.
106
113
 
107
114
  ### Per-Wave CSV (Temporary)
108
115
 
@@ -207,16 +214,16 @@ spawn_agents_on_csv({
207
214
  type: "object",
208
215
  properties: {
209
216
  id: { type: "string" },
210
- status: { type: "string", enum: ["completed", "failed"] },
211
- findings: { type: "string" },
217
+ result_status: { type: "string", enum: ["completed", "failed"] },
218
+ result_findings: { type: "string" },
212
219
  error: { type: "string" }
213
220
  },
214
- required: ["id", "status", "findings"]
221
+ required: ["id", "result_status", "result_findings"]
215
222
  }
216
223
  })
217
224
  ```
218
225
 
219
- Merge `wave-1-results.csv` into master `tasks.csv`, delete `wave-1.csv`.
226
+ Merge `wave-1-results.csv` into master `tasks.csv`: map `result_status` -> master `status`, `result_findings` -> master `findings`, copy `error` as-is. After merge, delete temporary files (`wave-1.csv` and `wave-1-results.csv`).
220
227
 
221
228
  ### Phase 3: Results -> .workflow/codebase/
222
229
 
@@ -78,16 +78,16 @@ When `--yes` or `-y`: Auto-confirm perspective selection, skip interactive valid
78
78
  ### tasks.csv (Master State)
79
79
 
80
80
  ```csv
81
- id,title,description,perspective,scope_glob,deps,context_from,wave,status,findings,issues_found,severity_distribution,error
82
- "1","Security Scan","Scan codebase for security vulnerabilities: authentication bypass, injection flaws, XSS, CSRF, sensitive data exposure, insecure crypto, secrets in code. Rate each finding critical/high/medium/low with file:line references.","security","src/**/*.{ts,tsx,js,jsx}","","","1","","","","",""
83
- "2","Performance Scan","Scan codebase for performance issues: N+1 queries, unbounded loops, missing caching, memory leaks, large payloads, blocking operations, unoptimized algorithms.","performance","src/**/*.{ts,tsx,js,jsx}","","","1","","","","",""
84
- "3","Reliability Scan","Scan codebase for reliability issues: unhandled errors, missing retry logic, race conditions, data integrity gaps, missing graceful degradation, silent failures.","reliability","src/**/*.{ts,tsx,js,jsx}","","","1","","","","",""
85
- "4","Maintainability Scan","Scan codebase for maintainability issues: code duplication, tight coupling, missing abstractions, unclear naming, dead code, overly complex functions.","maintainability","src/**/*.{ts,tsx,js,jsx}","","","1","","","","",""
86
- "5","Scalability Scan","Scan codebase for scalability issues: hardcoded limits, single-threaded bottlenecks, stateful assumptions, schema rigidity, missing pagination.","scalability","src/**/*.{ts,tsx,js,jsx}","","","1","","","","",""
87
- "6","UX Scan","Scan codebase for UX issues: confusing flows, missing user feedback, inconsistent behavior, missing loading states, poor error messages.","ux","src/**/*.{ts,tsx,js,jsx}","","","1","","","","",""
88
- "7","Accessibility Scan","Scan codebase for accessibility issues: missing ARIA labels, keyboard navigation gaps, color contrast problems, missing alt text, focus management issues.","accessibility","src/**/*.{ts,tsx,js,jsx}","","","1","","","","",""
89
- "8","Compliance Scan","Scan codebase for compliance issues: logging gaps, missing audit trails, data retention violations, privacy control gaps, regulatory requirement gaps.","compliance","src/**/*.{ts,tsx,js,jsx}","","","1","","","","",""
90
- "9","Dedup + Issue Creation","Aggregate all perspective findings. Deduplicate by file path + description similarity (keep higher severity). Generate ISS-YYYYMMDD-NNN issue records. Append to .workflow/issues/issues.jsonl.","dedup","","1;2;3;4;5;6;7;8","1;2;3;4;5;6;7;8","2","","","","",""
81
+ id,title,description,perspective,scope_glob,deps,context_from,wave
82
+ "1","Security Scan","Scan codebase for security vulnerabilities: authentication bypass, injection flaws, XSS, CSRF, sensitive data exposure, insecure crypto, secrets in code. Rate each finding critical/high/medium/low with file:line references.","security","src/**/*.{ts,tsx,js,jsx}","","","1"
83
+ "2","Performance Scan","Scan codebase for performance issues: N+1 queries, unbounded loops, missing caching, memory leaks, large payloads, blocking operations, unoptimized algorithms.","performance","src/**/*.{ts,tsx,js,jsx}","","","1"
84
+ "3","Reliability Scan","Scan codebase for reliability issues: unhandled errors, missing retry logic, race conditions, data integrity gaps, missing graceful degradation, silent failures.","reliability","src/**/*.{ts,tsx,js,jsx}","","","1"
85
+ "4","Maintainability Scan","Scan codebase for maintainability issues: code duplication, tight coupling, missing abstractions, unclear naming, dead code, overly complex functions.","maintainability","src/**/*.{ts,tsx,js,jsx}","","","1"
86
+ "5","Scalability Scan","Scan codebase for scalability issues: hardcoded limits, single-threaded bottlenecks, stateful assumptions, schema rigidity, missing pagination.","scalability","src/**/*.{ts,tsx,js,jsx}","","","1"
87
+ "6","UX Scan","Scan codebase for UX issues: confusing flows, missing user feedback, inconsistent behavior, missing loading states, poor error messages.","ux","src/**/*.{ts,tsx,js,jsx}","","","1"
88
+ "7","Accessibility Scan","Scan codebase for accessibility issues: missing ARIA labels, keyboard navigation gaps, color contrast problems, missing alt text, focus management issues.","accessibility","src/**/*.{ts,tsx,js,jsx}","","","1"
89
+ "8","Compliance Scan","Scan codebase for compliance issues: logging gaps, missing audit trails, data retention violations, privacy control gaps, regulatory requirement gaps.","compliance","src/**/*.{ts,tsx,js,jsx}","","","1"
90
+ "9","Dedup + Issue Creation","Aggregate all perspective findings. Deduplicate by file path + description similarity (keep higher severity). Generate ISS-YYYYMMDD-NNN issue records. Append to .workflow/issues/issues.jsonl.","dedup","","1;2;3;4;5;6;7;8","1;2;3;4;5;6;7;8","2"
91
91
  ```
92
92
 
93
93
  **Columns**:
@@ -102,12 +102,14 @@ id,title,description,perspective,scope_glob,deps,context_from,wave,status,findin
102
102
  | `deps` | Input | Semicolon-separated dependency task IDs |
103
103
  | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
104
104
  | `wave` | Computed | Wave number (1 = perspective scans, 2 = dedup + issue creation) |
105
- | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
105
+ | `result_status` | Output | `completed` / `failed` / `skipped` (mapped to master `status` on merge) |
106
106
  | `findings` | Output | Key scan findings summary (max 500 chars) |
107
107
  | `issues_found` | Output | JSON array of discovered issues: `[{"title":"...","severity":"critical","description":"...","location":"file:line","fix_direction":"...","affected_components":["..."]}]` |
108
108
  | `severity_distribution` | Output | JSON: `{"critical":N,"high":N,"medium":N,"low":N}` |
109
109
  | `error` | Output | Error message if failed |
110
110
 
111
+ **Column separation rule**: Input columns and Output columns MUST NOT share names. Wave CSV only contains Input columns + prev_context. Output columns are returned exclusively via output_schema.
112
+
111
113
  ### Per-Wave CSV (Temporary)
112
114
 
113
115
  Each wave generates `wave-{N}.csv` with extra `prev_context` column.
@@ -249,18 +251,18 @@ spawn_agents_on_csv({
249
251
  max_concurrency: maxConcurrency,
250
252
  max_runtime_seconds: 3600,
251
253
  output_csv_path: `${sessionFolder}/wave-1-results.csv`,
252
- output_schema: { // required: id, status, findings
253
- id: "string", status: "completed|failed",
254
+ output_schema: { // required: id, result_status, findings
255
+ id: "string", result_status: "completed|failed",
254
256
  findings: "string", issues_found: "string",
255
257
  severity_distribution: "string", error: "string"
256
258
  }
257
259
  })
258
260
  ```
259
261
 
260
- 6. Merge `wave-1-results.csv` into master `tasks.csv`
262
+ 6. Merge `wave-1-results.csv` into master `tasks.csv` (map `result_status` -> master `status` column)
261
263
  7. Save per-perspective findings to `{discoveryDir}/{perspective}-findings.json`
262
264
  8. Update `discovery-state.json` with completed perspectives
263
- 9. Delete `wave-1.csv`
265
+ 9. Delete temporary files: `wave-1.csv` and `wave-1-results.csv`
264
266
 
265
267
  **Perspective scan agent protocol**:
266
268
  - Scan all source files matching scope_glob
@@ -284,8 +286,8 @@ spawn_agents_on_csv({
284
286
  ```
285
287
  5. Write `wave-2.csv` with `prev_context` column
286
288
  6. Execute `spawn_agents_on_csv` for dedup agent
287
- 7. Merge results into master `tasks.csv`
288
- 8. Delete `wave-2.csv`
289
+ 7. Merge results into master `tasks.csv` (map `result_status` -> master `status` column)
290
+ 8. Delete temporary files: `wave-2.csv` and `wave-2-results.csv`
289
291
 
290
292
  **Dedup agent protocol**:
291
293
  - Merge all perspective findings from prev_context into single list
@@ -54,7 +54,7 @@ Find where incorrect value appears → trace backward through call chain → fix
54
54
  | |
55
55
  | Phase 3: Results Aggregation |
56
56
  | +-- Export results.csv with all investigation + fix outcomes |
57
- | +-- Generate context.md with diagnosis summary |
57
+ | +-- Generate understanding.md with diagnosis summary |
58
58
  | +-- Update UAT gaps with diagnosis (if --from-uat) |
59
59
  | +-- Update issues.jsonl with diagnosis results |
60
60
  | +-- Display summary with next steps |
@@ -83,7 +83,7 @@ $quality-debug --continue "20260318-debug-P3-jwt-expiry"
83
83
  When `--yes` or `-y`: Auto-confirm hypothesis selection, skip interactive symptom gathering (require bug description in args), use defaults for mode detection.
84
84
 
85
85
  **Output Directory**: `.workflow/.csv-wave/{session-id}/`
86
- **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (human-readable report)
86
+ **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `understanding.md` (human-readable report)
87
87
  </context>
88
88
 
89
89
  <csv_schema>
@@ -91,56 +91,60 @@ When `--yes` or `-y`: Auto-confirm hypothesis selection, skip interactive sympto
91
91
  ### tasks.csv (Master State)
92
92
 
93
93
  ```csv
94
- id,title,description,hypothesis,evidence_for,evidence_against,deps,context_from,wave,status,findings,fix_applied,verified,error
95
- "H1","Null pointer in login handler","Investigate whether login handler crashes due to null user object after failed DB lookup","User object is null when DB returns empty result; login.ts:42 dereferences without null check","","","","","1","","","","",""
96
- "H2","Missing error boundary","Investigate whether unhandled promise rejection in auth middleware propagates to 500","Auth middleware catches DB errors but not validation errors; middleware.ts:78 has no catch block","","","","","1","","","","",""
97
- "H3","Stale session token","Investigate whether expired session tokens bypass refresh logic","Session refresh only triggers on 403 but server returns 401 for expired tokens; session.ts:15","","","","","1","","","","",""
98
- "FIX-H1","Fix null pointer in login","Apply null check before user object dereference in login handler","","","","H1","H1","2","","","","",""
99
- "FIX-H3","Fix session token refresh","Update refresh trigger to also handle 401 status codes","","","","H3","H3","2","","","","",""
94
+ id,title,description,hypothesis,deps,context_from,wave
95
+ "H1","Null pointer in login handler","Investigate whether login handler crashes due to null user object after failed DB lookup","User object is null when DB returns empty result; login.ts:42 dereferences without null check","","","1"
96
+ "H2","Missing error boundary","Investigate whether unhandled promise rejection in auth middleware propagates to 500","Auth middleware catches DB errors but not validation errors; middleware.ts:78 has no catch block","","","1"
97
+ "H3","Stale session token","Investigate whether expired session tokens bypass refresh logic","Session refresh only triggers on 403 but server returns 401 for expired tokens; session.ts:15","","","1"
98
+ "FIX-H1","Fix null pointer in login","Apply null check before user object dereference in login handler","","H1","H1","2"
99
+ "FIX-H3","Fix session token refresh","Update refresh trigger to also handle 401 status codes","","H3","H3","2"
100
100
  ```
101
101
 
102
102
  **Columns**:
103
103
 
104
- | Column | Phase | Description |
104
+ | Column | Layer | Description |
105
105
  |--------|-------|-------------|
106
106
  | `id` | Input | Unique task identifier: `H{N}` for hypotheses (wave 1), `FIX-H{N}` for fixes (wave 2) |
107
107
  | `title` | Input | Short hypothesis or fix title |
108
108
  | `description` | Input | Detailed investigation/fix instructions |
109
109
  | `hypothesis` | Input | The hypothesis being tested (wave 1) or empty (wave 2) |
110
- | `evidence_for` | Output | Evidence supporting the hypothesis |
111
- | `evidence_against` | Output | Evidence refuting the hypothesis |
112
110
  | `deps` | Input | Semicolon-separated dependency task IDs (wave 2 depends on wave 1) |
113
111
  | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
114
- | `wave` | Computed | Wave number (1 = investigation, 2 = fix attempt) |
115
- | `status` | Output | `pending` -> `confirmed` / `refuted` / `inconclusive` / `fixed` / `fix_failed` / `skipped` |
112
+ | `wave` | Input | Wave number (1 = investigation, 2 = fix attempt) |
113
+ | `result_status` | Output | `confirmed` / `refuted` / `inconclusive` / `fixed` / `fix_failed` / `failed` |
116
114
  | `findings` | Output | Key findings summary (max 500 chars) |
115
+ | `evidence_for` | Output | Evidence supporting the hypothesis (wave 1) |
116
+ | `evidence_against` | Output | Evidence refuting the hypothesis (wave 1) |
117
117
  | `fix_applied` | Output | Description of fix applied (wave 2 only) |
118
118
  | `verified` | Output | `true` / `false` -- whether fix was verified to work (wave 2 only) |
119
119
  | `error` | Output | Error message if failed |
120
120
 
121
+ **Column separation rule**: Input columns and Output columns MUST NOT share names. Wave CSV only contains Input columns + `prev_context`. Output columns are returned exclusively via `output_schema`.
122
+
121
123
  ### Per-Wave CSV (Temporary)
122
124
 
123
- Each wave generates `wave-{N}.csv` with extra `prev_context` column.
125
+ Each wave generates `wave-{N}.csv` with Input columns + `prev_context` only. Output columns (`result_status`, `findings`, etc.) are NEVER included in wave CSV — they come from `output_schema` in the results CSV.
124
126
 
125
127
  ### Output Artifacts
126
128
 
127
129
  | File | Purpose | Lifecycle |
128
130
  |------|---------|-----------|
129
131
  | `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
130
- | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
132
+ | `wave-{N}.csv` | Per-wave input (temporary) | Deleted after merge |
133
+ | `wave-{N}-results.csv` | Per-wave output (temporary) | Deleted after merge into tasks.csv |
131
134
  | `results.csv` | Final export of all task results | Created in Phase 3 |
132
135
  | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
133
- | `context.md` | Human-readable diagnosis report | Created in Phase 3 |
136
+ | `understanding.md` | Human-readable diagnosis report | Created in Phase 3 |
134
137
 
135
138
  ### Session Structure
136
139
 
137
140
  ```
138
141
  .workflow/.csv-wave/{YYYYMMDD}-debug-P{N}-{slug}/
139
- +-- tasks.csv
140
- +-- results.csv
141
- +-- discoveries.ndjson
142
- +-- context.md
143
- +-- wave-{N}.csv (temporary)
142
+ +-- tasks.csv (master state, persisted)
143
+ +-- results.csv (final export, persisted)
144
+ +-- discoveries.ndjson (shared board, persisted)
145
+ +-- understanding.md (diagnosis report, persisted)
146
+ +-- wave-{N}.csv (temporary, deleted after merge)
147
+ +-- wave-{N}-results.csv (temporary, deleted after merge)
144
148
  ```
145
149
  </csv_schema>
146
150
 
@@ -151,7 +155,7 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
151
155
  4. **Context Propagation**: prev_context built from master CSV, not from memory
152
156
  5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
153
157
  6. **Skip on Refuted**: Wave 2 fix tasks skip if their hypothesis was refuted or inconclusive
154
- 7. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
158
+ 7. **Cleanup Temp Files**: Remove wave-{N}.csv AND wave-{N}-results.csv after results are merged into master tasks.csv
155
159
  8. **DO NOT STOP**: Continuous execution until all waves complete
156
160
  </invariants>
157
161
 
@@ -240,12 +244,12 @@ spawn_agents_on_csv({
240
244
  instruction: buildInvestigationInstruction(sessionFolder), // agent: ~/.codex/agents/workflow-debugger.toml
241
245
  max_concurrency: maxConcurrency, max_runtime_seconds: 3600,
242
246
  output_csv_path: `${sessionFolder}/wave-1-results.csv`,
243
- output_schema: { id, status: [confirmed|refuted|inconclusive|failed], findings, evidence_for, evidence_against, error }
247
+ output_schema: { id, result_status: [confirmed|refuted|inconclusive|failed], findings, evidence_for, evidence_against, error }
244
248
  })
245
249
  ```
246
250
 
247
- 3. Merge results into master `tasks.csv`, delete `wave-1.csv`
248
- 4. **Filter for wave 2**: Mark fix tasks as `skipped` if their hypothesis was `refuted` or `inconclusive`
251
+ 3. Merge `wave-1-results.csv` into master `tasks.csv` (map `result_status` → master `status` column), delete `wave-1.csv` and `wave-1-results.csv`
252
+ 4. **Filter for wave 2**: Mark fix tasks as `skipped` if their hypothesis `result_status` was `refuted` or `inconclusive`
249
253
 
250
254
  #### Wave 2: Fix Attempts (Parallel, Confirmed Only)
251
255
 
@@ -260,11 +264,11 @@ spawn_agents_on_csv({
260
264
  instruction: buildFixInstruction(sessionFolder), // agent: ~/.codex/agents/workflow-debugger.toml
261
265
  max_concurrency: maxConcurrency, max_runtime_seconds: 3600,
262
266
  output_csv_path: `${sessionFolder}/wave-2-results.csv`,
263
- output_schema: { id, status: [fixed|fix_failed|failed], findings, fix_applied, verified, error }
267
+ output_schema: { id, result_status: [fixed|fix_failed|failed], findings, fix_applied, verified, error }
264
268
  })
265
269
  ```
266
270
 
267
- 4. Merge results into master `tasks.csv`, delete `wave-2.csv`
271
+ 4. Merge `wave-2-results.csv` into master `tasks.csv` (map `result_status` → master `status` column), delete `wave-2.csv` and `wave-2-results.csv`
268
272
 
269
273
  ### Phase 3: Results Aggregation
270
274
 
@@ -272,11 +276,11 @@ spawn_agents_on_csv({
272
276
 
273
277
  1. Export final `tasks.csv` as `results.csv`
274
278
 
275
- 2. **Generate context.md**: Debug report with summary (mode, hypothesis/confirmed/fixed/verified counts), per-hypothesis results (hypothesis, evidence for/against, findings, status), per-fix results (fix applied, verified, findings), aggregated root causes, and next steps.
279
+ 2. **Generate understanding.md**: Debug report with summary (mode, hypothesis/confirmed/fixed/verified counts), per-hypothesis results (hypothesis, evidence for/against, findings, status), per-fix results (fix applied, verified, findings), aggregated root causes, and next steps.
276
280
 
277
281
  2b. **Debug confidence scoring**:
278
282
 
279
- Dimensions (4): hypothesis_quality, evidence_completeness, root_cause_isolation, fix_confidence. Factors (weights): evidence_depth(.30), evidence_strength(.25), coverage_breadth(.20), reproduction(.15), consistency(.10). Map to legacy: <40% = low, 40-70% = medium, >70% = high. Append confidence assessment to context.md.
283
+ Dimensions (4): hypothesis_quality, evidence_completeness, root_cause_isolation, fix_confidence. Factors (weights): evidence_depth(.30), evidence_strength(.25), coverage_breadth(.20), reproduction(.15), consistency(.10). Map to legacy: <40% = low, 40-70% = medium, >70% = high. Append confidence assessment to understanding.md.
280
284
 
281
285
  3. **UAT update** (if --from-uat): Update `uat.md` gaps with `root_cause`, `fix_direction`, `affected_files` for confirmed hypotheses.
282
286
 
@@ -353,9 +357,9 @@ echo '{"ts":"<ISO>","worker":"{id}","type":"root_cause","data":{"location":"src/
353
357
  - [ ] Wave 1 hypotheses investigated in parallel
354
358
  - [ ] Refuted/inconclusive hypotheses correctly skip wave 2 fix tasks
355
359
  - [ ] Wave 2 fixes attempted only for confirmed hypotheses
356
- - [ ] context.md produced with diagnosis summary
360
+ - [ ] understanding.md produced with diagnosis summary
357
361
  - [ ] Multi-factor confidence scored per hypothesis replacing simple high/medium/low
358
- - [ ] Confidence assessment appended to context.md
362
+ - [ ] Confidence assessment appended to understanding.md
359
363
  - [ ] UAT gaps updated (if --from-uat)
360
364
  - [ ] Issues updated with diagnosis results
361
365
  - [ ] discoveries.ndjson append-only throughout
@@ -39,10 +39,10 @@ $quality-refactor "--dir .workflow/scratch/refactor-auth-2026-03-18" # resume e
39
39
  ### tasks.csv (Master State)
40
40
 
41
41
  ```csv
42
- id,title,description,category,scope,convergence_criteria,read_first,verification_cmd,risk,deps,wave,status,findings,files_modified,tests_passed,retry_count,strategy_adjustment,error
43
- "TASK-001","Extract shared validation","Extract duplicated email/phone validation logic into shared utils module","duplication","src/auth/login.ts;src/auth/register.ts","src/utils/validation.ts contains export function validateEmail(; grep -r 'validateEmail' shows single import source","src/auth/login.ts;src/auth/register.ts;src/utils/","npm test","low","","1","","","","","0","",""
44
- "TASK-002","Simplify token refresh","Reduce cyclomatic complexity in token refresh handler from 12 to <6","complexity","src/auth/token.ts","src/auth/token.ts function refreshToken has no more than 2 levels of nesting","src/auth/token.ts;src/auth/types.ts","npm test -- --grep token","medium","","2","","","","","0","",""
45
- "TASK-003","Remove dead session code","Remove unused session cleanup functions identified in analysis","dead_code","src/session/","grep -r 'cleanupExpired' returns 0 matches outside test files","src/session/cleanup.ts","npm test","low","","1","","","","","0","",""
42
+ id,title,description,category,scope,convergence_criteria,read_first,verification_cmd,risk,deps,wave,status,retry_count,strategy_adjustment
43
+ "TASK-001","Extract shared validation","Extract duplicated email/phone validation logic into shared utils module","duplication","src/auth/login.ts;src/auth/register.ts","src/utils/validation.ts contains export function validateEmail(; grep -r 'validateEmail' shows single import source","src/auth/login.ts;src/auth/register.ts;src/utils/","npm test","low","","1","pending","0",""
44
+ "TASK-002","Simplify token refresh","Reduce cyclomatic complexity in token refresh handler from 12 to <6","complexity","src/auth/token.ts","src/auth/token.ts function refreshToken has no more than 2 levels of nesting","src/auth/token.ts;src/auth/types.ts","npm test -- --grep token","medium","","2","pending","0",""
45
+ "TASK-003","Remove dead session code","Remove unused session cleanup functions identified in analysis","dead_code","src/session/","grep -r 'cleanupExpired' returns 0 matches outside test files","src/session/cleanup.ts","npm test","low","","1","pending","0",""
46
46
  ```
47
47
 
48
48
  **Columns**:
@@ -60,13 +60,21 @@ id,title,description,category,scope,convergence_criteria,read_first,verification
60
60
  | `risk` | Input | `low` / `medium` / `high` |
61
61
  | `deps` | Input | Semicolon-separated dependency task IDs |
62
62
  | `wave` | Computed | Wave number — same-risk independent tasks can share a wave |
63
- | `status` | Output | `pending` -> `completed` / `failed` / `blocked` / `skipped` |
64
- | `findings` | Output | Implementation notes (max 500 chars) |
65
- | `files_modified` | Output | Semicolon-separated list of changed files |
66
- | `tests_passed` | Output | `true` / `false` — verification result |
63
+ | `status` | Input | Task lifecycle state in master CSV: `pending` / `completed` / `failed` / `blocked` / `skipped` |
67
64
  | `retry_count` | State | Current retry count (max 2) |
68
65
  | `strategy_adjustment` | State | Strategy change note for retry |
69
- | `error` | Output | Error message if failed |
66
+
67
+ **Output columns** (returned exclusively via `output_schema`, NOT in wave CSV):
68
+
69
+ | Column | Description |
70
+ |--------|-------------|
71
+ | `result_status` | `completed` / `failed` / `blocked` — wave execution result |
72
+ | `findings` | Implementation notes (max 500 chars) |
73
+ | `files_modified` | Semicolon-separated list of changed files |
74
+ | `tests_passed` | `true` / `false` — verification result |
75
+ | `error` | Error message if failed |
76
+
77
+ **Column separation rule**: Input columns and Output columns MUST NOT share names. Wave CSV only contains Input columns. Output columns are returned exclusively via output_schema.
70
78
 
71
79
  ### Per-Wave CSV (Temporary)
72
80
 
@@ -168,16 +176,16 @@ spawn_agents_on_csv({
168
176
  2. Apply refactoring described in description targeting scope files
169
177
  3. Verify convergence_criteria via grep (all criteria must pass)
170
178
  4. Run verification_cmd and report test result
171
- 5. If tests fail: revert ALL changes for this task, set status=failed
179
+ 5. If tests fail: revert ALL changes for this task, set result_status=failed
172
180
  6. Append discoveries to ${sessionFolder}/discoveries.ndjson
173
181
  Report: files_modified (semicolon-separated), tests_passed (true/false), findings (what was changed and why)`,
174
182
  max_concurrency: 1, max_runtime_seconds: 1800,
175
183
  output_csv_path: `${sessionFolder}/wave-${N}-results.csv`,
176
- output_schema: { id, status: [completed|failed|blocked], findings, files_modified, tests_passed, error }
184
+ output_schema: { id, result_status: [completed|failed|blocked], findings, files_modified, tests_passed, error }
177
185
  })
178
186
  ```
179
187
 
180
- 4. Merge results into master `tasks.csv`, delete `wave-{N}.csv`
188
+ 4. Merge results into master `tasks.csv`: map `result_status` -> master `status` column, copy `findings`, `files_modified`, `tests_passed`, `error` into master. Delete temporary `wave-{N}.csv` and `wave-{N}-results.csv`.
181
189
 
182
190
  **5b. Reflect per wave:**
183
191
 
@@ -81,19 +81,19 @@ When `--yes` or `-y`: Auto-confirm dimension selection, skip interactive validat
81
81
  ### tasks.csv (Master State)
82
82
 
83
83
  ```csv
84
- id,title,description,dimension,changed_files,project_specs,review_level,deps,context_from,wave,status,findings,severity_counts,top_issues,error
85
- "1","Correctness Review","Review all changed files for correctness: logic errors, missing edge cases, incorrect return values, null/undefined handling, off-by-one errors. Classify each finding as critical/high/medium/low with file:line references.","correctness","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","Existing patterns use Result type for error handling","standard","","","1","","","","",""
86
- "2","Security Review","Review all changed files for security vulnerabilities: injection flaws, XSS, CSRF, auth bypass, sensitive data exposure, insecure crypto. Reference OWASP Top 10. Classify each finding.","security","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","Auth uses bcrypt + JWT","standard","","","1","","","","",""
87
- "3","Performance Review","Review all changed files for performance issues: N+1 queries, unnecessary re-renders, memory leaks, blocking operations, unoptimized algorithms.","performance","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
88
- "4","Architecture Review","Review all changed files for architecture issues: layer violations, circular dependencies, inappropriate coupling, missing abstractions, SRP violations.","architecture","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","ESM modules, strict TypeScript","standard","","","1","","","","",""
89
- "5","Maintainability Review","Review all changed files for maintainability: code duplication, overly complex functions, poor naming, missing types, unclear control flow.","maintainability","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
90
- "6","Best Practices Review","Review all changed files for best-practice violations: error handling gaps, missing validation, hardcoded values, deprecated API usage, inconsistent patterns.","best-practices","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1","","","","",""
91
- "7","Aggregate + Deep-Dive","Aggregate all dimension findings. Calculate severity distribution. Determine verdict (PASS/WARN/BLOCK). If critical findings exist, perform deep-dive with cross-file impact analysis.","aggregation","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","1;2;3;4;5;6","1;2;3;4;5;6","2","","","","",""
84
+ id,title,description,dimension,changed_files,project_specs,review_level,deps,context_from,wave
85
+ "1","Correctness Review","Review all changed files for correctness: logic errors, missing edge cases, incorrect return values, null/undefined handling, off-by-one errors. Classify each finding as critical/high/medium/low with file:line references.","correctness","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","Existing patterns use Result type for error handling","standard","","","1"
86
+ "2","Security Review","Review all changed files for security vulnerabilities: injection flaws, XSS, CSRF, auth bypass, sensitive data exposure, insecure crypto. Reference OWASP Top 10. Classify each finding.","security","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","Auth uses bcrypt + JWT","standard","","","1"
87
+ "3","Performance Review","Review all changed files for performance issues: N+1 queries, unnecessary re-renders, memory leaks, blocking operations, unoptimized algorithms.","performance","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1"
88
+ "4","Architecture Review","Review all changed files for architecture issues: layer violations, circular dependencies, inappropriate coupling, missing abstractions, SRP violations.","architecture","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","ESM modules, strict TypeScript","standard","","","1"
89
+ "5","Maintainability Review","Review all changed files for maintainability: code duplication, overly complex functions, poor naming, missing types, unclear control flow.","maintainability","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1"
90
+ "6","Best Practices Review","Review all changed files for best-practice violations: error handling gaps, missing validation, hardcoded values, deprecated API usage, inconsistent patterns.","best-practices","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","","","1"
91
+ "7","Aggregate + Deep-Dive","Aggregate all dimension findings. Calculate severity distribution. Determine verdict (PASS/WARN/BLOCK). If critical findings exist, perform deep-dive with cross-file impact analysis.","aggregation","src/auth/login.ts;src/auth/register.ts;src/utils/validation.ts","","standard","1;2;3;4;5;6","1;2;3;4;5;6","2"
92
92
  ```
93
93
 
94
94
  **Columns**:
95
95
 
96
- | Column | Phase | Description |
96
+ | Column | Layer | Description |
97
97
  |--------|-------|-------------|
98
98
  | `id` | Input | Unique task identifier (string) |
99
99
  | `title` | Input | Short task title |
@@ -105,12 +105,14 @@ id,title,description,dimension,changed_files,project_specs,review_level,deps,con
105
105
  | `deps` | Input | Semicolon-separated dependency task IDs |
106
106
  | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
107
107
  | `wave` | Computed | Wave number (1 = dimension review, 2 = aggregation) |
108
- | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
108
+ | `result_status` | Output | `completed` / `failed` (returned via output_schema) |
109
109
  | `findings` | Output | Key review findings summary (max 500 chars) |
110
110
  | `severity_counts` | Output | JSON: `{"critical":N,"high":N,"medium":N,"low":N}` |
111
111
  | `top_issues` | Output | Top 5 issues with `[severity] description (file:line)` format |
112
112
  | `error` | Output | Error message if failed |
113
113
 
114
+ **Column separation rule**: Input columns and Output columns MUST NOT share names. Wave CSV only contains Input columns + prev_context. Output columns are returned exclusively via output_schema.
115
+
114
116
  ### Per-Wave CSV (Temporary)
115
117
 
116
118
  Each wave generates `wave-{N}.csv` with extra `prev_context` column.
@@ -120,7 +122,8 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
120
122
  | File | Purpose | Lifecycle |
121
123
  |------|---------|-----------|
122
124
  | `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
123
- | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
125
+ | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after merge |
126
+ | `wave-{N}-results.csv` | Per-wave output from spawn_agents_on_csv (temporary) | Created by spawn_agents_on_csv, deleted after merge |
124
127
  | `results.csv` | Final export of all task results | Created in Phase 3 |
125
128
  | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
126
129
  | `context.md` | Human-readable review report | Created in Phase 3 |
@@ -135,7 +138,8 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
135
138
  +-- discoveries.ndjson
136
139
  +-- context.md
137
140
  +-- review.json
138
- +-- wave-{N}.csv (temporary)
141
+ +-- wave-{N}.csv (temporary, deleted after merge)
142
+ +-- wave-{N}-results.csv (temporary, deleted after merge)
139
143
  ```
140
144
  </csv_schema>
141
145
 
@@ -146,7 +150,7 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
146
150
  4. **Context Propagation**: prev_context built from master CSV, not from memory
147
151
  5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
148
152
  6. **Skip on Failure**: If all dimension agents failed, skip aggregation
149
- 7. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
153
+ 7. **Cleanup Temp Files**: Remove wave-{N}.csv and wave-{N}-results.csv after results are merged
150
154
  8. **DO NOT STOP**: Continuous execution until all waves complete
151
155
  </invariants>
152
156
 
@@ -220,25 +224,25 @@ spawn_agents_on_csv({
220
224
  type: "object",
221
225
  properties: {
222
226
  id: { type: "string" },
223
- status: { type: "string", enum: ["completed", "failed"] },
227
+ result_status: { type: "string", enum: ["completed", "failed"] },
224
228
  findings: { type: "string" },
225
229
  severity_counts: { type: "string" },
226
230
  top_issues: { type: "string" },
227
231
  error: { type: "string" }
228
232
  },
229
- required: ["id", "status", "findings"]
233
+ required: ["id", "result_status", "findings"]
230
234
  }
231
235
  })
232
236
  ```
233
237
 
234
- Merge `wave-1-results.csv` into master `tasks.csv`, delete `wave-1.csv`.
238
+ Merge `wave-1-results.csv` into master `tasks.csv` (map `result_status` → master `status` column), then delete both `wave-1.csv` and `wave-1-results.csv`.
235
239
 
236
240
  #### Wave 2: Aggregation + Deep-Dive
237
241
 
238
242
  Filter master `tasks.csv` for `wave == 2 AND status == pending`. If all wave 1 tasks failed, skip aggregation.
239
243
 
240
244
  Build `prev_context` from wave 1 findings (format: `[Task N: Title] summary...` per task).
241
- Write `wave-2.csv` with `prev_context` column → execute `spawn_agents_on_csv` → merge results → delete `wave-2.csv`.
245
+ Write `wave-2.csv` with `prev_context` column → execute `spawn_agents_on_csv` → merge results into master `tasks.csv` (map `result_status` master `status` column) → delete both `wave-2.csv` and `wave-2-results.csv`.
242
246
 
243
247
  ### Phase 3: Results Aggregation
244
248