@evolith/smart-cli 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/ARCHITECTURE.md +1 -1
  2. package/LICENSE +21 -0
  3. package/README.es.md +31 -3
  4. package/README.md +906 -170
  5. package/dist/app.module.js +79 -6
  6. package/dist/app.module.js.map +1 -1
  7. package/dist/commands/adr/adr.command.d.ts +7 -3
  8. package/dist/commands/adr/adr.command.js +50 -78
  9. package/dist/commands/adr/adr.command.js.map +1 -1
  10. package/dist/commands/agents/agents.command.d.ts +14 -0
  11. package/dist/commands/agents/agents.command.js +61 -0
  12. package/dist/commands/agents/agents.command.js.map +1 -0
  13. package/dist/commands/agents/index.d.ts +1 -0
  14. package/dist/commands/agents/index.js +6 -0
  15. package/dist/commands/agents/index.js.map +1 -0
  16. package/dist/commands/alias/alias.command.d.ts +16 -0
  17. package/dist/commands/alias/alias.command.js +95 -0
  18. package/dist/commands/alias/alias.command.js.map +1 -0
  19. package/dist/commands/api/api.catalog.d.ts +38 -0
  20. package/dist/commands/api/api.catalog.js +167 -0
  21. package/dist/commands/api/api.catalog.js.map +1 -0
  22. package/dist/commands/api/api.command.d.ts +21 -0
  23. package/dist/commands/api/api.command.js +162 -0
  24. package/dist/commands/api/api.command.js.map +1 -0
  25. package/dist/commands/architecture/scaffold/index.d.ts +2 -0
  26. package/dist/commands/architecture/scaffold/index.js +6 -0
  27. package/dist/commands/architecture/scaffold/index.js.map +1 -0
  28. package/dist/commands/architecture/scaffold/scaffold-strategy.d.ts +15 -0
  29. package/dist/commands/architecture/scaffold/scaffold-strategy.js +20 -0
  30. package/dist/commands/architecture/scaffold/scaffold-strategy.js.map +1 -0
  31. package/dist/commands/architecture/scaffold.command.d.ts +11 -3
  32. package/dist/commands/architecture/scaffold.command.js +194 -57
  33. package/dist/commands/architecture/scaffold.command.js.map +1 -1
  34. package/dist/commands/completion/completion.command.d.ts +12 -4
  35. package/dist/commands/completion/completion.command.js +159 -53
  36. package/dist/commands/completion/completion.command.js.map +1 -1
  37. package/dist/commands/docs/docs.command.d.ts +6 -3
  38. package/dist/commands/docs/docs.command.js +75 -16
  39. package/dist/commands/docs/docs.command.js.map +1 -1
  40. package/dist/commands/drift/drift.command.d.ts +7 -3
  41. package/dist/commands/drift/drift.command.js +82 -49
  42. package/dist/commands/drift/drift.command.js.map +1 -1
  43. package/dist/commands/fixtures/fixtures.command.d.ts +21 -0
  44. package/dist/commands/fixtures/fixtures.command.js +310 -0
  45. package/dist/commands/fixtures/fixtures.command.js.map +1 -0
  46. package/dist/commands/gate/gate.command.d.ts +9 -3
  47. package/dist/commands/gate/gate.command.js +36 -53
  48. package/dist/commands/gate/gate.command.js.map +1 -1
  49. package/dist/commands/history/history.command.d.ts +3 -3
  50. package/dist/commands/history/history.command.js +24 -55
  51. package/dist/commands/history/history.command.js.map +1 -1
  52. package/dist/commands/init/agents.command.d.ts +6 -4
  53. package/dist/commands/init/agents.command.js +142 -314
  54. package/dist/commands/init/agents.command.js.map +1 -1
  55. package/dist/commands/init/init.command.d.ts +9 -3
  56. package/dist/commands/init/init.command.js +39 -198
  57. package/dist/commands/init/init.command.js.map +1 -1
  58. package/dist/commands/init/init.wizard.d.ts +19 -0
  59. package/dist/commands/init/init.wizard.js +181 -0
  60. package/dist/commands/init/init.wizard.js.map +1 -0
  61. package/dist/commands/init/upgrade.command.d.ts +6 -3
  62. package/dist/commands/init/upgrade.command.js +34 -66
  63. package/dist/commands/init/upgrade.command.js.map +1 -1
  64. package/dist/commands/mcp/mcp-serve.command.d.ts +7 -5
  65. package/dist/commands/mcp/mcp-serve.command.js +84 -37
  66. package/dist/commands/mcp/mcp-serve.command.js.map +1 -1
  67. package/dist/commands/phase/phase-advance.command.d.ts +30 -0
  68. package/dist/commands/phase/phase-advance.command.js +206 -0
  69. package/dist/commands/phase/phase-advance.command.js.map +1 -0
  70. package/dist/commands/profile/profile.command.d.ts +18 -0
  71. package/dist/commands/profile/profile.command.js +198 -0
  72. package/dist/commands/profile/profile.command.js.map +1 -0
  73. package/dist/commands/sdlc/gate-status.command.d.ts +6 -3
  74. package/dist/commands/sdlc/gate-status.command.js +54 -81
  75. package/dist/commands/sdlc/gate-status.command.js.map +1 -1
  76. package/dist/commands/sdlc/generate-domain.command.d.ts +4 -3
  77. package/dist/commands/sdlc/generate-domain.command.js +35 -36
  78. package/dist/commands/sdlc/generate-domain.command.js.map +1 -1
  79. package/dist/commands/sdlc/handoff.command.d.ts +9 -4
  80. package/dist/commands/sdlc/handoff.command.js +106 -104
  81. package/dist/commands/sdlc/handoff.command.js.map +1 -1
  82. package/dist/commands/sdlc/sdlc.command.d.ts +4 -3
  83. package/dist/commands/sdlc/sdlc.command.js +17 -43
  84. package/dist/commands/sdlc/sdlc.command.js.map +1 -1
  85. package/dist/commands/standards/standards.command.d.ts +6 -3
  86. package/dist/commands/standards/standards.command.js +52 -77
  87. package/dist/commands/standards/standards.command.js.map +1 -1
  88. package/dist/commands/update/update.command.d.ts +21 -0
  89. package/dist/commands/update/update.command.js +214 -0
  90. package/dist/commands/update/update.command.js.map +1 -0
  91. package/dist/commands/upgrade/index.d.ts +1 -0
  92. package/dist/commands/upgrade/index.js +6 -0
  93. package/dist/commands/upgrade/index.js.map +1 -0
  94. package/dist/commands/upgrade/upgrade.command.d.ts +14 -0
  95. package/dist/commands/upgrade/upgrade.command.js +58 -0
  96. package/dist/commands/upgrade/upgrade.command.js.map +1 -0
  97. package/dist/commands/validate/validate.command.d.ts +22 -4
  98. package/dist/commands/validate/validate.command.js +295 -65
  99. package/dist/commands/validate/validate.command.js.map +1 -1
  100. package/dist/config/alias.service.d.ts +14 -0
  101. package/dist/{core/sync/sync.service.js → config/alias.service.js} +54 -32
  102. package/dist/config/alias.service.js.map +1 -0
  103. package/dist/contributions/contribution-validator.d.ts +16 -0
  104. package/dist/contributions/contribution-validator.js +34 -0
  105. package/dist/contributions/contribution-validator.js.map +1 -0
  106. package/dist/contributions/index.d.ts +1 -0
  107. package/dist/contributions/index.js +6 -0
  108. package/dist/contributions/index.js.map +1 -0
  109. package/dist/{domain/services → infrastructure/adapters}/agent-registry.service.d.ts +6 -2
  110. package/dist/{domain/services → infrastructure/adapters}/agent-registry.service.js +33 -10
  111. package/dist/infrastructure/adapters/agent-registry.service.js.map +1 -0
  112. package/dist/{core → infrastructure}/architecture/nx-workspace.strategy.d.ts +6 -1
  113. package/dist/{core → infrastructure}/architecture/nx-workspace.strategy.js +27 -38
  114. package/dist/infrastructure/architecture/nx-workspace.strategy.js.map +1 -0
  115. package/dist/infrastructure/catalog/catalog-loader.d.ts +1 -2
  116. package/dist/infrastructure/catalog/catalog-loader.js +14 -5
  117. package/dist/infrastructure/catalog/catalog-loader.js.map +1 -1
  118. package/dist/infrastructure/cli/base-command.d.ts +14 -0
  119. package/dist/infrastructure/cli/base-command.js +41 -0
  120. package/dist/infrastructure/cli/base-command.js.map +1 -0
  121. package/dist/infrastructure/cli/command-executor.d.ts +1 -1
  122. package/dist/infrastructure/cli/command-executor.js +4 -3
  123. package/dist/infrastructure/cli/command-executor.js.map +1 -1
  124. package/dist/infrastructure/config/config.service.d.ts +34 -0
  125. package/dist/infrastructure/config/config.service.js +126 -0
  126. package/dist/infrastructure/config/config.service.js.map +1 -0
  127. package/dist/infrastructure/filesystem/file-manager.service.d.ts +12 -0
  128. package/dist/{core → infrastructure}/filesystem/file-manager.service.js +8 -25
  129. package/dist/infrastructure/filesystem/file-manager.service.js.map +1 -0
  130. package/dist/infrastructure/formatters/output-formatter.service.js +2 -1
  131. package/dist/infrastructure/formatters/output-formatter.service.js.map +1 -1
  132. package/dist/{core → infrastructure}/observability/command-watcher.js +31 -0
  133. package/dist/infrastructure/observability/command-watcher.js.map +1 -0
  134. package/dist/{core → infrastructure}/observability/error-reporter.js +5 -5
  135. package/dist/infrastructure/observability/error-reporter.js.map +1 -0
  136. package/dist/infrastructure/observability/index.d.ts +11 -0
  137. package/dist/{core → infrastructure}/observability/index.js +6 -1
  138. package/dist/infrastructure/observability/index.js.map +1 -0
  139. package/dist/infrastructure/observability/otel-tracing.d.ts +4 -0
  140. package/dist/infrastructure/observability/otel-tracing.js +34 -0
  141. package/dist/infrastructure/observability/otel-tracing.js.map +1 -0
  142. package/dist/infrastructure/observability/structured-logger.js.map +1 -0
  143. package/dist/infrastructure/observability/timing.js.map +1 -0
  144. package/dist/infrastructure/observability/tool-usage-telemetry.service.js.map +1 -0
  145. package/dist/infrastructure/plugins/plugin-loader.d.ts +10 -0
  146. package/dist/infrastructure/plugins/plugin-loader.js +145 -0
  147. package/dist/infrastructure/plugins/plugin-loader.js.map +1 -0
  148. package/dist/infrastructure/plugins/plugin.module.d.ts +4 -0
  149. package/dist/infrastructure/plugins/plugin.module.js +28 -0
  150. package/dist/infrastructure/plugins/plugin.module.js.map +1 -0
  151. package/dist/infrastructure/prompts/init-prompt-group.d.ts +3 -0
  152. package/dist/infrastructure/prompts/init-prompt-group.js +115 -0
  153. package/dist/infrastructure/prompts/init-prompt-group.js.map +1 -0
  154. package/dist/infrastructure/prompts/init-prompt-options.d.ts +10 -0
  155. package/dist/infrastructure/prompts/init-prompt-options.js +40 -0
  156. package/dist/infrastructure/prompts/init-prompt-options.js.map +1 -0
  157. package/dist/infrastructure/prompts/progress.service.d.ts +24 -0
  158. package/dist/infrastructure/prompts/progress.service.js +180 -0
  159. package/dist/infrastructure/prompts/progress.service.js.map +1 -0
  160. package/dist/infrastructure/prompts/prompt.service.d.ts +42 -0
  161. package/dist/infrastructure/prompts/prompt.service.js +142 -0
  162. package/dist/infrastructure/prompts/prompt.service.js.map +1 -0
  163. package/dist/infrastructure/prompts/wizard.service.d.ts +27 -0
  164. package/dist/infrastructure/prompts/wizard.service.js +163 -0
  165. package/dist/infrastructure/prompts/wizard.service.js.map +1 -0
  166. package/dist/{core/abstractions → infrastructure}/providers/config-parser.provider.d.ts +1 -1
  167. package/dist/infrastructure/providers/config-parser.provider.js.map +1 -0
  168. package/dist/{core/abstractions → infrastructure}/providers/logger.provider.d.ts +1 -1
  169. package/dist/infrastructure/providers/logger.provider.js.map +1 -0
  170. package/dist/{core/abstractions → infrastructure}/providers/mock-filesystem.provider.d.ts +5 -2
  171. package/dist/{core/abstractions → infrastructure}/providers/mock-filesystem.provider.js +4 -1
  172. package/dist/infrastructure/providers/mock-filesystem.provider.js.map +1 -0
  173. package/dist/{core/abstractions → infrastructure}/providers/node-filesystem.provider.d.ts +5 -2
  174. package/dist/{core/abstractions → infrastructure}/providers/node-filesystem.provider.js +9 -0
  175. package/dist/infrastructure/providers/node-filesystem.provider.js.map +1 -0
  176. package/dist/main.js +18 -1
  177. package/dist/main.js.map +1 -1
  178. package/dist/plugins/index.d.ts +1 -0
  179. package/dist/plugins/index.js +6 -0
  180. package/dist/plugins/index.js.map +1 -0
  181. package/dist/plugins/plugin-registry.d.ts +22 -0
  182. package/dist/plugins/plugin-registry.js +33 -0
  183. package/dist/plugins/plugin-registry.js.map +1 -0
  184. package/package.json +50 -41
  185. package/shell/hooks.bash +68 -0
  186. package/shell/hooks.fish +57 -0
  187. package/shell/hooks.zsh +68 -0
  188. package/dist/app.module.spec.d.ts +0 -1
  189. package/dist/app.module.spec.js +0 -305
  190. package/dist/app.module.spec.js.map +0 -1
  191. package/dist/application/ports/webhook-notifier.port.d.ts +0 -4
  192. package/dist/application/ports/webhook-notifier.port.js +0 -3
  193. package/dist/application/ports/webhook-notifier.port.js.map +0 -1
  194. package/dist/application/services/index.d.ts +0 -64
  195. package/dist/application/services/index.js +0 -371
  196. package/dist/application/services/index.js.map +0 -1
  197. package/dist/application/services/initialize-project.spec.d.ts +0 -1
  198. package/dist/application/services/initialize-project.spec.js +0 -211
  199. package/dist/application/services/initialize-project.spec.js.map +0 -1
  200. package/dist/application/services/phase-transition.use-case.spec.d.ts +0 -1
  201. package/dist/application/services/phase-transition.use-case.spec.js +0 -297
  202. package/dist/application/services/phase-transition.use-case.spec.js.map +0 -1
  203. package/dist/application/services/services.test.d.ts +0 -1
  204. package/dist/application/services/services.test.js +0 -176
  205. package/dist/application/services/services.test.js.map +0 -1
  206. package/dist/application/use-cases/evaluate-gate.use-case.d.ts +0 -20
  207. package/dist/application/use-cases/evaluate-gate.use-case.js +0 -72
  208. package/dist/application/use-cases/evaluate-gate.use-case.js.map +0 -1
  209. package/dist/application/use-cases/validate-satellite.use-case.d.ts +0 -19
  210. package/dist/application/use-cases/validate-satellite.use-case.js +0 -96
  211. package/dist/application/use-cases/validate-satellite.use-case.js.map +0 -1
  212. package/dist/application/use-cases/validate-satellite.use-case.spec.d.ts +0 -1
  213. package/dist/application/use-cases/validate-satellite.use-case.spec.js +0 -102
  214. package/dist/application/use-cases/validate-satellite.use-case.spec.js.map +0 -1
  215. package/dist/commands/adr/adr.command.spec.d.ts +0 -1
  216. package/dist/commands/adr/adr.command.spec.js +0 -409
  217. package/dist/commands/adr/adr.command.spec.js.map +0 -1
  218. package/dist/commands/architecture/scaffold.command.spec.d.ts +0 -1
  219. package/dist/commands/architecture/scaffold.command.spec.js +0 -207
  220. package/dist/commands/architecture/scaffold.command.spec.js.map +0 -1
  221. package/dist/commands/commands.test.d.ts +0 -1
  222. package/dist/commands/commands.test.js +0 -131
  223. package/dist/commands/commands.test.js.map +0 -1
  224. package/dist/commands/completion/completion.command.spec.d.ts +0 -1
  225. package/dist/commands/completion/completion.command.spec.js +0 -240
  226. package/dist/commands/completion/completion.command.spec.js.map +0 -1
  227. package/dist/commands/docs/docs.command.spec.d.ts +0 -1
  228. package/dist/commands/docs/docs.command.spec.js +0 -87
  229. package/dist/commands/docs/docs.command.spec.js.map +0 -1
  230. package/dist/commands/drift/drift.command.spec.d.ts +0 -1
  231. package/dist/commands/drift/drift.command.spec.js +0 -327
  232. package/dist/commands/drift/drift.command.spec.js.map +0 -1
  233. package/dist/commands/history/history.command.spec.d.ts +0 -1
  234. package/dist/commands/history/history.command.spec.js +0 -392
  235. package/dist/commands/history/history.command.spec.js.map +0 -1
  236. package/dist/commands/init/agents.command.spec.d.ts +0 -1
  237. package/dist/commands/init/agents.command.spec.js +0 -550
  238. package/dist/commands/init/agents.command.spec.js.map +0 -1
  239. package/dist/commands/init/init.command.spec.d.ts +0 -1
  240. package/dist/commands/init/init.command.spec.js +0 -272
  241. package/dist/commands/init/init.command.spec.js.map +0 -1
  242. package/dist/commands/init/upgrade.command.spec.d.ts +0 -1
  243. package/dist/commands/init/upgrade.command.spec.js +0 -378
  244. package/dist/commands/init/upgrade.command.spec.js.map +0 -1
  245. package/dist/commands/mcp/mcp-serve.command.spec.d.ts +0 -1
  246. package/dist/commands/mcp/mcp-serve.command.spec.js +0 -58
  247. package/dist/commands/mcp/mcp-serve.command.spec.js.map +0 -1
  248. package/dist/commands/sdlc/gate-status.command.spec.d.ts +0 -1
  249. package/dist/commands/sdlc/gate-status.command.spec.js +0 -302
  250. package/dist/commands/sdlc/gate-status.command.spec.js.map +0 -1
  251. package/dist/commands/sdlc/generate-domain.command.spec.d.ts +0 -1
  252. package/dist/commands/sdlc/generate-domain.command.spec.js +0 -121
  253. package/dist/commands/sdlc/generate-domain.command.spec.js.map +0 -1
  254. package/dist/commands/sdlc/handoff.command.spec.d.ts +0 -1
  255. package/dist/commands/sdlc/handoff.command.spec.js +0 -395
  256. package/dist/commands/sdlc/handoff.command.spec.js.map +0 -1
  257. package/dist/commands/sdlc/sdlc.command.spec.d.ts +0 -1
  258. package/dist/commands/sdlc/sdlc.command.spec.js +0 -79
  259. package/dist/commands/sdlc/sdlc.command.spec.js.map +0 -1
  260. package/dist/commands/standards/standards.command.spec.d.ts +0 -1
  261. package/dist/commands/standards/standards.command.spec.js +0 -311
  262. package/dist/commands/standards/standards.command.spec.js.map +0 -1
  263. package/dist/commands/validate/validate.command.spec.d.ts +0 -1
  264. package/dist/commands/validate/validate.command.spec.js +0 -368
  265. package/dist/commands/validate/validate.command.spec.js.map +0 -1
  266. package/dist/config/runtimes.json +0 -196
  267. package/dist/config/tool-catalog.json +0 -343
  268. package/dist/core/abstractions/index.d.ts +0 -6
  269. package/dist/core/abstractions/index.js +0 -23
  270. package/dist/core/abstractions/index.js.map +0 -1
  271. package/dist/core/abstractions/interfaces.d.ts +0 -61
  272. package/dist/core/abstractions/interfaces.js +0 -5
  273. package/dist/core/abstractions/interfaces.js.map +0 -1
  274. package/dist/core/abstractions/providers/config-parser.provider.js.map +0 -1
  275. package/dist/core/abstractions/providers/config-parser.provider.spec.d.ts +0 -1
  276. package/dist/core/abstractions/providers/config-parser.provider.spec.js +0 -18
  277. package/dist/core/abstractions/providers/config-parser.provider.spec.js.map +0 -1
  278. package/dist/core/abstractions/providers/logger.provider.js.map +0 -1
  279. package/dist/core/abstractions/providers/logger.provider.spec.d.ts +0 -1
  280. package/dist/core/abstractions/providers/logger.provider.spec.js +0 -212
  281. package/dist/core/abstractions/providers/logger.provider.spec.js.map +0 -1
  282. package/dist/core/abstractions/providers/mock-filesystem.provider.js.map +0 -1
  283. package/dist/core/abstractions/providers/mock-filesystem.provider.spec.d.ts +0 -1
  284. package/dist/core/abstractions/providers/mock-filesystem.provider.spec.js +0 -56
  285. package/dist/core/abstractions/providers/mock-filesystem.provider.spec.js.map +0 -1
  286. package/dist/core/abstractions/providers/node-filesystem.provider.js.map +0 -1
  287. package/dist/core/agents/agent-ruleset-builder.d.ts +0 -30
  288. package/dist/core/agents/agent-ruleset-builder.js +0 -75
  289. package/dist/core/agents/agent-ruleset-builder.js.map +0 -1
  290. package/dist/core/agents/agent-ruleset-builder.spec.d.ts +0 -1
  291. package/dist/core/agents/agent-ruleset-builder.spec.js +0 -135
  292. package/dist/core/agents/agent-ruleset-builder.spec.js.map +0 -1
  293. package/dist/core/architecture/nx-workspace.strategy.js.map +0 -1
  294. package/dist/core/architecture/nx-workspace.strategy.spec.d.ts +0 -1
  295. package/dist/core/architecture/nx-workspace.strategy.spec.js +0 -187
  296. package/dist/core/architecture/nx-workspace.strategy.spec.js.map +0 -1
  297. package/dist/core/architecture/workspace-manager.strategy.d.ts +0 -8
  298. package/dist/core/architecture/workspace-manager.strategy.js +0 -3
  299. package/dist/core/architecture/workspace-manager.strategy.js.map +0 -1
  300. package/dist/core/config/config.service.d.ts +0 -15
  301. package/dist/core/config/config.service.js +0 -55
  302. package/dist/core/config/config.service.js.map +0 -1
  303. package/dist/core/config/config.service.spec.d.ts +0 -1
  304. package/dist/core/config/config.service.spec.js +0 -43
  305. package/dist/core/config/config.service.spec.js.map +0 -1
  306. package/dist/core/di/container.d.ts +0 -25
  307. package/dist/core/di/container.js +0 -87
  308. package/dist/core/di/container.js.map +0 -1
  309. package/dist/core/di/container.spec.d.ts +0 -1
  310. package/dist/core/di/container.spec.js +0 -301
  311. package/dist/core/di/container.spec.js.map +0 -1
  312. package/dist/core/errors/index.d.ts +0 -26
  313. package/dist/core/errors/index.js +0 -67
  314. package/dist/core/errors/index.js.map +0 -1
  315. package/dist/core/filesystem/file-manager.service.d.ts +0 -4
  316. package/dist/core/filesystem/file-manager.service.js.map +0 -1
  317. package/dist/core/filesystem/file-manager.service.spec.d.ts +0 -1
  318. package/dist/core/filesystem/file-manager.service.spec.js +0 -103
  319. package/dist/core/filesystem/file-manager.service.spec.js.map +0 -1
  320. package/dist/core/generators/hexagonal-scaffolder.d.ts +0 -6
  321. package/dist/core/generators/hexagonal-scaffolder.js +0 -260
  322. package/dist/core/generators/hexagonal-scaffolder.js.map +0 -1
  323. package/dist/core/generators/hexagonal-scaffolder.spec.d.ts +0 -1
  324. package/dist/core/generators/hexagonal-scaffolder.spec.js +0 -164
  325. package/dist/core/generators/hexagonal-scaffolder.spec.js.map +0 -1
  326. package/dist/core/generators/mermaid-class-parser.d.ts +0 -38
  327. package/dist/core/generators/mermaid-class-parser.js +0 -183
  328. package/dist/core/generators/mermaid-class-parser.js.map +0 -1
  329. package/dist/core/generators/mermaid-class-parser.spec.d.ts +0 -1
  330. package/dist/core/generators/mermaid-class-parser.spec.js +0 -148
  331. package/dist/core/generators/mermaid-class-parser.spec.js.map +0 -1
  332. package/dist/core/mcp/mcp-server.service.d.ts +0 -7
  333. package/dist/core/mcp/mcp-server.service.js +0 -31
  334. package/dist/core/mcp/mcp-server.service.js.map +0 -1
  335. package/dist/core/mcp/metrics.service.d.ts +0 -37
  336. package/dist/core/mcp/metrics.service.js +0 -72
  337. package/dist/core/mcp/metrics.service.js.map +0 -1
  338. package/dist/core/mcp/metrics.service.spec.d.ts +0 -1
  339. package/dist/core/mcp/metrics.service.spec.js +0 -159
  340. package/dist/core/mcp/metrics.service.spec.js.map +0 -1
  341. package/dist/core/mcp/prompts/index.d.ts +0 -22
  342. package/dist/core/mcp/prompts/index.js +0 -211
  343. package/dist/core/mcp/prompts/index.js.map +0 -1
  344. package/dist/core/mcp/prompts/index.spec.d.ts +0 -1
  345. package/dist/core/mcp/prompts/index.spec.js +0 -150
  346. package/dist/core/mcp/prompts/index.spec.js.map +0 -1
  347. package/dist/core/mcp/resources/index.d.ts +0 -11
  348. package/dist/core/mcp/resources/index.js +0 -209
  349. package/dist/core/mcp/resources/index.js.map +0 -1
  350. package/dist/core/mcp/resources/index.spec.d.ts +0 -1
  351. package/dist/core/mcp/resources/index.spec.js +0 -212
  352. package/dist/core/mcp/resources/index.spec.js.map +0 -1
  353. package/dist/core/mcp/server.d.ts +0 -33
  354. package/dist/core/mcp/server.js +0 -693
  355. package/dist/core/mcp/server.js.map +0 -1
  356. package/dist/core/mcp/server.spec.d.ts +0 -1
  357. package/dist/core/mcp/server.spec.js +0 -579
  358. package/dist/core/mcp/server.spec.js.map +0 -1
  359. package/dist/core/mcp/tools/agent.d.ts +0 -41
  360. package/dist/core/mcp/tools/agent.js +0 -195
  361. package/dist/core/mcp/tools/agent.js.map +0 -1
  362. package/dist/core/mcp/tools/agent.spec.d.ts +0 -1
  363. package/dist/core/mcp/tools/agent.spec.js +0 -171
  364. package/dist/core/mcp/tools/agent.spec.js.map +0 -1
  365. package/dist/core/mcp/tools/architecture.d.ts +0 -29
  366. package/dist/core/mcp/tools/architecture.js +0 -234
  367. package/dist/core/mcp/tools/architecture.js.map +0 -1
  368. package/dist/core/mcp/tools/architecture.spec.d.ts +0 -1
  369. package/dist/core/mcp/tools/architecture.spec.js +0 -145
  370. package/dist/core/mcp/tools/architecture.spec.js.map +0 -1
  371. package/dist/core/mcp/tools/gate.d.ts +0 -1
  372. package/dist/core/mcp/tools/gate.js +0 -68
  373. package/dist/core/mcp/tools/gate.js.map +0 -1
  374. package/dist/core/mcp/tools/moscow.d.ts +0 -30
  375. package/dist/core/mcp/tools/moscow.js +0 -113
  376. package/dist/core/mcp/tools/moscow.js.map +0 -1
  377. package/dist/core/mcp/tools/moscow.spec.d.ts +0 -1
  378. package/dist/core/mcp/tools/moscow.spec.js +0 -209
  379. package/dist/core/mcp/tools/moscow.spec.js.map +0 -1
  380. package/dist/core/mcp/tools/sdlc.d.ts +0 -32
  381. package/dist/core/mcp/tools/sdlc.js +0 -190
  382. package/dist/core/mcp/tools/sdlc.js.map +0 -1
  383. package/dist/core/mcp/tools/sdlc.spec.d.ts +0 -1
  384. package/dist/core/mcp/tools/sdlc.spec.js +0 -170
  385. package/dist/core/mcp/tools/sdlc.spec.js.map +0 -1
  386. package/dist/core/mcp/tools/tool-utils.d.ts +0 -4
  387. package/dist/core/mcp/tools/tool-utils.js +0 -18
  388. package/dist/core/mcp/tools/tool-utils.js.map +0 -1
  389. package/dist/core/mcp/tools/validate.d.ts +0 -18
  390. package/dist/core/mcp/tools/validate.js +0 -56
  391. package/dist/core/mcp/tools/validate.js.map +0 -1
  392. package/dist/core/mcp/tools/validate.spec.d.ts +0 -1
  393. package/dist/core/mcp/tools/validate.spec.js +0 -130
  394. package/dist/core/mcp/tools/validate.spec.js.map +0 -1
  395. package/dist/core/mcp/watcher.service.d.ts +0 -8
  396. package/dist/core/mcp/watcher.service.js +0 -82
  397. package/dist/core/mcp/watcher.service.js.map +0 -1
  398. package/dist/core/mcp/watcher.service.spec.d.ts +0 -1
  399. package/dist/core/mcp/watcher.service.spec.js +0 -171
  400. package/dist/core/mcp/watcher.service.spec.js.map +0 -1
  401. package/dist/core/metrics/dora-calculator.d.ts +0 -18
  402. package/dist/core/metrics/dora-calculator.js +0 -146
  403. package/dist/core/metrics/dora-calculator.js.map +0 -1
  404. package/dist/core/metrics/dora-calculator.spec.d.ts +0 -1
  405. package/dist/core/metrics/dora-calculator.spec.js +0 -164
  406. package/dist/core/metrics/dora-calculator.spec.js.map +0 -1
  407. package/dist/core/metrics/git-log-reader.d.ts +0 -14
  408. package/dist/core/metrics/git-log-reader.js +0 -39
  409. package/dist/core/metrics/git-log-reader.js.map +0 -1
  410. package/dist/core/metrics/git-log-reader.spec.d.ts +0 -1
  411. package/dist/core/metrics/git-log-reader.spec.js +0 -108
  412. package/dist/core/metrics/git-log-reader.spec.js.map +0 -1
  413. package/dist/core/observability/command-watcher.js.map +0 -1
  414. package/dist/core/observability/command-watcher.spec.d.ts +0 -1
  415. package/dist/core/observability/command-watcher.spec.js +0 -123
  416. package/dist/core/observability/command-watcher.spec.js.map +0 -1
  417. package/dist/core/observability/error-reporter.js.map +0 -1
  418. package/dist/core/observability/error-reporter.spec.d.ts +0 -1
  419. package/dist/core/observability/error-reporter.spec.js +0 -291
  420. package/dist/core/observability/error-reporter.spec.js.map +0 -1
  421. package/dist/core/observability/index.d.ts +0 -5
  422. package/dist/core/observability/index.js.map +0 -1
  423. package/dist/core/observability/observability.test.d.ts +0 -1
  424. package/dist/core/observability/observability.test.js +0 -224
  425. package/dist/core/observability/observability.test.js.map +0 -1
  426. package/dist/core/observability/structured-logger.js.map +0 -1
  427. package/dist/core/observability/structured-logger.spec.d.ts +0 -1
  428. package/dist/core/observability/structured-logger.spec.js +0 -197
  429. package/dist/core/observability/structured-logger.spec.js.map +0 -1
  430. package/dist/core/observability/timing.js.map +0 -1
  431. package/dist/core/observability/timing.spec.d.ts +0 -1
  432. package/dist/core/observability/timing.spec.js +0 -216
  433. package/dist/core/observability/timing.spec.js.map +0 -1
  434. package/dist/core/observability/tool-usage-telemetry.service.js.map +0 -1
  435. package/dist/core/services/command-executor.service.d.ts +0 -3
  436. package/dist/core/services/command-executor.service.js +0 -12
  437. package/dist/core/services/command-executor.service.js.map +0 -1
  438. package/dist/core/services/command-history.service.d.ts +0 -39
  439. package/dist/core/services/command-history.service.js +0 -150
  440. package/dist/core/services/command-history.service.js.map +0 -1
  441. package/dist/core/services/command-history.service.spec.d.ts +0 -1
  442. package/dist/core/services/command-history.service.spec.js +0 -257
  443. package/dist/core/services/command-history.service.spec.js.map +0 -1
  444. package/dist/core/services/command-providers.d.ts +0 -1
  445. package/dist/core/services/command-providers.js +0 -17
  446. package/dist/core/services/command-providers.js.map +0 -1
  447. package/dist/core/services/runtime-catalog.service.d.ts +0 -2
  448. package/dist/core/services/runtime-catalog.service.js +0 -7
  449. package/dist/core/services/runtime-catalog.service.js.map +0 -1
  450. package/dist/core/sync/sync.service.d.ts +0 -4
  451. package/dist/core/sync/sync.service.js.map +0 -1
  452. package/dist/core/sync/sync.service.spec.d.ts +0 -1
  453. package/dist/core/sync/sync.service.spec.js +0 -63
  454. package/dist/core/sync/sync.service.spec.js.map +0 -1
  455. package/dist/core/upgrade/satellite-upgrade.service.d.ts +0 -48
  456. package/dist/core/upgrade/satellite-upgrade.service.js +0 -358
  457. package/dist/core/upgrade/satellite-upgrade.service.js.map +0 -1
  458. package/dist/core/upgrade/satellite-upgrade.service.spec.d.ts +0 -1
  459. package/dist/core/upgrade/satellite-upgrade.service.spec.js +0 -223
  460. package/dist/core/upgrade/satellite-upgrade.service.spec.js.map +0 -1
  461. package/dist/core/validators/architecture-drift.service.d.ts +0 -68
  462. package/dist/core/validators/architecture-drift.service.js +0 -266
  463. package/dist/core/validators/architecture-drift.service.js.map +0 -1
  464. package/dist/core/validators/architecture-drift.service.spec.d.ts +0 -1
  465. package/dist/core/validators/architecture-drift.service.spec.js +0 -315
  466. package/dist/core/validators/architecture-drift.service.spec.js.map +0 -1
  467. package/dist/core/validators/deep-architecture-analyzer.d.ts +0 -58
  468. package/dist/core/validators/deep-architecture-analyzer.js +0 -333
  469. package/dist/core/validators/deep-architecture-analyzer.js.map +0 -1
  470. package/dist/core/validators/deep-architecture-analyzer.spec.d.ts +0 -1
  471. package/dist/core/validators/deep-architecture-analyzer.spec.js +0 -186
  472. package/dist/core/validators/deep-architecture-analyzer.spec.js.map +0 -1
  473. package/dist/core/validators/evaluators/evaluator.interface.d.ts +0 -14
  474. package/dist/core/validators/evaluators/evaluator.interface.js +0 -3
  475. package/dist/core/validators/evaluators/evaluator.interface.js.map +0 -1
  476. package/dist/core/validators/evaluators/native-evaluator.d.ts +0 -31
  477. package/dist/core/validators/evaluators/native-evaluator.js +0 -461
  478. package/dist/core/validators/evaluators/native-evaluator.js.map +0 -1
  479. package/dist/core/validators/evaluators/opa-evaluator.d.ts +0 -20
  480. package/dist/core/validators/evaluators/opa-evaluator.js +0 -249
  481. package/dist/core/validators/evaluators/opa-evaluator.js.map +0 -1
  482. package/dist/core/validators/phase-gate-validator.service.d.ts +0 -75
  483. package/dist/core/validators/phase-gate-validator.service.js +0 -338
  484. package/dist/core/validators/phase-gate-validator.service.js.map +0 -1
  485. package/dist/core/validators/phase-gate-validator.service.spec.d.ts +0 -1
  486. package/dist/core/validators/phase-gate-validator.service.spec.js +0 -326
  487. package/dist/core/validators/phase-gate-validator.service.spec.js.map +0 -1
  488. package/dist/core/validators/rule-evaluation-engine.d.ts +0 -34
  489. package/dist/core/validators/rule-evaluation-engine.js +0 -187
  490. package/dist/core/validators/rule-evaluation-engine.js.map +0 -1
  491. package/dist/core/validators/rule-evaluation-engine.spec.d.ts +0 -1
  492. package/dist/core/validators/rule-evaluation-engine.spec.js +0 -243
  493. package/dist/core/validators/rule-evaluation-engine.spec.js.map +0 -1
  494. package/dist/core/validators/ruleset-validator-architecture.spec.d.ts +0 -1
  495. package/dist/core/validators/ruleset-validator-architecture.spec.js +0 -178
  496. package/dist/core/validators/ruleset-validator-architecture.spec.js.map +0 -1
  497. package/dist/core/validators/ruleset-validator.service.d.ts +0 -82
  498. package/dist/core/validators/ruleset-validator.service.js +0 -682
  499. package/dist/core/validators/ruleset-validator.service.js.map +0 -1
  500. package/dist/core/validators/ruleset-validator.service.spec.d.ts +0 -1
  501. package/dist/core/validators/ruleset-validator.service.spec.js +0 -469
  502. package/dist/core/validators/ruleset-validator.service.spec.js.map +0 -1
  503. package/dist/domain/entities/index.d.ts +0 -72
  504. package/dist/domain/entities/index.js +0 -119
  505. package/dist/domain/entities/index.js.map +0 -1
  506. package/dist/domain/gate-evidence.d.ts +0 -59
  507. package/dist/domain/gate-evidence.js +0 -38
  508. package/dist/domain/gate-evidence.js.map +0 -1
  509. package/dist/domain/interfaces.d.ts +0 -224
  510. package/dist/domain/interfaces.js +0 -3
  511. package/dist/domain/interfaces.js.map +0 -1
  512. package/dist/domain/services/adr.service.d.ts +0 -50
  513. package/dist/domain/services/adr.service.js +0 -129
  514. package/dist/domain/services/adr.service.js.map +0 -1
  515. package/dist/domain/services/adr.service.spec.d.ts +0 -1
  516. package/dist/domain/services/adr.service.spec.js +0 -141
  517. package/dist/domain/services/adr.service.spec.js.map +0 -1
  518. package/dist/domain/services/agent-registry.service.js.map +0 -1
  519. package/dist/domain/services/agent-registry.service.spec.d.ts +0 -1
  520. package/dist/domain/services/agent-registry.service.spec.js +0 -162
  521. package/dist/domain/services/agent-registry.service.spec.js.map +0 -1
  522. package/dist/domain/services/index.d.ts +0 -34
  523. package/dist/domain/services/index.js +0 -128
  524. package/dist/domain/services/index.js.map +0 -1
  525. package/dist/domain/services/moscow-prioritization.service.d.ts +0 -44
  526. package/dist/domain/services/moscow-prioritization.service.js +0 -213
  527. package/dist/domain/services/moscow-prioritization.service.js.map +0 -1
  528. package/dist/domain/services/moscow-prioritization.service.spec.d.ts +0 -1
  529. package/dist/domain/services/moscow-prioritization.service.spec.js +0 -285
  530. package/dist/domain/services/moscow-prioritization.service.spec.js.map +0 -1
  531. package/dist/domain/services/services.test.d.ts +0 -1
  532. package/dist/domain/services/services.test.js +0 -236
  533. package/dist/domain/services/services.test.js.map +0 -1
  534. package/dist/domain/services/standards.service.d.ts +0 -47
  535. package/dist/domain/services/standards.service.js +0 -129
  536. package/dist/domain/services/standards.service.js.map +0 -1
  537. package/dist/domain/services/standards.service.spec.d.ts +0 -1
  538. package/dist/domain/services/standards.service.spec.js +0 -600
  539. package/dist/domain/services/standards.service.spec.js.map +0 -1
  540. package/dist/domain/services/tool-usage-telemetry.service.d.ts +0 -46
  541. package/dist/domain/services/tool-usage-telemetry.service.js +0 -181
  542. package/dist/domain/services/tool-usage-telemetry.service.js.map +0 -1
  543. package/dist/domain/services/tool-usage-telemetry.service.spec.d.ts +0 -1
  544. package/dist/domain/services/tool-usage-telemetry.service.spec.js +0 -180
  545. package/dist/domain/services/tool-usage-telemetry.service.spec.js.map +0 -1
  546. package/dist/infrastructure/adapters/webhook.adapter.d.ts +0 -5
  547. package/dist/infrastructure/adapters/webhook.adapter.js +0 -19
  548. package/dist/infrastructure/adapters/webhook.adapter.js.map +0 -1
  549. package/dist/infrastructure/catalog/catalog-loader.test.d.ts +0 -1
  550. package/dist/infrastructure/catalog/catalog-loader.test.js +0 -184
  551. package/dist/infrastructure/catalog/catalog-loader.test.js.map +0 -1
  552. package/dist/infrastructure/cli/command-executor.spec.d.ts +0 -1
  553. package/dist/infrastructure/cli/command-executor.spec.js +0 -149
  554. package/dist/infrastructure/cli/command-executor.spec.js.map +0 -1
  555. package/dist/infrastructure/cli/command-executor.test.d.ts +0 -1
  556. package/dist/infrastructure/cli/command-executor.test.js +0 -98
  557. package/dist/infrastructure/cli/command-executor.test.js.map +0 -1
  558. package/dist/infrastructure/cli/providers/providers.spec.d.ts +0 -1
  559. package/dist/infrastructure/cli/providers/providers.spec.js +0 -251
  560. package/dist/infrastructure/cli/providers/providers.spec.js.map +0 -1
  561. package/dist/infrastructure/formatters/output-formatter.service.spec.d.ts +0 -1
  562. package/dist/infrastructure/formatters/output-formatter.service.spec.js +0 -164
  563. package/dist/infrastructure/formatters/output-formatter.service.spec.js.map +0 -1
  564. package/dist/test/mocks/index.d.ts +0 -44
  565. package/dist/test/mocks/index.js +0 -135
  566. package/dist/test/mocks/index.js.map +0 -1
  567. /package/dist/{core → infrastructure}/observability/command-watcher.d.ts +0 -0
  568. /package/dist/{core → infrastructure}/observability/error-reporter.d.ts +0 -0
  569. /package/dist/{core → infrastructure}/observability/structured-logger.d.ts +0 -0
  570. /package/dist/{core → infrastructure}/observability/structured-logger.js +0 -0
  571. /package/dist/{core → infrastructure}/observability/timing.d.ts +0 -0
  572. /package/dist/{core → infrastructure}/observability/timing.js +0 -0
  573. /package/dist/{core → infrastructure}/observability/tool-usage-telemetry.service.d.ts +0 -0
  574. /package/dist/{core → infrastructure}/observability/tool-usage-telemetry.service.js +0 -0
  575. /package/dist/{core/abstractions → infrastructure}/providers/config-parser.provider.js +0 -0
  576. /package/dist/{core/abstractions → infrastructure}/providers/logger.provider.js +0 -0
