claude-flow-novice 1.3.5 → 1.5.0

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 (356) hide show
  1. package/.claude/agents/analysis/code-analyzer.md +3 -20
  2. package/.claude/agents/analysis/code-review/analyze-code-quality.md +1 -1
  3. package/.claude/agents/analyst.md +300 -0
  4. package/.claude/agents/architect.md +557 -0
  5. package/.claude/agents/architecture/system-architect.md +630 -0
  6. package/.claude/agents/architecture/system-design/arch-system-design.md +1 -1
  7. package/.claude/agents/base-template-generator.md +24 -1
  8. package/.claude/agents/coder.md +180 -0
  9. package/.claude/agents/consensus/byzantine-coordinator.md +4 -21
  10. package/.claude/agents/consensus/consensus-builder.md +3 -20
  11. package/.claude/agents/consensus/crdt-synchronizer.md +4 -21
  12. package/.claude/agents/consensus/gossip-coordinator.md +4 -21
  13. package/.claude/agents/consensus/performance-benchmarker.md +4 -21
  14. package/.claude/agents/consensus/quorum-manager.md +4 -21
  15. package/.claude/agents/consensus/raft-manager.md +4 -21
  16. package/.claude/agents/consensus/security-manager.md +4 -21
  17. package/.claude/agents/coordinator.md +842 -0
  18. package/.claude/agents/data/ml/data-ml-model.md +2 -2
  19. package/.claude/agents/development/backend/dev-backend-api.md +2 -2
  20. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +2 -2
  21. package/.claude/agents/devops/devops-engineer.md +638 -0
  22. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +2 -2
  23. package/.claude/agents/github/code-review-swarm.md +1 -1
  24. package/.claude/agents/github/github-specialist.md +856 -0
  25. package/.claude/agents/github/pr-manager.md +1 -1
  26. package/.claude/agents/github/release-manager.md +1 -1
  27. package/.claude/agents/neural/neural-pattern-agent.md +762 -0
  28. package/.claude/agents/optimization/benchmark-suite.md +1 -1
  29. package/.claude/agents/optimization/perf-analyzer.md +725 -0
  30. package/.claude/agents/optimization/performance-monitor.md +1 -1
  31. package/.claude/agents/planner.md +135 -0
  32. package/.claude/agents/researcher.md +185 -0
  33. package/.claude/agents/reviewer.md +291 -0
  34. package/.claude/agents/security/security-specialist.md +978 -0
  35. package/.claude/agents/sparc/architecture.md +1 -1
  36. package/.claude/agents/sparc/pseudocode.md +1 -1
  37. package/.claude/agents/sparc/refinement.md +1 -1
  38. package/.claude/agents/sparc/specification.md +1 -1
  39. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +2 -2
  40. package/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
  41. package/.claude/agents/tester.md +663 -0
  42. package/.claude/agents/testing/unit/tdd-london-swarm.md +1 -1
  43. package/.claude/agents/testing/validation/production-validator.md +1 -1
  44. package/.claude/commands/claude-soul.js +1 -1
  45. package/.claude/hooks.json +12 -15
  46. package/{.claude → .claude-flow-novice/.claude}/agents/MIGRATION_SUMMARY.md +1 -1
  47. package/.claude-flow-novice/.claude/agents/analysis/code-analyzer.md +192 -0
  48. package/.claude-flow-novice/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
  49. package/.claude-flow-novice/.claude/agents/analyst.md +300 -0
  50. package/.claude-flow-novice/.claude/agents/architect.md +557 -0
  51. package/.claude-flow-novice/.claude/agents/architecture/system-architect.md +630 -0
  52. package/.claude-flow-novice/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
  53. package/.claude-flow-novice/.claude/agents/backend-dev.json +42 -0
  54. package/.claude-flow-novice/.claude/agents/base-template-generator.md +65 -0
  55. package/.claude-flow-novice/.claude/agents/code-analyzer.json +39 -0
  56. package/.claude-flow-novice/.claude/agents/coder.json +42 -0
  57. package/.claude-flow-novice/.claude/agents/coder.md +180 -0
  58. package/.claude-flow-novice/.claude/agents/consensus/byzantine-coordinator.md +46 -0
  59. package/.claude-flow-novice/.claude/agents/consensus/consensus-builder.md +225 -0
  60. package/.claude-flow-novice/.claude/agents/consensus/crdt-synchronizer.md +980 -0
  61. package/.claude-flow-novice/.claude/agents/consensus/gossip-coordinator.md +46 -0
  62. package/.claude-flow-novice/.claude/agents/consensus/performance-benchmarker.md +834 -0
  63. package/.claude-flow-novice/.claude/agents/consensus/quorum-manager.md +806 -0
  64. package/.claude-flow-novice/.claude/agents/consensus/raft-manager.md +46 -0
  65. package/.claude-flow-novice/.claude/agents/consensus/security-manager.md +605 -0
  66. package/.claude-flow-novice/.claude/agents/coordinator.md +842 -0
  67. package/.claude-flow-novice/.claude/agents/data/ml/data-ml-model.md +193 -0
  68. package/.claude-flow-novice/.claude/agents/development/backend/dev-backend-api.md +142 -0
  69. package/.claude-flow-novice/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
  70. package/.claude-flow-novice/.claude/agents/devops/devops-engineer.md +638 -0
  71. package/.claude-flow-novice/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
  72. package/.claude-flow-novice/.claude/agents/github/code-review-swarm.md +538 -0
  73. package/.claude-flow-novice/.claude/agents/github/github-modes.md +173 -0
  74. package/.claude-flow-novice/.claude/agents/github/github-specialist.md +856 -0
  75. package/.claude-flow-novice/.claude/agents/github/issue-tracker.md +319 -0
  76. package/.claude-flow-novice/.claude/agents/github/multi-repo-swarm.md +553 -0
  77. package/.claude-flow-novice/.claude/agents/github/pr-manager.md +191 -0
  78. package/.claude-flow-novice/.claude/agents/github/project-board-sync.md +509 -0
  79. package/.claude-flow-novice/.claude/agents/github/release-manager.md +367 -0
  80. package/.claude-flow-novice/.claude/agents/github/release-swarm.md +583 -0
  81. package/.claude-flow-novice/.claude/agents/github/repo-architect.md +398 -0
  82. package/.claude-flow-novice/.claude/agents/github/swarm-issue.md +573 -0
  83. package/.claude-flow-novice/.claude/agents/github/swarm-pr.md +428 -0
  84. package/.claude-flow-novice/.claude/agents/github/sync-coordinator.md +452 -0
  85. package/.claude-flow-novice/.claude/agents/github/workflow-automation.md +635 -0
  86. package/.claude-flow-novice/.claude/agents/goal/goal-planner.md +73 -0
  87. package/.claude-flow-novice/.claude/agents/neural/neural-pattern-agent.md +762 -0
  88. package/.claude-flow-novice/.claude/agents/neural/safla-neural.md +74 -0
  89. package/.claude-flow-novice/.claude/agents/optimization/benchmark-suite.md +665 -0
  90. package/.claude-flow-novice/.claude/agents/optimization/load-balancer.md +431 -0
  91. package/.claude-flow-novice/.claude/agents/optimization/perf-analyzer.md +725 -0
  92. package/.claude-flow-novice/.claude/agents/optimization/performance-monitor.md +672 -0
  93. package/.claude-flow-novice/.claude/agents/optimization/resource-allocator.md +674 -0
  94. package/.claude-flow-novice/.claude/agents/optimization/topology-optimizer.md +808 -0
  95. package/.claude-flow-novice/.claude/agents/planner.json +41 -0
  96. package/.claude-flow-novice/.claude/agents/planner.md +135 -0
  97. package/.claude-flow-novice/.claude/agents/researcher.json +41 -0
  98. package/.claude-flow-novice/.claude/agents/researcher.md +185 -0
  99. package/.claude-flow-novice/.claude/agents/reviewer.json +39 -0
  100. package/.claude-flow-novice/.claude/agents/reviewer.md +291 -0
  101. package/.claude-flow-novice/.claude/agents/security/security-specialist.md +978 -0
  102. package/.claude-flow-novice/.claude/agents/sparc/architecture.md +472 -0
  103. package/.claude-flow-novice/.claude/agents/sparc/pseudocode.md +318 -0
  104. package/.claude-flow-novice/.claude/agents/sparc/refinement.md +525 -0
  105. package/.claude-flow-novice/.claude/agents/sparc/specification.md +276 -0
  106. package/.claude-flow-novice/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
  107. package/.claude-flow-novice/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
  108. package/.claude-flow-novice/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
  109. package/.claude-flow-novice/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
  110. package/.claude-flow-novice/.claude/agents/sublinear/pagerank-agent.md +699 -0
  111. package/.claude-flow-novice/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
  112. package/.claude-flow-novice/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
  113. package/.claude-flow-novice/.claude/agents/sublinear/sublinear.md +816 -0
  114. package/.claude-flow-novice/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
  115. package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
  116. package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator.md +396 -0
  117. package/.claude-flow-novice/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
  118. package/.claude-flow-novice/.claude/agents/swarm/mesh-coordinator.md +435 -0
  119. package/.claude-flow-novice/.claude/agents/system-architect.json +40 -0
  120. package/.claude-flow-novice/.claude/agents/templates/automation-smart-agent.md +205 -0
  121. package/.claude-flow-novice/.claude/agents/templates/coordinator-swarm-init.md +90 -0
  122. package/.claude-flow-novice/.claude/agents/templates/github-pr-manager.md +177 -0
  123. package/.claude-flow-novice/.claude/agents/templates/implementer-sparc-coder.md +259 -0
  124. package/.claude-flow-novice/.claude/agents/templates/memory-coordinator.md +187 -0
  125. package/.claude-flow-novice/.claude/agents/templates/migration-plan.md +746 -0
  126. package/.claude-flow-novice/.claude/agents/templates/orchestrator-task.md +139 -0
  127. package/.claude-flow-novice/.claude/agents/templates/performance-analyzer.md +199 -0
  128. package/.claude-flow-novice/.claude/agents/templates/sparc-coordinator.md +183 -0
  129. package/.claude-flow-novice/.claude/agents/tester.json +40 -0
  130. package/.claude-flow-novice/.claude/agents/tester.md +663 -0
  131. package/.claude-flow-novice/.claude/agents/testing/e2e/playwright-agent.md +249 -0
  132. package/.claude-flow-novice/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
  133. package/.claude-flow-novice/.claude/agents/testing/validation/production-validator.md +395 -0
  134. package/.claude-flow-novice/dist/index.js +12 -24
  135. package/.claude-flow-novice/dist/index.js.map +1 -0
  136. package/.claude-flow-novice/dist/src/agents/agent-manager.js +123 -69
  137. package/.claude-flow-novice/dist/src/agents/agent-manager.js.map +1 -1
  138. package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js +7 -7
  139. package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js.map +1 -1
  140. package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js +485 -0
  141. package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js.map +1 -0
  142. package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js +630 -0
  143. package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js.map +1 -0
  144. package/.claude-flow-novice/dist/src/cli/commands/agent.js +1 -1
  145. package/.claude-flow-novice/dist/src/cli/commands/agent.js.map +1 -1
  146. package/.claude-flow-novice/dist/src/cli/commands/config-integration.js +6 -6
  147. package/.claude-flow-novice/dist/src/cli/commands/enterprise.js +18 -18
  148. package/.claude-flow-novice/dist/src/cli/commands/enterprise.js.map +1 -1
  149. package/.claude-flow-novice/dist/src/cli/commands/goal-init.js +4 -4
  150. package/.claude-flow-novice/dist/src/cli/commands/help-new.js +23 -23
  151. package/.claude-flow-novice/dist/src/cli/commands/help-new.js.map +1 -1
  152. package/.claude-flow-novice/dist/src/cli/commands/help.js +74 -74
  153. package/.claude-flow-novice/dist/src/cli/commands/help.js.map +1 -1
  154. package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js +2 -2
  155. package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js.map +1 -1
  156. package/.claude-flow-novice/dist/src/cli/commands/hive.js +4 -4
  157. package/.claude-flow-novice/dist/src/cli/commands/index.js +103 -132
  158. package/.claude-flow-novice/dist/src/cli/commands/index.js.map +1 -1
  159. package/.claude-flow-novice/dist/src/cli/commands/mcp.js +1 -1
  160. package/.claude-flow-novice/dist/src/cli/commands/migrate.js +4 -4
  161. package/.claude-flow-novice/dist/src/cli/commands/migrate.js.map +1 -1
  162. package/.claude-flow-novice/dist/src/cli/commands/monitor.js +1 -1
  163. package/.claude-flow-novice/dist/src/cli/commands/neural-init.js +4 -4
  164. package/.claude-flow-novice/dist/src/cli/commands/ruv-swarm.js +8 -8
  165. package/.claude-flow-novice/dist/src/cli/commands/sparc.js +12 -12
  166. package/.claude-flow-novice/dist/src/cli/commands/sparc.js.map +1 -1
  167. package/.claude-flow-novice/dist/src/cli/commands/start/start-command.js +3 -3
  168. package/.claude-flow-novice/dist/src/cli/commands/status.js +1 -1
  169. package/.claude-flow-novice/dist/src/cli/commands/swarm.js +7 -7
  170. package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
  171. package/.claude-flow-novice/dist/src/cli/commands/verification.js +18 -18
  172. package/.claude-flow-novice/dist/src/cli/completion.js +54 -54
  173. package/.claude-flow-novice/dist/src/cli/completion.js.map +1 -1
  174. package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js +11 -11
  175. package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -1
  176. package/.claude-flow-novice/dist/src/cli/consolidated/core/CommandHandlers.js +31 -31
  177. package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js +39 -39
  178. package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js.map +1 -1
  179. package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js +25 -25
  180. package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -1
  181. package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js +8 -8
  182. package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -1
  183. package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js +6 -6
  184. package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -1
  185. package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +7 -7
  186. package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -1
  187. package/.claude-flow-novice/dist/src/cli/index-remote.js +10 -10
  188. package/.claude-flow-novice/dist/src/cli/index.js +1 -1
  189. package/.claude-flow-novice/dist/src/cli/init/directory-structure.js +8 -8
  190. package/.claude-flow-novice/dist/src/cli/init/index.js +3 -3
  191. package/.claude-flow-novice/dist/src/cli/init/sparc-environment.js +67 -67
  192. package/.claude-flow-novice/dist/src/cli/init/swarm-commands.js +18 -18
  193. package/.claude-flow-novice/dist/src/cli/node-repl.js +2 -2
  194. package/.claude-flow-novice/dist/src/cli/repl.js +1 -1
  195. package/.claude-flow-novice/dist/src/cli/simple-cli.js +68 -68
  196. package/.claude-flow-novice/dist/src/cli/simple-cli.js.map +1 -1
  197. package/.claude-flow-novice/dist/src/cli/simple-commands/session-start-soul.js +271 -0
  198. package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js +7 -7
  199. package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js.map +1 -1
  200. package/.claude-flow-novice/dist/src/cli/ui/fallback-handler.js +7 -7
  201. package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js +816 -0
  202. package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js.map +1 -0
  203. package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js +812 -0
  204. package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js.map +1 -0
  205. package/.claude-flow-novice/dist/src/communication/optimized-serialization.js +369 -0
  206. package/.claude-flow-novice/dist/src/communication/optimized-serialization.js.map +1 -0
  207. package/.claude-flow-novice/dist/src/communication/performance-optimizations.js +526 -0
  208. package/.claude-flow-novice/dist/src/communication/performance-optimizations.js.map +1 -0
  209. package/.claude-flow-novice/dist/src/communication/performance-validator.js +532 -0
  210. package/.claude-flow-novice/dist/src/communication/performance-validator.js.map +1 -0
  211. package/.claude-flow-novice/dist/src/communication/priority-message-queue.js +525 -0
  212. package/.claude-flow-novice/dist/src/communication/priority-message-queue.js.map +1 -0
  213. package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js +218 -0
  214. package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js.map +1 -0
  215. package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js +521 -0
  216. package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js.map +1 -0
  217. package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js +563 -0
  218. package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js.map +1 -0
  219. package/.claude-flow-novice/dist/src/communication/websocket-cluster.js +344 -0
  220. package/.claude-flow-novice/dist/src/communication/websocket-cluster.js.map +1 -0
  221. package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js +369 -0
  222. package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js.map +1 -0
  223. package/.claude-flow-novice/dist/src/config/config-manager.js +1 -1
  224. package/.claude-flow-novice/dist/src/config/config-manager.js.map +1 -1
  225. package/.claude-flow-novice/dist/src/config/core/intelligent-configuration-manager.js +1 -1
  226. package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js +6 -6
  227. package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js.map +1 -1
  228. package/.claude-flow-novice/dist/src/config/migration/config-migration.js +1 -1
  229. package/.claude-flow-novice/dist/src/config/ruv-swarm-integration.js +1 -1
  230. package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js +1 -1
  231. package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js.map +1 -1
  232. package/.claude-flow-novice/dist/src/config/web-portal-config.js +0 -9
  233. package/.claude-flow-novice/dist/src/config/web-portal-config.js.map +1 -1
  234. package/.claude-flow-novice/dist/src/config/zero-config-setup.js +18 -18
  235. package/.claude-flow-novice/dist/src/config/zero-config-setup.js.map +1 -1
  236. package/.claude-flow-novice/dist/src/core/logger.js +33 -10
  237. package/.claude-flow-novice/dist/src/core/logger.js.map +1 -1
  238. package/.claude-flow-novice/dist/src/migration/index.js +1 -1
  239. package/.claude-flow-novice/dist/src/migration/index.js.map +1 -1
  240. package/.claude-flow-novice/dist/src/migration/migration-runner.js +4 -4
  241. package/.claude-flow-novice/dist/src/migration/migration-runner.js.map +1 -1
  242. package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js +430 -0
  243. package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js.map +1 -0
  244. package/.claude-flow-novice/dist/src/slash-commands/claude-soul.js +248 -365
  245. package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +1 -1
  246. package/.claude-flow-novice/dist/src/swarm/claude-code-interface.js +1 -1
  247. package/.claude-flow-novice/dist/src/swarm/claude-flow-executor.js +1 -1
  248. package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js +471 -0
  249. package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js.map +1 -0
  250. package/.claude-flow-novice/dist/src/swarm/hive-mind-integration.js +1 -1
  251. package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js +543 -0
  252. package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js.map +1 -0
  253. package/.claude-flow-novice/dist/src/swarm/optimizations/connection-pool.js +1 -1
  254. package/.claude-flow-novice/dist/src/swarm/optimizations/optimized-executor.js +1 -1
  255. package/.claude-flow-novice/dist/src/swarm/types.js.map +1 -1
  256. package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js +709 -0
  257. package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js.map +1 -0
  258. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js +612 -0
  259. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js.map +1 -0
  260. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js +679 -0
  261. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js.map +1 -0
  262. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js +654 -0
  263. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js.map +1 -0
  264. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js +402 -0
  265. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js.map +1 -0
  266. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js +459 -0
  267. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js.map +1 -0
  268. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js +513 -0
  269. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js.map +1 -0
  270. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js +19 -0
  271. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js.map +1 -0
  272. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js +568 -0
  273. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js.map +1 -0
  274. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js +418 -0
  275. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js.map +1 -0
  276. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js +530 -0
  277. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js.map +1 -0
  278. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js +250 -0
  279. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js.map +1 -0
  280. package/.claude-flow-novice/dist/src/task/index.js +7 -7
  281. package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js +420 -0
  282. package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js.map +1 -0
  283. package/.claude-flow-novice/dist/src/validation/production-validator.js +1435 -0
  284. package/.claude-flow-novice/dist/src/validation/production-validator.js.map +1 -0
  285. package/.claude-flow-novice/dist/src/verification/cli-integration.js +3 -3
  286. package/.claude-flow-novice/dist/src/verification/hooks.js +1 -1
  287. package/CHANGELOG.md +13 -0
  288. package/CLAUDE.md +1032 -61
  289. package/README.md +0 -1
  290. package/config/build/babel.config.cjs +19 -11
  291. package/config/typescript/tsconfig.json +1 -1
  292. package/examples/02-workflows/claude-workflow.json +5 -5
  293. package/examples/claude-api-error-handling.ts +2 -2
  294. package/examples/frontend-testing-demo.ts +470 -0
  295. package/examples/litellm/config/config.yaml +1 -1
  296. package/package.json +13 -7
  297. package/scripts/build/unified-builder.sh +6 -6
  298. package/scripts/build/validate-agents.js +238 -0
  299. package/scripts/post-install-claude-md.js +28 -0
  300. package/scripts/run-production-validation.ts +590 -0
  301. package/scripts/test/test-coordination-features.ts +2 -2
  302. package/scripts/validate-stage3-performance.ts +377 -0
  303. package/src/cli/simple-commands/hooks.js +1 -0
  304. package/src/cli/simple-commands/init/agent-copier.js +0 -2
  305. package/src/cli/simple-commands/init/index.js +18 -110
  306. package/src/cli/simple-commands/init/templates/CLAUDE.md +162 -1158
  307. package/src/cli/simple-commands/init/templates/claude-md.js +38 -157
  308. package/src/swarm-fullstack/integrations/communication-bridge.ts +931 -0
  309. package/src/swarm-fullstack/testing/api-contract-validator.ts +909 -0
  310. package/src/swarm-fullstack/testing/backend-test-orchestrator.ts +791 -0
  311. package/src/swarm-fullstack/testing/frontend-test-orchestrator.ts +853 -0
  312. package/src/swarm-fullstack/testing/visual-regression.ts +507 -0
  313. package/src/swarm-fullstack/workflows/convergence-detector.ts +736 -0
  314. package/src/swarm-fullstack/workflows/fix-coordinator.ts +677 -0
  315. package/src/swarm-fullstack/workflows/index.ts +75 -0
  316. package/src/swarm-fullstack/workflows/iterative-build-test.ts +829 -0
  317. package/src/swarm-fullstack/workflows/regression-test-manager.ts +590 -0
  318. package/src/swarm-fullstack/workflows/test-result-analyzer.ts +739 -0
  319. package/src/swarm-fullstack/workflows/workflow-metrics.ts +399 -0
  320. package/wiki/command-reference/README.md +1 -2
  321. package/wiki/command-reference/mcp-tools/README.md +1 -1
  322. package/wiki/getting-started/claude-code-mcp/README.md +1 -2
  323. package/wiki/getting-started/installation/README.md +2 -10
  324. package/.claude/agents/backend-dev.json +0 -9
  325. package/.claude/agents/code-analyzer.json +0 -9
  326. package/.claude/agents/coder.json +0 -9
  327. package/.claude/agents/planner.json +0 -9
  328. package/.claude/agents/researcher.json +0 -9
  329. package/.claude/agents/reviewer.json +0 -9
  330. package/.claude/agents/system-architect.json +0 -9
  331. package/.claude/agents/tester.json +0 -9
  332. package/.claude/commands/flow-nexus/app-store.md +0 -124
  333. package/.claude/commands/flow-nexus/challenges.md +0 -120
  334. package/.claude/commands/flow-nexus/login-registration.md +0 -65
  335. package/.claude/commands/flow-nexus/neural-network.md +0 -134
  336. package/.claude/commands/flow-nexus/payments.md +0 -116
  337. package/.claude/commands/flow-nexus/sandbox.md +0 -83
  338. package/.claude/commands/flow-nexus/swarm.md +0 -87
  339. package/.claude/commands/flow-nexus/user-tools.md +0 -152
  340. package/.claude/commands/flow-nexus/workflow.md +0 -115
  341. package/.claude-flow-novice/dist/cli/index.js +0 -45
  342. package/.claude-flow-novice/dist/core/index.js +0 -22
  343. package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +0 -595
  344. package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +0 -649
  345. package/.claude-flow-novice/dist/mcp/mcp-server-with-slash-commands.js +0 -776
  346. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-md.js +0 -1101
  347. package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +0 -265
  348. /package/{.claude → .claude-flow-novice/.claude}/agents/README.md +0 -0
  349. /package/{.claude → .claude-flow-novice/.claude}/agents/consensus/README.md +0 -0
  350. /package/{.claude → .claude-flow-novice/.claude}/agents/core/coder.md +0 -0
  351. /package/{.claude → .claude-flow-novice/.claude}/agents/core/planner.md +0 -0
  352. /package/{.claude → .claude-flow-novice/.claude}/agents/core/researcher.md +0 -0
  353. /package/{.claude → .claude-flow-novice/.claude}/agents/core/reviewer.md +0 -0
  354. /package/{.claude → .claude-flow-novice/.claude}/agents/core/tester.md +0 -0
  355. /package/{.claude → .claude-flow-novice/.claude}/agents/optimization/README.md +0 -0
  356. /package/{.claude → .claude-flow-novice/.claude}/agents/swarm/README.md +0 -0
