specweave 0.21.1 → 0.21.3

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 (607) hide show
  1. package/CLAUDE.md +232 -5
  2. package/dist/plugins/specweave-github/lib/IssueStateManager.d.ts +98 -0
  3. package/dist/plugins/specweave-github/lib/IssueStateManager.d.ts.map +1 -0
  4. package/dist/plugins/specweave-github/lib/IssueStateManager.js +146 -0
  5. package/dist/plugins/specweave-github/lib/IssueStateManager.js.map +1 -0
  6. package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts.map +1 -1
  7. package/dist/plugins/specweave-github/lib/user-story-issue-builder.js +6 -0
  8. package/dist/plugins/specweave-github/lib/user-story-issue-builder.js.map +1 -1
  9. package/dist/src/cli/commands/check-hooks.d.ts +11 -0
  10. package/dist/src/cli/commands/check-hooks.d.ts.map +1 -0
  11. package/dist/src/cli/commands/check-hooks.js +144 -0
  12. package/dist/src/cli/commands/check-hooks.js.map +1 -0
  13. package/dist/src/cli/commands/cicd-monitor.js +3 -3
  14. package/dist/src/cli/commands/cicd-monitor.js.map +1 -1
  15. package/dist/src/cli/commands/import-docs.js +2 -2
  16. package/dist/src/cli/commands/import-docs.js.map +1 -1
  17. package/dist/src/cli/commands/init-multiproject.js +4 -4
  18. package/dist/src/cli/commands/init-multiproject.js.map +1 -1
  19. package/dist/src/cli/commands/migrate-to-multiproject.js +3 -3
  20. package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -1
  21. package/dist/src/cli/commands/plan/agent-invoker.d.ts +79 -0
  22. package/dist/src/cli/commands/plan/agent-invoker.d.ts.map +1 -0
  23. package/dist/src/cli/commands/plan/agent-invoker.js +383 -0
  24. package/dist/src/cli/commands/plan/agent-invoker.js.map +1 -0
  25. package/dist/src/cli/commands/plan/increment-detector.d.ts +27 -0
  26. package/dist/src/cli/commands/plan/increment-detector.d.ts.map +1 -0
  27. package/dist/src/cli/commands/plan/increment-detector.js +159 -0
  28. package/dist/src/cli/commands/plan/increment-detector.js.map +1 -0
  29. package/dist/src/cli/commands/plan/plan-orchestrator.d.ts +45 -0
  30. package/dist/src/cli/commands/plan/plan-orchestrator.d.ts.map +1 -0
  31. package/dist/src/cli/commands/plan/plan-orchestrator.js +229 -0
  32. package/dist/src/cli/commands/plan/plan-orchestrator.js.map +1 -0
  33. package/dist/src/cli/commands/plan/plan-validator.d.ts +36 -0
  34. package/dist/src/cli/commands/plan/plan-validator.d.ts.map +1 -0
  35. package/dist/src/cli/commands/plan/plan-validator.js +174 -0
  36. package/dist/src/cli/commands/plan/plan-validator.js.map +1 -0
  37. package/dist/src/cli/commands/plan/types.d.ts +170 -0
  38. package/dist/src/cli/commands/plan/types.d.ts.map +1 -0
  39. package/dist/src/cli/commands/plan/types.js +42 -0
  40. package/dist/src/cli/commands/plan/types.js.map +1 -0
  41. package/dist/src/cli/commands/plan-command.d.ts +16 -0
  42. package/dist/src/cli/commands/plan-command.d.ts.map +1 -0
  43. package/dist/src/cli/commands/plan-command.js +127 -0
  44. package/dist/src/cli/commands/plan-command.js.map +1 -0
  45. package/dist/src/cli/commands/switch-project.js +3 -3
  46. package/dist/src/cli/commands/switch-project.js.map +1 -1
  47. package/dist/src/cli/commands/validate-parent-repo.js +1 -1
  48. package/dist/src/cli/commands/validate-parent-repo.js.map +1 -1
  49. package/dist/src/config/ConfigManager.d.ts +69 -0
  50. package/dist/src/config/ConfigManager.d.ts.map +1 -0
  51. package/dist/src/config/ConfigManager.js +130 -0
  52. package/dist/src/config/ConfigManager.js.map +1 -0
  53. package/dist/src/config/types.d.ts +1357 -0
  54. package/dist/src/config/types.d.ts.map +1 -0
  55. package/dist/src/config/types.js +67 -0
  56. package/dist/src/config/types.js.map +1 -0
  57. package/dist/src/core/brownfield/importer.d.ts +1 -1
  58. package/dist/src/core/brownfield/importer.d.ts.map +1 -1
  59. package/dist/src/core/brownfield/importer.js +3 -3
  60. package/dist/src/core/brownfield/importer.js.map +1 -1
  61. package/dist/src/core/cicd/config-loader.d.ts +1 -1
  62. package/dist/src/core/cicd/config-loader.d.ts.map +1 -1
  63. package/dist/src/core/cicd/index.d.ts +6 -6
  64. package/dist/src/core/cicd/index.d.ts.map +1 -1
  65. package/dist/src/core/cicd/index.js +6 -6
  66. package/dist/src/core/cicd/index.js.map +1 -1
  67. package/dist/src/core/cicd/monitor-service.d.ts +3 -3
  68. package/dist/src/core/cicd/monitor-service.d.ts.map +1 -1
  69. package/dist/src/core/cicd/monitor-service.js +3 -3
  70. package/dist/src/core/cicd/monitor-service.js.map +1 -1
  71. package/dist/src/core/cicd/notifier.d.ts +1 -1
  72. package/dist/src/core/cicd/notifier.d.ts.map +1 -1
  73. package/dist/src/core/cicd/state-manager.d.ts +1 -1
  74. package/dist/src/core/cicd/state-manager.d.ts.map +1 -1
  75. package/dist/src/core/cicd/state-manager.js +1 -1
  76. package/dist/src/core/cicd/state-manager.js.map +1 -1
  77. package/dist/src/core/cicd/workflow-monitor.d.ts +1 -1
  78. package/dist/src/core/cicd/workflow-monitor.d.ts.map +1 -1
  79. package/dist/src/core/cicd/workflow-monitor.js +1 -1
  80. package/dist/src/core/cicd/workflow-monitor.js.map +1 -1
  81. package/dist/src/core/cost-tracker.d.ts +2 -2
  82. package/dist/src/core/cost-tracker.d.ts.map +1 -1
  83. package/dist/src/core/cost-tracker.js +1 -1
  84. package/dist/src/core/cost-tracker.js.map +1 -1
  85. package/dist/src/core/hooks/HealthReporter.d.ts +55 -0
  86. package/dist/src/core/hooks/HealthReporter.d.ts.map +1 -0
  87. package/dist/src/core/hooks/HealthReporter.js +268 -0
  88. package/dist/src/core/hooks/HealthReporter.js.map +1 -0
  89. package/dist/src/core/hooks/HookAutoFixer.d.ts +41 -0
  90. package/dist/src/core/hooks/HookAutoFixer.d.ts.map +1 -0
  91. package/dist/src/core/hooks/HookAutoFixer.js +222 -0
  92. package/dist/src/core/hooks/HookAutoFixer.js.map +1 -0
  93. package/dist/src/core/hooks/HookExecutor.d.ts +57 -0
  94. package/dist/src/core/hooks/HookExecutor.d.ts.map +1 -0
  95. package/dist/src/core/hooks/HookExecutor.js +287 -0
  96. package/dist/src/core/hooks/HookExecutor.js.map +1 -0
  97. package/dist/src/core/hooks/HookHealthChecker.d.ts +51 -0
  98. package/dist/src/core/hooks/HookHealthChecker.d.ts.map +1 -0
  99. package/dist/src/core/hooks/HookHealthChecker.js +212 -0
  100. package/dist/src/core/hooks/HookHealthChecker.js.map +1 -0
  101. package/dist/src/core/hooks/HookScanner.d.ts +65 -0
  102. package/dist/src/core/hooks/HookScanner.d.ts.map +1 -0
  103. package/dist/src/core/hooks/HookScanner.js +214 -0
  104. package/dist/src/core/hooks/HookScanner.js.map +1 -0
  105. package/dist/src/core/hooks/types.d.ts +281 -0
  106. package/dist/src/core/hooks/types.d.ts.map +1 -0
  107. package/dist/src/core/hooks/types.js +10 -0
  108. package/dist/src/core/hooks/types.js.map +1 -0
  109. package/dist/src/core/iac/index.d.ts +10 -0
  110. package/dist/src/core/iac/index.d.ts.map +1 -0
  111. package/dist/src/core/iac/index.js +11 -0
  112. package/dist/src/core/iac/index.js.map +1 -0
  113. package/dist/src/core/iac/template-engine.d.ts +77 -0
  114. package/dist/src/core/iac/template-engine.d.ts.map +1 -0
  115. package/dist/src/core/iac/template-engine.js +182 -0
  116. package/dist/src/core/iac/template-engine.js.map +1 -0
  117. package/dist/src/core/increment/ac-status-manager.d.ts +115 -0
  118. package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -0
  119. package/dist/src/core/increment/ac-status-manager.js +343 -0
  120. package/dist/src/core/increment/ac-status-manager.js.map +1 -0
  121. package/dist/src/core/increment/auto-transition-manager.d.ts +60 -0
  122. package/dist/src/core/increment/auto-transition-manager.d.ts.map +1 -0
  123. package/dist/src/core/increment/auto-transition-manager.js +192 -0
  124. package/dist/src/core/increment/auto-transition-manager.js.map +1 -0
  125. package/dist/src/core/increment/limits.d.ts +1 -1
  126. package/dist/src/core/increment/limits.d.ts.map +1 -1
  127. package/dist/src/core/increment/limits.js +2 -2
  128. package/dist/src/core/increment/limits.js.map +1 -1
  129. package/dist/src/core/increment/spec-sync-manager.d.ts +177 -0
  130. package/dist/src/core/increment/spec-sync-manager.d.ts.map +1 -0
  131. package/dist/src/core/increment/spec-sync-manager.js +496 -0
  132. package/dist/src/core/increment/spec-sync-manager.js.map +1 -0
  133. package/dist/src/core/increment/status-auto-transition.d.ts +46 -0
  134. package/dist/src/core/increment/status-auto-transition.d.ts.map +1 -0
  135. package/dist/src/core/increment/status-auto-transition.js +178 -0
  136. package/dist/src/core/increment/status-auto-transition.js.map +1 -0
  137. package/dist/src/core/increment/task-state-manager.d.ts +75 -0
  138. package/dist/src/core/increment/task-state-manager.d.ts.map +1 -0
  139. package/dist/src/core/increment/task-state-manager.js +117 -0
  140. package/dist/src/core/increment/task-state-manager.js.map +1 -0
  141. package/dist/src/core/living-docs/CodeValidator.d.ts +68 -0
  142. package/dist/src/core/living-docs/CodeValidator.d.ts.map +1 -0
  143. package/dist/src/core/living-docs/CodeValidator.js +160 -0
  144. package/dist/src/core/living-docs/CodeValidator.js.map +1 -0
  145. package/dist/src/core/living-docs/CompletionPropagator.d.ts +84 -0
  146. package/dist/src/core/living-docs/CompletionPropagator.d.ts.map +1 -0
  147. package/dist/src/core/living-docs/CompletionPropagator.js +205 -0
  148. package/dist/src/core/living-docs/CompletionPropagator.js.map +1 -0
  149. package/dist/src/core/living-docs/ProjectDetector.d.ts +29 -0
  150. package/dist/src/core/living-docs/ProjectDetector.d.ts.map +1 -0
  151. package/dist/src/core/living-docs/ProjectDetector.js +94 -0
  152. package/dist/src/core/living-docs/ProjectDetector.js.map +1 -0
  153. package/dist/src/core/living-docs/SpecDistributor.d.ts +55 -0
  154. package/dist/src/core/living-docs/SpecDistributor.d.ts.map +1 -0
  155. package/dist/src/core/living-docs/SpecDistributor.js +216 -0
  156. package/dist/src/core/living-docs/SpecDistributor.js.map +1 -0
  157. package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts +116 -0
  158. package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts.map +1 -0
  159. package/dist/src/core/living-docs/ThreeLayerSyncManager.js +356 -0
  160. package/dist/src/core/living-docs/ThreeLayerSyncManager.js.map +1 -0
  161. package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -1
  162. package/dist/src/core/living-docs/hierarchy-mapper.js +2 -1
  163. package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
  164. package/dist/src/core/living-docs/index.d.ts +1 -1
  165. package/dist/src/core/living-docs/index.d.ts.map +1 -1
  166. package/dist/src/core/living-docs/index.js +5 -1
  167. package/dist/src/core/living-docs/index.js.map +1 -1
  168. package/dist/src/core/living-docs/types.d.ts +70 -300
  169. package/dist/src/core/living-docs/types.d.ts.map +1 -1
  170. package/dist/src/core/living-docs/types.js +2 -10
  171. package/dist/src/core/living-docs/types.js.map +1 -1
  172. package/dist/src/core/project-manager.d.ts +1 -1
  173. package/dist/src/core/project-manager.d.ts.map +1 -1
  174. package/dist/src/core/project-manager.js +2 -2
  175. package/dist/src/core/project-manager.js.map +1 -1
  176. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  177. package/dist/src/core/qa/quality-gate-decider.d.ts.map +1 -1
  178. package/dist/src/core/qa/risk-calculator.d.ts +1 -1
  179. package/dist/src/core/qa/risk-calculator.d.ts.map +1 -1
  180. package/dist/src/core/repo-structure/setup-summary.d.ts +1 -1
  181. package/dist/src/core/repo-structure/setup-summary.d.ts.map +1 -1
  182. package/dist/src/core/rfc-generator-v2.d.ts +1 -1
  183. package/dist/src/core/rfc-generator-v2.d.ts.map +1 -1
  184. package/dist/src/core/rfc-generator-v2.js +1 -1
  185. package/dist/src/core/rfc-generator-v2.js.map +1 -1
  186. package/dist/src/core/serverless/context-detector.d.ts +12 -0
  187. package/dist/src/core/serverless/context-detector.d.ts.map +1 -0
  188. package/dist/src/core/serverless/context-detector.js +213 -0
  189. package/dist/src/core/serverless/context-detector.js.map +1 -0
  190. package/dist/src/core/serverless/cost-comparison.d.ts +73 -0
  191. package/dist/src/core/serverless/cost-comparison.d.ts.map +1 -0
  192. package/dist/src/core/serverless/cost-comparison.js +198 -0
  193. package/dist/src/core/serverless/cost-comparison.js.map +1 -0
  194. package/dist/src/core/serverless/cost-estimator.d.ts +69 -0
  195. package/dist/src/core/serverless/cost-estimator.d.ts.map +1 -0
  196. package/dist/src/core/serverless/cost-estimator.js +127 -0
  197. package/dist/src/core/serverless/cost-estimator.js.map +1 -0
  198. package/dist/src/core/serverless/cost-optimizer.d.ts +57 -0
  199. package/dist/src/core/serverless/cost-optimizer.d.ts.map +1 -0
  200. package/dist/src/core/serverless/cost-optimizer.js +221 -0
  201. package/dist/src/core/serverless/cost-optimizer.js.map +1 -0
  202. package/dist/src/core/serverless/index.d.ts +20 -0
  203. package/dist/src/core/serverless/index.d.ts.map +1 -0
  204. package/dist/src/core/serverless/index.js +26 -0
  205. package/dist/src/core/serverless/index.js.map +1 -0
  206. package/dist/src/core/serverless/learning-path-recommender.d.ts +152 -0
  207. package/dist/src/core/serverless/learning-path-recommender.d.ts.map +1 -0
  208. package/dist/src/core/serverless/learning-path-recommender.js +389 -0
  209. package/dist/src/core/serverless/learning-path-recommender.js.map +1 -0
  210. package/dist/src/core/serverless/platform-data-loader.d.ts +22 -0
  211. package/dist/src/core/serverless/platform-data-loader.d.ts.map +1 -0
  212. package/dist/src/core/serverless/platform-data-loader.js +49 -0
  213. package/dist/src/core/serverless/platform-data-loader.js.map +1 -0
  214. package/dist/src/core/serverless/platform-selector.d.ts +20 -0
  215. package/dist/src/core/serverless/platform-selector.d.ts.map +1 -0
  216. package/dist/src/core/serverless/platform-selector.js +279 -0
  217. package/dist/src/core/serverless/platform-selector.js.map +1 -0
  218. package/dist/src/core/serverless/recommendation-formatter.d.ts +24 -0
  219. package/dist/src/core/serverless/recommendation-formatter.d.ts.map +1 -0
  220. package/dist/src/core/serverless/recommendation-formatter.js +70 -0
  221. package/dist/src/core/serverless/recommendation-formatter.js.map +1 -0
  222. package/dist/src/core/serverless/suitability-analyzer.d.ts +22 -0
  223. package/dist/src/core/serverless/suitability-analyzer.d.ts.map +1 -0
  224. package/dist/src/core/serverless/suitability-analyzer.js +262 -0
  225. package/dist/src/core/serverless/suitability-analyzer.js.map +1 -0
  226. package/dist/src/core/serverless/types.d.ts +96 -0
  227. package/dist/src/core/serverless/types.d.ts.map +1 -0
  228. package/dist/src/core/serverless/types.js +5 -0
  229. package/dist/src/core/serverless/types.js.map +1 -0
  230. package/dist/src/core/sync/bidirectional-engine.d.ts +1 -1
  231. package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
  232. package/dist/src/core/sync/enhanced-content-builder.d.ts +1 -1
  233. package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -1
  234. package/dist/src/core/sync/profile-manager.d.ts +1 -1
  235. package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
  236. package/dist/src/core/sync/profile-selector.d.ts +1 -1
  237. package/dist/src/core/sync/profile-selector.d.ts.map +1 -1
  238. package/dist/src/core/sync/profile-selector.js +1 -1
  239. package/dist/src/core/sync/profile-selector.js.map +1 -1
  240. package/dist/src/core/sync/project-context.d.ts +1 -1
  241. package/dist/src/core/sync/project-context.d.ts.map +1 -1
  242. package/dist/src/core/sync/rate-limiter.d.ts +1 -1
  243. package/dist/src/core/sync/rate-limiter.d.ts.map +1 -1
  244. package/dist/src/core/sync/status-sync-engine.d.ts +2 -2
  245. package/dist/src/core/sync/status-sync-engine.d.ts.map +1 -1
  246. package/dist/src/core/sync/status-sync-engine.js +2 -2
  247. package/dist/src/core/sync/status-sync-engine.js.map +1 -1
  248. package/dist/src/core/sync/time-range-selector.d.ts +1 -1
  249. package/dist/src/core/sync/time-range-selector.d.ts.map +1 -1
  250. package/dist/src/core/sync/time-range-selector.js +1 -1
  251. package/dist/src/core/sync/time-range-selector.js.map +1 -1
  252. package/dist/src/core/types/increment-metadata.d.ts +27 -0
  253. package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
  254. package/dist/src/core/types/increment-metadata.js +45 -1
  255. package/dist/src/core/types/increment-metadata.js.map +1 -1
  256. package/dist/src/core/types/sync-profile.d.ts +2 -0
  257. package/dist/src/core/types/sync-profile.d.ts.map +1 -1
  258. package/dist/src/core/types/sync-profile.js.map +1 -1
  259. package/dist/src/core/validation/increment-structure-validator.d.ts +47 -0
  260. package/dist/src/core/validation/increment-structure-validator.d.ts.map +1 -0
  261. package/dist/src/core/validation/increment-structure-validator.js +187 -0
  262. package/dist/src/core/validation/increment-structure-validator.js.map +1 -0
  263. package/dist/src/core/validation/three-file-validator.d.ts +82 -0
  264. package/dist/src/core/validation/three-file-validator.d.ts.map +1 -0
  265. package/dist/src/core/validation/three-file-validator.js +320 -0
  266. package/dist/src/core/validation/three-file-validator.js.map +1 -0
  267. package/dist/src/core/workflow/phase-detector.d.ts +103 -0
  268. package/dist/src/core/workflow/phase-detector.d.ts.map +1 -0
  269. package/dist/src/core/workflow/phase-detector.js +704 -0
  270. package/dist/src/core/workflow/phase-detector.js.map +1 -0
  271. package/dist/src/core/workflow/types.d.ts +153 -0
  272. package/dist/src/core/workflow/types.d.ts.map +1 -0
  273. package/dist/src/core/workflow/types.js +47 -0
  274. package/dist/src/core/workflow/types.js.map +1 -0
  275. package/dist/src/init/InitFlow.d.ts +37 -0
  276. package/dist/src/init/InitFlow.d.ts.map +1 -0
  277. package/dist/src/init/InitFlow.js +209 -0
  278. package/dist/src/init/InitFlow.js.map +1 -0
  279. package/dist/src/init/architecture/ArchitectureDecisionEngine.d.ts +107 -0
  280. package/dist/src/init/architecture/ArchitectureDecisionEngine.d.ts.map +1 -0
  281. package/dist/src/init/architecture/ArchitectureDecisionEngine.js +405 -0
  282. package/dist/src/init/architecture/ArchitectureDecisionEngine.js.map +1 -0
  283. package/dist/src/init/architecture/CloudCreditsDatabase.d.ts +11 -0
  284. package/dist/src/init/architecture/CloudCreditsDatabase.d.ts.map +1 -0
  285. package/dist/src/init/architecture/CloudCreditsDatabase.js +92 -0
  286. package/dist/src/init/architecture/CloudCreditsDatabase.js.map +1 -0
  287. package/dist/src/init/architecture/types.d.ts +251 -0
  288. package/dist/src/init/architecture/types.d.ts.map +1 -0
  289. package/dist/src/init/architecture/types.js +54 -0
  290. package/dist/src/init/architecture/types.js.map +1 -0
  291. package/dist/src/init/compliance/ComplianceDetector.d.ts +17 -0
  292. package/dist/src/init/compliance/ComplianceDetector.d.ts.map +1 -0
  293. package/dist/src/init/compliance/ComplianceDetector.js +64 -0
  294. package/dist/src/init/compliance/ComplianceDetector.js.map +1 -0
  295. package/dist/src/init/compliance/standards-database.d.ts +48 -0
  296. package/dist/src/init/compliance/standards-database.d.ts.map +1 -0
  297. package/dist/src/init/compliance/standards-database.js +506 -0
  298. package/dist/src/init/compliance/standards-database.js.map +1 -0
  299. package/dist/src/init/compliance/types.d.ts +91 -0
  300. package/dist/src/init/compliance/types.d.ts.map +1 -0
  301. package/dist/src/init/compliance/types.js +43 -0
  302. package/dist/src/init/compliance/types.js.map +1 -0
  303. package/dist/src/init/repo/GitHubAPIClient.d.ts +51 -0
  304. package/dist/src/init/repo/GitHubAPIClient.d.ts.map +1 -0
  305. package/dist/src/init/repo/GitHubAPIClient.js +144 -0
  306. package/dist/src/init/repo/GitHubAPIClient.js.map +1 -0
  307. package/dist/src/init/repo/RepositorySelector.d.ts +45 -0
  308. package/dist/src/init/repo/RepositorySelector.d.ts.map +1 -0
  309. package/dist/src/init/repo/RepositorySelector.js +106 -0
  310. package/dist/src/init/repo/RepositorySelector.js.map +1 -0
  311. package/dist/src/init/repo/types.d.ts +95 -0
  312. package/dist/src/init/repo/types.d.ts.map +1 -0
  313. package/dist/src/init/repo/types.js +25 -0
  314. package/dist/src/init/repo/types.js.map +1 -0
  315. package/dist/src/init/research/CompetitorAnalyzer.d.ts +79 -0
  316. package/dist/src/init/research/CompetitorAnalyzer.d.ts.map +1 -0
  317. package/dist/src/init/research/CompetitorAnalyzer.js +265 -0
  318. package/dist/src/init/research/CompetitorAnalyzer.js.map +1 -0
  319. package/dist/src/init/research/MarketDetector.d.ts +62 -0
  320. package/dist/src/init/research/MarketDetector.d.ts.map +1 -0
  321. package/dist/src/init/research/MarketDetector.js +247 -0
  322. package/dist/src/init/research/MarketDetector.js.map +1 -0
  323. package/dist/src/init/research/OpportunityScorer.d.ts +58 -0
  324. package/dist/src/init/research/OpportunityScorer.d.ts.map +1 -0
  325. package/dist/src/init/research/OpportunityScorer.js +194 -0
  326. package/dist/src/init/research/OpportunityScorer.js.map +1 -0
  327. package/dist/src/init/research/QuestionGenerator.d.ts +68 -0
  328. package/dist/src/init/research/QuestionGenerator.d.ts.map +1 -0
  329. package/dist/src/init/research/QuestionGenerator.js +244 -0
  330. package/dist/src/init/research/QuestionGenerator.js.map +1 -0
  331. package/dist/src/init/research/ReportGenerator.d.ts +36 -0
  332. package/dist/src/init/research/ReportGenerator.d.ts.map +1 -0
  333. package/dist/src/init/research/ReportGenerator.js +125 -0
  334. package/dist/src/init/research/ReportGenerator.js.map +1 -0
  335. package/dist/src/init/research/VisionAnalyzer.d.ts +129 -0
  336. package/dist/src/init/research/VisionAnalyzer.d.ts.map +1 -0
  337. package/dist/src/init/research/VisionAnalyzer.js +212 -0
  338. package/dist/src/init/research/VisionAnalyzer.js.map +1 -0
  339. package/dist/src/init/research/keyword-extractor.d.ts +78 -0
  340. package/dist/src/init/research/keyword-extractor.d.ts.map +1 -0
  341. package/dist/src/init/research/keyword-extractor.js +230 -0
  342. package/dist/src/init/research/keyword-extractor.js.map +1 -0
  343. package/dist/src/init/research/src/config/ConfigManager.d.ts +14 -0
  344. package/dist/src/init/research/src/config/ConfigManager.d.ts.map +1 -0
  345. package/dist/src/init/research/src/config/ConfigManager.js +45 -0
  346. package/dist/src/init/research/src/config/ConfigManager.js.map +1 -0
  347. package/dist/src/init/research/src/config/types.d.ts +102 -0
  348. package/dist/src/init/research/src/config/types.d.ts.map +1 -0
  349. package/dist/src/init/research/src/config/types.js +24 -0
  350. package/dist/src/init/research/src/config/types.js.map +1 -0
  351. package/dist/src/init/research/types.d.ts +183 -0
  352. package/dist/src/init/research/types.d.ts.map +1 -0
  353. package/dist/src/init/research/types.js +65 -0
  354. package/dist/src/init/research/types.js.map +1 -0
  355. package/dist/src/init/team/ServerlessSavingsCalculator.d.ts +136 -0
  356. package/dist/src/init/team/ServerlessSavingsCalculator.d.ts.map +1 -0
  357. package/dist/src/init/team/ServerlessSavingsCalculator.js +360 -0
  358. package/dist/src/init/team/ServerlessSavingsCalculator.js.map +1 -0
  359. package/dist/src/init/team/TeamRecommender.d.ts +122 -0
  360. package/dist/src/init/team/TeamRecommender.d.ts.map +1 -0
  361. package/dist/src/init/team/TeamRecommender.js +405 -0
  362. package/dist/src/init/team/TeamRecommender.js.map +1 -0
  363. package/dist/src/init/team/types.d.ts +95 -0
  364. package/dist/src/init/team/types.d.ts.map +1 -0
  365. package/dist/src/init/team/types.js +23 -0
  366. package/dist/src/init/team/types.js.map +1 -0
  367. package/dist/src/integrations/jira/jira-mapper.d.ts +1 -1
  368. package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -1
  369. package/dist/src/types/cost-tracking.d.ts +1 -1
  370. package/dist/src/types/cost-tracking.d.ts.map +1 -1
  371. package/dist/src/utils/cost-reporter.d.ts +2 -2
  372. package/dist/src/utils/cost-reporter.d.ts.map +1 -1
  373. package/dist/src/utils/docs-preview/config-generator.d.ts +1 -1
  374. package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -1
  375. package/dist/src/utils/docs-preview/config-generator.js +1 -1
  376. package/dist/src/utils/docs-preview/docusaurus-setup.d.ts +1 -1
  377. package/dist/src/utils/docs-preview/docusaurus-setup.d.ts.map +1 -1
  378. package/dist/src/utils/docs-preview/docusaurus-setup.js +4 -4
  379. package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -1
  380. package/dist/src/utils/docs-preview/index.d.ts +6 -6
  381. package/dist/src/utils/docs-preview/index.d.ts.map +1 -1
  382. package/dist/src/utils/docs-preview/index.js +6 -6
  383. package/dist/src/utils/docs-preview/index.js.map +1 -1
  384. package/dist/src/utils/docs-preview/package-installer.d.ts +1 -1
  385. package/dist/src/utils/docs-preview/package-installer.d.ts.map +1 -1
  386. package/dist/src/utils/docs-preview/package-installer.js +1 -1
  387. package/dist/src/utils/docs-preview/package-installer.js.map +1 -1
  388. package/dist/src/utils/docs-preview/server-manager.d.ts +1 -1
  389. package/dist/src/utils/docs-preview/server-manager.d.ts.map +1 -1
  390. package/dist/src/utils/docs-preview/server-manager.js +1 -1
  391. package/dist/src/utils/docs-preview/server-manager.js.map +1 -1
  392. package/dist/src/utils/docs-preview/sidebar-builder.d.ts +1 -1
  393. package/dist/src/utils/docs-preview/sidebar-builder.d.ts.map +1 -1
  394. package/dist/src/utils/generate-skills-index.d.ts +1 -1
  395. package/dist/src/utils/generate-skills-index.js +1 -1
  396. package/dist/src/utils/project-detection.js +1 -1
  397. package/dist/src/utils/project-detection.js.map +1 -1
  398. package/package.json +9 -3
  399. package/plugins/specweave/agents/architect/AGENT.md +605 -0
  400. package/plugins/specweave/agents/infrastructure/AGENT.md +760 -0
  401. package/plugins/specweave/agents/pm/AGENT.md +14 -13
  402. package/plugins/specweave/commands/specweave-check-hooks.md +186 -0
  403. package/plugins/specweave/commands/specweave-plan.md +151 -0
  404. package/plugins/specweave/commands/specweave-sync-acs.md +342 -0
  405. package/plugins/specweave/commands/specweave-validate.md +60 -11
  406. package/plugins/specweave/hooks/lib/update-status-line.sh +8 -4
  407. package/plugins/specweave/hooks/post-increment-change.sh +4 -0
  408. package/plugins/specweave/hooks/post-increment-completion.sh +7 -1
  409. package/plugins/specweave/hooks/post-increment-planning.sh +4 -0
  410. package/plugins/specweave/hooks/post-increment-status-change.sh +4 -0
  411. package/plugins/specweave/hooks/user-prompt-submit.sh +78 -0
  412. package/plugins/specweave/iac-templates/aws-lambda/README.md.hbs +280 -0
  413. package/plugins/specweave/iac-templates/aws-lambda/defaults.json +118 -0
  414. package/plugins/specweave/iac-templates/aws-lambda/environments/dev.defaults.json +46 -0
  415. package/plugins/specweave/iac-templates/aws-lambda/environments/prod.defaults.json +67 -0
  416. package/plugins/specweave/iac-templates/aws-lambda/environments/staging.defaults.json +47 -0
  417. package/plugins/specweave/iac-templates/aws-lambda/main.tf.hbs +241 -0
  418. package/plugins/specweave/iac-templates/aws-lambda/outputs.tf.hbs +61 -0
  419. package/plugins/specweave/iac-templates/aws-lambda/provider.tf.hbs +15 -0
  420. package/plugins/specweave/iac-templates/aws-lambda/variables.tf.hbs +88 -0
  421. package/plugins/specweave/iac-templates/azure-functions/README.md.hbs +315 -0
  422. package/plugins/specweave/iac-templates/azure-functions/defaults.json +65 -0
  423. package/plugins/specweave/iac-templates/azure-functions/environments/dev.defaults.json +30 -0
  424. package/plugins/specweave/iac-templates/azure-functions/environments/prod.defaults.json +34 -0
  425. package/plugins/specweave/iac-templates/azure-functions/environments/staging.defaults.json +31 -0
  426. package/plugins/specweave/iac-templates/azure-functions/iam.tf.hbs +34 -0
  427. package/plugins/specweave/iac-templates/azure-functions/main.tf.hbs +247 -0
  428. package/plugins/specweave/iac-templates/azure-functions/outputs.tf.hbs +72 -0
  429. package/plugins/specweave/iac-templates/azure-functions/provider.tf.hbs +14 -0
  430. package/plugins/specweave/iac-templates/azure-functions/variables.tf.hbs +64 -0
  431. package/plugins/specweave/iac-templates/firebase/README.md.hbs +487 -0
  432. package/plugins/specweave/iac-templates/firebase/defaults.json +55 -0
  433. package/plugins/specweave/iac-templates/firebase/environments/dev.defaults.json +44 -0
  434. package/plugins/specweave/iac-templates/firebase/environments/prod.defaults.json +52 -0
  435. package/plugins/specweave/iac-templates/firebase/environments/staging.defaults.json +43 -0
  436. package/plugins/specweave/iac-templates/firebase/iam.tf.hbs +75 -0
  437. package/plugins/specweave/iac-templates/firebase/main.tf.hbs +297 -0
  438. package/plugins/specweave/iac-templates/firebase/outputs.tf.hbs +67 -0
  439. package/plugins/specweave/iac-templates/firebase/provider.tf.hbs +26 -0
  440. package/plugins/specweave/iac-templates/firebase/variables.tf.hbs +68 -0
  441. package/plugins/specweave/iac-templates/gcp-cloud-functions/README.md.hbs +330 -0
  442. package/plugins/specweave/iac-templates/gcp-cloud-functions/defaults.json +69 -0
  443. package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/dev.defaults.json +33 -0
  444. package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/prod.defaults.json +40 -0
  445. package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/staging.defaults.json +33 -0
  446. package/plugins/specweave/iac-templates/gcp-cloud-functions/iam.tf.hbs +54 -0
  447. package/plugins/specweave/iac-templates/gcp-cloud-functions/main.tf.hbs +211 -0
  448. package/plugins/specweave/iac-templates/gcp-cloud-functions/outputs.tf.hbs +44 -0
  449. package/plugins/specweave/iac-templates/gcp-cloud-functions/provider.tf.hbs +14 -0
  450. package/plugins/specweave/iac-templates/gcp-cloud-functions/variables.tf.hbs +82 -0
  451. package/plugins/specweave/iac-templates/supabase/README.md.hbs +534 -0
  452. package/plugins/specweave/iac-templates/supabase/defaults.json +69 -0
  453. package/plugins/specweave/iac-templates/supabase/environments/dev.defaults.json +55 -0
  454. package/plugins/specweave/iac-templates/supabase/environments/prod.defaults.json +75 -0
  455. package/plugins/specweave/iac-templates/supabase/environments/staging.defaults.json +54 -0
  456. package/plugins/specweave/iac-templates/supabase/iam.tf.hbs +146 -0
  457. package/plugins/specweave/iac-templates/supabase/main.tf.hbs +310 -0
  458. package/plugins/specweave/iac-templates/supabase/outputs.tf.hbs +74 -0
  459. package/plugins/specweave/iac-templates/supabase/provider.tf.hbs +19 -0
  460. package/plugins/specweave/iac-templates/supabase/variables.tf.hbs +78 -0
  461. package/plugins/specweave/knowledge-base/serverless/FRESHNESS.md +69 -0
  462. package/plugins/specweave/knowledge-base/serverless/learning-paths.json +865 -0
  463. package/plugins/specweave/knowledge-base/serverless/platforms/aws-lambda.json +41 -0
  464. package/plugins/specweave/knowledge-base/serverless/platforms/azure-functions.json +41 -0
  465. package/plugins/specweave/knowledge-base/serverless/platforms/firebase.json +46 -0
  466. package/plugins/specweave/knowledge-base/serverless/platforms/gcp-cloud-functions.json +41 -0
  467. package/plugins/specweave/knowledge-base/serverless/platforms/supabase.json +41 -0
  468. package/plugins/specweave/knowledge-base/serverless/schema.json +155 -0
  469. package/plugins/specweave/lib/hooks/auto-transition.js +50 -0
  470. package/plugins/specweave/lib/hooks/auto-transition.ts +84 -0
  471. package/plugins/specweave/lib/hooks/invoke-translator-skill.js +1 -1
  472. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +1 -1
  473. package/plugins/specweave/lib/hooks/sync-living-docs.js +4 -31
  474. package/plugins/specweave/lib/hooks/{sync-living-docs.ts → sync-living-docs.ts.DISABLED} +9 -48
  475. package/plugins/specweave/lib/hooks/translate-file.js +1 -1
  476. package/plugins/specweave/lib/hooks/translate-file.ts +1 -1
  477. package/plugins/specweave/lib/hooks/update-ac-status.js +24 -75
  478. package/plugins/specweave/lib/hooks/update-ac-status.ts +46 -135
  479. package/plugins/specweave/lib/hooks/update-tasks-md.js +115 -3
  480. package/plugins/specweave/lib/hooks/update-tasks-md.ts +182 -10
  481. package/plugins/specweave/lib/utils/validate-dev-setup.sh +133 -0
  482. package/plugins/specweave/skills/increment-planner/SKILL.md +25 -15
  483. package/plugins/specweave/skills/serverless-recommender/SKILL.md +368 -0
  484. package/plugins/specweave/templates/iac/aws-lambda/templates/iam.tf.hbs +137 -0
  485. package/plugins/specweave/templates/iac/aws-lambda/templates/main.tf.hbs +216 -0
  486. package/plugins/specweave-github/lib/IssueStateManager.js +117 -0
  487. package/plugins/specweave-github/lib/IssueStateManager.ts +231 -0
  488. package/plugins/specweave-github/lib/user-story-issue-builder.js +7 -0
  489. package/plugins/specweave-github/lib/user-story-issue-builder.ts +11 -0
  490. package/plugins/specweave-ui/.mcp.json +0 -10
  491. package/plugins/specweave-ui/README.md +26 -26
  492. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +31 -18
  493. package/src/templates/tasks.md.template +51 -33
  494. package/dist/locales/de/.gitkeep +0 -0
  495. package/dist/locales/de/cli.json +0 -108
  496. package/dist/locales/en/cli.json +0 -287
  497. package/dist/locales/en/errors.json +0 -7
  498. package/dist/locales/en/templates.json +0 -6
  499. package/dist/locales/es/.gitkeep +0 -0
  500. package/dist/locales/es/cli.json +0 -41
  501. package/dist/locales/fr/.gitkeep +0 -0
  502. package/dist/locales/fr/cli.json +0 -108
  503. package/dist/locales/ja/.gitkeep +0 -0
  504. package/dist/locales/ja/cli.json +0 -108
  505. package/dist/locales/ko/.gitkeep +0 -0
  506. package/dist/locales/ko/cli.json +0 -108
  507. package/dist/locales/pt/.gitkeep +0 -0
  508. package/dist/locales/pt/cli.json +0 -108
  509. package/dist/locales/ru/.gitkeep +0 -0
  510. package/dist/locales/ru/cli.json +0 -269
  511. package/dist/locales/zh/.gitkeep +0 -0
  512. package/dist/locales/zh/cli.json +0 -108
  513. package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts +0 -89
  514. package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.map +0 -1
  515. package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js +0 -226
  516. package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js.map +0 -1
  517. package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts +0 -60
  518. package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.map +0 -1
  519. package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js +0 -201
  520. package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js.map +0 -1
  521. package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts +0 -42
  522. package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.map +0 -1
  523. package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js +0 -123
  524. package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js.map +0 -1
  525. package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts +0 -45
  526. package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.map +0 -1
  527. package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js +0 -132
  528. package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js.map +0 -1
  529. package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts +0 -33
  530. package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts.map +0 -1
  531. package/dist/plugins/specweave/lib/hooks/reflection-parser.js +0 -419
  532. package/dist/plugins/specweave/lib/hooks/reflection-parser.js.map +0 -1
  533. package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts +0 -56
  534. package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.map +0 -1
  535. package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js +0 -239
  536. package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js.map +0 -1
  537. package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts +0 -64
  538. package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts.map +0 -1
  539. package/dist/plugins/specweave/lib/hooks/reflection-storage.js +0 -305
  540. package/dist/plugins/specweave/lib/hooks/reflection-storage.js.map +0 -1
  541. package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts +0 -43
  542. package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts.map +0 -1
  543. package/dist/plugins/specweave/lib/hooks/run-self-reflection.js +0 -203
  544. package/dist/plugins/specweave/lib/hooks/run-self-reflection.js.map +0 -1
  545. package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts +0 -32
  546. package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +0 -1
  547. package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +0 -405
  548. package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +0 -1
  549. package/dist/plugins/specweave/lib/hooks/translate-file.d.ts +0 -59
  550. package/dist/plugins/specweave/lib/hooks/translate-file.d.ts.map +0 -1
  551. package/dist/plugins/specweave/lib/hooks/translate-file.js +0 -350
  552. package/dist/plugins/specweave/lib/hooks/translate-file.js.map +0 -1
  553. package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts +0 -13
  554. package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts.map +0 -1
  555. package/dist/plugins/specweave/lib/hooks/translate-living-docs.js +0 -175
  556. package/dist/plugins/specweave/lib/hooks/translate-living-docs.js.map +0 -1
  557. package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts +0 -164
  558. package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts.map +0 -1
  559. package/dist/plugins/specweave/lib/hooks/types/reflection-types.js +0 -73
  560. package/dist/plugins/specweave/lib/hooks/types/reflection-types.js.map +0 -1
  561. package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts +0 -21
  562. package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts.map +0 -1
  563. package/dist/plugins/specweave/lib/hooks/update-ac-status.js +0 -162
  564. package/dist/plugins/specweave/lib/hooks/update-ac-status.js.map +0 -1
  565. package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts +0 -29
  566. package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts.map +0 -1
  567. package/dist/plugins/specweave/lib/hooks/update-tasks-md.js +0 -203
  568. package/dist/plugins/specweave/lib/hooks/update-tasks-md.js.map +0 -1
  569. package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts +0 -25
  570. package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts.map +0 -1
  571. package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -191
  572. package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js.map +0 -1
  573. package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.d.ts +0 -57
  574. package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.d.ts.map +0 -1
  575. package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.js +0 -248
  576. package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.js.map +0 -1
  577. package/dist/plugins/specweave-kafka/lib/cli/types.d.ts +0 -82
  578. package/dist/plugins/specweave-kafka/lib/cli/types.d.ts.map +0 -1
  579. package/dist/plugins/specweave-kafka/lib/cli/types.js +0 -13
  580. package/dist/plugins/specweave-kafka/lib/cli/types.js.map +0 -1
  581. package/dist/plugins/specweave-kafka/lib/mcp/detector.d.ts +0 -49
  582. package/dist/plugins/specweave-kafka/lib/mcp/detector.d.ts.map +0 -1
  583. package/dist/plugins/specweave-kafka/lib/mcp/detector.js +0 -316
  584. package/dist/plugins/specweave-kafka/lib/mcp/detector.js.map +0 -1
  585. package/dist/plugins/specweave-kafka/lib/mcp/types.d.ts +0 -70
  586. package/dist/plugins/specweave-kafka/lib/mcp/types.d.ts.map +0 -1
  587. package/dist/plugins/specweave-kafka/lib/mcp/types.js +0 -23
  588. package/dist/plugins/specweave-kafka/lib/mcp/types.js.map +0 -1
  589. package/dist/plugins/specweave-kafka/lib/utils/partitioning.d.ts +0 -85
  590. package/dist/plugins/specweave-kafka/lib/utils/partitioning.d.ts.map +0 -1
  591. package/dist/plugins/specweave-kafka/lib/utils/partitioning.js +0 -281
  592. package/dist/plugins/specweave-kafka/lib/utils/partitioning.js.map +0 -1
  593. package/dist/plugins/specweave-kafka/lib/utils/sizing.d.ts +0 -75
  594. package/dist/plugins/specweave-kafka/lib/utils/sizing.d.ts.map +0 -1
  595. package/dist/plugins/specweave-kafka/lib/utils/sizing.js +0 -238
  596. package/dist/plugins/specweave-kafka/lib/utils/sizing.js.map +0 -1
  597. package/dist/spec-parser.js +0 -629
  598. package/dist/src/core/living-docs/spec-distributor.d.ts +0 -180
  599. package/dist/src/core/living-docs/spec-distributor.d.ts.map +0 -1
  600. package/dist/src/core/living-docs/spec-distributor.js +0 -1840
  601. package/dist/src/core/living-docs/spec-distributor.js.map +0 -1
  602. package/dist/src/core/sync/spec-content-sync.d.ts +0 -88
  603. package/dist/src/core/sync/spec-content-sync.d.ts.map +0 -1
  604. package/dist/src/core/sync/spec-content-sync.js +0 -5
  605. package/dist/src/core/sync/spec-content-sync.js.map +0 -1
  606. package/dist/tsconfig.tsbuildinfo +0 -1
  607. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