@@ -1,682 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.RulesetValidatorService = void 0;
37
- const path = __importStar(require("path"));
38
- const abstractions_1 = require("../abstractions");
39
- const rule_evaluation_engine_1 = require("./rule-evaluation-engine");
40
- const native_evaluator_1 = require("./evaluators/native-evaluator");
41
- const opa_evaluator_1 = require("./evaluators/opa-evaluator");
42
- class RulesetValidatorService {
43
- constructor(options) {
44
- const container = (0, abstractions_1.getContainer)();
45
- this.logger = options?.logger ?? container.createLogger('RulesetValidatorService');
46
- this.fs = options?.fileSystem ?? container.createFileSystem();
47
- this.configParser = options?.configParser ?? container.createConfigParser('yaml');
48
- const strategy = options?.engineType === 'opa'
49
- ? new opa_evaluator_1.OpaEvaluator(this.fs, this.logger)
50
- : new native_evaluator_1.NativeEvaluator(this.fs, this.logger);
51
- this.engine = new rule_evaluation_engine_1.RuleEvaluationEngine({
52
- fileSystem: this.fs,
53
- logger: this.logger,
54
- strategy
55
- });
56
- }
57
- async validate(satellitePath, corePath) {
58
- const issues = [];
59
- let rulesChecked = 0;
60
- const resolvedCorePath = corePath || this.findCorePath(satellitePath);
61
- const evolithYamlPath = path.join(satellitePath, 'evolith.yaml');
62
- let coreRefVersion = null;
63
- let coreRefPath = null;
64
- if (!await this.fs.exists(evolithYamlPath)) {
65
- issues.push({
66
- ruleId: 'GOV-01',
67
- severity: 'MUST',
68
- category: 'governance',
69
- title: 'evolith.yaml missing',
70
- description: 'Satellite repository must have evolith.yaml at root',
71
- file: evolithYamlPath,
72
- blocking: true,
73
- });
74
- return {
75
- status: 'failed',
76
- rulesChecked: 0,
77
- issues,
78
- coreRef: { version: null, path: null },
79
- timestamp: new Date().toISOString(),
80
- };
81
- }
82
- const evolithYaml = await this.loadEvolithYaml(evolithYamlPath);
83
- coreRefVersion = evolithYaml.coreRef?.version || null;
84
- coreRefPath = evolithYaml.coreRef?.path || null;
85
- if (!coreRefVersion) {
86
- issues.push({
87
- ruleId: 'INH-02',
88
- severity: 'MUST',
89
- category: 'inheritance',
90
- title: 'Core version not pinned',
91
- description: 'evolith.yaml must specify coreRef.version (semver). Unpinned references are prohibited.',
92
- file: 'evolith.yaml',
93
- expected: 'coreRef.version: "1.0.0"',
94
- actual: 'coreRef.version not defined',
95
- blocking: true,
96
- });
97
- }
98
- const inheritanceRules = await this.loadRuleset(resolvedCorePath, 'governance/inheritance.rules.json');
99
- if (inheritanceRules) {
100
- rulesChecked += inheritanceRules.length;
101
- for (const rule of inheritanceRules) {
102
- if (rule.id === 'INH-02' && coreRefVersion && !this.isValidSemver(coreRefVersion)) {
103
- issues.push({
104
- ruleId: 'INH-02',
105
- severity: 'MUST',
106
- category: 'inheritance',
107
- title: 'Invalid semver format',
108
- description: `coreRef.version "${coreRefVersion}" is not valid semver`,
109
- file: 'evolith.yaml',
110
- expected: 'x.y.z format',
111
- actual: coreRefVersion,
112
- blocking: true,
113
- });
114
- }
115
- }
116
- }
117
- const aclRules = await this.loadRuleset(resolvedCorePath, 'acl/anti-corruption-layer.rules.json');
118
- const satelliteAclPath = path.join(satellitePath, 'acl');
119
- if (aclRules && await this.fs.exists(satelliteAclPath)) {
120
- rulesChecked += aclRules.length;
121
- const aclDir = await this.fs.readdirNames(satelliteAclPath);
122
- if (aclDir.length === 0) {
123
- issues.push({
124
- ruleId: 'ACL-01',
125
- severity: 'MUST',
126
- category: 'anti-corruption',
127
- title: 'ACL directory is empty',
128
- description: 'ACL implementation exists but contains no files. External data ingestion will fail.',
129
- file: 'acl/',
130
- blocking: true,
131
- });
132
- }
133
- }
134
- const openCoreRules = await this.loadRuleset(resolvedCorePath, 'governance/open-core-boundary.rules.json');
135
- if (openCoreRules) {
136
- rulesChecked += openCoreRules.length;
137
- const packageJsonPath = path.join(satellitePath, 'package.json');
138
- if (await this.fs.exists(packageJsonPath)) {
139
- const packageJson = await this.fs.readJson(packageJsonPath);
140
- if (packageJson.license?.startsWith('Enterprise') || packageJson.license === 'UNLICENSED') {
141
- issues.push({
142
- ruleId: 'OCB-01',
143
- severity: 'MUST',
144
- category: 'open-core',
145
- title: 'Core contains enterprise-only license',
146
- description: 'Core artifacts cannot reference commercial or enterprise-only licenses.',
147
- file: 'package.json',
148
- expected: 'MIT, Apache-2.0, or open license',
149
- actual: packageJson.license,
150
- blocking: true,
151
- });
152
- }
153
- }
154
- }
155
- const governanceVersion = evolithYaml.governance?.version;
156
- if (!governanceVersion) {
157
- issues.push({
158
- ruleId: 'GOV-02',
159
- severity: 'SHOULD',
160
- category: 'governance',
161
- title: 'Governance version not declared',
162
- description: 'evolith.yaml should specify governance.version for change tracking',
163
- file: 'evolith.yaml',
164
- blocking: false,
165
- });
166
- }
167
- try {
168
- const engineResults = await this.engine.discoverAndEvaluate(satellitePath, resolvedCorePath);
169
- const evaluated = engineResults.filter(r => r.result !== 'skipped');
170
- rulesChecked += evaluated.length;
171
- issues.push(...this.engine.toValidationIssues(engineResults));
172
- }
173
- catch (err) {
174
- this.logger.warn(`Rule engine error: ${err instanceof Error ? err.message : String(err)}`);
175
- }
176
- const status = issues.some(i => i.blocking) ? 'failed' : issues.length > 0 ? 'warning' : 'passed';
177
- return {
178
- status,
179
- rulesChecked,
180
- issues,
181
- coreRef: { version: coreRefVersion, path: coreRefPath },
182
- timestamp: new Date().toISOString(),
183
- };
184
- }
185
- async loadEvolithYaml(filePath) {
186
- const content = await this.fs.readFile(filePath);
187
- return this.configParser.parse(content);
188
- }
189
- async loadRuleset(corePath, relativePath) {
190
- const fullPath = path.join(corePath, 'rulesets', relativePath);
191
- if (!await this.fs.exists(fullPath)) {
192
- return null;
193
- }
194
- try {
195
- const content = await this.fs.readFile(fullPath);
196
- const parsed = JSON.parse(content);
197
- const rules = [];
198
- if (parsed.principles) {
199
- for (const p of parsed.principles) {
200
- rules.push({
201
- id: p.id,
202
- severity: p.severity,
203
- title: p.principle,
204
- description: p.statement,
205
- blocking: p.blocking,
206
- });
207
- }
208
- }
209
- if (parsed.rules) {
210
- for (const r of parsed.rules) {
211
- rules.push({
212
- id: r.id,
213
- severity: r.severity,
214
- title: r.title,
215
- description: r.description,
216
- blocking: r.blocking,
217
- });
218
- }
219
- }
220
- return rules;
221
- }
222
- catch (error) {
223
- const message = error instanceof Error ? error.message : String(error);
224
- this.logger.warn(`Failed to load ruleset ${relativePath}: ${message}`);
225
- return null;
226
- }
227
- }
228
- findCorePath(satellitePath) {
229
- const parts = satellitePath.split(path.sep);
230
- while (parts.length > 0) {
231
- parts.pop();
232
- const candidate = path.join(parts.join(path.sep), 'rulesets');
233
- if (this.fs.existsSync(candidate)) {
234
- return parts.join(path.sep);
235
- }
236
- }
237
- return path.join(satellitePath, '..', 'evolith');
238
- }
239
- isValidSemver(version) {
240
- return /^\d+\.\d+\.\d+(-[\w.]+)?(\+[\w.]+)?$/.test(version);
241
- }
242
- async loadRulesetById(corePath, rulesetId) {
243
- const issues = [];
244
- const mapping = {
245
- 'adr-0002': 'adr/adr-0002-hexagonal-architecture.rules.json',
246
- 'adr-0005': 'adr/adr-0005-cicd-quality-gates.rules.json',
247
- 'adr-0010': 'adr/adr-0010-multi-tenancy.rules.json',
248
- 'adr-0018': 'adr/adr-0018-testing-pyramid.rules.json',
249
- 'adr-0032': 'adr/adr-0032-protocol-selection.rules.json',
250
- 'adr-0040': 'adr/adr-0040-multi-runtime.rules.json',
251
- 'adr-0050': 'adr/adr-0050-gitflow-branching.rules.json',
252
- 'acl': 'acl/anti-corruption-layer.rules.json',
253
- 'open-core': 'governance/open-core-boundary.rules.json',
254
- 'inheritance': 'governance/inheritance.rules.json',
255
- 'cli-release': 'cli/release-readiness.rules.json',
256
- 'cli-parity': 'cli/core-parity.rules.json',
257
- 'evidence': 'evidence/evidence-manifest.rules.json',
258
- 'mcp': 'mcp/protocol-compliance.rules.json',
259
- 'observability': 'observability/telemetry-evidence.rules.json',
260
- };
261
- const relativePath = mapping[rulesetId.toLowerCase()];
262
- if (!relativePath) {
263
- issues.push({
264
- ruleId: 'UNKNOWN',
265
- severity: 'SHOULD',
266
- category: 'governance',
267
- title: `Unknown ruleset ID: ${rulesetId}`,
268
- description: 'Available ruleset IDs: adr-0002, adr-0005, adr-0010, adr-0018, adr-0032, adr-0040, adr-0050, acl, open-core, inheritance, cli-release, cli-parity, evidence, mcp, observability',
269
- blocking: false,
270
- });
271
- return issues;
272
- }
273
- const rules = await this.loadRuleset(corePath, relativePath);
274
- if (!rules || rules.length === 0) {
275
- issues.push({
276
- ruleId: 'MISSING',
277
- severity: 'MUST',
278
- category: 'governance',
279
- title: `Ruleset not found: ${rulesetId}`,
280
- description: `Could not load ruleset at ${relativePath}`,
281
- blocking: true,
282
- });
283
- }
284
- return issues;
285
- }
286
- async validateArchitecture(satellitePath, corePath, level) {
287
- const resolvedCorePath = corePath || this.findCorePath(satellitePath);
288
- const issues = [];
289
- let rulesChecked = 0;
290
- const levels = level === 'ALL' || !level
291
- ? ['F1', 'F2', 'F3']
292
- : [level];
293
- for (const lvl of levels) {
294
- const rulesetPath = path.join(resolvedCorePath, 'rulesets', 'architecture', `f${lvl.toLowerCase()}-${lvl === 'F1' ? 'modular-monolith' : lvl === 'F2' ? 'distributed-modules' : 'microservices'}.rules.json`);
295
- if (!await this.fs.exists(rulesetPath)) {
296
- issues.push({
297
- ruleId: `ARCH-${lvl}-MISSING`,
298
- severity: 'SHOULD',
299
- category: 'architecture',
300
- title: `${lvl} ruleset not found`,
301
- description: `Could not find ${lvl} architecture rules at ${rulesetPath}`,
302
- blocking: false,
303
- });
304
- continue;
305
- }
306
- const content = await this.fs.readFile(rulesetPath);
307
- const ruleset = JSON.parse(content);
308
- const rules = ruleset.rules || [];
309
- rulesChecked += rules.length;
310
- for (const rule of rules) {
311
- const validationResult = await this.validateArchitectureRule(satellitePath, rule, lvl);
312
- if (validationResult) {
313
- issues.push(...validationResult);
314
- }
315
- }
316
- }
317
- const blockingCount = issues.filter(i => i.blocking).length;
318
- return {
319
- status: blockingCount > 0 ? 'failed' : 'passed',
320
- levels: levels,
321
- rulesChecked,
322
- issues,
323
- timestamp: new Date().toISOString(),
324
- };
325
- }
326
- async validateArchitectureRule(satellitePath, rule, level) {
327
- const issues = [];
328
- switch (rule.category) {
329
- case 'topology':
330
- await this.validateTopologyRule(satellitePath, rule, issues);
331
- break;
332
- case 'bounded-contexts':
333
- await this.validateBoundedContextsRule(satellitePath, rule, issues);
334
- break;
335
- case 'hexagonal-architecture':
336
- await this.validateHexagonalRule(satellitePath, rule, issues);
337
- break;
338
- case 'communication':
339
- await this.validateCommunicationRule(satellitePath, rule, issues);
340
- break;
341
- case 'persistence':
342
- await this.validatePersistenceRule(satellitePath, rule, issues);
343
- break;
344
- case 'async-boundaries':
345
- await this.validateAsyncRule(satellitePath, rule, issues);
346
- break;
347
- case 'extraction-readiness':
348
- await this.validateExtractionReadinessRule(satellitePath, rule, issues);
349
- break;
350
- case 'observability':
351
- await this.validateObservabilityRule(satellitePath, rule, issues);
352
- break;
353
- case 'module-autonomy':
354
- await this.validateModuleAutonomyRule(satellitePath, rule, issues);
355
- break;
356
- case 'contract-stability':
357
- await this.validateContractStabilityRule(satellitePath, rule, issues);
358
- break;
359
- case 'data-ownership':
360
- this.validateDataOwnershipRule(satellitePath, rule, issues);
361
- break;
362
- case 'async-communication':
363
- await this.validateAsyncCommunicationRule(satellitePath, rule, issues);
364
- break;
365
- case 'distributed-tracing':
366
- await this.validateDistributedTracingRule(satellitePath, rule, issues);
367
- break;
368
- case 'containerization':
369
- await this.validateContainerizationRule(satellitePath, rule, issues);
370
- break;
371
- case 'service-boundaries':
372
- await this.validateServiceBoundariesRule(satellitePath, rule, issues);
373
- break;
374
- default:
375
- break;
376
- }
377
- return issues.length > 0 ? issues : null;
378
- }
379
- async validateTopologyRule(satellitePath, rule, issues) {
380
- const packageJsonPath = path.join(satellitePath, 'package.json');
381
- if (rule.id === 'F1-R01') {
382
- if (await this.fs.exists(packageJsonPath)) {
383
- const pkg = await this.fs.readJson(packageJsonPath);
384
- if (pkg.workspaces) {
385
- issues.push({
386
- ruleId: rule.id,
387
- severity: rule.severity,
388
- category: rule.category,
389
- title: rule.title,
390
- description: `${rule.description} - Monorepo workspace detected`,
391
- blocking: rule.blocking,
392
- });
393
- }
394
- }
395
- }
396
- }
397
- async validateBoundedContextsRule(satellitePath, rule, issues) {
398
- const srcPath = path.join(satellitePath, 'src');
399
- if (await this.fs.exists(srcPath)) {
400
- const entries = await this.fs.readdirNames(srcPath);
401
- const moduleCount = entries.filter(e => !e.startsWith('.')).length;
402
- if (rule.id === 'F1-R02') {
403
- if (moduleCount < 2) {
404
- issues.push({
405
- ruleId: rule.id,
406
- severity: rule.severity,
407
- category: rule.category,
408
- title: rule.title,
409
- description: `${rule.description} - Found only ${moduleCount} module(s) in src/`,
410
- blocking: rule.blocking,
411
- });
412
- }
413
- }
414
- }
415
- }
416
- async validateHexagonalRule(satellitePath, rule, issues) {
417
- if (rule.id === 'F1-R03') {
418
- const srcPath = path.join(satellitePath, 'src');
419
- const hasPorts = await this.fs.exists(path.join(srcPath, 'ports')) ||
420
- await this.fs.exists(path.join(srcPath, 'Ports')) ||
421
- await this.fs.exists(path.join(srcPath, 'application/ports'));
422
- if (!hasPorts) {
423
- issues.push({
424
- ruleId: rule.id,
425
- severity: rule.severity,
426
- category: rule.category,
427
- title: rule.title,
428
- description: `${rule.description} - No ports directory found (expected: src/ports or src/application/ports)`,
429
- blocking: rule.blocking,
430
- });
431
- }
432
- }
433
- }
434
- async validateCommunicationRule(satellitePath, rule, issues) {
435
- if (rule.id === 'F1-R04' || rule.id === 'F2-R03') {
436
- const contractsPath = path.join(satellitePath, 'contracts');
437
- const hasContracts = await this.fs.exists(contractsPath);
438
- if (!hasContracts) {
439
- issues.push({
440
- ruleId: rule.id,
441
- severity: rule.severity,
442
- category: rule.category,
443
- title: rule.title,
444
- description: `${rule.description} - No contracts/ directory found for inter-module contracts`,
445
- blocking: rule.blocking,
446
- });
447
- }
448
- }
449
- }
450
- async validatePersistenceRule(satellitePath, rule, issues) {
451
- if (rule.id === 'F1-R05') {
452
- const aclPath = path.join(satellitePath, 'acl');
453
- if (!await this.fs.exists(aclPath)) {
454
- issues.push({
455
- ruleId: rule.id,
456
- severity: rule.severity,
457
- category: rule.category,
458
- title: rule.title,
459
- description: `${rule.description} - No acl/ directory found (should contain one subdirectory per bounded context)`,
460
- blocking: rule.blocking,
461
- });
462
- }
463
- else {
464
- const entries = await this.fs.readdirNames(aclPath);
465
- if (entries.length < 2) {
466
- issues.push({
467
- ruleId: rule.id,
468
- severity: rule.severity,
469
- category: rule.category,
470
- title: rule.title,
471
- description: `${rule.description} - Found ${entries.length} bounded context(s) in acl/ (expected multiple)`,
472
- blocking: rule.blocking,
473
- });
474
- }
475
- }
476
- }
477
- }
478
- async validateAsyncRule(satellitePath, rule, issues) {
479
- if (rule.id === 'F1-R06') {
480
- const eventsPath = path.join(satellitePath, 'events') ||
481
- path.join(satellitePath, 'src', 'events') ||
482
- path.join(satellitePath, 'src', 'domain', 'events');
483
- const hasEvents = await this.fs.exists(eventsPath);
484
- if (!hasEvents) {
485
- issues.push({
486
- ruleId: rule.id,
487
- severity: rule.severity,
488
- category: rule.category,
489
- title: rule.title,
490
- description: `${rule.description} - No events directory found`,
491
- blocking: rule.blocking,
492
- });
493
- }
494
- }
495
- }
496
- async validateExtractionReadinessRule(satellitePath, rule, issues) {
497
- const extractionReadinessPath = path.join(satellitePath, 'docs', 'extraction-readiness.md');
498
- const hasExtractionReadiness = await this.fs.exists(extractionReadinessPath);
499
- if (!hasExtractionReadiness) {
500
- issues.push({
501
- ruleId: rule.id,
502
- severity: rule.severity,
503
- category: rule.category,
504
- title: rule.title,
505
- description: `${rule.description} - No extraction-readiness.md found in docs/`,
506
- blocking: rule.blocking,
507
- });
508
- }
509
- }
510
- async validateObservabilityRule(satellitePath, rule, issues) {
511
- const hasPkgJson = await this.fs.exists(path.join(satellitePath, 'package.json'));
512
- if (hasPkgJson) {
513
- const otelConfigPath = path.join(satellitePath, 'otel.config.js') ||
514
- path.join(satellitePath, 'opentelemetry.config.js') ||
515
- path.join(satellitePath, 'src', 'instrumentation.ts');
516
- let hasOtel = false;
517
- for (const p of [otelConfigPath]) {
518
- if (await this.fs.exists(p)) {
519
- hasOtel = true;
520
- break;
521
- }
522
- }
523
- if (!hasOtel) {
524
- issues.push({
525
- ruleId: rule.id,
526
- severity: rule.severity,
527
- category: rule.category,
528
- title: rule.title,
529
- description: `${rule.description} - No OpenTelemetry instrumentation found`,
530
- blocking: rule.blocking,
531
- });
532
- }
533
- }
534
- }
535
- async validateModuleAutonomyRule(satellitePath, rule, issues) {
536
- if (rule.id === 'F2-R01') {
537
- const srcPath = path.join(satellitePath, 'src');
538
- if (await this.fs.exists(srcPath)) {
539
- const entries = await this.fs.readdirNames(srcPath);
540
- let hasIndependentModules = false;
541
- for (const entry of entries) {
542
- if (await this.fs.exists(path.join(srcPath, entry, 'package.json'))) {
543
- hasIndependentModules = true;
544
- break;
545
- }
546
- }
547
- if (!hasIndependentModules && entries.length > 1) {
548
- issues.push({
549
- ruleId: rule.id,
550
- severity: rule.severity,
551
- category: rule.category,
552
- title: rule.title,
553
- description: `${rule.description} - No independent module package.json files found`,
554
- blocking: rule.blocking,
555
- });
556
- }
557
- }
558
- }
559
- }
560
- async validateContractStabilityRule(satellitePath, rule, issues) {
561
- if (rule.id === 'F2-R02') {
562
- const contractsPath = path.join(satellitePath, 'contracts');
563
- const hasContracts = await this.fs.exists(contractsPath);
564
- if (!hasContracts) {
565
- issues.push({
566
- ruleId: rule.id,
567
- severity: rule.severity,
568
- category: rule.category,
569
- title: rule.title,
570
- description: `${rule.description} - No contracts directory found`,
571
- blocking: rule.blocking,
572
- });
573
- }
574
- else {
575
- const contractFiles = (await this.fs.readdirNames(contractsPath)).filter(f => f.endsWith('.proto') || f.endsWith('.avsc') || f.endsWith('.json'));
576
- if (contractFiles.length === 0) {
577
- issues.push({
578
- ruleId: rule.id,
579
- severity: rule.severity,
580
- category: rule.category,
581
- title: rule.title,
582
- description: `${rule.description} - No contract definition files (.proto, .avsc, .json schema) found`,
583
- blocking: rule.blocking,
584
- });
585
- }
586
- }
587
- }
588
- }
589
- validateDataOwnershipRule(satellitePath, rule, issues) {
590
- if (rule.id === 'F2-R03') {
591
- const aclPath = path.join(satellitePath, 'acl');
592
- if (!this.fs.existsSync(aclPath)) {
593
- issues.push({
594
- ruleId: rule.id,
595
- severity: rule.severity,
596
- category: rule.category,
597
- title: rule.title,
598
- description: `${rule.description} - No acl directory for data ownership enforcement`,
599
- blocking: rule.blocking,
600
- });
601
- }
602
- }
603
- }
604
- async validateAsyncCommunicationRule(satellitePath, rule, issues) {
605
- if (rule.id === 'F2-R04') {
606
- const eventsPath = path.join(satellitePath, 'events') || path.join(satellitePath, 'src', 'events');
607
- const hasEvents = await this.fs.exists(eventsPath);
608
- if (hasEvents) {
609
- const eventFiles = (await this.fs.readdirNames(eventsPath)).filter(f => f.endsWith('.json') || f.endsWith('.schema.json'));
610
- if (eventFiles.length === 0) {
611
- issues.push({
612
- ruleId: rule.id,
613
- severity: rule.severity,
614
- category: rule.category,
615
- title: rule.title,
616
- description: `${rule.description} - No schema-validated event files found`,
617
- blocking: rule.blocking,
618
- });
619
- }
620
- }
621
- }
622
- }
623
- async validateDistributedTracingRule(satellitePath, rule, issues) {
624
- const tracerSetupFiles = [
625
- path.join(satellitePath, 'src', 'tracing.ts'),
626
- path.join(satellitePath, 'src', 'instrumentation.ts'),
627
- path.join(satellitePath, 'opentelemetry.config.js'),
628
- ];
629
- const existsResults = await Promise.all(tracerSetupFiles.map(f => this.fs.exists(f)));
630
- const hasTracerSetup = existsResults.some(Boolean);
631
- if (!hasTracerSetup) {
632
- issues.push({
633
- ruleId: rule.id,
634
- severity: rule.severity,
635
- category: rule.category,
636
- title: rule.title,
637
- description: `${rule.description} - No distributed tracing setup found`,
638
- blocking: rule.blocking,
639
- });
640
- }
641
- }
642
- async validateContainerizationRule(satellitePath, rule, issues) {
643
- const dockerfilePath = path.join(satellitePath, 'Dockerfile');
644
- const dockerfileExists = await this.fs.exists(dockerfilePath);
645
- if (rule.id === 'F3-R01' && !dockerfileExists) {
646
- issues.push({
647
- ruleId: rule.id,
648
- severity: rule.severity,
649
- category: rule.category,
650
- title: rule.title,
651
- description: `${rule.description} - No Dockerfile found at repository root`,
652
- blocking: rule.blocking,
653
- });
654
- }
655
- }
656
- async validateServiceBoundariesRule(satellitePath, rule, issues) {
657
- const srcPath = path.join(satellitePath, 'src');
658
- if (await this.fs.exists(srcPath)) {
659
- const entries = await this.fs.readdirNames(srcPath);
660
- const dirEntries = [];
661
- for (const entry of entries) {
662
- const entryPath = path.join(srcPath, entry);
663
- const stat = await this.fs.stat(entryPath);
664
- if (stat.isDirectory && stat.isDirectory()) {
665
- dirEntries.push(entry);
666
- }
667
- }
668
- if (rule.id === 'F3-R02' && dirEntries.length < 2) {
669
- issues.push({
670
- ruleId: rule.id,
671
- severity: rule.severity,
672
- category: rule.category,
673
- title: rule.title,
674
- description: `${rule.description} - Only ${dirEntries.length} service(s) found (expected multiple independent services)`,
675
- blocking: rule.blocking,
676
- });
677
- }
678
- }
679
- }
680
- }
681
- exports.RulesetValidatorService = RulesetValidatorService;
682
- //# sourceMappingURL=ruleset-validator.service.js.map