@opensip-cli/graph 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 (836) 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 +11 -0
  5. package/dist/__tests__/baseline-plane.test.d.ts.map +1 -0
  6. package/dist/__tests__/baseline-plane.test.js +60 -0
  7. package/dist/__tests__/baseline-plane.test.js.map +1 -0
  8. package/dist/__tests__/cache/engine-version.test.d.ts +12 -0
  9. package/dist/__tests__/cache/engine-version.test.d.ts.map +1 -0
  10. package/dist/__tests__/cache/engine-version.test.js +79 -0
  11. package/dist/__tests__/cache/engine-version.test.js.map +1 -0
  12. package/dist/__tests__/cache/invalidate.test.d.ts +9 -0
  13. package/dist/__tests__/cache/invalidate.test.d.ts.map +1 -0
  14. package/dist/__tests__/cache/invalidate.test.js +228 -0
  15. package/dist/__tests__/cache/invalidate.test.js.map +1 -0
  16. package/dist/__tests__/cli/contribution-from-signals.test.d.ts +17 -0
  17. package/dist/__tests__/cli/contribution-from-signals.test.d.ts.map +1 -0
  18. package/dist/__tests__/cli/contribution-from-signals.test.js +89 -0
  19. package/dist/__tests__/cli/contribution-from-signals.test.js.map +1 -0
  20. package/dist/__tests__/cli/detect.test.d.ts +2 -0
  21. package/dist/__tests__/cli/detect.test.d.ts.map +1 -0
  22. package/dist/__tests__/cli/detect.test.js +96 -0
  23. package/dist/__tests__/cli/detect.test.js.map +1 -0
  24. package/dist/__tests__/cli/graph-config.test.d.ts +9 -0
  25. package/dist/__tests__/cli/graph-config.test.d.ts.map +1 -0
  26. package/dist/__tests__/cli/graph-config.test.js +113 -0
  27. package/dist/__tests__/cli/graph-config.test.js.map +1 -0
  28. package/dist/__tests__/cli/graph-execute.test.d.ts +9 -0
  29. package/dist/__tests__/cli/graph-execute.test.d.ts.map +1 -0
  30. package/dist/__tests__/cli/graph-execute.test.js +434 -0
  31. package/dist/__tests__/cli/graph-execute.test.js.map +1 -0
  32. package/dist/__tests__/cli/graph.test.d.ts +12 -0
  33. package/dist/__tests__/cli/graph.test.d.ts.map +1 -0
  34. package/dist/__tests__/cli/graph.test.js +589 -0
  35. package/dist/__tests__/cli/graph.test.js.map +1 -0
  36. package/dist/__tests__/cli/heap-preflight.test.d.ts +11 -0
  37. package/dist/__tests__/cli/heap-preflight.test.d.ts.map +1 -0
  38. package/dist/__tests__/cli/heap-preflight.test.js +150 -0
  39. package/dist/__tests__/cli/heap-preflight.test.js.map +1 -0
  40. package/dist/__tests__/cli/language-mismatch.test.d.ts +10 -0
  41. package/dist/__tests__/cli/language-mismatch.test.d.ts.map +1 -0
  42. package/dist/__tests__/cli/language-mismatch.test.js +155 -0
  43. package/dist/__tests__/cli/language-mismatch.test.js.map +1 -0
  44. package/dist/__tests__/cli/lookup.test.d.ts +7 -0
  45. package/dist/__tests__/cli/lookup.test.d.ts.map +1 -0
  46. package/dist/__tests__/cli/lookup.test.js +104 -0
  47. package/dist/__tests__/cli/lookup.test.js.map +1 -0
  48. package/dist/__tests__/cli/orchestrate.test.d.ts +12 -0
  49. package/dist/__tests__/cli/orchestrate.test.d.ts.map +1 -0
  50. package/dist/__tests__/cli/orchestrate.test.js +315 -0
  51. package/dist/__tests__/cli/orchestrate.test.js.map +1 -0
  52. package/dist/__tests__/cli/positional-paths.test.d.ts +5 -0
  53. package/dist/__tests__/cli/positional-paths.test.d.ts.map +1 -0
  54. package/dist/__tests__/cli/positional-paths.test.js +87 -0
  55. package/dist/__tests__/cli/positional-paths.test.js.map +1 -0
  56. package/dist/__tests__/cli/pressure-monitor.test.d.ts +11 -0
  57. package/dist/__tests__/cli/pressure-monitor.test.d.ts.map +1 -0
  58. package/dist/__tests__/cli/pressure-monitor.test.js +94 -0
  59. package/dist/__tests__/cli/pressure-monitor.test.js.map +1 -0
  60. package/dist/__tests__/cli/sarif-export.test.d.ts +8 -0
  61. package/dist/__tests__/cli/sarif-export.test.d.ts.map +1 -0
  62. package/dist/__tests__/cli/sarif-export.test.js +94 -0
  63. package/dist/__tests__/cli/sarif-export.test.js.map +1 -0
  64. package/dist/__tests__/cli/session-contract.test.d.ts +17 -0
  65. package/dist/__tests__/cli/session-contract.test.d.ts.map +1 -0
  66. package/dist/__tests__/cli/session-contract.test.js +225 -0
  67. package/dist/__tests__/cli/session-contract.test.js.map +1 -0
  68. package/dist/__tests__/cli/symbol-index.test.d.ts +7 -0
  69. package/dist/__tests__/cli/symbol-index.test.d.ts.map +1 -0
  70. package/dist/__tests__/cli/symbol-index.test.js +117 -0
  71. package/dist/__tests__/cli/symbol-index.test.js.map +1 -0
  72. package/dist/__tests__/cli/tool-show-mode.test.d.ts +10 -0
  73. package/dist/__tests__/cli/tool-show-mode.test.d.ts.map +1 -0
  74. package/dist/__tests__/cli/tool-show-mode.test.js +128 -0
  75. package/dist/__tests__/cli/tool-show-mode.test.js.map +1 -0
  76. package/dist/__tests__/cli/workspace-runner-polyglot.test.d.ts +10 -0
  77. package/dist/__tests__/cli/workspace-runner-polyglot.test.d.ts.map +1 -0
  78. package/dist/__tests__/cli/workspace-runner-polyglot.test.js +120 -0
  79. package/dist/__tests__/cli/workspace-runner-polyglot.test.js.map +1 -0
  80. package/dist/__tests__/graph-catalog-drift.test.d.ts +24 -0
  81. package/dist/__tests__/graph-catalog-drift.test.d.ts.map +1 -0
  82. package/dist/__tests__/graph-catalog-drift.test.js +34 -0
  83. package/dist/__tests__/graph-catalog-drift.test.js.map +1 -0
  84. package/dist/__tests__/internal-surface.test.d.ts +17 -0
  85. package/dist/__tests__/internal-surface.test.d.ts.map +1 -0
  86. package/dist/__tests__/internal-surface.test.js +45 -0
  87. package/dist/__tests__/internal-surface.test.js.map +1 -0
  88. package/dist/__tests__/lang-adapter/body-digest.test.d.ts +13 -0
  89. package/dist/__tests__/lang-adapter/body-digest.test.d.ts.map +1 -0
  90. package/dist/__tests__/lang-adapter/body-digest.test.js +51 -0
  91. package/dist/__tests__/lang-adapter/body-digest.test.js.map +1 -0
  92. package/dist/__tests__/lang-adapter/edge-helpers.test.d.ts +12 -0
  93. package/dist/__tests__/lang-adapter/edge-helpers.test.d.ts.map +1 -0
  94. package/dist/__tests__/lang-adapter/edge-helpers.test.js +147 -0
  95. package/dist/__tests__/lang-adapter/edge-helpers.test.js.map +1 -0
  96. package/dist/__tests__/lang-adapter/registry.test.d.ts +9 -0
  97. package/dist/__tests__/lang-adapter/registry.test.d.ts.map +1 -0
  98. package/dist/__tests__/lang-adapter/registry.test.js +228 -0
  99. package/dist/__tests__/lang-adapter/registry.test.js.map +1 -0
  100. package/dist/__tests__/persistence/catalog-repo.test.d.ts +2 -0
  101. package/dist/__tests__/persistence/catalog-repo.test.d.ts.map +1 -0
  102. package/dist/__tests__/persistence/catalog-repo.test.js +188 -0
  103. package/dist/__tests__/persistence/catalog-repo.test.js.map +1 -0
  104. package/dist/__tests__/persistence/session-payload.test.d.ts +2 -0
  105. package/dist/__tests__/persistence/session-payload.test.d.ts.map +1 -0
  106. package/dist/__tests__/persistence/session-payload.test.js +81 -0
  107. package/dist/__tests__/persistence/session-payload.test.js.map +1 -0
  108. package/dist/__tests__/persistence/session-replay.test.d.ts +10 -0
  109. package/dist/__tests__/persistence/session-replay.test.d.ts.map +1 -0
  110. package/dist/__tests__/persistence/session-replay.test.js +196 -0
  111. package/dist/__tests__/persistence/session-replay.test.js.map +1 -0
  112. package/dist/__tests__/public-api.test.d.ts +19 -0
  113. package/dist/__tests__/public-api.test.d.ts.map +1 -0
  114. package/dist/__tests__/public-api.test.js +96 -0
  115. package/dist/__tests__/public-api.test.js.map +1 -0
  116. package/dist/__tests__/render/catalog-json-types.test.d.ts +10 -0
  117. package/dist/__tests__/render/catalog-json-types.test.d.ts.map +1 -0
  118. package/dist/__tests__/render/catalog-json-types.test.js +121 -0
  119. package/dist/__tests__/render/catalog-json-types.test.js.map +1 -0
  120. package/dist/__tests__/render/catalog-json.test.d.ts +19 -0
  121. package/dist/__tests__/render/catalog-json.test.d.ts.map +1 -0
  122. package/dist/__tests__/render/catalog-json.test.js +435 -0
  123. package/dist/__tests__/render/catalog-json.test.js.map +1 -0
  124. package/dist/__tests__/render/opensip-id-derivation.test.d.ts +21 -0
  125. package/dist/__tests__/render/opensip-id-derivation.test.d.ts.map +1 -0
  126. package/dist/__tests__/render/opensip-id-derivation.test.js +159 -0
  127. package/dist/__tests__/render/opensip-id-derivation.test.js.map +1 -0
  128. package/dist/__tests__/render/rule-id-mapping.test.d.ts +13 -0
  129. package/dist/__tests__/render/rule-id-mapping.test.d.ts.map +1 -0
  130. package/dist/__tests__/render/rule-id-mapping.test.js +50 -0
  131. package/dist/__tests__/render/rule-id-mapping.test.js.map +1 -0
  132. package/dist/__tests__/render/sarif-opensip.test.d.ts +20 -0
  133. package/dist/__tests__/render/sarif-opensip.test.d.ts.map +1 -0
  134. package/dist/__tests__/render/sarif-opensip.test.js +235 -0
  135. package/dist/__tests__/render/sarif-opensip.test.js.map +1 -0
  136. package/dist/__tests__/resolution-mode.test.d.ts +10 -0
  137. package/dist/__tests__/resolution-mode.test.d.ts.map +1 -0
  138. package/dist/__tests__/resolution-mode.test.js +96 -0
  139. package/dist/__tests__/resolution-mode.test.js.map +1 -0
  140. package/dist/__tests__/resolve-callee.test.d.ts +2 -0
  141. package/dist/__tests__/resolve-callee.test.d.ts.map +1 -0
  142. package/dist/__tests__/resolve-callee.test.js +119 -0
  143. package/dist/__tests__/resolve-callee.test.js.map +1 -0
  144. package/dist/__tests__/rules/_entry-points.test.d.ts +8 -0
  145. package/dist/__tests__/rules/_entry-points.test.d.ts.map +1 -0
  146. package/dist/__tests__/rules/_entry-points.test.js +74 -0
  147. package/dist/__tests__/rules/_entry-points.test.js.map +1 -0
  148. package/dist/__tests__/rules/_helpers.d.ts +18 -0
  149. package/dist/__tests__/rules/_helpers.d.ts.map +1 -0
  150. package/dist/__tests__/rules/_helpers.js +72 -0
  151. package/dist/__tests__/rules/_helpers.js.map +1 -0
  152. package/dist/__tests__/rules/always-throws-branch.test.d.ts +9 -0
  153. package/dist/__tests__/rules/always-throws-branch.test.d.ts.map +1 -0
  154. package/dist/__tests__/rules/always-throws-branch.test.js +113 -0
  155. package/dist/__tests__/rules/always-throws-branch.test.js.map +1 -0
  156. package/dist/__tests__/rules/cycle-and-coupling.test.d.ts +13 -0
  157. package/dist/__tests__/rules/cycle-and-coupling.test.d.ts.map +1 -0
  158. package/dist/__tests__/rules/cycle-and-coupling.test.js +224 -0
  159. package/dist/__tests__/rules/cycle-and-coupling.test.js.map +1 -0
  160. package/dist/__tests__/rules/duplicated-function-body-config.test.d.ts +8 -0
  161. package/dist/__tests__/rules/duplicated-function-body-config.test.d.ts.map +1 -0
  162. package/dist/__tests__/rules/duplicated-function-body-config.test.js +132 -0
  163. package/dist/__tests__/rules/duplicated-function-body-config.test.js.map +1 -0
  164. package/dist/__tests__/rules/duplicated-function-body-cross-package.test.d.ts +10 -0
  165. package/dist/__tests__/rules/duplicated-function-body-cross-package.test.d.ts.map +1 -0
  166. package/dist/__tests__/rules/duplicated-function-body-cross-package.test.js +274 -0
  167. package/dist/__tests__/rules/duplicated-function-body-cross-package.test.js.map +1 -0
  168. package/dist/__tests__/rules/feature-column-parity.test.d.ts +11 -0
  169. package/dist/__tests__/rules/feature-column-parity.test.d.ts.map +1 -0
  170. package/dist/__tests__/rules/feature-column-parity.test.js +169 -0
  171. package/dist/__tests__/rules/feature-column-parity.test.js.map +1 -0
  172. package/dist/__tests__/rules/high-blast-untested.test.d.ts +13 -0
  173. package/dist/__tests__/rules/high-blast-untested.test.d.ts.map +1 -0
  174. package/dist/__tests__/rules/high-blast-untested.test.js +108 -0
  175. package/dist/__tests__/rules/high-blast-untested.test.js.map +1 -0
  176. package/dist/__tests__/rules/large-function.test.d.ts +11 -0
  177. package/dist/__tests__/rules/large-function.test.d.ts.map +1 -0
  178. package/dist/__tests__/rules/large-function.test.js +105 -0
  179. package/dist/__tests__/rules/large-function.test.js.map +1 -0
  180. package/dist/__tests__/rules/no-side-effect-path.test.d.ts +10 -0
  181. package/dist/__tests__/rules/no-side-effect-path.test.d.ts.map +1 -0
  182. package/dist/__tests__/rules/no-side-effect-path.test.js +301 -0
  183. package/dist/__tests__/rules/no-side-effect-path.test.js.map +1 -0
  184. package/dist/__tests__/rules/orphan-subtree-config.test.d.ts +8 -0
  185. package/dist/__tests__/rules/orphan-subtree-config.test.d.ts.map +1 -0
  186. package/dist/__tests__/rules/orphan-subtree-config.test.js +176 -0
  187. package/dist/__tests__/rules/orphan-subtree-config.test.js.map +1 -0
  188. package/dist/__tests__/rules/registry.test.d.ts +11 -0
  189. package/dist/__tests__/rules/registry.test.d.ts.map +1 -0
  190. package/dist/__tests__/rules/registry.test.js +50 -0
  191. package/dist/__tests__/rules/registry.test.js.map +1 -0
  192. package/dist/__tests__/rules/severity-override.test.d.ts +11 -0
  193. package/dist/__tests__/rules/severity-override.test.d.ts.map +1 -0
  194. package/dist/__tests__/rules/severity-override.test.js +67 -0
  195. package/dist/__tests__/rules/severity-override.test.js.map +1 -0
  196. package/dist/__tests__/rules/test-only-reachable.test.d.ts +9 -0
  197. package/dist/__tests__/rules/test-only-reachable.test.d.ts.map +1 -0
  198. package/dist/__tests__/rules/test-only-reachable.test.js +142 -0
  199. package/dist/__tests__/rules/test-only-reachable.test.js.map +1 -0
  200. package/dist/__tests__/rules/wide-function.test.d.ts +9 -0
  201. package/dist/__tests__/rules/wide-function.test.d.ts.map +1 -0
  202. package/dist/__tests__/rules/wide-function.test.js +64 -0
  203. package/dist/__tests__/rules/wide-function.test.js.map +1 -0
  204. package/dist/__tests__/test-utils/with-graph-scope.d.ts +14 -0
  205. package/dist/__tests__/test-utils/with-graph-scope.d.ts.map +1 -0
  206. package/dist/__tests__/test-utils/with-graph-scope.js +26 -0
  207. package/dist/__tests__/test-utils/with-graph-scope.js.map +1 -0
  208. package/dist/__tests__/tool-branches.test.d.ts +18 -0
  209. package/dist/__tests__/tool-branches.test.d.ts.map +1 -0
  210. package/dist/__tests__/tool-branches.test.js +262 -0
  211. package/dist/__tests__/tool-branches.test.js.map +1 -0
  212. package/dist/__tests__/tool-register.test.d.ts +16 -0
  213. package/dist/__tests__/tool-register.test.d.ts.map +1 -0
  214. package/dist/__tests__/tool-register.test.js +419 -0
  215. package/dist/__tests__/tool-register.test.js.map +1 -0
  216. package/dist/__tests__/tool.test.d.ts +18 -0
  217. package/dist/__tests__/tool.test.d.ts.map +1 -0
  218. package/dist/__tests__/tool.test.js +65 -0
  219. package/dist/__tests__/tool.test.js.map +1 -0
  220. package/dist/baseline-strategy.d.ts +28 -0
  221. package/dist/baseline-strategy.d.ts.map +1 -0
  222. package/dist/baseline-strategy.js +27 -0
  223. package/dist/baseline-strategy.js.map +1 -0
  224. package/dist/cache/engine-version.d.ts +69 -0
  225. package/dist/cache/engine-version.d.ts.map +1 -0
  226. package/dist/cache/engine-version.js +60 -0
  227. package/dist/cache/engine-version.js.map +1 -0
  228. package/dist/cache/invalidate.d.ts +60 -0
  229. package/dist/cache/invalidate.d.ts.map +1 -0
  230. package/dist/cache/invalidate.js +120 -0
  231. package/dist/cache/invalidate.js.map +1 -0
  232. package/dist/cli/__tests__/build-envelope.test.d.ts +8 -0
  233. package/dist/cli/__tests__/build-envelope.test.d.ts.map +1 -0
  234. package/dist/cli/__tests__/build-envelope.test.js +70 -0
  235. package/dist/cli/__tests__/build-envelope.test.js.map +1 -0
  236. package/dist/cli/__tests__/dispatch-envelope.test.d.ts +15 -0
  237. package/dist/cli/__tests__/dispatch-envelope.test.d.ts.map +1 -0
  238. package/dist/cli/__tests__/dispatch-envelope.test.js +73 -0
  239. package/dist/cli/__tests__/dispatch-envelope.test.js.map +1 -0
  240. package/dist/cli/__tests__/dispatch-suppression-root.test.d.ts +18 -0
  241. package/dist/cli/__tests__/dispatch-suppression-root.test.d.ts.map +1 -0
  242. package/dist/cli/__tests__/dispatch-suppression-root.test.js +91 -0
  243. package/dist/cli/__tests__/dispatch-suppression-root.test.js.map +1 -0
  244. package/dist/cli/__tests__/graph-config-schema.test.d.ts +7 -0
  245. package/dist/cli/__tests__/graph-config-schema.test.d.ts.map +1 -0
  246. package/dist/cli/__tests__/graph-config-schema.test.js +60 -0
  247. package/dist/cli/__tests__/graph-config-schema.test.js.map +1 -0
  248. package/dist/cli/__tests__/graph-gate-mode.test.d.ts +15 -0
  249. package/dist/cli/__tests__/graph-gate-mode.test.d.ts.map +1 -0
  250. package/dist/cli/__tests__/graph-gate-mode.test.js +99 -0
  251. package/dist/cli/__tests__/graph-gate-mode.test.js.map +1 -0
  252. package/dist/cli/__tests__/graph-recipes.test.d.ts +7 -0
  253. package/dist/cli/__tests__/graph-recipes.test.d.ts.map +1 -0
  254. package/dist/cli/__tests__/graph-recipes.test.js +24 -0
  255. package/dist/cli/__tests__/graph-recipes.test.js.map +1 -0
  256. package/dist/cli/__tests__/graph-report.test.d.ts +7 -0
  257. package/dist/cli/__tests__/graph-report.test.d.ts.map +1 -0
  258. package/dist/cli/__tests__/graph-report.test.js +138 -0
  259. package/dist/cli/__tests__/graph-report.test.js.map +1 -0
  260. package/dist/cli/__tests__/graph-tracer.test.d.ts +11 -0
  261. package/dist/cli/__tests__/graph-tracer.test.d.ts.map +1 -0
  262. package/dist/cli/__tests__/graph-tracer.test.js +41 -0
  263. package/dist/cli/__tests__/graph-tracer.test.js.map +1 -0
  264. package/dist/cli/__tests__/graph-worker.test.d.ts +13 -0
  265. package/dist/cli/__tests__/graph-worker.test.d.ts.map +1 -0
  266. package/dist/cli/__tests__/graph-worker.test.js +127 -0
  267. package/dist/cli/__tests__/graph-worker.test.js.map +1 -0
  268. package/dist/cli/__tests__/list-files.test.d.ts +12 -0
  269. package/dist/cli/__tests__/list-files.test.d.ts.map +1 -0
  270. package/dist/cli/__tests__/list-files.test.js +146 -0
  271. package/dist/cli/__tests__/list-files.test.js.map +1 -0
  272. package/dist/cli/__tests__/live-suppression-parity.test.d.ts +23 -0
  273. package/dist/cli/__tests__/live-suppression-parity.test.d.ts.map +1 -0
  274. package/dist/cli/__tests__/live-suppression-parity.test.js +136 -0
  275. package/dist/cli/__tests__/live-suppression-parity.test.js.map +1 -0
  276. package/dist/cli/__tests__/orchestrate-spans.test.d.ts +18 -0
  277. package/dist/cli/__tests__/orchestrate-spans.test.d.ts.map +1 -0
  278. package/dist/cli/__tests__/orchestrate-spans.test.js +108 -0
  279. package/dist/cli/__tests__/orchestrate-spans.test.js.map +1 -0
  280. package/dist/cli/__tests__/shard-worker.test.d.ts +10 -0
  281. package/dist/cli/__tests__/shard-worker.test.d.ts.map +1 -0
  282. package/dist/cli/__tests__/shard-worker.test.js +153 -0
  283. package/dist/cli/__tests__/shard-worker.test.js.map +1 -0
  284. package/dist/cli/__tests__/workspace-report.test.d.ts +6 -0
  285. package/dist/cli/__tests__/workspace-report.test.d.ts.map +1 -0
  286. package/dist/cli/__tests__/workspace-report.test.js +89 -0
  287. package/dist/cli/__tests__/workspace-report.test.js.map +1 -0
  288. package/dist/cli/apply-suppressions.d.ts +86 -0
  289. package/dist/cli/apply-suppressions.d.ts.map +1 -0
  290. package/dist/cli/apply-suppressions.js +101 -0
  291. package/dist/cli/apply-suppressions.js.map +1 -0
  292. package/dist/cli/apply-suppressions.test.d.ts +12 -0
  293. package/dist/cli/apply-suppressions.test.d.ts.map +1 -0
  294. package/dist/cli/apply-suppressions.test.js +85 -0
  295. package/dist/cli/apply-suppressions.test.js.map +1 -0
  296. package/dist/cli/build-envelope.d.ts +53 -0
  297. package/dist/cli/build-envelope.d.ts.map +1 -0
  298. package/dist/cli/build-envelope.js +88 -0
  299. package/dist/cli/build-envelope.js.map +1 -0
  300. package/dist/cli/detect.d.ts +37 -0
  301. package/dist/cli/detect.d.ts.map +1 -0
  302. package/dist/cli/detect.js +60 -0
  303. package/dist/cli/detect.js.map +1 -0
  304. package/dist/cli/equivalence-check-command.d.ts +45 -0
  305. package/dist/cli/equivalence-check-command.d.ts.map +1 -0
  306. package/dist/cli/equivalence-check-command.js +196 -0
  307. package/dist/cli/equivalence-check-command.js.map +1 -0
  308. package/dist/cli/graph/graph-aux-command-specs.d.ts +60 -0
  309. package/dist/cli/graph/graph-aux-command-specs.d.ts.map +1 -0
  310. package/dist/cli/graph/graph-aux-command-specs.js +390 -0
  311. package/dist/cli/graph/graph-aux-command-specs.js.map +1 -0
  312. package/dist/cli/graph/graph-command-spec.d.ts +43 -0
  313. package/dist/cli/graph/graph-command-spec.d.ts.map +1 -0
  314. package/dist/cli/graph/graph-command-spec.js +456 -0
  315. package/dist/cli/graph/graph-command-spec.js.map +1 -0
  316. package/dist/cli/graph-config-schema.d.ts +70 -0
  317. package/dist/cli/graph-config-schema.d.ts.map +1 -0
  318. package/dist/cli/graph-config-schema.js +68 -0
  319. package/dist/cli/graph-config-schema.js.map +1 -0
  320. package/dist/cli/graph-config.d.ts +53 -0
  321. package/dist/cli/graph-config.d.ts.map +1 -0
  322. package/dist/cli/graph-config.js +111 -0
  323. package/dist/cli/graph-config.js.map +1 -0
  324. package/dist/cli/graph-modes.d.ts +36 -0
  325. package/dist/cli/graph-modes.d.ts.map +1 -0
  326. package/dist/cli/graph-modes.js +161 -0
  327. package/dist/cli/graph-modes.js.map +1 -0
  328. package/dist/cli/graph-options.d.ts +143 -0
  329. package/dist/cli/graph-options.d.ts.map +1 -0
  330. package/dist/cli/graph-options.js +15 -0
  331. package/dist/cli/graph-options.js.map +1 -0
  332. package/dist/cli/graph-progress.d.ts +31 -0
  333. package/dist/cli/graph-progress.d.ts.map +1 -0
  334. package/dist/cli/graph-progress.js +56 -0
  335. package/dist/cli/graph-progress.js.map +1 -0
  336. package/dist/cli/graph-recipes.d.ts +23 -0
  337. package/dist/cli/graph-recipes.d.ts.map +1 -0
  338. package/dist/cli/graph-recipes.js +44 -0
  339. package/dist/cli/graph-recipes.js.map +1 -0
  340. package/dist/cli/graph-report.d.ts +79 -0
  341. package/dist/cli/graph-report.d.ts.map +1 -0
  342. package/dist/cli/graph-report.js +186 -0
  343. package/dist/cli/graph-report.js.map +1 -0
  344. package/dist/cli/graph-runner.d.ts +106 -0
  345. package/dist/cli/graph-runner.d.ts.map +1 -0
  346. package/dist/cli/graph-runner.js +274 -0
  347. package/dist/cli/graph-runner.js.map +1 -0
  348. package/dist/cli/graph-tracer.d.ts +27 -0
  349. package/dist/cli/graph-tracer.d.ts.map +1 -0
  350. package/dist/cli/graph-tracer.js +33 -0
  351. package/dist/cli/graph-tracer.js.map +1 -0
  352. package/dist/cli/graph-worker.d.ts +29 -0
  353. package/dist/cli/graph-worker.d.ts.map +1 -0
  354. package/dist/cli/graph-worker.js +86 -0
  355. package/dist/cli/graph-worker.js.map +1 -0
  356. package/dist/cli/graph.d.ts +171 -0
  357. package/dist/cli/graph.d.ts.map +1 -0
  358. package/dist/cli/graph.js +1041 -0
  359. package/dist/cli/graph.js.map +1 -0
  360. package/dist/cli/heap-preflight.d.ts +62 -0
  361. package/dist/cli/heap-preflight.d.ts.map +1 -0
  362. package/dist/cli/heap-preflight.js +176 -0
  363. package/dist/cli/heap-preflight.js.map +1 -0
  364. package/dist/cli/list-files.d.ts +37 -0
  365. package/dist/cli/list-files.d.ts.map +1 -0
  366. package/dist/cli/list-files.js +166 -0
  367. package/dist/cli/list-files.js.map +1 -0
  368. package/dist/cli/lookup.d.ts +19 -0
  369. package/dist/cli/lookup.d.ts.map +1 -0
  370. package/dist/cli/lookup.js +87 -0
  371. package/dist/cli/lookup.js.map +1 -0
  372. package/dist/cli/orchestrate/__tests__/_equivalence-harness.d.ts +47 -0
  373. package/dist/cli/orchestrate/__tests__/_equivalence-harness.d.ts.map +1 -0
  374. package/dist/cli/orchestrate/__tests__/_equivalence-harness.js +331 -0
  375. package/dist/cli/orchestrate/__tests__/_equivalence-harness.js.map +1 -0
  376. package/dist/cli/orchestrate/__tests__/_flat-large-fixture.d.ts +69 -0
  377. package/dist/cli/orchestrate/__tests__/_flat-large-fixture.d.ts.map +1 -0
  378. package/dist/cli/orchestrate/__tests__/_flat-large-fixture.js +181 -0
  379. package/dist/cli/orchestrate/__tests__/_flat-large-fixture.js.map +1 -0
  380. package/dist/cli/orchestrate/__tests__/canonical-file-set.test.d.ts +8 -0
  381. package/dist/cli/orchestrate/__tests__/canonical-file-set.test.d.ts.map +1 -0
  382. package/dist/cli/orchestrate/__tests__/canonical-file-set.test.js +51 -0
  383. package/dist/cli/orchestrate/__tests__/canonical-file-set.test.js.map +1 -0
  384. package/dist/cli/orchestrate/__tests__/catalog-builder-incremental.test.d.ts +9 -0
  385. package/dist/cli/orchestrate/__tests__/catalog-builder-incremental.test.d.ts.map +1 -0
  386. package/dist/cli/orchestrate/__tests__/catalog-builder-incremental.test.js +147 -0
  387. package/dist/cli/orchestrate/__tests__/catalog-builder-incremental.test.js.map +1 -0
  388. package/dist/cli/orchestrate/__tests__/cross-shard-resolve.test.d.ts +12 -0
  389. package/dist/cli/orchestrate/__tests__/cross-shard-resolve.test.d.ts.map +1 -0
  390. package/dist/cli/orchestrate/__tests__/cross-shard-resolve.test.js +509 -0
  391. package/dist/cli/orchestrate/__tests__/cross-shard-resolve.test.js.map +1 -0
  392. package/dist/cli/orchestrate/__tests__/determinism.test.d.ts +19 -0
  393. package/dist/cli/orchestrate/__tests__/determinism.test.d.ts.map +1 -0
  394. package/dist/cli/orchestrate/__tests__/determinism.test.js +163 -0
  395. package/dist/cli/orchestrate/__tests__/determinism.test.js.map +1 -0
  396. package/dist/cli/orchestrate/__tests__/edge-identity.test.d.ts +9 -0
  397. package/dist/cli/orchestrate/__tests__/edge-identity.test.d.ts.map +1 -0
  398. package/dist/cli/orchestrate/__tests__/edge-identity.test.js +103 -0
  399. package/dist/cli/orchestrate/__tests__/edge-identity.test.js.map +1 -0
  400. package/dist/cli/orchestrate/__tests__/equivalence-check.test.d.ts +10 -0
  401. package/dist/cli/orchestrate/__tests__/equivalence-check.test.d.ts.map +1 -0
  402. package/dist/cli/orchestrate/__tests__/equivalence-check.test.js +277 -0
  403. package/dist/cli/orchestrate/__tests__/equivalence-check.test.js.map +1 -0
  404. package/dist/cli/orchestrate/__tests__/equivalence-repo-scale.test.d.ts +51 -0
  405. package/dist/cli/orchestrate/__tests__/equivalence-repo-scale.test.d.ts.map +1 -0
  406. package/dist/cli/orchestrate/__tests__/equivalence-repo-scale.test.js +183 -0
  407. package/dist/cli/orchestrate/__tests__/equivalence-repo-scale.test.js.map +1 -0
  408. package/dist/cli/orchestrate/__tests__/equivalence.test.d.ts +47 -0
  409. package/dist/cli/orchestrate/__tests__/equivalence.test.d.ts.map +1 -0
  410. package/dist/cli/orchestrate/__tests__/equivalence.test.js +259 -0
  411. package/dist/cli/orchestrate/__tests__/equivalence.test.js.map +1 -0
  412. package/dist/cli/orchestrate/__tests__/exact-boundary-recovery.test.d.ts +9 -0
  413. package/dist/cli/orchestrate/__tests__/exact-boundary-recovery.test.d.ts.map +1 -0
  414. package/dist/cli/orchestrate/__tests__/exact-boundary-recovery.test.js +105 -0
  415. package/dist/cli/orchestrate/__tests__/exact-boundary-recovery.test.js.map +1 -0
  416. package/dist/cli/orchestrate/__tests__/export-index.test.d.ts +12 -0
  417. package/dist/cli/orchestrate/__tests__/export-index.test.d.ts.map +1 -0
  418. package/dist/cli/orchestrate/__tests__/export-index.test.js +346 -0
  419. package/dist/cli/orchestrate/__tests__/export-index.test.js.map +1 -0
  420. package/dist/cli/orchestrate/__tests__/flat-large-fixture.test.d.ts +16 -0
  421. package/dist/cli/orchestrate/__tests__/flat-large-fixture.test.d.ts.map +1 -0
  422. package/dist/cli/orchestrate/__tests__/flat-large-fixture.test.js +99 -0
  423. package/dist/cli/orchestrate/__tests__/flat-large-fixture.test.js.map +1 -0
  424. package/dist/cli/orchestrate/__tests__/flat-monorepo-strategy.test.d.ts +11 -0
  425. package/dist/cli/orchestrate/__tests__/flat-monorepo-strategy.test.d.ts.map +1 -0
  426. package/dist/cli/orchestrate/__tests__/flat-monorepo-strategy.test.js +271 -0
  427. package/dist/cli/orchestrate/__tests__/flat-monorepo-strategy.test.js.map +1 -0
  428. package/dist/cli/orchestrate/__tests__/function-set-parity.test.d.ts +38 -0
  429. package/dist/cli/orchestrate/__tests__/function-set-parity.test.d.ts.map +1 -0
  430. package/dist/cli/orchestrate/__tests__/function-set-parity.test.js +163 -0
  431. package/dist/cli/orchestrate/__tests__/function-set-parity.test.js.map +1 -0
  432. package/dist/cli/orchestrate/__tests__/incremental-merge.test.d.ts +8 -0
  433. package/dist/cli/orchestrate/__tests__/incremental-merge.test.d.ts.map +1 -0
  434. package/dist/cli/orchestrate/__tests__/incremental-merge.test.js +153 -0
  435. package/dist/cli/orchestrate/__tests__/incremental-merge.test.js.map +1 -0
  436. package/dist/cli/orchestrate/__tests__/partition-files.test.d.ts +10 -0
  437. package/dist/cli/orchestrate/__tests__/partition-files.test.d.ts.map +1 -0
  438. package/dist/cli/orchestrate/__tests__/partition-files.test.js +104 -0
  439. package/dist/cli/orchestrate/__tests__/partition-files.test.js.map +1 -0
  440. package/dist/cli/orchestrate/__tests__/resolution-completeness-floor.test.d.ts +21 -0
  441. package/dist/cli/orchestrate/__tests__/resolution-completeness-floor.test.d.ts.map +1 -0
  442. package/dist/cli/orchestrate/__tests__/resolution-completeness-floor.test.js +59 -0
  443. package/dist/cli/orchestrate/__tests__/resolution-completeness-floor.test.js.map +1 -0
  444. package/dist/cli/orchestrate/__tests__/shard-model.test.d.ts +8 -0
  445. package/dist/cli/orchestrate/__tests__/shard-model.test.d.ts.map +1 -0
  446. package/dist/cli/orchestrate/__tests__/shard-model.test.js +77 -0
  447. package/dist/cli/orchestrate/__tests__/shard-model.test.js.map +1 -0
  448. package/dist/cli/orchestrate/__tests__/shard-runner-spawn.test.d.ts +13 -0
  449. package/dist/cli/orchestrate/__tests__/shard-runner-spawn.test.d.ts.map +1 -0
  450. package/dist/cli/orchestrate/__tests__/shard-runner-spawn.test.js +103 -0
  451. package/dist/cli/orchestrate/__tests__/shard-runner-spawn.test.js.map +1 -0
  452. package/dist/cli/orchestrate/__tests__/sharded-graph.test.d.ts +13 -0
  453. package/dist/cli/orchestrate/__tests__/sharded-graph.test.d.ts.map +1 -0
  454. package/dist/cli/orchestrate/__tests__/sharded-graph.test.js +257 -0
  455. package/dist/cli/orchestrate/__tests__/sharded-graph.test.js.map +1 -0
  456. package/dist/cli/orchestrate/__tests__/worker-pool.test.d.ts +6 -0
  457. package/dist/cli/orchestrate/__tests__/worker-pool.test.d.ts.map +1 -0
  458. package/dist/cli/orchestrate/__tests__/worker-pool.test.js +38 -0
  459. package/dist/cli/orchestrate/__tests__/worker-pool.test.js.map +1 -0
  460. package/dist/cli/orchestrate/cache-orchestrator.d.ts +42 -0
  461. package/dist/cli/orchestrate/cache-orchestrator.d.ts.map +1 -0
  462. package/dist/cli/orchestrate/cache-orchestrator.js +92 -0
  463. package/dist/cli/orchestrate/cache-orchestrator.js.map +1 -0
  464. package/dist/cli/orchestrate/canonical-file-set.d.ts +51 -0
  465. package/dist/cli/orchestrate/canonical-file-set.d.ts.map +1 -0
  466. package/dist/cli/orchestrate/canonical-file-set.js +58 -0
  467. package/dist/cli/orchestrate/canonical-file-set.js.map +1 -0
  468. package/dist/cli/orchestrate/catalog-builder.d.ts +121 -0
  469. package/dist/cli/orchestrate/catalog-builder.d.ts.map +1 -0
  470. package/dist/cli/orchestrate/catalog-builder.js +279 -0
  471. package/dist/cli/orchestrate/catalog-builder.js.map +1 -0
  472. package/dist/cli/orchestrate/catalog-stats.d.ts +31 -0
  473. package/dist/cli/orchestrate/catalog-stats.d.ts.map +1 -0
  474. package/dist/cli/orchestrate/catalog-stats.js +52 -0
  475. package/dist/cli/orchestrate/catalog-stats.js.map +1 -0
  476. package/dist/cli/orchestrate/cross-shard-resolve.d.ts +190 -0
  477. package/dist/cli/orchestrate/cross-shard-resolve.d.ts.map +1 -0
  478. package/dist/cli/orchestrate/cross-shard-resolve.js +523 -0
  479. package/dist/cli/orchestrate/cross-shard-resolve.js.map +1 -0
  480. package/dist/cli/orchestrate/edge-identity.d.ts +48 -0
  481. package/dist/cli/orchestrate/edge-identity.d.ts.map +1 -0
  482. package/dist/cli/orchestrate/edge-identity.js +68 -0
  483. package/dist/cli/orchestrate/edge-identity.js.map +1 -0
  484. package/dist/cli/orchestrate/equivalence-check.d.ts +227 -0
  485. package/dist/cli/orchestrate/equivalence-check.d.ts.map +1 -0
  486. package/dist/cli/orchestrate/equivalence-check.js +264 -0
  487. package/dist/cli/orchestrate/equivalence-check.js.map +1 -0
  488. package/dist/cli/orchestrate/exact-boundary-recovery.d.ts +33 -0
  489. package/dist/cli/orchestrate/exact-boundary-recovery.d.ts.map +1 -0
  490. package/dist/cli/orchestrate/exact-boundary-recovery.js +62 -0
  491. package/dist/cli/orchestrate/exact-boundary-recovery.js.map +1 -0
  492. package/dist/cli/orchestrate/flat-monorepo-strategy.d.ts +171 -0
  493. package/dist/cli/orchestrate/flat-monorepo-strategy.d.ts.map +1 -0
  494. package/dist/cli/orchestrate/flat-monorepo-strategy.js +328 -0
  495. package/dist/cli/orchestrate/flat-monorepo-strategy.js.map +1 -0
  496. package/dist/cli/orchestrate/incremental-merge.d.ts +46 -0
  497. package/dist/cli/orchestrate/incremental-merge.d.ts.map +1 -0
  498. package/dist/cli/orchestrate/incremental-merge.js +236 -0
  499. package/dist/cli/orchestrate/incremental-merge.js.map +1 -0
  500. package/dist/cli/orchestrate/partition-chunk.d.ts +36 -0
  501. package/dist/cli/orchestrate/partition-chunk.d.ts.map +1 -0
  502. package/dist/cli/orchestrate/partition-chunk.js +37 -0
  503. package/dist/cli/orchestrate/partition-chunk.js.map +1 -0
  504. package/dist/cli/orchestrate/partition-files.d.ts +52 -0
  505. package/dist/cli/orchestrate/partition-files.d.ts.map +1 -0
  506. package/dist/cli/orchestrate/partition-files.js +94 -0
  507. package/dist/cli/orchestrate/partition-files.js.map +1 -0
  508. package/dist/cli/orchestrate/resolution-trace.d.ts +11 -0
  509. package/dist/cli/orchestrate/resolution-trace.d.ts.map +1 -0
  510. package/dist/cli/orchestrate/resolution-trace.js +27 -0
  511. package/dist/cli/orchestrate/resolution-trace.js.map +1 -0
  512. package/dist/cli/orchestrate/shard-model.d.ts +99 -0
  513. package/dist/cli/orchestrate/shard-model.d.ts.map +1 -0
  514. package/dist/cli/orchestrate/shard-model.js +23 -0
  515. package/dist/cli/orchestrate/shard-model.js.map +1 -0
  516. package/dist/cli/orchestrate/shard-runner.d.ts +65 -0
  517. package/dist/cli/orchestrate/shard-runner.d.ts.map +1 -0
  518. package/dist/cli/orchestrate/shard-runner.js +169 -0
  519. package/dist/cli/orchestrate/shard-runner.js.map +1 -0
  520. package/dist/cli/orchestrate/sharded-graph.d.ts +86 -0
  521. package/dist/cli/orchestrate/sharded-graph.d.ts.map +1 -0
  522. package/dist/cli/orchestrate/sharded-graph.js +227 -0
  523. package/dist/cli/orchestrate/sharded-graph.js.map +1 -0
  524. package/dist/cli/orchestrate/types.d.ts +31 -0
  525. package/dist/cli/orchestrate/types.d.ts.map +1 -0
  526. package/dist/cli/orchestrate/types.js +24 -0
  527. package/dist/cli/orchestrate/types.js.map +1 -0
  528. package/dist/cli/orchestrate/worker-pool.d.ts +16 -0
  529. package/dist/cli/orchestrate/worker-pool.d.ts.map +1 -0
  530. package/dist/cli/orchestrate/worker-pool.js +39 -0
  531. package/dist/cli/orchestrate/worker-pool.js.map +1 -0
  532. package/dist/cli/orchestrate.d.ts +106 -0
  533. package/dist/cli/orchestrate.d.ts.map +1 -0
  534. package/dist/cli/orchestrate.js +228 -0
  535. package/dist/cli/orchestrate.js.map +1 -0
  536. package/dist/cli/positional-paths.d.ts +23 -0
  537. package/dist/cli/positional-paths.d.ts.map +1 -0
  538. package/dist/cli/positional-paths.js +64 -0
  539. package/dist/cli/positional-paths.js.map +1 -0
  540. package/dist/cli/pressure-monitor.d.ts +62 -0
  541. package/dist/cli/pressure-monitor.d.ts.map +1 -0
  542. package/dist/cli/pressure-monitor.js +110 -0
  543. package/dist/cli/pressure-monitor.js.map +1 -0
  544. package/dist/cli/profile.d.ts +82 -0
  545. package/dist/cli/profile.d.ts.map +1 -0
  546. package/dist/cli/profile.js +120 -0
  547. package/dist/cli/profile.js.map +1 -0
  548. package/dist/cli/report-data.d.ts +46 -0
  549. package/dist/cli/report-data.d.ts.map +1 -0
  550. package/dist/cli/report-data.js +48 -0
  551. package/dist/cli/report-data.js.map +1 -0
  552. package/dist/cli/resolve-adapters.d.ts +19 -0
  553. package/dist/cli/resolve-adapters.d.ts.map +1 -0
  554. package/dist/cli/resolve-adapters.js +38 -0
  555. package/dist/cli/resolve-adapters.js.map +1 -0
  556. package/dist/cli/sarif-export.d.ts +40 -0
  557. package/dist/cli/sarif-export.d.ts.map +1 -0
  558. package/dist/cli/sarif-export.js +69 -0
  559. package/dist/cli/sarif-export.js.map +1 -0
  560. package/dist/cli/shard-worker.d.ts +25 -0
  561. package/dist/cli/shard-worker.d.ts.map +1 -0
  562. package/dist/cli/shard-worker.js +98 -0
  563. package/dist/cli/shard-worker.js.map +1 -0
  564. package/dist/cli/symbol-index.d.ts +51 -0
  565. package/dist/cli/symbol-index.d.ts.map +1 -0
  566. package/dist/cli/symbol-index.js +120 -0
  567. package/dist/cli/symbol-index.js.map +1 -0
  568. package/dist/cli/workspace-report.d.ts +32 -0
  569. package/dist/cli/workspace-report.d.ts.map +1 -0
  570. package/dist/cli/workspace-report.js +107 -0
  571. package/dist/cli/workspace-report.js.map +1 -0
  572. package/dist/cli/workspace-runner.d.ts +104 -0
  573. package/dist/cli/workspace-runner.d.ts.map +1 -0
  574. package/dist/cli/workspace-runner.js +166 -0
  575. package/dist/cli/workspace-runner.js.map +1 -0
  576. package/dist/cross-package/export-index.d.ts +118 -0
  577. package/dist/cross-package/export-index.d.ts.map +1 -0
  578. package/dist/cross-package/export-index.js +296 -0
  579. package/dist/cross-package/export-index.js.map +1 -0
  580. package/dist/cross-package/posix-path.d.ts +16 -0
  581. package/dist/cross-package/posix-path.d.ts.map +1 -0
  582. package/dist/cross-package/posix-path.js +18 -0
  583. package/dist/cross-package/posix-path.js.map +1 -0
  584. package/dist/cross-package/resolve.d.ts +68 -0
  585. package/dist/cross-package/resolve.d.ts.map +1 -0
  586. package/dist/cross-package/resolve.js +83 -0
  587. package/dist/cross-package/resolve.js.map +1 -0
  588. package/dist/index.d.ts +33 -0
  589. package/dist/index.d.ts.map +1 -0
  590. package/dist/index.js +61 -0
  591. package/dist/index.js.map +1 -0
  592. package/dist/internal.d.ts +25 -0
  593. package/dist/internal.d.ts.map +1 -0
  594. package/dist/internal.js +38 -0
  595. package/dist/internal.js.map +1 -0
  596. package/dist/lang-adapter/body-digest.d.ts +46 -0
  597. package/dist/lang-adapter/body-digest.d.ts.map +1 -0
  598. package/dist/lang-adapter/body-digest.js +49 -0
  599. package/dist/lang-adapter/body-digest.js.map +1 -0
  600. package/dist/lang-adapter/edge-helpers.d.ts +104 -0
  601. package/dist/lang-adapter/edge-helpers.d.ts.map +1 -0
  602. package/dist/lang-adapter/edge-helpers.js +120 -0
  603. package/dist/lang-adapter/edge-helpers.js.map +1 -0
  604. package/dist/lang-adapter/registry.d.ts +59 -0
  605. package/dist/lang-adapter/registry.d.ts.map +1 -0
  606. package/dist/lang-adapter/registry.js +100 -0
  607. package/dist/lang-adapter/registry.js.map +1 -0
  608. package/dist/lang-adapter/selector.d.ts +39 -0
  609. package/dist/lang-adapter/selector.d.ts.map +1 -0
  610. package/dist/lang-adapter/selector.js +140 -0
  611. package/dist/lang-adapter/selector.js.map +1 -0
  612. package/dist/lang-adapter/types.d.ts +217 -0
  613. package/dist/lang-adapter/types.d.ts.map +1 -0
  614. package/dist/lang-adapter/types.js +18 -0
  615. package/dist/lang-adapter/types.js.map +1 -0
  616. package/dist/owner-key.d.ts +22 -0
  617. package/dist/owner-key.d.ts.map +1 -0
  618. package/dist/owner-key.js +25 -0
  619. package/dist/owner-key.js.map +1 -0
  620. package/dist/persistence/__tests__/shard-fragment-cache.test.d.ts +8 -0
  621. package/dist/persistence/__tests__/shard-fragment-cache.test.d.ts.map +1 -0
  622. package/dist/persistence/__tests__/shard-fragment-cache.test.js +126 -0
  623. package/dist/persistence/__tests__/shard-fragment-cache.test.js.map +1 -0
  624. package/dist/persistence/catalog-repo.d.ts +77 -0
  625. package/dist/persistence/catalog-repo.d.ts.map +1 -0
  626. package/dist/persistence/catalog-repo.js +229 -0
  627. package/dist/persistence/catalog-repo.js.map +1 -0
  628. package/dist/persistence/schema.d.ts +249 -0
  629. package/dist/persistence/schema.d.ts.map +1 -0
  630. package/dist/persistence/schema.js +53 -0
  631. package/dist/persistence/schema.js.map +1 -0
  632. package/dist/persistence/session-payload.d.ts +96 -0
  633. package/dist/persistence/session-payload.d.ts.map +1 -0
  634. package/dist/persistence/session-payload.js +116 -0
  635. package/dist/persistence/session-payload.js.map +1 -0
  636. package/dist/persistence/session-replay.d.ts +15 -0
  637. package/dist/persistence/session-replay.d.ts.map +1 -0
  638. package/dist/persistence/session-replay.js +80 -0
  639. package/dist/persistence/session-replay.js.map +1 -0
  640. package/dist/pipeline/__tests__/assign-packages.test.d.ts +2 -0
  641. package/dist/pipeline/__tests__/assign-packages.test.d.ts.map +1 -0
  642. package/dist/pipeline/__tests__/assign-packages.test.js +88 -0
  643. package/dist/pipeline/__tests__/assign-packages.test.js.map +1 -0
  644. package/dist/pipeline/__tests__/constrain-edges.test.d.ts +2 -0
  645. package/dist/pipeline/__tests__/constrain-edges.test.d.ts.map +1 -0
  646. package/dist/pipeline/__tests__/constrain-edges.test.js +228 -0
  647. package/dist/pipeline/__tests__/constrain-edges.test.js.map +1 -0
  648. package/dist/pipeline/__tests__/features.test.d.ts +9 -0
  649. package/dist/pipeline/__tests__/features.test.d.ts.map +1 -0
  650. package/dist/pipeline/__tests__/features.test.js +458 -0
  651. package/dist/pipeline/__tests__/features.test.js.map +1 -0
  652. package/dist/pipeline/__tests__/indexes-imports.test.d.ts +2 -0
  653. package/dist/pipeline/__tests__/indexes-imports.test.d.ts.map +1 -0
  654. package/dist/pipeline/__tests__/indexes-imports.test.js +114 -0
  655. package/dist/pipeline/__tests__/indexes-imports.test.js.map +1 -0
  656. package/dist/pipeline/assign-packages.d.ts +18 -0
  657. package/dist/pipeline/assign-packages.d.ts.map +1 -0
  658. package/dist/pipeline/assign-packages.js +86 -0
  659. package/dist/pipeline/assign-packages.js.map +1 -0
  660. package/dist/pipeline/constrain-edges.d.ts +34 -0
  661. package/dist/pipeline/constrain-edges.d.ts.map +1 -0
  662. package/dist/pipeline/constrain-edges.js +139 -0
  663. package/dist/pipeline/constrain-edges.js.map +1 -0
  664. package/dist/pipeline/feature-deps.d.ts +19 -0
  665. package/dist/pipeline/feature-deps.d.ts.map +1 -0
  666. package/dist/pipeline/feature-deps.js +28 -0
  667. package/dist/pipeline/feature-deps.js.map +1 -0
  668. package/dist/pipeline/features.d.ts +50 -0
  669. package/dist/pipeline/features.d.ts.map +1 -0
  670. package/dist/pipeline/features.js +462 -0
  671. package/dist/pipeline/features.js.map +1 -0
  672. package/dist/pipeline/indexes.d.ts +27 -0
  673. package/dist/pipeline/indexes.d.ts.map +1 -0
  674. package/dist/pipeline/indexes.js +159 -0
  675. package/dist/pipeline/indexes.js.map +1 -0
  676. package/dist/recipes/__tests__/built-in-recipes.test.d.ts +5 -0
  677. package/dist/recipes/__tests__/built-in-recipes.test.d.ts.map +1 -0
  678. package/dist/recipes/__tests__/built-in-recipes.test.js +24 -0
  679. package/dist/recipes/__tests__/built-in-recipes.test.js.map +1 -0
  680. package/dist/recipes/__tests__/registry.test.d.ts +7 -0
  681. package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
  682. package/dist/recipes/__tests__/registry.test.js +34 -0
  683. package/dist/recipes/__tests__/registry.test.js.map +1 -0
  684. package/dist/recipes/__tests__/resolve.test.d.ts +10 -0
  685. package/dist/recipes/__tests__/resolve.test.d.ts.map +1 -0
  686. package/dist/recipes/__tests__/resolve.test.js +38 -0
  687. package/dist/recipes/__tests__/resolve.test.js.map +1 -0
  688. package/dist/recipes/built-in-recipes.d.ts +26 -0
  689. package/dist/recipes/built-in-recipes.d.ts.map +1 -0
  690. package/dist/recipes/built-in-recipes.js +43 -0
  691. package/dist/recipes/built-in-recipes.js.map +1 -0
  692. package/dist/recipes/registry.d.ts +31 -0
  693. package/dist/recipes/registry.d.ts.map +1 -0
  694. package/dist/recipes/registry.js +48 -0
  695. package/dist/recipes/registry.js.map +1 -0
  696. package/dist/recipes/resolve.d.ts +31 -0
  697. package/dist/recipes/resolve.d.ts.map +1 -0
  698. package/dist/recipes/resolve.js +70 -0
  699. package/dist/recipes/resolve.js.map +1 -0
  700. package/dist/recipes/types.d.ts +58 -0
  701. package/dist/recipes/types.d.ts.map +1 -0
  702. package/dist/recipes/types.js +39 -0
  703. package/dist/recipes/types.js.map +1 -0
  704. package/dist/render/__tests__/catalog-json.test.d.ts +9 -0
  705. package/dist/render/__tests__/catalog-json.test.d.ts.map +1 -0
  706. package/dist/render/__tests__/catalog-json.test.js +132 -0
  707. package/dist/render/__tests__/catalog-json.test.js.map +1 -0
  708. package/dist/render/catalog-json-types.d.ts +114 -0
  709. package/dist/render/catalog-json-types.d.ts.map +1 -0
  710. package/dist/render/catalog-json-types.js +23 -0
  711. package/dist/render/catalog-json-types.js.map +1 -0
  712. package/dist/render/catalog-json.d.ts +43 -0
  713. package/dist/render/catalog-json.d.ts.map +1 -0
  714. package/dist/render/catalog-json.js +303 -0
  715. package/dist/render/catalog-json.js.map +1 -0
  716. package/dist/render/opensip-id-derivation.d.ts +73 -0
  717. package/dist/render/opensip-id-derivation.d.ts.map +1 -0
  718. package/dist/render/opensip-id-derivation.js +65 -0
  719. package/dist/render/opensip-id-derivation.js.map +1 -0
  720. package/dist/render/rule-id-mapping.d.ts +61 -0
  721. package/dist/render/rule-id-mapping.d.ts.map +1 -0
  722. package/dist/render/rule-id-mapping.js +82 -0
  723. package/dist/render/rule-id-mapping.js.map +1 -0
  724. package/dist/resolve-callee.d.ts +50 -0
  725. package/dist/resolve-callee.d.ts.map +1 -0
  726. package/dist/resolve-callee.js +80 -0
  727. package/dist/resolve-callee.js.map +1 -0
  728. package/dist/rules/__tests__/__fixtures__/catalog.fixture.d.ts +22 -0
  729. package/dist/rules/__tests__/__fixtures__/catalog.fixture.d.ts.map +1 -0
  730. package/dist/rules/__tests__/__fixtures__/catalog.fixture.js +143 -0
  731. package/dist/rules/__tests__/__fixtures__/catalog.fixture.js.map +1 -0
  732. package/dist/rules/__tests__/create-graph-signal.test.d.ts +8 -0
  733. package/dist/rules/__tests__/create-graph-signal.test.d.ts.map +1 -0
  734. package/dist/rules/__tests__/create-graph-signal.test.js +55 -0
  735. package/dist/rules/__tests__/create-graph-signal.test.js.map +1 -0
  736. package/dist/rules/__tests__/define-rule.test.d.ts +13 -0
  737. package/dist/rules/__tests__/define-rule.test.d.ts.map +1 -0
  738. package/dist/rules/__tests__/define-rule.test.js +102 -0
  739. package/dist/rules/__tests__/define-rule.test.js.map +1 -0
  740. package/dist/rules/__tests__/fingerprint-golden.test.d.ts +21 -0
  741. package/dist/rules/__tests__/fingerprint-golden.test.d.ts.map +1 -0
  742. package/dist/rules/__tests__/fingerprint-golden.test.js +69 -0
  743. package/dist/rules/__tests__/fingerprint-golden.test.js.map +1 -0
  744. package/dist/rules/__tests__/registry.test.d.ts +6 -0
  745. package/dist/rules/__tests__/registry.test.d.ts.map +1 -0
  746. package/dist/rules/__tests__/registry.test.js +37 -0
  747. package/dist/rules/__tests__/registry.test.js.map +1 -0
  748. package/dist/rules/__tests__/rule-behaviors.test.d.ts +9 -0
  749. package/dist/rules/__tests__/rule-behaviors.test.d.ts.map +1 -0
  750. package/dist/rules/__tests__/rule-behaviors.test.js +204 -0
  751. package/dist/rules/__tests__/rule-behaviors.test.js.map +1 -0
  752. package/dist/rules/__tests__/signal-output.snapshot.test.d.ts +11 -0
  753. package/dist/rules/__tests__/signal-output.snapshot.test.d.ts.map +1 -0
  754. package/dist/rules/__tests__/signal-output.snapshot.test.js +55 -0
  755. package/dist/rules/__tests__/signal-output.snapshot.test.js.map +1 -0
  756. package/dist/rules/_approximation.d.ts +23 -0
  757. package/dist/rules/_approximation.d.ts.map +1 -0
  758. package/dist/rules/_approximation.js +28 -0
  759. package/dist/rules/_approximation.js.map +1 -0
  760. package/dist/rules/_entry-points.d.ts +27 -0
  761. package/dist/rules/_entry-points.d.ts.map +1 -0
  762. package/dist/rules/_entry-points.js +81 -0
  763. package/dist/rules/_entry-points.js.map +1 -0
  764. package/dist/rules/_severity-override.d.ts +32 -0
  765. package/dist/rules/_severity-override.d.ts.map +1 -0
  766. package/dist/rules/_severity-override.js +33 -0
  767. package/dist/rules/_severity-override.js.map +1 -0
  768. package/dist/rules/always-throws-branch.d.ts +26 -0
  769. package/dist/rules/always-throws-branch.d.ts.map +1 -0
  770. package/dist/rules/always-throws-branch.js +66 -0
  771. package/dist/rules/always-throws-branch.js.map +1 -0
  772. package/dist/rules/create-graph-signal.d.ts +38 -0
  773. package/dist/rules/create-graph-signal.d.ts.map +1 -0
  774. package/dist/rules/create-graph-signal.js +35 -0
  775. package/dist/rules/create-graph-signal.js.map +1 -0
  776. package/dist/rules/cycle.d.ts +29 -0
  777. package/dist/rules/cycle.d.ts.map +1 -0
  778. package/dist/rules/cycle.js +166 -0
  779. package/dist/rules/cycle.js.map +1 -0
  780. package/dist/rules/cycle.memberlocations.test.d.ts +11 -0
  781. package/dist/rules/cycle.memberlocations.test.d.ts.map +1 -0
  782. package/dist/rules/cycle.memberlocations.test.js +84 -0
  783. package/dist/rules/cycle.memberlocations.test.js.map +1 -0
  784. package/dist/rules/define-rule.d.ts +67 -0
  785. package/dist/rules/define-rule.d.ts.map +1 -0
  786. package/dist/rules/define-rule.js +66 -0
  787. package/dist/rules/define-rule.js.map +1 -0
  788. package/dist/rules/duplicated-function-body.d.ts +40 -0
  789. package/dist/rules/duplicated-function-body.d.ts.map +1 -0
  790. package/dist/rules/duplicated-function-body.js +232 -0
  791. package/dist/rules/duplicated-function-body.js.map +1 -0
  792. package/dist/rules/high-blast-untested.d.ts +26 -0
  793. package/dist/rules/high-blast-untested.d.ts.map +1 -0
  794. package/dist/rules/high-blast-untested.js +82 -0
  795. package/dist/rules/high-blast-untested.js.map +1 -0
  796. package/dist/rules/large-function.d.ts +22 -0
  797. package/dist/rules/large-function.d.ts.map +1 -0
  798. package/dist/rules/large-function.js +72 -0
  799. package/dist/rules/large-function.js.map +1 -0
  800. package/dist/rules/no-side-effect-path.d.ts +31 -0
  801. package/dist/rules/no-side-effect-path.d.ts.map +1 -0
  802. package/dist/rules/no-side-effect-path.js +217 -0
  803. package/dist/rules/no-side-effect-path.js.map +1 -0
  804. package/dist/rules/orphan-subtree.d.ts +11 -0
  805. package/dist/rules/orphan-subtree.d.ts.map +1 -0
  806. package/dist/rules/orphan-subtree.js +104 -0
  807. package/dist/rules/orphan-subtree.js.map +1 -0
  808. package/dist/rules/registry.d.ts +35 -0
  809. package/dist/rules/registry.d.ts.map +1 -0
  810. package/dist/rules/registry.js +96 -0
  811. package/dist/rules/registry.js.map +1 -0
  812. package/dist/rules/test-only-reachable.d.ts +9 -0
  813. package/dist/rules/test-only-reachable.d.ts.map +1 -0
  814. package/dist/rules/test-only-reachable.js +101 -0
  815. package/dist/rules/test-only-reachable.js.map +1 -0
  816. package/dist/rules/unexpected-coupling.d.ts +29 -0
  817. package/dist/rules/unexpected-coupling.d.ts.map +1 -0
  818. package/dist/rules/unexpected-coupling.js +0 -0
  819. package/dist/rules/unexpected-coupling.js.map +1 -0
  820. package/dist/rules/wide-function.d.ts +18 -0
  821. package/dist/rules/wide-function.d.ts.map +1 -0
  822. package/dist/rules/wide-function.js +58 -0
  823. package/dist/rules/wide-function.js.map +1 -0
  824. package/dist/scope-augmentation.d.ts +58 -0
  825. package/dist/scope-augmentation.d.ts.map +1 -0
  826. package/dist/scope-augmentation.js +29 -0
  827. package/dist/scope-augmentation.js.map +1 -0
  828. package/dist/tool.d.ts +29 -0
  829. package/dist/tool.d.ts.map +1 -0
  830. package/dist/tool.js +241 -0
  831. package/dist/tool.js.map +1 -0
  832. package/dist/types.d.ts +642 -0
  833. package/dist/types.d.ts.map +1 -0
  834. package/dist/types.js +2 -0
  835. package/dist/types.js.map +1 -0
  836. package/package.json +136 -0
