@evolith/smart-cli 0.0.2-beta → 1.0.0

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