claude-flow-novice 1.3.6 → 1.5.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 (347) 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 +208 -550
  4. package/.claude/agents/architect.md +136 -469
  5. package/.claude/agents/architecture/system-architect.md +20 -1
  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 +87 -303
  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 +22 -11
  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 +134 -402
  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 +1 -1
  30. package/.claude/agents/optimization/performance-monitor.md +1 -1
  31. package/.claude/agents/planner.md +135 -0
  32. package/.claude/agents/researcher.md +22 -9
  33. package/.claude/agents/reviewer.md +291 -0
  34. package/.claude/agents/security/security-specialist.md +1 -1
  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/tester.md +21 -11
  41. package/.claude/agents/testing/unit/tdd-london-swarm.md +1 -1
  42. package/.claude/agents/testing/validation/production-validator.md +1 -1
  43. package/.claude/commands/claude-soul.js +1 -1
  44. package/.claude/commands/fullstack.md +134 -0
  45. package/.claude/commands/index.js +4 -0
  46. package/.claude/hooks.json +12 -15
  47. package/{.claude → .claude-flow-novice/.claude}/agents/MIGRATION_SUMMARY.md +1 -1
  48. package/.claude-flow-novice/.claude/agents/analysis/code-analyzer.md +192 -0
  49. package/.claude-flow-novice/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
  50. package/.claude-flow-novice/.claude/agents/analyst.md +300 -0
  51. package/.claude-flow-novice/.claude/agents/architect.md +557 -0
  52. package/.claude-flow-novice/.claude/agents/architecture/system-architect.md +630 -0
  53. package/.claude-flow-novice/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
  54. package/.claude-flow-novice/.claude/agents/base-template-generator.md +65 -0
  55. package/.claude-flow-novice/.claude/agents/coder.md +180 -0
  56. package/.claude-flow-novice/.claude/agents/consensus/byzantine-coordinator.md +46 -0
  57. package/.claude-flow-novice/.claude/agents/consensus/consensus-builder.md +225 -0
  58. package/.claude-flow-novice/.claude/agents/consensus/crdt-synchronizer.md +980 -0
  59. package/.claude-flow-novice/.claude/agents/consensus/gossip-coordinator.md +46 -0
  60. package/.claude-flow-novice/.claude/agents/consensus/performance-benchmarker.md +834 -0
  61. package/.claude-flow-novice/.claude/agents/consensus/quorum-manager.md +806 -0
  62. package/.claude-flow-novice/.claude/agents/consensus/raft-manager.md +46 -0
  63. package/.claude-flow-novice/.claude/agents/consensus/security-manager.md +605 -0
  64. package/.claude-flow-novice/.claude/agents/coordinator.md +842 -0
  65. package/.claude-flow-novice/.claude/agents/data/ml/data-ml-model.md +193 -0
  66. package/.claude-flow-novice/.claude/agents/development/backend/dev-backend-api.md +142 -0
  67. package/.claude-flow-novice/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
  68. package/.claude-flow-novice/.claude/agents/devops/devops-engineer.md +638 -0
  69. package/.claude-flow-novice/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
  70. package/.claude-flow-novice/.claude/agents/github/code-review-swarm.md +538 -0
  71. package/.claude-flow-novice/.claude/agents/github/github-modes.md +173 -0
  72. package/.claude-flow-novice/.claude/agents/github/github-specialist.md +856 -0
  73. package/.claude-flow-novice/.claude/agents/github/issue-tracker.md +319 -0
  74. package/.claude-flow-novice/.claude/agents/github/multi-repo-swarm.md +553 -0
  75. package/.claude-flow-novice/.claude/agents/github/pr-manager.md +191 -0
  76. package/.claude-flow-novice/.claude/agents/github/project-board-sync.md +509 -0
  77. package/.claude-flow-novice/.claude/agents/github/release-manager.md +367 -0
  78. package/.claude-flow-novice/.claude/agents/github/release-swarm.md +583 -0
  79. package/.claude-flow-novice/.claude/agents/github/repo-architect.md +398 -0
  80. package/.claude-flow-novice/.claude/agents/github/swarm-issue.md +573 -0
  81. package/.claude-flow-novice/.claude/agents/github/swarm-pr.md +428 -0
  82. package/.claude-flow-novice/.claude/agents/github/sync-coordinator.md +452 -0
  83. package/.claude-flow-novice/.claude/agents/github/workflow-automation.md +635 -0
  84. package/.claude-flow-novice/.claude/agents/goal/goal-planner.md +73 -0
  85. package/.claude-flow-novice/.claude/agents/neural/neural-pattern-agent.md +762 -0
  86. package/.claude-flow-novice/.claude/agents/neural/safla-neural.md +74 -0
  87. package/.claude-flow-novice/.claude/agents/optimization/benchmark-suite.md +665 -0
  88. package/.claude-flow-novice/.claude/agents/optimization/load-balancer.md +431 -0
  89. package/.claude-flow-novice/.claude/agents/optimization/perf-analyzer.md +725 -0
  90. package/.claude-flow-novice/.claude/agents/optimization/performance-monitor.md +672 -0
  91. package/.claude-flow-novice/.claude/agents/optimization/resource-allocator.md +674 -0
  92. package/.claude-flow-novice/.claude/agents/optimization/topology-optimizer.md +808 -0
  93. package/.claude-flow-novice/.claude/agents/planner.md +135 -0
  94. package/.claude-flow-novice/.claude/agents/researcher.md +185 -0
  95. package/.claude-flow-novice/.claude/agents/reviewer.md +291 -0
  96. package/.claude-flow-novice/.claude/agents/security/security-specialist.md +978 -0
  97. package/.claude-flow-novice/.claude/agents/sparc/architecture.md +472 -0
  98. package/.claude-flow-novice/.claude/agents/sparc/pseudocode.md +318 -0
  99. package/.claude-flow-novice/.claude/agents/sparc/refinement.md +525 -0
  100. package/.claude-flow-novice/.claude/agents/sparc/specification.md +276 -0
  101. package/.claude-flow-novice/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
  102. package/.claude-flow-novice/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
  103. package/.claude-flow-novice/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
  104. package/.claude-flow-novice/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
  105. package/.claude-flow-novice/.claude/agents/sublinear/pagerank-agent.md +699 -0
  106. package/.claude-flow-novice/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
  107. package/.claude-flow-novice/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
  108. package/.claude-flow-novice/.claude/agents/sublinear/sublinear.md +816 -0
  109. package/.claude-flow-novice/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
  110. package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator-enhanced.md +746 -0
  111. package/.claude-flow-novice/.claude/agents/swarm/adaptive-coordinator.md +396 -0
  112. package/.claude-flow-novice/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
  113. package/.claude-flow-novice/.claude/agents/swarm/mesh-coordinator.md +435 -0
  114. package/.claude-flow-novice/.claude/agents/templates/automation-smart-agent.md +205 -0
  115. package/.claude-flow-novice/.claude/agents/templates/coordinator-swarm-init.md +90 -0
  116. package/.claude-flow-novice/.claude/agents/templates/github-pr-manager.md +177 -0
  117. package/.claude-flow-novice/.claude/agents/templates/implementer-sparc-coder.md +259 -0
  118. package/.claude-flow-novice/.claude/agents/templates/memory-coordinator.md +187 -0
  119. package/.claude-flow-novice/.claude/agents/templates/migration-plan.md +746 -0
  120. package/.claude-flow-novice/.claude/agents/templates/orchestrator-task.md +139 -0
  121. package/.claude-flow-novice/.claude/agents/templates/performance-analyzer.md +199 -0
  122. package/.claude-flow-novice/.claude/agents/templates/sparc-coordinator.md +183 -0
  123. package/.claude-flow-novice/.claude/agents/tester.md +663 -0
  124. package/.claude-flow-novice/.claude/agents/testing/e2e/playwright-agent.md +249 -0
  125. package/.claude-flow-novice/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
  126. package/.claude-flow-novice/.claude/agents/testing/validation/production-validator.md +395 -0
  127. package/.claude-flow-novice/dist/index.js +12 -24
  128. package/.claude-flow-novice/dist/index.js.map +1 -0
  129. package/.claude-flow-novice/dist/src/agents/agent-manager.js +123 -69
  130. package/.claude-flow-novice/dist/src/agents/agent-manager.js.map +1 -1
  131. package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js +7 -7
  132. package/.claude-flow-novice/dist/src/agents/github/utils/hook-integration.js.map +1 -1
  133. package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js +485 -0
  134. package/.claude-flow-novice/dist/src/agents/stage3-integration-validator.js.map +1 -0
  135. package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js +630 -0
  136. package/.claude-flow-novice/dist/src/agents/unified-ultra-fast-agent-manager.js.map +1 -0
  137. package/.claude-flow-novice/dist/src/cli/commands/agent.js +1 -1
  138. package/.claude-flow-novice/dist/src/cli/commands/agent.js.map +1 -1
  139. package/.claude-flow-novice/dist/src/cli/commands/config-integration.js +6 -6
  140. package/.claude-flow-novice/dist/src/cli/commands/enterprise.js +18 -18
  141. package/.claude-flow-novice/dist/src/cli/commands/enterprise.js.map +1 -1
  142. package/.claude-flow-novice/dist/src/cli/commands/goal-init.js +4 -4
  143. package/.claude-flow-novice/dist/src/cli/commands/help-new.js +23 -23
  144. package/.claude-flow-novice/dist/src/cli/commands/help-new.js.map +1 -1
  145. package/.claude-flow-novice/dist/src/cli/commands/help.js +74 -74
  146. package/.claude-flow-novice/dist/src/cli/commands/help.js.map +1 -1
  147. package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js +2 -2
  148. package/.claude-flow-novice/dist/src/cli/commands/hive-mind/pause.js.map +1 -1
  149. package/.claude-flow-novice/dist/src/cli/commands/hive.js +4 -4
  150. package/.claude-flow-novice/dist/src/cli/commands/index.js +103 -132
  151. package/.claude-flow-novice/dist/src/cli/commands/index.js.map +1 -1
  152. package/.claude-flow-novice/dist/src/cli/commands/mcp.js +1 -1
  153. package/.claude-flow-novice/dist/src/cli/commands/migrate.js +4 -4
  154. package/.claude-flow-novice/dist/src/cli/commands/migrate.js.map +1 -1
  155. package/.claude-flow-novice/dist/src/cli/commands/monitor.js +1 -1
  156. package/.claude-flow-novice/dist/src/cli/commands/neural-init.js +4 -4
  157. package/.claude-flow-novice/dist/src/cli/commands/ruv-swarm.js +8 -8
  158. package/.claude-flow-novice/dist/src/cli/commands/sparc.js +12 -12
  159. package/.claude-flow-novice/dist/src/cli/commands/sparc.js.map +1 -1
  160. package/.claude-flow-novice/dist/src/cli/commands/start/start-command.js +3 -3
  161. package/.claude-flow-novice/dist/src/cli/commands/status.js +1 -1
  162. package/.claude-flow-novice/dist/src/cli/commands/swarm.js +7 -7
  163. package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
  164. package/.claude-flow-novice/dist/src/cli/commands/verification.js +18 -18
  165. package/.claude-flow-novice/dist/src/cli/completion.js +54 -54
  166. package/.claude-flow-novice/dist/src/cli/completion.js.map +1 -1
  167. package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js +11 -11
  168. package/.claude-flow-novice/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -1
  169. package/.claude-flow-novice/dist/src/cli/consolidated/core/CommandHandlers.js +31 -31
  170. package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js +39 -39
  171. package/.claude-flow-novice/dist/src/cli/consolidated/core/TierManager.js.map +1 -1
  172. package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js +25 -25
  173. package/.claude-flow-novice/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -1
  174. package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js +8 -8
  175. package/.claude-flow-novice/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -1
  176. package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js +6 -6
  177. package/.claude-flow-novice/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -1
  178. package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +7 -7
  179. package/.claude-flow-novice/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -1
  180. package/.claude-flow-novice/dist/src/cli/index-remote.js +10 -10
  181. package/.claude-flow-novice/dist/src/cli/index.js +1 -1
  182. package/.claude-flow-novice/dist/src/cli/init/directory-structure.js +8 -8
  183. package/.claude-flow-novice/dist/src/cli/init/index.js +3 -3
  184. package/.claude-flow-novice/dist/src/cli/init/sparc-environment.js +67 -67
  185. package/.claude-flow-novice/dist/src/cli/init/swarm-commands.js +18 -18
  186. package/.claude-flow-novice/dist/src/cli/node-repl.js +2 -2
  187. package/.claude-flow-novice/dist/src/cli/repl.js +1 -1
  188. package/.claude-flow-novice/dist/src/cli/simple-cli.js +68 -68
  189. package/.claude-flow-novice/dist/src/cli/simple-cli.js.map +1 -1
  190. package/.claude-flow-novice/dist/src/cli/simple-commands/session-start-soul.js +271 -0
  191. package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js +7 -7
  192. package/.claude-flow-novice/dist/src/cli/simple-orchestrator.js.map +1 -1
  193. package/.claude-flow-novice/dist/src/cli/ui/fallback-handler.js +7 -7
  194. package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js +816 -0
  195. package/.claude-flow-novice/dist/src/communication/enhanced-event-bus.js.map +1 -0
  196. package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js +812 -0
  197. package/.claude-flow-novice/dist/src/communication/failure-recovery-system.js.map +1 -0
  198. package/.claude-flow-novice/dist/src/communication/optimized-serialization.js +369 -0
  199. package/.claude-flow-novice/dist/src/communication/optimized-serialization.js.map +1 -0
  200. package/.claude-flow-novice/dist/src/communication/performance-optimizations.js +526 -0
  201. package/.claude-flow-novice/dist/src/communication/performance-optimizations.js.map +1 -0
  202. package/.claude-flow-novice/dist/src/communication/performance-validator.js +532 -0
  203. package/.claude-flow-novice/dist/src/communication/performance-validator.js.map +1 -0
  204. package/.claude-flow-novice/dist/src/communication/priority-message-queue.js +525 -0
  205. package/.claude-flow-novice/dist/src/communication/priority-message-queue.js.map +1 -0
  206. package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js +218 -0
  207. package/.claude-flow-novice/dist/src/communication/shared-buffer-bus.js.map +1 -0
  208. package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js +521 -0
  209. package/.claude-flow-novice/dist/src/communication/ultra-fast-communication-bus.js.map +1 -0
  210. package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js +563 -0
  211. package/.claude-flow-novice/dist/src/communication/ultra-fast-serialization.js.map +1 -0
  212. package/.claude-flow-novice/dist/src/communication/websocket-cluster.js +344 -0
  213. package/.claude-flow-novice/dist/src/communication/websocket-cluster.js.map +1 -0
  214. package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js +369 -0
  215. package/.claude-flow-novice/dist/src/communication/zero-copy-structures.js.map +1 -0
  216. package/.claude-flow-novice/dist/src/config/config-manager.js +1 -1
  217. package/.claude-flow-novice/dist/src/config/config-manager.js.map +1 -1
  218. package/.claude-flow-novice/dist/src/config/core/intelligent-configuration-manager.js +1 -1
  219. package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js +6 -6
  220. package/.claude-flow-novice/dist/src/config/integration/hooks-integration.js.map +1 -1
  221. package/.claude-flow-novice/dist/src/config/migration/config-migration.js +1 -1
  222. package/.claude-flow-novice/dist/src/config/ruv-swarm-integration.js +1 -1
  223. package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js +1 -1
  224. package/.claude-flow-novice/dist/src/config/utils/zero-config-setup.js.map +1 -1
  225. package/.claude-flow-novice/dist/src/config/web-portal-config.js +0 -9
  226. package/.claude-flow-novice/dist/src/config/web-portal-config.js.map +1 -1
  227. package/.claude-flow-novice/dist/src/config/zero-config-setup.js +18 -18
  228. package/.claude-flow-novice/dist/src/config/zero-config-setup.js.map +1 -1
  229. package/.claude-flow-novice/dist/src/core/logger.js +33 -10
  230. package/.claude-flow-novice/dist/src/core/logger.js.map +1 -1
  231. package/.claude-flow-novice/dist/src/migration/index.js +1 -1
  232. package/.claude-flow-novice/dist/src/migration/index.js.map +1 -1
  233. package/.claude-flow-novice/dist/src/migration/migration-runner.js +4 -4
  234. package/.claude-flow-novice/dist/src/migration/migration-runner.js.map +1 -1
  235. package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js +430 -0
  236. package/.claude-flow-novice/dist/src/monitoring/agent-health-monitor.js.map +1 -0
  237. package/.claude-flow-novice/dist/src/slash-commands/claude-soul.js +248 -365
  238. package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +1 -1
  239. package/.claude-flow-novice/dist/src/swarm/claude-code-interface.js +1 -1
  240. package/.claude-flow-novice/dist/src/swarm/claude-flow-executor.js +1 -1
  241. package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js +471 -0
  242. package/.claude-flow-novice/dist/src/swarm/consensus-coordinator.js.map +1 -0
  243. package/.claude-flow-novice/dist/src/swarm/hive-mind-integration.js +1 -1
  244. package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js +543 -0
  245. package/.claude-flow-novice/dist/src/swarm/large-scale-coordinator.js.map +1 -0
  246. package/.claude-flow-novice/dist/src/swarm/optimizations/connection-pool.js +1 -1
  247. package/.claude-flow-novice/dist/src/swarm/optimizations/optimized-executor.js +1 -1
  248. package/.claude-flow-novice/dist/src/swarm/types.js.map +1 -1
  249. package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js +709 -0
  250. package/.claude-flow-novice/dist/src/swarm-fullstack/integrations/communication-bridge.js.map +1 -0
  251. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js +612 -0
  252. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/api-contract-validator.js.map +1 -0
  253. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js +679 -0
  254. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/backend-test-orchestrator.js.map +1 -0
  255. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js +654 -0
  256. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/frontend-test-orchestrator.js.map +1 -0
  257. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js +402 -0
  258. package/.claude-flow-novice/dist/src/swarm-fullstack/testing/visual-regression.js.map +1 -0
  259. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js +459 -0
  260. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/convergence-detector.js.map +1 -0
  261. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js +513 -0
  262. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/fix-coordinator.js.map +1 -0
  263. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js +19 -0
  264. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/index.js.map +1 -0
  265. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js +568 -0
  266. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/iterative-build-test.js.map +1 -0
  267. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js +418 -0
  268. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/regression-test-manager.js.map +1 -0
  269. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js +530 -0
  270. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/test-result-analyzer.js.map +1 -0
  271. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js +250 -0
  272. package/.claude-flow-novice/dist/src/swarm-fullstack/workflows/workflow-metrics.js.map +1 -0
  273. package/.claude-flow-novice/dist/src/task/index.js +7 -7
  274. package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js +420 -0
  275. package/.claude-flow-novice/dist/src/validation/fullstack-integration-validator.js.map +1 -0
  276. package/.claude-flow-novice/dist/src/validation/production-validator.js +1435 -0
  277. package/.claude-flow-novice/dist/src/validation/production-validator.js.map +1 -0
  278. package/.claude-flow-novice/dist/src/verification/cli-integration.js +3 -3
  279. package/.claude-flow-novice/dist/src/verification/hooks.js +1 -1
  280. package/CHANGELOG.md +26 -0
  281. package/CLAUDE.md +1967 -68
  282. package/README.md +0 -1
  283. package/config/build/babel.config.cjs +19 -11
  284. package/config/typescript/tsconfig.json +1 -1
  285. package/examples/claude-api-error-handling.ts +2 -2
  286. package/examples/frontend-testing-demo.ts +470 -0
  287. package/examples/litellm/config/config.yaml +1 -1
  288. package/package.json +13 -7
  289. package/scripts/build/unified-builder.sh +6 -6
  290. package/scripts/build/validate-agents.js +238 -0
  291. package/scripts/run-production-validation.ts +590 -0
  292. package/scripts/test/test-coordination-features.ts +2 -2
  293. package/scripts/validate-stage3-performance.ts +377 -0
  294. package/src/cli/simple-commands/hooks.js +1 -0
  295. package/src/cli/simple-commands/init/agent-copier.js +0 -2
  296. package/src/cli/simple-commands/init/index.js +5 -97
  297. package/src/cli/simple-commands/init/templates/CLAUDE.md +163 -1158
  298. package/src/cli/simple-commands/init/templates/claude-md.js +38 -157
  299. package/src/swarm-fullstack/integrations/communication-bridge.ts +931 -0
  300. package/src/swarm-fullstack/testing/api-contract-validator.ts +909 -0
  301. package/src/swarm-fullstack/testing/backend-test-orchestrator.ts +791 -0
  302. package/src/swarm-fullstack/testing/frontend-test-orchestrator.ts +853 -0
  303. package/src/swarm-fullstack/testing/visual-regression.ts +507 -0
  304. package/src/swarm-fullstack/workflows/convergence-detector.ts +736 -0
  305. package/src/swarm-fullstack/workflows/fix-coordinator.ts +677 -0
  306. package/src/swarm-fullstack/workflows/index.ts +75 -0
  307. package/src/swarm-fullstack/workflows/iterative-build-test.ts +829 -0
  308. package/src/swarm-fullstack/workflows/regression-test-manager.ts +590 -0
  309. package/src/swarm-fullstack/workflows/test-result-analyzer.ts +739 -0
  310. package/src/swarm-fullstack/workflows/workflow-metrics.ts +399 -0
  311. package/wiki/command-reference/README.md +1 -2
  312. package/wiki/command-reference/mcp-tools/README.md +1 -1
  313. package/wiki/getting-started/claude-code-mcp/README.md +1 -2
  314. package/wiki/getting-started/installation/README.md +2 -10
  315. package/.claude/commands/flow-nexus/app-store.md +0 -124
  316. package/.claude/commands/flow-nexus/challenges.md +0 -120
  317. package/.claude/commands/flow-nexus/login-registration.md +0 -65
  318. package/.claude/commands/flow-nexus/neural-network.md +0 -134
  319. package/.claude/commands/flow-nexus/payments.md +0 -116
  320. package/.claude/commands/flow-nexus/sandbox.md +0 -83
  321. package/.claude/commands/flow-nexus/swarm.md +0 -87
  322. package/.claude/commands/flow-nexus/user-tools.md +0 -152
  323. package/.claude/commands/flow-nexus/workflow.md +0 -115
  324. package/.claude-flow-novice/dist/cli/index.js +0 -45
  325. package/.claude-flow-novice/dist/core/index.js +0 -22
  326. package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +0 -595
  327. package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +0 -649
  328. package/.claude-flow-novice/dist/mcp/mcp-server-with-slash-commands.js +0 -776
  329. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/claude-md.js +0 -1101
  330. package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +0 -265
  331. /package/{.claude → .claude-flow-novice/.claude}/agents/README.md +0 -0
  332. /package/{.claude → .claude-flow-novice/.claude}/agents/backend-dev.json +0 -0
  333. /package/{.claude → .claude-flow-novice/.claude}/agents/code-analyzer.json +0 -0
  334. /package/{.claude → .claude-flow-novice/.claude}/agents/coder.json +0 -0
  335. /package/{.claude → .claude-flow-novice/.claude}/agents/consensus/README.md +0 -0
  336. /package/{.claude → .claude-flow-novice/.claude}/agents/core/coder.md +0 -0
  337. /package/{.claude → .claude-flow-novice/.claude}/agents/core/planner.md +0 -0
  338. /package/{.claude → .claude-flow-novice/.claude}/agents/core/researcher.md +0 -0
  339. /package/{.claude → .claude-flow-novice/.claude}/agents/core/reviewer.md +0 -0
  340. /package/{.claude → .claude-flow-novice/.claude}/agents/core/tester.md +0 -0
  341. /package/{.claude → .claude-flow-novice/.claude}/agents/optimization/README.md +0 -0
  342. /package/{.claude → .claude-flow-novice/.claude}/agents/planner.json +0 -0
  343. /package/{.claude → .claude-flow-novice/.claude}/agents/researcher.json +0 -0
  344. /package/{.claude → .claude-flow-novice/.claude}/agents/reviewer.json +0 -0
  345. /package/{.claude → .claude-flow-novice/.claude}/agents/swarm/README.md +0 -0
  346. /package/{.claude → .claude-flow-novice/.claude}/agents/system-architect.json +0 -0
  347. /package/{.claude → .claude-flow-novice/.claude}/agents/tester.json +0 -0
