@opensip-cli/core 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 (604) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +31 -0
  4. package/dist/__tests__/config-resolution.test.d.ts +2 -0
  5. package/dist/__tests__/config-resolution.test.d.ts.map +1 -0
  6. package/dist/__tests__/config-resolution.test.js +94 -0
  7. package/dist/__tests__/config-resolution.test.js.map +1 -0
  8. package/dist/__tests__/public-api.test.d.ts +16 -0
  9. package/dist/__tests__/public-api.test.d.ts.map +1 -0
  10. package/dist/__tests__/public-api.test.js +209 -0
  11. package/dist/__tests__/public-api.test.js.map +1 -0
  12. package/dist/__tests__/signal-batch.test.d.ts +2 -0
  13. package/dist/__tests__/signal-batch.test.d.ts.map +1 -0
  14. package/dist/__tests__/signal-batch.test.js +39 -0
  15. package/dist/__tests__/signal-batch.test.js.map +1 -0
  16. package/dist/__tests__/signal-sink.test.d.ts +2 -0
  17. package/dist/__tests__/signal-sink.test.d.ts.map +1 -0
  18. package/dist/__tests__/signal-sink.test.js +25 -0
  19. package/dist/__tests__/signal-sink.test.js.map +1 -0
  20. package/dist/__tests__/strip-utils.test.d.ts +2 -0
  21. package/dist/__tests__/strip-utils.test.d.ts.map +1 -0
  22. package/dist/__tests__/strip-utils.test.js +397 -0
  23. package/dist/__tests__/strip-utils.test.js.map +1 -0
  24. package/dist/__tests__/text-tree.test.d.ts +2 -0
  25. package/dist/__tests__/text-tree.test.d.ts.map +1 -0
  26. package/dist/__tests__/text-tree.test.js +31 -0
  27. package/dist/__tests__/text-tree.test.js.map +1 -0
  28. package/dist/baseline/__tests__/fingerprint-strategy.test.d.ts +2 -0
  29. package/dist/baseline/__tests__/fingerprint-strategy.test.d.ts.map +1 -0
  30. package/dist/baseline/__tests__/fingerprint-strategy.test.js +69 -0
  31. package/dist/baseline/__tests__/fingerprint-strategy.test.js.map +1 -0
  32. package/dist/baseline/fingerprint-strategy.d.ts +70 -0
  33. package/dist/baseline/fingerprint-strategy.d.ts.map +1 -0
  34. package/dist/baseline/fingerprint-strategy.js +90 -0
  35. package/dist/baseline/fingerprint-strategy.js.map +1 -0
  36. package/dist/config-resolution.d.ts +27 -0
  37. package/dist/config-resolution.d.ts.map +1 -0
  38. package/dist/config-resolution.js +92 -0
  39. package/dist/config-resolution.js.map +1 -0
  40. package/dist/index.d.ts +81 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +165 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/languages/__tests__/content-filter-dispatch.test.d.ts +2 -0
  45. package/dist/languages/__tests__/content-filter-dispatch.test.d.ts.map +1 -0
  46. package/dist/languages/__tests__/content-filter-dispatch.test.js +87 -0
  47. package/dist/languages/__tests__/content-filter-dispatch.test.js.map +1 -0
  48. package/dist/languages/__tests__/non-code-formats.test.d.ts +2 -0
  49. package/dist/languages/__tests__/non-code-formats.test.d.ts.map +1 -0
  50. package/dist/languages/__tests__/non-code-formats.test.js +31 -0
  51. package/dist/languages/__tests__/non-code-formats.test.js.map +1 -0
  52. package/dist/languages/__tests__/parse-cache.test.d.ts +2 -0
  53. package/dist/languages/__tests__/parse-cache.test.d.ts.map +1 -0
  54. package/dist/languages/__tests__/parse-cache.test.js +228 -0
  55. package/dist/languages/__tests__/parse-cache.test.js.map +1 -0
  56. package/dist/languages/__tests__/registry.test.d.ts +2 -0
  57. package/dist/languages/__tests__/registry.test.d.ts.map +1 -0
  58. package/dist/languages/__tests__/registry.test.js +193 -0
  59. package/dist/languages/__tests__/registry.test.js.map +1 -0
  60. package/dist/languages/__tests__/workspace-unit-contract.test.d.ts +2 -0
  61. package/dist/languages/__tests__/workspace-unit-contract.test.d.ts.map +1 -0
  62. package/dist/languages/__tests__/workspace-unit-contract.test.js +66 -0
  63. package/dist/languages/__tests__/workspace-unit-contract.test.js.map +1 -0
  64. package/dist/languages/adapter.d.ts +66 -0
  65. package/dist/languages/adapter.d.ts.map +1 -0
  66. package/dist/languages/adapter.js +2 -0
  67. package/dist/languages/adapter.js.map +1 -0
  68. package/dist/languages/content-filter-dispatch.d.ts +36 -0
  69. package/dist/languages/content-filter-dispatch.d.ts.map +1 -0
  70. package/dist/languages/content-filter-dispatch.js +75 -0
  71. package/dist/languages/content-filter-dispatch.js.map +1 -0
  72. package/dist/languages/generic-types.d.ts +22 -0
  73. package/dist/languages/generic-types.d.ts.map +1 -0
  74. package/dist/languages/generic-types.js +3 -0
  75. package/dist/languages/generic-types.js.map +1 -0
  76. package/dist/languages/index.d.ts +12 -0
  77. package/dist/languages/index.d.ts.map +1 -0
  78. package/dist/languages/index.js +7 -0
  79. package/dist/languages/index.js.map +1 -0
  80. package/dist/languages/non-code-formats.d.ts +37 -0
  81. package/dist/languages/non-code-formats.d.ts.map +1 -0
  82. package/dist/languages/non-code-formats.js +45 -0
  83. package/dist/languages/non-code-formats.js.map +1 -0
  84. package/dist/languages/parse-cache-class.d.ts +69 -0
  85. package/dist/languages/parse-cache-class.d.ts.map +1 -0
  86. package/dist/languages/parse-cache-class.js +135 -0
  87. package/dist/languages/parse-cache-class.js.map +1 -0
  88. package/dist/languages/parse-cache.d.ts +54 -0
  89. package/dist/languages/parse-cache.d.ts.map +1 -0
  90. package/dist/languages/parse-cache.js +88 -0
  91. package/dist/languages/parse-cache.js.map +1 -0
  92. package/dist/languages/registry.d.ts +35 -0
  93. package/dist/languages/registry.d.ts.map +1 -0
  94. package/dist/languages/registry.js +123 -0
  95. package/dist/languages/registry.js.map +1 -0
  96. package/dist/languages/strip-scanners.d.ts +170 -0
  97. package/dist/languages/strip-scanners.d.ts.map +1 -0
  98. package/dist/languages/strip-scanners.js +233 -0
  99. package/dist/languages/strip-scanners.js.map +1 -0
  100. package/dist/languages/strip-utils.d.ts +66 -0
  101. package/dist/languages/strip-utils.d.ts.map +1 -0
  102. package/dist/languages/strip-utils.js +88 -0
  103. package/dist/languages/strip-utils.js.map +1 -0
  104. package/dist/languages/text-tree.d.ts +44 -0
  105. package/dist/languages/text-tree.d.ts.map +1 -0
  106. package/dist/languages/text-tree.js +34 -0
  107. package/dist/languages/text-tree.js.map +1 -0
  108. package/dist/languages/workspace-unit.d.ts +18 -0
  109. package/dist/languages/workspace-unit.d.ts.map +1 -0
  110. package/dist/languages/workspace-unit.js +2 -0
  111. package/dist/languages/workspace-unit.js.map +1 -0
  112. package/dist/lib/__tests__/config-version.test.d.ts +12 -0
  113. package/dist/lib/__tests__/config-version.test.d.ts.map +1 -0
  114. package/dist/lib/__tests__/config-version.test.js +92 -0
  115. package/dist/lib/__tests__/config-version.test.js.map +1 -0
  116. package/dist/lib/__tests__/diagnostics-bus.test.d.ts +7 -0
  117. package/dist/lib/__tests__/diagnostics-bus.test.d.ts.map +1 -0
  118. package/dist/lib/__tests__/diagnostics-bus.test.js +44 -0
  119. package/dist/lib/__tests__/diagnostics-bus.test.js.map +1 -0
  120. package/dist/lib/__tests__/env-registry.test.d.ts +7 -0
  121. package/dist/lib/__tests__/env-registry.test.d.ts.map +1 -0
  122. package/dist/lib/__tests__/env-registry.test.js +82 -0
  123. package/dist/lib/__tests__/env-registry.test.js.map +1 -0
  124. package/dist/lib/__tests__/errors.test.d.ts +2 -0
  125. package/dist/lib/__tests__/errors.test.d.ts.map +1 -0
  126. package/dist/lib/__tests__/errors.test.js +218 -0
  127. package/dist/lib/__tests__/errors.test.js.map +1 -0
  128. package/dist/lib/__tests__/format.test.d.ts +2 -0
  129. package/dist/lib/__tests__/format.test.d.ts.map +1 -0
  130. package/dist/lib/__tests__/format.test.js +23 -0
  131. package/dist/lib/__tests__/format.test.js.map +1 -0
  132. package/dist/lib/__tests__/ids.test.d.ts +2 -0
  133. package/dist/lib/__tests__/ids.test.d.ts.map +1 -0
  134. package/dist/lib/__tests__/ids.test.js +80 -0
  135. package/dist/lib/__tests__/ids.test.js.map +1 -0
  136. package/dist/lib/__tests__/logger.test.d.ts +2 -0
  137. package/dist/lib/__tests__/logger.test.d.ts.map +1 -0
  138. package/dist/lib/__tests__/logger.test.js +284 -0
  139. package/dist/lib/__tests__/logger.test.js.map +1 -0
  140. package/dist/lib/__tests__/package-version.test.d.ts +2 -0
  141. package/dist/lib/__tests__/package-version.test.d.ts.map +1 -0
  142. package/dist/lib/__tests__/package-version.test.js +47 -0
  143. package/dist/lib/__tests__/package-version.test.js.map +1 -0
  144. package/dist/lib/__tests__/paths.test.d.ts +5 -0
  145. package/dist/lib/__tests__/paths.test.d.ts.map +1 -0
  146. package/dist/lib/__tests__/paths.test.js +59 -0
  147. package/dist/lib/__tests__/paths.test.js.map +1 -0
  148. package/dist/lib/__tests__/payload-version.test.d.ts +2 -0
  149. package/dist/lib/__tests__/payload-version.test.d.ts.map +1 -0
  150. package/dist/lib/__tests__/payload-version.test.js +35 -0
  151. package/dist/lib/__tests__/payload-version.test.js.map +1 -0
  152. package/dist/lib/__tests__/phantom-detect.test.d.ts +10 -0
  153. package/dist/lib/__tests__/phantom-detect.test.d.ts.map +1 -0
  154. package/dist/lib/__tests__/phantom-detect.test.js +84 -0
  155. package/dist/lib/__tests__/phantom-detect.test.js.map +1 -0
  156. package/dist/lib/__tests__/project-context.test.d.ts +10 -0
  157. package/dist/lib/__tests__/project-context.test.d.ts.map +1 -0
  158. package/dist/lib/__tests__/project-context.test.js +240 -0
  159. package/dist/lib/__tests__/project-context.test.js.map +1 -0
  160. package/dist/lib/__tests__/registry.test.d.ts +2 -0
  161. package/dist/lib/__tests__/registry.test.d.ts.map +1 -0
  162. package/dist/lib/__tests__/registry.test.js +333 -0
  163. package/dist/lib/__tests__/registry.test.js.map +1 -0
  164. package/dist/lib/__tests__/retry.test.d.ts +2 -0
  165. package/dist/lib/__tests__/retry.test.d.ts.map +1 -0
  166. package/dist/lib/__tests__/retry.test.js +71 -0
  167. package/dist/lib/__tests__/retry.test.js.map +1 -0
  168. package/dist/lib/__tests__/run-diagnostics.test.d.ts +9 -0
  169. package/dist/lib/__tests__/run-diagnostics.test.d.ts.map +1 -0
  170. package/dist/lib/__tests__/run-diagnostics.test.js +61 -0
  171. package/dist/lib/__tests__/run-diagnostics.test.js.map +1 -0
  172. package/dist/lib/__tests__/run-scope.test.d.ts +2 -0
  173. package/dist/lib/__tests__/run-scope.test.d.ts.map +1 -0
  174. package/dist/lib/__tests__/run-scope.test.js +202 -0
  175. package/dist/lib/__tests__/run-scope.test.js.map +1 -0
  176. package/dist/lib/__tests__/run-timer.test.d.ts +2 -0
  177. package/dist/lib/__tests__/run-timer.test.d.ts.map +1 -0
  178. package/dist/lib/__tests__/run-timer.test.js +152 -0
  179. package/dist/lib/__tests__/run-timer.test.js.map +1 -0
  180. package/dist/lib/__tests__/severity-policy.test.d.ts +6 -0
  181. package/dist/lib/__tests__/severity-policy.test.d.ts.map +1 -0
  182. package/dist/lib/__tests__/severity-policy.test.js +47 -0
  183. package/dist/lib/__tests__/severity-policy.test.js.map +1 -0
  184. package/dist/lib/__tests__/telemetry.test.d.ts +2 -0
  185. package/dist/lib/__tests__/telemetry.test.d.ts.map +1 -0
  186. package/dist/lib/__tests__/telemetry.test.js +212 -0
  187. package/dist/lib/__tests__/telemetry.test.js.map +1 -0
  188. package/dist/lib/__tests__/verdict-policy.test.d.ts +7 -0
  189. package/dist/lib/__tests__/verdict-policy.test.d.ts.map +1 -0
  190. package/dist/lib/__tests__/verdict-policy.test.js +91 -0
  191. package/dist/lib/__tests__/verdict-policy.test.js.map +1 -0
  192. package/dist/lib/__tests__/yaml.test.d.ts +6 -0
  193. package/dist/lib/__tests__/yaml.test.d.ts.map +1 -0
  194. package/dist/lib/__tests__/yaml.test.js +79 -0
  195. package/dist/lib/__tests__/yaml.test.js.map +1 -0
  196. package/dist/lib/config-version.d.ts +49 -0
  197. package/dist/lib/config-version.d.ts.map +1 -0
  198. package/dist/lib/config-version.js +56 -0
  199. package/dist/lib/config-version.js.map +1 -0
  200. package/dist/lib/diagnostics-bus.d.ts +48 -0
  201. package/dist/lib/diagnostics-bus.d.ts.map +1 -0
  202. package/dist/lib/diagnostics-bus.js +74 -0
  203. package/dist/lib/diagnostics-bus.js.map +1 -0
  204. package/dist/lib/env-registry.d.ts +108 -0
  205. package/dist/lib/env-registry.d.ts.map +1 -0
  206. package/dist/lib/env-registry.js +92 -0
  207. package/dist/lib/env-registry.js.map +1 -0
  208. package/dist/lib/errors.d.ts +132 -0
  209. package/dist/lib/errors.d.ts.map +1 -0
  210. package/dist/lib/errors.js +160 -0
  211. package/dist/lib/errors.js.map +1 -0
  212. package/dist/lib/execution/__tests__/execution.test.d.ts +7 -0
  213. package/dist/lib/execution/__tests__/execution.test.d.ts.map +1 -0
  214. package/dist/lib/execution/__tests__/execution.test.js +254 -0
  215. package/dist/lib/execution/__tests__/execution.test.js.map +1 -0
  216. package/dist/lib/execution/index.d.ts +15 -0
  217. package/dist/lib/execution/index.d.ts.map +1 -0
  218. package/dist/lib/execution/index.js +10 -0
  219. package/dist/lib/execution/index.js.map +1 -0
  220. package/dist/lib/execution/options.d.ts +32 -0
  221. package/dist/lib/execution/options.d.ts.map +1 -0
  222. package/dist/lib/execution/options.js +15 -0
  223. package/dist/lib/execution/options.js.map +1 -0
  224. package/dist/lib/execution/pipeline.d.ts +36 -0
  225. package/dist/lib/execution/pipeline.d.ts.map +1 -0
  226. package/dist/lib/execution/pipeline.js +38 -0
  227. package/dist/lib/execution/pipeline.js.map +1 -0
  228. package/dist/lib/execution/retry.d.ts +38 -0
  229. package/dist/lib/execution/retry.d.ts.map +1 -0
  230. package/dist/lib/execution/retry.js +56 -0
  231. package/dist/lib/execution/retry.js.map +1 -0
  232. package/dist/lib/execution/run-with-timeout.d.ts +46 -0
  233. package/dist/lib/execution/run-with-timeout.d.ts.map +1 -0
  234. package/dist/lib/execution/run-with-timeout.js +86 -0
  235. package/dist/lib/execution/run-with-timeout.js.map +1 -0
  236. package/dist/lib/execution/schedule.d.ts +62 -0
  237. package/dist/lib/execution/schedule.d.ts.map +1 -0
  238. package/dist/lib/execution/schedule.js +130 -0
  239. package/dist/lib/execution/schedule.js.map +1 -0
  240. package/dist/lib/format.d.ts +17 -0
  241. package/dist/lib/format.d.ts.map +1 -0
  242. package/dist/lib/format.js +26 -0
  243. package/dist/lib/format.js.map +1 -0
  244. package/dist/lib/ids.d.ts +13 -0
  245. package/dist/lib/ids.d.ts.map +1 -0
  246. package/dist/lib/ids.js +48 -0
  247. package/dist/lib/ids.js.map +1 -0
  248. package/dist/lib/logger.d.ts +166 -0
  249. package/dist/lib/logger.d.ts.map +1 -0
  250. package/dist/lib/logger.js +283 -0
  251. package/dist/lib/logger.js.map +1 -0
  252. package/dist/lib/package-version.d.ts +17 -0
  253. package/dist/lib/package-version.d.ts.map +1 -0
  254. package/dist/lib/package-version.js +52 -0
  255. package/dist/lib/package-version.js.map +1 -0
  256. package/dist/lib/paths.d.ts +139 -0
  257. package/dist/lib/paths.d.ts.map +1 -0
  258. package/dist/lib/paths.js +105 -0
  259. package/dist/lib/paths.js.map +1 -0
  260. package/dist/lib/payload-version.d.ts +15 -0
  261. package/dist/lib/payload-version.d.ts.map +1 -0
  262. package/dist/lib/payload-version.js +24 -0
  263. package/dist/lib/payload-version.js.map +1 -0
  264. package/dist/lib/phantom-detect.d.ts +21 -0
  265. package/dist/lib/phantom-detect.d.ts.map +1 -0
  266. package/dist/lib/phantom-detect.js +76 -0
  267. package/dist/lib/phantom-detect.js.map +1 -0
  268. package/dist/lib/project-context.d.ts +66 -0
  269. package/dist/lib/project-context.d.ts.map +1 -0
  270. package/dist/lib/project-context.js +112 -0
  271. package/dist/lib/project-context.js.map +1 -0
  272. package/dist/lib/recipe-id.d.ts +13 -0
  273. package/dist/lib/recipe-id.d.ts.map +1 -0
  274. package/dist/lib/recipe-id.js +15 -0
  275. package/dist/lib/recipe-id.js.map +1 -0
  276. package/dist/lib/registry.d.ts +98 -0
  277. package/dist/lib/registry.d.ts.map +1 -0
  278. package/dist/lib/registry.js +152 -0
  279. package/dist/lib/registry.js.map +1 -0
  280. package/dist/lib/retry.d.ts +26 -0
  281. package/dist/lib/retry.d.ts.map +1 -0
  282. package/dist/lib/retry.js +48 -0
  283. package/dist/lib/retry.js.map +1 -0
  284. package/dist/lib/run-diagnostics.d.ts +64 -0
  285. package/dist/lib/run-diagnostics.d.ts.map +1 -0
  286. package/dist/lib/run-diagnostics.js +25 -0
  287. package/dist/lib/run-diagnostics.js.map +1 -0
  288. package/dist/lib/run-scope.d.ts +167 -0
  289. package/dist/lib/run-scope.d.ts.map +1 -0
  290. package/dist/lib/run-scope.js +176 -0
  291. package/dist/lib/run-scope.js.map +1 -0
  292. package/dist/lib/run-timer.d.ts +82 -0
  293. package/dist/lib/run-timer.d.ts.map +1 -0
  294. package/dist/lib/run-timer.js +79 -0
  295. package/dist/lib/run-timer.js.map +1 -0
  296. package/dist/lib/scope-types.d.ts +172 -0
  297. package/dist/lib/scope-types.d.ts.map +1 -0
  298. package/dist/lib/scope-types.js +27 -0
  299. package/dist/lib/scope-types.js.map +1 -0
  300. package/dist/lib/severity-policy.d.ts +38 -0
  301. package/dist/lib/severity-policy.d.ts.map +1 -0
  302. package/dist/lib/severity-policy.js +44 -0
  303. package/dist/lib/severity-policy.js.map +1 -0
  304. package/dist/lib/telemetry.d.ts +93 -0
  305. package/dist/lib/telemetry.d.ts.map +1 -0
  306. package/dist/lib/telemetry.js +144 -0
  307. package/dist/lib/telemetry.js.map +1 -0
  308. package/dist/lib/ui-context.d.ts +34 -0
  309. package/dist/lib/ui-context.d.ts.map +1 -0
  310. package/dist/lib/ui-context.js +16 -0
  311. package/dist/lib/ui-context.js.map +1 -0
  312. package/dist/lib/verdict-policy.d.ts +71 -0
  313. package/dist/lib/verdict-policy.d.ts.map +1 -0
  314. package/dist/lib/verdict-policy.js +82 -0
  315. package/dist/lib/verdict-policy.js.map +1 -0
  316. package/dist/lib/yaml.d.ts +74 -0
  317. package/dist/lib/yaml.d.ts.map +1 -0
  318. package/dist/lib/yaml.js +118 -0
  319. package/dist/lib/yaml.js.map +1 -0
  320. package/dist/plugins/__tests__/as-if-external.test.d.ts +18 -0
  321. package/dist/plugins/__tests__/as-if-external.test.d.ts.map +1 -0
  322. package/dist/plugins/__tests__/as-if-external.test.js +159 -0
  323. package/dist/plugins/__tests__/as-if-external.test.js.map +1 -0
  324. package/dist/plugins/__tests__/authored-tool-discovery.test.d.ts +8 -0
  325. package/dist/plugins/__tests__/authored-tool-discovery.test.d.ts.map +1 -0
  326. package/dist/plugins/__tests__/authored-tool-discovery.test.js +97 -0
  327. package/dist/plugins/__tests__/authored-tool-discovery.test.js.map +1 -0
  328. package/dist/plugins/__tests__/capability-discovery.test.d.ts +2 -0
  329. package/dist/plugins/__tests__/capability-discovery.test.d.ts.map +1 -0
  330. package/dist/plugins/__tests__/capability-discovery.test.js +349 -0
  331. package/dist/plugins/__tests__/capability-discovery.test.js.map +1 -0
  332. package/dist/plugins/__tests__/capability-from-manifest.test.d.ts +2 -0
  333. package/dist/plugins/__tests__/capability-from-manifest.test.d.ts.map +1 -0
  334. package/dist/plugins/__tests__/capability-from-manifest.test.js +172 -0
  335. package/dist/plugins/__tests__/capability-from-manifest.test.js.map +1 -0
  336. package/dist/plugins/__tests__/capability-loader.test.d.ts +2 -0
  337. package/dist/plugins/__tests__/capability-loader.test.d.ts.map +1 -0
  338. package/dist/plugins/__tests__/capability-loader.test.js +122 -0
  339. package/dist/plugins/__tests__/capability-loader.test.js.map +1 -0
  340. package/dist/plugins/__tests__/capability-registry.test.d.ts +2 -0
  341. package/dist/plugins/__tests__/capability-registry.test.d.ts.map +1 -0
  342. package/dist/plugins/__tests__/capability-registry.test.js +185 -0
  343. package/dist/plugins/__tests__/capability-registry.test.js.map +1 -0
  344. package/dist/plugins/__tests__/discover.test.d.ts +2 -0
  345. package/dist/plugins/__tests__/discover.test.d.ts.map +1 -0
  346. package/dist/plugins/__tests__/discover.test.js +311 -0
  347. package/dist/plugins/__tests__/discover.test.js.map +1 -0
  348. package/dist/plugins/__tests__/loader.test.d.ts +2 -0
  349. package/dist/plugins/__tests__/loader.test.d.ts.map +1 -0
  350. package/dist/plugins/__tests__/loader.test.js +191 -0
  351. package/dist/plugins/__tests__/loader.test.js.map +1 -0
  352. package/dist/plugins/__tests__/manifest-discovery.test.d.ts +2 -0
  353. package/dist/plugins/__tests__/manifest-discovery.test.d.ts.map +1 -0
  354. package/dist/plugins/__tests__/manifest-discovery.test.js +132 -0
  355. package/dist/plugins/__tests__/manifest-discovery.test.js.map +1 -0
  356. package/dist/plugins/__tests__/manifest-loader.test.d.ts +2 -0
  357. package/dist/plugins/__tests__/manifest-loader.test.d.ts.map +1 -0
  358. package/dist/plugins/__tests__/manifest-loader.test.js +434 -0
  359. package/dist/plugins/__tests__/manifest-loader.test.js.map +1 -0
  360. package/dist/plugins/__tests__/marker-discovery.test.d.ts +2 -0
  361. package/dist/plugins/__tests__/marker-discovery.test.d.ts.map +1 -0
  362. package/dist/plugins/__tests__/marker-discovery.test.js +164 -0
  363. package/dist/plugins/__tests__/marker-discovery.test.js.map +1 -0
  364. package/dist/plugins/__tests__/node-modules-walk.test.d.ts +2 -0
  365. package/dist/plugins/__tests__/node-modules-walk.test.d.ts.map +1 -0
  366. package/dist/plugins/__tests__/node-modules-walk.test.js +76 -0
  367. package/dist/plugins/__tests__/node-modules-walk.test.js.map +1 -0
  368. package/dist/plugins/__tests__/package-entry.test.d.ts +9 -0
  369. package/dist/plugins/__tests__/package-entry.test.d.ts.map +1 -0
  370. package/dist/plugins/__tests__/package-entry.test.js +117 -0
  371. package/dist/plugins/__tests__/package-entry.test.js.map +1 -0
  372. package/dist/plugins/__tests__/recipe-loader.test.d.ts +2 -0
  373. package/dist/plugins/__tests__/recipe-loader.test.d.ts.map +1 -0
  374. package/dist/plugins/__tests__/recipe-loader.test.js +130 -0
  375. package/dist/plugins/__tests__/recipe-loader.test.js.map +1 -0
  376. package/dist/plugins/__tests__/scope-validation.test.d.ts +2 -0
  377. package/dist/plugins/__tests__/scope-validation.test.d.ts.map +1 -0
  378. package/dist/plugins/__tests__/scope-validation.test.js +68 -0
  379. package/dist/plugins/__tests__/scope-validation.test.js.map +1 -0
  380. package/dist/plugins/__tests__/single-core-guard.test.d.ts +10 -0
  381. package/dist/plugins/__tests__/single-core-guard.test.d.ts.map +1 -0
  382. package/dist/plugins/__tests__/single-core-guard.test.js +89 -0
  383. package/dist/plugins/__tests__/single-core-guard.test.js.map +1 -0
  384. package/dist/plugins/__tests__/tool-package-discovery.test.d.ts +2 -0
  385. package/dist/plugins/__tests__/tool-package-discovery.test.d.ts.map +1 -0
  386. package/dist/plugins/__tests__/tool-package-discovery.test.js +215 -0
  387. package/dist/plugins/__tests__/tool-package-discovery.test.js.map +1 -0
  388. package/dist/plugins/authored-tool-discovery.d.ts +45 -0
  389. package/dist/plugins/authored-tool-discovery.d.ts.map +1 -0
  390. package/dist/plugins/authored-tool-discovery.js +61 -0
  391. package/dist/plugins/authored-tool-discovery.js.map +1 -0
  392. package/dist/plugins/capability-discovery.d.ts +80 -0
  393. package/dist/plugins/capability-discovery.d.ts.map +1 -0
  394. package/dist/plugins/capability-discovery.js +278 -0
  395. package/dist/plugins/capability-discovery.js.map +1 -0
  396. package/dist/plugins/capability-loader.d.ts +50 -0
  397. package/dist/plugins/capability-loader.d.ts.map +1 -0
  398. package/dist/plugins/capability-loader.js +85 -0
  399. package/dist/plugins/capability-loader.js.map +1 -0
  400. package/dist/plugins/capability-registry.d.ts +169 -0
  401. package/dist/plugins/capability-registry.d.ts.map +1 -0
  402. package/dist/plugins/capability-registry.js +319 -0
  403. package/dist/plugins/capability-registry.js.map +1 -0
  404. package/dist/plugins/discover.d.ts +64 -0
  405. package/dist/plugins/discover.d.ts.map +1 -0
  406. package/dist/plugins/discover.js +303 -0
  407. package/dist/plugins/discover.js.map +1 -0
  408. package/dist/plugins/index.d.ts +37 -0
  409. package/dist/plugins/index.d.ts.map +1 -0
  410. package/dist/plugins/index.js +40 -0
  411. package/dist/plugins/index.js.map +1 -0
  412. package/dist/plugins/json-guards.d.ts +11 -0
  413. package/dist/plugins/json-guards.d.ts.map +1 -0
  414. package/dist/plugins/json-guards.js +15 -0
  415. package/dist/plugins/json-guards.js.map +1 -0
  416. package/dist/plugins/loader.d.ts +67 -0
  417. package/dist/plugins/loader.d.ts.map +1 -0
  418. package/dist/plugins/loader.js +137 -0
  419. package/dist/plugins/loader.js.map +1 -0
  420. package/dist/plugins/manifest-discovery.d.ts +28 -0
  421. package/dist/plugins/manifest-discovery.d.ts.map +1 -0
  422. package/dist/plugins/manifest-discovery.js +103 -0
  423. package/dist/plugins/manifest-discovery.js.map +1 -0
  424. package/dist/plugins/manifest-loader.d.ts +120 -0
  425. package/dist/plugins/manifest-loader.d.ts.map +1 -0
  426. package/dist/plugins/manifest-loader.js +410 -0
  427. package/dist/plugins/manifest-loader.js.map +1 -0
  428. package/dist/plugins/marker-discovery.d.ts +115 -0
  429. package/dist/plugins/marker-discovery.d.ts.map +1 -0
  430. package/dist/plugins/marker-discovery.js +172 -0
  431. package/dist/plugins/marker-discovery.js.map +1 -0
  432. package/dist/plugins/node-modules-walk.d.ts +61 -0
  433. package/dist/plugins/node-modules-walk.d.ts.map +1 -0
  434. package/dist/plugins/node-modules-walk.js +99 -0
  435. package/dist/plugins/node-modules-walk.js.map +1 -0
  436. package/dist/plugins/package-entry.d.ts +38 -0
  437. package/dist/plugins/package-entry.d.ts.map +1 -0
  438. package/dist/plugins/package-entry.js +86 -0
  439. package/dist/plugins/package-entry.js.map +1 -0
  440. package/dist/plugins/recipe-loader.d.ts +63 -0
  441. package/dist/plugins/recipe-loader.d.ts.map +1 -0
  442. package/dist/plugins/recipe-loader.js +67 -0
  443. package/dist/plugins/recipe-loader.js.map +1 -0
  444. package/dist/plugins/scope-validation.d.ts +35 -0
  445. package/dist/plugins/scope-validation.d.ts.map +1 -0
  446. package/dist/plugins/scope-validation.js +55 -0
  447. package/dist/plugins/scope-validation.js.map +1 -0
  448. package/dist/plugins/single-core-guard.d.ts +28 -0
  449. package/dist/plugins/single-core-guard.d.ts.map +1 -0
  450. package/dist/plugins/single-core-guard.js +69 -0
  451. package/dist/plugins/single-core-guard.js.map +1 -0
  452. package/dist/plugins/tool-package-discovery.d.ts +93 -0
  453. package/dist/plugins/tool-package-discovery.d.ts.map +1 -0
  454. package/dist/plugins/tool-package-discovery.js +118 -0
  455. package/dist/plugins/tool-package-discovery.js.map +1 -0
  456. package/dist/plugins/types.d.ts +78 -0
  457. package/dist/plugins/types.d.ts.map +1 -0
  458. package/dist/plugins/types.js +15 -0
  459. package/dist/plugins/types.js.map +1 -0
  460. package/dist/recipes/__tests__/registry.test.d.ts +2 -0
  461. package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
  462. package/dist/recipes/__tests__/registry.test.js +170 -0
  463. package/dist/recipes/__tests__/registry.test.js.map +1 -0
  464. package/dist/recipes/__tests__/selector.test.d.ts +20 -0
  465. package/dist/recipes/__tests__/selector.test.d.ts.map +1 -0
  466. package/dist/recipes/__tests__/selector.test.js +173 -0
  467. package/dist/recipes/__tests__/selector.test.js.map +1 -0
  468. package/dist/recipes/__tests__/unit-config.test.d.ts +7 -0
  469. package/dist/recipes/__tests__/unit-config.test.d.ts.map +1 -0
  470. package/dist/recipes/__tests__/unit-config.test.js +52 -0
  471. package/dist/recipes/__tests__/unit-config.test.js.map +1 -0
  472. package/dist/recipes/registry.d.ts +105 -0
  473. package/dist/recipes/registry.d.ts.map +1 -0
  474. package/dist/recipes/registry.js +141 -0
  475. package/dist/recipes/registry.js.map +1 -0
  476. package/dist/recipes/selector.d.ts +112 -0
  477. package/dist/recipes/selector.d.ts.map +1 -0
  478. package/dist/recipes/selector.js +134 -0
  479. package/dist/recipes/selector.js.map +1 -0
  480. package/dist/recipes/unit-config.d.ts +63 -0
  481. package/dist/recipes/unit-config.d.ts.map +1 -0
  482. package/dist/recipes/unit-config.js +68 -0
  483. package/dist/recipes/unit-config.js.map +1 -0
  484. package/dist/runtime/__tests__/in-process-transport.test.d.ts +6 -0
  485. package/dist/runtime/__tests__/in-process-transport.test.d.ts.map +1 -0
  486. package/dist/runtime/__tests__/in-process-transport.test.js +73 -0
  487. package/dist/runtime/__tests__/in-process-transport.test.js.map +1 -0
  488. package/dist/runtime/__tests__/subprocess-transport.test.d.ts +11 -0
  489. package/dist/runtime/__tests__/subprocess-transport.test.d.ts.map +1 -0
  490. package/dist/runtime/__tests__/subprocess-transport.test.js +118 -0
  491. package/dist/runtime/__tests__/subprocess-transport.test.js.map +1 -0
  492. package/dist/runtime/in-process-transport.d.ts +20 -0
  493. package/dist/runtime/in-process-transport.d.ts.map +1 -0
  494. package/dist/runtime/in-process-transport.js +49 -0
  495. package/dist/runtime/in-process-transport.js.map +1 -0
  496. package/dist/runtime/progress-transport.d.ts +73 -0
  497. package/dist/runtime/progress-transport.d.ts.map +1 -0
  498. package/dist/runtime/progress-transport.js +17 -0
  499. package/dist/runtime/progress-transport.js.map +1 -0
  500. package/dist/runtime/subprocess-transport.d.ts +43 -0
  501. package/dist/runtime/subprocess-transport.d.ts.map +1 -0
  502. package/dist/runtime/subprocess-transport.js +134 -0
  503. package/dist/runtime/subprocess-transport.js.map +1 -0
  504. package/dist/signals/comment-openers.d.ts +29 -0
  505. package/dist/signals/comment-openers.d.ts.map +1 -0
  506. package/dist/signals/comment-openers.js +41 -0
  507. package/dist/signals/comment-openers.js.map +1 -0
  508. package/dist/signals/comment-openers.test.d.ts +7 -0
  509. package/dist/signals/comment-openers.test.d.ts.map +1 -0
  510. package/dist/signals/comment-openers.test.js +41 -0
  511. package/dist/signals/comment-openers.test.js.map +1 -0
  512. package/dist/signals/create-signal-from-violation.d.ts +29 -0
  513. package/dist/signals/create-signal-from-violation.d.ts.map +1 -0
  514. package/dist/signals/create-signal-from-violation.js +29 -0
  515. package/dist/signals/create-signal-from-violation.js.map +1 -0
  516. package/dist/signals/signal-sink.d.ts +49 -0
  517. package/dist/signals/signal-sink.d.ts.map +1 -0
  518. package/dist/signals/signal-sink.js +6 -0
  519. package/dist/signals/signal-sink.js.map +1 -0
  520. package/dist/signals/suppress.d.ts +102 -0
  521. package/dist/signals/suppress.d.ts.map +1 -0
  522. package/dist/signals/suppress.js +325 -0
  523. package/dist/signals/suppress.js.map +1 -0
  524. package/dist/signals/suppress.test.d.ts +2 -0
  525. package/dist/signals/suppress.test.d.ts.map +1 -0
  526. package/dist/signals/suppress.test.js +213 -0
  527. package/dist/signals/suppress.test.js.map +1 -0
  528. package/dist/tools/__tests__/command-spec.test.d.ts +2 -0
  529. package/dist/tools/__tests__/command-spec.test.d.ts.map +1 -0
  530. package/dist/tools/__tests__/command-spec.test.js +191 -0
  531. package/dist/tools/__tests__/command-spec.test.js.map +1 -0
  532. package/dist/tools/__tests__/compatibility.test.d.ts +5 -0
  533. package/dist/tools/__tests__/compatibility.test.d.ts.map +1 -0
  534. package/dist/tools/__tests__/compatibility.test.js +41 -0
  535. package/dist/tools/__tests__/compatibility.test.js.map +1 -0
  536. package/dist/tools/__tests__/ids.test.d.ts +5 -0
  537. package/dist/tools/__tests__/ids.test.d.ts.map +1 -0
  538. package/dist/tools/__tests__/ids.test.js +56 -0
  539. package/dist/tools/__tests__/ids.test.js.map +1 -0
  540. package/dist/tools/__tests__/manifest-assert.test.d.ts +5 -0
  541. package/dist/tools/__tests__/manifest-assert.test.d.ts.map +1 -0
  542. package/dist/tools/__tests__/manifest-assert.test.js +66 -0
  543. package/dist/tools/__tests__/manifest-assert.test.js.map +1 -0
  544. package/dist/tools/__tests__/registry.test.d.ts +2 -0
  545. package/dist/tools/__tests__/registry.test.d.ts.map +1 -0
  546. package/dist/tools/__tests__/registry.test.js +93 -0
  547. package/dist/tools/__tests__/registry.test.js.map +1 -0
  548. package/dist/tools/__tests__/types.test.d.ts +2 -0
  549. package/dist/tools/__tests__/types.test.d.ts.map +1 -0
  550. package/dist/tools/__tests__/types.test.js +51 -0
  551. package/dist/tools/__tests__/types.test.js.map +1 -0
  552. package/dist/tools/capability.d.ts +257 -0
  553. package/dist/tools/capability.d.ts.map +1 -0
  554. package/dist/tools/capability.js +46 -0
  555. package/dist/tools/capability.js.map +1 -0
  556. package/dist/tools/command-spec.d.ts +211 -0
  557. package/dist/tools/command-spec.d.ts.map +1 -0
  558. package/dist/tools/command-spec.js +110 -0
  559. package/dist/tools/command-spec.js.map +1 -0
  560. package/dist/tools/compatibility.d.ts +45 -0
  561. package/dist/tools/compatibility.d.ts.map +1 -0
  562. package/dist/tools/compatibility.js +49 -0
  563. package/dist/tools/compatibility.js.map +1 -0
  564. package/dist/tools/ids.d.ts +61 -0
  565. package/dist/tools/ids.d.ts.map +1 -0
  566. package/dist/tools/ids.js +61 -0
  567. package/dist/tools/ids.js.map +1 -0
  568. package/dist/tools/index.d.ts +22 -0
  569. package/dist/tools/index.d.ts.map +1 -0
  570. package/dist/tools/index.js +28 -0
  571. package/dist/tools/index.js.map +1 -0
  572. package/dist/tools/manifest-assert.d.ts +35 -0
  573. package/dist/tools/manifest-assert.d.ts.map +1 -0
  574. package/dist/tools/manifest-assert.js +67 -0
  575. package/dist/tools/manifest-assert.js.map +1 -0
  576. package/dist/tools/manifest.d.ts +178 -0
  577. package/dist/tools/manifest.d.ts.map +1 -0
  578. package/dist/tools/manifest.js +35 -0
  579. package/dist/tools/manifest.js.map +1 -0
  580. package/dist/tools/registry.d.ts +37 -0
  581. package/dist/tools/registry.d.ts.map +1 -0
  582. package/dist/tools/registry.js +49 -0
  583. package/dist/tools/registry.js.map +1 -0
  584. package/dist/tools/types.d.ts +1021 -0
  585. package/dist/tools/types.d.ts.map +1 -0
  586. package/dist/tools/types.js +77 -0
  587. package/dist/tools/types.js.map +1 -0
  588. package/dist/types/__tests__/signal.test.d.ts +2 -0
  589. package/dist/types/__tests__/signal.test.d.ts.map +1 -0
  590. package/dist/types/__tests__/signal.test.js +111 -0
  591. package/dist/types/__tests__/signal.test.js.map +1 -0
  592. package/dist/types/index.d.ts +5 -0
  593. package/dist/types/index.d.ts.map +1 -0
  594. package/dist/types/index.js +3 -0
  595. package/dist/types/index.js.map +1 -0
  596. package/dist/types/signal-batch.d.ts +56 -0
  597. package/dist/types/signal-batch.d.ts.map +1 -0
  598. package/dist/types/signal-batch.js +54 -0
  599. package/dist/types/signal-batch.js.map +1 -0
  600. package/dist/types/signal.d.ts +77 -0
  601. package/dist/types/signal.d.ts.map +1 -0
  602. package/dist/types/signal.js +42 -0
  603. package/dist/types/signal.js.map +1 -0
  604. package/package.json +57 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @fileoverview UiContext — per-invocation presentation settings.
