claude-flow-novice 1.6.4 → 1.6.6

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 (286) hide show
  1. package/.claude/commands/parse-epic.js +180 -0
  2. package/.claude/settings.local.json +2 -1
  3. package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +37 -2
  4. package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +45 -0
  5. package/.claude-flow-novice/dist/mcp/transports/base.js +5 -0
  6. package/.claude-flow-novice/dist/mcp/transports/base.js.map +1 -0
  7. package/.claude-flow-novice/dist/mcp/transports/http.js +414 -0
  8. package/.claude-flow-novice/dist/mcp/transports/http.js.map +1 -0
  9. package/.claude-flow-novice/dist/mcp/transports/stdio.js +217 -0
  10. package/.claude-flow-novice/dist/mcp/transports/stdio.js.map +1 -0
  11. package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js +129 -0
  12. package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js.map +1 -0
  13. package/.claude-flow-novice/dist/src/cli/index.js +3 -0
  14. package/.claude-flow-novice/dist/src/cli/index.js.map +1 -1
  15. package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js +266 -0
  16. package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js.map +1 -0
  17. package/.claude-flow-novice/dist/src/communication/message-bus.js +105 -2
  18. package/.claude-flow-novice/dist/src/communication/message-bus.js.map +1 -1
  19. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +1 -1
  20. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -1
  21. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js +632 -0
  22. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js.map +1 -0
  23. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js +11 -0
  24. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js.map +1 -0
  25. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js +318 -0
  26. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js.map +1 -0
  27. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js +234 -0
  28. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js.map +1 -0
  29. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js +347 -0
  30. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js.map +1 -0
  31. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js +13 -0
  32. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js.map +1 -0
  33. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js +173 -0
  34. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js.map +1 -0
  35. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js +526 -0
  36. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js.map +1 -0
  37. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js +443 -0
  38. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js.map +1 -0
  39. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js +366 -0
  40. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js.map +1 -0
  41. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js +287 -0
  42. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js.map +1 -0
  43. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js +364 -0
  44. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js.map +1 -0
  45. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js +492 -0
  46. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js.map +1 -0
  47. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js +786 -0
  48. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js.map +1 -0
  49. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js +16 -0
  50. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js.map +1 -0
  51. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js +342 -0
  52. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js.map +1 -0
  53. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js +601 -0
  54. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
  55. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js +9 -0
  56. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js.map +1 -0
  57. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js +413 -0
  58. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js.map +1 -0
  59. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js +471 -0
  60. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js.map +1 -0
  61. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js +379 -0
  62. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js.map +1 -0
  63. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js +335 -0
  64. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js.map +1 -0
  65. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js +211 -0
  66. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js.map +1 -0
  67. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js +33 -0
  68. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js.map +1 -0
  69. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js +920 -0
  70. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js.map +1 -0
  71. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js +385 -0
  72. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js.map +1 -0
  73. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js +138 -0
  74. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js.map +1 -0
  75. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js +478 -0
  76. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js.map +1 -0
  77. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js +358 -0
  78. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js.map +1 -0
  79. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js +588 -0
  80. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js.map +1 -0
  81. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js +153 -0
  82. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js.map +1 -0
  83. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js +360 -0
  84. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js.map +1 -0
  85. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js +337 -0
  86. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js.map +1 -0
  87. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js +424 -0
  88. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js.map +1 -0
  89. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js +9 -0
  90. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js.map +1 -0
  91. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js +669 -0
  92. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js.map +1 -0
  93. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js +451 -0
  94. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js.map +1 -0
  95. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js +271 -0
  96. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js.map +1 -0
  97. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js +335 -0
  98. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js.map +1 -0
  99. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js +439 -0
  100. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js.map +1 -0
  101. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js +92 -0
  102. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js.map +1 -0
  103. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js +21 -0
  104. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js.map +1 -0
  105. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js +223 -0
  106. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js.map +1 -0
  107. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js +436 -0
  108. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js.map +1 -0
  109. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js +278 -0
  110. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js.map +1 -0
  111. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js +317 -0
  112. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js.map +1 -0
  113. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js +273 -0
  114. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js.map +1 -0
  115. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js +15 -0
  116. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js.map +1 -0
  117. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js +512 -0
  118. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js.map +1 -0
  119. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js +67 -0
  120. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js.map +1 -0
  121. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js +557 -0
  122. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js.map +1 -0
  123. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js +14 -0
  124. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js.map +1 -0
  125. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js +212 -0
  126. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js.map +1 -0
  127. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js +552 -0
  128. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js.map +1 -0
  129. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js +635 -0
  130. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js.map +1 -0
  131. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js +28 -0
  132. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js.map +1 -0
  133. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js +9 -0
  134. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js.map +1 -0
  135. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js +25 -0
  136. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js.map +1 -0
  137. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js +14 -0
  138. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js.map +1 -0
  139. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js +308 -0
  140. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js.map +1 -0
  141. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js +439 -0
  142. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js.map +1 -0
  143. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js +540 -0
  144. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js.map +1 -0
  145. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js +367 -0
  146. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js.map +1 -0
  147. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js +14 -0
  148. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js.map +1 -0
  149. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js +518 -0
  150. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js.map +1 -0
  151. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js +377 -0
  152. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js.map +1 -0
  153. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js +371 -0
  154. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js.map +1 -0
  155. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js +355 -0
  156. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js.map +1 -0
  157. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js +424 -0
  158. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js.map +1 -0
  159. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js +16 -0
  160. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js.map +1 -0
  161. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js +295 -0
  162. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js.map +1 -0
  163. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js +411 -0
  164. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js.map +1 -0
  165. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js +14 -0
  166. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js.map +1 -0
  167. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js +387 -0
  168. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js.map +1 -0
  169. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js +589 -0
  170. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js.map +1 -0
  171. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js +444 -0
  172. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js.map +1 -0
  173. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js +560 -0
  174. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js.map +1 -0
  175. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js +335 -0
  176. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js.map +1 -0
  177. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js +104 -0
  178. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js.map +1 -0
  179. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js +847 -0
  180. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js.map +1 -0
  181. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js +470 -0
  182. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js.map +1 -0
  183. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js +450 -0
  184. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js.map +1 -0
  185. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js +13 -0
  186. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js.map +1 -0
  187. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js +625 -0
  188. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js.map +1 -0
  189. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js +545 -0
  190. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js.map +1 -0
  191. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js +740 -0
  192. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js.map +1 -0
  193. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js +415 -0
  194. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js.map +1 -0
  195. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js +615 -0
  196. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js.map +1 -0
  197. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js +547 -0
  198. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js.map +1 -0
  199. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js +342 -0
  200. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js.map +1 -0
  201. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js +259 -0
  202. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js.map +1 -0
  203. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js +273 -0
  204. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js.map +1 -0
  205. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js +8 -0
  206. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js.map +1 -0
  207. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js +310 -0
  208. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js.map +1 -0
  209. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js +218 -0
  210. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js.map +1 -0
  211. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js +9 -0
  212. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js.map +1 -0
  213. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js +6 -0
  214. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js.map +1 -0
  215. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js +145 -0
  216. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js.map +1 -0
  217. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js +122 -0
  218. package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js.map +1 -0
  219. package/.claude-flow-novice/dist/src/coordination/config-translator.js +17 -43
  220. package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -1
  221. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +34 -76
  222. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -1
  223. package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js +172 -0
  224. package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js.map +1 -0
  225. package/.claude-flow-novice/dist/src/coordination/shared/core/index.js +7 -0
  226. package/.claude-flow-novice/dist/src/coordination/shared/core/index.js.map +1 -0
  227. package/.claude-flow-novice/dist/src/coordination/shared/index.js +19 -0
  228. package/.claude-flow-novice/dist/src/coordination/shared/index.js.map +1 -0
  229. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js +24 -0
  230. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js.map +1 -0
  231. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js +7 -0
  232. package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js.map +1 -0
  233. package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js +920 -0
  234. package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js.map +1 -0
  235. package/.claude-flow-novice/dist/src/coordination/shared/message.js +138 -0
  236. package/.claude-flow-novice/dist/src/coordination/shared/message.js.map +1 -0
  237. package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js +259 -0
  238. package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js.map +1 -0
  239. package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js +17 -0
  240. package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js.map +1 -0
  241. package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js +19 -0
  242. package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js.map +1 -0
  243. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js +357 -0
  244. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js.map +1 -0
  245. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js +679 -0
  246. package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js.map +1 -0
  247. package/.claude-flow-novice/dist/src/coordination/shared/types/index.js +7 -0
  248. package/.claude-flow-novice/dist/src/coordination/shared/types/index.js.map +1 -0
  249. package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js +10 -0
  250. package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js.map +1 -0
  251. package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js +52 -2
  252. package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -1
  253. package/.claude-flow-novice/dist/src/mcp/mcp-server-novice.js +37 -2
  254. package/.claude-flow-novice/dist/src/mcp/session-manager.js +3 -1
  255. package/.claude-flow-novice/dist/src/mcp/session-manager.js.map +1 -1
  256. package/.claude-flow-novice/dist/src/providers/provider-manager.js +36 -3
  257. package/.claude-flow-novice/dist/src/providers/provider-manager.js.map +1 -1
  258. package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js +65 -41
  259. package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js.map +1 -1
  260. package/.claude-flow-novice/dist/src/web/api/server.js +1 -1
  261. package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -1
  262. package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js +30 -0
  263. package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js.map +1 -1
  264. package/.claude-flow-novice/metrics.db-shm +0 -0
  265. package/.claude-flow-novice/metrics.db-wal +0 -0
  266. package/config/.env.example +178 -0
  267. package/config/DEPLOYMENT_GUIDE.md +692 -0
  268. package/config/README-CONFIG.md +331 -0
  269. package/config/coordination-config.sh +327 -0
  270. package/config/docker/env.development +53 -0
  271. package/config/docker/env.production +83 -0
  272. package/config/docker/env.staging +70 -0
  273. package/config/k8s/configmap-development.yaml +60 -0
  274. package/config/k8s/configmap-production.yaml +85 -0
  275. package/config/k8s/configmap-staging.yaml +76 -0
  276. package/config/k8s/secret-production.yaml +62 -0
  277. package/config/k8s/secret-staging.yaml +36 -0
  278. package/package.json +2 -2
  279. package/scripts/monitoring/alert-monitor.sh +220 -0
  280. package/scripts/monitoring/dashboards/rate-limiting-dashboard.json +211 -0
  281. package/scripts/monitoring/quick-test-alerting.sh +118 -0
  282. package/scripts/monitoring/quick-test-rate-limiting.sh +206 -0
  283. package/scripts/monitoring/rate-limiting-monitor.sh +380 -0
  284. package/scripts/monitoring/view-alerts.sh +307 -0
  285. package/scripts/test-zai-api.cjs +2 -2
  286. package/src/slash-commands/parse-epic.js +1 -1