@@ -1,281 +0,0 @@
1
- /**
2
- * Partitioning Strategy Analyzer
3
- *
4
- * Analyzes partition key distribution and provides recommendations
5
- * for optimal Kafka topic partitioning strategies.
6
- */
7
- export class PartitioningStrategyAnalyzer {
8
- constructor() {
9
- this.MAX_PARTITION_THROUGHPUT_MBPS = 20;
10
- this.MAX_PARTITION_MSG_PER_SEC = 50000;
11
- this.IDEAL_PARTITIONS_PER_CONSUMER = 2;
12
- }
13
- /**
14
- * Analyze partition key candidates and recommend strategy
15
- */
16
- analyze(req) {
17
- const peakMultiplier = req.peakMultiplier ?? 3;
18
- const targetLatency = req.targetLatencyMs ?? 100;
19
- const peakMessagesPerSec = req.expectedMessagesPerSecond * peakMultiplier;
20
- // Analyze each potential key
21
- const keyAnalyses = req.potentialKeys.map(key => this.analyzeKey(key));
22
- // Find best key based on distribution
23
- const bestKey = this.selectBestKey(keyAnalyses, req.orderingRequired);
24
- // Calculate partitions needed based on throughput
25
- let partitionsForThroughput = 1;
26
- if (req.targetThroughputMBps) {
27
- partitionsForThroughput = Math.ceil(req.targetThroughputMBps / this.MAX_PARTITION_THROUGHPUT_MBPS);
28
- }
29
- // Calculate partitions needed based on message rate
30
- const partitionsForMsgRate = Math.ceil(peakMessagesPerSec / this.MAX_PARTITION_MSG_PER_SEC);
31
- // Calculate partitions for consumer parallelism
32
- const partitionsForParallelism = Math.max(4, partitionsForMsgRate * this.IDEAL_PARTITIONS_PER_CONSUMER);
33
- // Take maximum (most constraining)
34
- let recommendedPartitions = Math.max(partitionsForThroughput, partitionsForMsgRate, partitionsForParallelism);
35
- // Round up to nearest power of 2 or multiple of 3 (for rack awareness)
36
- if (recommendedPartitions <= 16) {
37
- recommendedPartitions = this.nextPowerOfTwo(recommendedPartitions);
38
- }
39
- else {
40
- recommendedPartitions = Math.ceil(recommendedPartitions / 12) * 12; // Multiple of 12 (3 racks × 4)
41
- }
42
- // Ensure minimum partitions
43
- recommendedPartitions = Math.max(recommendedPartitions, 3);
44
- // Determine key strategy
45
- const { keyStrategy, keyField, reasoning } = this.determineKeyStrategy(bestKey, req.orderingRequired, recommendedPartitions);
46
- // Generate warnings
47
- const warnings = this.generateWarnings({
48
- bestKey,
49
- recommendedPartitions,
50
- currentPartitionCount: req.currentPartitionCount,
51
- req
52
- });
53
- // Generate usage examples
54
- const examples = this.generateExamples(keyStrategy, keyField, req.topicName);
55
- return {
56
- recommendedPartitions,
57
- keyStrategy,
58
- keyField,
59
- reasoning,
60
- warnings,
61
- examples
62
- };
63
- }
64
- /**
65
- * Analyze a single partition key candidate
66
- */
67
- analyzeKey(key) {
68
- const cardinality = key.estimatedUniqueCount;
69
- const sampleSize = key.sampleValues.length;
70
- // Estimate distribution from sample
71
- const uniqueInSample = new Set(key.sampleValues).size;
72
- const uniquenessRatio = uniqueInSample / sampleSize;
73
- // Classify distribution
74
- let distribution;
75
- if (uniquenessRatio > 0.9) {
76
- distribution = 'uniform'; // Most values are unique
77
- }
78
- else if (uniquenessRatio > 0.5) {
79
- distribution = 'skewed'; // Some duplicate values
80
- }
81
- else {
82
- distribution = 'severely-skewed'; // Many duplicate values
83
- }
84
- // Assess hotspot risk
85
- let hotspotRisk;
86
- if (cardinality > 10000 && distribution === 'uniform') {
87
- hotspotRisk = 'low';
88
- }
89
- else if (cardinality > 1000 && distribution !== 'severely-skewed') {
90
- hotspotRisk = 'medium';
91
- }
92
- else {
93
- hotspotRisk = 'high';
94
- }
95
- return {
96
- key: key.fieldName,
97
- sampleValues: key.sampleValues.slice(0, 5), // Top 5 examples
98
- estimatedCardinality: cardinality,
99
- distribution,
100
- hotspotRisk
101
- };
102
- }
103
- /**
104
- * Select best partition key from candidates
105
- */
106
- selectBestKey(analyses, orderingRequired) {
107
- // Sort by hotspot risk (low is best) and cardinality (high is best)
108
- const sorted = [...analyses].sort((a, b) => {
109
- const riskScore = { low: 0, medium: 1, high: 2 };
110
- const riskDiff = riskScore[a.hotspotRisk] - riskScore[b.hotspotRisk];
111
- if (riskDiff !== 0)
112
- return riskDiff; // Lower risk wins
113
- // If risks equal, higher cardinality wins
114
- return b.estimatedCardinality - a.estimatedCardinality;
115
- });
116
- return sorted[0];
117
- }
118
- /**
119
- * Determine optimal partitioning key strategy
120
- */
121
- determineKeyStrategy(bestKey, orderingRequired, partitionCount) {
122
- // No ordering required and no good key → round-robin
123
- if (!orderingRequired && (!bestKey || bestKey.hotspotRisk === 'high')) {
124
- return {
125
- keyStrategy: 'round-robin',
126
- keyField: null,
127
- reasoning: 'No ordering requirement and no suitable key field. Round-robin provides best load distribution.'
128
- };
129
- }
130
- // Ordering required but bad key → need compound key or custom partitioner
131
- if (orderingRequired && bestKey && bestKey.hotspotRisk === 'high') {
132
- return {
133
- keyStrategy: 'compound-hash',
134
- keyField: bestKey.key,
135
- reasoning: `Ordering required but ${bestKey.key} has high hotspot risk. Use compound key (e.g., ${bestKey.key} + timestamp) to distribute load.`
136
- };
137
- }
138
- // Good key with ordering → simple hash
139
- if (orderingRequired && bestKey && bestKey.hotspotRisk !== 'high') {
140
- return {
141
- keyStrategy: 'simple-hash',
142
- keyField: bestKey.key,
143
- reasoning: `${bestKey.key} has ${bestKey.distribution} distribution with ${bestKey.hotspotRisk} hotspot risk. Use simple hash partitioning.`
144
- };
145
- }
146
- // No ordering, but good key available → can use for locality
147
- if (!orderingRequired && bestKey && bestKey.hotspotRisk === 'low') {
148
- return {
149
- keyStrategy: 'simple-hash',
150
- keyField: bestKey.key,
151
- reasoning: `${bestKey.key} has excellent distribution. Use hash partitioning for data locality even though ordering not required.`
152
- };
153
- }
154
- // Fallback: custom partitioner for complex cases
155
- return {
156
- keyStrategy: 'custom-partitioner',
157
- keyField: bestKey?.key ?? null,
158
- reasoning: 'Complex partitioning requirements. Implement custom partitioner for optimal distribution.'
159
- };
160
- }
161
- /**
162
- * Generate warnings for partitioning strategy
163
- */
164
- generateWarnings(params) {
165
- const warnings = [];
166
- // Hotspot warnings
167
- if (params.bestKey && params.bestKey.hotspotRisk === 'high') {
168
- warnings.push(`⚠️ Best key (${params.bestKey.key}) has HIGH hotspot risk with cardinality ${params.bestKey.estimatedCardinality}. ` +
169
- `Consider compound key or custom partitioner.`);
170
- }
171
- if (params.bestKey && params.bestKey.hotspotRisk === 'medium') {
172
- warnings.push(`⚠️ Key (${params.bestKey.key}) has MEDIUM hotspot risk. Monitor partition distribution in production.`);
173
- }
174
- // Partition count warnings
175
- if (params.currentPartitionCount && params.recommendedPartitions > params.currentPartitionCount) {
176
- warnings.push(`⚠️ Current partition count (${params.currentPartitionCount}) is below recommended (${params.recommendedPartitions}). ` +
177
- `Increasing partitions requires re-creating topic or using partition expansion (Kafka 2.4+).`);
178
- }
179
- if (params.recommendedPartitions > 100) {
180
- warnings.push(`⚠️ Recommended ${params.recommendedPartitions} partitions is high. Ensure cluster can handle this (max ~4000 per broker).`);
181
- }
182
- // Ordering warnings
183
- if (params.req.orderingRequired && !params.bestKey) {
184
- warnings.push(`🚨 CRITICAL: Ordering required but no suitable partition key found. ALL messages will be unordered!`);
185
- }
186
- // Throughput warnings
187
- if (params.req.targetThroughputMBps && params.req.targetThroughputMBps > params.recommendedPartitions * this.MAX_PARTITION_THROUGHPUT_MBPS) {
188
- const neededPartitions = Math.ceil(params.req.targetThroughputMBps / this.MAX_PARTITION_THROUGHPUT_MBPS);
189
- warnings.push(`⚠️ Target throughput (${params.req.targetThroughputMBps} MB/s) requires ${neededPartitions} partitions, ` +
190
- `but recommended only ${params.recommendedPartitions}. Increase partition count.`);
191
- }
192
- return warnings;
193
- }
194
- /**
195
- * Generate usage examples for the recommended strategy
196
- */
197
- generateExamples(keyStrategy, keyField, topicName) {
198
- const examples = [];
199
- switch (keyStrategy) {
200
- case 'simple-hash':
201
- examples.push(`// Producer (JavaScript/Node.js)`, `await producer.send({`, ` topic: '${topicName}',`, ` messages: [{`, ` key: record.${keyField}, // Hash this key`, ` value: JSON.stringify(record)`, ` }]`, `});`, ``, `// Producer (Java)`, `ProducerRecord<String, String> record = new ProducerRecord<>(`, ` "${topicName}",`, ` record.get${this.capitalize(keyField || 'id')}(), // Partition key`, ` jsonValue`, `);`, `producer.send(record);`);
202
- break;
203
- case 'compound-hash':
204
- examples.push(`// Producer (JavaScript/Node.js) - Compound Key`, `const compoundKey = \`\${record.${keyField}}-\${Date.now() % 100}\`; // Add temporal component`, `await producer.send({`, ` topic: '${topicName}',`, ` messages: [{`, ` key: compoundKey,`, ` value: JSON.stringify(record)`, ` }]`, `});`, ``, `// Alternative: Geographic + Entity ID`, `const compoundKey = \`\${record.region}-\${record.${keyField}}\`;`);
205
- break;
206
- case 'custom-partitioner':
207
- examples.push(`// Custom Partitioner (Java)`, `public class CustomPartitioner implements Partitioner {`, ` @Override`, ` public int partition(String topic, Object key, byte[] keyBytes,`, ` Object value, byte[] valueBytes, Cluster cluster) {`, ` int partitionCount = cluster.partitionCountForTopic(topic);`, ` `, ` // Custom logic here`, ` String keyStr = (String) key;`, ` if (keyStr.startsWith("priority-")) {`, ` return 0; // High-priority partition`, ` }`, ` `, ` // Default hashing for others`, ` return Math.abs(keyStr.hashCode()) % (partitionCount - 1) + 1;`, ` }`, `}`, ``, `// Configure producer`, `props.put("partitioner.class", "com.example.CustomPartitioner");`);
208
- break;
209
- case 'round-robin':
210
- examples.push(`// Producer (JavaScript/Node.js) - No Key`, `await producer.send({`, ` topic: '${topicName}',`, ` messages: [{`, ` value: JSON.stringify(record) // No key = round-robin`, ` }]`, `});`, ``, `// Producer (Java)`, `ProducerRecord<String, String> record = new ProducerRecord<>(`, ` "${topicName}",`, ` null, // No key`, ` jsonValue`, `);`, `producer.send(record);`);
211
- break;
212
- }
213
- return examples;
214
- }
215
- /**
216
- * Helper: Next power of 2
217
- */
218
- nextPowerOfTwo(n) {
219
- return Math.pow(2, Math.ceil(Math.log2(n)));
220
- }
221
- /**
222
- * Helper: Capitalize first letter
223
- */
224
- capitalize(str) {
225
- return str.charAt(0).toUpperCase() + str.slice(1);
226
- }
227
- /**
228
- * Calculate partition distribution for a given key
229
- */
230
- calculateDistribution(sampleValues, partitionCount) {
231
- // Simulate Kafka's DefaultPartitioner
232
- const partitionCounts = new Map();
233
- for (const value of sampleValues) {
234
- const hash = this.murmur2Hash(value);
235
- const partition = Math.abs(hash) % partitionCount;
236
- partitionCounts.set(partition, (partitionCounts.get(partition) || 0) + 1);
237
- }
238
- // Convert to array and calculate percentages
239
- const distribution = Array.from(partitionCounts.entries())
240
- .map(([partition, count]) => ({
241
- partition,
242
- count,
243
- percentage: (count / sampleValues.length) * 100
244
- }))
245
- .sort((a, b) => b.count - a.count);
246
- return distribution;
247
- }
248
- /**
249
- * Simple MurmurHash2 implementation (matches Kafka's DefaultPartitioner)
250
- */
251
- murmur2Hash(data) {
252
- const bytes = Buffer.from(data, 'utf-8');
253
- const length = bytes.length;
254
- const seed = 0x9747b28c;
255
- const m = 0x5bd1e995;
256
- const r = 24;
257
- let h = seed ^ length;
258
- for (let i = 0; i + 4 <= length; i += 4) {
259
- let k = bytes.readInt32LE(i);
260
- k = Math.imul(k, m);
261
- k ^= k >>> r;
262
- k = Math.imul(k, m);
263
- h = Math.imul(h, m);
264
- h ^= k;
265
- }
266
- const remaining = length % 4;
267
- if (remaining >= 3)
268
- h ^= bytes[length - 3] << 16;
269
- if (remaining >= 2)
270
- h ^= bytes[length - 2] << 8;
271
- if (remaining >= 1) {
272
- h ^= bytes[length - 1];
273
- h = Math.imul(h, m);
274
- }
275
- h ^= h >>> 13;
276
- h = Math.imul(h, m);
277
- h ^= h >>> 15;
278
- return h;
279
- }
280
- }
281
- //# sourceMappingURL=partitioning.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"partitioning.js","sourceRoot":"","sources":["../../../../../plugins/specweave-kafka/lib/utils/partitioning.ts"],"names":[],"mappings":"AAAA;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,WAAW,CAAC,CAAC,CAAC,CAAC;YAC7B,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACpB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACb,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACpB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACpB,CAAC,IAAI,CAAC,CAAC;QACT,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,CAAC;QAC7B,IAAI,SAAS,IAAI,CAAC;YAAE,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,IAAI,SAAS,IAAI,CAAC;YAAE,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;YACnB,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACvB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtB,CAAC;QAED,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACd,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAEd,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
@@ -1,75 +0,0 @@
1
- /**
2
- * Cluster Sizing Calculator
3
- *
4
- * Calculates optimal Kafka cluster size based on workload requirements.
5
- * Considers throughput, retention, replication, and growth factors.
6
- */
7
- export interface SizingRequirements {
8
- writeThroughputMBps: number;
9
- readThroughputMBps: number;
10
- retentionDays: number;
11
- avgMessageSizeKB: number;
12
- messagesPerDay: number;
13
- replicationFactor: number;
14
- minInsyncReplicas?: number;
15
- topicCount: number;
16
- avgPartitionsPerTopic: number;
17
- growthFactor?: number;
18
- targetCPUUtilization?: number;
19
- targetDiskUtilization?: number;
20
- }
21
- export interface ClusterSizingRecommendation {
22
- brokerCount: number;
23
- totalPartitions: number;
24
- partitionsPerBroker: number;
25
- cpuCores: number;
26
- ramGB: number;
27
- diskGB: number;
28
- networkGbps: number;
29
- estimatedWriteThroughputMBps: number;
30
- estimatedReadThroughputMBps: number;
31
- estimatedLatencyP99Ms: number;
32
- dailyDataVolumeMB: number;
33
- totalStorageRequiredGB: number;
34
- storageWithReplicationGB: number;
35
- warnings: string[];
36
- recommendations: string[];
37
- }
38
- export declare class ClusterSizingCalculator {
39
- private readonly MAX_PARTITIONS_PER_BROKER;
40
- private readonly SINGLE_PARTITION_WRITE_MBPS;
41
- private readonly SINGLE_PARTITION_READ_MBPS;
42
- private readonly NETWORK_OVERHEAD;
43
- private readonly BASE_RAM_GB;
44
- private readonly RAM_PER_PARTITION_MB;
45
- private readonly RAM_PER_REPLICATION_MB;
46
- /**
47
- * Calculate recommended cluster size
48
- */
49
- calculate(req: SizingRequirements): ClusterSizingRecommendation;
50
- /**
51
- * Calculate network bandwidth requirements
52
- */
53
- private calculateNetworkBandwidth;
54
- /**
55
- * Estimate p99 latency based on partition count and disk size
56
- */
57
- private estimateLatency;
58
- /**
59
- * Generate warnings for potential issues
60
- */
61
- private generateWarnings;
62
- /**
63
- * Generate optimization recommendations
64
- */
65
- private generateRecommendations;
66
- /**
67
- * Calculate disk IOPS requirements
68
- */
69
- calculateDiskIOPS(writeThroughputMBps: number, replicationFactor: number): {
70
- readIOPS: number;
71
- writeIOPS: number;
72
- recommendation: string;
73
- };
74
- }
75
- //# sourceMappingURL=sizing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sizing.d.ts","sourceRoot":"","sources":["../../../../../plugins/specweave-kafka/lib/utils/sizing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,kBAAkB;IAEjC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1C,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAK;IAE5C;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,kBAAkB,GAAG,2BAA2B;IAqG/D;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAiBjC;;OAEG;IACH,OAAO,CAAC,eAAe;IAoBvB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAyDxB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IA+D/B;;OAEG;IACH,iBAAiB,CAAC,mBAAmB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG;QACzE,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;KACxB;CAwBF"}
@@ -1,238 +0,0 @@
1
- /**
2
- * Cluster Sizing Calculator
3
- *
4
- * Calculates optimal Kafka cluster size based on workload requirements.
5
- * Considers throughput, retention, replication, and growth factors.
6
- */
7
- export class ClusterSizingCalculator {
8
- constructor() {
9
- // Constants (empirical limits from production deployments)
10
- this.MAX_PARTITIONS_PER_BROKER = 4000;
11
- this.SINGLE_PARTITION_WRITE_MBPS = 20; // Conservative estimate
12
- this.SINGLE_PARTITION_READ_MBPS = 40;
13
- this.NETWORK_OVERHEAD = 1.3; // 30% overhead for protocol, replication
14
- this.BASE_RAM_GB = 8; // Minimum OS + Kafka overhead
15
- this.RAM_PER_PARTITION_MB = 1; // Page cache per partition
16
- this.RAM_PER_REPLICATION_MB = 2; // Replica fetcher overhead
17
- }
18
- /**
19
- * Calculate recommended cluster size
20
- */
21
- calculate(req) {
22
- const growthFactor = req.growthFactor ?? 2.0;
23
- const targetCPU = req.targetCPUUtilization ?? 0.6;
24
- const targetDisk = req.targetDiskUtilization ?? 0.7;
25
- // Apply growth factor to throughput
26
- const writeThru = req.writeThroughputMBps * growthFactor;
27
- const readThru = req.readThroughputMBps * growthFactor;
28
- // Calculate total partitions needed
29
- const totalPartitions = req.topicCount * req.avgPartitionsPerTopic;
30
- // Calculate brokers needed based on throughput
31
- const brokersForWrite = Math.ceil((writeThru * this.NETWORK_OVERHEAD) / (this.SINGLE_PARTITION_WRITE_MBPS * this.MAX_PARTITIONS_PER_BROKER / 10));
32
- const brokersForRead = Math.ceil((readThru * this.NETWORK_OVERHEAD) / (this.SINGLE_PARTITION_READ_MBPS * this.MAX_PARTITIONS_PER_BROKER / 10));
33
- // Calculate brokers needed based on partition count
34
- const brokersForPartitions = Math.ceil(totalPartitions / this.MAX_PARTITIONS_PER_BROKER);
35
- // Take maximum (most constraining factor)
36
- let brokerCount = Math.max(brokersForWrite, brokersForRead, brokersForPartitions);
37
- // Ensure minimum for replication factor
38
- brokerCount = Math.max(brokerCount, req.replicationFactor);
39
- // Ensure broker count allows for rack awareness (multiples of 3)
40
- if (brokerCount > 3 && brokerCount % 3 !== 0) {
41
- brokerCount = Math.ceil(brokerCount / 3) * 3;
42
- }
43
- // Calculate partitions per broker
44
- const partitionsPerBroker = Math.ceil(totalPartitions / brokerCount);
45
- // Calculate daily data volume
46
- const dailyDataVolumeMB = (req.messagesPerDay * req.avgMessageSizeKB) / 1024;
47
- // Calculate total storage needed
48
- const totalStorageGB = (dailyDataVolumeMB * req.retentionDays) / 1024;
49
- const storageWithReplicationGB = totalStorageGB * req.replicationFactor;
50
- // Calculate disk per broker (with headroom)
51
- const diskPerBrokerGB = Math.ceil((storageWithReplicationGB / brokerCount) / targetDisk);
52
- // Calculate RAM per broker
53
- const ramForPartitionsGB = (partitionsPerBroker * this.RAM_PER_PARTITION_MB) / 1024;
54
- const ramForReplicationGB = (partitionsPerBroker * req.replicationFactor * this.RAM_PER_REPLICATION_MB) / 1024;
55
- const ramGB = Math.ceil(this.BASE_RAM_GB + ramForPartitionsGB + ramForReplicationGB);
56
- // Calculate CPU cores (rule: 1 core per 500 partitions + 8 base cores)
57
- const cpuCores = Math.ceil(partitionsPerBroker / 500) + 8;
58
- // Calculate network bandwidth needed
59
- const networkGbps = this.calculateNetworkBandwidth(writeThru, readThru, brokerCount);
60
- // Estimate performance
61
- const estimatedWriteThroughputMBps = brokerCount * this.SINGLE_PARTITION_WRITE_MBPS * (partitionsPerBroker / 10);
62
- const estimatedReadThroughputMBps = brokerCount * this.SINGLE_PARTITION_READ_MBPS * (partitionsPerBroker / 10);
63
- const estimatedLatencyP99Ms = this.estimateLatency(partitionsPerBroker, diskPerBrokerGB);
64
- // Generate warnings
65
- const warnings = this.generateWarnings({
66
- partitionsPerBroker,
67
- brokerCount,
68
- req,
69
- diskPerBrokerGB
70
- });
71
- // Generate recommendations
72
- const recommendations = this.generateRecommendations({
73
- partitionsPerBroker,
74
- brokerCount,
75
- req,
76
- ramGB,
77
- diskPerBrokerGB
78
- });
79
- return {
80
- brokerCount,
81
- totalPartitions,
82
- partitionsPerBroker,
83
- cpuCores,
84
- ramGB,
85
- diskGB: diskPerBrokerGB,
86
- networkGbps,
87
- estimatedWriteThroughputMBps,
88
- estimatedReadThroughputMBps,
89
- estimatedLatencyP99Ms,
90
- dailyDataVolumeMB,
91
- totalStorageRequiredGB: totalStorageGB,
92
- storageWithReplicationGB,
93
- warnings,
94
- recommendations
95
- };
96
- }
97
- /**
98
- * Calculate network bandwidth requirements
99
- */
100
- calculateNetworkBandwidth(writeMBps, readMBps, brokerCount) {
101
- // Each broker handles replication traffic
102
- const replicationTrafficMBps = writeMBps * 2; // Leader + follower writes
103
- const totalTrafficMBps = writeMBps + readMBps + replicationTrafficMBps;
104
- const perBrokerMBps = totalTrafficMBps / brokerCount;
105
- // Convert to Gbps and round up
106
- const gbps = Math.ceil((perBrokerMBps * 8) / 1000);
107
- // Recommend common NIC sizes: 1, 10, 25, 40, 100 Gbps
108
- if (gbps <= 1)
109
- return 1;
110
- if (gbps <= 10)
111
- return 10;
112
- if (gbps <= 25)
113
- return 25;
114
- if (gbps <= 40)
115
- return 40;
116
- return 100;
117
- }
118
- /**
119
- * Estimate p99 latency based on partition count and disk size
120
- */
121
- estimateLatency(partitionsPerBroker, diskGB) {
122
- let latencyMs = 5; // Base latency (network + CPU)
123
- // Add latency for partition count (more partitions = more overhead)
124
- if (partitionsPerBroker > 2000) {
125
- latencyMs += 5;
126
- }
127
- else if (partitionsPerBroker > 1000) {
128
- latencyMs += 2;
129
- }
130
- // Add latency for disk size (larger disks = potential seek time)
131
- if (diskGB > 10000) {
132
- latencyMs += 10; // HDD territory
133
- }
134
- else if (diskGB > 5000) {
135
- latencyMs += 5; // Large SSD
136
- }
137
- return latencyMs;
138
- }
139
- /**
140
- * Generate warnings for potential issues
141
- */
142
- generateWarnings(params) {
143
- const warnings = [];
144
- // Partition count warnings
145
- if (params.partitionsPerBroker > 4000) {
146
- warnings.push(`⚠️ ${params.partitionsPerBroker} partitions per broker exceeds recommended limit (4000). ` +
147
- `Consider increasing broker count to ${Math.ceil(params.req.topicCount * params.req.avgPartitionsPerTopic / 4000)}.`);
148
- }
149
- if (params.partitionsPerBroker < 100) {
150
- warnings.push(`⚠️ ${params.partitionsPerBroker} partitions per broker is very low. ` +
151
- `You may be over-provisioned. Consider reducing to ${Math.max(3, Math.ceil(params.brokerCount / 2))} brokers.`);
152
- }
153
- // Broker count warnings
154
- if (params.brokerCount < params.req.replicationFactor) {
155
- warnings.push(`🚨 CRITICAL: ${params.brokerCount} brokers < replication factor (${params.req.replicationFactor}). ` +
156
- `Minimum required: ${params.req.replicationFactor} brokers.`);
157
- }
158
- if (params.brokerCount === params.req.replicationFactor) {
159
- warnings.push(`⚠️ Broker count equals replication factor. No fault tolerance! ` +
160
- `Increase to at least ${params.req.replicationFactor + 1} brokers.`);
161
- }
162
- // Disk size warnings
163
- if (params.diskPerBrokerGB > 10000) {
164
- warnings.push(`⚠️ ${params.diskPerBrokerGB} GB per broker is very large. ` +
165
- `Consider using HDD for cost savings or increasing broker count to reduce disk per broker.`);
166
- }
167
- // Replication warnings
168
- if (params.req.minInsyncReplicas && params.req.minInsyncReplicas >= params.req.replicationFactor) {
169
- warnings.push(`🚨 CRITICAL: min.insync.replicas (${params.req.minInsyncReplicas}) >= replication.factor (${params.req.replicationFactor}). ` +
170
- `This will cause writes to fail! Set min.insync.replicas to ${params.req.replicationFactor - 1}.`);
171
- }
172
- return warnings;
173
- }
174
- /**
175
- * Generate optimization recommendations
176
- */
177
- generateRecommendations(params) {
178
- const recommendations = [];
179
- // Partition strategy
180
- if (params.req.avgPartitionsPerTopic < 10) {
181
- recommendations.push(`💡 Consider increasing partitions per topic to 12-24 for better parallelism and future growth.`);
182
- }
183
- if (params.req.avgPartitionsPerTopic > 100) {
184
- recommendations.push(`💡 ${params.req.avgPartitionsPerTopic} partitions per topic is high. ` +
185
- `Consider splitting into multiple topics or reducing partition count unless you need extreme parallelism.`);
186
- }
187
- // Hardware recommendations
188
- if (params.diskPerBrokerGB > 5000) {
189
- recommendations.push(`💡 Large disk requirement (${params.diskPerBrokerGB} GB). Consider using tiered storage (Kafka 2.8+) ` +
190
- `to offload old data to S3/Azure Blob/GCS.`);
191
- }
192
- if (params.ramGB > 128) {
193
- recommendations.push(`💡 High RAM requirement (${params.ramGB} GB). Ensure your infrastructure supports this. ` +
194
- `Consider AWS i3en/i4i instances or equivalent.`);
195
- }
196
- // Replication recommendations
197
- if (!params.req.minInsyncReplicas) {
198
- recommendations.push(`💡 Set min.insync.replicas=2 for production (currently not configured). ` +
199
- `This prevents data loss if a broker fails.`);
200
- }
201
- if (params.req.replicationFactor < 3) {
202
- recommendations.push(`💡 Increase replication factor to 3 for production durability (currently ${params.req.replicationFactor}).`);
203
- }
204
- // Broker count recommendations
205
- if (params.brokerCount % 3 !== 0 && params.brokerCount > 3) {
206
- recommendations.push(`💡 Broker count (${params.brokerCount}) is not a multiple of 3. ` +
207
- `Consider using ${Math.ceil(params.brokerCount / 3) * 3} brokers for better rack awareness.`);
208
- }
209
- return recommendations;
210
- }
211
- /**
212
- * Calculate disk IOPS requirements
213
- */
214
- calculateDiskIOPS(writeThroughputMBps, replicationFactor) {
215
- // Assume 4KB blocks
216
- const writeIOPS = (writeThroughputMBps * 1024) / 4;
217
- const replicationWriteIOPS = writeIOPS * (replicationFactor - 1); // Follower writes
218
- const readIOPS = writeIOPS * 0.5; // Conservative (depends on consumer lag)
219
- const totalWriteIOPS = writeIOPS + replicationWriteIOPS;
220
- const totalReadIOPS = readIOPS;
221
- let recommendation = '';
222
- if (totalWriteIOPS > 50000) {
223
- recommendation = 'Use NVMe SSDs (500K+ IOPS)';
224
- }
225
- else if (totalWriteIOPS > 10000) {
226
- recommendation = 'Use Premium SSD (20K-64K IOPS)';
227
- }
228
- else {
229
- recommendation = 'Standard SSD (3K-6K IOPS) sufficient';
230
- }
231
- return {
232
- readIOPS: Math.ceil(totalReadIOPS),
233
- writeIOPS: Math.ceil(totalWriteIOPS),
234
- recommendation
235
- };
236
- }
237
- }
238
- //# sourceMappingURL=sizing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sizing.js","sourceRoot":"","sources":["../../../../../plugins/specweave-kafka/lib/utils/sizing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqDH,MAAM,OAAO,uBAAuB;IAApC;QACE,2DAA2D;QAC1C,8BAAyB,GAAG,IAAI,CAAC;QACjC,gCAA2B,GAAG,EAAE,CAAC,CAAC,wBAAwB;QAC1D,+BAA0B,GAAG,EAAE,CAAC;QAChC,qBAAgB,GAAG,GAAG,CAAC,CAAC,yCAAyC;QAEjE,gBAAW,GAAG,CAAC,CAAC,CAAC,8BAA8B;QAC/C,yBAAoB,GAAG,CAAC,CAAC,CAAC,2BAA2B;QACrD,2BAAsB,GAAG,CAAC,CAAC,CAAC,2BAA2B;IAkT1E,CAAC;IAhTC;;OAEG;IACH,SAAS,CAAC,GAAuB;QAC/B,MAAM,YAAY,GAAG,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC;QAC7C,MAAM,SAAS,GAAG,GAAG,CAAC,oBAAoB,IAAI,GAAG,CAAC;QAClD,MAAM,UAAU,GAAG,GAAG,CAAC,qBAAqB,IAAI,GAAG,CAAC;QAEpD,oCAAoC;QACpC,MAA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