3
+ *
4
+ * A small kernel-level bag for values the render paths need but that aren't
5
+ * owned by any single tool: the selected banner size and the CLI version.
6
+ * Populated once by the CLI bootstrap (pre-action hook) and read by every
7
+ * render seam — the static `App`, fit's live view, and graph's live view —
8
+ * via `currentScope()?.ui`.
9
+ *
10
+ * `bannerSize` is a plain `string` here, NOT the `BannerSize` union: that
11
+ * union lives in `@opensip-cli/cli-ui` (a higher layer the kernel must not
12
+ * import). The render sites narrow it with `normalizeBannerSize` at the
13
+ * point of use, so an unknown / stale config value degrades to `lg`.
14
+ */
15
+ /** Per-invocation presentation settings, read by the render paths. */
16
+ export interface UiContext {
17
+ /**
18
+ * Selected banner art: `lg` | `md` | `sm` | `mini` (product default
19
+ * `mini`, applied by the CLI bootstrap when no `cli.ui.banner` is set).
20
+ * Stored untyped; narrowed via cli-ui's `normalizeBannerSize` at render.
21
+ */
22
+ readonly bannerSize: string;
23
+ /** CLI version (e.g. `1.0.0`), shown by the `mini` banner. */
24
+ readonly version: string;
25
+ /**
26
+ * Newer published version available on npm (e.g. `1.0.1`), or `undefined`
27
+ * when up-to-date / the check is skipped or hasn't completed. Resolved by
28
+ * the CLI bootstrap from the cached `update-notifier` result. The `mini`
29
+ * banner surfaces it inline as `(<new-version> available)`; other sizes rely on
30
+ * the separate stderr nag.
31
+ */
32
+ readonly update?: string;
33
+ }
34
+ //# sourceMappingURL=ui-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-context.d.ts","sourceRoot":"","sources":["../../src/lib/ui-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @fileoverview UiContext — per-invocation presentation settings.
3
+ *
4
+ * A small kernel-level bag for values the render paths need but that aren't
5
+ * owned by any single tool: the selected banner size and the CLI version.
6
+ * Populated once by the CLI bootstrap (pre-action hook) and read by every
7
+ * render seam — the static `App`, fit's live view, and graph's live view —
8
+ * via `currentScope()?.ui`.
9
+ *
10
+ * `bannerSize` is a plain `string` here, NOT the `BannerSize` union: that
11
+ * union lives in `@opensip-cli/cli-ui` (a higher layer the kernel must not
12
+ * import). The render sites narrow it with `normalizeBannerSize` at the
13
+ * point of use, so an unknown / stale config value degrades to `lg`.
14
+ */
15
+ export {};
16
+ //# sourceMappingURL=ui-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-context.js","sourceRoot":"","sources":["../../src/lib/ui-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @fileoverview Verdict policy — the host-owned findings gate (ADR-0035).
3
+ *
4
+ * A run's pass/fail is one value, `envelope.verdict.passed`, computed from the
5
+ * run's error/warning counts against a tool-declared findings policy. The policy
6
+ * is two reserved config keys — `failOnErrors` / `failOnWarnings` — recognized in
7
+ * EVERY tool's config namespace, with a host fallback of `{1, 0}` (fail on any
8
+ * error, warnings informational) when a tool declares neither.
9
+ *
10
+ * Lives in `lib/` next to {@link ./severity-policy} (the error/warning split it
11
+ * pairs with), NOT under `tools/`: `resolveVerdictPolicy` reads
12
+ * `currentScope().toolConfig`, and `run-scope.ts` imports `tools/registry.js`, so
13
+ * a `tools/ → run-scope` edge would reintroduce a cycle (see `tools/types.ts`).
14
+ * `contracts` imports {@link VerdictPolicy} / {@link policyPasses} from here the
15
+ * same way it imports `SeverityPolicy`.
16
+ */
17
+ /** The findings gate for a run: fail when counts cross either threshold. */
18
+ export interface VerdictPolicy {
19
+ /** Fail when `errors >= failOnErrors`; `0` disables the error gate. */
20
+ readonly failOnErrors: number;
21
+ /** Fail when `warnings >= failOnWarnings`; `0` disables the warning gate. */
22
+ readonly failOnWarnings: number;
23
+ }
24
+ /**
25
+ * Host fallback applied when a tool declares neither reserved key: fail on any
26
+ * error, warnings informational. This is fit's historical default generalized to
27
+ * every tool (graph/sim inherit it, reproducing their `errors > 0 ⇒ fail`).
28
+ */
29
+ export declare const HOST_VERDICT_POLICY_FALLBACK: VerdictPolicy;
30
+ /**
31
+ * The findings predicate: `true` ⇔ the run passes its policy. Pure. Mirrors
32
+ * fit's pre-ADR-0035 threshold (`result-builders.ts`) exactly — a `> 0` threshold
33
+ * is active, `0` disables that rung. Execution faults are handled by the caller
34
+ * (the envelope's `runFaulted` / unit `error`), not here.
35
+ */
36
+ export declare function policyPasses(counts: {
37
+ readonly errors: number;
38
+ readonly warnings: number;
39
+ }, policy: VerdictPolicy): boolean;
40
+ /**
41
+ * Resolve a tool's findings policy from its config namespace. Reads the already-
42
+ * resolved `currentScope().toolConfig?.[toolNamespace]` (ADR-0023 applied the
43
+ * flag>env>file>defaults precedence upstream); this only extracts the two
44
+ * reserved keys and applies {@link HOST_VERDICT_POLICY_FALLBACK} per-key, so a
45
+ * tool may declare one key and inherit the other.
46
+ */
47
+ export declare function resolveVerdictPolicy(toolNamespace: string): VerdictPolicy;
48
+ /**
49
+ * Host default for the third reserved gate key, `failOnDegraded` (ADR-0036): a
50
+ * `--gate-compare` that finds net-new findings (the diff is `degraded`) fails the
51
+ * run. `true` by default.
52
+ */
53
+ export declare const DEFAULT_FAIL_ON_DEGRADED = true;
54
+ /**
55
+ * Resolve the net-new ratchet's hard-fail switch, `failOnDegraded` (ADR-0036) —
56
+ * the THIRD reserved gate key beside `failOnErrors`/`failOnWarnings`, read off the
57
+ * same already-resolved `currentScope().toolConfig?.[toolNamespace]` (ADR-0023
58
+ * flag>env>file precedence). Boolean, default {@link DEFAULT_FAIL_ON_DEGRADED}.
59
+ *
60
+ * Deliberately NOT part of {@link VerdictPolicy} or {@link policyPasses}: the
61
+ * findings verdict stays a pure function of findings, while the gate-compare
62
+ * ratchet is the documented ADR-0035 Phase-5 RETAIN carve-out — an orthogonal,
63
+ * gate-dispatch-only mechanism. `false` ⇒ ratchet-as-report (compare runs, prints
64
+ * the diff, exits 0), mirroring ADR-0020's `failOnErrors:0 = ratchet-only`.
65
+ *
66
+ * The HOST derives the exit: dispatch passes `degraded && failOnDegraded` as the
67
+ * `deliverSignals` runFailed override (→ RUNTIME_ERROR). No tool calls
68
+ * `setExitCode` for the gate path (ADR-0035 invariant).
69
+ */
70
+ export declare function resolveFailOnDegraded(toolNamespace: string): boolean;
71
+ //# sourceMappingURL=verdict-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdict-policy.d.ts","sourceRoot":"","sources":["../../src/lib/verdict-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,aAG1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC9D,MAAM,EAAE,aAAa,GACpB,OAAO,CAIT;AAOD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAMzE;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAGpE"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @fileoverview Verdict policy — the host-owned findings gate (ADR-0035).
3
+ *
4
+ * A run's pass/fail is one value, `envelope.verdict.passed`, computed from the
5
+ * run's error/warning counts against a tool-declared findings policy. The policy
6
+ * is two reserved config keys — `failOnErrors` / `failOnWarnings` — recognized in
7
+ * EVERY tool's config namespace, with a host fallback of `{1, 0}` (fail on any
8
+ * error, warnings informational) when a tool declares neither.
9
+ *
10
+ * Lives in `lib/` next to {@link ./severity-policy} (the error/warning split it
11
+ * pairs with), NOT under `tools/`: `resolveVerdictPolicy` reads
12
+ * `currentScope().toolConfig`, and `run-scope.ts` imports `tools/registry.js`, so
13
+ * a `tools/ → run-scope` edge would reintroduce a cycle (see `tools/types.ts`).
14
+ * `contracts` imports {@link VerdictPolicy} / {@link policyPasses} from here the
15
+ * same way it imports `SeverityPolicy`.
16
+ */
17
+ import { currentScope } from './run-scope.js';
18
+ /**
19
+ * Host fallback applied when a tool declares neither reserved key: fail on any
20
+ * error, warnings informational. This is fit's historical default generalized to
21
+ * every tool (graph/sim inherit it, reproducing their `errors > 0 ⇒ fail`).
22
+ */
23
+ export const HOST_VERDICT_POLICY_FALLBACK = {
24
+ failOnErrors: 1,
25
+ failOnWarnings: 0,
26
+ };
27
+ /**
28
+ * The findings predicate: `true` ⇔ the run passes its policy. Pure. Mirrors
29
+ * fit's pre-ADR-0035 threshold (`result-builders.ts`) exactly — a `> 0` threshold
30
+ * is active, `0` disables that rung. Execution faults are handled by the caller
31
+ * (the envelope's `runFaulted` / unit `error`), not here.
32
+ */
33
+ export function policyPasses(counts, policy) {
34
+ const failsOnErrors = policy.failOnErrors > 0 && counts.errors >= policy.failOnErrors;
35
+ const failsOnWarnings = policy.failOnWarnings > 0 && counts.warnings >= policy.failOnWarnings;
36
+ return !failsOnErrors && !failsOnWarnings;
37
+ }
38
+ /** A resolved config value is a usable threshold only if it is a non-negative int. */
39
+ function asThreshold(value) {
40
+ return typeof value === 'number' && Number.isInteger(value) && value >= 0 ? value : undefined;
41
+ }
42
+ /**
43
+ * Resolve a tool's findings policy from its config namespace. Reads the already-
44
+ * resolved `currentScope().toolConfig?.[toolNamespace]` (ADR-0023 applied the
45
+ * flag>env>file>defaults precedence upstream); this only extracts the two
46
+ * reserved keys and applies {@link HOST_VERDICT_POLICY_FALLBACK} per-key, so a
47
+ * tool may declare one key and inherit the other.
48
+ */
49
+ export function resolveVerdictPolicy(toolNamespace) {
50
+ const ns = currentScope()?.toolConfig?.[toolNamespace];
51
+ return {
52
+ failOnErrors: asThreshold(ns?.failOnErrors) ?? HOST_VERDICT_POLICY_FALLBACK.failOnErrors,
53
+ failOnWarnings: asThreshold(ns?.failOnWarnings) ?? HOST_VERDICT_POLICY_FALLBACK.failOnWarnings,
54
+ };
55
+ }
56
+ /**
57
+ * Host default for the third reserved gate key, `failOnDegraded` (ADR-0036): a
58
+ * `--gate-compare` that finds net-new findings (the diff is `degraded`) fails the
59
+ * run. `true` by default.
60
+ */
61
+ export const DEFAULT_FAIL_ON_DEGRADED = true;
62
+ /**
63
+ * Resolve the net-new ratchet's hard-fail switch, `failOnDegraded` (ADR-0036) —
64
+ * the THIRD reserved gate key beside `failOnErrors`/`failOnWarnings`, read off the
65
+ * same already-resolved `currentScope().toolConfig?.[toolNamespace]` (ADR-0023
66
+ * flag>env>file precedence). Boolean, default {@link DEFAULT_FAIL_ON_DEGRADED}.
67
+ *
68
+ * Deliberately NOT part of {@link VerdictPolicy} or {@link policyPasses}: the
69
+ * findings verdict stays a pure function of findings, while the gate-compare
70
+ * ratchet is the documented ADR-0035 Phase-5 RETAIN carve-out — an orthogonal,
71
+ * gate-dispatch-only mechanism. `false` ⇒ ratchet-as-report (compare runs, prints
72
+ * the diff, exits 0), mirroring ADR-0020's `failOnErrors:0 = ratchet-only`.
73
+ *
74
+ * The HOST derives the exit: dispatch passes `degraded && failOnDegraded` as the
75
+ * `deliverSignals` runFailed override (→ RUNTIME_ERROR). No tool calls
76
+ * `setExitCode` for the gate path (ADR-0035 invariant).
77
+ */
78
+ export function resolveFailOnDegraded(toolNamespace) {
79
+ const value = currentScope()?.toolConfig?.[toolNamespace]?.failOnDegraded;
80
+ return typeof value === 'boolean' ? value : DEFAULT_FAIL_ON_DEGRADED;
81
+ }
82
+ //# sourceMappingURL=verdict-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdict-policy.js","sourceRoot":"","sources":["../../src/lib/verdict-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAU9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAkB;IACzD,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,MAA8D,EAC9D,MAAqB;IAErB,MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC;IACtF,MAAM,eAAe,GAAG,MAAM,CAAC,cAAc,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,cAAc,CAAC;IAC9F,OAAO,CAAC,aAAa,IAAI,CAAC,eAAe,CAAC;AAC5C,CAAC;AAED,sFAAsF;AACtF,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAChG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,aAAqB;IACxD,MAAM,EAAE,GAAG,YAAY,EAAE,EAAE,UAAU,EAAE,CAAC,aAAa,CAAC,CAAC;IACvD,OAAO;QACL,YAAY,EAAE,WAAW,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,4BAA4B,CAAC,YAAY;QACxF,cAAc,EAAE,WAAW,CAAC,EAAE,EAAE,cAAc,CAAC,IAAI,4BAA4B,CAAC,cAAc;KAC/F,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CAAC,aAAqB;IACzD,MAAM,KAAK,GAAG,YAAY,EAAE,EAAE,UAAU,EAAE,CAAC,aAAa,CAAC,EAAE,cAAc,CAAC;IAC1E,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,wBAAwB,CAAC;AACvE,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @fileoverview Permissive YAML reader used by plugin-discovery sites
3
+ * that need to extract a single field from `opensip-cli.config.yml`
4
+ * without dragging in a Zod schema or surfacing structured errors.
5
+ *
6
+ * The kernel's plugin discovery (and fitness's check-package discovery)
7
+ * only need to read `plugins.<domain>` / `plugins.checkPackages`
8
+ * out of the project config. They previously reached for js-yaml via a
9
+ * `createRequire(import.meta.url)` shim — duplicated, and unnecessary
10
+ * now that `js-yaml` is a direct dep of every package that calls this.
11
+ *
12
+ * Behavior:
13
+ * - Missing file → `undefined`
14
+ * - I/O error → `undefined`
15
+ * - Malformed YAML → `undefined`
16
+ * - Valid YAML → parsed value (typed `unknown`; callers narrow)
17
+ *
18
+ * Strict YAML loading (with structured errors and size caps) is the
19
+ * targets loader's job — it lives in fitness because the schema lives
20
+ * there. Don't add error-throwing modes here; that's a different tool's
21
+ * surface.
22
+ */
23
+ /**
24
+ * Read a YAML file and return the parsed document. Returns `undefined`
25
+ * on any failure (missing, unreadable, or malformed). Callers that
26
+ * need structured error reporting should use a dedicated loader
27
+ * instead — this helper exists for the discovery seam where "no
28
+ * config" and "bad config" are both treated the same: don't load
29
+ * plugins.
30
+ *
31
+ * @remarks Advanced / discouraged for general use. This is the
32
+ * "permissive" reader for plugin discovery; tools that read their
33
+ * own config should keep a dedicated loader (see fitness's
34
+ * targets/loader.ts) so malformed YAML surfaces a structured error
35
+ * instead of silently no-op'ing.
36
+ *
37
+ * On parse failure we still emit a `core.yaml.parse_failed` debug
38
+ * log so a `--debug` run reveals the cause — "permissive" should
39
+ * not mean "silent" at the kernel layer.
40
+ */
41
+ export declare function readYamlFile(filePath: string): unknown;
42
+ /** Knobs for {@link readYamlFileOrThrow}: size guard and loader attribution. */
43
+ export interface ReadYamlFileOrThrowOptions {
44
+ /**
45
+ * Maximum file size in bytes before this loader refuses to read.
46
+ * Defaults to 10 MB — a project config file that grows past this is
47
+ * almost certainly checked-in test data or a bug.
48
+ */
49
+ readonly maxBytes?: number;
50
+ /**
51
+ * Loader name surfaced in `ValidationError.options.loader` so
52
+ * downstream error rendering can attribute failures to the right
53
+ * subsystem (e.g. `'signalers'`, `'cli-defaults'`).
54
+ */
55
+ readonly loader?: string;
56
+ }
57
+ /**
58
+ * Strict counterpart to `readYamlFile`. Throws structured errors on
59
+ * any failure mode instead of returning `undefined`:
60
+ *
61
+ * - `ValidationError` — missing file, unreadable file, malformed YAML.
62
+ * The `loader` and `operation` fields are populated for downstream
63
+ * attribution.
64
+ * - `SystemError` — file exceeds `maxBytes` (default 10 MB).
65
+ *
66
+ * Consumers that want hand-rolled stat/read/parse with the same
67
+ * structured errors should call this instead — it consolidates a
68
+ * pattern previously duplicated across loaders (audit-round-2 Finding F).
69
+ *
70
+ * @throws {ValidationError} When the file is missing, unreadable, or contains malformed YAML.
71
+ * @throws {SystemError} When the file exceeds `maxBytes`.
72
+ */
73
+ export declare function readYamlFileOrThrow(filePath: string, options?: ReadYamlFileOrThrowOptions): unknown;
74
+ //# sourceMappingURL=yaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../src/lib/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AASH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CActD;AAED,gFAAgF;AAChF,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAsCT"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * @fileoverview Permissive YAML reader used by plugin-discovery sites
3
+ * that need to extract a single field from `opensip-cli.config.yml`
4
+ * without dragging in a Zod schema or surfacing structured errors.
5
+ *
6
+ * The kernel's plugin discovery (and fitness's check-package discovery)
7
+ * only need to read `plugins.<domain>` / `plugins.checkPackages`
8
+ * out of the project config. They previously reached for js-yaml via a
9
+ * `createRequire(import.meta.url)` shim — duplicated, and unnecessary
10
+ * now that `js-yaml` is a direct dep of every package that calls this.
11
+ *
12
+ * Behavior:
13
+ * - Missing file → `undefined`
14
+ * - I/O error → `undefined`
15
+ * - Malformed YAML → `undefined`
16
+ * - Valid YAML → parsed value (typed `unknown`; callers narrow)
17
+ *
18
+ * Strict YAML loading (with structured errors and size caps) is the
19
+ * targets loader's job — it lives in fitness because the schema lives
20
+ * there. Don't add error-throwing modes here; that's a different tool's
21
+ * surface.
22
+ */
23
+ import { existsSync, readFileSync, statSync } from 'node:fs';
24
+ import yaml from 'js-yaml';
25
+ import { SystemError, ValidationError } from './errors.js';
26
+ import { logger } from './logger.js';
27
+ /**
28
+ * Read a YAML file and return the parsed document. Returns `undefined`
29
+ * on any failure (missing, unreadable, or malformed). Callers that
30
+ * need structured error reporting should use a dedicated loader
31
+ * instead — this helper exists for the discovery seam where "no
32
+ * config" and "bad config" are both treated the same: don't load
33
+ * plugins.
34
+ *
35
+ * @remarks Advanced / discouraged for general use. This is the
36
+ * "permissive" reader for plugin discovery; tools that read their
37
+ * own config should keep a dedicated loader (see fitness's
38
+ * targets/loader.ts) so malformed YAML surfaces a structured error
39
+ * instead of silently no-op'ing.
40
+ *
41
+ * On parse failure we still emit a `core.yaml.parse_failed` debug
42
+ * log so a `--debug` run reveals the cause — "permissive" should
43
+ * not mean "silent" at the kernel layer.
44
+ */
45
+ export function readYamlFile(filePath) {
46
+ if (!existsSync(filePath))
47
+ return undefined;
48
+ try {
49
+ const raw = readFileSync(filePath, 'utf8');
50
+ return yaml.load(raw);
51
+ }
52
+ catch (error) {
53
+ logger.debug({
54
+ evt: 'core.yaml.parse_failed',
55
+ module: 'core:lib',
56
+ filePath,
57
+ error: error instanceof Error ? error.message : String(error),
58
+ });
59
+ return undefined;
60
+ }
61
+ }
62
+ /**
63
+ * Strict counterpart to `readYamlFile`. Throws structured errors on
64
+ * any failure mode instead of returning `undefined`:
65
+ *
66
+ * - `ValidationError` — missing file, unreadable file, malformed YAML.
67
+ * The `loader` and `operation` fields are populated for downstream
68
+ * attribution.
69
+ * - `SystemError` — file exceeds `maxBytes` (default 10 MB).
70
+ *
71
+ * Consumers that want hand-rolled stat/read/parse with the same
72
+ * structured errors should call this instead — it consolidates a
73
+ * pattern previously duplicated across loaders (audit-round-2 Finding F).
74
+ *
75
+ * @throws {ValidationError} When the file is missing, unreadable, or contains malformed YAML.
76
+ * @throws {SystemError} When the file exceeds `maxBytes`.
77
+ */
78
+ export function readYamlFileOrThrow(filePath, options = {}) {
79
+ const loader = options.loader ?? 'yaml';
80
+ const maxBytes = options.maxBytes ?? 10 * 1024 * 1024;
81
+ let raw;
82
+ try {
83
+ const stats = statSync(filePath);
84
+ if (stats.size > maxBytes) {
85
+ throw new SystemError(`File too large (${stats.size} bytes, max ${maxBytes}): ${filePath}`, {
86
+ code: 'SYSTEM.FILE.TOO_LARGE',
87
+ operation: 'read',
88
+ loader,
89
+ filePath,
90
+ });
91
+ }
92
+ raw = readFileSync(filePath, 'utf8');
93
+ }
94
+ catch (error) {
95
+ if (error instanceof SystemError || error instanceof ValidationError)
96
+ throw error;
97
+ const message = error instanceof Error ? error.message : String(error);
98
+ throw new ValidationError(`Failed to read ${filePath}: ${message}`, {
99
+ operation: 'read',
100
+ loader,
101
+ filePath,
102
+ cause: error instanceof Error ? error : undefined,
103
+ });
104
+ }
105
+ try {
106
+ return yaml.load(raw) ?? {};
107
+ }
108
+ catch (error) {
109
+ const message = error instanceof Error ? error.message : String(error);
110
+ throw new ValidationError(`${filePath} contains invalid YAML: ${message}`, {
111
+ operation: 'parse',
112
+ loader,
113
+ filePath,
114
+ cause: error instanceof Error ? error : undefined,
115
+ });
116
+ }
117
+ }
118
+ //# sourceMappingURL=yaml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.js","sourceRoot":"","sources":["../../src/lib/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,IAAI,CAAC;QACH,MAAM,G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KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,IAAI,eAAe,CAAC,kBAAkB,QAAQ,KAAK,OAAO,EAAE,EAAE;YAClE,SAAS,EAAE,MAAM;YACjB,MAAM;YACN,QAAQ;YACR,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SAClD,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,IAAI,eAAe,CAAC,GAAG,QAAQ,2BAA2B,OAAO,EAAE,EAAE;YACzE,SAAS,EAAE,OAAO;YAClB,MAAM;YACN,QAAQ;YACR,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SAClD,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @fileoverview As-if-external acceptance test (release 2.8.0, identity &
3
+ * compatibility — Phase 5, task 5.2).
4
+ *
5
+ * The miniature of the north-star §8 minimum proof slice: a **bundled** tool's
6
+ * static manifest, loaded + admitted through the **exact same** gate path an
7
+ * external tool would take (`loadToolManifest` → `admitTool`), is admitted
8
+ * identically — and the gate actually fires on incompatibility.
9
+ *
10
+ * Why the equality is asserted against a KNOWN command list rather than by
11
+ * importing the tool's runtime `Tool.commands`: core is the kernel and MUST
12
+ * NOT import `@opensip-cli/fitness` / `graph` / `simulation` (the layering
13
+ * rule dependency-cruiser enforces). The manifest⇔tool equality was already
14
+ * asserted from the tool side in Phase 1; here we assert the manifest the
15
+ * host reads matches the contract-frozen command set the tools register.
16
+ */
17
+ export {};
18
+ //# sourceMappingURL=as-if-external.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"as-if-external.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/as-if-external.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * @fileoverview As-if-external acceptance test (release 2.8.0, identity &
3
+ * compatibility — Phase 5, task 5.2).
4
+ *
5
+ * The miniature of the north-star §8 minimum proof slice: a **bundled** tool's
6
+ * static manifest, loaded + admitted through the **exact same** gate path an
7
+ * external tool would take (`loadToolManifest` → `admitTool`), is admitted
8
+ * identically — and the gate actually fires on incompatibility.
9
+ *
10
+ * Why the equality is asserted against a KNOWN command list rather than by
11
+ * importing the tool's runtime `Tool.commands`: core is the kernel and MUST
12
+ * NOT import `@opensip-cli/fitness` / `graph` / `simulation` (the layering
13
+ * rule dependency-cruiser enforces). The manifest⇔tool equality was already
14
+ * asserted from the tool side in Phase 1; here we assert the manifest the
15
+ * host reads matches the contract-frozen command set the tools register.
16
+ */
17
+ import { dirname, join } from 'node:path';
18
+ import { fileURLToPath } from 'node:url';
19
+ import { describe, expect, it } from 'vitest';
20
+ import { PLUGIN_API_VERSION } from '../../tools/manifest.js';
21
+ import { admitTool, loadToolManifest } from '../manifest-loader.js';
22
+ const HERE = dirname(fileURLToPath(import.meta.url));
23
+ /** Repo root, five levels up from this test's directory. */
24
+ const REPO_ROOT = join(HERE, '..', '..', '..', '..', '..');
25
+ /**
26
+ * The three bundled tools' engine package dirs + their CONTRACT-FROZEN command
27
+ * name sets. These are the exact lists the runtime `Tool.commands` arrays
28
+ * register (Phase 1 asserts manifest⇔Tool from the tool side); core asserts
29
+ * the host-read manifest matches them without importing the tool runtime.
30
+ */
31
+ const BUNDLED_TOOLS = [
32
+ {
33
+ id: 'fitness',
34
+ dir: join(REPO_ROOT, 'packages', 'fitness', 'engine'),
35
+ commands: ['fit', 'fit-list', 'fit-recipes', 'fit-baseline-export', 'fit-run-worker'],
36
+ },
37
+ {
38
+ id: 'simulation',
39
+ dir: join(REPO_ROOT, 'packages', 'simulation', 'engine'),
40
+ commands: ['sim', 'sim-run-worker'],
41
+ },
42
+ {
43
+ id: 'graph',
44
+ dir: join(REPO_ROOT, 'packages', 'graph', 'engine'),
45
+ commands: [
46
+ 'graph',
47
+ 'graph-lookup',
48
+ 'graph-symbol-index',
49
+ 'graph-baseline-export',
50
+ 'graph-shard-worker',
51
+ 'graph-equivalence-check',
52
+ 'graph-run-worker',
53
+ 'catalog-export',
54
+ 'sarif-export',
55
+ 'graph-recipes',
56
+ ],
57
+ },
58
+ ];
59
+ const FIXTURES = join(HERE, '__fixtures__');
60
+ const FUTURE_EPOCH_DIR = join(FIXTURES, 'future-epoch-tool');
61
+ const NO_APIVERSION_DIR = join(FIXTURES, 'no-apiversion-tool');
62
+ describe('as-if-external gate — bundled tools admitted through the external path', () => {
63
+ for (const tool of BUNDLED_TOOLS) {
64
+ describe(`${tool.id} (bundled)`, () => {
65
+ it('(a) loads its static manifest from package.json and admits it', () => {
66
+ const manifest = loadToolManifest('bundled', tool.dir);
67
+ expect(manifest, `expected a readable manifest for ${tool.id}`).toBeDefined();
68
+ if (manifest === undefined)
69
+ return;
70
+ expect(manifest.kind).toBe('tool');
71
+ expect(manifest.id).toBe(tool.id);
72
+ // Bundled tools declare the current epoch.
73
+ expect(manifest.apiVersion).toBe(PLUGIN_API_VERSION);
74
+ const result = admitTool({
75
+ manifest,
76
+ source: 'bundled',
77
+ dir: tool.dir,
78
+ packageName: manifest.name,
79
+ explicitlyRequested: false,
80
+ });
81
+ expect(result.decision).toBe('admit');
82
+ expect(result.verdict.kind).toBe('compatible');
83
+ expect(result.diagnostic).toBeUndefined();
84
+ // Provenance identity matches the tool the host read.
85
+ expect(result.provenance.source).toBe('bundled');
86
+ expect(result.provenance.id).toBe(tool.id);
87
+ expect(result.provenance.resolvedPath).toBe(tool.dir);
88
+ expect(result.provenance.manifestHash).toMatch(/^[0-9a-f]{64}$/);
89
+ });
90
+ it('(b) manifest command-name SET equals the contract-frozen Tool.commands set', () => {
91
+ const manifest = loadToolManifest('bundled', tool.dir);
92
+ expect(manifest).toBeDefined();
93
+ if (manifest === undefined)
94
+ return;
95
+ const manifestNames = new Set(manifest.commands.map((c) => c.name));
96
+ expect(manifestNames).toEqual(new Set(tool.commands));
97
+ // Every command entry carries a non-empty description (the manifest
98
+ // contract the guardrail enforces).
99
+ for (const cmd of manifest.commands) {
100
+ expect(typeof cmd.description).toBe('string');
101
+ expect(cmd.name.length).toBeGreaterThan(0);
102
+ }
103
+ });
104
+ });
105
+ }
106
+ });
107
+ describe('as-if-external gate — the gate fires on incompatibility', () => {
108
+ it('(c) skips an out-of-range tool that was NOT explicitly requested', () => {
109
+ const manifest = loadToolManifest('installed', FUTURE_EPOCH_DIR);
110
+ expect(manifest?.apiVersion).toBe(999);
111
+ if (manifest === undefined)
112
+ return;
113
+ const result = admitTool({
114
+ manifest,
115
+ source: 'installed',
116
+ dir: FUTURE_EPOCH_DIR,
117
+ explicitlyRequested: false,
118
+ });
119
+ expect(result.decision).toBe('skip');
120
+ expect(result.verdict.kind).toBe('incompatible');
121
+ expect(result.diagnostic).toBeTruthy();
122
+ expect(result.diagnostic).toContain('999');
123
+ // Provenance is still recorded for a skipped tool.
124
+ expect(result.provenance.id).toBe('future');
125
+ });
126
+ it('(c) fails closed for an out-of-range tool that WAS explicitly requested', () => {
127
+ const manifest = loadToolManifest('installed', FUTURE_EPOCH_DIR);
128
+ expect(manifest).toBeDefined();
129
+ if (manifest === undefined)
130
+ return;
131
+ const result = admitTool({
132
+ manifest,
133
+ source: 'installed',
134
+ dir: FUTURE_EPOCH_DIR,
135
+ explicitlyRequested: true,
136
+ });
137
+ expect(result.decision).toBe('fail-closed');
138
+ expect(result.verdict.kind).toBe('incompatible');
139
+ expect(result.diagnostic).toBeTruthy();
140
+ });
141
+ it('(d) fail-closes an explicitly-requested tool with NO apiVersion (3.0.0 — grace window ended)', () => {
142
+ const manifest = loadToolManifest('installed', NO_APIVERSION_DIR);
143
+ expect(manifest).toBeDefined();
144
+ if (manifest === undefined)
145
+ return;
146
+ // The manifest omits apiVersion entirely.
147
+ expect(manifest.apiVersion).toBeUndefined();
148
+ const result = admitTool({
149
+ manifest,
150
+ source: 'installed',
151
+ dir: NO_APIVERSION_DIR,
152
+ explicitlyRequested: true, // 3.0.0: a missing apiVersion + explicit request → fail-closed.
153
+ });
154
+ expect(result.decision).toBe('fail-closed');
155
+ expect(result.verdict.kind).toBe('incompatible');
156
+ expect(result.diagnostic).toBeDefined();
157
+ });
158
+ });
159
+ //# sourceMappingURL=as-if-external.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"as-if-external.test.js","sourceRoot":"","sources":["../../../src/plugins/__tests__/as-if-external.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAErD,4DAA4D;AAC5D,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAS3D;;;;;GAKG;AACH,MAAM,aAAa,GAA2B;IAC5C;QACE,EAAE,EAAE,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AW,EAAE,CAAC;QAC/B,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO;QACnC,0CAA0C;QAC1C,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,aAAa,EAAE,CAAC;QAE5C,MAAM,MAAM,GAAG,SAAS,CAAC;YACvB,QAAQ;YACR,MAAM,EAAE,WAAW;YACnB,GAAG,EAAE,iBAAiB;YACtB,mBAAmB,EAAE,IAAI,EAAE,gEAAgE;SAC5F,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACjD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Authored-Tool sidecar discovery (Phase 1): a source-agnostic walk over a
3
+ * single authored `tools/` root that returns each `<root>/<name>/` dir carrying
4
+ * an `opensip-tool.manifest.json` sidecar. Pure filesystem reads — no module
5
+ * code is imported (the walk keys on the sidecar FILE's presence).
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=authored-tool-discovery.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authored-tool-discovery.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/__tests__/authored-tool-discovery.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}