@@ -0,0 +1,220 @@
1
+ #!/usr/bin/env bash
2
+ # scripts/monitoring/alert-monitor.sh - Continuous monitoring daemon with alerting
3
+ # Phase 1 Sprint 1.1: Monitoring loop integration
4
+
5
+ set -euo pipefail
6
+
7
+ # ==============================================================================
8
+ # CONFIGURATION
9
+ # ==============================================================================
10
+
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ LIB_DIR="${SCRIPT_DIR}/../../lib"
13
+ METRICS_FILE="${METRICS_FILE:-/dev/shm/cfn-metrics.jsonl}"
14
+ ALERT_LOG_FILE="${ALERT_LOG_FILE:-/dev/shm/cfn-alerts.jsonl}"
15
+ MONITOR_PID_FILE="${MONITOR_PID_FILE:-/dev/shm/alert-monitor.pid}"
16
+
17
+ # Check interval (seconds)
18
+ CHECK_INTERVAL="${CHECK_INTERVAL:-30}"
19
+
20
+ # Cleanup retention (hours)
21
+ ALERT_RETENTION_HOURS="${ALERT_RETENTION_HOURS:-24}"
22
+ METRICS_RETENTION_HOURS="${METRICS_RETENTION_HOURS:-48}"
23
+
24
+ # ==============================================================================
25
+ # DEPENDENCIES
26
+ # ==============================================================================
27
+
28
+ # Source alerting library
29
+ if [ -f "$LIB_DIR/alerting.sh" ]; then
30
+ # shellcheck source=../../lib/alerting.sh
31
+ source "$LIB_DIR/alerting.sh"
32
+ else
33
+ echo "[ERROR] Alerting library not found at $LIB_DIR/alerting.sh" >&2
34
+ exit 1
35
+ fi
36
+
37
+ # ==============================================================================
38
+ # SIGNAL HANDLERS
39
+ # ==============================================================================
40
+
41
+ cleanup() {
42
+ echo "[INFO] Shutting down alert monitor (PID: $$)" >&2
43
+ rm -f "$MONITOR_PID_FILE"
44
+ exit 0
45
+ }
46
+
47
+ trap cleanup SIGTERM SIGINT
48
+
49
+ # ==============================================================================
50
+ # MONITORING FUNCTIONS
51
+ # ==============================================================================
52
+
53
+ # start_monitor - Begin continuous threshold monitoring
54
+ start_monitor() {
55
+ local iteration=0
56
+
57
+ echo "[INFO] Alert monitor started (PID: $$)" >&2
58
+ echo "[INFO] Check interval: ${CHECK_INTERVAL}s" >&2
59
+ echo "[INFO] Metrics file: $METRICS_FILE" >&2
60
+ echo "[INFO] Alert log: $ALERT_LOG_FILE" >&2
61
+
62
+ # Write PID file
63
+ echo $$ > "$MONITOR_PID_FILE"
64
+
65
+ while true; do
66
+ iteration=$((iteration + 1))
67
+
68
+ # Check thresholds
69
+ if [ -f "$METRICS_FILE" ]; then
70
+ check_thresholds "$METRICS_FILE" 2>&1 | while IFS= read -r line; do
71
+ echo "[$(date -u +"%Y-%m-%dT%H:%M:%SZ")] $line"
72
+ done
73
+ fi
74
+
75
+ # Periodic cleanup (every 100 iterations)
76
+ if [ $((iteration % 100)) -eq 0 ]; then
77
+ echo "[INFO] Running periodic cleanup (iteration $iteration)" >&2
78
+ cleanup_old_data
79
+ fi
80
+
81
+ # Sleep until next check
82
+ sleep "$CHECK_INTERVAL"
83
+ done
84
+ }
85
+
86
+ # cleanup_old_data - Remove old metrics and alerts
87
+ cleanup_old_data() {
88
+ # Clear old alerts
89
+ if [ -f "$ALERT_LOG_FILE" ]; then
90
+ local alert_count_before
91
+ alert_count_before=$(wc -l < "$ALERT_LOG_FILE" 2>/dev/null || echo "0")
92
+
93
+ clear_old_alerts "$ALERT_RETENTION_HOURS"
94
+
95
+ local alert_count_after
96
+ alert_count_after=$(wc -l < "$ALERT_LOG_FILE" 2>/dev/null || echo "0")
97
+
98
+ echo "[INFO] Cleared $((alert_count_before - alert_count_after)) old alerts" >&2
99
+ fi
100
+
101
+ # Clear old metrics
102
+ if [ -f "$METRICS_FILE" ]; then
103
+ local metrics_count_before
104
+ metrics_count_before=$(wc -l < "$METRICS_FILE" 2>/dev/null || echo "0")
105
+
106
+ local cutoff_time
107
+ cutoff_time=$(date -u -d "$METRICS_RETENTION_HOURS hours ago" +"%Y-%m-%dT%H:%M:%S" 2>/dev/null || \
108
+ date -u -v-"${METRICS_RETENTION_HOURS}H" +"%Y-%m-%dT%H:%M:%S" 2>/dev/null || \
109
+ echo "1970-01-01T00:00:00")
110
+
111
+ local temp_file="${METRICS_FILE}.tmp"
112
+ jq -c --arg cutoff "$cutoff_time" \
113
+ 'select(.timestamp >= $cutoff)' \
114
+ "$METRICS_FILE" > "$temp_file" 2>/dev/null || true
115
+
116
+ if [ -f "$temp_file" ]; then
117
+ mv "$temp_file" "$METRICS_FILE"
118
+
119
+ local metrics_count_after
120
+ metrics_count_after=$(wc -l < "$METRICS_FILE" 2>/dev/null || echo "0")
121
+
122
+ echo "[INFO] Cleared $((metrics_count_before - metrics_count_after)) old metrics" >&2
123
+ fi
124
+ fi
125
+ }
126
+
127
+ # get_monitor_status - Check if monitor is running
128
+ get_monitor_status() {
129
+ if [ -f "$MONITOR_PID_FILE" ]; then
130
+ local pid
131
+ pid=$(cat "$MONITOR_PID_FILE")
132
+
133
+ if kill -0 "$pid" 2>/dev/null; then
134
+ echo "running (PID: $pid)"
135
+ return 0
136
+ else
137
+ echo "stale (PID file exists but process not running)"
138
+ rm -f "$MONITOR_PID_FILE"
139
+ return 1
140
+ fi
141
+ else
142
+ echo "stopped"
143
+ return 1
144
+ fi
145
+ }
146
+
147
+ # stop_monitor - Stop running monitor
148
+ stop_monitor() {
149
+ if [ -f "$MONITOR_PID_FILE" ]; then
150
+ local pid
151
+ pid=$(cat "$MONITOR_PID_FILE")
152
+
153
+ if kill -0 "$pid" 2>/dev/null; then
154
+ echo "[INFO] Stopping monitor (PID: $pid)" >&2
155
+ kill -TERM "$pid"
156
+
157
+ # Wait for graceful shutdown (max 5 seconds)
158
+ for i in {1..10}; do
159
+ if ! kill -0 "$pid" 2>/dev/null; then
160
+ echo "[INFO] Monitor stopped successfully" >&2
161
+ return 0
162
+ fi
163
+ sleep 0.5
164
+ done
165
+
166
+ # Force kill if still running
167
+ if kill -0 "$pid" 2>/dev/null; then
168
+ echo "[WARN] Monitor did not stop gracefully, forcing..." >&2
169
+ kill -KILL "$pid" 2>/dev/null || true
170
+ fi
171
+ fi
172
+
173
+ rm -f "$MONITOR_PID_FILE"
174
+ else
175
+ echo "[INFO] No monitor running" >&2
176
+ fi
177
+ }
178
+
179
+ # ==============================================================================
180
+ # MAIN EXECUTION
181
+ # ==============================================================================
182
+
183
+ case "${1:-start}" in
184
+ start)
185
+ if [ -f "$MONITOR_PID_FILE" ]; then
186
+ echo "[ERROR] Monitor already running (PID: $(cat "$MONITOR_PID_FILE"))" >&2
187
+ exit 1
188
+ fi
189
+ start_monitor
190
+ ;;
191
+
192
+ stop)
193
+ stop_monitor
194
+ ;;
195
+
196
+ restart)
197
+ stop_monitor
198
+ sleep 1
199
+ start_monitor
200
+ ;;
201
+
202
+ status)
203
+ get_monitor_status
204
+ ;;
205
+
206
+ background)
207
+ # Start in background
208
+ if [ -f "$MONITOR_PID_FILE" ]; then
209
+ echo "[ERROR] Monitor already running (PID: $(cat "$MONITOR_PID_FILE"))" >&2
210
+ exit 1
211
+ fi
212
+ nohup "$0" start > /dev/shm/alert-monitor.log 2>&1 &
213
+ echo "[INFO] Monitor started in background (PID: $!)" >&2
214
+ ;;
215
+
216
+ *)
217
+ echo "Usage: $0 {start|stop|restart|status|background}" >&2
218
+ exit 1
219
+ ;;
220
+ esac
@@ -0,0 +1,211 @@
1
+ {
2
+ "dashboard": {
3
+ "title": "CFN Rate Limiting & Backpressure Monitoring",
4
+ "description": "Real-time monitoring of message inbox utilization, backpressure events, and overflow alerts",
5
+ "version": "1.0.0",
6
+ "tags": ["rate-limiting", "backpressure", "inbox", "coordination"],
7
+ "timezone": "UTC",
8
+ "refresh": "10s",
9
+ "panels": [
10
+ {
11
+ "id": 1,
12
+ "title": "Inbox Utilization by Agent",
13
+ "type": "timeseries",
14
+ "gridPos": { "x": 0, "y": 0, "w": 12, "h": 8 },
15
+ "targets": [
16
+ {
17
+ "metric": "inbox.utilization",
18
+ "legend": "{{agent}}",
19
+ "unit": "percent"
20
+ }
21
+ ],
22
+ "thresholds": [
23
+ { "value": 75, "color": "yellow", "label": "Warning" },
24
+ { "value": 90, "color": "red", "label": "Critical" }
25
+ ],
26
+ "description": "Message inbox utilization percentage per agent (max 100 messages)"
27
+ },
28
+ {
29
+ "id": 2,
30
+ "title": "Inbox Message Count",
31
+ "type": "timeseries",
32
+ "gridPos": { "x": 12, "y": 0, "w": 12, "h": 8 },
33
+ "targets": [
34
+ {
35
+ "metric": "inbox.size",
36
+ "legend": "{{agent}}",
37
+ "unit": "count"
38
+ }
39
+ ],
40
+ "thresholds": [
41
+ { "value": 75, "color": "yellow", "label": "Warning (75 msgs)" },
42
+ { "value": 90, "color": "red", "label": "Critical (90 msgs)" }
43
+ ],
44
+ "description": "Absolute message count in agent inboxes"
45
+ },
46
+ {
47
+ "id": 3,
48
+ "title": "Backpressure Events Rate",
49
+ "type": "timeseries",
50
+ "gridPos": { "x": 0, "y": 8, "w": 12, "h": 8 },
51
+ "targets": [
52
+ {
53
+ "metric": "backpressure.events_per_min",
54
+ "legend": "Backpressure events/min",
55
+ "unit": "count"
56
+ }
57
+ ],
58
+ "thresholds": [
59
+ { "value": 100, "color": "yellow", "label": "Warning threshold" }
60
+ ],
61
+ "description": "Rate of backpressure wait events (high rate indicates system load)"
62
+ },
63
+ {
64
+ "id": 4,
65
+ "title": "Message Send Failures",
66
+ "type": "timeseries",
67
+ "gridPos": { "x": 12, "y": 8, "w": 12, "h": 8 },
68
+ "targets": [
69
+ {
70
+ "metric": "coordination.send_failures_per_min",
71
+ "legend": "Send failures/min",
72
+ "unit": "count"
73
+ }
74
+ ],
75
+ "thresholds": [
76
+ { "value": 10, "color": "red", "label": "Critical threshold" }
77
+ ],
78
+ "description": "Message delivery failure rate (critical if >10/min)"
79
+ },
80
+ {
81
+ "id": 5,
82
+ "title": "Inbox Overflow Events",
83
+ "type": "timeseries",
84
+ "gridPos": { "x": 0, "y": 16, "w": 12, "h": 8 },
85
+ "targets": [
86
+ {
87
+ "metric": "inbox.overflow_events_per_min",
88
+ "legend": "Overflow events/min",
89
+ "unit": "count"
90
+ }
91
+ ],
92
+ "thresholds": [
93
+ { "value": 1, "color": "red", "label": "Any overflow is critical" }
94
+ ],
95
+ "description": "Inbox overflow events (messages dropped due to full inbox)"
96
+ },
97
+ {
98
+ "id": 6,
99
+ "title": "Alert Summary",
100
+ "type": "stat",
101
+ "gridPos": { "x": 12, "y": 16, "w": 6, "h": 8 },
102
+ "targets": [
103
+ {
104
+ "query": "count_alerts_by_severity",
105
+ "fields": ["critical", "warning", "info"]
106
+ }
107
+ ],
108
+ "description": "Alert counts by severity level (last hour)"
109
+ },
110
+ {
111
+ "id": 7,
112
+ "title": "Top Utilized Agents",
113
+ "type": "table",
114
+ "gridPos": { "x": 18, "y": 16, "w": 6, "h": 8 },
115
+ "targets": [
116
+ {
117
+ "query": "top_inbox_utilization",
118
+ "fields": ["agent", "utilization", "message_count"],
119
+ "limit": 10,
120
+ "order": "desc"
121
+ }
122
+ ],
123
+ "description": "Agents with highest inbox utilization"
124
+ }
125
+ ],
126
+ "annotations": [
127
+ {
128
+ "name": "Rate Limiting Alerts",
129
+ "datasource": "cfn-alerts",
130
+ "filter": {
131
+ "tags": ["inbox_high_utilization", "backpressure_high_rate", "inbox_overflow_detected"]
132
+ },
133
+ "color": "red"
134
+ }
135
+ ],
136
+ "variables": [
137
+ {
138
+ "name": "agent",
139
+ "type": "query",
140
+ "query": "SELECT DISTINCT agent FROM inbox_metrics",
141
+ "description": "Filter by specific agent",
142
+ "multi": true,
143
+ "includeAll": true
144
+ },
145
+ {
146
+ "name": "timeRange",
147
+ "type": "interval",
148
+ "options": ["5m", "15m", "1h", "6h", "24h"],
149
+ "default": "1h",
150
+ "description": "Time range for metrics"
151
+ }
152
+ ]
153
+ },
154
+ "queries": {
155
+ "count_alerts_by_severity": {
156
+ "description": "Count alerts grouped by severity",
157
+ "source": "/dev/shm/cfn-alerts.jsonl",
158
+ "aggregation": "GROUP BY severity, COUNT(*)",
159
+ "timeWindow": "1h"
160
+ },
161
+ "top_inbox_utilization": {
162
+ "description": "Rank agents by inbox utilization",
163
+ "source": "/dev/shm/cfn-metrics.jsonl",
164
+ "query": "SELECT agent, MAX(value) as utilization FROM metrics WHERE metric='inbox.utilization' GROUP BY agent ORDER BY utilization DESC LIMIT 10",
165
+ "timeWindow": "5m"
166
+ }
167
+ },
168
+ "alertRules": [
169
+ {
170
+ "name": "Inbox Critical Utilization",
171
+ "condition": "inbox.utilization >= 90",
172
+ "severity": "critical",
173
+ "message": "Agent {{agent}} inbox at {{value}}% utilization (critical threshold: 90%)",
174
+ "actions": ["emit_alert", "notify_oncall"]
175
+ },
176
+ {
177
+ "name": "Inbox Warning Utilization",
178
+ "condition": "inbox.utilization >= 75 AND inbox.utilization < 90",
179
+ "severity": "warning",
180
+ "message": "Agent {{agent}} inbox at {{value}}% utilization (warning threshold: 75%)",
181
+ "actions": ["emit_alert"]
182
+ },
183
+ {
184
+ "name": "Backpressure High Rate",
185
+ "condition": "backpressure.events_per_min > 100",
186
+ "severity": "warning",
187
+ "message": "Backpressure events exceeding threshold: {{value}} events/min (threshold: 100/min)",
188
+ "actions": ["emit_alert"]
189
+ },
190
+ {
191
+ "name": "Message Send Failures Critical",
192
+ "condition": "coordination.send_failures_per_min > 10",
193
+ "severity": "critical",
194
+ "message": "Message send failures critical: {{value}} failures/min (threshold: 10/min)",
195
+ "actions": ["emit_alert", "notify_oncall", "trigger_incident"]
196
+ },
197
+ {
198
+ "name": "Inbox Overflow Detected",
199
+ "condition": "inbox.overflow_events_per_min > 0",
200
+ "severity": "critical",
201
+ "message": "Inbox overflow detected: {{value}} overflow events in last minute",
202
+ "actions": ["emit_alert", "notify_oncall", "trigger_incident"]
203
+ }
204
+ ],
205
+ "metadata": {
206
+ "createdBy": "devops-engineer",
207
+ "phase": "1",
208
+ "sprint": "1.5",
209
+ "lastUpdated": "2025-10-06T19:35:00Z"
210
+ }
211
+ }
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env bash
2
+ # Quick validation test for alerting system (no jq dependency)
3
+ # Phase 1 Sprint 1.1: Simple validation
4
+
5
+ set -euo pipefail
6
+
7
+ echo "=========================================="
8
+ echo "ALERTING SYSTEM QUICK VALIDATION"
9
+ echo "=========================================="
10
+ echo ""
11
+
12
+ # Check if files exist
13
+ echo "1. Checking component files..."
14
+ files=(
15
+ "lib/alerting.sh"
16
+ "scripts/monitoring/alert-monitor.sh"
17
+ "scripts/monitoring/view-alerts.sh"
18
+ )
19
+
20
+ for file in "${files[@]}"; do
21
+ if [ -f "$file" ]; then
22
+ echo " ✅ $file"
23
+ else
24
+ echo " ❌ $file (MISSING)"
25
+ exit 1
26
+ fi
27
+ done
28
+
29
+ echo ""
30
+ echo "2. Checking executability..."
31
+ for file in "${files[@]}"; do
32
+ if [ -x "$file" ]; then
33
+ echo " ✅ $file"
34
+ else
35
+ echo " ⚠️ $file (not executable, fixing...)"
36
+ chmod +x "$file"
37
+ fi
38
+ done
39
+
40
+ echo ""
41
+ echo "3. Checking syntax..."
42
+ for file in "${files[@]}"; do
43
+ if bash -n "$file" 2>/dev/null; then
44
+ echo " ✅ $file"
45
+ else
46
+ echo " ❌ $file (SYNTAX ERROR)"
47
+ exit 1
48
+ fi
49
+ done
50
+
51
+ echo ""
52
+ echo "4. Checking alerting library functions..."
53
+ # Source the library and verify key functions exist
54
+ if source lib/alerting.sh 2>/dev/null; then
55
+ echo " ✅ Library sourced successfully"
56
+
57
+ # Check if key functions are defined
58
+ funcs=(
59
+ "check_thresholds"
60
+ "emit_alert"
61
+ "get_alert_summary"
62
+ "clear_old_alerts"
63
+ )
64
+
65
+ for func in "${funcs[@]}"; do
66
+ if declare -f "$func" >/dev/null; then
67
+ echo " ✅ Function: $func"
68
+ else
69
+ echo " ❌ Function: $func (NOT FOUND)"
70
+ exit 1
71
+ fi
72
+ done
73
+ else
74
+ echo " ❌ Failed to source library"
75
+ exit 1
76
+ fi
77
+
78
+ echo ""
79
+ echo "5. Checking threshold configuration..."
80
+ # Verify environment variables are set with defaults
81
+ vars=(
82
+ "ALERT_COORDINATION_TIME_MS"
83
+ "ALERT_DELIVERY_RATE_PCT"
84
+ "ALERT_MEMORY_GROWTH_PCT"
85
+ "ALERT_FD_GROWTH"
86
+ )
87
+
88
+ for var in "${vars[@]}"; do
89
+ if [ -n "${!var:-}" ]; then
90
+ echo " ✅ $var=${!var}"
91
+ else
92
+ echo " ❌ $var (NOT SET)"
93
+ exit 1
94
+ fi
95
+ done
96
+
97
+ echo ""
98
+ echo "=========================================="
99
+ echo "✅ VALIDATION PASSED"
100
+ echo "=========================================="
101
+ echo ""
102
+ echo "DELIVERABLES CONFIRMED:"
103
+ echo " ✅ lib/alerting.sh - Alert threshold engine"
104
+ echo " ✅ scripts/monitoring/alert-monitor.sh - Monitoring daemon"
105
+ echo " ✅ scripts/monitoring/view-alerts.sh - Alert dashboard"
106
+ echo " ✅ Configurable thresholds"
107
+ echo " ✅ All functions defined"
108
+ echo " ✅ Syntax validation passed"
109
+ echo ""
110
+ echo "ACCEPTANCE CRITERIA STATUS:"
111
+ echo " ✅ Alerts trigger when thresholds exceeded - Implemented"
112
+ echo " ⚠️ False positive rate <1% - Requires jq for full testing"
113
+ echo " ⚠️ Alert latency <30 seconds - Requires jq for full testing"
114
+ echo " ✅ Configurable thresholds - Confirmed"
115
+ echo ""
116
+ echo "To run full integration tests, install jq:"
117
+ echo " sudo apt-get install jq"
118
+ echo " bash tests/integration/alerting-system.test.sh"