@@ -0,0 +1,1041 @@
1
+ // @fitness-ignore-file error-handling-quality -- CLI output baseline-write at line 396 is best-effort by design ("don't fail the run"); the comment + v8-ignore at the catch already document that user-visible behavior is unaffected if the persistence layer hiccups.
2
+ // @fitness-ignore-file detached-promises -- CLI renderers (process.stdout.write, render helpers, log lines, setExitCode) are synchronous; heuristic flags inside async handlers.
3
+ // @fitness-ignore-file module-coupling-fan-out -- composition root: the main graph command handler wires detection, orchestration, reporting, workspace, persistence, and recipe resolution; high intra-project fan-out is inherent to a CLI entry point (cf. the index.ts / code-paths.ts barrels that suppress the same check).
4
+ // @fitness-ignore-file performance-anti-patterns -- spread in CLI report aggregation iterates bounded result sets (rule counts, entry-point lists).
5
+ // @fitness-ignore-file no-markdown-references -- docs/plans/* pointers in JSDoc are stable internal references.
6
+ // @fitness-ignore-file public-api-jsdoc -- GraphCommandOptions interface and executeGraph are already documented with rich JSDoc on each field; the check counts the top-level export line, not the fields.
7
+ // @fitness-ignore-file file-length-limit -- top-level graph command handler with rich JSDoc on options; splitting would fragment the unified subcommand surface (gate/persist/output dispatch).
8
+ /**
9
+ * `opensip graph` — main subcommand handler.
10
+ *
11
+ * Runs the full pipeline and prints a comprehensive report covering
12
+ * rules, entry points, and catalog summary in one invocation. Per
13
+ * DEC-8, a switch in this handler dispatches to the right renderer.
14
+ *
15
+ * CLI shape (language-neutral):
16
+ * - `graph` — whole project, auto-detected language(s)
17
+ * - `graph <path> [<path>...]` — scope to one or more subtrees
18
+ * - `graph --workspace` — fan out across detected workspace units
19
+ * (polyglot: aggregates every adapter's units per spec D8b)
20
+ * - `graph --language <name>` — force a single adapter
21
+ *
22
+ * History: v0.2 originally split this into three subcommands (`graph`,
23
+ * `graph-orphans`, `graph-entry-points`). The two filtered views are
24
+ * now sections in this unified report. The TS-flavored `--package` /
25
+ * `--packages` flags were retired in favor of the polyglot surface
26
+ * above; see docs/plans/graph-cli-language-neutral-scoping/.
27
+ */
28
+ import { realpathSync } from 'node:fs';
29
+ import { resolve } from 'node:path';
30
+ import { EXIT_CODES, passRate } from '@opensip-cli/contracts';
31
+ import { ConfigurationError, currentScope, logger, SystemError, ToolError, ValidationError, } from '@opensip-cli/core';
32
+ import { pickAdapter } from '../lang-adapter/registry.js';
33
+ import { CatalogRepo } from '../persistence/catalog-repo.js';
34
+ import { buildGraphSessionPayload } from '../persistence/session-payload.js';
35
+ import { resolveRecipeToRules } from '../recipes/resolve.js';
36
+ import { mapOpenSipRuleIdToEngineSlug } from '../render/rule-id-mapping.js';
37
+ import { currentRules } from '../rules/registry.js';
38
+ import { assertFinalizedAcrossBoundary, finalizeGraphSignals, } from './apply-suppressions.js';
39
+ import { buildGraphEnvelope } from './build-envelope.js';
40
+ import { runCatalogJsonMode, runGateMode } from './graph-modes.js';
41
+ import { buildLiveGraphOutput, buildUnifiedReportLines, countFiles, resolutionBannerText, } from './graph-report.js';
42
+ import { resolveCanonicalFileSet } from './orchestrate/canonical-file-set.js';
43
+ import { detectMonorepoLayout, partitionFlatRepo, selectStrategyForLayout, } from './orchestrate/flat-monorepo-strategy.js';
44
+ import { partitionFilesIntoShards } from './orchestrate/partition-files.js';
45
+ import { loadGraphConfig, resolveGraphRecipeSelection, runGraph, runShardedGraph, } from './orchestrate.js';
46
+ import { positionalPathLabel, resolvePositionalPaths } from './positional-paths.js';
47
+ import { MemoryPressureError } from './pressure-monitor.js';
48
+ import { GraphProfileBuilder, writeGraphProfile } from './profile.js';
49
+ import { resolveAdaptersForRun } from './resolve-adapters.js';
50
+ import { buildWorkspaceJsonDocument, writeWorkspaceReport } from './workspace-report.js';
51
+ import { discoverPolyglotUnits, runWorkspaceUnitsInParallel } from './workspace-runner.js';
52
+ const EVT_GRAPH_COMPLETE = 'graph.cli.graph.complete';
53
+ const MODULE_GRAPH_CLI = 'graph:cli';
54
+ const MODULE_GRAPH_RENDER = 'graph:render';
55
+ /**
56
+ * The feature columns the decoupled dashboard renders (ADR-0006): only these
57
+ * are materialized into the persisted catalog, and only on the standard
58
+ * (catalog-producing) `graph` run. Export-only paths (sarif/catalog export)
59
+ * do not go through this dispatch, so they stay lean (no features persisted).
60
+ */
61
+ const DASHBOARD_FEATURE_COLUMNS = ['blast', 'scc', 'packageCoupling'];
62
+ /**
63
+ * Run graph and return the run's {@link GraphRunOutcome} — the deliverable
64
+ * {@link SignalEnvelope} (so the composition root can cloud + `--report-to`
65
+ * deliver it, ADR-0011) plus the optional generic-session contribution the
66
+ * host run plane persists (host-owned-run-timing Phase 3; graph never writes
67
+ * the row itself). Returns `undefined` for the paths that do NOT produce a
68
+ * deliverable envelope: plain `--json` (the `--workspace` child carrier —
69
+ * children must not each emit cloud signals) and `--workspace` itself (the
70
+ * parent aggregates per-unit findings for the dashboard, not signals for the
71
+ * cloud — audit P1-2), and any error path. The `--workspace` path returns its
72
+ * outcome through `executeWorkspaceGraph` so the host persists the single
73
+ * aggregate session. tool.ts calls `cli.deliverSignals` only when an envelope
74
+ * comes back.
75
+ */
76
+ export async function executeGraph(opts, cli) {
77
+ // Hoisted dummies for any remaining internal startedAt refs in non-session
78
+ // profile/display code paths inside this file (the session ones were switched
79
+ // to host record). Visible to all branches despite early returns.
80
+ const startedAtForProfile = new Date().toISOString();
81
+ const startedAt = startedAtForProfile;
82
+ const profile = createProfileBuilder(opts, startedAtForProfile);
83
+ logger.info({
84
+ evt: 'graph.cli.graph.start',
85
+ module: MODULE_GRAPH_CLI,
86
+ cwd: opts.cwd,
87
+ // Observability: which build engine the user requested. Sharded is the
88
+ // default (ADR-0032), so a bare run requests `sharded`; `--exact` opts back
89
+ // to the single-program engine. The RESOLVED engine (after shardability) is
90
+ // logged at `graph.cli.graph.engine`.
91
+ requestedEngine: opts.exact === true ? 'exact' : 'sharded',
92
+ });
93
+ // Run-level lifecycle event on the per-run DiagnosticsBus (north-star §5.10).
94
+ // The host emits COMMAND-level lifecycle (mount-command-spec / pre-action
95
+ // hook); only the engine knows its INTERNAL lifecycle (requested engine,
96
+ // resolved mode, shard fan-out), so the graph run contributes a `start` here —
97
+ // before any branch, so workspace / multi-path / single-path runs all surface
98
+ // it — and a `complete` once the build returns. Rides on every `--json`
99
+ // CommandOutcome via `scope.diagnostics.snapshot()`. Engine/library code emits
100
+ // through the ambient `currentScope()?.diagnostics` accessor (the documented
101
+ // idiom; `cli.scope`/ToolScope deliberately omits the bus — see
102
+ // diagnostics-bus.ts header).
103
+ currentScope()?.diagnostics?.event('execute', 'debug', 'graph build started', {
104
+ requestedEngine: opts.exact === true ? 'exact' : 'sharded',
105
+ });
106
+ // (profile / startedAtForProfile already declared at top of fn for branch visibility)
107
+ try {
108
+ validateMutuallyExclusiveFlags(opts);
109
+ // Resolve the recipe once at the top of the run (CLI layer owns selection;
110
+ // the engine stays recipe-agnostic). Tool-scoped (ADR-0022): precedence is
111
+ // `--recipe` flag > `graph.recipe` > `default`.
112
+ // Threaded into every build path as `RunGraphInput.rules`. An explicit
113
+ // unknown name throws a ConfigurationError here (caught by handleGraphError);
114
+ // a config-sourced unknown name falls back to `default` with a warning. For
115
+ // the `--workspace` path the parent resolves only to validate the name
116
+ // (fail-fast); children re-resolve in their own scope.
117
+ const recipeSelection = resolveGraphRecipeSelection(opts.cwd, opts.recipe);
118
+ const rules = resolveRecipeToRules(recipeSelection.name, {
119
+ tolerant: recipeSelection.tolerant,
120
+ });
121
+ // Normalize opts.recipe to the RESOLVED name so the envelope/run-header,
122
+ // dashboard sessions, and any `--workspace` children report what actually
123
+ // ran. Pre-ADR-0022 the generic `mergeConfigDefaults` set opts.recipe from
124
+ // config; that responsibility now lives here, tool-scoped — opts is the
125
+ // request-scoped parsed-options bag the pre-action hook already augments, so
126
+ // this is the single point that owns graph's recipe normalization.
127
+ opts.recipe = recipeSelection.name;
128
+ if (opts.workspace === true) {
129
+ const outcome = await executeWorkspaceGraph(opts, cli, profile);
130
+ writeProfileIfRequested(opts, profile);
131
+ return outcome;
132
+ }
133
+ const positionalPaths = resolvePositionalScope(opts);
134
+ if (positionalPaths.length > 1) {
135
+ const outcome = await executeMultiPathGraph({ opts, cli, rules, startedAt, profile }, positionalPaths);
136
+ writeProfileIfRequested(opts, profile);
137
+ return outcome;
138
+ }
139
+ // Realpath the run root ONCE, before engine selection (F3 path parity). The
140
+ // EXACT engine normalizes its project dir via realpathSync internally
141
+ // (graph-typescript normalize-project-dir); the SHARDED worker derives
142
+ // project-relative `code.file` paths against this `projectRoot`. Under a
143
+ // symlinked cwd a RAW root would make the sharded paths gain `../..` prefixes
144
+ // while exact stays canonical → the two engines emit different `code.file`,
145
+ // and since the engine choice is environment-sensitive, a `--gate-save`
146
+ // baseline written by one engine would flag everything new under the other.
147
+ // Canonicalizing here (idempotent for non-symlinks) keeps both engines'
148
+ // emitted paths byte-identical. Shard discovery already realpaths internally
149
+ // (discoverFiles → normalizeProjectDir), so the shard files and this root now
150
+ // share the same canonical base.
151
+ const runCwd = realpathOrSelf(positionalPaths[0] ?? opts.cwd, opts.cwd);
152
+ // Honor the project's `graph:` config block (rule knobs like
153
+ // minCrossPackageDuplicatePackages). Resolved from the original cwd so a
154
+ // positional subtree run still picks up the project-root config.
155
+ const config = loadGraphConfig(opts.cwd);
156
+ // Determinism (ADR-0033, superseding ADR-0032/0031): the build engine is
157
+ // chosen by an explicit, deterministic policy — the SHARDED engine is the
158
+ // DEFAULT (both engines resolve through one shared model — exact = the
159
+ // 1-shard case — held equivalent by the directional soundness invariant +
160
+ // completeness floor; ADR-0033), and
161
+ // `--exact` opts OUT to the single-program engine. It is NOT chosen by
162
+ // `process.stdout.isTTY` or on-disk discovery state, so a bare `graph` builds
163
+ // the same catalog whether run in a terminal, piped, or under
164
+ // `--gate-*`/`--json`. When the project can't shard (no worker script,
165
+ // single-unit, discovery failure) we fall back to the exact engine — the
166
+ // natural single-package/small-repo path — rather than failing.
167
+ const resolution = await resolveEngineShards(opts, cli, positionalPaths);
168
+ const shards = resolution.shards;
169
+ logger.info({
170
+ evt: 'graph.cli.graph.engine',
171
+ module: MODULE_GRAPH_CLI,
172
+ mode: shards.length > 1 ? 'sharded' : 'exact',
173
+ requestedExact: opts.exact === true,
174
+ shards: shards.length,
175
+ reason: engineSelectionReason(opts, positionalPaths, shards.length > 1),
176
+ });
177
+ const profileRun = profile?.startRun({
178
+ label: positionalPaths.length === 0 ? 'root' : positionalPathLabel(runCwd, opts.cwd),
179
+ cwd: runCwd,
180
+ mode: shards.length > 1 ? 'sharded' : 'single-process',
181
+ });
182
+ // The synthetic partitioner runs BEFORE the profile run recorder exists
183
+ // (its `mode` label needs the shard count), so its wall time is measured
184
+ // where it runs and recorded here (ADR-0045 measurement plane).
185
+ if (resolution.partition !== undefined) {
186
+ profileRun?.recordStage('partition', resolution.partition.durationMs, resolution.partition.detail);
187
+ }
188
+ const result = shards.length > 1
189
+ ? await runProfiledShardedBuild(profileRun, {
190
+ opts,
191
+ shards,
192
+ projectRoot: runCwd,
193
+ cli,
194
+ config,
195
+ rules,
196
+ })
197
+ : await runGraph({
198
+ cwd: runCwd,
199
+ noCache: opts.noCache,
200
+ resolution: opts.resolution,
201
+ language: opts.language,
202
+ config,
203
+ rules,
204
+ datastore: cli.scope.datastore(),
205
+ emitFeatures: DASHBOARD_FEATURE_COLUMNS,
206
+ onProgress: profileRun?.onProgress,
207
+ });
208
+ profileRun?.finish(result);
209
+ // Propagate shard failures so incomplete catalogs do not silently produce
210
+ // baselines or pass --gate-compare (per-audit: failedShardIds was computed
211
+ // but never surfaced to the gate or as a hard error).
212
+ if (shards.length > 1) {
213
+ const sharded = result;
214
+ if (sharded.failedShardIds && sharded.failedShardIds.length > 0) {
215
+ throw new SystemError(`Sharded graph build had ${sharded.failedShardIds.length} shard failure(s); ` +
216
+ `catalog and any --gate-* / baseline artifacts are incomplete. ` +
217
+ `See 'graph.sharded.shard_failed' log events for per-shard details.`, { code: 'GRAPH.SHARD.FAILURES' });
218
+ }
219
+ }
220
+ enforceLanguageMismatchPolicy(opts, result.catalog, [runCwd]);
221
+ currentScope()?.diagnostics?.event('execute', 'debug', 'graph build complete', {
222
+ mode: shards.length > 1 ? 'sharded' : 'exact',
223
+ shards: shards.length,
224
+ });
225
+ // `runCwd` (= positionalPaths[0] ?? opts.cwd) is the build root the signals
226
+ // are relative to — the correct base for resolving `@graph-ignore` directive
227
+ // files. For the sharded build it equals `projectRoot` passed above.
228
+ const outcome = await dispatchGraphResult(opts, result, cli, startedAt, runCwd);
229
+ writeProfileIfRequested(opts, profile);
230
+ return outcome;
231
+ }
232
+ catch (error) {
233
+ handleGraphError('graph', error, cli);
234
+ return undefined;
235
+ }
236
+ }
237
+ /**
238
+ * Engine-selection policy (ADR-0033, superseding ADR-0032/0031). The SHARDED
239
+ * engine is the DEFAULT — both engines resolve through one shared model (exact =
240
+ * the 1-shard case), held equivalent by the directional soundness invariant +
241
+ * completeness floor (`equivalence-repo-scale.test.ts` fixture +
242
+ * `graph-equivalence-check` directional real-repo ratchet +
243
+ * `resolution-completeness-floor.test.ts`; ADR-0033). Returns the shard
244
+ * set whenever the project can actually shard (>1 non-empty shard); returns an
245
+ * empty array (→ the EXACT single-program engine) when `--exact` is passed OR
246
+ * the project isn't shardable (single-package / flat / discovery failure — the
247
+ * natural exact fallback). The decision is a pure function of the parsed options
248
+ * + the project's shardability — it never reads `process.stdout.isTTY`, so a
249
+ * bare `graph` is deterministic across terminal / pipe / CI invocations.
250
+ *
251
+ * The exact engine is selected (returns `[]`) when:
252
+ * - `--exact` was passed (the explicit small-repo / oracle escape hatch);
253
+ * - positional `[paths...]` were given (subtree/multi-path runs are exact);
254
+ * - the project resolves to ≤1 non-empty shard (nothing to parallelize) or
255
+ * no worker script is available — a graceful fall-through to exact, the
256
+ * natural single-package path.
257
+ */
258
+ /**
259
+ * Resolve a path to absolute (a RELATIVE input resolves against `base` —
260
+ * the command's `opts.cwd`, NOT `process.cwd()`, which may differ when the
261
+ * CLI is hosted), then realpath it (follow symlinks) — the SAME normalization
262
+ * the exact engine's `normalizeProjectDir` applies, so both engines see one
263
+ * canonical run root (F3). Falls back to the absolute path if realpath fails
264
+ * (e.g. the path doesn't exist yet — discovery reports the error downstream).
265
+ * Idempotent on an already-canonical path.
266
+ */
267
+ function realpathOrSelf(input, base) {
268
+ // `resolve(base, input)` returns `input` unchanged when it is already absolute.
269
+ const absolute = resolve(base, input);
270
+ try {
271
+ return realpathSync(absolute);
272
+ }
273
+ catch {
274
+ /* v8 ignore next */
275
+ return absolute;
276
+ }
277
+ }
278
+ async function resolveEngineShards(opts, cli, positionalPaths) {
279
+ if (opts.exact === true)
280
+ return { shards: [] };
281
+ if (positionalPaths.length > 0)
282
+ return { shards: [] };
283
+ return resolveShards(opts, cli);
284
+ }
285
+ /**
286
+ * Human-readable explanation of the engine decision for the
287
+ * `graph.cli.graph.engine` observability event. Pure; mirrors
288
+ * {@link resolveEngineShards}'s branches.
289
+ */
290
+ function engineSelectionReason(opts, positionalPaths, sharded) {
291
+ if (sharded)
292
+ return 'sharded-default';
293
+ if (opts.exact === true)
294
+ return 'exact-opt-out';
295
+ if (positionalPaths.length > 0)
296
+ return 'exact-positional-paths';
297
+ return 'exact-not-shardable';
298
+ }
299
+ /**
300
+ * Resolve a project to its shards (one per workspace package). Returns an
301
+ * empty array — signalling the caller to use the single-process build —
302
+ * when the project isn't multi-package, when no worker script is
303
+ * available to spawn, or when discovery fails. Each unit's file set is
304
+ * enumerated via the graph adapter; partitions with no files are dropped.
305
+ *
306
+ * ADR-0032: reached for any run that did NOT pass `--exact` (see
307
+ * {@link resolveEngineShards}) — sharded is the default. A project that yields
308
+ * ≤1 non-empty shard falls back to the exact single-program engine naturally.
309
+ */
310
+ async function resolveShards(opts, cli) {
311
+ const cliScript = opts.cliScript ?? process.argv[1];
312
+ if (typeof cliScript !== 'string' || cliScript.length === 0)
313
+ return { shards: [] };
314
+ let units;
315
+ try {
316
+ units = await discoverPolyglotUnits(opts.cwd, resolveAdaptersForRun(opts, cli));
317
+ }
318
+ catch {
319
+ /* v8 ignore next */
320
+ return resolveSyntheticFlatShards(opts);
321
+ }
322
+ if (units.length <= 1)
323
+ return resolveSyntheticFlatShards(opts);
324
+ // Phase 1 (graph-sharded-exact-parity): enumerate the canonical file set ONCE
325
+ // from project-wide root discovery — the SAME source + filter the exact engine
326
+ // uses — then PARTITION it across the discovered unit boundaries. The old loop
327
+ // re-derived each shard's files from that package's own tsconfig, which
328
+ // excludes the package's __fixtures__ tree and (for some) its test files, so
329
+ // the sharded engine silently dropped files the exact engine kept. Partitioning
330
+ // the canonical set guarantees both engines see the identical files.
331
+ const adapter = pickAdapter(opts.cwd);
332
+ let rootDiscovery;
333
+ try {
334
+ rootDiscovery = adapter.discoverFiles({ cwd: opts.cwd });
335
+ }
336
+ catch {
337
+ /* v8 ignore next */
338
+ return resolveSyntheticFlatShards(opts);
339
+ }
340
+ const canonicalFiles = resolveCanonicalFileSet(rootDiscovery.files);
341
+ const shards = partitionFilesIntoShards({
342
+ canonicalFiles,
343
+ units: units.map((u) => ({
344
+ id: u.id,
345
+ rootDir: u.rootDir,
346
+ ...(u.configPath === undefined ? {} : { configPathAbs: u.configPath }),
347
+ })),
348
+ projectRoot: rootDiscovery.projectDirAbs,
349
+ rootConfigPathAbs: rootDiscovery.configPathAbs,
350
+ });
351
+ // Need at least two non-empty shards to justify the parallel/merge overhead.
352
+ if (shards.length > 1)
353
+ return { shards };
354
+ return resolveSyntheticFlatShards(opts);
355
+ }
356
+ /**
357
+ * Resolve a project's shard set the SAME way a production `graph` run does
358
+ * (workspace units → canonical-file partition, else synthetic flat shards),
359
+ * exposed for the real-repo equivalence guardrail (`graph-equivalence-check`).
360
+ * Returns `[]` when the project isn't shardable (≤1 shard / no worker script) —
361
+ * the guardrail rejects that, since the comparison is only meaningful on a
362
+ * shardable multi-package repo. Reuses the private {@link resolveShards} so
363
+ * there is ONE shard-resolution model, never a drifting copy.
364
+ */
365
+ export async function resolveShardsForCwd(cwd, cliScript, cli) {
366
+ const resolution = await resolveShards({ cwd, cliScript, noCache: true }, cli);
367
+ return resolution.shards;
368
+ }
369
+ /**
370
+ * Flat-large fallback for single-tsconfig TypeScript repos. Workspace
371
+ * sharding is preferred because package boundaries are semantically real. When
372
+ * no workspace split exists and the TypeScript file count crosses the same
373
+ * threshold as heap preflight's 12 GB tier, synthesize directory-coherent
374
+ * shards and feed them into the existing sharded build.
375
+ */
376
+ function resolveSyntheticFlatShards(opts) {
377
+ if (typeof opts.language === 'string' && opts.language.length > 0)
378
+ return { shards: [] };
379
+ const adapter = pickAdapter(opts.cwd);
380
+ if (adapter.id !== 'typescript')
381
+ return { shards: [] };
382
+ let discovery;
383
+ try {
384
+ discovery = adapter.discoverFiles({ cwd: opts.cwd });
385
+ }
386
+ catch {
387
+ return { shards: [] };
388
+ }
389
+ // Canonical set (Phase 1): drop fixtures before partitioning so the flat-large
390
+ // fallback shards match the exact engine's file set just like the workspace path.
391
+ const canonicalFiles = resolveCanonicalFileSet(discovery.files);
392
+ // Measure the partition compute (layout detection + strategy resolution +
393
+ // partitioning) where it runs — the profile run recorder does not exist yet
394
+ // (its `mode` label needs the shard count), so executeGraph records the
395
+ // timing afterwards via `recordStage` (ADR-0045 measurement plane).
396
+ const partitionStart = Date.now();
397
+ const layout = detectMonorepoLayout({
398
+ repoRoot: discovery.projectDirAbs,
399
+ files: canonicalFiles,
400
+ });
401
+ const selection = selectStrategyForLayout(layout);
402
+ if (layout.kind !== 'flat-large' || selection.mode !== 'synthetic-partition') {
403
+ return { shards: [] };
404
+ }
405
+ // Strategy precedence: `graph.partitionStrategy` (config/env, ADR-0045) >
406
+ // the layout-recommended default > 'hybrid'. `loadGraphConfig` is
407
+ // scope-first and cheap, so reading it here (off the hot path) is safe.
408
+ const graphConfig = loadGraphConfig(opts.cwd);
409
+ const strategy = graphConfig.partitionStrategy ?? selection.partitionStrategy ?? 'hybrid';
410
+ const partitions = partitionFlatRepo({
411
+ files: layout.files,
412
+ repoRoot: discovery.projectDirAbs,
413
+ strategy,
414
+ });
415
+ const shards = partitions
416
+ .filter((p) => p.files.length > 0)
417
+ .map((p) => ({
418
+ id: `partition:${p.id}`,
419
+ rootDir: discovery.projectDirAbs,
420
+ files: p.files,
421
+ configPathAbs: discovery.configPathAbs,
422
+ }));
423
+ if (shards.length <= 1)
424
+ return { shards: [] };
425
+ return {
426
+ shards,
427
+ partition: {
428
+ durationMs: Date.now() - partitionStart,
429
+ detail: `${strategy}: ${String(shards.length)} partition(s)`,
430
+ },
431
+ };
432
+ }
433
+ /** Drive the sharded build and adapt it to the RunGraphResult dispatch shape. */
434
+ async function runShardedBuild(ctx) {
435
+ const { opts, shards, projectRoot, cli, config, rules } = ctx;
436
+ const datastore = cli.scope.datastore();
437
+ const sharded = await runShardedGraph({
438
+ shards,
439
+ projectRoot,
440
+ cliScript: opts.cliScript ?? process.argv[1] ?? '',
441
+ adapter: pickAdapter(projectRoot, opts.language),
442
+ resolutionMode: opts.resolution ?? 'exact',
443
+ concurrency: opts.concurrency,
444
+ useCache: opts.noCache !== true,
445
+ config,
446
+ rules,
447
+ catalogRepo: datastore ? new CatalogRepo(datastore) : null,
448
+ emitFeatures: DASHBOARD_FEATURE_COLUMNS,
449
+ ...(ctx.onProgress === undefined ? {} : { onProgress: ctx.onProgress }),
450
+ ...(opts.language === undefined ? {} : { language: opts.language }),
451
+ });
452
+ return {
453
+ catalog: sharded.catalog,
454
+ indexes: sharded.indexes,
455
+ signals: sharded.signals,
456
+ resolutionStats: sharded.resolutionStats,
457
+ cacheHit: sharded.cacheHit,
458
+ features: sharded.features,
459
+ shardStats: sharded.shardStats,
460
+ };
461
+ }
462
+ async function runProfiledShardedBuild(profileRun, ctx) {
463
+ const started = Date.now();
464
+ const result = await runShardedBuild(ctx);
465
+ profileRun?.recordStage('sharded-build', Date.now() - started, `${String(ctx.shards.length)} shard(s)`);
466
+ return result;
467
+ }
468
+ /**
469
+ * Resolve the build engine for the interactive live path — the SAME policy
470
+ * `executeGraph` uses (ADR-0032): the SHARDED engine when `--exact` is absent
471
+ * and the project yields >1 non-empty shard, the EXACT (single-program) engine
472
+ * otherwise. Returns the shard set (`length > 1` ⇒ sharded) so the live runner
473
+ * can decide its transport: sharded runs in-process (its shards are already
474
+ * subprocesses), exact runs off-process in the `graph-run-worker` (ADR-0028).
475
+ * `isTTY` is NEVER consulted — the engine is a pure function of the request +
476
+ * shardability, identical to the static path.
477
+ */
478
+ export async function resolveLiveEngineShards(args, cli) {
479
+ const opts = {
480
+ cwd: args.cwd,
481
+ noCache: args.noCache,
482
+ resolution: args.resolution,
483
+ exact: args.exact,
484
+ ...(args.cliScript === undefined ? {} : { cliScript: args.cliScript }),
485
+ };
486
+ // No positional paths in the whole-project live view, so the engine decision
487
+ // is `--exact` + shardability alone.
488
+ const resolution = await resolveEngineShards(opts, cli, []);
489
+ return resolution.shards;
490
+ }
491
+ /**
492
+ * Run the SHARDED build in-process for the live view and reduce it to the slim,
493
+ * serializable {@link LiveGraphOutput} the interactive runner consumes —
494
+ * IDENTICAL in shape to what the off-process exact worker streams back, so both
495
+ * live transports converge on one payload. The heavy per-shard parse/walk/resolve
496
+ * runs in the shard SUBPROCESSES, so the main thread (which animates the Ink
497
+ * checklist) is only orchestrating + merging — no off-process worker is needed
498
+ * for the sharded path (ADR-0032). Progress events flow through `onProgress`,
499
+ * mapped onto the same seven canonical stages the exact engine emits.
500
+ *
501
+ * Crosses the single suppression chokepoint via {@link buildLiveGraphOutput}
502
+ * (against `args.cwd`, the build root) — so the live sharded path waives
503
+ * `@graph-ignore` directives IDENTICALLY to the static/exact paths (ADR-0014/0031).
504
+ */
505
+ export async function runShardedLiveBuild(args, shards, datastore, onProgress) {
506
+ const result = await runShardedGraph({
507
+ shards,
508
+ projectRoot: args.cwd,
509
+ cliScript: args.cliScript ?? process.argv[1] ?? '',
510
+ adapter: pickAdapter(args.cwd),
511
+ resolutionMode: args.resolution ?? 'exact',
512
+ useCache: args.noCache !== true,
513
+ config: args.config ?? {},
514
+ // The live dispatch always resolves the recipe → rules; fall back to the
515
+ // full registered set if a programmatic caller omits them (parity with the
516
+ // exact path, where `runGraph` applies the same `?? currentRules()` default).
517
+ rules: args.rules ?? currentRules(),
518
+ catalogRepo: datastore ? new CatalogRepo(datastore) : null,
519
+ emitFeatures: DASHBOARD_FEATURE_COLUMNS,
520
+ onProgress,
521
+ });
522
+ return buildLiveGraphOutput({
523
+ catalog: result.catalog,
524
+ indexes: result.indexes,
525
+ signals: result.signals,
526
+ cacheHit: result.cacheHit,
527
+ }, args.cwd);
528
+ }
529
+ /** Profile bucket for the run shape: workspace fan-out, multi-path, or single graph. */
530
+ function profileMode(opts) {
531
+ if (opts.workspace === true)
532
+ return 'workspace';
533
+ if ((opts.paths?.length ?? 0) > 1)
534
+ return 'multi-path';
535
+ return 'graph';
536
+ }
537
+ function createProfileBuilder(opts, startedAt) {
538
+ if (typeof opts.profileOutput !== 'string' || opts.profileOutput.length === 0) {
539
+ return undefined;
540
+ }
541
+ return new GraphProfileBuilder({
542
+ cwd: opts.cwd,
543
+ mode: profileMode(opts),
544
+ resolutionMode: opts.resolution,
545
+ startedAt,
546
+ });
547
+ }
548
+ function writeProfileIfRequested(opts, profile) {
549
+ if (profile === undefined)
550
+ return;
551
+ if (typeof opts.profileOutput !== 'string' || opts.profileOutput.length === 0)
552
+ return;
553
+ const outPath = writeGraphProfile(opts.profileOutput, opts.cwd, profile.complete());
554
+ logger.info({
555
+ evt: 'graph.profile.write.complete',
556
+ module: MODULE_GRAPH_CLI,
557
+ output: outPath,
558
+ });
559
+ }
560
+ function validateMutuallyExclusiveFlags(opts) {
561
+ if (opts.gateSave === true && opts.gateCompare === true) {
562
+ throw new ConfigurationError('--gate-save and --gate-compare are mutually exclusive.');
563
+ }
564
+ if (opts.workspace === true && (opts.paths?.length ?? 0) > 0) {
565
+ throw new ConfigurationError('--workspace and positional paths are mutually exclusive. Use one or the other.');
566
+ }
567
+ if (opts.workspace === true && (opts.gateSave === true || opts.gateCompare === true)) {
568
+ throw new ConfigurationError('--workspace and --gate-save/--gate-compare are mutually exclusive. ' +
569
+ 'Gates and baselines apply to production code; --workspace intentionally scans the full project (including dependencies and test fixtures).');
570
+ }
571
+ }
572
+ function resolvePositionalScope(opts) {
573
+ if (!opts.paths || opts.paths.length === 0)
574
+ return [];
575
+ return resolvePositionalPaths(opts.paths, opts.cwd);
576
+ }
577
+ /**
578
+ * D14 mixed policy. When `--language X` was specified and the run
579
+ * discovered zero files matching that adapter, exit 2 with the
580
+ * canonical error. Auto-detection paths (no `--language`) do NOT
581
+ * trigger this check — a "zero files" outcome there is a valid
582
+ * (non-error) state.
583
+ */
584
+ function enforceLanguageMismatchPolicy(opts, catalog, paths) {
585
+ if (typeof opts.language !== 'string' || opts.language.length === 0)
586
+ return;
587
+ const fileCount = catalog === null ? 0 : countFiles(catalog);
588
+ if (fileCount > 0)
589
+ return;
590
+ const pathLabel = paths.map((p) => positionalPathLabel(p, opts.cwd)).join(', ');
591
+ throw new ConfigurationError(`--language ${opts.language} matched 0 files under ${pathLabel}; check the flag or paths.`);
592
+ }
593
+ async function executeMultiPathGraph(ctx, paths) {
594
+ const { opts, cli, rules, startedAt, profile } = ctx;
595
+ const allSignals = [];
596
+ let combinedFiles = 0;
597
+ let totalSuppressed = 0;
598
+ let lastResult = null;
599
+ const config = loadGraphConfig(opts.cwd);
600
+ for (const p of paths) {
601
+ const profileRun = profile?.startRun({
602
+ label: positionalPathLabel(p, opts.cwd),
603
+ cwd: p,
604
+ mode: 'single-process',
605
+ });
606
+ const r = await runGraph({
607
+ cwd: p,
608
+ noCache: opts.noCache,
609
+ resolution: opts.resolution,
610
+ language: opts.language,
611
+ config,
612
+ rules,
613
+ datastore: cli.scope.datastore(),
614
+ emitFeatures: DASHBOARD_FEATURE_COLUMNS,
615
+ onProgress: profileRun?.onProgress,
616
+ });
617
+ profileRun?.finish(r);
618
+ lastResult = r;
619
+ // Each path's signals are relative to THAT path's root — so waive them
620
+ // against `p` here, before aggregating. A single post-aggregation pass
621
+ // (the old shape) could only use one base and would leak waivers for every
622
+ // path but one. Each per-path call crosses the single suppression
623
+ // chokepoint (finalizeGraphSignals); the aggregate is then re-branded once
624
+ // below via assertFinalizedAcrossBoundary (an assertion that every member
625
+ // was finalized, NOT a second suppression pass).
626
+ const finalized = await finalizeGraphSignals(r.signals, p);
627
+ totalSuppressed += finalized.suppressedCount;
628
+ allSignals.push(...finalized.signals);
629
+ if (r.catalog !== null)
630
+ combinedFiles += countFiles(r.catalog);
631
+ }
632
+ // D14: count files across every analyzed path. Zero files + a
633
+ // `--language` override → exit 2 with the canonical message.
634
+ if (typeof opts.language === 'string' && opts.language.length > 0 && combinedFiles === 0) {
635
+ throw new ConfigurationError(`--language ${opts.language} matched 0 files under ${paths.map((p) => positionalPathLabel(p, opts.cwd)).join(', ')}; check the flag or paths.`);
636
+ }
637
+ /* v8 ignore next */
638
+ if (lastResult === null)
639
+ return undefined;
640
+ const combined = {
641
+ catalog: lastResult.catalog,
642
+ indexes: lastResult.indexes,
643
+ signals: allSignals,
644
+ resolutionStats: lastResult.resolutionStats,
645
+ cacheHit: lastResult.cacheHit,
646
+ features: lastResult.features,
647
+ };
648
+ // `allSignals` is already waived per-path (each against its own root), so
649
+ // deliver directly — a second suppression pass would have no single correct
650
+ // root and risk re-resolving paths under the wrong base. Re-brand the
651
+ // aggregate FinalizedSignals (each member already crossed finalizeGraphSignals
652
+ // above) so deliverGraphResult's persist call gets the type it requires.
653
+ const finalizedAggregate = assertFinalizedAcrossBoundary(allSignals, totalSuppressed);
654
+ return await deliverGraphResult(opts, combined, cli, startedAt, finalizedAggregate);
655
+ }
656
+ /**
657
+ * Assemble the run's {@link SignalEnvelope} from its raw engine signals
658
+ * (ADR-0011). Centralises `runId`/`createdAt` resolution off the live scope so
659
+ * cloud egress correlates with the run id the logger stamps; the envelope is
660
+ * pure (the clock read happens here, once).
661
+ */
662
+ function envelopeFor(opts, result, durationMs) {
663
+ return buildGraphEnvelope({
664
+ signals: result.signals,
665
+ recipe: opts.recipe,
666
+ runId: currentScope()?.runId ?? '',
667
+ createdAt: new Date().toISOString(),
668
+ durationMs,
669
+ resolutionMode: result.catalog?.resolutionMode,
670
+ });
671
+ }
672
+ // Exported for the per-mode dispatch test (audit P1-2). Not re-exported by
673
+ // the package barrel (only `executeGraph` is), so it stays package-internal.
674
+ //
675
+ // Returns the run's {@link GraphRunOutcome} for every mode that should deliver
676
+ // signals (gate, catalog, `--report-to`, default render) so the composition
677
+ // root can cloud-emit + report-to it ONCE (ADR-0011 / ADR-0008) and the host
678
+ // can persist the optional session contribution (host-owned-run-timing Phase
679
+ // 3). Returns `undefined` for plain `--json` (the `--workspace` child carrier —
680
+ // children must not each emit cloud signals).
681
+ export async function dispatchGraphResult(opts, rawResult, cli, startedAt, suppressionRoot) {
682
+ // ADR-0014: apply the inline graph-ignore waivers BEFORE any mode consumes
683
+ // the signals — the gate baseline, catalog, render, and session persistence
684
+ // all see the post-waiver set. `--workspace` is covered transitively: each
685
+ // child runs `graph --json` through this function, so the parent aggregates
686
+ // already-waived signals.
687
+ //
688
+ // `suppressionRoot` is the build root the signals' `code.file` paths are
689
+ // RELATIVE TO — i.e. the positional subtree / sharded-child / workspace-unit
690
+ // root, NOT necessarily `opts.cwd`. A `graph <subdir>` run (and every
691
+ // `--workspace` child, which runs `graph <unitRoot> --json`) builds against
692
+ // `runCwd = positionalPaths[0]`, so its signal paths and directive files
693
+ // resolve under that root. Resolving against `opts.cwd` instead made every
694
+ // `@graph-ignore` directive file unreadable (ENOENT), silently leaking the
695
+ // waiver — the bug this parameter closes.
696
+ // Route through the SINGLE suppression chokepoint (finalizeGraphSignals) — the
697
+ // same seam the live/worker producers cross via buildLiveGraphOutput. The
698
+ // branded FinalizedSignals it returns is the only signal shape the
699
+ // session-contribution builder (and, transitively, the verdict + render) will
700
+ // accept, so a future fourth output path cannot deliver un-waived signals: the
701
+ // compiler rejects it.
702
+ const finalized = await finalizeGraphSignals(rawResult.signals, suppressionRoot);
703
+ return deliverGraphResult(opts, { ...rawResult, signals: finalized.signals }, cli, startedAt, finalized);
704
+ }
705
+ /**
706
+ * Deliver an already-waived run to its output mode (gate / catalog-json /
707
+ * render) and, on the human-facing render path, BUILD the generic-session
708
+ * contribution the host run plane persists (host-owned-run-timing Phase 3 —
709
+ * graph never writes the row itself). Split out of {@link dispatchGraphResult}
710
+ * so the multi-path path — which must waive each path's signals against ITS
711
+ * OWN root before aggregating (the roots differ) — can aggregate the kept
712
+ * signals and deliver once, without a second (wrong-root) suppression pass.
713
+ *
714
+ * The contribution is built HERE, where the branded {@link FinalizedSignals}
715
+ * is in scope, so the dashboard history can only ever carry post-waiver
716
+ * findings (the branding guard is not lost across the return boundary).
717
+ */
718
+ async function deliverGraphResult(opts, result, cli, startedAt, finalized) {
719
+ const suppressedCount = finalized.suppressedCount;
720
+ const durationMs = Math.max(0, Date.now() - Date.parse(startedAt));
721
+ if (opts.gateSave === true || opts.gateCompare === true) {
722
+ // ADR-0036: the envelope arrives fingerprint-stamped — `buildGraphEnvelope`
723
+ // passes graph's byte-preserved strategy into `buildSignalEnvelope`, which
724
+ // stamps at construction (over the canonical remapped ruleIds, exactly what
725
+ // the former post-hoc gate-path stamp produced). The host seams only read
726
+ // `signal.fingerprint`. runGateMode owns the deliverSignals call
727
+ // (host-derived exit), so the command-spec skips it.
728
+ const envelope = envelopeFor(opts, result, durationMs);
729
+ await runGateMode(opts, envelope, cli, result.catalog?.resolutionMode);
730
+ logger.info({ evt: EVT_GRAPH_COMPLETE, module: MODULE_GRAPH_CLI, suppressed: suppressedCount });
731
+ return { envelope };
732
+ }
733
+ if (typeof opts.catalogOutput === 'string' && opts.catalogOutput.length > 0) {
734
+ runCatalogJsonMode(opts, result, cli, startedAt);
735
+ logger.info({ evt: EVT_GRAPH_COMPLETE, module: MODULE_GRAPH_CLI, suppressed: suppressedCount });
736
+ return { envelope: envelopeFor(opts, result, durationMs) };
737
+ }
738
+ const envelope = await renderGraphResult(opts, result, startedAt, cli);
739
+ // Session persistence is dashboard history — populated on human-facing runs
740
+ // only. Skipped for:
741
+ // - `--json` (the machine-artifact mode AND the carrier each
742
+ // `executeWorkspaceGraph` child runs under — keeps "one human invocation
743
+ // = one session"; the --workspace parent persists the single aggregate);
744
+ // - `--report-to` (an export mode; like gate/catalog it opts out of session
745
+ // history — the root delivers the envelope to the receiver instead).
746
+ // The host persists the returned `session` after the handler resolves; graph
747
+ // builds it here from the BRANDED FinalizedSignals so the contribution can
748
+ // only ever carry post-waiver findings regardless of which path reached here.
749
+ const isReportTo = typeof opts.reportTo === 'string' && opts.reportTo.length > 0;
750
+ const session = opts.json !== true && !isReportTo ? buildGraphSessionContribution(opts, finalized) : undefined;
751
+ cli.setExitCode(EXIT_CODES.SUCCESS);
752
+ logger.info({
753
+ evt: EVT_GRAPH_COMPLETE,
754
+ module: MODULE_GRAPH_CLI,
755
+ signals: result.signals.length,
756
+ suppressed: suppressedCount,
757
+ });
758
+ // Plain `--json` is the workspace-child carrier: it returns `undefined` so
759
+ // the root does not cloud-emit per child (the parent owns the dashboard
760
+ // aggregate, not per-unit signal batches — audit P1-2). Every other mode
761
+ // (default render, `--report-to`) returns the outcome for root delivery; only
762
+ // the non-export render path carries a `session`.
763
+ return opts.json === true ? undefined : { envelope, ...(session ? { session } : {}) };
764
+ }
765
+ /**
766
+ * Render the run and return its {@link SignalEnvelope} (ADR-0011).
767
+ *
768
+ * `--json` emits the envelope through the shared `formatSignalJson`
769
+ * (`cli.emitEnvelope`). The default/`--verbose` path hands a `graph-done`
770
+ * result to the render seam (Ink on TTY, plain text in pipes/CI): graph's
771
+ * report is richer than the neutral per-unit table — it carries the verbose
772
+ * catalog/findings/entry-point body as `verboseDetail` ({kind:'lines'},
773
+ * ADR-0021), a fast-tier caveat (`resolutionBanner`), and the one-line
774
+ * PASS/FAIL `summary`; the non-verbose footer hints are emitted by the shared
775
+ * seam (`graphDoneView`). The summary counts are derived from the envelope's
776
+ * verdict so `--json` and the human report agree; the envelope itself is NOT
777
+ * carried on the result (it would route to the neutral unit table and drop
778
+ * graph's body), but IS returned for the composition root's cloud +
779
+ * `--report-to` delivery.
780
+ */
781
+ async function renderGraphResult(opts, result, startedAt, cli) {
782
+ const durationMs = Math.max(0, Date.now() - Date.parse(startedAt));
783
+ const envelope = envelopeFor(opts, result, durationMs);
784
+ if (opts.json === true) {
785
+ logger.info({ evt: 'graph.render.json.start', module: MODULE_GRAPH_RENDER });
786
+ cli.emitEnvelope(envelope);
787
+ logger.info({ evt: 'graph.render.json.complete', module: MODULE_GRAPH_RENDER });
788
+ return envelope;
789
+ }
790
+ logger.info({ evt: 'graph.render.table.start', module: MODULE_GRAPH_RENDER });
791
+ const verbose = opts.verbose === true;
792
+ // ADR-0021: graph's verbose body is carried as VerboseDetail{kind:'lines'} and
793
+ // rendered through the shared resultToView seam — the same path the live runner
794
+ // uses — instead of a graph-only `reportLines`/`footerHints` shape. The
795
+ // non-verbose footer hints are emitted by the seam (`graphDoneView`).
796
+ const verboseDetail = verbose
797
+ ? {
798
+ kind: 'lines',
799
+ lines: buildUnifiedReportLines({
800
+ catalog: result.catalog,
801
+ indexes: result.indexes,
802
+ signals: result.signals,
803
+ cacheHit: result.cacheHit,
804
+ }, { includeSummary: false }),
805
+ }
806
+ : undefined;
807
+ const resolutionBanner = resolutionBannerText(result.catalog?.resolutionMode);
808
+ const { summary } = envelope.verdict;
809
+ const done = {
810
+ type: 'graph-done',
811
+ ...(verboseDetail === undefined ? {} : { verboseDetail }),
812
+ ...(resolutionBanner === undefined ? {} : { resolutionBanner }),
813
+ summary: {
814
+ passed: summary.passed,
815
+ failed: summary.failed,
816
+ errors: summary.errors,
817
+ warnings: summary.warnings,
818
+ },
819
+ durationMs,
820
+ };
821
+ await cli.render(done);
822
+ logger.info({ evt: 'graph.render.table.complete', module: MODULE_GRAPH_RENDER });
823
+ return envelope;
824
+ }
825
+ /**
826
+ * `graph --workspace` — fan a graph run out across every workspace
827
+ * unit returned by the adapters' `discoverWorkspaceUnits` hook. Per
828
+ * spec D8b, polyglot repos aggregate units from EVERY detected
829
+ * adapter (or the single adapter named by `--language`).
830
+ */
831
+ async function executeWorkspaceGraph(opts, cli, profile) {
832
+ const cliScript = opts.cliScript ?? process.argv[1];
833
+ if (typeof cliScript !== 'string' || cliScript.length === 0) {
834
+ throw new ConfigurationError('--workspace: could not determine the CLI entry script (process.argv[1] is empty).');
835
+ }
836
+ const adapters = resolveAdaptersForRun(opts, cli);
837
+ const units = await discoverPolyglotUnits(opts.cwd, adapters);
838
+ if (units.length === 0) {
839
+ const adapterLabel = adapters.map((a) => a.id).join(', ') || '(no language adapters available)';
840
+ throw new ConfigurationError(`--workspace: no workspace units detected for [${adapterLabel}]. Use 'opensip graph' for whole-project analysis.`);
841
+ }
842
+ const profileRun = profile?.startRun({ label: 'workspace', cwd: opts.cwd, mode: 'workspace' });
843
+ // Internal per-run timer for the workspace REPORT artifact (durationMs in the
844
+ // JSON document / report header + the profile stage). NOT a session timestamp:
845
+ // the generic session row's timing is host-owned (host-owned-run-timing Phase
846
+ // 3), stamped from the host RunTimer after this handler returns.
847
+ const startedAt = Date.now();
848
+ const result = await runWorkspaceUnitsInParallel({
849
+ cwd: opts.cwd,
850
+ units,
851
+ cliScript,
852
+ concurrency: opts.concurrency,
853
+ noCache: opts.noCache,
854
+ resolution: opts.resolution,
855
+ recipe: opts.recipe,
856
+ ...(opts.language === undefined ? {} : { language: opts.language }),
857
+ });
858
+ const durationMs = Date.now() - startedAt;
859
+ profileRun?.recordStage('workspace-fanout', durationMs, `${String(units.length)} unit(s)`);
860
+ const allSignals = [];
861
+ for (const r of result.perUnit)
862
+ allSignals.push(...r.signals);
863
+ profileRun?.finishSummary({
864
+ cacheHit: false,
865
+ signals: allSignals.length,
866
+ });
867
+ // Build exactly one aggregate session contribution for the whole --workspace
868
+ // invocation (non-json path only). Matches the contract "one human-facing CLI
869
+ // invocation = one session" that fitness/sim already follow; the per-unit child
870
+ // processes don't contribute because they always run with --json (see
871
+ // dispatchGraphResult). The host run plane persists the returned `session`
872
+ // after this handler resolves — graph never writes the row itself
873
+ // (host-owned-run-timing Phase 3).
874
+ //
875
+ // Cloud signal sync (ADR-0008) is intentionally NOT emitted for --workspace
876
+ // (audit P1-2): the parent aggregates per-unit signals for the dashboard, not
877
+ // for the cloud, and the --json children skip emit to avoid fragmented
878
+ // per-unit batches. So the returned outcome carries a `session` but NO
879
+ // envelope. A whole-project `graph` run emits normally (the root's
880
+ // deliverSignals on the returned envelope).
881
+ let session;
882
+ if (opts.json === true) {
883
+ // ADR-0011: emit through the CLI seam, not process.stdout directly.
884
+ // cli.emitJson applies the same JSON.stringify(_, null, 2) + '\n'.
885
+ cli.emitJson(buildWorkspaceJsonDocument(result.perUnit, durationMs));
886
+ }
887
+ else {
888
+ await writeWorkspaceReport(result.perUnit, durationMs, cli);
889
+ session = buildWorkspaceSessionContribution(opts, allSignals);
890
+ }
891
+ // If any child failed to spawn or exited with an error, surface it
892
+ // as a runtime error. The parent itself succeeded if every child
893
+ // returned exit 0.
894
+ if (result.anyChildFailed) {
895
+ cli.setExitCode(EXIT_CODES.RUNTIME_ERROR);
896
+ process.stderr.write(`graph --workspace: at least one unit run failed; see per-unit output above.\n`);
897
+ }
898
+ else {
899
+ cli.setExitCode(EXIT_CODES.SUCCESS);
900
+ }
901
+ logger.info({
902
+ evt: EVT_GRAPH_COMPLETE,
903
+ module: MODULE_GRAPH_CLI,
904
+ units: result.perUnit.length,
905
+ findings: allSignals.length,
906
+ failed: result.anyChildFailed,
907
+ durationMs,
908
+ });
909
+ // The aggregate outcome carries the single session (non-json path) but NO
910
+ // envelope — the parent does not cloud-emit per-unit signals (audit P1-2).
911
+ // `undefined` on the --json carrier path keeps the host from persisting.
912
+ return session === undefined ? undefined : { session };
913
+ }
914
+ /**
915
+ * Build the generic-session contribution for a single-process graph run from
916
+ * the branded {@link FinalizedSignals} (host-owned-run-timing Phase 3). The
917
+ * host run plane stamps timing + id and persists the row after the handler
918
+ * returns — graph never writes the generic `StoredSession` itself.
919
+ *
920
+ * Takes the branded {@link FinalizedSignals} (not a raw `Signal[]`): the only
921
+ * way to obtain one is to cross the single suppression chokepoint
922
+ * (`finalizeGraphSignals`, or `assertFinalizedAcrossBoundary` after the worker
923
+ * IPC boundary). This is the compile-time guardrail that makes the TTY-leak bug
924
+ * un-regressable — a caller that hands raw, un-waived signals here does not
925
+ * type-check, so the dashboard history can never record un-waived findings.
926
+ *
927
+ * The single-process path holds the raw engine signals (engine slugs), so the
928
+ * session payload's per-rule keys are engine slugs directly.
929
+ */
930
+ function buildGraphSessionContribution(opts, finalized) {
931
+ return contributionFromSignals(opts, finalized.signals);
932
+ }
933
+ /**
934
+ * Build the aggregate generic-session contribution for a `--workspace` run.
935
+ *
936
+ * Child envelopes carry Option-A-mapped OpenSIP rule IDs; reverse-map back to
937
+ * engine slugs so the aggregate session payload's per-rule metric columns
938
+ * (keyed on engine slugs in the dashboard) keep working — exactly what the old
939
+ * `persistWorkspaceSession` did before handing off to the shared save.
940
+ */
941
+ function buildWorkspaceSessionContribution(opts, signals) {
942
+ const engineSignals = signals.map((s) => {
943
+ const ruleId = mapOpenSipRuleIdToEngineSlug(s.ruleId);
944
+ return { ...s, ruleId, source: ruleId };
945
+ });
946
+ return contributionFromSignals(opts, engineSignals);
947
+ }
948
+ /**
949
+ * Shared contribution builder: derive graph's opaque session payload + the
950
+ * generic verdict (`score`/`passed`) from a run's engine-slug `Signal[]`. The
951
+ * payload is graph-owned detail (summary + rule-grouped per-signal findings);
952
+ * the generic session row holds zero graph vocabulary. `score`/`passed` mirror
953
+ * exactly what the former `saveGraphSession` computed (pass rate over
954
+ * passed/total rules; `passed` ⇔ no error-severity signals).
955
+ */
956
+ /**
957
+ * Engine slugs of every rule a run evaluated — the session payload's full rule
958
+ * list, so a CLEAN run still records a PASS row per rule (the session detail
959
+ * then shows the complete rule list, exactly the way fitness shows every check,
960
+ * not just the failing ones).
961
+ *
962
+ * Prefer the EXPLICITLY-resolved rule set the run actually used (the `--recipe`
963
+ * subset, threaded from the dispatch seam as `args.rules`); otherwise read the
964
+ * current scope's full registry — this mirrors `runGraph`'s own
965
+ * `args.rules ?? currentRules()` resolution, so the recorded set is exactly what
966
+ * ran. Degrades to the empty set (fired-rules-only) when no graph scope is
967
+ * active — e.g. an isolated dispatch unit test; production always runs the
968
+ * handler inside the entered RunScope.
969
+ *
970
+ * Exported so BOTH contribution-building paths derive the evaluated set
971
+ * identically: the static `executeGraph` dispatch (below) AND the live Ink
972
+ * runner (`graph-runner.tsx`). Before it was shared, only the static path
973
+ * threaded it, so a clean run on the live (interactive) path persisted an empty
974
+ * `checks[]` and the report rendered "no results" instead of the rule list.
975
+ */
976
+ export function evaluatedRuleSlugs(explicitRules) {
977
+ if (explicitRules)
978
+ return explicitRules.map((r) => r.slug);
979
+ try {
980
+ return currentRules().map((r) => r.slug);
981
+ }
982
+ catch {
983
+ // @swallow-ok no graph scope (isolated dispatch unit test); degrade to the
984
+ // fired-rule set. Production always runs the handler inside a RunScope.
985
+ return [];
986
+ }
987
+ }
988
+ /**
989
+ * Build graph's generic-session contribution from a run's engine-slug
990
+ * `Signal[]` plus the engine slugs of the rules it evaluated. The SINGLE
991
+ * assembly point for both the static dispatch path and the live Ink runner, so
992
+ * the contribution shape (and the "every evaluated rule gets a row" behaviour)
993
+ * can never drift between them again. The payload is graph-owned detail
994
+ * (summary + rule-grouped per-signal findings); the generic session row holds
995
+ * zero graph vocabulary. `score`/`passed` follow fit's semantics (pass rate over
996
+ * passed/total rules; `passed` ⇔ no error-severity signal).
997
+ *
998
+ * `evaluatedSlugs` defaults to {@link evaluatedRuleSlugs}() (the scope's full
999
+ * registry) for the static callers, which build inside the entered RunScope; the
1000
+ * live runner passes its `args.rules`-derived set explicitly.
1001
+ */
1002
+ export function contributionFromSignals(opts, signals, evaluatedSlugs = evaluatedRuleSlugs()) {
1003
+ const payload = buildGraphSessionPayload(signals, evaluatedSlugs);
1004
+ return {
1005
+ tool: 'graph',
1006
+ cwd: opts.cwd,
1007
+ ...(opts.recipe === undefined ? {} : { recipe: opts.recipe }),
1008
+ score: passRate(payload.summary),
1009
+ passed: payload.summary.errors === 0,
1010
+ payload,
1011
+ };
1012
+ }
1013
+ export function handleGraphError(label, error, cli) {
1014
+ logger.error({
1015
+ evt: `graph.cli.${label}.error`,
1016
+ module: MODULE_GRAPH_CLI,
1017
+ err: error instanceof Error ? error.message : String(error),
1018
+ });
1019
+ if (error instanceof ConfigurationError) {
1020
+ cli.setExitCode(EXIT_CODES.CONFIGURATION_ERROR);
1021
+ }
1022
+ else {
1023
+ /* v8 ignore start */
1024
+ if (error instanceof ValidationError) {
1025
+ cli.setExitCode(EXIT_CODES.CONFIGURATION_ERROR);
1026
+ }
1027
+ else if (error instanceof MemoryPressureError) {
1028
+ cli.setExitCode(EXIT_CODES.RUNTIME_ERROR);
1029
+ }
1030
+ else if (error instanceof ToolError) {
1031
+ cli.setExitCode(EXIT_CODES.RUNTIME_ERROR);
1032
+ }
1033
+ else {
1034
+ cli.setExitCode(EXIT_CODES.RUNTIME_ERROR);
1035
+ }
1036
+ /* v8 ignore stop */
1037
+ }
1038
+ process.stderr.write(`${label}: ${error instanceof Error ? error.message : String(error)}\n`);
1039
+ }
1040
+ export { buildUnifiedReportLines, buildLiveGraphOutput } from './graph-report.js';
1041
+ //# sourceMappingURL=graph.js.map