chati-dev 1.4.0 → 2.0.1

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 (200) hide show
  1. package/README.md +3 -3
  2. package/framework/agents/build/dev.md +343 -0
  3. package/framework/agents/clarity/architect.md +112 -0
  4. package/framework/agents/clarity/brief.md +182 -0
  5. package/framework/agents/clarity/brownfield-wu.md +181 -0
  6. package/framework/agents/clarity/detail.md +110 -0
  7. package/framework/agents/clarity/greenfield-wu.md +153 -0
  8. package/framework/agents/clarity/ux.md +112 -0
  9. package/framework/config.yaml +3 -3
  10. package/framework/constitution.md +31 -1
  11. package/framework/context/governance.md +37 -0
  12. package/framework/context/protocols.md +34 -0
  13. package/framework/context/quality.md +27 -0
  14. package/framework/context/root.md +24 -0
  15. package/framework/domains/agents/architect.yaml +51 -0
  16. package/framework/domains/agents/brief.yaml +47 -0
  17. package/framework/domains/agents/brownfield-wu.yaml +49 -0
  18. package/framework/domains/agents/detail.yaml +47 -0
  19. package/framework/domains/agents/dev.yaml +49 -0
  20. package/framework/domains/agents/devops.yaml +43 -0
  21. package/framework/domains/agents/greenfield-wu.yaml +47 -0
  22. package/framework/domains/agents/orchestrator.yaml +49 -0
  23. package/framework/domains/agents/phases.yaml +47 -0
  24. package/framework/domains/agents/qa-implementation.yaml +43 -0
  25. package/framework/domains/agents/qa-planning.yaml +44 -0
  26. package/framework/domains/agents/tasks.yaml +48 -0
  27. package/framework/domains/agents/ux.yaml +50 -0
  28. package/framework/domains/constitution.yaml +77 -0
  29. package/framework/domains/global.yaml +64 -0
  30. package/framework/domains/workflows/brownfield-discovery.yaml +16 -0
  31. package/framework/domains/workflows/brownfield-fullstack.yaml +26 -0
  32. package/framework/domains/workflows/brownfield-service.yaml +22 -0
  33. package/framework/domains/workflows/brownfield-ui.yaml +22 -0
  34. package/framework/domains/workflows/greenfield-fullstack.yaml +26 -0
  35. package/framework/hooks/constitution-guard.js +101 -0
  36. package/framework/hooks/mode-governance.js +92 -0
  37. package/framework/hooks/model-governance.js +76 -0
  38. package/framework/hooks/prism-engine.js +89 -0
  39. package/framework/hooks/session-digest.js +60 -0
  40. package/framework/hooks/settings.json +44 -0
  41. package/framework/migrations/v1.4-to-v2.0.yaml +167 -0
  42. package/framework/migrations/v2.0-to-v2.0.1.yaml +132 -0
  43. package/framework/orchestrator/chati.md +284 -6
  44. package/framework/tasks/architect-api-design.md +63 -0
  45. package/framework/tasks/architect-consolidate.md +47 -0
  46. package/framework/tasks/architect-db-design.md +73 -0
  47. package/framework/tasks/architect-design.md +95 -0
  48. package/framework/tasks/architect-security-review.md +62 -0
  49. package/framework/tasks/architect-stack-selection.md +53 -0
  50. package/framework/tasks/brief-consolidate.md +249 -0
  51. package/framework/tasks/brief-constraint-identify.md +277 -0
  52. package/framework/tasks/brief-extract-requirements.md +339 -0
  53. package/framework/tasks/brief-stakeholder-map.md +176 -0
  54. package/framework/tasks/brief-validate-completeness.md +121 -0
  55. package/framework/tasks/brownfield-wu-architecture-map.md +394 -0
  56. package/framework/tasks/brownfield-wu-deep-discovery.md +312 -0
  57. package/framework/tasks/brownfield-wu-dependency-scan.md +359 -0
  58. package/framework/tasks/brownfield-wu-migration-plan.md +483 -0
  59. package/framework/tasks/brownfield-wu-report.md +325 -0
  60. package/framework/tasks/brownfield-wu-risk-assess.md +424 -0
  61. package/framework/tasks/detail-acceptance-criteria.md +372 -0
  62. package/framework/tasks/detail-consolidate.md +138 -0
  63. package/framework/tasks/detail-edge-case-analysis.md +300 -0
  64. package/framework/tasks/detail-expand-prd.md +389 -0
  65. package/framework/tasks/detail-nfr-extraction.md +223 -0
  66. package/framework/tasks/dev-code-review.md +404 -0
  67. package/framework/tasks/dev-consolidate.md +543 -0
  68. package/framework/tasks/dev-debug.md +322 -0
  69. package/framework/tasks/dev-implement.md +252 -0
  70. package/framework/tasks/dev-iterate.md +411 -0
  71. package/framework/tasks/dev-pr-prepare.md +497 -0
  72. package/framework/tasks/dev-refactor.md +342 -0
  73. package/framework/tasks/dev-test-write.md +306 -0
  74. package/framework/tasks/devops-ci-setup.md +412 -0
  75. package/framework/tasks/devops-consolidate.md +712 -0
  76. package/framework/tasks/devops-deploy-config.md +598 -0
  77. package/framework/tasks/devops-monitoring-setup.md +658 -0
  78. package/framework/tasks/devops-release-prepare.md +673 -0
  79. package/framework/tasks/greenfield-wu-analyze-empty.md +169 -0
  80. package/framework/tasks/greenfield-wu-report.md +266 -0
  81. package/framework/tasks/greenfield-wu-scaffold-detection.md +203 -0
  82. package/framework/tasks/greenfield-wu-tech-stack-assess.md +255 -0
  83. package/framework/tasks/orchestrator-deviation.md +260 -0
  84. package/framework/tasks/orchestrator-escalate.md +276 -0
  85. package/framework/tasks/orchestrator-handoff.md +243 -0
  86. package/framework/tasks/orchestrator-health.md +372 -0
  87. package/framework/tasks/orchestrator-mode-switch.md +262 -0
  88. package/framework/tasks/orchestrator-resume.md +189 -0
  89. package/framework/tasks/orchestrator-route.md +169 -0
  90. package/framework/tasks/orchestrator-spawn-terminal.md +358 -0
  91. package/framework/tasks/orchestrator-status.md +260 -0
  92. package/framework/tasks/orchestrator-suggest-mode.md +372 -0
  93. package/framework/tasks/phases-breakdown.md +91 -0
  94. package/framework/tasks/phases-dependency-mapping.md +67 -0
  95. package/framework/tasks/phases-mvp-scoping.md +94 -0
  96. package/framework/tasks/qa-impl-consolidate.md +522 -0
  97. package/framework/tasks/qa-impl-performance-test.md +487 -0
  98. package/framework/tasks/qa-impl-regression-check.md +413 -0
  99. package/framework/tasks/qa-impl-sast-scan.md +402 -0
  100. package/framework/tasks/qa-impl-test-execute.md +344 -0
  101. package/framework/tasks/qa-impl-verdict.md +339 -0
  102. package/framework/tasks/qa-planning-consolidate.md +309 -0
  103. package/framework/tasks/qa-planning-coverage-plan.md +338 -0
  104. package/framework/tasks/qa-planning-gate-define.md +339 -0
  105. package/framework/tasks/qa-planning-risk-matrix.md +631 -0
  106. package/framework/tasks/qa-planning-test-strategy.md +217 -0
  107. package/framework/tasks/tasks-acceptance-write.md +75 -0
  108. package/framework/tasks/tasks-consolidate.md +57 -0
  109. package/framework/tasks/tasks-decompose.md +80 -0
  110. package/framework/tasks/tasks-estimate.md +66 -0
  111. package/framework/tasks/ux-a11y-check.md +49 -0
  112. package/framework/tasks/ux-component-map.md +55 -0
  113. package/framework/tasks/ux-consolidate.md +46 -0
  114. package/framework/tasks/ux-user-flow.md +46 -0
  115. package/framework/tasks/ux-wireframe.md +76 -0
  116. package/package.json +1 -1
  117. package/scripts/bundle-framework.js +2 -0
  118. package/scripts/changelog-generator.js +222 -0
  119. package/scripts/codebase-mapper.js +728 -0
  120. package/scripts/commit-message-generator.js +167 -0
  121. package/scripts/coverage-analyzer.js +260 -0
  122. package/scripts/dependency-analyzer.js +280 -0
  123. package/scripts/framework-analyzer.js +308 -0
  124. package/scripts/generate-constitution-domain.js +253 -0
  125. package/scripts/health-check.js +481 -0
  126. package/scripts/ide-sync.js +327 -0
  127. package/scripts/performance-analyzer.js +325 -0
  128. package/scripts/plan-tracker.js +278 -0
  129. package/scripts/populate-entity-registry.js +481 -0
  130. package/scripts/pr-review.js +317 -0
  131. package/scripts/rollback-manager.js +310 -0
  132. package/scripts/stuck-detector.js +343 -0
  133. package/scripts/test-quality-assessment.js +257 -0
  134. package/scripts/validate-agents.js +367 -0
  135. package/scripts/validate-tasks.js +465 -0
  136. package/src/autonomy/autonomous-gate.js +293 -0
  137. package/src/autonomy/index.js +51 -0
  138. package/src/autonomy/mode-manager.js +225 -0
  139. package/src/autonomy/mode-suggester.js +283 -0
  140. package/src/autonomy/progress-reporter.js +268 -0
  141. package/src/autonomy/safety-net.js +320 -0
  142. package/src/context/bracket-tracker.js +79 -0
  143. package/src/context/domain-loader.js +107 -0
  144. package/src/context/engine.js +144 -0
  145. package/src/context/formatter.js +184 -0
  146. package/src/context/index.js +4 -0
  147. package/src/context/layers/l0-constitution.js +28 -0
  148. package/src/context/layers/l1-global.js +37 -0
  149. package/src/context/layers/l2-agent.js +39 -0
  150. package/src/context/layers/l3-workflow.js +42 -0
  151. package/src/context/layers/l4-task.js +24 -0
  152. package/src/decision/analyzer.js +167 -0
  153. package/src/decision/engine.js +270 -0
  154. package/src/decision/index.js +38 -0
  155. package/src/decision/registry-healer.js +450 -0
  156. package/src/decision/registry-updater.js +330 -0
  157. package/src/gates/circuit-breaker.js +119 -0
  158. package/src/gates/g1-planning-complete.js +153 -0
  159. package/src/gates/g2-qa-planning.js +153 -0
  160. package/src/gates/g3-implementation.js +188 -0
  161. package/src/gates/g4-qa-implementation.js +207 -0
  162. package/src/gates/g5-deploy-ready.js +180 -0
  163. package/src/gates/gate-base.js +144 -0
  164. package/src/gates/index.js +46 -0
  165. package/src/installer/brownfield-upgrader.js +249 -0
  166. package/src/installer/core.js +55 -3
  167. package/src/installer/file-hasher.js +51 -0
  168. package/src/installer/manifest.js +117 -0
  169. package/src/installer/templates.js +17 -15
  170. package/src/installer/transaction.js +229 -0
  171. package/src/installer/validator.js +18 -1
  172. package/src/memory/agent-memory.js +255 -0
  173. package/src/memory/gotchas-injector.js +72 -0
  174. package/src/memory/gotchas.js +361 -0
  175. package/src/memory/index.js +35 -0
  176. package/src/memory/search.js +233 -0
  177. package/src/memory/session-digest.js +239 -0
  178. package/src/merger/env-merger.js +112 -0
  179. package/src/merger/index.js +56 -0
  180. package/src/merger/replace-merger.js +51 -0
  181. package/src/merger/yaml-merger.js +127 -0
  182. package/src/orchestrator/agent-selector.js +285 -0
  183. package/src/orchestrator/deviation-handler.js +350 -0
  184. package/src/orchestrator/handoff-engine.js +271 -0
  185. package/src/orchestrator/index.js +67 -0
  186. package/src/orchestrator/intent-classifier.js +264 -0
  187. package/src/orchestrator/pipeline-manager.js +492 -0
  188. package/src/orchestrator/pipeline-state.js +223 -0
  189. package/src/orchestrator/session-manager.js +409 -0
  190. package/src/tasks/executor.js +195 -0
  191. package/src/tasks/handoff.js +226 -0
  192. package/src/tasks/index.js +4 -0
  193. package/src/tasks/loader.js +210 -0
  194. package/src/tasks/router.js +182 -0
  195. package/src/terminal/collector.js +216 -0
  196. package/src/terminal/index.js +30 -0
  197. package/src/terminal/isolation.js +129 -0
  198. package/src/terminal/monitor.js +277 -0
  199. package/src/terminal/spawner.js +269 -0
  200. package/src/upgrade/checker.js +1 -1