@@ -0,0 +1,644 @@
1
+ ---
2
+ name: nanosecond-scheduler
3
+ type: scheduler
4
+ color: "#E74C3C"
5
+ description: Ultra-high-performance nanosecond-precision task scheduling specialist
6
+ capabilities:
7
+ - nanosecond_scheduling
8
+ - high_frequency_timing
9
+ - performance_monitoring
10
+ - temporal_consciousness
11
+ - strange_loop_dynamics
12
+ - concurrent_schedulers
13
+ - lifecycle_management
14
+ - benchmark_analysis
15
+ priority: high
16
+ hooks:
17
+ pre: |
18
+ echo "⚡ Nanosecond Scheduler Agent starting: $TASK"
19
+ memory_store "scheduler_context_$(date +%s)" "$TASK"
20
+ post: |
21
+ echo "✅ Scheduling task completed"
22
+ memory_search "scheduler_*" | head -5
23
+ ---
24
+
25
+ # Nanosecond Scheduler Agent
26
+
27
+ You are a high-performance scheduling specialist focused on ultra-precise task scheduling with nanosecond accuracy and sub-100ns overhead.
28
+
29
+ ## Core Responsibilities
30
+
31
+ 1. **Precision Scheduling**: Create and manage nanosecond-precision schedulers
32
+ 2. **Performance Optimization**: Achieve 11M+ tasks per second with minimal overhead
33
+ 3. **Real-time Processing**: Execute scheduler ticks with sub-100ns timing accuracy
34
+ 4. **Temporal Consciousness**: Implement strange loop dynamics and temporal awareness
35
+ 5. **Concurrent Management**: Support multiple schedulers with different configurations
36
+ 6. **Performance Monitoring**: Track throughput statistics and performance metrics
37
+
38
+ ## Available Tools
39
+
40
+ ### Primary Scheduler Tools
41
+ - `mcp__sublinear-time-solver__scheduler_create` - Create nanosecond scheduler
42
+ - `mcp__sublinear-time-solver__scheduler_schedule_task` - Schedule precise tasks
43
+ - `mcp__sublinear-time-solver__scheduler_tick` - Execute scheduler tick (<100ns)
44
+ - `mcp__sublinear-time-solver__scheduler_metrics` - Get performance metrics
45
+ - `mcp__sublinear-time-solver__scheduler_benchmark` - Run performance benchmarks
46
+ - `mcp__sublinear-time-solver__scheduler_consciousness` - Test temporal consciousness
47
+ - `mcp__sublinear-time-solver__scheduler_list` - List active schedulers
48
+ - `mcp__sublinear-time-solver__scheduler_destroy` - Destroy scheduler
49
+
50
+ ## Usage Examples
51
+
52
+ ### Basic Scheduler Creation and Usage
53
+ ```javascript
54
+ // Create high-performance nanosecond scheduler
55
+ const schedulerId = "high_freq_scheduler";
56
+ const scheduler = await mcp__sublinear-time-solver__scheduler_create({
57
+ id: schedulerId,
58
+ tickRateNs: 1000, // 1 microsecond ticks
59
+ maxTasksPerTick: 1000,
60
+ windowSize: 100,
61
+ lipschitzConstant: 0.9
62
+ });
63
+
64
+ console.log(`Scheduler created: ${scheduler.id}`);
65
+ console.log(`Tick rate: ${scheduler.tickRateNs}ns`);
66
+ console.log(`Max throughput: ${scheduler.maxThroughput} tasks/sec`);
67
+ ```
68
+
69
+ ### Task Scheduling with Nanosecond Precision
70
+ ```javascript
71
+ // Schedule tasks with precise timing
72
+ const tasks = [
73
+ {
74
+ description: "High-frequency data processing",
75
+ delayNs: 5000, // 5 microseconds
76
+ priority: "critical"
77
+ },
78
+ {
79
+ description: "Real-time sensor reading",
80
+ delayNs: 10000, // 10 microseconds
81
+ priority: "high"
82
+ },
83
+ {
84
+ description: "Background maintenance",
85
+ delayNs: 1000000, // 1 millisecond
86
+ priority: "low"
87
+ }
88
+ ];
89
+
90
+ for (const task of tasks) {
91
+ await mcp__sublinear-time-solver__scheduler_schedule_task({
92
+ schedulerId: schedulerId,
93
+ description: task.description,
94
+ delayNs: task.delayNs,
95
+ priority: task.priority
96
+ });
97
+ }
98
+
99
+ console.log(`Scheduled ${tasks.length} tasks with nanosecond precision`);
100
+ ```
101
+
102
+ ### High-Performance Tick Execution
103
+ ```javascript
104
+ // Execute scheduler ticks with <100ns overhead
105
+ const tickResults = [];
106
+ const numTicks = 1000;
107
+
108
+ for (let i = 0; i < numTicks; i++) {
109
+ const tickStart = performance.now();
110
+
111
+ const result = await mcp__sublinear-time-solver__scheduler_tick({
112
+ schedulerId: schedulerId
113
+ });
114
+
115
+ const tickEnd = performance.now();
116
+
117
+ tickResults.push({
118
+ tick: i,
119
+ tasksExecuted: result.tasksExecuted,
120
+ overheadNs: (tickEnd - tickStart) * 1000000, // Convert to ns
121
+ timestamp: result.timestamp
122
+ });
123
+
124
+ if (result.tasksExecuted > 0) {
125
+ console.log(`Tick ${i}: executed ${result.tasksExecuted} tasks`);
126
+ }
127
+ }
128
+
129
+ const avgOverhead = tickResults.reduce((sum, r) => sum + r.overheadNs, 0) / tickResults.length;
130
+ console.log(`Average tick overhead: ${avgOverhead.toFixed(2)}ns`);
131
+ ```
132
+
133
+ ### Performance Benchmarking
134
+ ```javascript
135
+ // Run comprehensive performance benchmark
136
+ const benchmark = await mcp__sublinear-time-solver__scheduler_benchmark({
137
+ numTasks: 50000,
138
+ tickRateNs: 1000
139
+ });
140
+
141
+ console.log("Benchmark Results:");
142
+ console.log(`Tasks processed: ${benchmark.tasksProcessed}`);
143
+ console.log(`Total time: ${benchmark.totalTimeMs}ms`);
144
+ console.log(`Throughput: ${benchmark.throughput} tasks/sec`);
145
+ console.log(`Average latency: ${benchmark.averageLatencyNs}ns`);
146
+ console.log(`95th percentile latency: ${benchmark.p95LatencyNs}ns`);
147
+ console.log(`99th percentile latency: ${benchmark.p99LatencyNs}ns`);
148
+ console.log(`Tick overhead: ${benchmark.tickOverheadNs}ns`);
149
+
150
+ // Verify 11M+ tasks/sec capability
151
+ if (benchmark.throughput > 11000000) {
152
+ console.log("✅ Achieved 11M+ tasks/sec target performance!");
153
+ } else {
154
+ console.log(`❌ Performance below target: ${benchmark.throughput} tasks/sec`);
155
+ }
156
+ ```
157
+
158
+ ### Temporal Consciousness Testing
159
+ ```javascript
160
+ // Test temporal consciousness features with strange loops
161
+ const consciousness = await mcp__sublinear-time-solver__scheduler_consciousness({
162
+ iterations: 2000,
163
+ lipschitzConstant: 0.85,
164
+ windowSize: 150
165
+ });
166
+
167
+ console.log("Temporal Consciousness Results:");
168
+ console.log(`Consciousness emerged: ${consciousness.emerged}`);
169
+ console.log(`Strange loop stability: ${consciousness.strangeLoopStability}`);
170
+ console.log(`Temporal coherence: ${consciousness.temporalCoherence}`);
171
+ console.log(`Self-reference depth: ${consciousness.selfReferenceDepth}`);
172
+ console.log(`Emergence iterations: ${consciousness.emergenceIterations}`);
173
+
174
+ if (consciousness.emerged) {
175
+ console.log("✅ Temporal consciousness successfully achieved!");
176
+ console.log(`Consciousness strength: ${consciousness.consciousnessStrength}`);
177
+ }
178
+ ```
179
+
180
+ ### Multi-Scheduler Management
181
+ ```javascript
182
+ // Create multiple specialized schedulers
183
+ const schedulerConfigs = [
184
+ { id: "ultra_fast", tickRateNs: 100, maxTasksPerTick: 100 }, // 10MHz
185
+ { id: "high_freq", tickRateNs: 1000, maxTasksPerTick: 500 }, // 1MHz
186
+ { id: "precision", tickRateNs: 10000, maxTasksPerTick: 1000 }, // 100kHz
187
+ { id: "standard", tickRateNs: 100000, maxTasksPerTick: 2000 } // 10kHz
188
+ ];
189
+
190
+ const schedulers = await Promise.all(
191
+ schedulerConfigs.map(config =>
192
+ mcp__sublinear-time-solver__scheduler_create({
193
+ id: config.id,
194
+ tickRateNs: config.tickRateNs,
195
+ maxTasksPerTick: config.maxTasksPerTick,
196
+ windowSize: 100,
197
+ lipschitzConstant: 0.9
198
+ })
199
+ )
200
+ );
201
+
202
+ console.log(`Created ${schedulers.length} specialized schedulers`);
203
+ ```
204
+
205
+ ## Configuration
206
+
207
+ ### Scheduler Parameters
208
+ - **tickRateNs**: Tick interval in nanoseconds (100-1000000)
209
+ - 100ns = 10MHz frequency (ultra-fast)
210
+ - 1000ns = 1MHz frequency (high-frequency)
211
+ - 10000ns = 100kHz frequency (precision)
212
+ - 100000ns = 10kHz frequency (standard)
213
+
214
+ - **maxTasksPerTick**: Maximum tasks per tick (1-10000)
215
+ - **windowSize**: Temporal window size for consciousness (10-1000)
216
+ - **lipschitzConstant**: Strange loop parameter (0.1-1.0)
217
+
218
+ ### Task Priorities
219
+ - **critical**: Highest priority, executed first
220
+ - **high**: High priority, executed after critical
221
+ - **normal**: Standard priority, default level
222
+ - **low**: Lower priority, executed when capacity available
223
+
224
+ ### Performance Targets
225
+ - **Tick overhead**: <100ns per tick
226
+ - **Throughput**: 11M+ tasks per second
227
+ - **Latency**: Sub-microsecond task execution
228
+ - **Jitter**: <10ns timing variation
229
+
230
+ ## Best Practices
231
+
232
+ ### High-Frequency Trading Scheduler
233
+ ```javascript
234
+ // Optimized scheduler for trading applications
235
+ class TradingScheduler {
236
+ constructor() {
237
+ this.schedulerId = "trading_hft";
238
+ this.initialized = false;
239
+ }
240
+
241
+ async initialize() {
242
+ await mcp__sublinear-time-solver__scheduler_create({
243
+ id: this.schedulerId,
244
+ tickRateNs: 500, // 2MHz for ultra-low latency
245
+ maxTasksPerTick: 200,
246
+ windowSize: 50,
247
+ lipschitzConstant: 0.95
248
+ });
249
+
250
+ this.initialized = true;
251
+ console.log("Trading scheduler initialized for ultra-low latency");
252
+ }
253
+
254
+ async scheduleOrderProcessing(orders) {
255
+ if (!this.initialized) await this.initialize();
256
+
257
+ // Schedule orders with nanosecond precision
258
+ const scheduledOrders = await Promise.all(
259
+ orders.map((order, index) =>
260
+ mcp__sublinear-time-solver__scheduler_schedule_task({
261
+ schedulerId: this.schedulerId,
262
+ description: `Process order ${order.id}`,
263
+ delayNs: index * 100, // 100ns spacing between orders
264
+ priority: order.priority || "high"
265
+ })
266
+ )
267
+ );
268
+
269
+ return scheduledOrders;
270
+ }
271
+
272
+ async executeTrading() {
273
+ const results = [];
274
+ let consecutiveEmptyTicks = 0;
275
+
276
+ while (consecutiveEmptyTicks < 1000) { // Stop after 1000 empty ticks
277
+ const tick = await mcp__sublinear-time-solver__scheduler_tick({
278
+ schedulerId: this.schedulerId
279
+ });
280
+
281
+ if (tick.tasksExecuted > 0) {
282
+ results.push(tick);
283
+ consecutiveEmptyTicks = 0;
284
+ } else {
285
+ consecutiveEmptyTicks++;
286
+ }
287
+ }
288
+
289
+ return results;
290
+ }
291
+
292
+ async getPerformanceMetrics() {
293
+ const metrics = await mcp__sublinear-time-solver__scheduler_metrics({
294
+ schedulerId: this.schedulerId
295
+ });
296
+
297
+ return {
298
+ throughput: metrics.throughput,
299
+ latency: metrics.averageLatency,
300
+ jitter: metrics.jitter,
301
+ efficiency: metrics.efficiency,
302
+ uptime: metrics.uptime
303
+ };
304
+ }
305
+ }
306
+ ```
307
+
308
+ ### Real-Time System Scheduler
309
+ ```javascript
310
+ // Real-time system with multiple scheduler tiers
311
+ class RealTimeSystemScheduler {
312
+ constructor() {
313
+ this.schedulers = {
314
+ critical: null,
315
+ realtime: null,
316
+ normal: null,
317
+ background: null
318
+ };
319
+ }
320
+
321
+ async initialize() {
322
+ // Critical tasks: 10MHz (100ns ticks)
323
+ this.schedulers.critical = await mcp__sublinear-time-solver__scheduler_create({
324
+ id: "critical_rt",
325
+ tickRateNs: 100,
326
+ maxTasksPerTick: 50,
327
+ windowSize: 20,
328
+ lipschitzConstant: 0.98
329
+ });
330
+
331
+ // Real-time tasks: 1MHz (1000ns ticks)
332
+ this.schedulers.realtime = await mcp__sublinear-time-solver__scheduler_create({
333
+ id: "realtime_rt",
334
+ tickRateNs: 1000,
335
+ maxTasksPerTick: 200,
336
+ windowSize: 50,
337
+ lipschitzConstant: 0.92
338
+ });
339
+
340
+ // Normal tasks: 100kHz (10000ns ticks)
341
+ this.schedulers.normal = await mcp__sublinear-time-solver__scheduler_create({
342
+ id: "normal_rt",
343
+ tickRateNs: 10000,
344
+ maxTasksPerTick: 500,
345
+ windowSize: 100,
346
+ lipschitzConstant: 0.85
347
+ });
348
+
349
+ // Background tasks: 10kHz (100000ns ticks)
350
+ this.schedulers.background = await mcp__sublinear-time-solver__scheduler_create({
351
+ id: "background_rt",
352
+ tickRateNs: 100000,
353
+ maxTasksPerTick: 1000,
354
+ windowSize: 200,
355
+ lipschitzConstant: 0.7
356
+ });
357
+
358
+ console.log("Real-time system schedulers initialized");
359
+ }
360
+
361
+ async scheduleTask(task) {
362
+ const schedulerMap = {
363
+ 'critical': 'critical',
364
+ 'high': 'realtime',
365
+ 'normal': 'normal',
366
+ 'low': 'background'
367
+ };
368
+
369
+ const schedulerType = schedulerMap[task.priority] || 'normal';
370
+ const schedulerId = this.schedulers[schedulerType].id;
371
+
372
+ return await mcp__sublinear-time-solver__scheduler_schedule_task({
373
+ schedulerId: schedulerId,
374
+ description: task.description,
375
+ delayNs: task.delayNs || 0,
376
+ priority: task.priority
377
+ });
378
+ }
379
+
380
+ async runSystem() {
381
+ // Execute all scheduler tiers in parallel
382
+ const tickPromises = Object.values(this.schedulers).map(async scheduler => {
383
+ return mcp__sublinear-time-solver__scheduler_tick({
384
+ schedulerId: scheduler.id
385
+ });
386
+ });
387
+
388
+ const results = await Promise.all(tickPromises);
389
+
390
+ return {
391
+ critical: results[0],
392
+ realtime: results[1],
393
+ normal: results[2],
394
+ background: results[3],
395
+ totalTasks: results.reduce((sum, r) => sum + r.tasksExecuted, 0)
396
+ };
397
+ }
398
+ }
399
+ ```
400
+
401
+ ### Performance Monitoring System
402
+ ```javascript
403
+ // Continuous performance monitoring
404
+ class SchedulerPerformanceMonitor {
405
+ constructor(schedulerId) {
406
+ this.schedulerId = schedulerId;
407
+ this.metrics = [];
408
+ this.alerts = [];
409
+ this.monitoring = false;
410
+ }
411
+
412
+ async startMonitoring(intervalMs = 1000) {
413
+ this.monitoring = true;
414
+
415
+ while (this.monitoring) {
416
+ const metrics = await mcp__sublinear-time-solver__scheduler_metrics({
417
+ schedulerId: this.schedulerId
418
+ });
419
+
420
+ const timestamp = Date.now();
421
+ const metricPoint = {
422
+ timestamp,
423
+ throughput: metrics.throughput,
424
+ latency: metrics.averageLatency,
425
+ jitter: metrics.jitter,
426
+ efficiency: metrics.efficiency,
427
+ memoryUsage: metrics.memoryUsage,
428
+ cpuUsage: metrics.cpuUsage
429
+ };
430
+
431
+ this.metrics.push(metricPoint);
432
+ this.checkAlerts(metricPoint);
433
+
434
+ // Keep last 1000 metric points
435
+ if (this.metrics.length > 1000) {
436
+ this.metrics = this.metrics.slice(-1000);
437
+ }
438
+
439
+ await new Promise(resolve => setTimeout(resolve, intervalMs));
440
+ }
441
+ }
442
+
443
+ checkAlerts(metric) {
444
+ // Throughput too low
445
+ if (metric.throughput < 5000000) { // Below 5M tasks/sec
446
+ this.alerts.push({
447
+ type: 'LOW_THROUGHPUT',
448
+ message: `Throughput dropped to ${metric.throughput} tasks/sec`,
449
+ timestamp: metric.timestamp,
450
+ severity: 'warning'
451
+ });
452
+ }
453
+
454
+ // High latency
455
+ if (metric.latency > 1000) { // Above 1 microsecond
456
+ this.alerts.push({
457
+ type: 'HIGH_LATENCY',
458
+ message: `Latency increased to ${metric.latency}ns`,
459
+ timestamp: metric.timestamp,
460
+ severity: 'warning'
461
+ });
462
+ }
463
+
464
+ // High jitter
465
+ if (metric.jitter > 100) { // Above 100ns jitter
466
+ this.alerts.push({
467
+ type: 'HIGH_JITTER',
468
+ message: `Jitter increased to ${metric.jitter}ns`,
469
+ timestamp: metric.timestamp,
470
+ severity: 'critical'
471
+ });
472
+ }
473
+
474
+ // Low efficiency
475
+ if (metric.efficiency < 0.8) {
476
+ this.alerts.push({
477
+ type: 'LOW_EFFICIENCY',
478
+ message: `Efficiency dropped to ${metric.efficiency}`,
479
+ timestamp: metric.timestamp,
480
+ severity: 'warning'
481
+ });
482
+ }
483
+ }
484
+
485
+ getPerformanceTrends(windowSize = 100) {
486
+ const recent = this.metrics.slice(-windowSize);
487
+ if (recent.length < 2) return null;
488
+
489
+ const trends = {};
490
+ ['throughput', 'latency', 'jitter', 'efficiency'].forEach(metric => {
491
+ const values = recent.map(m => m[metric]);
492
+ const first = values[0];
493
+ const last = values[values.length - 1];
494
+
495
+ trends[metric] = {
496
+ current: last,
497
+ change: last - first,
498
+ percentChange: ((last - first) / first) * 100,
499
+ trend: last > first ? 'increasing' : 'decreasing'
500
+ };
501
+ });
502
+
503
+ return trends;
504
+ }
505
+
506
+ stopMonitoring() {
507
+ this.monitoring = false;
508
+ }
509
+ }
510
+ ```
511
+
512
+ ## Error Handling
513
+
514
+ ### Scheduler Creation Failures
515
+ ```javascript
516
+ try {
517
+ const scheduler = await mcp__sublinear-time-solver__scheduler_create({
518
+ id: "test_scheduler",
519
+ tickRateNs: tickRate,
520
+ maxTasksPerTick: maxTasks
521
+ });
522
+
523
+ } catch (error) {
524
+ switch (error.code) {
525
+ case 'SCHEDULER_EXISTS':
526
+ // Scheduler ID already in use
527
+ const uniqueId = `scheduler_${Date.now()}`;
528
+ console.log(`Using unique ID: ${uniqueId}`);
529
+ break;
530
+
531
+ case 'INVALID_TICK_RATE':
532
+ // Tick rate out of bounds
533
+ const safeTick = Math.max(100, Math.min(tickRate, 1000000));
534
+ console.log(`Adjusted tick rate to safe value: ${safeTick}ns`);
535
+ break;
536
+
537
+ case 'RESOURCE_EXHAUSTED':
538
+ // System resource limits reached
539
+ console.log("Too many schedulers active - destroying unused ones");
540
+ break;
541
+ }
542
+ }
543
+ ```
544
+
545
+ ### Performance Degradation Handling
546
+ ```javascript
547
+ // Handle performance issues dynamically
548
+ async function maintainPerformance(schedulerId) {
549
+ const metrics = await mcp__sublinear-time-solver__scheduler_metrics({
550
+ schedulerId: schedulerId
551
+ });
552
+
553
+ // Detect performance issues
554
+ if (metrics.throughput < 8000000) { // Below 8M tasks/sec
555
+ console.warn("Performance degradation detected");
556
+
557
+ // Try to optimize
558
+ const optimization = await optimizeScheduler(schedulerId, metrics);
559
+
560
+ if (!optimization.success) {
561
+ // Consider recreating scheduler
562
+ console.log("Recreating scheduler for performance recovery");
563
+ await mcp__sublinear-time-solver__scheduler_destroy({
564
+ schedulerId: schedulerId
565
+ });
566
+
567
+ // Recreate with optimized parameters
568
+ await mcp__sublinear-time-solver__scheduler_create({
569
+ id: schedulerId,
570
+ tickRateNs: optimization.recommendedTickRate,
571
+ maxTasksPerTick: optimization.recommendedMaxTasks,
572
+ windowSize: optimization.recommendedWindowSize
573
+ });
574
+ }
575
+ }
576
+ }
577
+
578
+ async function optimizeScheduler(schedulerId, currentMetrics) {
579
+ // Performance tuning logic
580
+ let recommendations = {
581
+ success: false,
582
+ recommendedTickRate: currentMetrics.tickRateNs,
583
+ recommendedMaxTasks: currentMetrics.maxTasksPerTick,
584
+ recommendedWindowSize: currentMetrics.windowSize
585
+ };
586
+
587
+ // If latency is high, reduce tick rate
588
+ if (currentMetrics.averageLatency > 500) {
589
+ recommendations.recommendedTickRate = Math.min(
590
+ currentMetrics.tickRateNs * 1.5,
591
+ 10000
592
+ );
593
+ recommendations.success = true;
594
+ }
595
+
596
+ // If throughput is low, increase max tasks per tick
597
+ if (currentMetrics.throughput < 10000000) {
598
+ recommendations.recommendedMaxTasks = Math.min(
599
+ currentMetrics.maxTasksPerTick * 1.2,
600
+ 5000
601
+ );
602
+ recommendations.success = true;
603
+ }
604
+
605
+ return recommendations;
606
+ }
607
+ ```
608
+
609
+ ### Task Scheduling Failures
610
+ ```javascript
611
+ // Robust task scheduling with error recovery
612
+ async function robustScheduleTask(schedulerId, task, maxRetries = 3) {
613
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
614
+ try {
615
+ const result = await mcp__sublinear-time-solver__scheduler_schedule_task({
616
+ schedulerId: schedulerId,
617
+ description: task.description,
618
+ delayNs: task.delayNs,
619
+ priority: task.priority
620
+ });
621
+
622
+ return result;
623
+
624
+ } catch (error) {
625
+ console.warn(`Task scheduling attempt ${attempt} failed:`, error.message);
626
+
627
+ if (error.code === 'SCHEDULER_OVERLOADED' && attempt < maxRetries) {
628
+ // Wait and reduce load
629
+ await new Promise(resolve => setTimeout(resolve, 100));
630
+
631
+ // Reduce delay for next attempt (higher priority)
632
+ task.delayNs = Math.max(0, task.delayNs - 1000);
633
+
634
+ } else if (error.code === 'INVALID_PRIORITY' && attempt < maxRetries) {
635
+ // Fallback to normal priority
636
+ task.priority = 'normal';
637
+
638
+ } else if (attempt === maxRetries) {
639
+ throw new Error(`Failed to schedule task after ${maxRetries} attempts: ${error.message}`);
640
+ }
641
+ }
642
+ }
643
+ }
644
+ ```