@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,188 @@
1
+ /**
2
+ * @fileoverview Shared utilities for stripping string literal and comment
3
+ * content from source code. Used by fitness checks to avoid false positives
4
+ * from patterns appearing inside string literals or comments.
5
+ */
6
+ /**
7
+ * Strip string literal contents from a single line.
8
+ * Replaces content inside '...', "...", and `...` with empty strings.
9
+ * Used by checks for per-line pattern matching to avoid false positives
10
+ * from patterns appearing inside string literals.
11
+ */
12
+ export function stripStringLiterals(line) {
13
+ return line
14
+ .replaceAll(/'(?:[^'\\]|\\.)*'/g, "''")
15
+ .replaceAll(/"(?:[^"\\]|\\.)*"/g, '""')
16
+ .replaceAll(/`(?:[^`\\]|\\.)*`/gs, '``');
17
+ }
18
+ /** Shared regex patterns for string literal replacement */
19
+ const SINGLE_QUOTE_RE = /'(?:[^'\\]|\\.)*'/g;
20
+ const DOUBLE_QUOTE_RE = /"(?:[^"\\]|\\.)*"/g;
21
+ const BACKTICK_RE = /`(?:[^`\\]|\\.)*`/gs;
22
+ /**
23
+ * Strip string literals and single-line comments from full file content.
24
+ * Used by checks for quick-filter gates to avoid matching keywords
25
+ * that only appear in documentation strings or comments.
26
+ */
27
+ /**
28
+ * Check if a position in a line is inside a string literal.
29
+ * Scans characters before the match position for unescaped quotes/backticks.
30
+ * Used by checks to avoid false positives from suggestion/description text.
31
+ */
32
+ export function isInsideStringLiteral(line, matchIndex) {
33
+ let inSingle = false;
34
+ let inDouble = false;
35
+ let inTemplate = false;
36
+ let escaped = false;
37
+ for (let i = 0; i < matchIndex; i++) {
38
+ const ch = line[i];
39
+ if (escaped) {
40
+ escaped = false;
41
+ continue;
42
+ }
43
+ if (ch === '\\' && (inSingle || inDouble || inTemplate)) {
44
+ escaped = true;
45
+ continue;
46
+ }
47
+ if (ch === "'" && !inDouble && !inTemplate)
48
+ inSingle = !inSingle;
49
+ else if (ch === '"' && !inSingle && !inTemplate)
50
+ inDouble = !inDouble;
51
+ else if (ch === '`' && !inSingle && !inDouble)
52
+ inTemplate = !inTemplate;
53
+ }
54
+ return inSingle || inDouble || inTemplate;
55
+ }
56
+ /**
57
+ * Strip string literals and single-line comments from full file content.
58
+ * Used by checks for quick-filter gates to avoid matching keywords
59
+ * that only appear in documentation strings or comments.
60
+ */
61
+ export function stripStringsAndComments(content) {
62
+ // Strip string literals first
63
+ let result = content
64
+ .replaceAll(SINGLE_QUOTE_RE, "''")
65
+ .replaceAll(DOUBLE_QUOTE_RE, '""')
66
+ .replaceAll(BACKTICK_RE, '``');
67
+ // Strip single-line comments (after string stripping to avoid matching // inside strings)
68
+ // eslint-disable-next-line sonarjs/slow-regex -- .*$ anchored to line end; linear scan
69
+ result = result.replaceAll(/\/\/.*$/gm, '');
70
+ return result;
71
+ }
72
+ /**
73
+ * Strip strings, single-line comments, AND block comments while preserving
74
+ * BOTH character positions and line numbers. Each stripped character is
75
+ * replaced with a space (non-newline) so the output has identical length
76
+ * and line offsets to the input. Use this when downstream processing
77
+ * needs to map a match index back to a line number in the ORIGINAL
78
+ * source — `stripStringsAndComments` collapses string literals to empty
79
+ * pairs, which shifts indexes and breaks `getLineNumber(content, idx)`.
80
+ *
81
+ * Strips:
82
+ * - Single-quoted, double-quoted, and template-literal string contents
83
+ * - Single-line `// ...` comments (to end of line)
84
+ * - Block `/* ... *\/` comments (including JSDoc `/** ... *\/`)
85
+ *
86
+ * Preserves: newlines, total character count, character positions of
87
+ * code OUTSIDE these regions.
88
+ */
89
+ // eslint-disable-next-line sonarjs/cognitive-complexity -- token-state-machine: single-pass tokenizer, branches reflect quote/comment state
90
+ export function stripStringsAndCommentsPreservingPositions(content) {
91
+ const out = [];
92
+ let i = 0;
93
+ let inSingle = false;
94
+ let inDouble = false;
95
+ let inTemplate = false;
96
+ let inLineComment = false;
97
+ let inBlockComment = false;
98
+ let escaped = false;
99
+ while (i < content.length) {
100
+ const ch = content[i];
101
+ const next = content[i + 1];
102
+ // Inside any string: blank out chars (preserve newlines) until terminator.
103
+ if (inSingle || inDouble || inTemplate) {
104
+ if (escaped) {
105
+ out.push(ch === '\n' ? '\n' : ' ');
106
+ escaped = false;
107
+ i++;
108
+ continue;
109
+ }
110
+ if (ch === '\\') {
111
+ out.push(' ');
112
+ escaped = true;
113
+ i++;
114
+ continue;
115
+ }
116
+ if ((ch === "'" && inSingle) || (ch === '"' && inDouble) || (ch === '`' && inTemplate)) {
117
+ // Keep terminator for symmetry — replace with space too. The
118
+ // string itself is gone; outer code doesn't care about the quote.
119
+ out.push(' ');
120
+ inSingle = inDouble = inTemplate = false;
121
+ i++;
122
+ continue;
123
+ }
124
+ out.push(ch === '\n' ? '\n' : ' ');
125
+ i++;
126
+ continue;
127
+ }
128
+ // Inside line comment: blank to end of line.
129
+ if (inLineComment) {
130
+ if (ch === '\n') {
131
+ inLineComment = false;
132
+ out.push('\n');
133
+ }
134
+ else {
135
+ out.push(' ');
136
+ }
137
+ i++;
138
+ continue;
139
+ }
140
+ // Inside block comment: blank until `*/`.
141
+ if (inBlockComment) {
142
+ if (ch === '*' && next === '/') {
143
+ out.push(' ');
144
+ inBlockComment = false;
145
+ i += 2;
146
+ continue;
147
+ }
148
+ out.push(ch === '\n' ? '\n' : ' ');
149
+ i++;
150
+ continue;
151
+ }
152
+ // Outside any region: detect openers.
153
+ if (ch === '/' && next === '/') {
154
+ out.push(' ');
155
+ inLineComment = true;
156
+ i += 2;
157
+ continue;
158
+ }
159
+ if (ch === '/' && next === '*') {
160
+ out.push(' ');
161
+ inBlockComment = true;
162
+ i += 2;
163
+ continue;
164
+ }
165
+ if (ch === "'") {
166
+ out.push(' ');
167
+ inSingle = true;
168
+ i++;
169
+ continue;
170
+ }
171
+ if (ch === '"') {
172
+ out.push(' ');
173
+ inDouble = true;
174
+ i++;
175
+ continue;
176
+ }
177
+ if (ch === '`') {
178
+ out.push(' ');
179
+ inTemplate = true;
180
+ i++;
181
+ continue;
182
+ }
183
+ out.push(ch);
184
+ i++;
185
+ }
186
+ return out.join('');
187
+ }
188
+ //# sourceMappingURL=strip-literals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strip-literals.js","sourceRoot":"","sources":["../../src/framework/strip-literals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI;SACR,UAAU,CAAC,oBAAoB,EAAE,IAAI,CAAC;SACtC,UAAU,CAAC,oBAAoB,EAAE,IAAI,CAAC;SACtC,UAAU,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAA;AAC5C,CAAC;AAED,2DAA2D;AAC3D,MAAM,eAAe,GAAG,oBAAoB,CAAA;AAC5C,MAAM,eAAe,GAAG,oBAAoB,CAAA;AAC5C,MAAM,WAAW,GAAG,qBAAqB,CAAA;AAEzC;;;;GAIG;AACH;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,UAAkB;IACpE,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,UAAU,GAAG,KAAK,CAAA;IACtB,IAAI,OAAO,GAAG,KAAK,CAAA;IAEnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EA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AAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACb,QAAQ,GAAG,IAAI,CAAA;YACf,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACb,QAAQ,GAAG,IAAI,CAAA;YACf,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACb,UAAU,GAAG,IAAI,CAAA;YACjB,CAAC,EAAE,CAAA;YACH,SAAQ;QACV,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACZ,CAAC,EAAE,CAAA;IACL,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACrB,CAAC"}
package/dist/gate.d.ts ADDED
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Architecture-gate primitive — pre/post-fix regression detection.
3
+ *
4
+ * Operations:
5
+ * - saveBaseline(output, path) — persist current SARIF as the baseline
6
+ * - compareToBaseline(output, path) — diff current SARIF against baseline
7
+ * - renderGateCompareOutput(result) — pretty-print the diff for stdout
8
+ *
9
+ * Wired into the `fit` command via `--gate-save` and `--gate-compare` flags
10
+ * (see commands/fit.ts and index.ts).
11
+ *
12
+ * The baseline is opensip-tools' own SARIF document (built via buildSarifLog),
13
+ * persisted as a file. Diffs match by (filePath, ruleId, message) — line
14
+ * numbers are intentionally NOT in the matching key so unrelated line shifts
15
+ * don't register as added/resolved violations.
16
+ */
17
+ import type { CliOutput } from '@opensip-tools/contracts';
18
+ /** A single violation as it appears in the gate diff. */
19
+ interface GateViolation {
20
+ /** sha256(filePath + '\n' + ruleId + '\n' + message) — opaque identity */
21
+ readonly hash: string;
22
+ readonly ruleId: string;
23
+ readonly message: string;
24
+ readonly filePath: string;
25
+ /** Line number — informational only, NOT used in identity */
26
+ readonly line?: number;
27
+ readonly severity: 'error' | 'warning';
28
+ }
29
+ /** Result of comparing current state to a saved baseline. */
30
+ export interface GateCompareResult {
31
+ readonly baselinePath: string;
32
+ /** Violations present now but not in baseline. */
33
+ readonly added: readonly GateViolation[];
34
+ /** Violations present in baseline but not now. */
35
+ readonly resolved: readonly GateViolation[];
36
+ /** Violations present in both. */
37
+ readonly unchanged: readonly GateViolation[];
38
+ /** True iff `added` is non-empty — the gate decision. */
39
+ readonly degraded: boolean;
40
+ }
41
+ /** Thrown when --gate-compare is invoked but the baseline file doesn't exist. */
42
+ export declare class GateBaselineMissingError extends Error {
43
+ readonly baselinePath: string;
44
+ constructor(baselinePath: string);
45
+ }
46
+ /** Thrown when the baseline file exists but isn't a parseable SARIF document. */
47
+ export declare class GateBaselineInvalidError extends Error {
48
+ readonly baselinePath: string;
49
+ constructor(baselinePath: string, reason: string);
50
+ }
51
+ /**
52
+ * Default location for the baseline file when --baseline is not
53
+ * specified. Lives under the per-project gitignored runtime dir.
54
+ */
55
+ export declare const DEFAULT_BASELINE_PATH = "opensip-tools/.runtime/baseline.sarif";
56
+ /**
57
+ * Persist the current run's findings as a baseline SARIF document.
58
+ * Creates parent directories as needed. Overwrites any existing baseline.
59
+ */
60
+ export declare function saveBaseline(output: CliOutput, baselinePath: string): void;
61
+ /**
62
+ * Compare current findings against a saved baseline. Returns a structured
63
+ * diff of added / resolved / unchanged violations.
64
+ *
65
+ * @throws {GateBaselineMissingError} when the baseline file doesn't exist
66
+ * @throws {GateBaselineInvalidError} when the baseline isn't valid SARIF
67
+ */
68
+ export declare function compareToBaseline(output: CliOutput, baselinePath: string): GateCompareResult;
69
+ /**
70
+ * Pretty-print a gate compare result for stdout. Caller sets the exit code.
71
+ */
72
+ export declare function renderGateCompareOutput(result: GateCompareResult): string;
73
+ export {};
74
+ //# sourceMappingURL=gate.d.ts.map
@@ -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gB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAe1E;AAMD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,CAwD5F;AAMD;;GAEG;AAEH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA4CzE"}
package/dist/gate.js ADDED
@@ -0,0 +1,257 @@
1
+ /**
2
+ * Architecture-gate primitive — pre/post-fix regression detection.
3
+ *
4
+ * Operations:
5
+ * - saveBaseline(output, path) — persist current SARIF as the baseline
6
+ * - compareToBaseline(output, path) — diff current SARIF against baseline
7
+ * - renderGateCompareOutput(result) — pretty-print the diff for stdout
8
+ *
9
+ * Wired into the `fit` command via `--gate-save` and `--gate-compare` flags
10
+ * (see commands/fit.ts and index.ts).
11
+ *
12
+ * The baseline is opensip-tools' own SARIF document (built via buildSarifLog),
13
+ * persisted as a file. Diffs match by (filePath, ruleId, message) — line
14
+ * numbers are intentionally NOT in the matching key so unrelated line shifts
15
+ * don't register as added/resolved violations.
16
+ */
17
+ import { createHash } from 'node:crypto';
18
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
19
+ import { dirname } from 'node:path';
20
+ import { logger } from '@opensip-tools/core';
21
+ import { buildSarifLog } from './sarif.js';
22
+ /** Thrown when --gate-compare is invoked but the baseline file doesn't exist. */
23
+ export class GateBaselineMissingError extends Error {
24
+ baselinePath;
25
+ constructor(baselinePath) {
26
+ super(`Gate baseline not found at ${baselinePath}. ` +
27
+ `Run \`opensip-tools fit --gate-save\` first to create one, ` +
28
+ `or pass --baseline <path> if it lives elsewhere.`);
29
+ this.name = 'GateBaselineMissingError';
30
+ this.baselinePath = baselinePath;
31
+ }
32
+ }
33
+ /** Thrown when the baseline file exists but isn't a parseable SARIF document. */
34
+ export class GateBaselineInvalidError extends Error {
35
+ baselinePath;
36
+ constructor(baselinePath, reason) {
37
+ super(`Gate baseline at ${baselinePath} is invalid: ${reason}`);
38
+ this.name = 'GateBaselineInvalidError';
39
+ this.baselinePath = baselinePath;
40
+ }
41
+ }
42
+ // ---------------------------------------------------------------------------
43
+ // Default baseline path
44
+ // ---------------------------------------------------------------------------
45
+ /**
46
+ * Default location for the baseline file when --baseline is not
47
+ * specified. Lives under the per-project gitignored runtime dir.
48
+ */
49
+ export const DEFAULT_BASELINE_PATH = 'opensip-tools/.runtime/baseline.sarif';
50
+ // ---------------------------------------------------------------------------
51
+ // saveBaseline
52
+ // ---------------------------------------------------------------------------
53
+ /**
54
+ * Persist the current run's findings as a baseline SARIF document.
55
+ * Creates parent directories as needed. Overwrites any existing baseline.
56
+ */
57
+ export function saveBaseline(output, baselinePath) {
58
+ const sarif = buildSarifLog(output);
59
+ const dir = dirname(baselinePath);
60
+ // mkdirSync with recursive: true is idempotent — no need to check existsSync first.
61
+ mkdirSync(dir, { recursive: true });
62
+ writeFileSync(baselinePath, JSON.stringify(sarif, null, 2), 'utf8');
63
+ const findingCount = output.checks.reduce((n, c) => n + c.findings.length, 0);
64
+ logger.info({
65
+ evt: 'cli.gate.save.complete',
66
+ module: 'cli:gate',
67
+ baselinePath,
68
+ findingCount,
69
+ checkCount: output.checks.length,
70
+ });
71
+ }
72
+ // ---------------------------------------------------------------------------
73
+ // compareToBaseline
74
+ // ---------------------------------------------------------------------------
75
+ /**
76
+ * Compare current findings against a saved baseline. Returns a structured
77
+ * diff of added / resolved / unchanged violations.
78
+ *
79
+ * @throws {GateBaselineMissingError} when the baseline file doesn't exist
80
+ * @throws {GateBaselineInvalidError} when the baseline isn't valid SARIF
81
+ */
82
+ export function compareToBaseline(output, baselinePath) {
83
+ if (!existsSync(baselinePath)) {
84
+ throw new GateBaselineMissingError(baselinePath);
85
+ }
86
+ const baselineRaw = readFileSync(baselinePath, 'utf8');
87
+ let baselineDoc;
88
+ try {
89
+ baselineDoc = JSON.parse(baselineRaw);
90
+ }
91
+ catch (error) {
92
+ const reason = error instanceof Error ? error.message : String(error);
93
+ throw new GateBaselineInvalidError(baselinePath, `not valid JSON (${reason})`);
94
+ }
95
+ const baselineViolations = extractViolationsFromSarif(baselineDoc, baselinePath);
96
+ const currentViolations = extractViolationsFromCliOutput(output);
97
+ const baselineByHash = new Map(baselineViolations.map((v) => [v.hash, v]));
98
+ const currentByHash = new Map(currentViolations.map((v) => [v.hash, v]));
99
+ const added = [];
100
+ const unchanged = [];
101
+ for (const [hash, v] of currentByHash) {
102
+ if (baselineByHash.has(hash)) {
103
+ unchanged.push(v);
104
+ }
105
+ else {
106
+ added.push(v);
107
+ }
108
+ }
109
+ const resolved = [];
110
+ for (const [hash, v] of baselineByHash) {
111
+ if (!currentByHash.has(hash)) {
112
+ resolved.push(v);
113
+ }
114
+ }
115
+ const result = {
116
+ baselinePath,
117
+ added,
118
+ resolved,
119
+ unchanged,
120
+ degraded: added.length > 0,
121
+ };
122
+ logger.info({
123
+ evt: 'cli.gate.compare.complete',
124
+ module: 'cli:gate',
125
+ baselinePath,
126
+ addedCount: added.length,
127
+ resolvedCount: resolved.length,
128
+ unchangedCount: unchanged.length,
129
+ degraded: result.degraded,
130
+ });
131
+ return result;
132
+ }
133
+ // ---------------------------------------------------------------------------
134
+ // renderGateCompareOutput
135
+ // ---------------------------------------------------------------------------
136
+ /**
137
+ * Pretty-print a gate compare result for stdout. Caller sets the exit code.
138
+ */
139
+ // eslint-disable-next-line sonarjs/cognitive-complexity -- multi-section diff renderer: added/removed/changed sections each shape output; flatter form would scatter formatting
140
+ export function renderGateCompareOutput(result) {
141
+ const lines = ['opensip-tools gate compare', ''];
142
+ if (result.added.length > 0) {
143
+ lines.push(`Added (${result.added.length}):`);
144
+ for (const v of sortViolations(result.added)) {
145
+ lines.push(` ✗ ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
146
+ if (v.message && v.message !== v.ruleId) {
147
+ lines.push(` ${truncate(v.message, 120)}`);
148
+ }
149
+ }
150
+ lines.push('');
151
+ }
152
+ if (result.resolved.length > 0) {
153
+ lines.push(`Resolved (${result.resolved.length}):`);
154
+ for (const v of sortViolations(result.resolved)) {
155
+ lines.push(` ✓ ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
156
+ }
157
+ lines.push('');
158
+ }
159
+ if (result.unchanged.length > 0) {
160
+ lines.push(`Unchanged (${result.unchanged.length}):`);
161
+ // Truncate unchanged list — usually long and not actionable.
162
+ const sample = sortViolations(result.unchanged).slice(0, 5);
163
+ for (const v of sample) {
164
+ lines.push(` · ${v.ruleId.padEnd(40)} ${formatLocation(v)}`);
165
+ }
166
+ if (result.unchanged.length > sample.length) {
167
+ lines.push(` · ... and ${result.unchanged.length - sample.length} more`);
168
+ }
169
+ lines.push('');
170
+ }
171
+ if (result.degraded) {
172
+ lines.push(`✗ DEGRADED — ${result.added.length} new violation${result.added.length === 1 ? '' : 's'}`);
173
+ }
174
+ else if (result.resolved.length > 0) {
175
+ lines.push(`✓ IMPROVED — ${result.resolved.length} violation${result.resolved.length === 1 ? '' : 's'} resolved, none added`);
176
+ }
177
+ else {
178
+ lines.push(`✓ STABLE — no change`);
179
+ }
180
+ return lines.join('\n');
181
+ }
182
+ // ---------------------------------------------------------------------------
183
+ // Internal helpers
184
+ // ---------------------------------------------------------------------------
185
+ function hashViolation(filePath, ruleId, message) {
186
+ return createHash('sha256').update(`${filePath}\n${ruleId}\n${message}`).digest('hex');
187
+ }
188
+ function extractViolationsFromCliOutput(output) {
189
+ const violations = [];
190
+ for (const check of output.checks) {
191
+ for (const f of check.findings) {
192
+ const filePath = f.filePath ?? '';
193
+ violations.push({
194
+ hash: hashViolation(filePath, f.ruleId, f.message),
195
+ ruleId: f.ruleId,
196
+ message: f.message,
197
+ filePath,
198
+ line: f.line,
199
+ severity: f.severity,
200
+ });
201
+ }
202
+ }
203
+ return violations;
204
+ }
205
+ function extractViolationsFromSarif(doc, baselinePath) {
206
+ if (typeof doc !== 'object' || doc === null) {
207
+ throw new GateBaselineInvalidError(baselinePath, 'top-level value is not an object');
208
+ }
209
+ const sarif = doc;
210
+ if (sarif.runs === undefined || !Array.isArray(sarif.runs)) {
211
+ throw new GateBaselineInvalidError(baselinePath, 'missing or non-array `runs`');
212
+ }
213
+ const runs = sarif.runs;
214
+ const violations = [];
215
+ for (const run of runs) {
216
+ const results = run.results;
217
+ if (results === undefined)
218
+ continue;
219
+ for (const result of results) {
220
+ const ruleId = result.ruleId ?? '';
221
+ const message = result.message?.text ?? '';
222
+ const loc = result.locations?.[0]?.physicalLocation;
223
+ const filePath = loc?.artifactLocation?.uri ?? '';
224
+ const line = loc?.region?.startLine;
225
+ const severity = result.level === 'error' ? 'error' : 'warning';
226
+ violations.push({
227
+ hash: hashViolation(filePath, ruleId, message),
228
+ ruleId,
229
+ message,
230
+ filePath,
231
+ line,
232
+ severity,
233
+ });
234
+ }
235
+ }
236
+ return violations;
237
+ }
238
+ function formatLocation(v) {
239
+ if (!v.filePath)
240
+ return '(no location)';
241
+ return v.line == null ? v.filePath : `${v.filePath}:${v.line}`;
242
+ }
243
+ function sortViolations(vs) {
244
+ return [...vs].sort((a, b) => {
245
+ if (a.ruleId !== b.ruleId)
246
+ return a.ruleId.localeCompare(b.ruleId);
247
+ if (a.filePath !== b.filePath)
248
+ return a.filePath.localeCompare(b.filePath);
249
+ return (a.line ?? 0) - (b.line ?? 0);
250
+ });
251
+ }
252
+ function truncate(s, max) {
253
+ if (s.length <= max)
254
+ return s;
255
+ return s.slice(0, max - 1) + '…';
256
+ }
257
+ //# sourceMappingURL=gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAA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CAAC,CAAC,CAAC,QAAQ;QAAE,OAAO,eAAe,CAAC;IACxC,OAAO,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACjE,CAAC;AAED,SAAS,cAAc,CAAC,EAA4B;IAClD,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,OAAO,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;YAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC3E,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,GAAW;IACtC,IAAI,CAAC,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;AACnC,CAAC"}
@@ -0,0 +1,47 @@
1
+ export { defineCheck } from './framework/define-check.js';
2
+ export { CheckRegistry, defaultRegistry } from './framework/registry.js';
3
+ export { registerChecks } from './framework/register-helpers.js';
4
+ export type { CheckViolation, CheckScope, FileAccessor, CheckConcern, CheckLanguage } from './framework/check-config.js';
5
+ export type { Check, CheckConfig, ResolvedScope } from './framework/check-types.js';
6
+ export { isCheck } from './framework/check-types.js';
7
+ export type { ExecutionContext, RunOptions } from './framework/execution-context.js';
8
+ export { getLineNumber, extractSnippet, isAPIFile } from './framework/result-builder.js';
9
+ export { parseSource, walkNodes, getLineNumber as getASTLineNumber, getIdentifierName, getPropertyChain, isInStringLiteral, isLiteral, isPropertyAccess, } from './framework/ast-utilities.js';
10
+ export { execAbortable } from './framework/abortable-exec.js';
11
+ export { fileCache, DEFAULT_PREWARM_PATTERNS } from './framework/file-cache.js';
12
+ export { buildImportGraph, findStronglyConnectedComponents } from './framework/import-graph.js';
13
+ export type { ImportGraph } from './framework/import-graph.js';
14
+ export { isInsideStringLiteral, stripStringLiterals, stripStringsAndComments, stripStringsAndCommentsPreservingPositions } from './framework/strip-literals.js';
15
+ export { filterContent, clearFilterCache } from './framework/content-filter.js';
16
+ export type { FilteredContent } from './framework/content-filter.js';
17
+ import * as _ts from 'typescript';
18
+ export { _ts as ts };
19
+ export type { Finding, Severity, FindingSeverity, ToolOutput, CheckResult, CheckInfo, CheckResultMetadata, ItemType } from './types/findings.js';
20
+ export { createResultWithSignals, createErrorResult, createPassingResult, CheckInfoFactory } from './types/findings.js';
21
+ export { FitnessRecipeService } from './recipes/service.js';
22
+ export type { FitnessRecipeServiceConfig, FitnessRecipeServiceCallbacks, CheckSummary } from './recipes/service-types.js';
23
+ export type { FitnessRecipeResult, RecipeCheckResult, RecipeCheckConfigMap } from './recipes/types.js';
24
+ export { builtInRecipesByName } from './recipes/built-in-recipes.js';
25
+ export { defaultRecipeRegistry, FitnessRecipeRegistry } from './recipes/registry.js';
26
+ export { getCheckConfig, setCurrentRecipeCheckConfig, clearCurrentRecipeCheckConfig } from './recipes/check-config.js';
27
+ export { loadTargetsConfig, resolveTargetFiles } from './targets/index.js';
28
+ export type { TargetsConfig } from './targets/types.js';
29
+ export { TargetRegistry } from './targets/target-registry.js';
30
+ export { buildScopeBasedFileMap } from './framework/scope-resolver.js';
31
+ export { loadSignalersConfig } from './signalers/index.js';
32
+ export type { SignalersConfig } from './signalers/types.js';
33
+ export { loadPlugin, loadAllPlugins } from './plugins/loader.js';
34
+ export type { FitPluginExports } from './plugins/types.js';
35
+ export { discoverCheckPackages, readCheckPackageMetadata, readCheckPackagePreferences, } from './plugins/check-package-discovery.js';
36
+ export type { CheckPackageDiscoveryOptions, DiscoveredCheckPackage, CheckPackageMetadata, } from './plugins/check-package-discovery.js';
37
+ export { fitnessTool } from './tool.js';
38
+ export { executeFit, ensureChecksLoaded, getDisplayName, getEnabledCheckCount, getIcon, getPluginLoadErrors, setPreLoadHook, formatDuration, formatValidatedColumn, } from './cli/fit.js';
39
+ export type { PreLoadHook } from './cli/fit.js';
40
+ export { openDashboard } from './cli/dashboard.js';
41
+ export { listChecks } from './cli/list-checks.js';
42
+ export { listRecipes } from './cli/list-recipes.js';
43
+ export { saveBaseline, compareToBaseline, renderGateCompareOutput, GateBaselineMissingError, GateBaselineInvalidError, DEFAULT_BASELINE_PATH, } from './gate.js';
44
+ export type { GateCompareResult } from './gate.js';
45
+ export { buildSarifLog, chunkSarifRuns, reportToCloud } from './sarif.js';
46
+ export type { ReportResult } from './sarif.js';
47
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACzH,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kCAAk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,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,51 @@
1
+ // Framework — check definition API
2
+ export { defineCheck } from './framework/define-check.js';
3
+ export { CheckRegistry, defaultRegistry } from './framework/registry.js';
4
+ export { registerChecks } from './framework/register-helpers.js';
5
+ export { isCheck } from './framework/check-types.js';
6
+ // Framework utilities used by checks
7
+ export { getLineNumber, extractSnippet, isAPIFile } from './framework/result-builder.js';
8
+ export { parseSource, walkNodes, getLineNumber as getASTLineNumber, getIdentifierName, getPropertyChain, isInStringLiteral, isLiteral, isPropertyAccess, } from './framework/ast-utilities.js';
9
+ export { execAbortable } from './framework/abortable-exec.js';
10
+ // File cache (used by checks for content access; tests may seed/clear).
11
+ export { fileCache, DEFAULT_PREWARM_PATTERNS } from './framework/file-cache.js';
12
+ export { buildImportGraph, findStronglyConnectedComponents } from './framework/import-graph.js';
13
+ export { isInsideStringLiteral, stripStringLiterals, stripStringsAndComments, stripStringsAndCommentsPreservingPositions } from './framework/strip-literals.js';
14
+ export { filterContent, clearFilterCache } from './framework/content-filter.js';
15
+ // Re-export TypeScript compiler API for AST-based checks. The typescript module
16
+ // uses `export =`, so `export * as ts from 'typescript'` is invalid; the
17
+ // import-then-rename-export form works under esModuleInterop.
18
+ /* eslint-disable unicorn/prefer-export-from -- `export * as ts from 'typescript'` is invalid (the module uses `export =`); the namespace import + named export is the only working shape */
19
+ import * as _ts from 'typescript';
20
+ export { _ts as ts };
21
+ export { createResultWithSignals, createErrorResult, createPassingResult, CheckInfoFactory } from './types/findings.js';
22
+ // Recipe service
23
+ export { FitnessRecipeService } from './recipes/service.js';
24
+ export { builtInRecipesByName } from './recipes/built-in-recipes.js';
25
+ export { defaultRecipeRegistry, FitnessRecipeRegistry } from './recipes/registry.js';
26
+ export { getCheckConfig, setCurrentRecipeCheckConfig, clearCurrentRecipeCheckConfig } from './recipes/check-config.js';
27
+ // Targets and signalers
28
+ export { loadTargetsConfig, resolveTargetFiles } from './targets/index.js';
29
+ export { TargetRegistry } from './targets/target-registry.js';
30
+ export { buildScopeBasedFileMap } from './framework/scope-resolver.js';
31
+ export { loadSignalersConfig } from './signalers/index.js';
32
+ // Plugin loader (fitness owns the dispatcher; lang plugins also flow through
33
+ // it because lang adapter loading currently shares the same orchestration).
34
+ export { loadPlugin, loadAllPlugins } from './plugins/loader.js';
35
+ // Check-package discovery (fitness-specific — scans @opensip-tools/checks-* packages).
36
+ export { discoverCheckPackages, readCheckPackageMetadata, readCheckPackagePreferences, } from './plugins/check-package-discovery.js';
37
+ // Tool plugin export — fitness as a Tool.
38
+ export { fitnessTool } from './tool.js';
39
+ // CLI command implementations — re-exported for the Phase 2 CLI which
40
+ // still drives commands directly. Phase 4 will collapse these behind
41
+ // the Tool contract.
42
+ export { executeFit, ensureChecksLoaded, getDisplayName, getEnabledCheckCount, getIcon, getPluginLoadErrors, setPreLoadHook, formatDuration, formatValidatedColumn, } from './cli/fit.js';
43
+ export { openDashboard } from './cli/dashboard.js';
44
+ export { listChecks } from './cli/list-checks.js';
45
+ export { listRecipes } from './cli/list-recipes.js';
46
+ // Architecture-gate primitives (baseline save / compare) and SARIF
47
+ // upload — both operate on fitness's CliOutput. Wired into the `fit`
48
+ // subcommand by the tool's register() handler.
49
+ export { saveBaseline, compareToBaseline, renderGateCompareOutput, GateBaselineMissingError, GateBaselineInvalidError, DEFAULT_BASELINE_PATH, } from './gate.js';
50
+ export { buildSarifLog, chunkSarifRuns, reportToCloud } from './sarif.js';
51
+ //# sourceMappingURL=index.js.map