@@ -0,0 +1,736 @@
1
+ /**
2
+ * Convergence Detector - Determines When Iteration is Complete
3
+ *
4
+ * Monitors test pass rates, quality metrics, and progress indicators to
5
+ * determine when an iteration has converged and is ready to move forward.
6
+ *
7
+ * Key Features:
8
+ * - Multi-dimensional convergence analysis
9
+ * - Quality gate validation
10
+ * - Trend analysis
11
+ * - Early convergence detection
12
+ * - Divergence warnings
13
+ */
14
+
15
+ import { EventEmitter } from 'events';
16
+ import { ILogger } from '../../core/logger.js';
17
+ import { TestExecutionResult } from './iterative-build-test.js';
18
+
19
+ export interface ConvergenceConfig {
20
+ threshold: number; // 0-1, percentage of passing tests
21
+ minCoverage: number; // 0-100
22
+ requireStability: boolean; // require multiple stable iterations
23
+ stabilityWindow: number; // number of iterations to check
24
+ enableTrendAnalysis: boolean;
25
+ qualityGates: QualityGate[];
26
+ }
27
+
28
+ export interface QualityGate {
29
+ name: string;
30
+ metric: string;
31
+ threshold: number;
32
+ operator: '>' | '<' | '>=' | '<=' | '===';
33
+ blocking: boolean;
34
+ }
35
+
36
+ export interface ConvergenceCheck {
37
+ testResults: TestExecutionResult;
38
+ threshold: number;
39
+ minCoverage: number;
40
+ iterationNumber: number;
41
+ previousResults?: TestExecutionResult[];
42
+ }
43
+
44
+ export interface ConvergenceResult {
45
+ converged: boolean;
46
+ score: number; // 0-1
47
+ confidence: number; // 0-1
48
+ metrics: ConvergenceMetrics;
49
+ qualityGateResults: QualityGateResult[];
50
+ recommendations: string[];
51
+ blockers: string[];
52
+ trends: TrendAnalysis;
53
+ }
54
+
55
+ export interface ConvergenceMetrics {
56
+ testPassRate: number;
57
+ coverageScore: number;
58
+ qualityScore: number;
59
+ stabilityScore: number;
60
+ velocityScore: number;
61
+ overallScore: number;
62
+ }
63
+
64
+ export interface QualityGateResult {
65
+ gate: QualityGate;
66
+ passed: boolean;
67
+ actualValue: number;
68
+ threshold: number;
69
+ blocking: boolean;
70
+ }
71
+
72
+ export interface TrendAnalysis {
73
+ improving: boolean;
74
+ velocity: number; // rate of improvement
75
+ projection: {
76
+ iterationsToConvergence: number;
77
+ estimatedCompletion: string;
78
+ };
79
+ riskFactors: string[];
80
+ }
81
+
82
+ export class ConvergenceDetector extends EventEmitter {
83
+ private config: ConvergenceConfig;
84
+ private iterationHistory: TestExecutionResult[] = [];
85
+
86
+ constructor(private logger: ILogger, config?: Partial<ConvergenceConfig>) {
87
+ super();
88
+
89
+ this.config = {
90
+ threshold: 0.95,
91
+ minCoverage: 80,
92
+ requireStability: true,
93
+ stabilityWindow: 2,
94
+ enableTrendAnalysis: true,
95
+ qualityGates: [
96
+ {
97
+ name: 'Test Pass Rate',
98
+ metric: 'testPassRate',
99
+ threshold: 95,
100
+ operator: '>=',
101
+ blocking: true,
102
+ },
103
+ {
104
+ name: 'Code Coverage',
105
+ metric: 'coverage.lines',
106
+ threshold: 80,
107
+ operator: '>=',
108
+ blocking: true,
109
+ },
110
+ {
111
+ name: 'Critical Failures',
112
+ metric: 'criticalFailures',
113
+ threshold: 0,
114
+ operator: '===',
115
+ blocking: true,
116
+ },
117
+ ],
118
+ ...config,
119
+ };
120
+ }
121
+
122
+ /**
123
+ * Check if iteration has converged
124
+ */
125
+ async checkConvergence(check: ConvergenceCheck): Promise<ConvergenceResult> {
126
+ this.logger.info('Checking convergence', {
127
+ iteration: check.iterationNumber,
128
+ passRate: check.testResults.passed / check.testResults.totalTests,
129
+ });
130
+
131
+ // Add to history
132
+ this.iterationHistory.push(check.testResults);
133
+
134
+ // Calculate individual metrics
135
+ const metrics = this.calculateMetrics(check);
136
+
137
+ // Evaluate quality gates
138
+ const qualityGateResults = this.evaluateQualityGates(check.testResults, metrics);
139
+
140
+ // Analyze trends
141
+ const trends = this.config.enableTrendAnalysis
142
+ ? this.analyzeTrends(check)
143
+ : this.getDefaultTrends();
144
+
145
+ // Determine if converged
146
+ const converged = this.determineConvergence(metrics, qualityGateResults, trends);
147
+
148
+ // Calculate confidence
149
+ const confidence = this.calculateConfidence(metrics, qualityGateResults, trends);
150
+
151
+ // Generate recommendations
152
+ const recommendations = this.generateRecommendations(
153
+ metrics,
154
+ qualityGateResults,
155
+ trends,
156
+ converged,
157
+ );
158
+
159
+ // Identify blockers
160
+ const blockers = this.identifyBlockers(qualityGateResults, metrics);
161
+
162
+ const result: ConvergenceResult = {
163
+ converged,
164
+ score: metrics.overallScore,
165
+ confidence,
166
+ metrics,
167
+ qualityGateResults,
168
+ recommendations,
169
+ blockers,
170
+ trends,
171
+ };
172
+
173
+ // Emit event if converged
174
+ if (converged) {
175
+ this.emit('convergence:achieved', {
176
+ iteration: check.iterationNumber,
177
+ score: metrics.overallScore,
178
+ confidence,
179
+ });
180
+ }
181
+
182
+ // Emit warning if diverging
183
+ if (trends.improving === false && check.iterationNumber > 2) {
184
+ this.emit('convergence:diverging', {
185
+ iteration: check.iterationNumber,
186
+ riskFactors: trends.riskFactors,
187
+ });
188
+ }
189
+
190
+ return result;
191
+ }
192
+
193
+ /**
194
+ * Calculate convergence metrics
195
+ */
196
+ private calculateMetrics(check: ConvergenceCheck): ConvergenceMetrics {
197
+ const { testResults } = check;
198
+
199
+ // Test pass rate (0-1)
200
+ const testPassRate =
201
+ testResults.totalTests > 0 ? testResults.passed / testResults.totalTests : 0;
202
+
203
+ // Coverage score (0-1)
204
+ const coverageScore = this.calculateCoverageScore(testResults.coverage);
205
+
206
+ // Quality score based on failures and warnings (0-1)
207
+ const qualityScore = this.calculateQualityScore(testResults);
208
+
209
+ // Stability score based on recent iterations (0-1)
210
+ const stabilityScore = this.calculateStabilityScore(check);
211
+
212
+ // Velocity score based on improvement rate (0-1)
213
+ const velocityScore = this.calculateVelocityScore();
214
+
215
+ // Overall score (weighted average)
216
+ const overallScore =
217
+ testPassRate * 0.4 +
218
+ coverageScore * 0.25 +
219
+ qualityScore * 0.2 +
220
+ stabilityScore * 0.1 +
221
+ velocityScore * 0.05;
222
+
223
+ return {
224
+ testPassRate,
225
+ coverageScore,
226
+ qualityScore,
227
+ stabilityScore,
228
+ velocityScore,
229
+ overallScore,
230
+ };
231
+ }
232
+
233
+ /**
234
+ * Calculate coverage score from coverage metrics
235
+ */
236
+ private calculateCoverageScore(coverage: TestExecutionResult['coverage']): number {
237
+ const { lines, functions, branches, statements } = coverage;
238
+
239
+ // Weighted average of coverage metrics
240
+ const score = (lines * 0.3 + functions * 0.25 + branches * 0.25 + statements * 0.2) / 100;
241
+
242
+ return Math.min(Math.max(score, 0), 1);
243
+ }
244
+
245
+ /**
246
+ * Calculate quality score based on failures and warnings
247
+ */
248
+ private calculateQualityScore(testResults: TestExecutionResult): number {
249
+ let score = 1.0;
250
+
251
+ // Penalize for failures
252
+ const criticalFailures = testResults.failures.filter((f) => f.severity === 'critical').length;
253
+ const highFailures = testResults.failures.filter((f) => f.severity === 'high').length;
254
+ const mediumFailures = testResults.failures.filter((f) => f.severity === 'medium').length;
255
+
256
+ score -= criticalFailures * 0.2;
257
+ score -= highFailures * 0.1;
258
+ score -= mediumFailures * 0.05;
259
+
260
+ // Penalize for warnings
261
+ const highWarnings = testResults.warnings.filter((w) => w.severity === 'high').length;
262
+ const mediumWarnings = testResults.warnings.filter((w) => w.severity === 'medium').length;
263
+
264
+ score -= highWarnings * 0.02;
265
+ score -= mediumWarnings * 0.01;
266
+
267
+ return Math.max(score, 0);
268
+ }
269
+
270
+ /**
271
+ * Calculate stability score based on recent iterations
272
+ */
273
+ private calculateStabilityScore(check: ConvergenceCheck): number {
274
+ if (this.iterationHistory.length < 2) return 0.5;
275
+
276
+ const recent = this.iterationHistory.slice(-this.config.stabilityWindow);
277
+
278
+ // Calculate variance in pass rate
279
+ const passRates = recent.map((r) => r.passed / r.totalTests);
280
+ const variance = this.calculateVariance(passRates);
281
+
282
+ // Lower variance = higher stability
283
+ const stabilityScore = 1 - Math.min(variance * 10, 1);
284
+
285
+ return stabilityScore;
286
+ }
287
+
288
+ /**
289
+ * Calculate velocity score (rate of improvement)
290
+ */
291
+ private calculateVelocityScore(): number {
292
+ if (this.iterationHistory.length < 2) return 0.5;
293
+
294
+ const recent = this.iterationHistory.slice(-3);
295
+ const passRates = recent.map((r) => r.passed / r.totalTests);
296
+
297
+ // Check if improving
298
+ let improving = true;
299
+ for (let i = 1; i < passRates.length; i++) {
300
+ if (passRates[i] <= passRates[i - 1]) {
301
+ improving = false;
302
+ break;
303
+ }
304
+ }
305
+
306
+ if (!improving) return 0.3;
307
+
308
+ // Calculate improvement rate
309
+ const totalImprovement = passRates[passRates.length - 1] - passRates[0];
310
+ const velocityScore = Math.min(totalImprovement * 2, 1);
311
+
312
+ return velocityScore;
313
+ }
314
+
315
+ /**
316
+ * Evaluate quality gates
317
+ */
318
+ private evaluateQualityGates(
319
+ testResults: TestExecutionResult,
320
+ metrics: ConvergenceMetrics,
321
+ ): QualityGateResult[] {
322
+ return this.config.qualityGates.map((gate) => {
323
+ const actualValue = this.getMetricValue(gate.metric, testResults, metrics);
324
+ const passed = this.evaluateCondition(actualValue, gate.operator, gate.threshold);
325
+
326
+ return {
327
+ gate,
328
+ passed,
329
+ actualValue,
330
+ threshold: gate.threshold,
331
+ blocking: gate.blocking,
332
+ };
333
+ });
334
+ }
335
+
336
+ /**
337
+ * Get metric value from test results or metrics
338
+ */
339
+ private getMetricValue(
340
+ metric: string,
341
+ testResults: TestExecutionResult,
342
+ metrics: ConvergenceMetrics,
343
+ ): number {
344
+ // Handle nested properties
345
+ if (metric.includes('.')) {
346
+ const parts = metric.split('.');
347
+ let value: any = testResults;
348
+
349
+ for (const part of parts) {
350
+ value = value[part];
351
+ if (value === undefined) break;
352
+ }
353
+
354
+ return typeof value === 'number' ? value : 0;
355
+ }
356
+
357
+ // Handle special metrics
358
+ if (metric === 'testPassRate') {
359
+ return metrics.testPassRate * 100;
360
+ }
361
+
362
+ if (metric === 'criticalFailures') {
363
+ return testResults.failures.filter((f) => f.severity === 'critical').length;
364
+ }
365
+
366
+ return 0;
367
+ }
368
+
369
+ /**
370
+ * Evaluate condition
371
+ */
372
+ private evaluateCondition(
373
+ actualValue: number,
374
+ operator: QualityGate['operator'],
375
+ threshold: number,
376
+ ): boolean {
377
+ switch (operator) {
378
+ case '>':
379
+ return actualValue > threshold;
380
+ case '<':
381
+ return actualValue < threshold;
382
+ case '>=':
383
+ return actualValue >= threshold;
384
+ case '<=':
385
+ return actualValue <= threshold;
386
+ case '===':
387
+ return actualValue === threshold;
388
+ default:
389
+ return false;
390
+ }
391
+ }
392
+
393
+ /**
394
+ * Analyze trends
395
+ */
396
+ private analyzeTrends(check: ConvergenceCheck): TrendAnalysis {
397
+ if (this.iterationHistory.length < 2) {
398
+ return this.getDefaultTrends();
399
+ }
400
+
401
+ const recent = this.iterationHistory.slice(-3);
402
+ const passRates = recent.map((r) => r.passed / r.totalTests);
403
+
404
+ // Check if improving
405
+ const improving = this.isImproving(passRates);
406
+
407
+ // Calculate velocity (rate of change)
408
+ const velocity = this.calculateTrendVelocity(passRates);
409
+
410
+ // Project iterations to convergence
411
+ const iterationsToConvergence = this.projectIterationsToConvergence(
412
+ passRates,
413
+ velocity,
414
+ this.config.threshold,
415
+ );
416
+
417
+ // Identify risk factors
418
+ const riskFactors = this.identifyRiskFactors(passRates, velocity, check);
419
+
420
+ return {
421
+ improving,
422
+ velocity,
423
+ projection: {
424
+ iterationsToConvergence,
425
+ estimatedCompletion: new Date(
426
+ Date.now() + iterationsToConvergence * 1800000,
427
+ ).toISOString(),
428
+ },
429
+ riskFactors,
430
+ };
431
+ }
432
+
433
+ /**
434
+ * Determine if trend is improving
435
+ */
436
+ private isImproving(values: number[]): boolean {
437
+ if (values.length < 2) return true;
438
+
439
+ let improvementCount = 0;
440
+ for (let i = 1; i < values.length; i++) {
441
+ if (values[i] > values[i - 1]) improvementCount++;
442
+ }
443
+
444
+ return improvementCount > values.length / 2;
445
+ }
446
+
447
+ /**
448
+ * Calculate trend velocity
449
+ */
450
+ private calculateTrendVelocity(values: number[]): number {
451
+ if (values.length < 2) return 0;
452
+
453
+ const changes: number[] = [];
454
+ for (let i = 1; i < values.length; i++) {
455
+ changes.push(values[i] - values[i - 1]);
456
+ }
457
+
458
+ return changes.reduce((sum, change) => sum + change, 0) / changes.length;
459
+ }
460
+
461
+ /**
462
+ * Project iterations to convergence
463
+ */
464
+ private projectIterationsToConvergence(
465
+ passRates: number[],
466
+ velocity: number,
467
+ threshold: number,
468
+ ): number {
469
+ if (passRates.length === 0) return 10;
470
+
471
+ const currentRate = passRates[passRates.length - 1];
472
+ const gap = threshold - currentRate;
473
+
474
+ if (velocity <= 0) return 999; // Not converging
475
+ if (gap <= 0) return 0; // Already converged
476
+
477
+ return Math.ceil(gap / velocity);
478
+ }
479
+
480
+ /**
481
+ * Identify risk factors
482
+ */
483
+ private identifyRiskFactors(
484
+ passRates: number[],
485
+ velocity: number,
486
+ check: ConvergenceCheck,
487
+ ): string[] {
488
+ const risks: string[] = [];
489
+
490
+ // Negative velocity
491
+ if (velocity < 0) {
492
+ risks.push('Test pass rate is decreasing');
493
+ }
494
+
495
+ // Stagnant progress
496
+ if (Math.abs(velocity) < 0.01 && passRates[passRates.length - 1] < this.config.threshold) {
497
+ risks.push('Progress has stagnated');
498
+ }
499
+
500
+ // Critical failures
501
+ const criticalFailures = check.testResults.failures.filter(
502
+ (f) => f.severity === 'critical',
503
+ ).length;
504
+ if (criticalFailures > 0) {
505
+ risks.push(`${criticalFailures} critical test failures present`);
506
+ }
507
+
508
+ // Low coverage
509
+ const avgCoverage =
510
+ (check.testResults.coverage.lines +
511
+ check.testResults.coverage.functions +
512
+ check.testResults.coverage.branches) /
513
+ 3;
514
+ if (avgCoverage < this.config.minCoverage) {
515
+ risks.push(`Code coverage (${avgCoverage.toFixed(1)}%) below threshold`);
516
+ }
517
+
518
+ // High iteration count
519
+ if (check.iterationNumber > 7) {
520
+ risks.push('High iteration count may indicate design issues');
521
+ }
522
+
523
+ return risks;
524
+ }
525
+
526
+ /**
527
+ * Determine convergence
528
+ */
529
+ private determineConvergence(
530
+ metrics: ConvergenceMetrics,
531
+ qualityGateResults: QualityGateResult[],
532
+ trends: TrendAnalysis,
533
+ ): boolean {
534
+ // Check if all blocking quality gates pass
535
+ const blockingGatesPassed = qualityGateResults
536
+ .filter((r) => r.gate.blocking)
537
+ .every((r) => r.passed);
538
+
539
+ if (!blockingGatesPassed) return false;
540
+
541
+ // Check overall score
542
+ if (metrics.overallScore < this.config.threshold) return false;
543
+
544
+ // Check stability if required
545
+ if (this.config.requireStability && metrics.stabilityScore < 0.7) return false;
546
+
547
+ // Check if improving
548
+ if (this.config.enableTrendAnalysis && !trends.improving) return false;
549
+
550
+ return true;
551
+ }
552
+
553
+ /**
554
+ * Calculate confidence level
555
+ */
556
+ private calculateConfidence(
557
+ metrics: ConvergenceMetrics,
558
+ qualityGateResults: QualityGateResult[],
559
+ trends: TrendAnalysis,
560
+ ): number {
561
+ let confidence = 0.5;
562
+
563
+ // High pass rate increases confidence
564
+ confidence += metrics.testPassRate * 0.2;
565
+
566
+ // High coverage increases confidence
567
+ confidence += metrics.coverageScore * 0.15;
568
+
569
+ // High quality increases confidence
570
+ confidence += metrics.qualityScore * 0.1;
571
+
572
+ // Stability increases confidence
573
+ confidence += metrics.stabilityScore * 0.1;
574
+
575
+ // All quality gates passing increases confidence
576
+ const allGatesPassed = qualityGateResults.every((r) => r.passed);
577
+ if (allGatesPassed) confidence += 0.15;
578
+
579
+ // Positive trends increase confidence
580
+ if (trends.improving && trends.velocity > 0) confidence += 0.1;
581
+
582
+ return Math.min(confidence, 1);
583
+ }
584
+
585
+ /**
586
+ * Generate recommendations
587
+ */
588
+ private generateRecommendations(
589
+ metrics: ConvergenceMetrics,
590
+ qualityGateResults: QualityGateResult[],
591
+ trends: TrendAnalysis,
592
+ converged: boolean,
593
+ ): string[] {
594
+ const recommendations: string[] = [];
595
+
596
+ if (converged) {
597
+ recommendations.push('Iteration has converged - ready to proceed');
598
+ recommendations.push('Consider final validation before deployment');
599
+ return recommendations;
600
+ }
601
+
602
+ // Test pass rate recommendations
603
+ if (metrics.testPassRate < 0.9) {
604
+ recommendations.push(
605
+ `Focus on fixing remaining test failures (${((1 - metrics.testPassRate) * 100).toFixed(1)}% failing)`,
606
+ );
607
+ }
608
+
609
+ // Coverage recommendations
610
+ if (metrics.coverageScore < 0.8) {
611
+ recommendations.push(
612
+ `Increase test coverage (current: ${(metrics.coverageScore * 100).toFixed(1)}%)`,
613
+ );
614
+ }
615
+
616
+ // Quality recommendations
617
+ if (metrics.qualityScore < 0.8) {
618
+ recommendations.push('Address high-severity test failures and warnings');
619
+ }
620
+
621
+ // Stability recommendations
622
+ if (metrics.stabilityScore < 0.7) {
623
+ recommendations.push('Focus on stabilizing existing fixes before adding new changes');
624
+ }
625
+
626
+ // Trend recommendations
627
+ if (!trends.improving) {
628
+ recommendations.push('Re-evaluate fix strategies - current approach may not be effective');
629
+ }
630
+
631
+ // Failed quality gates
632
+ const failedGates = qualityGateResults.filter((r) => !r.passed);
633
+ for (const result of failedGates) {
634
+ recommendations.push(
635
+ `Address quality gate: ${result.gate.name} (${result.actualValue} ${result.gate.operator} ${result.threshold})`,
636
+ );
637
+ }
638
+
639
+ return recommendations;
640
+ }
641
+
642
+ /**
643
+ * Identify blockers
644
+ */
645
+ private identifyBlockers(
646
+ qualityGateResults: QualityGateResult[],
647
+ metrics: ConvergenceMetrics,
648
+ ): string[] {
649
+ const blockers: string[] = [];
650
+
651
+ // Failed blocking quality gates
652
+ const failedBlockingGates = qualityGateResults.filter(
653
+ (r) => r.gate.blocking && !r.passed,
654
+ );
655
+
656
+ for (const result of failedBlockingGates) {
657
+ blockers.push(
658
+ `Blocking quality gate failed: ${result.gate.name} (${result.actualValue} ${result.gate.operator} ${result.threshold})`,
659
+ );
660
+ }
661
+
662
+ return blockers;
663
+ }
664
+
665
+ /**
666
+ * Calculate variance
667
+ */
668
+ private calculateVariance(values: number[]): number {
669
+ if (values.length === 0) return 0;
670
+
671
+ const mean = values.reduce((sum, v) => sum + v, 0) / values.length;
672
+ const squaredDiffs = values.map((v) => Math.pow(v - mean, 2));
673
+ const variance = squaredDiffs.reduce((sum, v) => sum + v, 0) / values.length;
674
+
675
+ return variance;
676
+ }
677
+
678
+ /**
679
+ * Get default trends
680
+ */
681
+ private getDefaultTrends(): TrendAnalysis {
682
+ return {
683
+ improving: true,
684
+ velocity: 0,
685
+ projection: {
686
+ iterationsToConvergence: 5,
687
+ estimatedCompletion: new Date(Date.now() + 5 * 1800000).toISOString(),
688
+ },
689
+ riskFactors: [],
690
+ };
691
+ }
692
+
693
+ /**
694
+ * Reset detector for new workflow
695
+ */
696
+ reset(): void {
697
+ this.iterationHistory = [];
698
+ }
699
+
700
+ /**
701
+ * Get current status
702
+ */
703
+ getStatus(): {
704
+ iterations: number;
705
+ currentPassRate: number;
706
+ trend: string;
707
+ } {
708
+ const iterations = this.iterationHistory.length;
709
+
710
+ if (iterations === 0) {
711
+ return {
712
+ iterations: 0,
713
+ currentPassRate: 0,
714
+ trend: 'unknown',
715
+ };
716
+ }
717
+
718
+ const latest = this.iterationHistory[iterations - 1];
719
+ const currentPassRate = latest.passed / latest.totalTests;
720
+
721
+ let trend = 'stable';
722
+ if (iterations > 1) {
723
+ const previous = this.iterationHistory[iterations - 2];
724
+ const previousPassRate = previous.passed / previous.totalTests;
725
+
726
+ if (currentPassRate > previousPassRate + 0.05) trend = 'improving';
727
+ else if (currentPassRate < previousPassRate - 0.05) trend = 'declining';
728
+ }
729
+
730
+ return {
731
+ iterations,
732
+ currentPassRate,
733
+ trend,
734
+ };
735
+ }
736
+ }