@opensip-cli/fitness 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/baseline-plane.test.d.ts +12 -0
  5. package/dist/__tests__/baseline-plane.test.d.ts.map +1 -0
  6. package/dist/__tests__/baseline-plane.test.js +63 -0
  7. package/dist/__tests__/baseline-plane.test.js.map +1 -0
  8. package/dist/__tests__/check-utils.test.d.ts +10 -0
  9. package/dist/__tests__/check-utils.test.d.ts.map +1 -0
  10. package/dist/__tests__/check-utils.test.js +193 -0
  11. package/dist/__tests__/check-utils.test.js.map +1 -0
  12. package/dist/__tests__/fingerprint-parity.test.d.ts +14 -0
  13. package/dist/__tests__/fingerprint-parity.test.d.ts.map +1 -0
  14. package/dist/__tests__/fingerprint-parity.test.js +59 -0
  15. package/dist/__tests__/fingerprint-parity.test.js.map +1 -0
  16. package/dist/__tests__/fit-execute-opts.test.d.ts +15 -0
  17. package/dist/__tests__/fit-execute-opts.test.d.ts.map +1 -0
  18. package/dist/__tests__/fit-execute-opts.test.js +124 -0
  19. package/dist/__tests__/fit-execute-opts.test.js.map +1 -0
  20. package/dist/__tests__/public-api.test.d.ts +19 -0
  21. package/dist/__tests__/public-api.test.d.ts.map +1 -0
  22. package/dist/__tests__/public-api.test.js +85 -0
  23. package/dist/__tests__/public-api.test.js.map +1 -0
  24. package/dist/__tests__/tool.test.d.ts +10 -0
  25. package/dist/__tests__/tool.test.d.ts.map +1 -0
  26. package/dist/__tests__/tool.test.js +57 -0
  27. package/dist/__tests__/tool.test.js.map +1 -0
  28. package/dist/baseline-strategy.d.ts +21 -0
  29. package/dist/baseline-strategy.d.ts.map +1 -0
  30. package/dist/baseline-strategy.js +21 -0
  31. package/dist/baseline-strategy.js.map +1 -0
  32. package/dist/check-utils/display.d.ts +52 -0
  33. package/dist/check-utils/display.d.ts.map +1 -0
  34. package/dist/check-utils/display.js +66 -0
  35. package/dist/check-utils/display.js.map +1 -0
  36. package/dist/check-utils/index.d.ts +17 -0
  37. package/dist/check-utils/index.d.ts.map +1 -0
  38. package/dist/check-utils/index.js +13 -0
  39. package/dist/check-utils/index.js.map +1 -0
  40. package/dist/check-utils/path-matching.d.ts +40 -0
  41. package/dist/check-utils/path-matching.d.ts.map +1 -0
  42. package/dist/check-utils/path-matching.js +38 -0
  43. package/dist/check-utils/path-matching.js.map +1 -0
  44. package/dist/check-utils/source-analysis.d.ts +36 -0
  45. package/dist/check-utils/source-analysis.d.ts.map +1 -0
  46. package/dist/check-utils/source-analysis.js +44 -0
  47. package/dist/check-utils/source-analysis.js.map +1 -0
  48. package/dist/check-utils/test-helpers.d.ts +57 -0
  49. package/dist/check-utils/test-helpers.d.ts.map +1 -0
  50. package/dist/check-utils/test-helpers.js +71 -0
  51. package/dist/check-utils/test-helpers.js.map +1 -0
  52. package/dist/cli/__tests__/fit-gate-mode.test.d.ts +14 -0
  53. package/dist/cli/__tests__/fit-gate-mode.test.d.ts.map +1 -0
  54. package/dist/cli/__tests__/fit-gate-mode.test.js +110 -0
  55. package/dist/cli/__tests__/fit-gate-mode.test.js.map +1 -0
  56. package/dist/cli/__tests__/fit-modes-live.test.d.ts +13 -0
  57. package/dist/cli/__tests__/fit-modes-live.test.d.ts.map +1 -0
  58. package/dist/cli/__tests__/fit-modes-live.test.js +182 -0
  59. package/dist/cli/__tests__/fit-modes-live.test.js.map +1 -0
  60. package/dist/cli/__tests__/report-data.test.d.ts +12 -0
  61. package/dist/cli/__tests__/report-data.test.d.ts.map +1 -0
  62. package/dist/cli/__tests__/report-data.test.js +113 -0
  63. package/dist/cli/__tests__/report-data.test.js.map +1 -0
  64. package/dist/cli/fit/__tests__/display-fold.test.d.ts +8 -0
  65. package/dist/cli/fit/__tests__/display-fold.test.d.ts.map +1 -0
  66. package/dist/cli/fit/__tests__/display-fold.test.js +87 -0
  67. package/dist/cli/fit/__tests__/display-fold.test.js.map +1 -0
  68. package/dist/cli/fit/__tests__/gate-resolved-config.test.d.ts +16 -0
  69. package/dist/cli/fit/__tests__/gate-resolved-config.test.d.ts.map +1 -0
  70. package/dist/cli/fit/__tests__/gate-resolved-config.test.js +62 -0
  71. package/dist/cli/fit/__tests__/gate-resolved-config.test.js.map +1 -0
  72. package/dist/cli/fit/check-loader.d.ts +37 -0
  73. package/dist/cli/fit/check-loader.d.ts.map +1 -0
  74. package/dist/cli/fit/check-loader.js +154 -0
  75. package/dist/cli/fit/check-loader.js.map +1 -0
  76. package/dist/cli/fit/config-loader.d.ts +55 -0
  77. package/dist/cli/fit/config-loader.d.ts.map +1 -0
  78. package/dist/cli/fit/config-loader.js +107 -0
  79. package/dist/cli/fit/config-loader.js.map +1 -0
  80. package/dist/cli/fit/display-registry.d.ts +19 -0
  81. package/dist/cli/fit/display-registry.d.ts.map +1 -0
  82. package/dist/cli/fit/display-registry.js +33 -0
  83. package/dist/cli/fit/display-registry.js.map +1 -0
  84. package/dist/cli/fit/envelope-view.d.ts +49 -0
  85. package/dist/cli/fit/envelope-view.d.ts.map +1 -0
  86. package/dist/cli/fit/envelope-view.js +85 -0
  87. package/dist/cli/fit/envelope-view.js.map +1 -0
  88. package/dist/cli/fit/fit-aux-command-specs.d.ts +35 -0
  89. package/dist/cli/fit/fit-aux-command-specs.d.ts.map +1 -0
  90. package/dist/cli/fit/fit-aux-command-specs.js +110 -0
  91. package/dist/cli/fit/fit-aux-command-specs.js.map +1 -0
  92. package/dist/cli/fit/fit-command-spec.d.ts +24 -0
  93. package/dist/cli/fit/fit-command-spec.d.ts.map +1 -0
  94. package/dist/cli/fit/fit-command-spec.js +131 -0
  95. package/dist/cli/fit/fit-command-spec.js.map +1 -0
  96. package/dist/cli/fit/gate-compare-render.d.ts +13 -0
  97. package/dist/cli/fit/gate-compare-render.d.ts.map +1 -0
  98. package/dist/cli/fit/gate-compare-render.js +87 -0
  99. package/dist/cli/fit/gate-compare-render.js.map +1 -0
  100. package/dist/cli/fit/recipe-selector.d.ts +53 -0
  101. package/dist/cli/fit/recipe-selector.d.ts.map +1 -0
  102. package/dist/cli/fit/recipe-selector.js +106 -0
  103. package/dist/cli/fit/recipe-selector.js.map +1 -0
  104. package/dist/cli/fit/recipe-selector.test.d.ts +2 -0
  105. package/dist/cli/fit/recipe-selector.test.d.ts.map +1 -0
  106. package/dist/cli/fit/recipe-selector.test.js +69 -0
  107. package/dist/cli/fit/recipe-selector.test.js.map +1 -0
  108. package/dist/cli/fit/resolved-fitness-config.d.ts +48 -0
  109. package/dist/cli/fit/resolved-fitness-config.d.ts.map +1 -0
  110. package/dist/cli/fit/resolved-fitness-config.js +46 -0
  111. package/dist/cli/fit/resolved-fitness-config.js.map +1 -0
  112. package/dist/cli/fit/result-builders.d.ts +91 -0
  113. package/dist/cli/fit/result-builders.d.ts.map +1 -0
  114. package/dist/cli/fit/result-builders.js +206 -0
  115. package/dist/cli/fit/result-builders.js.map +1 -0
  116. package/dist/cli/fit-list.d.ts +7 -0
  117. package/dist/cli/fit-list.d.ts.map +1 -0
  118. package/dist/cli/fit-list.js +24 -0
  119. package/dist/cli/fit-list.js.map +1 -0
  120. package/dist/cli/fit-modes.d.ts +42 -0
  121. package/dist/cli/fit-modes.d.ts.map +1 -0
  122. package/dist/cli/fit-modes.js +322 -0
  123. package/dist/cli/fit-modes.js.map +1 -0
  124. package/dist/cli/fit-recipes.d.ts +7 -0
  125. package/dist/cli/fit-recipes.d.ts.map +1 -0
  126. package/dist/cli/fit-recipes.js +34 -0
  127. package/dist/cli/fit-recipes.js.map +1 -0
  128. package/dist/cli/fit-runner-views.d.ts +33 -0
  129. package/dist/cli/fit-runner-views.d.ts.map +1 -0
  130. package/dist/cli/fit-runner-views.js +92 -0
  131. package/dist/cli/fit-runner-views.js.map +1 -0
  132. package/dist/cli/fit-runner.d.ts +44 -0
  133. package/dist/cli/fit-runner.d.ts.map +1 -0
  134. package/dist/cli/fit-runner.js +250 -0
  135. package/dist/cli/fit-runner.js.map +1 -0
  136. package/dist/cli/fit-worker.d.ts +26 -0
  137. package/dist/cli/fit-worker.d.ts.map +1 -0
  138. package/dist/cli/fit-worker.js +67 -0
  139. package/dist/cli/fit-worker.js.map +1 -0
  140. package/dist/cli/fit.d.ts +74 -0
  141. package/dist/cli/fit.d.ts.map +1 -0
  142. package/dist/cli/fit.js +149 -0
  143. package/dist/cli/fit.js.map +1 -0
  144. package/dist/cli/report-data.d.ts +44 -0
  145. package/dist/cli/report-data.d.ts.map +1 -0
  146. package/dist/cli/report-data.js +89 -0
  147. package/dist/cli/report-data.js.map +1 -0
  148. package/dist/config/__tests__/fitness-config-schema.test.d.ts +6 -0
  149. package/dist/config/__tests__/fitness-config-schema.test.d.ts.map +1 -0
  150. package/dist/config/__tests__/fitness-config-schema.test.js +37 -0
  151. package/dist/config/__tests__/fitness-config-schema.test.js.map +1 -0
  152. package/dist/config/fitness-config-schema.d.ts +48 -0
  153. package/dist/config/fitness-config-schema.d.ts.map +1 -0
  154. package/dist/config/fitness-config-schema.js +62 -0
  155. package/dist/config/fitness-config-schema.js.map +1 -0
  156. package/dist/framework/__tests__/abortable-exec.test.d.ts +9 -0
  157. package/dist/framework/__tests__/abortable-exec.test.d.ts.map +1 -0
  158. package/dist/framework/__tests__/abortable-exec.test.js +102 -0
  159. package/dist/framework/__tests__/abortable-exec.test.js.map +1 -0
  160. package/dist/framework/__tests__/check-config.test.d.ts +2 -0
  161. package/dist/framework/__tests__/check-config.test.d.ts.map +1 -0
  162. package/dist/framework/__tests__/check-config.test.js +56 -0
  163. package/dist/framework/__tests__/check-config.test.js.map +1 -0
  164. package/dist/framework/__tests__/check-types.test.d.ts +2 -0
  165. package/dist/framework/__tests__/check-types.test.d.ts.map +1 -0
  166. package/dist/framework/__tests__/check-types.test.js +76 -0
  167. package/dist/framework/__tests__/check-types.test.js.map +1 -0
  168. package/dist/framework/__tests__/command-executor.test.d.ts +2 -0
  169. package/dist/framework/__tests__/command-executor.test.d.ts.map +1 -0
  170. package/dist/framework/__tests__/command-executor.test.js +110 -0
  171. package/dist/framework/__tests__/command-executor.test.js.map +1 -0
  172. package/dist/framework/__tests__/content-filter-dispatch.test.d.ts +2 -0
  173. package/dist/framework/__tests__/content-filter-dispatch.test.d.ts.map +1 -0
  174. package/dist/framework/__tests__/content-filter-dispatch.test.js +122 -0
  175. package/dist/framework/__tests__/content-filter-dispatch.test.js.map +1 -0
  176. package/dist/framework/__tests__/define-check.test.d.ts +2 -0
  177. package/dist/framework/__tests__/define-check.test.d.ts.map +1 -0
  178. package/dist/framework/__tests__/define-check.test.js +402 -0
  179. package/dist/framework/__tests__/define-check.test.js.map +1 -0
  180. package/dist/framework/__tests__/define-regex-list-check.test.d.ts +15 -0
  181. package/dist/framework/__tests__/define-regex-list-check.test.d.ts.map +1 -0
  182. package/dist/framework/__tests__/define-regex-list-check.test.js +299 -0
  183. package/dist/framework/__tests__/define-regex-list-check.test.js.map +1 -0
  184. package/dist/framework/__tests__/directive-inventory.test.d.ts +2 -0
  185. package/dist/framework/__tests__/directive-inventory.test.d.ts.map +1 -0
  186. package/dist/framework/__tests__/directive-inventory.test.js +111 -0
  187. package/dist/framework/__tests__/directive-inventory.test.js.map +1 -0
  188. package/dist/framework/__tests__/directive-parsing.test.d.ts +13 -0
  189. package/dist/framework/__tests__/directive-parsing.test.d.ts.map +1 -0
  190. package/dist/framework/__tests__/directive-parsing.test.js +86 -0
  191. package/dist/framework/__tests__/directive-parsing.test.js.map +1 -0
  192. package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.d.ts +2 -0
  193. package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.d.ts.map +1 -0
  194. package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.js +56 -0
  195. package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.js.map +1 -0
  196. package/dist/framework/__tests__/execution-context.test.d.ts +2 -0
  197. package/dist/framework/__tests__/execution-context.test.d.ts.map +1 -0
  198. package/dist/framework/__tests__/execution-context.test.js +140 -0
  199. package/dist/framework/__tests__/execution-context.test.js.map +1 -0
  200. package/dist/framework/__tests__/file-accessor.test.d.ts +2 -0
  201. package/dist/framework/__tests__/file-accessor.test.d.ts.map +1 -0
  202. package/dist/framework/__tests__/file-accessor.test.js +106 -0
  203. package/dist/framework/__tests__/file-accessor.test.js.map +1 -0
  204. package/dist/framework/__tests__/file-cache.test.d.ts +2 -0
  205. package/dist/framework/__tests__/file-cache.test.d.ts.map +1 -0
  206. package/dist/framework/__tests__/file-cache.test.js +122 -0
  207. package/dist/framework/__tests__/file-cache.test.js.map +1 -0
  208. package/dist/framework/__tests__/file-type-filter.test.d.ts +9 -0
  209. package/dist/framework/__tests__/file-type-filter.test.d.ts.map +1 -0
  210. package/dist/framework/__tests__/file-type-filter.test.js +39 -0
  211. package/dist/framework/__tests__/file-type-filter.test.js.map +1 -0
  212. package/dist/framework/__tests__/ignore-processing.test.d.ts +11 -0
  213. package/dist/framework/__tests__/ignore-processing.test.d.ts.map +1 -0
  214. package/dist/framework/__tests__/ignore-processing.test.js +175 -0
  215. package/dist/framework/__tests__/ignore-processing.test.js.map +1 -0
  216. package/dist/framework/__tests__/import-graph.test.d.ts +15 -0
  217. package/dist/framework/__tests__/import-graph.test.d.ts.map +1 -0
  218. package/dist/framework/__tests__/import-graph.test.js +164 -0
  219. package/dist/framework/__tests__/import-graph.test.js.map +1 -0
  220. package/dist/framework/__tests__/memory-profiler.test.d.ts +9 -0
  221. package/dist/framework/__tests__/memory-profiler.test.d.ts.map +1 -0
  222. package/dist/framework/__tests__/memory-profiler.test.js +108 -0
  223. package/dist/framework/__tests__/memory-profiler.test.js.map +1 -0
  224. package/dist/framework/__tests__/parse-cache.test.d.ts +9 -0
  225. package/dist/framework/__tests__/parse-cache.test.d.ts.map +1 -0
  226. package/dist/framework/__tests__/parse-cache.test.js +51 -0
  227. package/dist/framework/__tests__/parse-cache.test.js.map +1 -0
  228. package/dist/framework/__tests__/path-matcher.test.d.ts +2 -0
  229. package/dist/framework/__tests__/path-matcher.test.d.ts.map +1 -0
  230. package/dist/framework/__tests__/path-matcher.test.js +113 -0
  231. package/dist/framework/__tests__/path-matcher.test.js.map +1 -0
  232. package/dist/framework/__tests__/register-helpers.test.d.ts +2 -0
  233. package/dist/framework/__tests__/register-helpers.test.d.ts.map +1 -0
  234. package/dist/framework/__tests__/register-helpers.test.js +51 -0
  235. package/dist/framework/__tests__/register-helpers.test.js.map +1 -0
  236. package/dist/framework/__tests__/registry.test.d.ts +2 -0
  237. package/dist/framework/__tests__/registry.test.d.ts.map +1 -0
  238. package/dist/framework/__tests__/registry.test.js +211 -0
  239. package/dist/framework/__tests__/registry.test.js.map +1 -0
  240. package/dist/framework/__tests__/result-builder.test.d.ts +2 -0
  241. package/dist/framework/__tests__/result-builder.test.d.ts.map +1 -0
  242. package/dist/framework/__tests__/result-builder.test.js +153 -0
  243. package/dist/framework/__tests__/result-builder.test.js.map +1 -0
  244. package/dist/framework/__tests__/scope-registry.test.d.ts +8 -0
  245. package/dist/framework/__tests__/scope-registry.test.d.ts.map +1 -0
  246. package/dist/framework/__tests__/scope-registry.test.js +156 -0
  247. package/dist/framework/__tests__/scope-registry.test.js.map +1 -0
  248. package/dist/framework/__tests__/scope-resolver.golden.test.d.ts +2 -0
  249. package/dist/framework/__tests__/scope-resolver.golden.test.d.ts.map +1 -0
  250. package/dist/framework/__tests__/scope-resolver.golden.test.js +105 -0
  251. package/dist/framework/__tests__/scope-resolver.golden.test.js.map +1 -0
  252. package/dist/framework/__tests__/scope-resolver.test.d.ts +2 -0
  253. package/dist/framework/__tests__/scope-resolver.test.d.ts.map +1 -0
  254. package/dist/framework/__tests__/scope-resolver.test.js +150 -0
  255. package/dist/framework/__tests__/scope-resolver.test.js.map +1 -0
  256. package/dist/framework/__tests__/severity-mapping.test.d.ts +2 -0
  257. package/dist/framework/__tests__/severity-mapping.test.d.ts.map +1 -0
  258. package/dist/framework/__tests__/severity-mapping.test.js +74 -0
  259. package/dist/framework/__tests__/severity-mapping.test.js.map +1 -0
  260. package/dist/framework/__tests__/strip-literals.test.d.ts +2 -0
  261. package/dist/framework/__tests__/strip-literals.test.d.ts.map +1 -0
  262. package/dist/framework/__tests__/strip-literals.test.js +87 -0
  263. package/dist/framework/__tests__/strip-literals.test.js.map +1 -0
  264. package/dist/framework/abortable-exec.d.ts +34 -0
  265. package/dist/framework/abortable-exec.d.ts.map +1 -0
  266. package/dist/framework/abortable-exec.js +143 -0
  267. package/dist/framework/abortable-exec.js.map +1 -0
  268. package/dist/framework/check-config.d.ts +175 -0
  269. package/dist/framework/check-config.d.ts.map +1 -0
  270. package/dist/framework/check-config.js +115 -0
  271. package/dist/framework/check-config.js.map +1 -0
  272. package/dist/framework/check-types.d.ts +82 -0
  273. package/dist/framework/check-types.d.ts.map +1 -0
  274. package/dist/framework/check-types.js +63 -0
  275. package/dist/framework/check-types.js.map +1 -0
  276. package/dist/framework/command-executor.d.ts +25 -0
  277. package/dist/framework/command-executor.d.ts.map +1 -0
  278. package/dist/framework/command-executor.js +63 -0
  279. package/dist/framework/command-executor.js.map +1 -0
  280. package/dist/framework/comment-openers.d.ts +11 -0
  281. package/dist/framework/comment-openers.d.ts.map +1 -0
  282. package/dist/framework/comment-openers.js +11 -0
  283. package/dist/framework/comment-openers.js.map +1 -0
  284. package/dist/framework/constants.d.ts +9 -0
  285. package/dist/framework/constants.d.ts.map +1 -0
  286. package/dist/framework/constants.js +16 -0
  287. package/dist/framework/constants.js.map +1 -0
  288. package/dist/framework/define-check.d.ts +38 -0
  289. package/dist/framework/define-check.d.ts.map +1 -0
  290. package/dist/framework/define-check.js +296 -0
  291. package/dist/framework/define-check.js.map +1 -0
  292. package/dist/framework/define-regex-list-check.d.ts +160 -0
  293. package/dist/framework/define-regex-list-check.d.ts.map +1 -0
  294. package/dist/framework/define-regex-list-check.js +177 -0
  295. package/dist/framework/define-regex-list-check.js.map +1 -0
  296. package/dist/framework/directive-inventory.d.ts +37 -0
  297. package/dist/framework/directive-inventory.d.ts.map +1 -0
  298. package/dist/framework/directive-inventory.js +82 -0
  299. package/dist/framework/directive-inventory.js.map +1 -0
  300. package/dist/framework/directive-parsing.d.ts +23 -0
  301. package/dist/framework/directive-parsing.d.ts.map +1 -0
  302. package/dist/framework/directive-parsing.js +39 -0
  303. package/dist/framework/directive-parsing.js.map +1 -0
  304. package/dist/framework/execution-context.d.ts +98 -0
  305. package/dist/framework/execution-context.d.ts.map +1 -0
  306. package/dist/framework/execution-context.js +145 -0
  307. package/dist/framework/execution-context.js.map +1 -0
  308. package/dist/framework/file-accessor.d.ts +20 -0
  309. package/dist/framework/file-accessor.d.ts.map +1 -0
  310. package/dist/framework/file-accessor.js +122 -0
  311. package/dist/framework/file-accessor.js.map +1 -0
  312. package/dist/framework/file-cache.d.ts +70 -0
  313. package/dist/framework/file-cache.d.ts.map +1 -0
  314. package/dist/framework/file-cache.js +199 -0
  315. package/dist/framework/file-cache.js.map +1 -0
  316. package/dist/framework/file-type-filter.d.ts +11 -0
  317. package/dist/framework/file-type-filter.d.ts.map +1 -0
  318. package/dist/framework/file-type-filter.js +21 -0
  319. package/dist/framework/file-type-filter.js.map +1 -0
  320. package/dist/framework/ignore-processing.d.ts +36 -0
  321. package/dist/framework/ignore-processing.d.ts.map +1 -0
  322. package/dist/framework/ignore-processing.js +172 -0
  323. package/dist/framework/ignore-processing.js.map +1 -0
  324. package/dist/framework/import-graph.d.ts +51 -0
  325. package/dist/framework/import-graph.d.ts.map +1 -0
  326. package/dist/framework/import-graph.js +217 -0
  327. package/dist/framework/import-graph.js.map +1 -0
  328. package/dist/framework/memory-profiler.d.ts +53 -0
  329. package/dist/framework/memory-profiler.d.ts.map +1 -0
  330. package/dist/framework/memory-profiler.js +92 -0
  331. package/dist/framework/memory-profiler.js.map +1 -0
  332. package/dist/framework/parse-cache.d.ts +24 -0
  333. package/dist/framework/parse-cache.d.ts.map +1 -0
  334. package/dist/framework/parse-cache.js +41 -0
  335. package/dist/framework/parse-cache.js.map +1 -0
  336. package/dist/framework/path-matcher.d.ts +86 -0
  337. package/dist/framework/path-matcher.d.ts.map +1 -0
  338. package/dist/framework/path-matcher.js +138 -0
  339. package/dist/framework/path-matcher.js.map +1 -0
  340. package/dist/framework/register-helpers.d.ts +11 -0
  341. package/dist/framework/register-helpers.d.ts.map +1 -0
  342. package/dist/framework/register-helpers.js +19 -0
  343. package/dist/framework/register-helpers.js.map +1 -0
  344. package/dist/framework/registry.d.ts +51 -0
  345. package/dist/framework/registry.d.ts.map +1 -0
  346. package/dist/framework/registry.js +131 -0
  347. package/dist/framework/registry.js.map +1 -0
  348. package/dist/framework/result-builder.d.ts +74 -0
  349. package/dist/framework/result-builder.d.ts.map +1 -0
  350. package/dist/framework/result-builder.js +154 -0
  351. package/dist/framework/result-builder.js.map +1 -0
  352. package/dist/framework/scope-registry.d.ts +38 -0
  353. package/dist/framework/scope-registry.d.ts.map +1 -0
  354. package/dist/framework/scope-registry.js +77 -0
  355. package/dist/framework/scope-registry.js.map +1 -0
  356. package/dist/framework/scope-resolver.d.ts +23 -0
  357. package/dist/framework/scope-resolver.d.ts.map +1 -0
  358. package/dist/framework/scope-resolver.js +102 -0
  359. package/dist/framework/scope-resolver.js.map +1 -0
  360. package/dist/framework/severity-mapping.d.ts +17 -0
  361. package/dist/framework/severity-mapping.d.ts.map +1 -0
  362. package/dist/framework/severity-mapping.js +71 -0
  363. package/dist/framework/severity-mapping.js.map +1 -0
  364. package/dist/framework/strip-literals.d.ts +73 -0
  365. package/dist/framework/strip-literals.d.ts.map +1 -0
  366. package/dist/framework/strip-literals.js +213 -0
  367. package/dist/framework/strip-literals.js.map +1 -0
  368. package/dist/index.d.ts +47 -0
  369. package/dist/index.d.ts.map +1 -0
  370. package/dist/index.js +64 -0
  371. package/dist/index.js.map +1 -0
  372. package/dist/internal.d.ts +17 -0
  373. package/dist/internal.d.ts.map +1 -0
  374. package/dist/internal.js +17 -0
  375. package/dist/internal.js.map +1 -0
  376. package/dist/persistence/session-payload.d.ts +68 -0
  377. package/dist/persistence/session-payload.d.ts.map +1 -0
  378. package/dist/persistence/session-payload.js +78 -0
  379. package/dist/persistence/session-payload.js.map +1 -0
  380. package/dist/persistence/session-payload.test.d.ts +11 -0
  381. package/dist/persistence/session-payload.test.d.ts.map +1 -0
  382. package/dist/persistence/session-payload.test.js +80 -0
  383. package/dist/persistence/session-payload.test.js.map +1 -0
  384. package/dist/persistence/session-replay.d.ts +14 -0
  385. package/dist/persistence/session-replay.d.ts.map +1 -0
  386. package/dist/persistence/session-replay.js +85 -0
  387. package/dist/persistence/session-replay.js.map +1 -0
  388. package/dist/persistence/session-replay.test.d.ts +10 -0
  389. package/dist/persistence/session-replay.test.d.ts.map +1 -0
  390. package/dist/persistence/session-replay.test.js +171 -0
  391. package/dist/persistence/session-replay.test.js.map +1 -0
  392. package/dist/plugins/__tests__/check-package-discovery.test.d.ts +2 -0
  393. package/dist/plugins/__tests__/check-package-discovery.test.d.ts.map +1 -0
  394. package/dist/plugins/__tests__/check-package-discovery.test.js +48 -0
  395. package/dist/plugins/__tests__/check-package-discovery.test.js.map +1 -0
  396. package/dist/plugins/__tests__/lang-domain.test.d.ts +2 -0
  397. package/dist/plugins/__tests__/lang-domain.test.d.ts.map +1 -0
  398. package/dist/plugins/__tests__/lang-domain.test.js +192 -0
  399. package/dist/plugins/__tests__/lang-domain.test.js.map +1 -0
  400. package/dist/plugins/__tests__/loader.test.d.ts +2 -0
  401. package/dist/plugins/__tests__/loader.test.d.ts.map +1 -0
  402. package/dist/plugins/__tests__/loader.test.js +271 -0
  403. package/dist/plugins/__tests__/loader.test.js.map +1 -0
  404. package/dist/plugins/check-package-discovery.d.ts +19 -0
  405. package/dist/plugins/check-package-discovery.d.ts.map +1 -0
  406. package/dist/plugins/check-package-discovery.js +34 -0
  407. package/dist/plugins/check-package-discovery.js.map +1 -0
  408. package/dist/plugins/loader.d.ts +32 -0
  409. package/dist/plugins/loader.d.ts.map +1 -0
  410. package/dist/plugins/loader.js +198 -0
  411. package/dist/plugins/loader.js.map +1 -0
  412. package/dist/plugins/types.d.ts +29 -0
  413. package/dist/plugins/types.d.ts.map +1 -0
  414. package/dist/plugins/types.js +9 -0
  415. package/dist/plugins/types.js.map +1 -0
  416. package/dist/recipes/__tests__/built-in-recipes.test.d.ts +2 -0
  417. package/dist/recipes/__tests__/built-in-recipes.test.d.ts.map +1 -0
  418. package/dist/recipes/__tests__/built-in-recipes.test.js +93 -0
  419. package/dist/recipes/__tests__/built-in-recipes.test.js.map +1 -0
  420. package/dist/recipes/__tests__/check-config.test.d.ts +12 -0
  421. package/dist/recipes/__tests__/check-config.test.d.ts.map +1 -0
  422. package/dist/recipes/__tests__/check-config.test.js +90 -0
  423. package/dist/recipes/__tests__/check-config.test.js.map +1 -0
  424. package/dist/recipes/__tests__/check-resolution.test.d.ts +2 -0
  425. package/dist/recipes/__tests__/check-resolution.test.d.ts.map +1 -0
  426. package/dist/recipes/__tests__/check-resolution.test.js +160 -0
  427. package/dist/recipes/__tests__/check-resolution.test.js.map +1 -0
  428. package/dist/recipes/__tests__/execution-branches.test.d.ts +10 -0
  429. package/dist/recipes/__tests__/execution-branches.test.d.ts.map +1 -0
  430. package/dist/recipes/__tests__/execution-branches.test.js +612 -0
  431. package/dist/recipes/__tests__/execution-branches.test.js.map +1 -0
  432. package/dist/recipes/__tests__/execution-paths.test.d.ts +10 -0
  433. package/dist/recipes/__tests__/execution-paths.test.d.ts.map +1 -0
  434. package/dist/recipes/__tests__/execution-paths.test.js +280 -0
  435. package/dist/recipes/__tests__/execution-paths.test.js.map +1 -0
  436. package/dist/recipes/__tests__/registry.test.d.ts +2 -0
  437. package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
  438. package/dist/recipes/__tests__/registry.test.js +89 -0
  439. package/dist/recipes/__tests__/registry.test.js.map +1 -0
  440. package/dist/recipes/__tests__/retry.test.d.ts +2 -0
  441. package/dist/recipes/__tests__/retry.test.d.ts.map +1 -0
  442. package/dist/recipes/__tests__/retry.test.js +75 -0
  443. package/dist/recipes/__tests__/retry.test.js.map +1 -0
  444. package/dist/recipes/__tests__/run-one-check.test.d.ts +14 -0
  445. package/dist/recipes/__tests__/run-one-check.test.d.ts.map +1 -0
  446. package/dist/recipes/__tests__/run-one-check.test.js +182 -0
  447. package/dist/recipes/__tests__/run-one-check.test.js.map +1 -0
  448. package/dist/recipes/__tests__/service.test.d.ts +11 -0
  449. package/dist/recipes/__tests__/service.test.d.ts.map +1 -0
  450. package/dist/recipes/__tests__/service.test.js +572 -0
  451. package/dist/recipes/__tests__/service.test.js.map +1 -0
  452. package/dist/recipes/built-in-recipes.d.ts +14 -0
  453. package/dist/recipes/built-in-recipes.d.ts.map +1 -0
  454. package/dist/recipes/built-in-recipes.js +241 -0
  455. package/dist/recipes/built-in-recipes.js.map +1 -0
  456. package/dist/recipes/check-config.d.ts +56 -0
  457. package/dist/recipes/check-config.d.ts.map +1 -0
  458. package/dist/recipes/check-config.js +61 -0
  459. package/dist/recipes/check-config.js.map +1 -0
  460. package/dist/recipes/check-resolution.d.ts +36 -0
  461. package/dist/recipes/check-resolution.d.ts.map +1 -0
  462. package/dist/recipes/check-resolution.js +81 -0
  463. package/dist/recipes/check-resolution.js.map +1 -0
  464. package/dist/recipes/check-result-processor.d.ts +51 -0
  465. package/dist/recipes/check-result-processor.d.ts.map +1 -0
  466. package/dist/recipes/check-result-processor.js +197 -0
  467. package/dist/recipes/check-result-processor.js.map +1 -0
  468. package/dist/recipes/parallel-execution.d.ts +38 -0
  469. package/dist/recipes/parallel-execution.d.ts.map +1 -0
  470. package/dist/recipes/parallel-execution.js +61 -0
  471. package/dist/recipes/parallel-execution.js.map +1 -0
  472. package/dist/recipes/registry.d.ts +47 -0
  473. package/dist/recipes/registry.d.ts.map +1 -0
  474. package/dist/recipes/registry.js +70 -0
  475. package/dist/recipes/registry.js.map +1 -0
  476. package/dist/recipes/retry.d.ts +29 -0
  477. package/dist/recipes/retry.d.ts.map +1 -0
  478. package/dist/recipes/retry.js +23 -0
  479. package/dist/recipes/retry.js.map +1 -0
  480. package/dist/recipes/run-one-check.d.ts +59 -0
  481. package/dist/recipes/run-one-check.d.ts.map +1 -0
  482. package/dist/recipes/run-one-check.js +174 -0
  483. package/dist/recipes/run-one-check.js.map +1 -0
  484. package/dist/recipes/sequential-execution.d.ts +12 -0
  485. package/dist/recipes/sequential-execution.d.ts.map +1 -0
  486. package/dist/recipes/sequential-execution.js +48 -0
  487. package/dist/recipes/sequential-execution.js.map +1 -0
  488. package/dist/recipes/service-types.d.ts +87 -0
  489. package/dist/recipes/service-types.d.ts.map +1 -0
  490. package/dist/recipes/service-types.js +8 -0
  491. package/dist/recipes/service-types.js.map +1 -0
  492. package/dist/recipes/service.d.ts +73 -0
  493. package/dist/recipes/service.d.ts.map +1 -0
  494. package/dist/recipes/service.js +438 -0
  495. package/dist/recipes/service.js.map +1 -0
  496. package/dist/recipes/types.d.ts +155 -0
  497. package/dist/recipes/types.d.ts.map +1 -0
  498. package/dist/recipes/types.js +56 -0
  499. package/dist/recipes/types.js.map +1 -0
  500. package/dist/scaffold/config-block.d.ts +17 -0
  501. package/dist/scaffold/config-block.d.ts.map +1 -0
  502. package/dist/scaffold/config-block.js +30 -0
  503. package/dist/scaffold/config-block.js.map +1 -0
  504. package/dist/scaffold/examples.d.ts +30 -0
  505. package/dist/scaffold/examples.d.ts.map +1 -0
  506. package/dist/scaffold/examples.js +129 -0
  507. package/dist/scaffold/examples.js.map +1 -0
  508. package/dist/scope-augmentation.d.ts +77 -0
  509. package/dist/scope-augmentation.d.ts.map +1 -0
  510. package/dist/scope-augmentation.js +31 -0
  511. package/dist/scope-augmentation.js.map +1 -0
  512. package/dist/signalers/__tests__/loader.test.d.ts +2 -0
  513. package/dist/signalers/__tests__/loader.test.d.ts.map +1 -0
  514. package/dist/signalers/__tests__/loader.test.js +141 -0
  515. package/dist/signalers/__tests__/loader.test.js.map +1 -0
  516. package/dist/signalers/__tests__/violation-to-signal.test.d.ts +2 -0
  517. package/dist/signalers/__tests__/violation-to-signal.test.d.ts.map +1 -0
  518. package/dist/signalers/__tests__/violation-to-signal.test.js +59 -0
  519. package/dist/signalers/__tests__/violation-to-signal.test.js.map +1 -0
  520. package/dist/signalers/index.d.ts +8 -0
  521. package/dist/signalers/index.d.ts.map +1 -0
  522. package/dist/signalers/index.js +9 -0
  523. package/dist/signalers/index.js.map +1 -0
  524. package/dist/signalers/loader.d.ts +30 -0
  525. package/dist/signalers/loader.d.ts.map +1 -0
  526. package/dist/signalers/loader.js +120 -0
  527. package/dist/signalers/loader.js.map +1 -0
  528. package/dist/signalers/schema.d.ts +60 -0
  529. package/dist/signalers/schema.d.ts.map +1 -0
  530. package/dist/signalers/schema.js +74 -0
  531. package/dist/signalers/schema.js.map +1 -0
  532. package/dist/signalers/types.d.ts +13 -0
  533. package/dist/signalers/types.d.ts.map +1 -0
  534. package/dist/signalers/types.js +5 -0
  535. package/dist/signalers/types.js.map +1 -0
  536. package/dist/signalers/violation-to-signal.d.ts +38 -0
  537. package/dist/signalers/violation-to-signal.d.ts.map +1 -0
  538. package/dist/signalers/violation-to-signal.js +43 -0
  539. package/dist/signalers/violation-to-signal.js.map +1 -0
  540. package/dist/targets/__tests__/loader.test.d.ts +2 -0
  541. package/dist/targets/__tests__/loader.test.d.ts.map +1 -0
  542. package/dist/targets/__tests__/loader.test.js +190 -0
  543. package/dist/targets/__tests__/loader.test.js.map +1 -0
  544. package/dist/targets/__tests__/target-registry.test.d.ts +2 -0
  545. package/dist/targets/__tests__/target-registry.test.d.ts.map +1 -0
  546. package/dist/targets/__tests__/target-registry.test.js +182 -0
  547. package/dist/targets/__tests__/target-registry.test.js.map +1 -0
  548. package/dist/targets/index.d.ts +18 -0
  549. package/dist/targets/index.d.ts.map +1 -0
  550. package/dist/targets/index.js +21 -0
  551. package/dist/targets/index.js.map +1 -0
  552. package/dist/targets/loader.d.ts +27 -0
  553. package/dist/targets/loader.d.ts.map +1 -0
  554. package/dist/targets/loader.js +178 -0
  555. package/dist/targets/loader.js.map +1 -0
  556. package/dist/targets/target-registry.d.ts +41 -0
  557. package/dist/targets/target-registry.d.ts.map +1 -0
  558. package/dist/targets/target-registry.js +71 -0
  559. package/dist/targets/target-registry.js.map +1 -0
  560. package/dist/targets/types.d.ts +14 -0
  561. package/dist/targets/types.d.ts.map +1 -0
  562. package/dist/targets/types.js +14 -0
  563. package/dist/targets/types.js.map +1 -0
  564. package/dist/tool.d.ts +61 -0
  565. package/dist/tool.d.ts.map +1 -0
  566. package/dist/tool.js +260 -0
  567. package/dist/tool.js.map +1 -0
  568. package/dist/types/findings.d.ts +113 -0
  569. package/dist/types/findings.d.ts.map +1 -0
  570. package/dist/types/findings.js +89 -0
  571. package/dist/types/findings.js.map +1 -0
  572. package/dist/types/severity.d.ts +15 -0
  573. package/dist/types/severity.d.ts.map +1 -0
  574. package/dist/types/severity.js +33 -0
  575. package/dist/types/severity.js.map +1 -0
  576. package/package.json +137 -0
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Pure builders that transform fitness recipe results into the run's
3
+ * `SignalEnvelope` (the universal output currency, ADR-0011) and the
4
+ * `FitDoneResult` that carries it — plus the formatting helpers they rely on
5
+ * and the best-effort session persistence side effect invoked at the
6
+ * `executeFit` boundary.
7
+ *
8
+ * Keeping these together (rather than per-output-shape) makes the
9
+ * signal-shape mapping visible in one place: `buildFitEnvelope` maps check
10
+ * violations to `Signal`s and `buildFitDoneResult` wraps the envelope.
11
+ */
12
+ import { buildSignalEnvelope, } from '@opensip-cli/contracts';
13
+ import { currentScope, logger } from '@opensip-cli/core';
14
+ import { fitnessFingerprintStrategy } from '../../baseline-strategy.js';
15
+ import { violationToSignal } from '../../signalers/violation-to-signal.js';
16
+ import { getPluginLoadErrors } from './check-loader.js';
17
+ import { buildFitVerboseDetail } from './envelope-view.js';
18
+ import { resolvedFitnessConfig } from './resolved-fitness-config.js';
19
+ /**
20
+ * Resolve fit's findings policy (ADR-0035). Reserved keys
21
+ * `failOnErrors`/`failOnWarnings` come from the host-RESOLVED
22
+ * `scope.toolConfig.fitness` (flag>env>file>defaults, ADR-0023), falling back to
23
+ * the file-sourced `signalersConfig.fitness` when no scope/toolConfig is present
24
+ * (a config-less project, or `executeFit` invoked off the CLI dispatch path),
25
+ * then to the host default `{1, 0}`. This is fit's historical gate resolution,
26
+ * now expressed as a VerdictPolicy the host verdict consumes — so
27
+ * `envelope.verdict.passed` is the single exit driver.
28
+ */
29
+ export function resolveFitVerdictPolicy(signalersConfig) {
30
+ // Prefer a host-stamped policy (computed in build-per-run-scope from the
31
+ // single fully-resolved toolConfig after flag/env/file/defaults precedence).
32
+ // This guarantees every reader in the run (result builders, gate modes,
33
+ // recipe execution) sees identical numbers for the verdict that drives
34
+ // both the envelope and the final exit code.
35
+ const scope = currentScope();
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
37
+ const stamped = scope?.fitnessVerdictPolicy;
38
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */
39
+ if (stamped &&
40
+ typeof stamped.failOnErrors === 'number' &&
41
+ typeof stamped.failOnWarnings === 'number') {
42
+ return {
43
+ failOnErrors: stamped.failOnErrors,
44
+ failOnWarnings: stamped.failOnWarnings,
45
+ };
46
+ }
47
+ const resolved = resolvedFitnessConfig();
48
+ return {
49
+ failOnErrors: resolved?.failOnErrors ?? signalersConfig.fitness.failOnErrors ?? 1,
50
+ failOnWarnings: resolved?.failOnWarnings ?? signalersConfig.fitness.failOnWarnings ?? 0,
51
+ };
52
+ }
53
+ // ---------------------------------------------------------------------------
54
+ // Envelope builder (ADR-0011, Phase 6) — the canonical post-run transform
55
+ // ---------------------------------------------------------------------------
56
+ /** Per-check error string for the unit sidecar: the check's own error, or a timeout marker. */
57
+ function unitError(cr) {
58
+ if (cr.error !== undefined)
59
+ return cr.error;
60
+ if (cr.timedOut === true)
61
+ return 'timed out';
62
+ return undefined;
63
+ }
64
+ /**
65
+ * Assemble the fit run's {@link SignalEnvelope} — the universal output
66
+ * currency the composition root renders (table), emits (`--json`), and
67
+ * delivers (cloud + `--report-to`).
68
+ *
69
+ * Each check violation becomes one {@link Signal} (`source === ruleId ===
70
+ * checkSlug`) via {@link violationToSignal}; every check that ran produces one
71
+ * {@link UnitResult} row (so a clean check still appears in the table). The
72
+ * fitness-only `Validated`/`Ignores` columns ride on the unit as
73
+ * `filesValidated`/`itemType`/`ignoredCount` (per-unit facts a flat signal
74
+ * list cannot express). The verdict/summary are computed centrally by
75
+ * {@link buildSignalEnvelope} so all three tools agree on "passed ⇔ no
76
+ * critical/high".
77
+ *
78
+ * Pure: the only clock read (`createdAt`) and the run id come from the caller's
79
+ * scope, matching graph/sim's envelope builders.
80
+ */
81
+ export function buildFitEnvelope(fitnessResult, recipeName, signalersConfig) {
82
+ const { checkResults } = fitnessResult;
83
+ const signals = [];
84
+ const units = [];
85
+ for (const cr of checkResults) {
86
+ for (const violation of cr.violations ?? []) {
87
+ signals.push(violationToSignal(cr.checkSlug, violation));
88
+ }
89
+ units.push({
90
+ slug: cr.checkSlug,
91
+ passed: cr.passed,
92
+ violationCount: cr.violationCount,
93
+ durationMs: cr.durationMs,
94
+ error: unitError(cr),
95
+ filesValidated: cr.totalItems,
96
+ itemType: cr.itemType,
97
+ ignoredCount: cr.ignoredCount,
98
+ });
99
+ }
100
+ return buildSignalEnvelope({
101
+ tool: 'fit',
102
+ recipe: recipeName,
103
+ runId: currentScope()?.runId ?? '',
104
+ createdAt: new Date().toISOString(),
105
+ units,
106
+ signals,
107
+ // ADR-0035: the host-owned verdict reads fit's resolved
108
+ // failOnErrors/failOnWarnings (scope.toolConfig.fitness, signalersConfig
109
+ // fallback, then {1,0}). Plugin-load errors occur before any unit exists, so
110
+ // they ride runFaulted.
111
+ policy: resolveFitVerdictPolicy(signalersConfig),
112
+ runFaulted: getPluginLoadErrors().length > 0,
113
+ // ADR-0036: fit's message-hash identity (line-shift-tolerant), stamped at
114
+ // construction so EVERY fit envelope — live/json/cloud, not only the gate
115
+ // path — carries gate-ready fingerprints.
116
+ fingerprintStrategy: fitnessFingerprintStrategy,
117
+ });
118
+ }
119
+ /**
120
+ * Build the {@link FitDoneResult} the live renderer / non-TTY render path
121
+ * consume. Carries the run's {@link SignalEnvelope} (the composition root
122
+ * derives the terminal table + summary AND the findings exit code FROM it — one
123
+ * row per check unit, `envelope.verdict.passed` the single verdict) plus the run
124
+ * label and non-fatal warnings.
125
+ *
126
+ * ADR-0035: the exit code is no longer carried on the result. `verdict.passed`
127
+ * (computed with fit's resolved failOnErrors/failOnWarnings policy + plugin-load
128
+ * `runFaulted`) is the single exit driver; the host derives it in `deliverSignals`.
129
+ *
130
+ * Pure builder: session persistence (SessionRepo.save) lives at the
131
+ * `executeFit` call site (post-call), not here. The envelope is assembled once
132
+ * in `executeFit` and threaded in so the gate, render, and session-payload
133
+ * paths all consume the same envelope.
134
+ */
135
+ export function buildFitDoneResult({ args, envelope, recipeName, warnings, }) {
136
+ const label = args.tags && args.tags.length > 0
137
+ ? `tags: ${args.tags.join(',')}`
138
+ : `recipe ${recipeName ?? 'default'}`;
139
+ // ADR-0021: carry the verbose findings body on the result so the shared
140
+ // resultToView seam renders it identically in a TTY and a pipe (the old
141
+ // TTY-only path left `fit --verbose | cat` empty).
142
+ const verboseDetail = buildFitVerboseDetail(envelope, args);
143
+ return {
144
+ type: 'fit-done',
145
+ label,
146
+ cwd: args.cwd,
147
+ envelope,
148
+ configFound: true,
149
+ warnings: warnings && warnings.length > 0 ? warnings : undefined,
150
+ ...(verboseDetail === undefined ? {} : { verboseDetail }),
151
+ };
152
+ }
153
+ // ---------------------------------------------------------------------------
154
+ // Recipe-service progress callbacks
155
+ // ---------------------------------------------------------------------------
156
+ /**
157
+ * Wire up CLI-side progress callbacks for the recipe service.
158
+ *
159
+ * Monotonic completed-count: the service fires `onCheckStart(slug,
160
+ * displayIndex, total)` when a check STARTS and
161
+ * `onCheckComplete(slug, summary, displayIndex, total)` when it
162
+ * FINISHES. Under parallel execution `displayIndex` is the check's
163
+ * position in the queue (1..total), not "how many have completed" — so
164
+ * the last-started check's index hops above the current completion
165
+ * tally and then "resets" down when an earlier check finishes (the UI
166
+ * showed `147/148 → 121/148 → 78/148`).
167
+ *
168
+ * The progress bar wants a monotonic counter. We track completed
169
+ * locally, increment only on `onCheckComplete`, and ignore
170
+ * `onCheckStart`'s index. The counter is strictly non-decreasing and
171
+ * always reflects "N of M checks done."
172
+ */
173
+ export function buildFitCallbacks(onProgress) {
174
+ let completedCount = 0;
175
+ return {
176
+ onCheckStart(checkSlug, index, total) {
177
+ logger.debug({
178
+ evt: 'cli.check.start',
179
+ module: 'cli:fit',
180
+ checkSlug,
181
+ index,
182
+ total,
183
+ });
184
+ onProgress?.(completedCount, total);
185
+ },
186
+ onCheckComplete(checkSlug, summary, index, total) {
187
+ logger.debug({
188
+ evt: 'cli.check.complete',
189
+ module: 'cli:fit',
190
+ checkSlug,
191
+ passed: summary.passed,
192
+ errors: summary.errors,
193
+ warnings: summary.warnings,
194
+ durationMs: summary.durationMs,
195
+ });
196
+ completedCount++;
197
+ onProgress?.(completedCount, total);
198
+ },
199
+ };
200
+ }
201
+ // host-owned-run-timing Phase 3: the production `persistFitSession` helper was
202
+ // removed. Generic session rows are now persisted exclusively by the host run
203
+ // plane from the `ToolSessionContribution` the fit modes RETURN (see fit-modes /
204
+ // fit-command-spec). The only remaining session writer is the host.
205
+ export { buildFitnessSessionPayload } from '../../persistence/session-payload.js';
206
+ //# sourceMappingURL=result-builders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-builders.js","sourceRoot":"","sources":["../../../src/cli/fit/result-builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,mBAAmB,GAKpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAmC,MAAM,mBAAmB,CAAC;AAE1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CA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,KAAK,CAAC,CAAC;QACtC,CAAC;QACD,eAAe,CAAC,SAAiB,EAAE,OAAqB,EAAE,KAAa,EAAE,KAAa;YACpF,MAAM,CAAC,KAAK,CAAC;gBACX,GAAG,EAAE,oBAAoB;gBACzB,MAAM,EAAE,SAAS;gBACjB,SAAS;gBACT,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;YACH,cAAc,EAAE,CAAC;YACjB,UAAU,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,oEAAoE;AAEpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * fit-list command — list all available fitness checks
3
+ */
4
+ import type { ListChecksResult } from '@opensip-cli/contracts';
5
+ /** Returns metadata for every enabled check in the project's check registry. */
6
+ export declare function listChecks(projectDir?: string): Promise<ListChecksResult>;
7
+ //# sourceMappingURL=fit-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-list.d.ts","sourceRoot":"","sources":["../../src/cli/fit-list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,gFAAgF;AAChF,wBAAsB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAe/E"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * fit-list command — list all available fitness checks
3
+ */
4
+ import { currentCheckRegistry } from '../framework/scope-registry.js';
5
+ import { ensureChecksLoaded } from './fit.js';
6
+ // ---------------------------------------------------------------------------
7
+ // listChecks
8
+ // ---------------------------------------------------------------------------
9
+ /** Returns metadata for every enabled check in the project's check registry. */
10
+ export async function listChecks(projectDir) {
11
+ await ensureChecksLoaded(projectDir);
12
+ const checks = currentCheckRegistry().listEnabled();
13
+ const entries = checks.map((check) => ({
14
+ slug: check.config.slug,
15
+ description: check.config.description,
16
+ tags: [...(check.config.tags ?? ['untagged'])],
17
+ }));
18
+ return {
19
+ type: 'list-checks',
20
+ checks: entries,
21
+ totalCount: checks.length,
22
+ };
23
+ }
24
+ //# sourceMappingURL=fit-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-list.js","sourceRoot":"","sources":["../../src/cli/fit-list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,UAAmB;IAClD,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC,WAAW,EAAE,CAAC;IAEpD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;QACvB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;QACrC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;KAC/C,CAAC,CAAC,CAAC;IAEJ,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,MAAM,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @fileoverview Mode helpers for the `fit` Commander action.
3
+ *
4
+ * The `fit` subcommand dispatches to one of five mutually exclusive
5
+ * modes (gate, list, recipes, json, live) based on the parsed flags.
6
+ * Each mode is small and self-contained; isolating them in this module
7
+ * keeps `tool.ts` focused on Commander wiring and lets the runner
8
+ * branches be tested independently.
9
+ *
10
+ * The exported helpers all take the Commander-parsed `FitOptions` plus
11
+ * the `ToolCliContext` the dispatcher provides to each tool.
12
+ */
13
+ import { type FitOptions } from '@opensip-cli/contracts';
14
+ import { type ToolCliContext, type ToolRunCompletion } from '@opensip-cli/core';
15
+ /**
16
+ * The portion of a {@link ToolRunCompletion} fit's static modes return: the
17
+ * generic-session contribution (host-owned-run-timing Phase 3). The host run
18
+ * plane persists it after the handler resolves; the tool writes nothing itself.
19
+ */
20
+ type FitRunCompletion = Pick<ToolRunCompletion, 'session'>;
21
+ export declare function runListMode(args: FitOptions, cli: ToolCliContext): Promise<void>;
22
+ export declare function runRecipesMode(args: FitOptions, cli: ToolCliContext): Promise<void>;
23
+ export declare function runShowMode(args: FitOptions, cli: ToolCliContext): Promise<void>;
24
+ /**
25
+ * `--json` mode: run executeFit, write output (or error) to stdout, and
26
+ * propagate the configured fail threshold via the CLI's exit-code hook.
27
+ *
28
+ * Threads `datastore` so a `--json` run lands in the SQLite session
29
+ * history alongside live-mode and gate-mode runs. No `onProgress`: JSON
30
+ * output is one-shot, no progress UI.
31
+ */
32
+ export declare function runJsonMode(args: FitOptions, cli: ToolCliContext): Promise<FitRunCompletion | undefined>;
33
+ /**
34
+ * Visual mode — Ink-rendered live results. The CLI supplies the
35
+ * renderer via `cli.renderLive()` so this file doesn't depend on the
36
+ * CLI package directly. After the run, optionally launches the HTML
37
+ * dashboard.
38
+ */
39
+ export declare function runLiveMode(args: FitOptions, cli: ToolCliContext, liveViewKey: string, openRequested: boolean): Promise<FitRunCompletion | undefined>;
40
+ export declare function runGateMode(args: FitOptions, cli: ToolCliContext): Promise<FitRunCompletion | undefined>;
41
+ export {};
42
+ //# sourceMappingURL=fit-modes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-modes.d.ts","sourceRoot":"","sources":["../../src/cli/fit-modes.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,EAGL,KAAK,UAAU,EAGhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEvB,MAAM,mBAAmB,CAAC;AAa3B;;;;GAIG;AACH,KAAK,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;AA4E3D,wBAAsB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAOtF;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAOzF;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BtF;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAsBvC;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,cAAc,EACnB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAiCvC;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAiGvC"}
@@ -0,0 +1,322 @@
1
+ // @fitness-ignore-file detached-promises -- CLI mode dispatch: render helpers / process.stdout.write / setExitCode invocations are synchronous; heuristic flags inside async handlers.
2
+ // @fitness-ignore-file no-non-null-assertions -- mode-helpers narrow result.type before accessing branch-specific fields; the assertions are typescript-narrowing aids where the discriminant already proves the case.
3
+ /**
4
+ * @fileoverview Mode helpers for the `fit` Commander action.
5
+ *
6
+ * The `fit` subcommand dispatches to one of five mutually exclusive
7
+ * modes (gate, list, recipes, json, live) based on the parsed flags.
8
+ * Each mode is small and self-contained; isolating them in this module
9
+ * keeps `tool.ts` focused on Commander wiring and lets the runner
10
+ * branches be tested independently.
11
+ *
12
+ * The exported helpers all take the Commander-parsed `FitOptions` plus
13
+ * the `ToolCliContext` the dispatcher provides to each tool.
14
+ */
15
+ import { EXIT_CODES, mapToolErrorToExitCode, } from '@opensip-cli/contracts';
16
+ import { ConfigurationError, resolveFailOnDegraded, SystemError, } from '@opensip-cli/core';
17
+ import { resolveSession } from '@opensip-cli/session-store';
18
+ import { fitReplayFromSession } from '../persistence/session-replay.js';
19
+ import { renderGateCompareOutput } from './fit/gate-compare-render.js';
20
+ import { buildFitnessSessionPayload } from './fit/result-builders.js';
21
+ import { listChecks } from './fit-list.js';
22
+ import { listRecipes } from './fit-recipes.js';
23
+ import { executeFit } from './fit.js';
24
+ /**
25
+ * Build fit's generic-session contribution from a completed run envelope
26
+ * (host-owned-run-timing Phase 3). The static modes RETURN this; the host run
27
+ * plane persists it after the handler resolves — no tool-side session write.
28
+ */
29
+ function fitSessionContribution(args, envelope) {
30
+ return {
31
+ tool: 'fit',
32
+ cwd: args.cwd,
33
+ recipe: envelope.recipe,
34
+ score: envelope.verdict.score,
35
+ passed: envelope.verdict.passed,
36
+ payload: buildFitnessSessionPayload(envelope),
37
+ };
38
+ }
39
+ /**
40
+ * Build fit's run completion from the run envelope (host-owned-run-timing
41
+ * Phase 3): the generic-session contribution the host run plane persists.
42
+ */
43
+ function fitRunCompletion(args, envelope) {
44
+ return {
45
+ session: fitSessionContribution(args, envelope),
46
+ };
47
+ }
48
+ // persistFitRun removed (Phase 3). The three mode bodies (json/live-fallback/gate)
49
+ // now RETURN a FitRunCompletion (the `session` contribution above) from the
50
+ // handler/live renderer; the host run plane persists it and stamps
51
+ // startedAt/completedAt/durationMs from the invocation RunTimer. There is no
52
+ // tool-side generic-session writer (the `runSession.record`
53
+ // seam was removed in Phase 6).
54
+ /**
55
+ * Emit any non-fatal warnings collected during the run to stderr. Safe to
56
+ * call from non-Ink paths (JSON, gate modes) because Ink is not managing
57
+ * the screen there. The live renderer surfaces these through Ink in the
58
+ * summary block instead.
59
+ */
60
+ function emitWarningsToStderr(result) {
61
+ if (!result.warnings || result.warnings.length === 0)
62
+ return;
63
+ for (const msg of result.warnings) {
64
+ process.stderr.write(`opensip: ${msg}\n`);
65
+ }
66
+ }
67
+ /**
68
+ * Deliver the run's signal envelope to the composition-root-owned effectful
69
+ * sinks (ADR-0011 / ADR-0008): best-effort cloud sync + the `--report-to`
70
+ * SARIF upload — and, since ADR-0035, the host-owned FINDINGS exit code.
71
+ *
72
+ * Normal runs OMIT `runFailed`: the host derives the findings exit from
73
+ * `envelope.verdict.passed` (the single verdict). The gate-COMPARE mode passes
74
+ * its baseline-diff predicate (`degraded`), which is not expressible over the
75
+ * run's verdict; the host honours that override and a `--report-to` upload
76
+ * failure never masks the gate verdict. No-op when neither sink is active.
77
+ */
78
+ async function deliverFitSignals(cli, envelope, args, runFailed) {
79
+ await cli.deliverSignals(envelope, {
80
+ cwd: args.cwd,
81
+ reportTo: args.reportTo,
82
+ apiKey: args.apiKey,
83
+ ...(runFailed === undefined ? {} : { runFailed }),
84
+ });
85
+ }
86
+ export async function runListMode(args, cli) {
87
+ const result = await listChecks(args.cwd);
88
+ if (args.json) {
89
+ cli.emitJson(result);
90
+ return;
91
+ }
92
+ await cli.render(result);
93
+ }
94
+ export async function runRecipesMode(args, cli) {
95
+ const result = await listRecipes(args.cwd);
96
+ if (args.json) {
97
+ cli.emitJson(result);
98
+ return;
99
+ }
100
+ await cli.render(result);
101
+ }
102
+ export async function runShowMode(args, cli) {
103
+ const datastore = cli.scope.datastore();
104
+ if (datastore === undefined) {
105
+ await emitShowError(args, cli, 'datastore-unavailable', 'session replay requires a datastore');
106
+ return;
107
+ }
108
+ const resolved = resolveSession(datastore, { ref: args.show ?? 'latest', tool: 'fit' });
109
+ if (!resolved.ok) {
110
+ await emitShowError(args, cli, resolved.reason, resolved.detail);
111
+ return;
112
+ }
113
+ try {
114
+ const replay = fitReplayFromSession(resolved.session);
115
+ if (args.json) {
116
+ cli.emitJson(sessionShowJson(resolved.session, replay));
117
+ return;
118
+ }
119
+ await cli.render(replay.result);
120
+ }
121
+ catch (error) {
122
+ await emitShowError(args, cli, 'decode-error', error instanceof Error ? error.message : String(error));
123
+ }
124
+ }
125
+ /**
126
+ * `--json` mode: run executeFit, write output (or error) to stdout, and
127
+ * propagate the configured fail threshold via the CLI's exit-code hook.
128
+ *
129
+ * Threads `datastore` so a `--json` run lands in the SQLite session
130
+ * history alongside live-mode and gate-mode runs. No `onProgress`: JSON
131
+ * output is one-shot, no progress UI.
132
+ */
133
+ export async function runJsonMode(args, cli) {
134
+ const fitResult = await executeFit(args);
135
+ if (fitResult.envelope === undefined) {
136
+ // 2.12.0 (§5.5): a failed `--json` run emits a structured `status:'error'`
137
+ // CommandOutcome (the host wraps + sets the exit code), not a bare `{ error }`.
138
+ cli.emitError({ message: fitResult.result.message, exitCode: fitResult.result.exitCode });
139
+ return undefined;
140
+ }
141
+ // ADR-0011: emit the signal envelope through the shared `formatSignalJson`
142
+ // formatter (the root owns stdout). No per-tool re-stringification.
143
+ cli.emitEnvelope(fitResult.envelope);
144
+ // Warnings collected during the run go to stderr so JSON consumers still
145
+ // see them without contaminating the structured stdout payload.
146
+ emitWarningsToStderr(fitResult.result);
147
+ // ADR-0011/ADR-0035: the composition root owns effectful egress (cloud +
148
+ // `--report-to`, exit 4) AND the findings exit code (derived from the
149
+ // envelope verdict). Called once, after the JSON is on stdout.
150
+ await deliverFitSignals(cli, fitResult.envelope, args);
151
+ // Host-owned persistence (host-owned-run-timing Phases 3 + 5): RETURN the
152
+ // session + dashboard contribution; the host persists both after the handler
153
+ // resolves.
154
+ return fitRunCompletion(args, fitResult.envelope);
155
+ }
156
+ /**
157
+ * Visual mode — Ink-rendered live results. The CLI supplies the
158
+ * renderer via `cli.renderLive()` so this file doesn't depend on the
159
+ * CLI package directly. After the run, optionally launches the HTML
160
+ * dashboard.
161
+ */
162
+ export async function runLiveMode(args, cli, liveViewKey, openRequested) {
163
+ // The TTY live path persists via the host (renderLive → completeLiveRender),
164
+ // so this returns undefined there (no double-write). The non-TTY path returns
165
+ // the contribution for the host to persist after the handler resolves.
166
+ let completion;
167
+ if (process.stdout.isTTY === true) {
168
+ await cli.renderLive(liveViewKey, args);
169
+ }
170
+ else {
171
+ // Non-TTY (pipe / CI / redirect): the animated Ink live view is a TTY-only
172
+ // affordance and would emit garbled frames. Run the engine and emit the
173
+ // static `fit-done` result through the seam, which dual-renders it as plain
174
+ // text (`renderToText`) — the same content the TTY user's final frame
175
+ // shows. Exit-code policy mirrors the live runner (fit-runner.tsx): an
176
+ // error result carries its own code; a passing run that breached the fail
177
+ // threshold exits RUNTIME_ERROR. Warnings are rendered inline by the
178
+ // fit-done view, so we don't also write them to stderr here.
179
+ const fitResult = await executeFit(args);
180
+ if (fitResult.envelope === undefined) {
181
+ cli.setExitCode(fitResult.result.exitCode);
182
+ await cli.render(fitResult.result);
183
+ }
184
+ else {
185
+ await cli.render(fitResult.result);
186
+ // Effectful egress + host-owned findings exit at the composition root
187
+ // (ADR-0035), composing with non-TTY runs (CI), not just the TTY live view.
188
+ await deliverFitSignals(cli, fitResult.envelope, args);
189
+ completion = fitRunCompletion(args, fitResult.envelope);
190
+ }
191
+ }
192
+ await cli.maybeOpenReport({
193
+ openRequested,
194
+ jsonOutput: Boolean(args.json),
195
+ });
196
+ return completion;
197
+ }
198
+ export async function runGateMode(args, cli) {
199
+ if (args.gateSave === true && args.gateCompare === true) {
200
+ cli.logger.warn({
201
+ evt: 'cli.gate.config_error',
202
+ module: 'cli:gate',
203
+ reason: 'mutually-exclusive flags',
204
+ msg: '--gate-save and --gate-compare specified together',
205
+ });
206
+ cli.setExitCode(EXIT_CODES.CONFIGURATION_ERROR);
207
+ process.stderr.write('Error: --gate-save and --gate-compare are mutually exclusive.\n');
208
+ return undefined;
209
+ }
210
+ // Run on the main thread (ADR-0028 — engine is persistence-free). The session
211
+ // contribution is RETURNED (host-owned-run-timing Phase 3); the host persists
212
+ // it so gate-save / gate-compare runs land in history alongside live runs.
213
+ const fitResult = await executeFit(args);
214
+ if (fitResult.envelope === undefined) {
215
+ cli.logger.warn({
216
+ evt: 'cli.gate.fit_failed',
217
+ module: 'cli:gate',
218
+ mode: args.gateSave === true ? 'save' : 'compare',
219
+ reason: fitResult.result.message,
220
+ });
221
+ cli.setExitCode(fitResult.result.exitCode);
222
+ process.stderr.write(`Error: ${fitResult.result.message}\n`);
223
+ return undefined;
224
+ }
225
+ // ADR-0036: the envelope arrives fingerprint-stamped — `buildFitEnvelope`
226
+ // passes fit's message-hash strategy to `buildSignalEnvelope`, which stamps
227
+ // at construction. The host seams only read `signal.fingerprint`.
228
+ const envelope = fitResult.envelope;
229
+ const completion = fitRunCompletion(args, envelope);
230
+ // Surface non-fatal warnings before the gate output so the user sees them
231
+ // alongside the run summary. Safe here because gate mode is non-Ink.
232
+ emitWarningsToStderr(fitResult.result);
233
+ try {
234
+ if (args.gateSave === true) {
235
+ // @fitness-ignore-next-line async-waterfall-detection -- ordered side-effects: the "Baseline saved" confirmation (and the subsequent deliver) must follow a SUCCESSFUL save (if saveBaseline throws, nothing downstream runs), so these awaits cannot be parallelized.
236
+ await cli.saveBaseline('fitness', envelope);
237
+ await cli.render({
238
+ type: 'gate-done',
239
+ lines: [
240
+ 'Baseline saved (project SQLite store)',
241
+ ` ${envelope.units.length} check(s), ${envelope.signals.length} finding(s)`,
242
+ ],
243
+ });
244
+ // ADR-0020: gate-save records the baseline AND hard-fails the step on a
245
+ // fail-threshold breach (`failOnErrors`/`failOnWarnings`), mirroring live
246
+ // and JSON mode. The CI step is therefore the honest pass/fail signal —
247
+ // it no longer exits 0 while error-level findings exist, so enforcement
248
+ // does not rely solely on the downstream Code Scanning net-new ratchet +
249
+ // branch protection (external config the release-gate ADR-0017 explicitly
250
+ // declined to trust). The SARIF export runs in a separate `if: always()`
251
+ // CI step, so the baseline + net-new PR annotations survive a failed gate.
252
+ // ADR-0035: gate-save's findings gate IS the host verdict (fit's resolved
253
+ // failOnErrors/failOnWarnings), so the host sets the exit from the envelope
254
+ // verdict in deliverFitSignals — no per-path setExitCode needed.
255
+ await deliverFitSignals(cli, envelope, args);
256
+ return completion;
257
+ }
258
+ const result = await cli.compareBaseline('fitness', envelope);
259
+ await cli.render({ type: 'gate-done', lines: renderGateCompareOutput(result).split('\n') });
260
+ // gate-compare's verdict is the baseline-diff `degraded` predicate, NOT the
261
+ // findings policy — pass it as the host runFailed override (ADR-0035), gated by
262
+ // the reserved `failOnDegraded` key (ADR-0036, default true → ratchet-as-report
263
+ // when false). The host sets the exit (degraded → RUNTIME_ERROR, else SUCCESS)
264
+ // and a `--report-to` upload failure never masks the gate verdict.
265
+ await deliverFitSignals(cli, envelope, args, result.degraded && resolveFailOnDegraded('fitness'));
266
+ return completion;
267
+ }
268
+ catch (error) {
269
+ // Gate mode is plain-text (not Ink), so we render the error
270
+ // ourselves to stderr instead of letting it escape to the CLI's
271
+ // Ink-based `handleParseError`. The exit-code policy still flows
272
+ // through the canonical `mapToolErrorToExitCode` so a gate-mode
273
+ // failure gets the same exit code an Ink-mode failure would — the
274
+ // host compare seam throws ConfigurationError on a missing baseline
275
+ // (→ 2); a datastore-integrity SystemError → 1. Unknown errors
276
+ // rethrow to the central handler.
277
+ if (error instanceof ConfigurationError || error instanceof SystemError) {
278
+ cli.logger.warn({
279
+ evt: 'cli.gate.baseline_error',
280
+ module: 'cli:gate',
281
+ mode: args.gateSave === true ? 'save' : 'compare',
282
+ errorType: error.name,
283
+ reason: error.message,
284
+ });
285
+ cli.setExitCode(mapToolErrorToExitCode(error));
286
+ process.stderr.write(`Error: ${error.message}\n`);
287
+ return undefined;
288
+ }
289
+ throw error;
290
+ }
291
+ }
292
+ async function emitShowError(args, cli, reason, detail) {
293
+ if (args.json) {
294
+ // emitError sets the exit code itself (process exit == reported outcome).
295
+ cli.emitError({ message: detail, exitCode: EXIT_CODES.CONFIGURATION_ERROR, code: reason });
296
+ return;
297
+ }
298
+ cli.setExitCode(EXIT_CODES.CONFIGURATION_ERROR);
299
+ await cli.render({
300
+ type: 'error',
301
+ message: detail,
302
+ exitCode: EXIT_CODES.CONFIGURATION_ERROR,
303
+ });
304
+ }
305
+ function sessionShowJson(session, replay) {
306
+ return {
307
+ session: {
308
+ id: session.id,
309
+ tool: session.tool,
310
+ startedAt: session.startedAt,
311
+ completedAt: session.completedAt,
312
+ recipe: session.recipe,
313
+ cwd: session.cwd,
314
+ score: session.score,
315
+ passed: session.passed,
316
+ durationMs: session.durationMs,
317
+ },
318
+ fidelity: replay.fidelity,
319
+ envelope: replay.envelope,
320
+ };
321
+ }
322
+ //# sourceMappingURL=fit-modes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-modes.js","sourceRoot":"","sources":["../../src/cli/fit-modes.ts"],"names":[],"mappings":"AAAA,uLAAuL;AACvL,uNAAuN;AACvN;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,UAAU,EACV,sBAAsB,GAIvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,GAIZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,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D,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAChD,MAAM,GAAG,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,UAAU,CAAC,mBAAmB;KACzC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,eAAe,CACtB,OAAsB,EACtB,MAA+C;IAE/C,OAAO;QACL,OAAO,EAAE;YACP,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;QACD,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * fit-recipes command — list all available fitness recipes
3
+ */
4
+ import type { ListRecipesResult } from '@opensip-cli/contracts';
5
+ /** Returns metadata for every registered recipe (built-in plus user-defined). */
6
+ export declare function listRecipes(projectDir?: string): Promise<ListRecipesResult>;
7
+ //# sourceMappingURL=fit-recipes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-recipes.d.ts","sourceRoot":"","sources":["../../src/cli/fit-recipes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAMhE,iFAAiF;AACjF,wBAAsB,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuBjF"}