@opensip-tools/fitness 1.0.4

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 (461) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/.turbo/turbo-typecheck.log +4 -0
  3. package/LICENSE +21 -0
  4. package/dist/__tests__/gate.test.d.ts +13 -0
  5. package/dist/__tests__/gate.test.d.ts.map +1 -0
  6. package/dist/__tests__/gate.test.js +422 -0
  7. package/dist/__tests__/gate.test.js.map +1 -0
  8. package/dist/__tests__/sarif.test.d.ts +2 -0
  9. package/dist/__tests__/sarif.test.d.ts.map +1 -0
  10. package/dist/__tests__/sarif.test.js +169 -0
  11. package/dist/__tests__/sarif.test.js.map +1 -0
  12. package/dist/cli/dashboard.d.ts +6 -0
  13. package/dist/cli/dashboard.d.ts.map +1 -0
  14. package/dist/cli/dashboard.js +77 -0
  15. package/dist/cli/dashboard.js.map +1 -0
  16. package/dist/cli/fit.d.ts +37 -0
  17. package/dist/cli/fit.d.ts.map +1 -0
  18. package/dist/cli/fit.js +539 -0
  19. package/dist/cli/fit.js.map +1 -0
  20. package/dist/cli/list-checks.d.ts +6 -0
  21. package/dist/cli/list-checks.d.ts.map +1 -0
  22. package/dist/cli/list-checks.js +23 -0
  23. package/dist/cli/list-checks.js.map +1 -0
  24. package/dist/cli/list-recipes.d.ts +6 -0
  25. package/dist/cli/list-recipes.d.ts.map +1 -0
  26. package/dist/cli/list-recipes.js +31 -0
  27. package/dist/cli/list-recipes.js.map +1 -0
  28. package/dist/framework/__tests__/ast-utilities.test.d.ts +2 -0
  29. package/dist/framework/__tests__/ast-utilities.test.d.ts.map +1 -0
  30. package/dist/framework/__tests__/ast-utilities.test.js +153 -0
  31. package/dist/framework/__tests__/ast-utilities.test.js.map +1 -0
  32. package/dist/framework/__tests__/check-config.test.d.ts +2 -0
  33. package/dist/framework/__tests__/check-config.test.d.ts.map +1 -0
  34. package/dist/framework/__tests__/check-config.test.js +56 -0
  35. package/dist/framework/__tests__/check-config.test.js.map +1 -0
  36. package/dist/framework/__tests__/command-executor.test.d.ts +2 -0
  37. package/dist/framework/__tests__/command-executor.test.d.ts.map +1 -0
  38. package/dist/framework/__tests__/command-executor.test.js +71 -0
  39. package/dist/framework/__tests__/command-executor.test.js.map +1 -0
  40. package/dist/framework/__tests__/content-filter-dispatch.test.d.ts +2 -0
  41. package/dist/framework/__tests__/content-filter-dispatch.test.d.ts.map +1 -0
  42. package/dist/framework/__tests__/content-filter-dispatch.test.js +104 -0
  43. package/dist/framework/__tests__/content-filter-dispatch.test.js.map +1 -0
  44. package/dist/framework/__tests__/content-filter.test.d.ts +2 -0
  45. package/dist/framework/__tests__/content-filter.test.d.ts.map +1 -0
  46. package/dist/framework/__tests__/content-filter.test.js +126 -0
  47. package/dist/framework/__tests__/content-filter.test.js.map +1 -0
  48. package/dist/framework/__tests__/define-check.test.d.ts +2 -0
  49. package/dist/framework/__tests__/define-check.test.d.ts.map +1 -0
  50. package/dist/framework/__tests__/define-check.test.js +155 -0
  51. package/dist/framework/__tests__/define-check.test.js.map +1 -0
  52. package/dist/framework/__tests__/directive-inventory.test.d.ts +2 -0
  53. package/dist/framework/__tests__/directive-inventory.test.d.ts.map +1 -0
  54. package/dist/framework/__tests__/directive-inventory.test.js +44 -0
  55. package/dist/framework/__tests__/directive-inventory.test.js.map +1 -0
  56. package/dist/framework/__tests__/execution-context.test.d.ts +2 -0
  57. package/dist/framework/__tests__/execution-context.test.d.ts.map +1 -0
  58. package/dist/framework/__tests__/execution-context.test.js +62 -0
  59. package/dist/framework/__tests__/execution-context.test.js.map +1 -0
  60. package/dist/framework/__tests__/file-accessor.test.d.ts +2 -0
  61. package/dist/framework/__tests__/file-accessor.test.d.ts.map +1 -0
  62. package/dist/framework/__tests__/file-accessor.test.js +106 -0
  63. package/dist/framework/__tests__/file-accessor.test.js.map +1 -0
  64. package/dist/framework/__tests__/file-cache.test.d.ts +2 -0
  65. package/dist/framework/__tests__/file-cache.test.d.ts.map +1 -0
  66. package/dist/framework/__tests__/file-cache.test.js +122 -0
  67. package/dist/framework/__tests__/file-cache.test.js.map +1 -0
  68. package/dist/framework/__tests__/import-graph.test.d.ts +15 -0
  69. package/dist/framework/__tests__/import-graph.test.d.ts.map +1 -0
  70. package/dist/framework/__tests__/import-graph.test.js +164 -0
  71. package/dist/framework/__tests__/import-graph.test.js.map +1 -0
  72. package/dist/framework/__tests__/path-matcher.test.d.ts +2 -0
  73. package/dist/framework/__tests__/path-matcher.test.d.ts.map +1 -0
  74. package/dist/framework/__tests__/path-matcher.test.js +113 -0
  75. package/dist/framework/__tests__/path-matcher.test.js.map +1 -0
  76. package/dist/framework/__tests__/register-helpers.test.d.ts +2 -0
  77. package/dist/framework/__tests__/register-helpers.test.d.ts.map +1 -0
  78. package/dist/framework/__tests__/register-helpers.test.js +42 -0
  79. package/dist/framework/__tests__/register-helpers.test.js.map +1 -0
  80. package/dist/framework/__tests__/registry.test.d.ts +2 -0
  81. package/dist/framework/__tests__/registry.test.d.ts.map +1 -0
  82. package/dist/framework/__tests__/registry.test.js +208 -0
  83. package/dist/framework/__tests__/registry.test.js.map +1 -0
  84. package/dist/framework/__tests__/result-builder.test.d.ts +2 -0
  85. package/dist/framework/__tests__/result-builder.test.d.ts.map +1 -0
  86. package/dist/framework/__tests__/result-builder.test.js +153 -0
  87. package/dist/framework/__tests__/result-builder.test.js.map +1 -0
  88. package/dist/framework/__tests__/scope-resolver.test.d.ts +2 -0
  89. package/dist/framework/__tests__/scope-resolver.test.d.ts.map +1 -0
  90. package/dist/framework/__tests__/scope-resolver.test.js +140 -0
  91. package/dist/framework/__tests__/scope-resolver.test.js.map +1 -0
  92. package/dist/framework/__tests__/severity-mapping.test.d.ts +2 -0
  93. package/dist/framework/__tests__/severity-mapping.test.d.ts.map +1 -0
  94. package/dist/framework/__tests__/severity-mapping.test.js +42 -0
  95. package/dist/framework/__tests__/severity-mapping.test.js.map +1 -0
  96. package/dist/framework/__tests__/strip-literals.test.d.ts +2 -0
  97. package/dist/framework/__tests__/strip-literals.test.d.ts.map +1 -0
  98. package/dist/framework/__tests__/strip-literals.test.js +87 -0
  99. package/dist/framework/__tests__/strip-literals.test.js.map +1 -0
  100. package/dist/framework/abortable-exec.d.ts +34 -0
  101. package/dist/framework/abortable-exec.d.ts.map +1 -0
  102. package/dist/framework/abortable-exec.js +136 -0
  103. package/dist/framework/abortable-exec.js.map +1 -0
  104. package/dist/framework/ast-utilities.d.ts +41 -0
  105. package/dist/framework/ast-utilities.d.ts.map +1 -0
  106. package/dist/framework/ast-utilities.js +106 -0
  107. package/dist/framework/ast-utilities.js.map +1 -0
  108. package/dist/framework/check-config.d.ts +171 -0
  109. package/dist/framework/check-config.d.ts.map +1 -0
  110. package/dist/framework/check-config.js +114 -0
  111. package/dist/framework/check-config.js.map +1 -0
  112. package/dist/framework/check-types.d.ts +57 -0
  113. package/dist/framework/check-types.d.ts.map +1 -0
  114. package/dist/framework/check-types.js +35 -0
  115. package/dist/framework/check-types.js.map +1 -0
  116. package/dist/framework/command-executor.d.ts +25 -0
  117. package/dist/framework/command-executor.d.ts.map +1 -0
  118. package/dist/framework/command-executor.js +63 -0
  119. package/dist/framework/command-executor.js.map +1 -0
  120. package/dist/framework/constants.d.ts +9 -0
  121. package/dist/framework/constants.d.ts.map +1 -0
  122. package/dist/framework/constants.js +16 -0
  123. package/dist/framework/constants.js.map +1 -0
  124. package/dist/framework/content-filter.d.ts +33 -0
  125. package/dist/framework/content-filter.d.ts.map +1 -0
  126. package/dist/framework/content-filter.js +236 -0
  127. package/dist/framework/content-filter.js.map +1 -0
  128. package/dist/framework/define-check.d.ts +38 -0
  129. package/dist/framework/define-check.d.ts.map +1 -0
  130. package/dist/framework/define-check.js +252 -0
  131. package/dist/framework/define-check.js.map +1 -0
  132. package/dist/framework/directive-inventory.d.ts +34 -0
  133. package/dist/framework/directive-inventory.d.ts.map +1 -0
  134. package/dist/framework/directive-inventory.js +77 -0
  135. package/dist/framework/directive-inventory.js.map +1 -0
  136. package/dist/framework/directive-parsing.d.ts +20 -0
  137. package/dist/framework/directive-parsing.d.ts.map +1 -0
  138. package/dist/framework/directive-parsing.js +121 -0
  139. package/dist/framework/directive-parsing.js.map +1 -0
  140. package/dist/framework/execution-context.d.ts +95 -0
  141. package/dist/framework/execution-context.d.ts.map +1 -0
  142. package/dist/framework/execution-context.js +122 -0
  143. package/dist/framework/execution-context.js.map +1 -0
  144. package/dist/framework/file-accessor.d.ts +20 -0
  145. package/dist/framework/file-accessor.d.ts.map +1 -0
  146. package/dist/framework/file-accessor.js +122 -0
  147. package/dist/framework/file-accessor.js.map +1 -0
  148. package/dist/framework/file-cache.d.ts +70 -0
  149. package/dist/framework/file-cache.d.ts.map +1 -0
  150. package/dist/framework/file-cache.js +178 -0
  151. package/dist/framework/file-cache.js.map +1 -0
  152. package/dist/framework/file-type-filter.d.ts +11 -0
  153. package/dist/framework/file-type-filter.d.ts.map +1 -0
  154. package/dist/framework/file-type-filter.js +21 -0
  155. package/dist/framework/file-type-filter.js.map +1 -0
  156. package/dist/framework/ignore-processing.d.ts +22 -0
  157. package/dist/framework/ignore-processing.d.ts.map +1 -0
  158. package/dist/framework/ignore-processing.js +241 -0
  159. package/dist/framework/ignore-processing.js.map +1 -0
  160. package/dist/framework/import-graph.d.ts +51 -0
  161. package/dist/framework/import-graph.d.ts.map +1 -0
  162. package/dist/framework/import-graph.js +216 -0
  163. package/dist/framework/import-graph.js.map +1 -0
  164. package/dist/framework/memory-profiler.d.ts +53 -0
  165. package/dist/framework/memory-profiler.d.ts.map +1 -0
  166. package/dist/framework/memory-profiler.js +92 -0
  167. package/dist/framework/memory-profiler.js.map +1 -0
  168. package/dist/framework/parse-cache.d.ts +23 -0
  169. package/dist/framework/parse-cache.d.ts.map +1 -0
  170. package/dist/framework/parse-cache.js +37 -0
  171. package/dist/framework/parse-cache.js.map +1 -0
  172. package/dist/framework/path-matcher.d.ts +86 -0
  173. package/dist/framework/path-matcher.d.ts.map +1 -0
  174. package/dist/framework/path-matcher.js +138 -0
  175. package/dist/framework/path-matcher.js.map +1 -0
  176. package/dist/framework/register-helpers.d.ts +10 -0
  177. package/dist/framework/register-helpers.d.ts.map +1 -0
  178. package/dist/framework/register-helpers.js +17 -0
  179. package/dist/framework/register-helpers.js.map +1 -0
  180. package/dist/framework/registry.d.ts +41 -0
  181. package/dist/framework/registry.d.ts.map +1 -0
  182. package/dist/framework/registry.js +103 -0
  183. package/dist/framework/registry.js.map +1 -0
  184. package/dist/framework/result-builder.d.ts +74 -0
  185. package/dist/framework/result-builder.d.ts.map +1 -0
  186. package/dist/framework/result-builder.js +154 -0
  187. package/dist/framework/result-builder.js.map +1 -0
  188. package/dist/framework/scope-resolver.d.ts +23 -0
  189. package/dist/framework/scope-resolver.d.ts.map +1 -0
  190. package/dist/framework/scope-resolver.js +201 -0
  191. package/dist/framework/scope-resolver.js.map +1 -0
  192. package/dist/framework/severity-mapping.d.ts +13 -0
  193. package/dist/framework/severity-mapping.d.ts.map +1 -0
  194. package/dist/framework/severity-mapping.js +51 -0
  195. package/dist/framework/severity-mapping.js.map +1 -0
  196. package/dist/framework/strip-literals.d.ts +48 -0
  197. package/dist/framework/strip-literals.d.ts.map +1 -0
  198. package/dist/framework/strip-literals.js +188 -0
  199. package/dist/framework/strip-literals.js.map +1 -0
  200. package/dist/gate.d.ts +74 -0
  201. package/dist/gate.d.ts.map +1 -0
  202. package/dist/gate.js +257 -0
  203. package/dist/gate.js.map +1 -0
  204. package/dist/index.d.ts +47 -0
  205. package/dist/index.d.ts.map +1 -0
  206. package/dist/index.js +51 -0
  207. package/dist/index.js.map +1 -0
  208. package/dist/plugins/__tests__/check-package-discovery.test.d.ts +2 -0
  209. package/dist/plugins/__tests__/check-package-discovery.test.d.ts.map +1 -0
  210. package/dist/plugins/__tests__/check-package-discovery.test.js +170 -0
  211. package/dist/plugins/__tests__/check-package-discovery.test.js.map +1 -0
  212. package/dist/plugins/__tests__/lang-domain.test.d.ts +2 -0
  213. package/dist/plugins/__tests__/lang-domain.test.d.ts.map +1 -0
  214. package/dist/plugins/__tests__/lang-domain.test.js +171 -0
  215. package/dist/plugins/__tests__/lang-domain.test.js.map +1 -0
  216. package/dist/plugins/__tests__/loader.test.d.ts +2 -0
  217. package/dist/plugins/__tests__/loader.test.d.ts.map +1 -0
  218. package/dist/plugins/__tests__/loader.test.js +194 -0
  219. package/dist/plugins/__tests__/loader.test.js.map +1 -0
  220. package/dist/plugins/check-package-discovery.d.ts +73 -0
  221. package/dist/plugins/check-package-discovery.d.ts.map +1 -0
  222. package/dist/plugins/check-package-discovery.js +212 -0
  223. package/dist/plugins/check-package-discovery.js.map +1 -0
  224. package/dist/plugins/loader.d.ts +31 -0
  225. package/dist/plugins/loader.d.ts.map +1 -0
  226. package/dist/plugins/loader.js +290 -0
  227. package/dist/plugins/loader.js.map +1 -0
  228. package/dist/plugins/types.d.ts +23 -0
  229. package/dist/plugins/types.d.ts.map +1 -0
  230. package/dist/plugins/types.js +9 -0
  231. package/dist/plugins/types.js.map +1 -0
  232. package/dist/recipes/__tests__/built-in-recipes.test.d.ts +2 -0
  233. package/dist/recipes/__tests__/built-in-recipes.test.d.ts.map +1 -0
  234. package/dist/recipes/__tests__/built-in-recipes.test.js +93 -0
  235. package/dist/recipes/__tests__/built-in-recipes.test.js.map +1 -0
  236. package/dist/recipes/__tests__/check-config.test.d.ts +5 -0
  237. package/dist/recipes/__tests__/check-config.test.d.ts.map +1 -0
  238. package/dist/recipes/__tests__/check-config.test.js +37 -0
  239. package/dist/recipes/__tests__/check-config.test.js.map +1 -0
  240. package/dist/recipes/__tests__/check-resolution.test.d.ts +2 -0
  241. package/dist/recipes/__tests__/check-resolution.test.d.ts.map +1 -0
  242. package/dist/recipes/__tests__/check-resolution.test.js +135 -0
  243. package/dist/recipes/__tests__/check-resolution.test.js.map +1 -0
  244. package/dist/recipes/__tests__/registry.test.d.ts +2 -0
  245. package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
  246. package/dist/recipes/__tests__/registry.test.js +97 -0
  247. package/dist/recipes/__tests__/registry.test.js.map +1 -0
  248. package/dist/recipes/__tests__/retry.test.d.ts +2 -0
  249. package/dist/recipes/__tests__/retry.test.d.ts.map +1 -0
  250. package/dist/recipes/__tests__/retry.test.js +75 -0
  251. package/dist/recipes/__tests__/retry.test.js.map +1 -0
  252. package/dist/recipes/__tests__/service.test.d.ts +11 -0
  253. package/dist/recipes/__tests__/service.test.d.ts.map +1 -0
  254. package/dist/recipes/__tests__/service.test.js +482 -0
  255. package/dist/recipes/__tests__/service.test.js.map +1 -0
  256. package/dist/recipes/built-in-recipes.d.ts +14 -0
  257. package/dist/recipes/built-in-recipes.d.ts.map +1 -0
  258. package/dist/recipes/built-in-recipes.js +247 -0
  259. package/dist/recipes/built-in-recipes.js.map +1 -0
  260. package/dist/recipes/check-config.d.ts +40 -0
  261. package/dist/recipes/check-config.d.ts.map +1 -0
  262. package/dist/recipes/check-config.js +61 -0
  263. package/dist/recipes/check-config.js.map +1 -0
  264. package/dist/recipes/check-resolution.d.ts +21 -0
  265. package/dist/recipes/check-resolution.d.ts.map +1 -0
  266. package/dist/recipes/check-resolution.js +121 -0
  267. package/dist/recipes/check-resolution.js.map +1 -0
  268. package/dist/recipes/check-result-processor.d.ts +51 -0
  269. package/dist/recipes/check-result-processor.d.ts.map +1 -0
  270. package/dist/recipes/check-result-processor.js +158 -0
  271. package/dist/recipes/check-result-processor.js.map +1 -0
  272. package/dist/recipes/parallel-execution.d.ts +33 -0
  273. package/dist/recipes/parallel-execution.d.ts.map +1 -0
  274. package/dist/recipes/parallel-execution.js +142 -0
  275. package/dist/recipes/parallel-execution.js.map +1 -0
  276. package/dist/recipes/registry.d.ts +81 -0
  277. package/dist/recipes/registry.d.ts.map +1 -0
  278. package/dist/recipes/registry.js +131 -0
  279. package/dist/recipes/registry.js.map +1 -0
  280. package/dist/recipes/retry.d.ts +25 -0
  281. package/dist/recipes/retry.d.ts.map +1 -0
  282. package/dist/recipes/retry.js +44 -0
  283. package/dist/recipes/retry.js.map +1 -0
  284. package/dist/recipes/sequential-execution.d.ts +10 -0
  285. package/dist/recipes/sequential-execution.d.ts.map +1 -0
  286. package/dist/recipes/sequential-execution.js +122 -0
  287. package/dist/recipes/sequential-execution.js.map +1 -0
  288. package/dist/recipes/service-types.d.ts +84 -0
  289. package/dist/recipes/service-types.d.ts.map +1 -0
  290. package/dist/recipes/service-types.js +8 -0
  291. package/dist/recipes/service-types.js.map +1 -0
  292. package/dist/recipes/service.d.ts +71 -0
  293. package/dist/recipes/service.d.ts.map +1 -0
  294. package/dist/recipes/service.js +331 -0
  295. package/dist/recipes/service.js.map +1 -0
  296. package/dist/recipes/types.d.ts +154 -0
  297. package/dist/recipes/types.d.ts.map +1 -0
  298. package/dist/recipes/types.js +54 -0
  299. package/dist/recipes/types.js.map +1 -0
  300. package/dist/sarif.d.ts +34 -0
  301. package/dist/sarif.d.ts.map +1 -0
  302. package/dist/sarif.js +192 -0
  303. package/dist/sarif.js.map +1 -0
  304. package/dist/signalers/__tests__/loader.test.d.ts +2 -0
  305. package/dist/signalers/__tests__/loader.test.d.ts.map +1 -0
  306. package/dist/signalers/__tests__/loader.test.js +74 -0
  307. package/dist/signalers/__tests__/loader.test.js.map +1 -0
  308. package/dist/signalers/index.d.ts +8 -0
  309. package/dist/signalers/index.d.ts.map +1 -0
  310. package/dist/signalers/index.js +9 -0
  311. package/dist/signalers/index.js.map +1 -0
  312. package/dist/signalers/loader.d.ts +24 -0
  313. package/dist/signalers/loader.d.ts.map +1 -0
  314. package/dist/signalers/loader.js +108 -0
  315. package/dist/signalers/loader.js.map +1 -0
  316. package/dist/signalers/schema.d.ts +288 -0
  317. package/dist/signalers/schema.d.ts.map +1 -0
  318. package/dist/signalers/schema.js +99 -0
  319. package/dist/signalers/schema.js.map +1 -0
  320. package/dist/signalers/types.d.ts +13 -0
  321. package/dist/signalers/types.d.ts.map +1 -0
  322. package/dist/signalers/types.js +5 -0
  323. package/dist/signalers/types.js.map +1 -0
  324. package/dist/targets/__tests__/loader.test.d.ts +2 -0
  325. package/dist/targets/__tests__/loader.test.d.ts.map +1 -0
  326. package/dist/targets/__tests__/loader.test.js +127 -0
  327. package/dist/targets/__tests__/loader.test.js.map +1 -0
  328. package/dist/targets/__tests__/resolver.test.d.ts +2 -0
  329. package/dist/targets/__tests__/resolver.test.d.ts.map +1 -0
  330. package/dist/targets/__tests__/resolver.test.js +54 -0
  331. package/dist/targets/__tests__/resolver.test.js.map +1 -0
  332. package/dist/targets/__tests__/target-registry.test.d.ts +2 -0
  333. package/dist/targets/__tests__/target-registry.test.d.ts.map +1 -0
  334. package/dist/targets/__tests__/target-registry.test.js +89 -0
  335. package/dist/targets/__tests__/target-registry.test.js.map +1 -0
  336. package/dist/targets/index.d.ts +10 -0
  337. package/dist/targets/index.d.ts.map +1 -0
  338. package/dist/targets/index.js +12 -0
  339. package/dist/targets/index.js.map +1 -0
  340. package/dist/targets/loader.d.ts +19 -0
  341. package/dist/targets/loader.d.ts.map +1 -0
  342. package/dist/targets/loader.js +159 -0
  343. package/dist/targets/loader.js.map +1 -0
  344. package/dist/targets/resolver.d.ts +19 -0
  345. package/dist/targets/resolver.d.ts.map +1 -0
  346. package/dist/targets/resolver.js +37 -0
  347. package/dist/targets/resolver.js.map +1 -0
  348. package/dist/targets/target-registry.d.ts +61 -0
  349. package/dist/targets/target-registry.d.ts.map +1 -0
  350. package/dist/targets/target-registry.js +93 -0
  351. package/dist/targets/target-registry.js.map +1 -0
  352. package/dist/targets/types.d.ts +85 -0
  353. package/dist/targets/types.d.ts.map +1 -0
  354. package/dist/targets/types.js +5 -0
  355. package/dist/targets/types.js.map +1 -0
  356. package/dist/tool.d.ts +17 -0
  357. package/dist/tool.d.ts.map +1 -0
  358. package/dist/tool.js +282 -0
  359. package/dist/tool.js.map +1 -0
  360. package/dist/types/findings.d.ts +117 -0
  361. package/dist/types/findings.d.ts.map +1 -0
  362. package/dist/types/findings.js +93 -0
  363. package/dist/types/findings.js.map +1 -0
  364. package/dist/types/severity.d.ts +15 -0
  365. package/dist/types/severity.d.ts.map +1 -0
  366. package/dist/types/severity.js +36 -0
  367. package/dist/types/severity.js.map +1 -0
  368. package/package.json +45 -0
  369. package/src/__tests__/gate.test.ts +537 -0
  370. package/src/__tests__/sarif.test.ts +201 -0
  371. package/src/cli/dashboard.ts +93 -0
  372. package/src/cli/fit.ts +612 -0
  373. package/src/cli/list-checks.ts +32 -0
  374. package/src/cli/list-recipes.ts +38 -0
  375. package/src/framework/__tests__/ast-utilities.test.ts +157 -0
  376. package/src/framework/__tests__/check-config.test.ts +65 -0
  377. package/src/framework/__tests__/command-executor.test.ts +79 -0
  378. package/src/framework/__tests__/content-filter-dispatch.test.ts +132 -0
  379. package/src/framework/__tests__/content-filter.test.ts +136 -0
  380. package/src/framework/__tests__/define-check.test.ts +180 -0
  381. package/src/framework/__tests__/directive-inventory.test.ts +53 -0
  382. package/src/framework/__tests__/execution-context.test.ts +80 -0
  383. package/src/framework/__tests__/file-accessor.test.ts +121 -0
  384. package/src/framework/__tests__/file-cache.test.ts +142 -0
  385. package/src/framework/__tests__/import-graph.test.ts +282 -0
  386. package/src/framework/__tests__/path-matcher.test.ts +130 -0
  387. package/src/framework/__tests__/register-helpers.test.ts +51 -0
  388. package/src/framework/__tests__/registry.test.ts +243 -0
  389. package/src/framework/__tests__/result-builder.test.ts +178 -0
  390. package/src/framework/__tests__/scope-resolver.test.ts +208 -0
  391. package/src/framework/__tests__/severity-mapping.test.ts +50 -0
  392. package/src/framework/__tests__/strip-literals.test.ts +109 -0
  393. package/src/framework/abortable-exec.ts +177 -0
  394. package/src/framework/ast-utilities.ts +112 -0
  395. package/src/framework/check-config.ts +339 -0
  396. package/src/framework/check-types.ts +77 -0
  397. package/src/framework/command-executor.ts +100 -0
  398. package/src/framework/constants.ts +16 -0
  399. package/src/framework/content-filter.ts +288 -0
  400. package/src/framework/define-check.ts +336 -0
  401. package/src/framework/directive-inventory.ts +110 -0
  402. package/src/framework/directive-parsing.ts +152 -0
  403. package/src/framework/execution-context.ts +247 -0
  404. package/src/framework/file-accessor.ts +171 -0
  405. package/src/framework/file-cache.ts +220 -0
  406. package/src/framework/file-type-filter.ts +25 -0
  407. package/src/framework/ignore-processing.ts +350 -0
  408. package/src/framework/import-graph.ts +280 -0
  409. package/src/framework/memory-profiler.ts +145 -0
  410. package/src/framework/parse-cache.ts +38 -0
  411. package/src/framework/path-matcher.ts +191 -0
  412. package/src/framework/register-helpers.ts +20 -0
  413. package/src/framework/registry.ts +125 -0
  414. package/src/framework/result-builder.ts +225 -0
  415. package/src/framework/scope-resolver.ts +262 -0
  416. package/src/framework/severity-mapping.ts +56 -0
  417. package/src/framework/strip-literals.ts +200 -0
  418. package/src/gate.ts +337 -0
  419. package/src/index.ts +110 -0
  420. package/src/plugins/__tests__/check-package-discovery.test.ts +204 -0
  421. package/src/plugins/__tests__/lang-domain.test.ts +198 -0
  422. package/src/plugins/__tests__/loader.test.ts +226 -0
  423. package/src/plugins/check-package-discovery.ts +242 -0
  424. package/src/plugins/loader.ts +327 -0
  425. package/src/plugins/types.ts +25 -0
  426. package/src/recipes/__tests__/built-in-recipes.test.ts +107 -0
  427. package/src/recipes/__tests__/check-config.test.ts +51 -0
  428. package/src/recipes/__tests__/check-resolution.test.ts +185 -0
  429. package/src/recipes/__tests__/registry.test.ts +115 -0
  430. package/src/recipes/__tests__/retry.test.ts +83 -0
  431. package/src/recipes/__tests__/service.test.ts +572 -0
  432. package/src/recipes/built-in-recipes.ts +273 -0
  433. package/src/recipes/check-config.ts +64 -0
  434. package/src/recipes/check-resolution.ts +169 -0
  435. package/src/recipes/check-result-processor.ts +258 -0
  436. package/src/recipes/parallel-execution.ts +220 -0
  437. package/src/recipes/registry.ts +192 -0
  438. package/src/recipes/retry.ts +69 -0
  439. package/src/recipes/sequential-execution.ts +139 -0
  440. package/src/recipes/service-types.ts +105 -0
  441. package/src/recipes/service.ts +400 -0
  442. package/src/recipes/types.ts +247 -0
  443. package/src/sarif.ts +232 -0
  444. package/src/signalers/__tests__/loader.test.ts +99 -0
  445. package/src/signalers/index.ts +9 -0
  446. package/src/signalers/loader.ts +141 -0
  447. package/src/signalers/schema.ts +117 -0
  448. package/src/signalers/types.ts +15 -0
  449. package/src/targets/__tests__/loader.test.ts +170 -0
  450. package/src/targets/__tests__/resolver.test.ts +74 -0
  451. package/src/targets/__tests__/target-registry.test.ts +103 -0
  452. package/src/targets/index.ts +13 -0
  453. package/src/targets/loader.ts +214 -0
  454. package/src/targets/resolver.ts +44 -0
  455. package/src/targets/target-registry.ts +111 -0
  456. package/src/targets/types.ts +89 -0
  457. package/src/tool.ts +302 -0
  458. package/src/types/findings.ts +239 -0
  459. package/src/types/severity.ts +39 -0
  460. package/tsconfig.json +8 -0
  461. package/vitest.config.ts +33 -0
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @fileoverview Memory profiler for fitness checks
3
+ *
4
+ * Always-on, low-overhead memory tracking for check execution.
5
+ * Collects per-check profiles for trending analysis.
6
+ */
7
+ const DEFAULT_MEMORY_WARNING_THRESHOLD_MB = 200;
8
+ /** Low-overhead memory profiler that tracks per-check heap usage during fitness runs */
9
+ class MemoryProfiler {
10
+ profiles = [];
11
+ prewarmMemoryMB = 0;
12
+ peakMemoryMB = 0;
13
+ warningThresholdMB;
14
+ constructor(warningThresholdMB = DEFAULT_MEMORY_WARNING_THRESHOLD_MB) {
15
+ this.warningThresholdMB = warningThresholdMB;
16
+ }
17
+ takeSnapshot() {
18
+ const mem = process.memoryUsage();
19
+ return {
20
+ heapUsed: mem.heapUsed,
21
+ heapTotal: mem.heapTotal,
22
+ external: mem.external,
23
+ arrayBuffers: mem.arrayBuffers,
24
+ rss: mem.rss,
25
+ };
26
+ }
27
+ bytesToMB(bytes) {
28
+ return bytes / 1024 / 1024;
29
+ }
30
+ /** Record memory baseline after cache prewarm completes */
31
+ recordPrewarmComplete() {
32
+ const snapshot = this.takeSnapshot();
33
+ this.prewarmMemoryMB = this.bytesToMB(snapshot.heapUsed);
34
+ this.peakMemoryMB = this.prewarmMemoryMB;
35
+ }
36
+ /** Return current heap usage in megabytes */
37
+ getCurrentMemoryMB() {
38
+ const snapshot = this.takeSnapshot();
39
+ return this.bytesToMB(snapshot.heapUsed);
40
+ }
41
+ /** Record memory before a check starts; returns the pre-check heap in MB */
42
+ recordCheckStart() {
43
+ return this.getCurrentMemoryMB();
44
+ }
45
+ /** Record memory after a check completes and return the check's memory profile */
46
+ recordCheckComplete(checkId, memoryBeforeMB, violationCount, durationMs) {
47
+ const memoryAfterMB = this.getCurrentMemoryMB();
48
+ const memoryDeltaMB = memoryAfterMB - memoryBeforeMB;
49
+ if (memoryAfterMB > this.peakMemoryMB) {
50
+ this.peakMemoryMB = memoryAfterMB;
51
+ }
52
+ const profile = {
53
+ checkId,
54
+ memoryBeforeMB: Math.round(memoryBeforeMB * 100) / 100,
55
+ memoryAfterMB: Math.round(memoryAfterMB * 100) / 100,
56
+ memoryDeltaMB: Math.round(memoryDeltaMB * 100) / 100,
57
+ violationCount,
58
+ durationMs,
59
+ };
60
+ this.profiles.push(profile);
61
+ return profile;
62
+ }
63
+ /** Check whether a memory delta exceeds the configured warning threshold */
64
+ exceedsThreshold(deltaMB) {
65
+ return deltaMB > this.warningThresholdMB;
66
+ }
67
+ /** Return the configured warning threshold in megabytes */
68
+ getWarningThresholdMB() {
69
+ return this.warningThresholdMB;
70
+ }
71
+ /** Build and return an aggregated summary of all recorded check profiles */
72
+ getSummary() {
73
+ const sortedProfiles = [...this.profiles].sort((a, b) => b.memoryDeltaMB - a.memoryDeltaMB);
74
+ const checksExceedingThreshold = this.profiles.filter((p) => p.memoryDeltaMB > this.warningThresholdMB).length;
75
+ return {
76
+ prewarmMemoryMB: Math.round(this.prewarmMemoryMB * 100) / 100,
77
+ peakMemoryMB: Math.round(this.peakMemoryMB * 100) / 100,
78
+ checksExceedingThreshold,
79
+ topConsumers: sortedProfiles.slice(0, 10),
80
+ allProfiles: this.profiles,
81
+ };
82
+ }
83
+ /** Reset all recorded profiles and counters */
84
+ reset() {
85
+ this.profiles.length = 0;
86
+ this.prewarmMemoryMB = 0;
87
+ this.peakMemoryMB = 0;
88
+ }
89
+ }
90
+ /** Shared singleton memory profiler instance used across fitness check runs */
91
+ export const memoryProfiler = new MemoryProfiler();
92
+ //# sourceMappingURL=memory-profiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-profiler.js","sourceRoot":"","sources":["../../src/framework/memory-profiler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH,MAAM,mCAAmC,GAAG,GAAG,CAAA;AAE/C,wFAAwF;AACxF,MAAM,cAAc;IACD,QAAQ,GAAyB,EAAE,CAAA;IAC5C,eAAe,GAAG,CAAC,CAAA;IACnB,YAAY,GAAG,CAAC,CAAA;IACP,kBAAkB,CAAQ;IAE3C,YAAY,kBAAkB,GAAG,mCAAmC;QAClE,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;IAC9C,CAAC;IAEO,YAAY;QAClB,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAA;QACjC,OAAO;YACL,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,YAAY,EAAE,GAAG,CAAC,YAAY;YAC9B,GAAG,EAAE,GAAG,CAAC,GAAG;SACb,CAAA;IACH,CAAC;IAEO,SAAS,CAAC,KAAa;QAC7B,OAAO,KAAK,GAAG,IAAI,GAAG,IAAI,CAAA;IAC5B,CAAC;IAED,2DAA2D;IAC3D,qBAAqB;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA;QACpC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QACxD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,eAAe,CAAA;IAC1C,CAAC;IAED,6CAA6C;IAC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AE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,aAAa,CAAC,CAAA;QAE3F,MAAM,wBAAwB,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CACnD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,GAAG,IAAI,CAAC,kBAAkB,CACjD,CAAC,MAAM,CAAA;QAER,OAAO;YACL,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC,GAAG,GAAG;YAC7D,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,GAAG,GAAG;YACvD,wBAAwB;YACxB,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;YACzC,WAAW,EAAE,IAAI,CAAC,QAAQ;SAC3B,CAAA;IACH,CAAC;IAED,+CAA+C;IAC/C,KAAK;QACH,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAA;IACvB,CAAC;CACF;AAED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAA"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @fileoverview Re-export from the language-aware parse cache.
3
+ *
4
+ * The init/clear lifecycle and getParseTree API live in
5
+ * core/src/languages/parse-cache.ts. This file forwards those calls
6
+ * for backward compatibility with code that imported from this path.
7
+ *
8
+ * getSharedSourceFile remains as a TS-specific convenience wrapper
9
+ * that resolves the TypeScript adapter from the language registry.
10
+ * Phase 2 moved the canonical TS AST helpers to
11
+ * @opensip-tools/lang-typescript; this shim is retained for the
12
+ * core framework/import-graph.ts internal use case.
13
+ */
14
+ import ts from 'typescript';
15
+ /**
16
+ * Get a TypeScript SourceFile via the language-aware cache when the TS
17
+ * adapter is registered, falling back to a direct parse otherwise.
18
+ *
19
+ * @internal Used by framework/import-graph.ts. New TS check authors
20
+ * should import getSharedSourceFile from @opensip-tools/lang-typescript.
21
+ */
22
+ export declare function getSharedSourceFile(filePath: string, content: string): ts.SourceFile | null;
23
+ //# sourceMappingURL=parse-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-cache.d.ts","sourceRoot":"","sources":["../../src/framework/parse-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,GAAG,IAAI,CAY3F"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @fileoverview Re-export from the language-aware parse cache.
3
+ *
4
+ * The init/clear lifecycle and getParseTree API live in
5
+ * core/src/languages/parse-cache.ts. This file forwards those calls
6
+ * for backward compatibility with code that imported from this path.
7
+ *
8
+ * getSharedSourceFile remains as a TS-specific convenience wrapper
9
+ * that resolves the TypeScript adapter from the language registry.
10
+ * Phase 2 moved the canonical TS AST helpers to
11
+ * @opensip-tools/lang-typescript; this shim is retained for the
12
+ * core framework/import-graph.ts internal use case.
13
+ */
14
+ import { getParseTree, defaultLanguageRegistry } from '@opensip-tools/core';
15
+ import ts from 'typescript';
16
+ /**
17
+ * Get a TypeScript SourceFile via the language-aware cache when the TS
18
+ * adapter is registered, falling back to a direct parse otherwise.
19
+ *
20
+ * @internal Used by framework/import-graph.ts. New TS check authors
21
+ * should import getSharedSourceFile from @opensip-tools/lang-typescript.
22
+ */
23
+ export function getSharedSourceFile(filePath, content) {
24
+ const adapter = defaultLanguageRegistry.get('typescript');
25
+ if (adapter) {
26
+ return getParseTree(adapter, filePath, content);
27
+ }
28
+ // No adapter registered yet (e.g. unit tests that run without CLI bootstrap).
29
+ // Fall back to direct parse — preserves prior behavior.
30
+ try {
31
+ return ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
32
+ }
33
+ catch {
34
+ return null;
35
+ }
36
+ }
37
+ //# sourceMappingURL=parse-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-cache.js","sourceRoot":"","sources":["../../src/framework/parse-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,OAAe;IACnE,MAAM,OAAO,GAAG,uBAAuB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAyB,CAAA;IACzE,CAAC;IACD,8EAA8E;IAC9E,wDAAwD;IACxD,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAChG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * @fileoverview PathMatcher - Strategy pattern for file matching
3
+ *
4
+ * Provides glob-based file matching with include/exclude patterns.
5
+ * Supports lazy evaluation and composition.
6
+ */
7
+ /**
8
+ * Options for PathMatcher.
9
+ */
10
+ export interface PathMatcherOptions {
11
+ /** Root directory to search from */
12
+ readonly cwd: string;
13
+ /** Glob patterns to include */
14
+ readonly include: readonly string[];
15
+ /** Glob patterns to exclude */
16
+ readonly exclude: readonly string[];
17
+ /** Additional exclusion patterns (combined with exclude) */
18
+ readonly additionalExcludes?: readonly string[];
19
+ }
20
+ /**
21
+ * Result of file matching operation.
22
+ */
23
+ export interface MatchResult {
24
+ /** Matched files (absolute paths) */
25
+ readonly files: readonly string[];
26
+ /** Files that were excluded */
27
+ readonly excluded: readonly string[];
28
+ /** Time taken for glob operation in ms */
29
+ readonly durationMs: number;
30
+ }
31
+ /**
32
+ * Strategy for matching files based on glob patterns.
33
+ * Supports both custom patterns and composition.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * const matcher = PathMatcher.create({
38
+ * cwd: '/path/to/repo',
39
+ * include: ['src/**\/*.ts'],
40
+ * exclude: ['**\/__tests__/**'],
41
+ * });
42
+ * const files = await matcher.files();
43
+ * ```
44
+ */
45
+ export declare class PathMatcher {
46
+ private readonly options;
47
+ private constructor();
48
+ /**
49
+ * Create a PathMatcher from options.
50
+ */
51
+ static create(options: PathMatcherOptions): PathMatcher;
52
+ /**
53
+ * Get all matching files.
54
+ * @returns Array of absolute file paths matching the patterns
55
+ */
56
+ files(): Promise<readonly string[]>;
57
+ /**
58
+ * Get detailed match result including timing.
59
+ */
60
+ match(): Promise<MatchResult>;
61
+ /**
62
+ * Check if a file matches the patterns.
63
+ * @param filePath - Absolute path to check
64
+ * @returns True if file matches include patterns and is not excluded
65
+ */
66
+ matches(filePath: string): boolean;
67
+ /**
68
+ * Create a new PathMatcher with additional exclusions.
69
+ */
70
+ withExcludes(additionalExcludes: readonly string[]): PathMatcher;
71
+ /**
72
+ * Create a new PathMatcher that only includes TypeScript files.
73
+ */
74
+ typescriptOnly(): PathMatcher;
75
+ /**
76
+ * Create a new PathMatcher that excludes test files.
77
+ */
78
+ noTests(): PathMatcher;
79
+ /** Get the current working directory. */
80
+ get cwd(): string;
81
+ /** Get the include patterns. */
82
+ get includePatterns(): readonly string[];
83
+ /** Get the exclude patterns. */
84
+ get excludePatterns(): readonly string[];
85
+ }
86
+ //# sourceMappingURL=path-matcher.d.ts.map
@@ -0,0 +1 @@
1
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AAgC;IAChC,IAAI,eAAe,IAAI,SAAS,MAAM,EAAE,CAEvC;IAED,gCAAgC;IAChC,IAAI,eAAe,IAAI,SAAS,MAAM,EAAE,CAEvC;CACF"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * @fileoverview PathMatcher - Strategy pattern for file matching
3
+ *
4
+ * Provides glob-based file matching with include/exclude patterns.
5
+ * Supports lazy evaluation and composition.
6
+ */
7
+ import * as path from 'node:path';
8
+ import { glob } from 'glob';
9
+ import { minimatch } from 'minimatch';
10
+ /**
11
+ * Strategy for matching files based on glob patterns.
12
+ * Supports both custom patterns and composition.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const matcher = PathMatcher.create({
17
+ * cwd: '/path/to/repo',
18
+ * include: ['src/**\/*.ts'],
19
+ * exclude: ['**\/__tests__/**'],
20
+ * });
21
+ * const files = await matcher.files();
22
+ * ```
23
+ */
24
+ export class PathMatcher {
25
+ options;
26
+ constructor(options) {
27
+ this.options = options;
28
+ }
29
+ /**
30
+ * Create a PathMatcher from options.
31
+ */
32
+ static create(options) {
33
+ return new PathMatcher(options);
34
+ }
35
+ /**
36
+ * Get all matching files.
37
+ * @returns Array of absolute file paths matching the patterns
38
+ */
39
+ async files() {
40
+ const result = await this.match();
41
+ return result.files;
42
+ }
43
+ /**
44
+ * Get detailed match result including timing.
45
+ */
46
+ async match() {
47
+ const start = Date.now();
48
+ const allExcludes = [...this.options.exclude, ...(this.options.additionalExcludes ?? [])];
49
+ // Run glob for all include patterns
50
+ const matchedSets = await Promise.all(this.options.include.map((pattern) => glob(pattern, {
51
+ cwd: this.options.cwd,
52
+ absolute: true,
53
+ nodir: true,
54
+ ignore: allExcludes,
55
+ })));
56
+ // Combine and deduplicate results
57
+ const allMatched = new Set();
58
+ for (const matches of matchedSets) {
59
+ for (const file of matches) {
60
+ allMatched.add(path.normalize(file));
61
+ }
62
+ }
63
+ const files = [...allMatched].sort();
64
+ const durationMs = Date.now() - start;
65
+ return {
66
+ files,
67
+ excluded: [],
68
+ durationMs,
69
+ };
70
+ }
71
+ /**
72
+ * Check if a file matches the patterns.
73
+ * @param filePath - Absolute path to check
74
+ * @returns True if file matches include patterns and is not excluded
75
+ */
76
+ matches(filePath) {
77
+ const relativePath = path.relative(this.options.cwd, filePath);
78
+ const matchesInclude = this.options.include.some((pattern) => minimatch(relativePath, pattern, { dot: true }));
79
+ if (!matchesInclude) {
80
+ return false;
81
+ }
82
+ const allExcludes = [...this.options.exclude, ...(this.options.additionalExcludes ?? [])];
83
+ const matchesExclude = allExcludes.some((pattern) => minimatch(relativePath, pattern, { dot: true }));
84
+ return !matchesExclude;
85
+ }
86
+ /**
87
+ * Create a new PathMatcher with additional exclusions.
88
+ */
89
+ withExcludes(additionalExcludes) {
90
+ return new PathMatcher({
91
+ ...this.options,
92
+ additionalExcludes: [...(this.options.additionalExcludes ?? []), ...additionalExcludes],
93
+ });
94
+ }
95
+ /**
96
+ * Create a new PathMatcher that only includes TypeScript files.
97
+ */
98
+ typescriptOnly() {
99
+ return new PathMatcher({
100
+ ...this.options,
101
+ include: this.options.include.map((pattern) => {
102
+ if (pattern.endsWith('/*') || pattern.endsWith('/**/*')) {
103
+ const base = pattern.replace(/\/\*+$/, '');
104
+ return `${base}/**/*.{ts,tsx}`;
105
+ }
106
+ if (!pattern.includes('.')) {
107
+ return `${pattern}/**/*.{ts,tsx}`;
108
+ }
109
+ return pattern;
110
+ }),
111
+ });
112
+ }
113
+ /**
114
+ * Create a new PathMatcher that excludes test files.
115
+ */
116
+ noTests() {
117
+ return this.withExcludes([
118
+ '**/__tests__/**',
119
+ '**/*.test.ts',
120
+ '**/*.test.tsx',
121
+ '**/*.spec.ts',
122
+ '**/*.spec.tsx',
123
+ ]);
124
+ }
125
+ /** Get the current working directory. */
126
+ get cwd() {
127
+ return this.options.cwd;
128
+ }
129
+ /** Get the include patterns. */
130
+ get includePatterns() {
131
+ return this.options.include;
132
+ }
133
+ /** Get the exclude patterns. */
134
+ get excludePatterns() {
135
+ return [...this.options.exclude, ...(this.options.additionalExcludes ?? [])];
136
+ }
137
+ }
138
+ //# sourceMappingURL=path-matcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-matcher.js","sourceRoot":"","sources":["../../src/framework/path-matcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AA4BrC;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,WAAW;IACe;IAArC,YAAqC,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAG,CAAC;IAEpE;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,OAA2B;QACvC,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,CAAA;IACjC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QACjC,OAAO,MAAM,CAAC,KAAK,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAExB,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,CAAA;QAEzF,oCAAoC;QACpC,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CACnC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CACnC,IAAI,CAAC,OAAO,EAAE;YACZ,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG;YACrB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,WAAW;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Ae;QACjB,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,CAAA;IAC9E,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @fileoverview Helper for registering checks with a namespace
3
+ */
4
+ import type { Check } from './check-types.js';
5
+ /**
6
+ * Register an array of checks with a namespace into the default registry.
7
+ * @returns The number of checks registered.
8
+ */
9
+ export declare function registerChecks(checks: Check[], namespace: string): number;
10
+ //# sourceMappingURL=register-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-helpers.d.ts","sourceRoot":"","sources":["../../src/framework/register-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @fileoverview Helper for registering checks with a namespace
3
+ */
4
+ import { defaultRegistry } from './registry.js';
5
+ /**
6
+ * Register an array of checks with a namespace into the default registry.
7
+ * @returns The number of checks registered.
8
+ */
9
+ export function registerChecks(checks, namespace) {
10
+ let count = 0;
11
+ for (const check of checks) {
12
+ defaultRegistry.register(check, namespace);
13
+ count++;
14
+ }
15
+ return count;
16
+ }
17
+ //# sourceMappingURL=register-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-helpers.js","sourceRoot":"","sources":["../../src/framework/register-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIhD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAe,EAAE,SAAiB;IAC/D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,eAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC3C,KAAK,EAAE,CAAC;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Check registry — central registration and discovery.
3
+ *
4
+ * Supports namespaced slugs: checks are stored as `namespace:slug` when
5
+ * a namespace is provided. Bare slug lookups resolve via a reverse index,
6
+ * with a warning logged on ambiguity.
7
+ */
8
+ import type { Check } from './check-types.js';
9
+ export declare class CheckRegistry {
10
+ /** Primary store: key is `namespace:slug` or bare `slug` */
11
+ private readonly checks;
12
+ /** Reverse index: bare slug → list of namespaced keys */
13
+ private readonly bareSlugIndex;
14
+ register(check: Check, namespace?: string): void;
15
+ /** Get a check by slug. Supports both namespaced and bare slugs. */
16
+ get(slug: string): Check;
17
+ /** Check whether a slug is registered (namespaced or bare). */
18
+ has(slug: string): boolean;
19
+ list(): Check[];
20
+ /** Get the namespace a check was registered under. Returns undefined for bare slugs. */
21
+ getNamespace(bareSlug: string): string | undefined;
22
+ listEnabled(): Check[];
23
+ byTag(tag: string): Check[];
24
+ /** Get a check by slug, returning undefined if not found. */
25
+ getBySlug(slug: string): Check | undefined;
26
+ /** Return all registered keys (namespaced where applicable). */
27
+ listSlugs(): string[];
28
+ /** Return all checks with a given bare slug across all namespaces. */
29
+ listByBareSlug(bareSlug: string): Check[];
30
+ get size(): number;
31
+ /**
32
+ * Resolve a slug to a Check.
33
+ * - If slug contains ':', exact lookup.
34
+ * - If bare slug, use reverse index. Single match → return. Multiple → warn + return first.
35
+ */
36
+ private resolve;
37
+ }
38
+ /** Default global registry — checks auto-register here on import */
39
+ export declare const defaultRegistry: CheckRegistry;
40
+ export { type Check } from './check-types.js';
41
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/framework/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAI9C,qBAAa,aAAa;IACxB,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA+B;IAE7D,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAiBhD,oEAAoE;IACpE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAMxB,+DAA+D;IAC/D,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,IAAI,IAAI,KAAK,EAAE;IAIf,wFAAwF;IACxF,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQlD,WAAW,IAAI,KAAK,EAAE;IAItB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE;IAI3B,6DAA6D;IAC7D,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS;IAI1C,gEAAgE;IAChE,SAAS,IAAI,MAAM,EAAE;IAIrB,sEAAsE;IACtE,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,EAAE;IAKzC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;OAIG;IACH,OAAO,CAAC,OAAO;CAwBhB;AAED,oEAAoE;AACpE,eAAO,MAAM,eAAe,eAAsB,CAAC;AAEnD,OAAO,EAAC,KAAK,KAAK,EAAC,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Check registry — central registration and discovery.
3
+ *
4
+ * Supports namespaced slugs: checks are stored as `namespace:slug` when
5
+ * a namespace is provided. Bare slug lookups resolve via a reverse index,
6
+ * with a warning logged on ambiguity.
7
+ */
8
+ import { NotFoundError, logger } from '@opensip-tools/core';
9
+ export class CheckRegistry {
10
+ /** Primary store: key is `namespace:slug` or bare `slug` */
11
+ checks = new Map();
12
+ /** Reverse index: bare slug → list of namespaced keys */
13
+ bareSlugIndex = new Map();
14
+ register(check, namespace) {
15
+ const bareSlug = check.config.slug;
16
+ const key = namespace ? `${namespace}:${bareSlug}` : bareSlug;
17
+ if (this.checks.has(key)) {
18
+ // Silently skip duplicate — same check imported multiple times
19
+ return;
20
+ }
21
+ this.checks.set(key, check);
22
+ // Update bare slug index
23
+ const existing = this.bareSlugIndex.get(bareSlug) ?? [];
24
+ existing.push(key);
25
+ this.bareSlugIndex.set(bareSlug, existing);
26
+ }
27
+ /** Get a check by slug. Supports both namespaced and bare slugs. */
28
+ get(slug) {
29
+ const check = this.resolve(slug);
30
+ if (!check)
31
+ throw new NotFoundError(`Check not found: ${slug}`);
32
+ return check;
33
+ }
34
+ /** Check whether a slug is registered (namespaced or bare). */
35
+ has(slug) {
36
+ return this.resolve(slug) !== undefined;
37
+ }
38
+ list() {
39
+ return [...this.checks.values()];
40
+ }
41
+ /** Get the namespace a check was registered under. Returns undefined for bare slugs. */
42
+ getNamespace(bareSlug) {
43
+ const keys = this.bareSlugIndex.get(bareSlug);
44
+ if (!keys || keys.length === 0)
45
+ return undefined;
46
+ const key = keys[0];
47
+ const colonIdx = key.indexOf(':');
48
+ return colonIdx === -1 ? undefined : key.slice(0, colonIdx);
49
+ }
50
+ listEnabled() {
51
+ return this.list().filter(c => !c.config.disabled);
52
+ }
53
+ byTag(tag) {
54
+ return this.listEnabled().filter(c => c.config.tags?.includes(tag));
55
+ }
56
+ /** Get a check by slug, returning undefined if not found. */
57
+ getBySlug(slug) {
58
+ return this.resolve(slug);
59
+ }
60
+ /** Return all registered keys (namespaced where applicable). */
61
+ listSlugs() {
62
+ return [...this.checks.keys()];
63
+ }
64
+ /** Return all checks with a given bare slug across all namespaces. */
65
+ listByBareSlug(bareSlug) {
66
+ const keys = this.bareSlugIndex.get(bareSlug) ?? [];
67
+ return keys.map(k => this.checks.get(k)).filter((c) => c !== undefined);
68
+ }
69
+ get size() {
70
+ return this.checks.size;
71
+ }
72
+ /**
73
+ * Resolve a slug to a Check.
74
+ * - If slug contains ':', exact lookup.
75
+ * - If bare slug, use reverse index. Single match → return. Multiple → warn + return first.
76
+ */
77
+ resolve(slug) {
78
+ // Exact match (namespaced or bare)
79
+ const exact = this.checks.get(slug);
80
+ if (exact)
81
+ return exact;
82
+ // If it contains ':', it was a namespaced lookup that didn't match
83
+ if (slug.includes(':'))
84
+ return undefined;
85
+ // Bare slug → reverse index
86
+ const candidates = this.bareSlugIndex.get(slug);
87
+ if (!candidates || candidates.length === 0)
88
+ return undefined;
89
+ if (candidates.length > 1) {
90
+ logger.warn({
91
+ evt: 'plugin.registry.collision',
92
+ module: 'core:registry',
93
+ bareSlug: slug,
94
+ candidates,
95
+ msg: `Ambiguous slug '${slug}' matches ${candidates.length} checks — using first registered`,
96
+ });
97
+ }
98
+ return this.checks.get(candidates[0]);
99
+ }
100
+ }
101
+ /** Default global registry — checks auto-register here on import */
102
+ export const defaultRegistry = new CheckRegistry();
103
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/framework/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAG,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7D,MAAM,OAAO,aAAa;IACxB,4DAA4D;IAC3C,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IACnD,yDAAyD;IACxC,aAAa,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE7D,QAAQ,CAAC,KAAY,EAAE,SAAkB;QACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QACnC,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;QAE9D,IAAI,IAAI,CAA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