@@ -0,0 +1,344 @@
1
+ ---
2
+ id: qa-impl-test-execute
3
+ agent: qa-implementation
4
+ trigger: dev
5
+ phase: build
6
+ requires_input: false
7
+ parallelizable: false
8
+ outputs: [test-results.yaml]
9
+ handoff_to: qa-impl-sast-scan
10
+ autonomous_gate: false
11
+ criteria:
12
+ - All unit tests executed
13
+ - All integration tests executed
14
+ - Test results collected and analyzed
15
+ - Failures categorized by severity
16
+ ---
17
+
18
+ # Test Suite Execution
19
+
20
+ ## Purpose
21
+ Execute the complete test suite (unit and integration tests) for the implemented code, collect results, analyze failures, and provide actionable feedback for remediation.
22
+
23
+ ## Prerequisites
24
+ - Implementation complete (dev agent marked tasks as done)
25
+ - Test files exist in test/ or **/*.test.js
26
+ - Test framework configured (package.json scripts)
27
+ - Coverage tool configured
28
+ - qa-plan.yaml with coverage targets
29
+
30
+ ## Steps
31
+
32
+ 1. **Verify Test Environment**
33
+ - Check that test framework is installed (npm list vitest / jest / mocha)
34
+ - Verify test scripts exist in package.json (test, test:unit, test:integration)
35
+ - Ensure coverage tool is configured (c8, nyc, or built-in)
36
+ - Validate test environment variables if required
37
+
38
+ 2. **Discover Test Files**
39
+ - Scan for unit test files: **/*.test.js, **/*.spec.js in unit/
40
+ - Scan for integration test files: **/*.test.js in integration/
41
+ - List all discovered test files with count
42
+ - Verify test files match implemented modules (coverage-plan.yaml reference)
43
+
44
+ 3. **Execute Unit Tests**
45
+ - Run: `npm run test:unit` or equivalent
46
+ - Capture exit code (0 = pass, non-zero = fail)
47
+ - Parse test output for results (passed, failed, skipped)
48
+ - Collect execution time and memory usage
49
+ - Save raw output to test-results/unit-output.log
50
+
51
+ 4. **Execute Integration Tests**
52
+ - Run: `npm run test:integration` or equivalent
53
+ - Capture exit code
54
+ - Parse test output for results
55
+ - Collect execution time (integration tests typically slower)
56
+ - Save raw output to test-results/integration-output.log
57
+
58
+ 5. **Generate Coverage Report**
59
+ - Run: `npm run test:coverage` or `c8 npm test`
60
+ - Parse coverage output for percentages (line, branch, function, statement)
61
+ - Generate HTML coverage report for detailed inspection
62
+ - Compare coverage to qa-plan.yaml targets (overall, per-module)
63
+ - Identify modules below target coverage
64
+
65
+ 6. **Analyze Test Failures**
66
+ - For each failed test:
67
+ - Extract test name, file, line number
68
+ - Capture error message and stack trace
69
+ - Categorize failure type (assertion, exception, timeout, setup error)
70
+ - Determine affected module/component
71
+ - Group failures by module for reporting
72
+
73
+ 7. **Categorize by Severity**
74
+ - **CRITICAL**: Failures in critical-risk modules (state management, mode governance, file operations)
75
+ - **HIGH**: Failures in high-risk modules (agent logic, orchestrator, configuration)
76
+ - **MEDIUM**: Failures in medium-risk modules (CLI, i18n, error handling)
77
+ - **LOW**: Failures in low-risk modules (formatting, documentation)
78
+ - Reference risk-matrix.yaml for severity mapping
79
+
80
+ 8. **Check for Test Quality Issues**
81
+ - **Flaky tests**: Tests that fail intermittently (run failed tests 3x to verify)
82
+ - **Skipped tests**: Tests marked as .skip or .todo (should be minimal)
83
+ - **Long-running tests**: Tests exceeding 5 seconds (may indicate inefficiency)
84
+ - **No assertions**: Tests that pass but have no assertions (false positives)
85
+
86
+ 9. **Calculate Test Metrics**
87
+ - **Pass rate**: (passed / total) * 100
88
+ - **Coverage delta**: actual coverage - target coverage
89
+ - **Failure density**: failures per module
90
+ - **Test execution time**: total time for full suite
91
+ - **Flakiness rate**: flaky tests / total tests
92
+
93
+ 10. **Generate Recommendations**
94
+ - For coverage gaps: Suggest specific areas needing tests
95
+ - For failures: Provide first-action recommendations (fix code vs fix test)
96
+ - For flaky tests: Recommend stabilization strategies
97
+ - For long-running tests: Suggest optimization approaches
98
+
99
+ 11. **Compile Test Results Document**
100
+ - Summarize pass/fail status
101
+ - Include coverage report
102
+ - List failures with severity and recommendations
103
+ - Document test quality issues
104
+ - Provide overall assessment (PASS, FAIL, CONDITIONAL)
105
+
106
+ 12. **Log Results and Next Steps**
107
+ - Save test-results.yaml to session
108
+ - Update session.yaml with test execution status
109
+ - If all tests pass and coverage meets targets: proceed to SAST scan
110
+ - If failures exist: flag for dev agent remediation, then re-run
111
+
112
+ ## Decision Points
113
+
114
+ - **Coverage Below Target but Tests Pass**: If coverage is 2-5% below target but all tests pass, decide whether to proceed with CONDITIONAL status or block for more tests. Recommend: CONDITIONAL if critical modules meet targets, FAIL if critical modules below target.
115
+
116
+ - **Flaky Test Handling**: If a test fails once but passes on retry, mark as flaky rather than failed. However, if >10% of tests are flaky, treat as a test quality issue and FAIL the build.
117
+
118
+ - **Integration Test Failures Due to Environment**: If integration tests fail due to missing external dependencies (e.g., filesystem permissions, network), distinguish from code failures. Provide remediation steps for environment setup.
119
+
120
+ ## Error Handling
121
+
122
+ **Test Script Not Found**
123
+ - If package.json lacks test scripts, check for test framework binary (node_modules/.bin/vitest)
124
+ - Attempt to run directly: `npx vitest run`
125
+ - If no test framework found, FAIL with error: "Test framework not installed"
126
+ - Escalate to dev agent for test setup
127
+
128
+ **Test Execution Timeout**
129
+ - If tests hang (no output for 5 minutes), kill process
130
+ - Log timeout error with test context (last test executed)
131
+ - Investigate long-running tests or infinite loops
132
+ - Recommend: Add --testTimeout flag or investigate hanging code
133
+
134
+ **Coverage Tool Failure**
135
+ - If coverage generation fails, proceed with test results only
136
+ - Log coverage tool error
137
+ - Mark coverage as UNKNOWN in test-results.yaml
138
+ - Recommend: Fix coverage configuration, re-run
139
+
140
+ **Parse Failure (Unrecognized Output Format)**
141
+ - If test output format is unrecognized, save raw output
142
+ - Attempt to extract pass/fail from exit code only
143
+ - Log parse warning
144
+ - Recommend: Use standard test reporter (JSON, TAP)
145
+
146
+ ## Output Format
147
+
148
+ ```yaml
149
+ # test-results.yaml
150
+ version: 1.0.0
151
+ created: YYYY-MM-DD
152
+ agent: qa-implementation
153
+ phase: build
154
+
155
+ summary:
156
+ status: FAIL # PASS, FAIL, CONDITIONAL
157
+ total_tests: 247
158
+ passed: 235
159
+ failed: 12
160
+ skipped: 0
161
+ pass_rate: 95.1%
162
+ execution_time: 42.3s
163
+
164
+ unit_tests:
165
+ total: 198
166
+ passed: 191
167
+ failed: 7
168
+ skipped: 0
169
+ pass_rate: 96.5%
170
+ execution_time: 18.7s
171
+ output_log: test-results/unit-output.log
172
+
173
+ integration_tests:
174
+ total: 49
175
+ passed: 44
176
+ failed: 5
177
+ skipped: 0
178
+ pass_rate: 89.8%
179
+ execution_time: 23.6s
180
+ output_log: test-results/integration-output.log
181
+
182
+ coverage:
183
+ overall: 76.3%
184
+ target: 75%
185
+ delta: +1.3%
186
+ status: PASS
187
+
188
+ by_metric:
189
+ line: 76.3%
190
+ branch: 72.1%
191
+ function: 81.2%
192
+ statement: 76.5%
193
+
194
+ by_module:
195
+ orchestrator:
196
+ actual: 87%
197
+ target: 85%
198
+ status: PASS
199
+
200
+ state_management:
201
+ actual: 91%
202
+ target: 90%
203
+ status: PASS
204
+
205
+ agents:
206
+ actual: 78%
207
+ target: 75%
208
+ status: PASS
209
+
210
+ file_operations:
211
+ actual: 73%
212
+ target: 80%
213
+ status: FAIL
214
+ gap: -7%
215
+
216
+ validators:
217
+ actual: 92%
218
+ target: 90%
219
+ status: PASS
220
+
221
+ cli:
222
+ actual: 68%
223
+ target: 70%
224
+ status: FAIL
225
+ gap: -2%
226
+
227
+ html_report: coverage/index.html
228
+
229
+ failures:
230
+ critical:
231
+ - test: "state_management: concurrent write protection"
232
+ file: test/unit/state-manager.test.js
233
+ line: 142
234
+ module: state_management
235
+ error: "Expected lock to be acquired, but was not"
236
+ stack_trace: |
237
+ AssertionError: Expected lock to be acquired
238
+ at Context.<anonymous> (test/unit/state-manager.test.js:142:12)
239
+ recommendation: "Fix lock acquisition logic in state/session-manager.js"
240
+ severity: CRITICAL
241
+ risk_level: critical
242
+
243
+ high:
244
+ - test: "file_operations: permission error handling"
245
+ file: test/integration/file-ops.test.js
246
+ line: 87
247
+ module: file_operations
248
+ error: "Expected error to be thrown, but function succeeded"
249
+ stack_trace: |
250
+ AssertionError: Expected error to be thrown
251
+ at Context.<anonymous> (test/integration/file-ops.test.js:87:15)
252
+ recommendation: "Add permission check in utils/file-ops.js before write"
253
+ severity: HIGH
254
+ risk_level: high
255
+
256
+ medium:
257
+ - test: "cli: invalid argument handling"
258
+ file: test/unit/cli-parser.test.js
259
+ line: 203
260
+ module: cli
261
+ error: "TypeError: Cannot read property 'value' of undefined"
262
+ stack_trace: |
263
+ TypeError: Cannot read property 'value' of undefined
264
+ at parseArgs (cli/index.js:45:18)
265
+ recommendation: "Add null check for optional arguments"
266
+ severity: MEDIUM
267
+ risk_level: medium
268
+
269
+ low: []
270
+
271
+ test_quality_issues:
272
+ flaky_tests:
273
+ count: 2
274
+ rate: 0.8%
275
+ tests:
276
+ - name: "agent: task execution with timeout"
277
+ file: test/integration/agent-executor.test.js
278
+ pass_rate: 2/3
279
+ recommendation: "Increase timeout or mock async operations"
280
+
281
+ skipped_tests:
282
+ count: 0
283
+ rate: 0%
284
+
285
+ long_running_tests:
286
+ count: 5
287
+ threshold: 5s
288
+ tests:
289
+ - name: "upgrade: full migration end-to-end"
290
+ file: test/e2e/upgrade.test.js
291
+ duration: 12.3s
292
+ recommendation: "Acceptable for e2e test, consider splitting if grows >20s"
293
+
294
+ no_assertions:
295
+ count: 0
296
+
297
+ metrics:
298
+ pass_rate: 95.1%
299
+ coverage_delta: +1.3%
300
+ failure_density:
301
+ state_management: 1 failure / 45 tests (2.2%)
302
+ file_operations: 1 failure / 38 tests (2.6%)
303
+ cli: 1 failure / 42 tests (2.4%)
304
+ execution_time: 42.3s
305
+ flakiness_rate: 0.8%
306
+
307
+ assessment:
308
+ status: FAIL
309
+ rationale: |
310
+ - 12 test failures across critical, high, and medium severity
311
+ - Coverage for file_operations below target (-7%)
312
+ - Critical failure in state management (concurrent write protection)
313
+
314
+ blocking_issues:
315
+ - CRITICAL: state_management concurrent write protection failure
316
+ - HIGH: file_operations permission error handling failure
317
+ - Coverage gap in file_operations module (-7%)
318
+
319
+ conditional_pass_criteria:
320
+ - Fix all CRITICAL and HIGH severity failures
321
+ - Increase file_operations coverage to 80% (add 7% more tests)
322
+ - Re-run test suite and verify PASS
323
+
324
+ recommendations:
325
+ - Priority 1: Fix state_management lock acquisition logic
326
+ - Priority 2: Add permission check in file_operations
327
+ - Priority 3: Add 10-12 tests for file_operations (edge cases, error handling)
328
+ - Priority 4: Fix medium severity CLI parsing issue
329
+ - Address flaky agent test (increase timeout or mock)
330
+
331
+ next_steps:
332
+ - Return to dev agent for remediation of blocking issues
333
+ - Re-run qa-impl-test-execute after fixes
334
+ - If rerun passes, proceed to qa-impl-sast-scan
335
+ - Do NOT proceed to SAST until all tests pass and coverage targets met
336
+
337
+ handoff:
338
+ to: dev
339
+ reason: Test failures and coverage gap
340
+ priority_fixes:
341
+ - state_management: concurrent write protection
342
+ - file_operations: permission error handling
343
+ - file_operations: add 10-12 tests for 7% coverage increase
344
+ ```
@@ -0,0 +1,339 @@
1
+ ---
2
+ id: qa-impl-verdict
3
+ agent: qa-implementation
4
+ trigger: qa-impl-performance-test
5
+ phase: validate
6
+ requires_input: false
7
+ parallelizable: false
8
+ outputs: [qa-verdict.yaml]
9
+ handoff_to: qa-impl-consolidate
10
+ autonomous_gate: true
11
+ criteria:
12
+ - All tests passing
13
+ - No critical SAST findings
14
+ - No regressions
15
+ - Performance within thresholds
16
+ - Final verdict issued (PASS/FAIL/CONDITIONAL)
17
+ ---
18
+
19
+ # QA Implementation Verdict
20
+
21
+ ## Purpose
22
+ Issue the final QA verdict by synthesizing all QA implementation results (tests, SAST, regressions, performance), determining overall quality status, and deciding whether to proceed to deployment or return to development.
23
+
24
+ ## Prerequisites
25
+ - test-results.yaml with final test execution results
26
+ - sast-report.yaml with security analysis
27
+ - regression-report.yaml with regression testing results
28
+ - performance-report.yaml with benchmark results
29
+ - quality-gates.yaml with pass/fail thresholds
30
+
31
+ ## Steps
32
+
33
+ 1. **Load All QA Implementation Reports**
34
+ - Read test-results.yaml and extract status, pass rate, coverage
35
+ - Read sast-report.yaml and extract vulnerability counts, severity levels
36
+ - Read regression-report.yaml and extract regression count, severity
37
+ - Read performance-report.yaml and extract performance status, degradation
38
+ - Validate all reports are present and complete
39
+
40
+ 2. **Evaluate Test Results Gate**
41
+ - **Pass Criteria**: 100% test pass rate, coverage >= target (75% overall)
42
+ - **Fail Criteria**: Any test failures, coverage < target
43
+ - **Status**: PASS, FAIL, or CONDITIONAL (minor coverage gaps)
44
+ - Document gate outcome with rationale
45
+
46
+ 3. **Evaluate SAST Gate**
47
+ - **Pass Criteria**: 0 critical vulnerabilities, < 3 high vulnerabilities
48
+ - **Fail Criteria**: >= 1 critical OR >= 3 high vulnerabilities (exploitable)
49
+ - **Status**: PASS, FAIL, or CONDITIONAL (high vulns with mitigations)
50
+ - Document gate outcome with rationale
51
+
52
+ 4. **Evaluate Regression Gate**
53
+ - **Pass Criteria**: 0 true regressions, all changes intentional
54
+ - **Fail Criteria**: >= 1 critical or high regression
55
+ - **Status**: PASS, FAIL, or CONDITIONAL (medium regressions only)
56
+ - Document gate outcome with rationale
57
+
58
+ 5. **Evaluate Performance Gate**
59
+ - **Pass Criteria**: All metrics within thresholds, < 10% degradation
60
+ - **Fail Criteria**: Critical metrics outside thresholds, > 20% degradation
61
+ - **Status**: PASS, FAIL, or CONDITIONAL (minor degradation with justification)
62
+ - Document gate outcome with rationale
63
+
64
+ 6. **Calculate Overall Quality Score**
65
+ - **Test Results**: 25 points (pass rate, coverage)
66
+ - **SAST**: 25 points (vulnerability severity, count)
67
+ - **Regressions**: 25 points (regression count, severity)
68
+ - **Performance**: 25 points (threshold compliance, degradation)
69
+ - Total: 100 points maximum
70
+
71
+ 7. **Apply Gate Logic**
72
+ - **ALL gates PASS**: Overall verdict = PASS
73
+ - **ANY gate FAIL**: Overall verdict = FAIL
74
+ - **ALL gates PASS or CONDITIONAL, >= 1 CONDITIONAL**: Overall verdict = CONDITIONAL
75
+ - Document gate combination and logic
76
+
77
+ 8. **Determine Verdict**
78
+ - **PASS**: All quality gates passed, ready for deployment
79
+ - **FAIL**: One or more critical issues, must return to development
80
+ - **CONDITIONAL**: Minor issues, can deploy with risk acceptance or quick fixes
81
+
82
+ 9. **Compile Blocking Issues (if FAIL or CONDITIONAL)**
83
+ - List all CRITICAL and HIGH severity issues
84
+ - For each issue:
85
+ - Source (test failure, SAST, regression, performance)
86
+ - Severity and impact
87
+ - Fix recommendation
88
+ - Estimated effort
89
+ - Prioritize issues by risk and user impact
90
+
91
+ 10. **Define Acceptance Criteria for PASS**
92
+ - If verdict is CONDITIONAL, define what must be done to achieve PASS:
93
+ - Specific issues to fix
94
+ - Acceptable risk mitigations
95
+ - Documentation requirements
96
+ - If verdict is FAIL, define complete remediation plan
97
+
98
+ 11. **Generate Handoff Recommendations**
99
+ - **PASS**: Handoff to devops agent for deployment
100
+ - **FAIL**: Handoff to dev agent for remediation, list priority fixes
101
+ - **CONDITIONAL**: Provide decision framework for stakeholder (deploy with risk vs fix)
102
+
103
+ 12. **Log Verdict and Update Session**
104
+ - Save qa-verdict.yaml with complete verdict
105
+ - Update session.yaml with QA implementation status
106
+ - If PASS (autonomous gate), trigger handoff to qa-impl-consolidate
107
+ - If FAIL, flag for orchestrator to return to dev
108
+ - If CONDITIONAL, prompt orchestrator for user decision
109
+
110
+ ## Decision Points
111
+
112
+ - **CONDITIONAL Verdict Threshold**: If overall score is 90-95%, verdict is CONDITIONAL. Requires stakeholder decision: accept minor issues and deploy, or remediate first. Provide clear risk assessment.
113
+
114
+ - **Autonomous Transition**: If verdict is PASS and overall score >= 95%, autonomous gate allows automatic transition to qa-impl-consolidate and then devops. No manual approval needed.
115
+
116
+ - **Risk Acceptance for Deployment**: If verdict is CONDITIONAL due to minor performance degradation or low-severity SAST findings, assess whether issues are acceptable for production. Consider: user impact, workarounds, fix timeline.
117
+
118
+ ## Error Handling
119
+
120
+ **Missing QA Report**
121
+ - If any of the four prerequisite reports are missing, cannot issue verdict
122
+ - Log error with specific missing file
123
+ - Status = INCOMPLETE
124
+ - Escalate to orchestrator for dependency resolution
125
+
126
+ **Conflicting Gate Results**
127
+ - If reports contain conflicting information (e.g., test-results says PASS but has failures listed), investigate
128
+ - Trust most conservative interpretation (if ambiguous, treat as FAIL)
129
+ - Log conflict and recommendation for report validation
130
+ - Flag for manual review
131
+
132
+ **Score Calculation Anomaly**
133
+ - If overall score exceeds 100 or is negative, recalculate
134
+ - Log calculation details for audit
135
+ - If recalculation fails, default to FAIL verdict
136
+ - Escalate for manual scoring review
137
+
138
+ **Autonomous Gate Trigger Failure**
139
+ - If autonomous gate should trigger but handoff fails, log error
140
+ - Do not proceed to next agent automatically
141
+ - Escalate to orchestrator for manual handoff
142
+ - Document failure in session.yaml
143
+
144
+ ## Output Format
145
+
146
+ ```yaml
147
+ # qa-verdict.yaml
148
+ version: 1.0.0
149
+ created: YYYY-MM-DD
150
+ agent: qa-implementation
151
+ phase: validate
152
+
153
+ verdict: PASS # PASS, FAIL, CONDITIONAL
154
+
155
+ overall_score: 96
156
+ threshold_for_pass: 95
157
+ threshold_for_conditional: 90
158
+
159
+ gates:
160
+ test_results:
161
+ status: PASS
162
+ score: 24 / 25
163
+ rationale: "All tests passing (100% pass rate), coverage 76.3% exceeds target 75%"
164
+ details:
165
+ pass_rate: 100%
166
+ coverage: 76.3%
167
+ target_coverage: 75%
168
+ penalty: -1 (one module slightly below target, but overall exceeds)
169
+
170
+ sast:
171
+ status: PASS
172
+ score: 25 / 25
173
+ rationale: "0 critical, 0 high exploitable vulnerabilities after remediation"
174
+ details:
175
+ critical: 0
176
+ high: 0
177
+ medium: 6
178
+ low: 10
179
+ threshold:
180
+ critical: 0
181
+ high: "< 3"
182
+
183
+ regressions:
184
+ status: PASS
185
+ score: 24 / 25
186
+ rationale: "0 true regressions, all changes intentional and documented"
187
+ details:
188
+ true_regressions: 0
189
+ intentional_changes: 4
190
+ non_deterministic: 1
191
+ penalty: -1 (minor documentation completeness issue)
192
+
193
+ performance:
194
+ status: PASS
195
+ score: 23 / 25
196
+ rationale: "All metrics within thresholds, overall performance improved 5.2%"
197
+ details:
198
+ within_thresholds: true
199
+ degradation: -5.2% # negative = improvement
200
+ accepted_regressions: 2 # YAML parsing, validation (justified)
201
+ penalty: -2 (accepted performance trade-offs, minor)
202
+
203
+ gate_logic:
204
+ all_pass: true
205
+ any_fail: false
206
+ any_conditional: false
207
+ result: PASS
208
+
209
+ quality_assessment:
210
+ confidence: high
211
+ readiness: 96%
212
+
213
+ strengths:
214
+ - All tests passing with good coverage
215
+ - No critical or high security vulnerabilities
216
+ - No functional regressions
217
+ - Performance improved overall
218
+
219
+ areas_of_concern: []
220
+
221
+ minor_issues:
222
+ - One module (cli) coverage 2% below target (acceptable)
223
+ - YAML parsing 20% slower (justified by security fix)
224
+ - Consistency validation 12.5% slower (justified by reliability)
225
+
226
+ recommendation: "Proceed to deployment. All quality gates passed, system ready for release."
227
+
228
+ blocking_issues: []
229
+
230
+ conditional_pass_criteria: null # Not applicable for PASS verdict
231
+
232
+ risk_acceptance: []
233
+
234
+ handoff_decision:
235
+ next_agent: qa-impl-consolidate
236
+ autonomous: true
237
+ reason: "PASS verdict with score 96% >= 95% threshold, autonomous gate allows transition"
238
+
239
+ deployment_readiness:
240
+ status: READY
241
+ confidence: high
242
+ prerequisites_met:
243
+ - All tests passing: true
244
+ - No critical vulnerabilities: true
245
+ - No regressions: true
246
+ - Performance acceptable: true
247
+ - Documentation complete: true
248
+
249
+ deployment_risks: []
250
+
251
+ post_deployment_monitoring:
252
+ - Monitor YAML parsing performance in production
253
+ - Track user feedback on CLI responsiveness
254
+ - Watch for any unreported edge cases
255
+
256
+ rollback_plan:
257
+ available: true
258
+ tested: true
259
+ details: "Upgrade system supports rollback to v1.0.0, tested in regression suite"
260
+
261
+ recommendations:
262
+ immediate:
263
+ - Proceed to qa-impl-consolidate for final report
264
+ - Handoff to devops for deployment preparation
265
+ - Update baselines (test, performance) for future releases
266
+
267
+ short_term:
268
+ - Monitor performance metrics in production
269
+ - Collect user feedback on new features
270
+ - Schedule follow-up for minor issues in backlog
271
+
272
+ long_term:
273
+ - Evaluate alternative YAML parser for performance
274
+ - Consider CLI performance optimizations if user complaints
275
+ - Review and update quality gates based on production data
276
+
277
+ summary_for_stakeholders:
278
+ status: APPROVED FOR DEPLOYMENT
279
+ quality_level: EXCELLENT
280
+ score: 96 / 100
281
+
282
+ highlights:
283
+ - Zero test failures across 247 tests
284
+ - Zero critical or high security vulnerabilities
285
+ - Zero functional regressions
286
+ - Performance improved by 5.2% overall
287
+
288
+ trade_offs_accepted:
289
+ - YAML parsing 20% slower due to security fix (acceptable)
290
+ - Minor increase in validation time for improved reliability (acceptable)
291
+
292
+ deployment_recommendation: "Deploy to production immediately. All quality criteria met or exceeded."
293
+
294
+ input_reports:
295
+ - file: test-results.yaml
296
+ status: valid
297
+ outcome: PASS
298
+ score_contribution: 24 / 25
299
+
300
+ - file: sast-report.yaml
301
+ status: valid
302
+ outcome: PASS
303
+ score_contribution: 25 / 25
304
+
305
+ - file: regression-report.yaml
306
+ status: valid
307
+ outcome: PASS
308
+ score_contribution: 24 / 25
309
+
310
+ - file: performance-report.yaml
311
+ status: valid
312
+ outcome: PASS
313
+ score_contribution: 23 / 25
314
+
315
+ session_update:
316
+ agent: qa-implementation
317
+ task: qa-impl-verdict
318
+ status: completed
319
+ verdict: PASS
320
+ score: 96
321
+ autonomous_transition: approved
322
+ next_agent: qa-impl-consolidate
323
+ timestamp: YYYY-MM-DDTHH:MM:SSZ
324
+
325
+ next_steps:
326
+ - qa-impl-consolidate: Compile final QA implementation report
327
+ - devops: Begin deployment preparation (after consolidate)
328
+ - Archive QA reports for audit trail
329
+ - Update project baselines
330
+
331
+ audit_trail:
332
+ qa_planning_score: 96
333
+ qa_implementation_score: 96
334
+ total_qa_score: 96
335
+ verdict: PASS
336
+ autonomous_gates_passed: 2
337
+ manual_overrides: 0
338
+ deviation_protocol_invoked: 0
339
+ ```