@opencodehub/ingestion 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 (563) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +69 -0
  3. package/dist/extract/index.d.ts +8 -0
  4. package/dist/extract/index.d.ts.map +1 -0
  5. package/dist/extract/index.js +6 -0
  6. package/dist/extract/index.js.map +1 -0
  7. package/dist/extract/orm-detector.d.ts +19 -0
  8. package/dist/extract/orm-detector.d.ts.map +1 -0
  9. package/dist/extract/orm-detector.js +209 -0
  10. package/dist/extract/orm-detector.js.map +1 -0
  11. package/dist/extract/property-access.d.ts +76 -0
  12. package/dist/extract/property-access.d.ts.map +1 -0
  13. package/dist/extract/property-access.js +260 -0
  14. package/dist/extract/property-access.js.map +1 -0
  15. package/dist/extract/receiver-resolver.d.ts +86 -0
  16. package/dist/extract/receiver-resolver.d.ts.map +1 -0
  17. package/dist/extract/receiver-resolver.js +77 -0
  18. package/dist/extract/receiver-resolver.js.map +1 -0
  19. package/dist/extract/route-detector-java.d.ts +29 -0
  20. package/dist/extract/route-detector-java.d.ts.map +1 -0
  21. package/dist/extract/route-detector-java.js +190 -0
  22. package/dist/extract/route-detector-java.js.map +1 -0
  23. package/dist/extract/route-detector-nestjs.d.ts +30 -0
  24. package/dist/extract/route-detector-nestjs.d.ts.map +1 -0
  25. package/dist/extract/route-detector-nestjs.js +134 -0
  26. package/dist/extract/route-detector-nestjs.js.map +1 -0
  27. package/dist/extract/route-detector-python.d.ts +28 -0
  28. package/dist/extract/route-detector-python.d.ts.map +1 -0
  29. package/dist/extract/route-detector-python.js +100 -0
  30. package/dist/extract/route-detector-python.js.map +1 -0
  31. package/dist/extract/route-detector-rails.d.ts +28 -0
  32. package/dist/extract/route-detector-rails.d.ts.map +1 -0
  33. package/dist/extract/route-detector-rails.js +162 -0
  34. package/dist/extract/route-detector-rails.js.map +1 -0
  35. package/dist/extract/route-detector.d.ts +45 -0
  36. package/dist/extract/route-detector.d.ts.map +1 -0
  37. package/dist/extract/route-detector.js +467 -0
  38. package/dist/extract/route-detector.js.map +1 -0
  39. package/dist/extract/tool-detector.d.ts +26 -0
  40. package/dist/extract/tool-detector.d.ts.map +1 -0
  41. package/dist/extract/tool-detector.js +364 -0
  42. package/dist/extract/tool-detector.js.map +1 -0
  43. package/dist/extract/types.d.ts +89 -0
  44. package/dist/extract/types.d.ts.map +1 -0
  45. package/dist/extract/types.js +11 -0
  46. package/dist/extract/types.js.map +1 -0
  47. package/dist/index.d.ts +10 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +10 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/parse/cobol-regex.d.ts +85 -0
  52. package/dist/parse/cobol-regex.d.ts.map +1 -0
  53. package/dist/parse/cobol-regex.js +355 -0
  54. package/dist/parse/cobol-regex.js.map +1 -0
  55. package/dist/parse/grammar-registry.d.ts +115 -0
  56. package/dist/parse/grammar-registry.d.ts.map +1 -0
  57. package/dist/parse/grammar-registry.js +278 -0
  58. package/dist/parse/grammar-registry.js.map +1 -0
  59. package/dist/parse/index.d.ts +14 -0
  60. package/dist/parse/index.d.ts.map +1 -0
  61. package/dist/parse/index.js +10 -0
  62. package/dist/parse/index.js.map +1 -0
  63. package/dist/parse/language-detector.d.ts +17 -0
  64. package/dist/parse/language-detector.d.ts.map +1 -0
  65. package/dist/parse/language-detector.js +104 -0
  66. package/dist/parse/language-detector.js.map +1 -0
  67. package/dist/parse/parse-worker.d.ts +24 -0
  68. package/dist/parse/parse-worker.d.ts.map +1 -0
  69. package/dist/parse/parse-worker.js +230 -0
  70. package/dist/parse/parse-worker.js.map +1 -0
  71. package/dist/parse/types.d.ts +49 -0
  72. package/dist/parse/types.d.ts.map +1 -0
  73. package/dist/parse/types.js +11 -0
  74. package/dist/parse/types.js.map +1 -0
  75. package/dist/parse/unified-queries.d.ts +37 -0
  76. package/dist/parse/unified-queries.d.ts.map +1 -0
  77. package/dist/parse/unified-queries.js +623 -0
  78. package/dist/parse/unified-queries.js.map +1 -0
  79. package/dist/parse/wasm-fallback.d.ts +88 -0
  80. package/dist/parse/wasm-fallback.d.ts.map +1 -0
  81. package/dist/parse/wasm-fallback.js +258 -0
  82. package/dist/parse/wasm-fallback.js.map +1 -0
  83. package/dist/parse/worker-pool.d.ts +48 -0
  84. package/dist/parse/worker-pool.d.ts.map +1 -0
  85. package/dist/parse/worker-pool.js +97 -0
  86. package/dist/parse/worker-pool.js.map +1 -0
  87. package/dist/pipeline/dep-parsers/go.d.ts +25 -0
  88. package/dist/pipeline/dep-parsers/go.d.ts.map +1 -0
  89. package/dist/pipeline/dep-parsers/go.js +146 -0
  90. package/dist/pipeline/dep-parsers/go.js.map +1 -0
  91. package/dist/pipeline/dep-parsers/index.d.ts +17 -0
  92. package/dist/pipeline/dep-parsers/index.d.ts.map +1 -0
  93. package/dist/pipeline/dep-parsers/index.js +16 -0
  94. package/dist/pipeline/dep-parsers/index.js.map +1 -0
  95. package/dist/pipeline/dep-parsers/maven.d.ts +24 -0
  96. package/dist/pipeline/dep-parsers/maven.d.ts.map +1 -0
  97. package/dist/pipeline/dep-parsers/maven.js +131 -0
  98. package/dist/pipeline/dep-parsers/maven.js.map +1 -0
  99. package/dist/pipeline/dep-parsers/npm.d.ts +30 -0
  100. package/dist/pipeline/dep-parsers/npm.d.ts.map +1 -0
  101. package/dist/pipeline/dep-parsers/npm.js +309 -0
  102. package/dist/pipeline/dep-parsers/npm.js.map +1 -0
  103. package/dist/pipeline/dep-parsers/nuget.d.ts +24 -0
  104. package/dist/pipeline/dep-parsers/nuget.d.ts.map +1 -0
  105. package/dist/pipeline/dep-parsers/nuget.js +178 -0
  106. package/dist/pipeline/dep-parsers/nuget.js.map +1 -0
  107. package/dist/pipeline/dep-parsers/python.d.ts +21 -0
  108. package/dist/pipeline/dep-parsers/python.d.ts.map +1 -0
  109. package/dist/pipeline/dep-parsers/python.js +369 -0
  110. package/dist/pipeline/dep-parsers/python.js.map +1 -0
  111. package/dist/pipeline/dep-parsers/rust.d.ts +18 -0
  112. package/dist/pipeline/dep-parsers/rust.d.ts.map +1 -0
  113. package/dist/pipeline/dep-parsers/rust.js +134 -0
  114. package/dist/pipeline/dep-parsers/rust.js.map +1 -0
  115. package/dist/pipeline/dep-parsers/spdx-normalize.d.ts +15 -0
  116. package/dist/pipeline/dep-parsers/spdx-normalize.d.ts.map +1 -0
  117. package/dist/pipeline/dep-parsers/spdx-normalize.js +31 -0
  118. package/dist/pipeline/dep-parsers/spdx-normalize.js.map +1 -0
  119. package/dist/pipeline/dep-parsers/types.d.ts +63 -0
  120. package/dist/pipeline/dep-parsers/types.d.ts.map +1 -0
  121. package/dist/pipeline/dep-parsers/types.js +56 -0
  122. package/dist/pipeline/dep-parsers/types.js.map +1 -0
  123. package/dist/pipeline/gitignore-stack.d.ts +44 -0
  124. package/dist/pipeline/gitignore-stack.d.ts.map +1 -0
  125. package/dist/pipeline/gitignore-stack.js +69 -0
  126. package/dist/pipeline/gitignore-stack.js.map +1 -0
  127. package/dist/pipeline/gitignore.d.ts +67 -0
  128. package/dist/pipeline/gitignore.d.ts.map +1 -0
  129. package/dist/pipeline/gitignore.js +210 -0
  130. package/dist/pipeline/gitignore.js.map +1 -0
  131. package/dist/pipeline/index.d.ts +53 -0
  132. package/dist/pipeline/index.d.ts.map +1 -0
  133. package/dist/pipeline/index.js +29 -0
  134. package/dist/pipeline/index.js.map +1 -0
  135. package/dist/pipeline/orchestrator.d.ts +105 -0
  136. package/dist/pipeline/orchestrator.d.ts.map +1 -0
  137. package/dist/pipeline/orchestrator.js +175 -0
  138. package/dist/pipeline/orchestrator.js.map +1 -0
  139. package/dist/pipeline/ownership-helpers/drift.d.ts +41 -0
  140. package/dist/pipeline/ownership-helpers/drift.d.ts.map +1 -0
  141. package/dist/pipeline/ownership-helpers/drift.js +122 -0
  142. package/dist/pipeline/ownership-helpers/drift.js.map +1 -0
  143. package/dist/pipeline/ownership-helpers/gini-community.d.ts +24 -0
  144. package/dist/pipeline/ownership-helpers/gini-community.d.ts.map +1 -0
  145. package/dist/pipeline/ownership-helpers/gini-community.js +32 -0
  146. package/dist/pipeline/ownership-helpers/gini-community.js.map +1 -0
  147. package/dist/pipeline/ownership-helpers/git-blame-batcher.d.ts +71 -0
  148. package/dist/pipeline/ownership-helpers/git-blame-batcher.d.ts.map +1 -0
  149. package/dist/pipeline/ownership-helpers/git-blame-batcher.js +178 -0
  150. package/dist/pipeline/ownership-helpers/git-blame-batcher.js.map +1 -0
  151. package/dist/pipeline/ownership-helpers/line-overlap.d.ts +35 -0
  152. package/dist/pipeline/ownership-helpers/line-overlap.d.ts.map +1 -0
  153. package/dist/pipeline/ownership-helpers/line-overlap.js +62 -0
  154. package/dist/pipeline/ownership-helpers/line-overlap.js.map +1 -0
  155. package/dist/pipeline/ownership-helpers/orphan.d.ts +73 -0
  156. package/dist/pipeline/ownership-helpers/orphan.d.ts.map +1 -0
  157. package/dist/pipeline/ownership-helpers/orphan.js +117 -0
  158. package/dist/pipeline/ownership-helpers/orphan.js.map +1 -0
  159. package/dist/pipeline/phases/accesses.d.ts +44 -0
  160. package/dist/pipeline/phases/accesses.d.ts.map +1 -0
  161. package/dist/pipeline/phases/accesses.js +194 -0
  162. package/dist/pipeline/phases/accesses.js.map +1 -0
  163. package/dist/pipeline/phases/annotate.d.ts +28 -0
  164. package/dist/pipeline/phases/annotate.d.ts.map +1 -0
  165. package/dist/pipeline/phases/annotate.js +60 -0
  166. package/dist/pipeline/phases/annotate.js.map +1 -0
  167. package/dist/pipeline/phases/cochange.d.ts +42 -0
  168. package/dist/pipeline/phases/cochange.d.ts.map +1 -0
  169. package/dist/pipeline/phases/cochange.js +0 -0
  170. package/dist/pipeline/phases/cochange.js.map +1 -0
  171. package/dist/pipeline/phases/communities.d.ts +34 -0
  172. package/dist/pipeline/phases/communities.d.ts.map +1 -0
  173. package/dist/pipeline/phases/communities.js +412 -0
  174. package/dist/pipeline/phases/communities.js.map +1 -0
  175. package/dist/pipeline/phases/complexity.d.ts +50 -0
  176. package/dist/pipeline/phases/complexity.d.ts.map +1 -0
  177. package/dist/pipeline/phases/complexity.js +794 -0
  178. package/dist/pipeline/phases/complexity.js.map +1 -0
  179. package/dist/pipeline/phases/confidence-demote.d.ts +23 -0
  180. package/dist/pipeline/phases/confidence-demote.d.ts.map +1 -0
  181. package/dist/pipeline/phases/confidence-demote.js +113 -0
  182. package/dist/pipeline/phases/confidence-demote.js.map +1 -0
  183. package/dist/pipeline/phases/content-cache.d.ts +166 -0
  184. package/dist/pipeline/phases/content-cache.d.ts.map +1 -0
  185. package/dist/pipeline/phases/content-cache.js +323 -0
  186. package/dist/pipeline/phases/content-cache.js.map +1 -0
  187. package/dist/pipeline/phases/coverage-parsers/cobertura.d.ts +25 -0
  188. package/dist/pipeline/phases/coverage-parsers/cobertura.d.ts.map +1 -0
  189. package/dist/pipeline/phases/coverage-parsers/cobertura.js +139 -0
  190. package/dist/pipeline/phases/coverage-parsers/cobertura.js.map +1 -0
  191. package/dist/pipeline/phases/coverage-parsers/coverage-py.d.ts +25 -0
  192. package/dist/pipeline/phases/coverage-parsers/coverage-py.d.ts.map +1 -0
  193. package/dist/pipeline/phases/coverage-parsers/coverage-py.js +51 -0
  194. package/dist/pipeline/phases/coverage-parsers/coverage-py.js.map +1 -0
  195. package/dist/pipeline/phases/coverage-parsers/jacoco.d.ts +32 -0
  196. package/dist/pipeline/phases/coverage-parsers/jacoco.d.ts.map +1 -0
  197. package/dist/pipeline/phases/coverage-parsers/jacoco.js +98 -0
  198. package/dist/pipeline/phases/coverage-parsers/jacoco.js.map +1 -0
  199. package/dist/pipeline/phases/coverage-parsers/lcov.d.ts +21 -0
  200. package/dist/pipeline/phases/coverage-parsers/lcov.d.ts.map +1 -0
  201. package/dist/pipeline/phases/coverage-parsers/lcov.js +104 -0
  202. package/dist/pipeline/phases/coverage-parsers/lcov.js.map +1 -0
  203. package/dist/pipeline/phases/coverage-parsers/types.d.ts +27 -0
  204. package/dist/pipeline/phases/coverage-parsers/types.d.ts.map +1 -0
  205. package/dist/pipeline/phases/coverage-parsers/types.js +39 -0
  206. package/dist/pipeline/phases/coverage-parsers/types.js.map +1 -0
  207. package/dist/pipeline/phases/coverage.d.ts +39 -0
  208. package/dist/pipeline/phases/coverage.d.ts.map +1 -0
  209. package/dist/pipeline/phases/coverage.js +154 -0
  210. package/dist/pipeline/phases/coverage.js.map +1 -0
  211. package/dist/pipeline/phases/cross-file.d.ts +40 -0
  212. package/dist/pipeline/phases/cross-file.d.ts.map +1 -0
  213. package/dist/pipeline/phases/cross-file.js +411 -0
  214. package/dist/pipeline/phases/cross-file.js.map +1 -0
  215. package/dist/pipeline/phases/dead-code.d.ts +28 -0
  216. package/dist/pipeline/phases/dead-code.d.ts.map +1 -0
  217. package/dist/pipeline/phases/dead-code.js +157 -0
  218. package/dist/pipeline/phases/dead-code.js.map +1 -0
  219. package/dist/pipeline/phases/default-set.d.ts +24 -0
  220. package/dist/pipeline/phases/default-set.d.ts.map +1 -0
  221. package/dist/pipeline/phases/default-set.js +133 -0
  222. package/dist/pipeline/phases/default-set.js.map +1 -0
  223. package/dist/pipeline/phases/dependencies.d.ts +59 -0
  224. package/dist/pipeline/phases/dependencies.d.ts.map +1 -0
  225. package/dist/pipeline/phases/dependencies.js +281 -0
  226. package/dist/pipeline/phases/dependencies.js.map +1 -0
  227. package/dist/pipeline/phases/embedder-pool.d.ts +31 -0
  228. package/dist/pipeline/phases/embedder-pool.d.ts.map +1 -0
  229. package/dist/pipeline/phases/embedder-pool.js +79 -0
  230. package/dist/pipeline/phases/embedder-pool.js.map +1 -0
  231. package/dist/pipeline/phases/embedder-worker.d.ts +28 -0
  232. package/dist/pipeline/phases/embedder-worker.d.ts.map +1 -0
  233. package/dist/pipeline/phases/embedder-worker.js +43 -0
  234. package/dist/pipeline/phases/embedder-worker.js.map +1 -0
  235. package/dist/pipeline/phases/embeddings.d.ts +117 -0
  236. package/dist/pipeline/phases/embeddings.d.ts.map +1 -0
  237. package/dist/pipeline/phases/embeddings.js +697 -0
  238. package/dist/pipeline/phases/embeddings.js.map +1 -0
  239. package/dist/pipeline/phases/fetches.d.ts +47 -0
  240. package/dist/pipeline/phases/fetches.d.ts.map +1 -0
  241. package/dist/pipeline/phases/fetches.js +207 -0
  242. package/dist/pipeline/phases/fetches.js.map +1 -0
  243. package/dist/pipeline/phases/incremental-helper.d.ts +96 -0
  244. package/dist/pipeline/phases/incremental-helper.d.ts.map +1 -0
  245. package/dist/pipeline/phases/incremental-helper.js +125 -0
  246. package/dist/pipeline/phases/incremental-helper.js.map +1 -0
  247. package/dist/pipeline/phases/incremental-scope.d.ts +67 -0
  248. package/dist/pipeline/phases/incremental-scope.d.ts.map +1 -0
  249. package/dist/pipeline/phases/incremental-scope.js +225 -0
  250. package/dist/pipeline/phases/incremental-scope.js.map +1 -0
  251. package/dist/pipeline/phases/markdown.d.ts +29 -0
  252. package/dist/pipeline/phases/markdown.d.ts.map +1 -0
  253. package/dist/pipeline/phases/markdown.js +298 -0
  254. package/dist/pipeline/phases/markdown.js.map +1 -0
  255. package/dist/pipeline/phases/mro.d.ts +24 -0
  256. package/dist/pipeline/phases/mro.d.ts.map +1 -0
  257. package/dist/pipeline/phases/mro.js +303 -0
  258. package/dist/pipeline/phases/mro.js.map +1 -0
  259. package/dist/pipeline/phases/openapi.d.ts +52 -0
  260. package/dist/pipeline/phases/openapi.d.ts.map +1 -0
  261. package/dist/pipeline/phases/openapi.js +285 -0
  262. package/dist/pipeline/phases/openapi.js.map +1 -0
  263. package/dist/pipeline/phases/orm.d.ts +26 -0
  264. package/dist/pipeline/phases/orm.d.ts.map +1 -0
  265. package/dist/pipeline/phases/orm.js +183 -0
  266. package/dist/pipeline/phases/orm.js.map +1 -0
  267. package/dist/pipeline/phases/ownership.d.ts +88 -0
  268. package/dist/pipeline/phases/ownership.d.ts.map +1 -0
  269. package/dist/pipeline/phases/ownership.js +479 -0
  270. package/dist/pipeline/phases/ownership.js.map +1 -0
  271. package/dist/pipeline/phases/parse.d.ts +63 -0
  272. package/dist/pipeline/phases/parse.d.ts.map +1 -0
  273. package/dist/pipeline/phases/parse.js +994 -0
  274. package/dist/pipeline/phases/parse.js.map +1 -0
  275. package/dist/pipeline/phases/processes.d.ts +47 -0
  276. package/dist/pipeline/phases/processes.d.ts.map +1 -0
  277. package/dist/pipeline/phases/processes.js +620 -0
  278. package/dist/pipeline/phases/processes.js.map +1 -0
  279. package/dist/pipeline/phases/profile.d.ts +33 -0
  280. package/dist/pipeline/phases/profile.d.ts.map +1 -0
  281. package/dist/pipeline/phases/profile.js +91 -0
  282. package/dist/pipeline/phases/profile.js.map +1 -0
  283. package/dist/pipeline/phases/repo-node.d.ts +112 -0
  284. package/dist/pipeline/phases/repo-node.d.ts.map +1 -0
  285. package/dist/pipeline/phases/repo-node.js +272 -0
  286. package/dist/pipeline/phases/repo-node.js.map +1 -0
  287. package/dist/pipeline/phases/risk-snapshot.d.ts +34 -0
  288. package/dist/pipeline/phases/risk-snapshot.d.ts.map +1 -0
  289. package/dist/pipeline/phases/risk-snapshot.js +63 -0
  290. package/dist/pipeline/phases/risk-snapshot.js.map +1 -0
  291. package/dist/pipeline/phases/routes.d.ts +31 -0
  292. package/dist/pipeline/phases/routes.d.ts.map +1 -0
  293. package/dist/pipeline/phases/routes.js +262 -0
  294. package/dist/pipeline/phases/routes.js.map +1 -0
  295. package/dist/pipeline/phases/sbom.d.ts +45 -0
  296. package/dist/pipeline/phases/sbom.d.ts.map +1 -0
  297. package/dist/pipeline/phases/sbom.js +289 -0
  298. package/dist/pipeline/phases/sbom.js.map +1 -0
  299. package/dist/pipeline/phases/scan.d.ts +54 -0
  300. package/dist/pipeline/phases/scan.d.ts.map +1 -0
  301. package/dist/pipeline/phases/scan.js +340 -0
  302. package/dist/pipeline/phases/scan.js.map +1 -0
  303. package/dist/pipeline/phases/scip-index.d.ts +54 -0
  304. package/dist/pipeline/phases/scip-index.d.ts.map +1 -0
  305. package/dist/pipeline/phases/scip-index.js +469 -0
  306. package/dist/pipeline/phases/scip-index.js.map +1 -0
  307. package/dist/pipeline/phases/structure.d.ts +21 -0
  308. package/dist/pipeline/phases/structure.d.ts.map +1 -0
  309. package/dist/pipeline/phases/structure.js +115 -0
  310. package/dist/pipeline/phases/structure.js.map +1 -0
  311. package/dist/pipeline/phases/summarize.d.ts +126 -0
  312. package/dist/pipeline/phases/summarize.d.ts.map +1 -0
  313. package/dist/pipeline/phases/summarize.js +401 -0
  314. package/dist/pipeline/phases/summarize.js.map +1 -0
  315. package/dist/pipeline/phases/temporal-helpers/branch-divergence.d.ts +42 -0
  316. package/dist/pipeline/phases/temporal-helpers/branch-divergence.d.ts.map +1 -0
  317. package/dist/pipeline/phases/temporal-helpers/branch-divergence.js +96 -0
  318. package/dist/pipeline/phases/temporal-helpers/branch-divergence.js.map +1 -0
  319. package/dist/pipeline/phases/temporal-helpers/churn-decay.d.ts +22 -0
  320. package/dist/pipeline/phases/temporal-helpers/churn-decay.d.ts.map +1 -0
  321. package/dist/pipeline/phases/temporal-helpers/churn-decay.js +32 -0
  322. package/dist/pipeline/phases/temporal-helpers/churn-decay.js.map +1 -0
  323. package/dist/pipeline/phases/temporal-helpers/conventional-commits.d.ts +21 -0
  324. package/dist/pipeline/phases/temporal-helpers/conventional-commits.d.ts.map +1 -0
  325. package/dist/pipeline/phases/temporal-helpers/conventional-commits.js +37 -0
  326. package/dist/pipeline/phases/temporal-helpers/conventional-commits.js.map +1 -0
  327. package/dist/pipeline/phases/temporal-helpers/gini.d.ts +32 -0
  328. package/dist/pipeline/phases/temporal-helpers/gini.d.ts.map +1 -0
  329. package/dist/pipeline/phases/temporal-helpers/gini.js +78 -0
  330. package/dist/pipeline/phases/temporal-helpers/gini.js.map +1 -0
  331. package/dist/pipeline/phases/temporal-helpers/revert-detect.d.ts +14 -0
  332. package/dist/pipeline/phases/temporal-helpers/revert-detect.d.ts.map +1 -0
  333. package/dist/pipeline/phases/temporal-helpers/revert-detect.js +25 -0
  334. package/dist/pipeline/phases/temporal-helpers/revert-detect.js.map +1 -0
  335. package/dist/pipeline/phases/temporal-helpers/test-pair.d.ts +18 -0
  336. package/dist/pipeline/phases/temporal-helpers/test-pair.d.ts.map +1 -0
  337. package/dist/pipeline/phases/temporal-helpers/test-pair.js +119 -0
  338. package/dist/pipeline/phases/temporal-helpers/test-pair.js.map +1 -0
  339. package/dist/pipeline/phases/temporal.d.ts +65 -0
  340. package/dist/pipeline/phases/temporal.d.ts.map +1 -0
  341. package/dist/pipeline/phases/temporal.js +621 -0
  342. package/dist/pipeline/phases/temporal.js.map +1 -0
  343. package/dist/pipeline/phases/tools.d.ts +21 -0
  344. package/dist/pipeline/phases/tools.d.ts.map +1 -0
  345. package/dist/pipeline/phases/tools.js +118 -0
  346. package/dist/pipeline/phases/tools.js.map +1 -0
  347. package/dist/pipeline/profile-detectors/api-contracts.d.ts +18 -0
  348. package/dist/pipeline/profile-detectors/api-contracts.d.ts.map +1 -0
  349. package/dist/pipeline/profile-detectors/api-contracts.js +78 -0
  350. package/dist/pipeline/profile-detectors/api-contracts.js.map +1 -0
  351. package/dist/pipeline/profile-detectors/framework-detector.d.ts +11 -0
  352. package/dist/pipeline/profile-detectors/framework-detector.d.ts.map +1 -0
  353. package/dist/pipeline/profile-detectors/framework-detector.js +11 -0
  354. package/dist/pipeline/profile-detectors/framework-detector.js.map +1 -0
  355. package/dist/pipeline/profile-detectors/frameworks-catalog.d.ts +7 -0
  356. package/dist/pipeline/profile-detectors/frameworks-catalog.d.ts.map +1 -0
  357. package/dist/pipeline/profile-detectors/frameworks-catalog.js +7 -0
  358. package/dist/pipeline/profile-detectors/frameworks-catalog.js.map +1 -0
  359. package/dist/pipeline/profile-detectors/frameworks.d.ts +7 -0
  360. package/dist/pipeline/profile-detectors/frameworks.d.ts.map +1 -0
  361. package/dist/pipeline/profile-detectors/frameworks.js +7 -0
  362. package/dist/pipeline/profile-detectors/frameworks.js.map +1 -0
  363. package/dist/pipeline/profile-detectors/iac.d.ts +22 -0
  364. package/dist/pipeline/profile-detectors/iac.d.ts.map +1 -0
  365. package/dist/pipeline/profile-detectors/iac.js +97 -0
  366. package/dist/pipeline/profile-detectors/iac.js.map +1 -0
  367. package/dist/pipeline/profile-detectors/languages.d.ts +18 -0
  368. package/dist/pipeline/profile-detectors/languages.d.ts.map +1 -0
  369. package/dist/pipeline/profile-detectors/languages.js +60 -0
  370. package/dist/pipeline/profile-detectors/languages.js.map +1 -0
  371. package/dist/pipeline/profile-detectors/manifests.d.ts +7 -0
  372. package/dist/pipeline/profile-detectors/manifests.d.ts.map +1 -0
  373. package/dist/pipeline/profile-detectors/manifests.js +7 -0
  374. package/dist/pipeline/profile-detectors/manifests.js.map +1 -0
  375. package/dist/pipeline/profile-detectors/src-dirs.d.ts +17 -0
  376. package/dist/pipeline/profile-detectors/src-dirs.d.ts.map +1 -0
  377. package/dist/pipeline/profile-detectors/src-dirs.js +89 -0
  378. package/dist/pipeline/profile-detectors/src-dirs.js.map +1 -0
  379. package/dist/pipeline/profile-detectors/variant-detectors.d.ts +7 -0
  380. package/dist/pipeline/profile-detectors/variant-detectors.d.ts.map +1 -0
  381. package/dist/pipeline/profile-detectors/variant-detectors.js +7 -0
  382. package/dist/pipeline/profile-detectors/variant-detectors.js.map +1 -0
  383. package/dist/pipeline/runner.d.ts +54 -0
  384. package/dist/pipeline/runner.d.ts.map +1 -0
  385. package/dist/pipeline/runner.js +247 -0
  386. package/dist/pipeline/runner.js.map +1 -0
  387. package/dist/pipeline/types.d.ts +235 -0
  388. package/dist/pipeline/types.d.ts.map +1 -0
  389. package/dist/pipeline/types.js +15 -0
  390. package/dist/pipeline/types.js.map +1 -0
  391. package/dist/providers/c.d.ts +3 -0
  392. package/dist/providers/c.d.ts.map +1 -0
  393. package/dist/providers/c.js +162 -0
  394. package/dist/providers/c.js.map +1 -0
  395. package/dist/providers/cobol.d.ts +19 -0
  396. package/dist/providers/cobol.d.ts.map +1 -0
  397. package/dist/providers/cobol.js +44 -0
  398. package/dist/providers/cobol.js.map +1 -0
  399. package/dist/providers/cpp.d.ts +3 -0
  400. package/dist/providers/cpp.d.ts.map +1 -0
  401. package/dist/providers/cpp.js +200 -0
  402. package/dist/providers/cpp.js.map +1 -0
  403. package/dist/providers/csharp.d.ts +3 -0
  404. package/dist/providers/csharp.d.ts.map +1 -0
  405. package/dist/providers/csharp.js +292 -0
  406. package/dist/providers/csharp.js.map +1 -0
  407. package/dist/providers/dart.d.ts +3 -0
  408. package/dist/providers/dart.d.ts.map +1 -0
  409. package/dist/providers/dart.js +214 -0
  410. package/dist/providers/dart.js.map +1 -0
  411. package/dist/providers/definition-ids.d.ts +18 -0
  412. package/dist/providers/definition-ids.d.ts.map +1 -0
  413. package/dist/providers/definition-ids.js +23 -0
  414. package/dist/providers/definition-ids.js.map +1 -0
  415. package/dist/providers/extract-helpers.d.ts +60 -0
  416. package/dist/providers/extract-helpers.d.ts.map +1 -0
  417. package/dist/providers/extract-helpers.js +296 -0
  418. package/dist/providers/extract-helpers.js.map +1 -0
  419. package/dist/providers/extraction-types.d.ts +85 -0
  420. package/dist/providers/extraction-types.d.ts.map +1 -0
  421. package/dist/providers/extraction-types.js +13 -0
  422. package/dist/providers/extraction-types.js.map +1 -0
  423. package/dist/providers/go.d.ts +3 -0
  424. package/dist/providers/go.d.ts.map +1 -0
  425. package/dist/providers/go.js +359 -0
  426. package/dist/providers/go.js.map +1 -0
  427. package/dist/providers/http-detect.d.ts +44 -0
  428. package/dist/providers/http-detect.d.ts.map +1 -0
  429. package/dist/providers/http-detect.js +307 -0
  430. package/dist/providers/http-detect.js.map +1 -0
  431. package/dist/providers/index.d.ts +38 -0
  432. package/dist/providers/index.d.ts.map +1 -0
  433. package/dist/providers/index.js +33 -0
  434. package/dist/providers/index.js.map +1 -0
  435. package/dist/providers/java.d.ts +3 -0
  436. package/dist/providers/java.d.ts.map +1 -0
  437. package/dist/providers/java.js +259 -0
  438. package/dist/providers/java.js.map +1 -0
  439. package/dist/providers/javascript.d.ts +3 -0
  440. package/dist/providers/javascript.d.ts.map +1 -0
  441. package/dist/providers/javascript.js +139 -0
  442. package/dist/providers/javascript.js.map +1 -0
  443. package/dist/providers/kotlin.d.ts +3 -0
  444. package/dist/providers/kotlin.d.ts.map +1 -0
  445. package/dist/providers/kotlin.js +175 -0
  446. package/dist/providers/kotlin.js.map +1 -0
  447. package/dist/providers/php.d.ts +3 -0
  448. package/dist/providers/php.d.ts.map +1 -0
  449. package/dist/providers/php.js +218 -0
  450. package/dist/providers/php.js.map +1 -0
  451. package/dist/providers/python-accesses.d.ts +9 -0
  452. package/dist/providers/python-accesses.d.ts.map +1 -0
  453. package/dist/providers/python-accesses.js +22 -0
  454. package/dist/providers/python-accesses.js.map +1 -0
  455. package/dist/providers/python.d.ts +3 -0
  456. package/dist/providers/python.d.ts.map +1 -0
  457. package/dist/providers/python.js +323 -0
  458. package/dist/providers/python.js.map +1 -0
  459. package/dist/providers/registry.d.ts +4 -0
  460. package/dist/providers/registry.d.ts.map +1 -0
  461. package/dist/providers/registry.js +46 -0
  462. package/dist/providers/registry.js.map +1 -0
  463. package/dist/providers/resolution/c3.d.ts +6 -0
  464. package/dist/providers/resolution/c3.d.ts.map +1 -0
  465. package/dist/providers/resolution/c3.js +76 -0
  466. package/dist/providers/resolution/c3.js.map +1 -0
  467. package/dist/providers/resolution/context.d.ts +38 -0
  468. package/dist/providers/resolution/context.d.ts.map +1 -0
  469. package/dist/providers/resolution/context.js +45 -0
  470. package/dist/providers/resolution/context.js.map +1 -0
  471. package/dist/providers/resolution/first-wins.d.ts +3 -0
  472. package/dist/providers/resolution/first-wins.d.ts.map +1 -0
  473. package/dist/providers/resolution/first-wins.js +27 -0
  474. package/dist/providers/resolution/first-wins.js.map +1 -0
  475. package/dist/providers/resolution/mro.d.ts +16 -0
  476. package/dist/providers/resolution/mro.d.ts.map +1 -0
  477. package/dist/providers/resolution/mro.js +14 -0
  478. package/dist/providers/resolution/mro.js.map +1 -0
  479. package/dist/providers/resolution/none.d.ts +3 -0
  480. package/dist/providers/resolution/none.d.ts.map +1 -0
  481. package/dist/providers/resolution/none.js +11 -0
  482. package/dist/providers/resolution/none.js.map +1 -0
  483. package/dist/providers/resolution/python-all-filter.d.ts +25 -0
  484. package/dist/providers/resolution/python-all-filter.d.ts.map +1 -0
  485. package/dist/providers/resolution/python-all-filter.js +64 -0
  486. package/dist/providers/resolution/python-all-filter.js.map +1 -0
  487. package/dist/providers/resolution/resolver-strategy.d.ts +42 -0
  488. package/dist/providers/resolution/resolver-strategy.d.ts.map +1 -0
  489. package/dist/providers/resolution/resolver-strategy.js +50 -0
  490. package/dist/providers/resolution/resolver-strategy.js.map +1 -0
  491. package/dist/providers/resolution/single-inheritance.d.ts +3 -0
  492. package/dist/providers/resolution/single-inheritance.d.ts.map +1 -0
  493. package/dist/providers/resolution/single-inheritance.js +21 -0
  494. package/dist/providers/resolution/single-inheritance.js.map +1 -0
  495. package/dist/providers/resolution/stack-graphs/__fixtures__/mock-tree.d.ts +16 -0
  496. package/dist/providers/resolution/stack-graphs/__fixtures__/mock-tree.d.ts.map +1 -0
  497. package/dist/providers/resolution/stack-graphs/__fixtures__/mock-tree.js +50 -0
  498. package/dist/providers/resolution/stack-graphs/__fixtures__/mock-tree.js.map +1 -0
  499. package/dist/providers/resolution/stack-graphs/glue.d.ts +15 -0
  500. package/dist/providers/resolution/stack-graphs/glue.d.ts.map +1 -0
  501. package/dist/providers/resolution/stack-graphs/glue.js +44 -0
  502. package/dist/providers/resolution/stack-graphs/glue.js.map +1 -0
  503. package/dist/providers/resolution/stack-graphs/node-edge-builder.d.ts +30 -0
  504. package/dist/providers/resolution/stack-graphs/node-edge-builder.d.ts.map +1 -0
  505. package/dist/providers/resolution/stack-graphs/node-edge-builder.js +366 -0
  506. package/dist/providers/resolution/stack-graphs/node-edge-builder.js.map +1 -0
  507. package/dist/providers/resolution/stack-graphs/partial-path-engine.d.ts +9 -0
  508. package/dist/providers/resolution/stack-graphs/partial-path-engine.d.ts.map +1 -0
  509. package/dist/providers/resolution/stack-graphs/partial-path-engine.js +152 -0
  510. package/dist/providers/resolution/stack-graphs/partial-path-engine.js.map +1 -0
  511. package/dist/providers/resolution/stack-graphs/rule-parser.d.ts +11 -0
  512. package/dist/providers/resolution/stack-graphs/rule-parser.d.ts.map +1 -0
  513. package/dist/providers/resolution/stack-graphs/rule-parser.js +247 -0
  514. package/dist/providers/resolution/stack-graphs/rule-parser.js.map +1 -0
  515. package/dist/providers/resolution/stack-graphs/types.d.ts +93 -0
  516. package/dist/providers/resolution/stack-graphs/types.d.ts.map +1 -0
  517. package/dist/providers/resolution/stack-graphs/types.js +11 -0
  518. package/dist/providers/resolution/stack-graphs/types.js.map +1 -0
  519. package/dist/providers/resolution/stack-graphs-python.d.ts +27 -0
  520. package/dist/providers/resolution/stack-graphs-python.d.ts.map +1 -0
  521. package/dist/providers/resolution/stack-graphs-python.js +104 -0
  522. package/dist/providers/resolution/stack-graphs-python.js.map +1 -0
  523. package/dist/providers/resolution/stack-graphs-ts.d.ts +134 -0
  524. package/dist/providers/resolution/stack-graphs-ts.d.ts.map +1 -0
  525. package/dist/providers/resolution/stack-graphs-ts.js +372 -0
  526. package/dist/providers/resolution/stack-graphs-ts.js.map +1 -0
  527. package/dist/providers/ruby.d.ts +3 -0
  528. package/dist/providers/ruby.d.ts.map +1 -0
  529. package/dist/providers/ruby.js +259 -0
  530. package/dist/providers/ruby.js.map +1 -0
  531. package/dist/providers/rust.d.ts +3 -0
  532. package/dist/providers/rust.d.ts.map +1 -0
  533. package/dist/providers/rust.js +318 -0
  534. package/dist/providers/rust.js.map +1 -0
  535. package/dist/providers/swift.d.ts +3 -0
  536. package/dist/providers/swift.d.ts.map +1 -0
  537. package/dist/providers/swift.js +177 -0
  538. package/dist/providers/swift.js.map +1 -0
  539. package/dist/providers/test-helpers.d.ts +24 -0
  540. package/dist/providers/test-helpers.d.ts.map +1 -0
  541. package/dist/providers/test-helpers.js +33 -0
  542. package/dist/providers/test-helpers.js.map +1 -0
  543. package/dist/providers/ts-shared.d.ts +30 -0
  544. package/dist/providers/ts-shared.d.ts.map +1 -0
  545. package/dist/providers/ts-shared.js +328 -0
  546. package/dist/providers/ts-shared.js.map +1 -0
  547. package/dist/providers/tsx.d.ts +7 -0
  548. package/dist/providers/tsx.d.ts.map +1 -0
  549. package/dist/providers/tsx.js +79 -0
  550. package/dist/providers/tsx.js.map +1 -0
  551. package/dist/providers/types.d.ts +166 -0
  552. package/dist/providers/types.d.ts.map +1 -0
  553. package/dist/providers/types.js +7 -0
  554. package/dist/providers/types.js.map +1 -0
  555. package/dist/providers/typescript-family-accesses.d.ts +14 -0
  556. package/dist/providers/typescript-family-accesses.d.ts.map +1 -0
  557. package/dist/providers/typescript-family-accesses.js +27 -0
  558. package/dist/providers/typescript-family-accesses.js.map +1 -0
  559. package/dist/providers/typescript.d.ts +9 -0
  560. package/dist/providers/typescript.d.ts.map +1 -0
  561. package/dist/providers/typescript.js +84 -0
  562. package/dist/providers/typescript.js.map +1 -0
  563. package/package.json +108 -0
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Default pipeline phase set — full 14-phase DAG.
3
+ *
4
+ * The runner treats this array as the canonical ordering source. Adding or
5
+ * removing a phase is a one-line change here; the DAG validator catches
6
+ * missing dependencies and cycles on the next run.
7
+ *
8
+ * Phase ordering (topologically):
9
+ * scan → profile
10
+ * → structure → markdown → parse → complexity → routes → tools →
11
+ * orm → crossFile → mro →
12
+ * communities → dead-code →
13
+ * processes → temporal → annotate
14
+ *
15
+ * `markdown` depends on `structure` and could run alongside `parse`; the
16
+ * runner serialises everything since determinism dominates the latency
17
+ * win at MVP scale. `profile` and `temporal` are pure leaves on `scan`
18
+ * and could run in parallel with any post-scan phase once the runner
19
+ * learns to fan out. `profile` emits a single ProjectProfile node that
20
+ * scanner phases will consult to decide which scanners to invoke.
21
+ */
22
+ import { accessesPhase } from "./accesses.js";
23
+ import { annotatePhase } from "./annotate.js";
24
+ import { cochangePhase } from "./cochange.js";
25
+ import { communitiesPhase } from "./communities.js";
26
+ import { complexityPhase } from "./complexity.js";
27
+ import { confidenceDemotePhase } from "./confidence-demote.js";
28
+ import { crossFilePhase } from "./cross-file.js";
29
+ import { deadCodePhase } from "./dead-code.js";
30
+ import { dependenciesPhase } from "./dependencies.js";
31
+ import { embeddingsPhase } from "./embeddings.js";
32
+ import { fetchesPhase } from "./fetches.js";
33
+ import { incrementalScopePhase } from "./incremental-scope.js";
34
+ import { markdownPhase } from "./markdown.js";
35
+ import { mroPhase } from "./mro.js";
36
+ import { openapiPhase } from "./openapi.js";
37
+ import { ormPhase } from "./orm.js";
38
+ import { ownershipPhase } from "./ownership.js";
39
+ import { parsePhase } from "./parse.js";
40
+ import { processesPhase } from "./processes.js";
41
+ import { profilePhase } from "./profile.js";
42
+ import { repoNodePhase } from "./repo-node.js";
43
+ import { riskSnapshotPhase } from "./risk-snapshot.js";
44
+ import { routesPhase } from "./routes.js";
45
+ import { sbomPhase } from "./sbom.js";
46
+ import { scanPhase } from "./scan.js";
47
+ import { scipIndexPhase } from "./scip-index.js";
48
+ import { structurePhase } from "./structure.js";
49
+ import { summarizePhase } from "./summarize.js";
50
+ import { temporalPhase } from "./temporal.js";
51
+ import { toolsPhase } from "./tools.js";
52
+ export const DEFAULT_PHASES = [
53
+ scanPhase,
54
+ profilePhase,
55
+ // `repo-node` emits one RepoNode and runs immediately after
56
+ // `profile` so it inherits the detected-languages list when deriving
57
+ // `languageStats`. It has no downstream dependents — the node is read
58
+ // from the graph by MCP tools at query time, not consumed by later phases.
59
+ repoNodePhase,
60
+ structurePhase,
61
+ markdownPhase,
62
+ parsePhase,
63
+ // incremental-scope is passive at v1.0: it consumes scan output and emits
64
+ // a closure hint for future consumers. Placed after parse so later phases
65
+ // can plumb `ctx.phaseOutputs.incremental-scope.closureFiles` once they
66
+ // learn to honour it. It has no downstream dependents today.
67
+ incrementalScopePhase,
68
+ complexityPhase,
69
+ routesPhase,
70
+ openapiPhase,
71
+ toolsPhase,
72
+ ormPhase,
73
+ crossFilePhase,
74
+ // `accesses` depends on parse (symbol boundaries + source) and cross-file
75
+ // (stable CALLS graph before we layer ACCESSES on top). Runs before
76
+ // communities so ACCESSES can participate in Leiden weights if we later
77
+ // decide to surface receiver ↔ field coupling.
78
+ accessesPhase,
79
+ // `scip-index` replaces the four per-language LSP upgrade phases.
80
+ // It runs the appropriate SCIP indexer (scip-typescript / scip-python
81
+ // / scip-go / rust-analyzer --scip / scip-java), parses the resulting
82
+ // index, and emits CodeRelation edges with confidence=1.0 and
83
+ // reason=`scip:<indexer>@<version>`. No long-running language servers,
84
+ // no stdio JSON-RPC, no per-symbol roundtrips. Runs after the
85
+ // tree-sitter heuristic tier so its oracle edges can upgrade the
86
+ // heuristic graph in-place.
87
+ scipIndexPhase,
88
+ // `confidence-demote` runs immediately after `scip-index` and before
89
+ // `mro`. It demotes any confidence-0.5 heuristic edge whose triple is
90
+ // also covered by a confidence-1.0 SCIP-sourced edge to 0.2 with a
91
+ // `+scip-unconfirmed` reason suffix.
92
+ confidenceDemotePhase,
93
+ mroPhase,
94
+ communitiesPhase,
95
+ // Dead-code classification. Depends on cross-file (for inbound
96
+ // edges), MRO (for METHOD_OVERRIDES / METHOD_IMPLEMENTS keep-alive edges),
97
+ // and communities (for ghost-community rollups). Runs before processes so
98
+ // later phases can observe `deadness` on callable nodes.
99
+ deadCodePhase,
100
+ processesPhase,
101
+ // Outbound HTTP → Route detection runs after processes so enclosing-symbol
102
+ // anchors are consistent with Process entry-point ids, and after routes so
103
+ // local Route nodes are available for matching.
104
+ fetchesPhase,
105
+ temporalPhase,
106
+ cochangePhase,
107
+ // Ownership depends on temporal (for decayedChurn / top-contributor-last-seen /
108
+ // coauthorCount), communities (to denormalise truck-factor + drift), and parse
109
+ // (for symbol boundaries). Runs once per analyse cycle so blame happens once.
110
+ ownershipPhase,
111
+ dependenciesPhase,
112
+ // `sbom` depends on `dependencies` and is a silent no-op unless
113
+ // `options.sbom === true`. When enabled, it emits
114
+ // `.codehub/sbom.cyclonedx.json` + `.codehub/sbom.spdx.json`.
115
+ sbomPhase,
116
+ annotatePhase,
117
+ // `risk-snapshot` depends on `annotate` and captures a per-community +
118
+ // findings-histogram snapshot under `.codehub/history/` for trend analysis.
119
+ // Rotation keeps the last 100 snapshots.
120
+ riskSnapshotPhase,
121
+ // `summarize` runs after every LSP phase (via its dep on
122
+ // `confidence-demote`) so trust filtering observes finalised edge
123
+ // provenance, and BEFORE `embeddings` so a future follow-up can embed
124
+ // summary text alongside the existing signature/description vectors.
125
+ // The phase is a silent no-op unless `options.summaries === true`, and
126
+ // it is a hard no-op whenever `options.offline === true`.
127
+ summarizePhase,
128
+ // `embeddings` depends on `annotate` so it observes the final graph. The
129
+ // phase is a silent no-op unless `options.embeddings === true`. Keeping it
130
+ // at the tail means downstream hashing can key embeddings to graph state.
131
+ embeddingsPhase,
132
+ ];
133
+ //# sourceMappingURL=default-set.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-set.js","sourceRoot":"","sources":["../../../src/pipeline/phases/default-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,cAA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IACZ,UAAU;IACV,QAAQ;IACR,cAAc;IACd,0EAA0E;IAC1E,oEAAoE;IACpE,wEAAwE;IACxE,+CAA+C;IAC/C,aAAa;IACb,kEAAkE;IAClE,sEAAsE;IACtE,sEAAsE;IACtE,8DAA8D;IAC9D,uEAAuE;IACvE,8DAA8D;IAC9D,iEAAiE;IACjE,4BAA4B;IAC5B,cAAc;IACd,qEAAqE;IACrE,sEAAsE;IACtE,mEAAmE;IACnE,qCAAqC;IACrC,qBAAqB;IACrB,QAAQ;IACR,gBAAgB;IAChB,+DAA+D;IAC/D,2EAA2E;IAC3E,0EAA0E;IAC1E,yDAAyD;IACzD,aAAa;IACb,cAAc;IACd,2EAA2E;IAC3E,2EAA2E;IAC3E,gDAAgD;IAChD,YAAY;IACZ,aAAa;IACb,aAAa;IACb,gFAAgF;IAChF,+EAA+E;IAC/E,8EAA8E;IAC9E,cAAc;IACd,iBAAiB;IACjB,gEAAgE;IAChE,kDAAkD;IAClD,8DAA8D;IAC9D,SAAS;IACT,aAAa;IACb,uEAAuE;IACvE,4EAA4E;IAC5E,yCAAyC;IACzC,iBAAiB;IACjB,yDAAyD;IACzD,kEAAkE;IAClE,sEAAsE;IACtE,qEAAqE;IACrE,uEAAuE;IACvE,0DAA0D;IAC1D,cAAc;IACd,yEAAyE;IACzE,2EAA2E;IAC3E,0EAA0E;IAC1E,eAAe;CAChB,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Dependencies phase — materialises external packages as Dependency
3
+ * nodes and links them to the manifest File node via DEPENDS_ON.
4
+ *
5
+ * Inputs: scan output (file list). We classify every scanned file by
6
+ * basename (optionally extension) and dispatch to a per-ecosystem parser
7
+ * (see `../dep-parsers/`). Each parser returns a list of
8
+ * `ParsedDependency` tuples; the phase promotes them to `DependencyNode`
9
+ * entries with the canonical id scheme
10
+ *
11
+ * `Dependency:${ecosystem}:${name}@${version}`
12
+ *
13
+ * and adds DEPENDS_ON edges:
14
+ *
15
+ * File(manifestPath) --DEPENDS_ON--> Dependency(...)
16
+ *
17
+ * This is intentionally coarse — v1.0 emits one DEPENDS_ON per
18
+ * (manifest, dep) rather than per-importing-source-file. A later pass
19
+ * can refine this to per-file once the parse phase exposes package
20
+ * resolution data.
21
+ *
22
+ * Determinism:
23
+ * - Manifests visited in scan order (scan output is already sorted).
24
+ * - Dependencies sorted canonically by
25
+ * (ecosystem, name, version, lockfileSource) before graph insertion.
26
+ * - `skippedEcosystems` output is sorted ascending.
27
+ *
28
+ * The phase is tolerant: any parser error becomes a warning and the
29
+ * offending manifest is skipped. Network access is forbidden.
30
+ *
31
+ * Phase dependency: `scan`. The phase is designed to eventually also
32
+ * depend on the ProjectProfile phase — we only need the scan output
33
+ * today, and the profile phase does not yet exist in default-set.
34
+ */
35
+ import { type Ecosystem, type ParseDepsFn } from "../dep-parsers/index.js";
36
+ import type { PipelinePhase } from "../types.js";
37
+ export declare const DEPENDENCIES_PHASE_NAME: "dependencies";
38
+ export interface DependenciesOutput {
39
+ readonly dependenciesEmitted: number;
40
+ readonly manifestsScanned: number;
41
+ /** Ecosystems with no discovered manifests (alphabetical). */
42
+ readonly skippedEcosystems: readonly Ecosystem[];
43
+ }
44
+ interface ManifestDispatch {
45
+ readonly ecosystem: Ecosystem;
46
+ readonly parse: ParseDepsFn;
47
+ }
48
+ /**
49
+ * Classify a scanned file by its basename + extension to decide which
50
+ * ecosystem parser should receive it. Order of checks matters: `go.mod`
51
+ * and `go.sum` must beat a generic `.mod` / `.sum` rule that does not
52
+ * exist (we are explicit to stay deterministic).
53
+ *
54
+ * Returns `undefined` for files we don't care about.
55
+ */
56
+ export declare function classifyManifest(relPath: string): ManifestDispatch | undefined;
57
+ export declare const dependenciesPhase: PipelinePhase<DependenciesOutput>;
58
+ export {};
59
+ //# sourceMappingURL=dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../src/pipeline/phases/dependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,uBAAuB,EAAG,cAAuB,CAAC;AAE/D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,SAAS,SAAS,EAAE,CAAC;CAClD;AAED,UAAU,gBAAgB;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAqD9E;AAED,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,kBAAkB,CAc/D,CAAC"}
@@ -0,0 +1,281 @@
1
+ /**
2
+ * Dependencies phase — materialises external packages as Dependency
3
+ * nodes and links them to the manifest File node via DEPENDS_ON.
4
+ *
5
+ * Inputs: scan output (file list). We classify every scanned file by
6
+ * basename (optionally extension) and dispatch to a per-ecosystem parser
7
+ * (see `../dep-parsers/`). Each parser returns a list of
8
+ * `ParsedDependency` tuples; the phase promotes them to `DependencyNode`
9
+ * entries with the canonical id scheme
10
+ *
11
+ * `Dependency:${ecosystem}:${name}@${version}`
12
+ *
13
+ * and adds DEPENDS_ON edges:
14
+ *
15
+ * File(manifestPath) --DEPENDS_ON--> Dependency(...)
16
+ *
17
+ * This is intentionally coarse — v1.0 emits one DEPENDS_ON per
18
+ * (manifest, dep) rather than per-importing-source-file. A later pass
19
+ * can refine this to per-file once the parse phase exposes package
20
+ * resolution data.
21
+ *
22
+ * Determinism:
23
+ * - Manifests visited in scan order (scan output is already sorted).
24
+ * - Dependencies sorted canonically by
25
+ * (ecosystem, name, version, lockfileSource) before graph insertion.
26
+ * - `skippedEcosystems` output is sorted ascending.
27
+ *
28
+ * The phase is tolerant: any parser error becomes a warning and the
29
+ * offending manifest is skipped. Network access is forbidden.
30
+ *
31
+ * Phase dependency: `scan`. The phase is designed to eventually also
32
+ * depend on the ProjectProfile phase — we only need the scan output
33
+ * today, and the profile phase does not yet exist in default-set.
34
+ */
35
+ import { makeNodeId } from "@opencodehub/core-types";
36
+ import { parseGoDeps } from "../dep-parsers/go.js";
37
+ import { compareParsedDependency, dedupAndSort, } from "../dep-parsers/index.js";
38
+ import { parseMavenDeps } from "../dep-parsers/maven.js";
39
+ import { parseNpmDeps } from "../dep-parsers/npm.js";
40
+ import { parseNugetDeps } from "../dep-parsers/nuget.js";
41
+ import { parsePythonDeps } from "../dep-parsers/python.js";
42
+ import { parseRustDeps } from "../dep-parsers/rust.js";
43
+ import { PROFILE_PHASE_NAME } from "./profile.js";
44
+ import { SCAN_PHASE_NAME } from "./scan.js";
45
+ export const DEPENDENCIES_PHASE_NAME = "dependencies";
46
+ /**
47
+ * Classify a scanned file by its basename + extension to decide which
48
+ * ecosystem parser should receive it. Order of checks matters: `go.mod`
49
+ * and `go.sum` must beat a generic `.mod` / `.sum` rule that does not
50
+ * exist (we are explicit to stay deterministic).
51
+ *
52
+ * Returns `undefined` for files we don't care about.
53
+ */
54
+ export function classifyManifest(relPath) {
55
+ // Use forward-slash splitting; scan emits POSIX paths.
56
+ const parts = relPath.split("/");
57
+ const basename = parts[parts.length - 1] ?? relPath;
58
+ // npm
59
+ if (basename === "package-lock.json" || basename === "pnpm-lock.yaml") {
60
+ return { ecosystem: "npm", parse: parseNpmDeps };
61
+ }
62
+ // Bare package.json (lockfile preferred when both are present — we
63
+ // handle that at the phase level by skipping package.json when a
64
+ // sibling lockfile is in the manifest set).
65
+ if (basename === "package.json") {
66
+ return { ecosystem: "npm", parse: parseNpmDeps };
67
+ }
68
+ // python
69
+ if (basename === "pyproject.toml") {
70
+ return { ecosystem: "pypi", parse: parsePythonDeps };
71
+ }
72
+ if (basename === "uv.lock") {
73
+ return { ecosystem: "pypi", parse: parsePythonDeps };
74
+ }
75
+ if (basename === "requirements.txt" || /^requirements-.*\.txt$/.test(basename)) {
76
+ return { ecosystem: "pypi", parse: parsePythonDeps };
77
+ }
78
+ // go
79
+ if (basename === "go.mod" || basename === "go.sum") {
80
+ return { ecosystem: "go", parse: parseGoDeps };
81
+ }
82
+ // rust
83
+ if (basename === "Cargo.lock" || basename === "Cargo.toml") {
84
+ return { ecosystem: "cargo", parse: parseRustDeps };
85
+ }
86
+ // maven
87
+ if (basename === "pom.xml") {
88
+ return { ecosystem: "maven", parse: parseMavenDeps };
89
+ }
90
+ // nuget
91
+ if (basename === "packages.lock.json" ||
92
+ basename.endsWith(".csproj") ||
93
+ basename.endsWith(".fsproj") ||
94
+ basename.endsWith(".vbproj")) {
95
+ return { ecosystem: "nuget", parse: parseNugetDeps };
96
+ }
97
+ return undefined;
98
+ }
99
+ export const dependenciesPhase = {
100
+ name: DEPENDENCIES_PHASE_NAME,
101
+ // Depends on `profile` so we only classify manifests the profile phase
102
+ // already vetted — and so the dependency phase runs strictly after
103
+ // ProjectProfile (this guarantees profile-driven ecosystem gating when
104
+ // the profile's manifest list becomes a hard filter in v1.1).
105
+ deps: [SCAN_PHASE_NAME, PROFILE_PHASE_NAME],
106
+ async run(ctx) {
107
+ const scan = ctx.phaseOutputs.get(SCAN_PHASE_NAME);
108
+ if (scan === undefined) {
109
+ throw new Error("dependencies: scan output missing from phase outputs");
110
+ }
111
+ return runDependencies(ctx, scan);
112
+ },
113
+ };
114
+ async function runDependencies(ctx, scan) {
115
+ const classified = selectManifests(scan.files);
116
+ const ecoWithDeps = new Set();
117
+ const allParsed = [];
118
+ let manifestsScanned = 0;
119
+ for (const entry of classified) {
120
+ manifestsScanned += 1;
121
+ const deps = await entry.dispatch.parse({
122
+ absPath: entry.file.absPath,
123
+ relPath: entry.file.relPath,
124
+ repoRoot: ctx.repoPath,
125
+ onWarn: (m) => {
126
+ ctx.onProgress?.({
127
+ phase: DEPENDENCIES_PHASE_NAME,
128
+ kind: "warn",
129
+ message: m,
130
+ });
131
+ },
132
+ });
133
+ for (const d of deps) {
134
+ allParsed.push(d);
135
+ ecoWithDeps.add(d.ecosystem);
136
+ }
137
+ }
138
+ // Dedup + canonical sort before emitting nodes/edges. Two manifests in
139
+ // the same repo (e.g. package.json + package-lock.json) will typically
140
+ // yield overlapping sets; dedup on
141
+ // (ecosystem, name, version, lockfileSource) retains both sources'
142
+ // edges while keeping a single node per coordinate.
143
+ const deduped = dedupAndSort(allParsed);
144
+ // Build Dependency nodes (one node per (ecosystem, name, version)
145
+ // coordinate — lockfileSource is *not* part of node identity, but
146
+ // remembered on the node via `lockfileSource` field using the first
147
+ // source encountered in canonical order).
148
+ const nodeById = new Map();
149
+ for (const d of deduped) {
150
+ const id = depNodeId(d.ecosystem, d.name, d.version);
151
+ const license = normalizeLicenseField(d.license);
152
+ const existing = nodeById.get(id);
153
+ if (existing === undefined) {
154
+ const node = {
155
+ id,
156
+ kind: "Dependency",
157
+ name: d.name,
158
+ filePath: d.lockfileSource,
159
+ version: d.version,
160
+ ecosystem: d.ecosystem,
161
+ lockfileSource: d.lockfileSource,
162
+ license,
163
+ };
164
+ nodeById.set(id, node);
165
+ }
166
+ else if (existing.license === "UNKNOWN" && license !== "UNKNOWN") {
167
+ // Upgrade UNKNOWN when a later source for the same coordinate
168
+ // carries a real license.
169
+ nodeById.set(id, { ...existing, license });
170
+ }
171
+ }
172
+ // Insert into graph in canonical order for byte-stable hashing.
173
+ const nodes = [...nodeById.values()].sort(compareNodeByIdString);
174
+ for (const n of nodes) {
175
+ ctx.graph.addNode(n);
176
+ }
177
+ // DEPENDS_ON edges: File(manifestPath) --> Dependency(...).
178
+ // Emit each edge at most once (same manifest referencing the same dep
179
+ // across npm's package.json + package-lock.json would otherwise double).
180
+ emitDependencyEdges(ctx.graph, deduped);
181
+ const dependenciesEmitted = nodeById.size;
182
+ const ALL_ECOS = ["npm", "pypi", "go", "cargo", "maven", "nuget"];
183
+ const skippedEcosystems = ALL_ECOS.filter((e) => !ecoWithDeps.has(e)).sort();
184
+ return {
185
+ dependenciesEmitted,
186
+ manifestsScanned,
187
+ skippedEcosystems,
188
+ };
189
+ }
190
+ /**
191
+ * Walk the scan file list and pick the manifests we know how to parse.
192
+ * npm has a prefer-lockfile rule: if a directory has
193
+ * `package-lock.json`, we skip the sibling `package.json` to avoid
194
+ * emitting two versions for the same tree (one specifier string, one
195
+ * resolved version). Same for `pnpm-lock.yaml`.
196
+ */
197
+ function selectManifests(files) {
198
+ // Index of directory -> set of basenames (used for the prefer-lockfile rule).
199
+ const dirBasenames = new Map();
200
+ for (const f of files) {
201
+ const slash = f.relPath.lastIndexOf("/");
202
+ const dir = slash === -1 ? "" : f.relPath.slice(0, slash);
203
+ const base = slash === -1 ? f.relPath : f.relPath.slice(slash + 1);
204
+ let set = dirBasenames.get(dir);
205
+ if (!set) {
206
+ set = new Set();
207
+ dirBasenames.set(dir, set);
208
+ }
209
+ set.add(base);
210
+ }
211
+ const out = [];
212
+ for (const f of files) {
213
+ const dispatch = classifyManifest(f.relPath);
214
+ if (!dispatch)
215
+ continue;
216
+ const slash = f.relPath.lastIndexOf("/");
217
+ const dir = slash === -1 ? "" : f.relPath.slice(0, slash);
218
+ const basename = slash === -1 ? f.relPath : f.relPath.slice(slash + 1);
219
+ if (basename === "package.json") {
220
+ const sib = dirBasenames.get(dir);
221
+ if (sib && (sib.has("package-lock.json") || sib.has("pnpm-lock.yaml"))) {
222
+ continue;
223
+ }
224
+ }
225
+ if (basename === "Cargo.toml") {
226
+ const sib = dirBasenames.get(dir);
227
+ if (sib?.has("Cargo.lock"))
228
+ continue;
229
+ }
230
+ if (basename === "go.mod") {
231
+ // Prefer go.sum when present; it enumerates transitives explicitly
232
+ // and dedups to the exact module graph.
233
+ const sib = dirBasenames.get(dir);
234
+ if (sib?.has("go.sum"))
235
+ continue;
236
+ }
237
+ out.push({ file: f, dispatch });
238
+ }
239
+ return out;
240
+ }
241
+ function emitDependencyEdges(graph, deps) {
242
+ // Sorted insertion matches the pre-dedup sort; confidence is a fixed
243
+ // 1.0 because a lockfile is authoritative evidence of dependence.
244
+ const sorted = [...deps].sort(compareParsedDependency);
245
+ for (const d of sorted) {
246
+ const fileId = makeNodeId("File", d.lockfileSource, d.lockfileSource);
247
+ const depId = depNodeId(d.ecosystem, d.name, d.version);
248
+ graph.addEdge({
249
+ from: fileId,
250
+ to: depId,
251
+ type: "DEPENDS_ON",
252
+ confidence: 1.0,
253
+ reason: `manifest:${d.ecosystem}`,
254
+ });
255
+ }
256
+ }
257
+ function depNodeId(ecosystem, name, version) {
258
+ return makeNodeId("Dependency", ecosystem, `${name}@${version}`);
259
+ }
260
+ function compareNodeByIdString(a, b) {
261
+ const av = a.id;
262
+ const bv = b.id;
263
+ if (av === bv)
264
+ return 0;
265
+ return av < bv ? -1 : 1;
266
+ }
267
+ /**
268
+ * Normalize a parser-supplied license value onto the DependencyNode.
269
+ * Drops empty strings, collapses to `"UNKNOWN"` when the parser did not
270
+ * find one, and leaves SPDX-normalisation to downstream callers that
271
+ * need it (the `license_audit` tool does its own pass).
272
+ */
273
+ function normalizeLicenseField(raw) {
274
+ if (raw === undefined)
275
+ return "UNKNOWN";
276
+ const trimmed = raw.trim();
277
+ if (trimmed.length === 0)
278
+ return "UNKNOWN";
279
+ return trimmed;
280
+ }
281
+ //# sourceMappingURL=dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/pipeline/phases/dependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC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,CAAiB;IACjE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAY,CAAC;IAC1B,MAAM,EAAE,GAAG,CAAC,CAAC,EAAY,CAAC;IAC1B,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,CAAC,CAAC;IACxB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,SAAS,qBAAqB,CAAC,GAAuB;IACpD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Worker-pool `Embedder` facade.
3
+ *
4
+ * Wraps a Piscina pool of OnnxEmbedder workers behind the same
5
+ * `{ embed, embedBatch, close }` surface the embeddings phase already
6
+ * consumes. Each worker holds its own OnnxEmbedder; tasks are partitioned
7
+ * by batch index so repeat runs visit the same work → same worker
8
+ * assignment for a fixed pool size, preserving byte-identical output.
9
+ *
10
+ * Determinism note: the underlying ONNX session pins all thread counts to 1
11
+ * and disables graph optimization, so a given input text produces the same
12
+ * vector regardless of *which* worker computes it. The ordering guarantee
13
+ * here is belt-and-braces: we reassemble results in input order before
14
+ * returning.
15
+ */
16
+ import type { Embedder } from "@opencodehub/embedder";
17
+ export interface EmbedderPoolOptions {
18
+ readonly workers: number;
19
+ readonly variant: "fp32" | "int8";
20
+ readonly modelDir?: string;
21
+ }
22
+ /**
23
+ * Open a worker-pool-backed embedder. Caller must invoke `close()` when
24
+ * done; that tears the pool down.
25
+ *
26
+ * The pool is sized with `minThreads === maxThreads === workers` so worker
27
+ * allocation is stable across a run. Workers lazy-load their OnnxEmbedder
28
+ * on first task, so pool construction itself is cheap.
29
+ */
30
+ export declare function openOnnxEmbedderPool(opts: EmbedderPoolOptions): Embedder;
31
+ //# sourceMappingURL=embedder-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedder-pool.d.ts","sourceRoot":"","sources":["../../../src/pipeline/phases/embedder-pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,GAAG,QAAQ,CAgDxE"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Worker-pool `Embedder` facade.
3
+ *
4
+ * Wraps a Piscina pool of OnnxEmbedder workers behind the same
5
+ * `{ embed, embedBatch, close }` surface the embeddings phase already
6
+ * consumes. Each worker holds its own OnnxEmbedder; tasks are partitioned
7
+ * by batch index so repeat runs visit the same work → same worker
8
+ * assignment for a fixed pool size, preserving byte-identical output.
9
+ *
10
+ * Determinism note: the underlying ONNX session pins all thread counts to 1
11
+ * and disables graph optimization, so a given input text produces the same
12
+ * vector regardless of *which* worker computes it. The ordering guarantee
13
+ * here is belt-and-braces: we reassemble results in input order before
14
+ * returning.
15
+ */
16
+ import { fileURLToPath } from "node:url";
17
+ import { embedderModelId } from "@opencodehub/embedder";
18
+ import { Piscina } from "piscina";
19
+ const WORKER_FILENAME = fileURLToPath(new URL("./embedder-worker.js", import.meta.url));
20
+ /**
21
+ * Open a worker-pool-backed embedder. Caller must invoke `close()` when
22
+ * done; that tears the pool down.
23
+ *
24
+ * The pool is sized with `minThreads === maxThreads === workers` so worker
25
+ * allocation is stable across a run. Workers lazy-load their OnnxEmbedder
26
+ * on first task, so pool construction itself is cheap.
27
+ */
28
+ export function openOnnxEmbedderPool(opts) {
29
+ const workerData = {
30
+ variant: opts.variant,
31
+ };
32
+ if (opts.modelDir !== undefined)
33
+ workerData.modelDir = opts.modelDir;
34
+ const pool = new Piscina({
35
+ filename: WORKER_FILENAME,
36
+ minThreads: opts.workers,
37
+ maxThreads: opts.workers,
38
+ // Each worker owns an ~300 MB ONNX session; don't recycle on idle.
39
+ idleTimeout: Number.POSITIVE_INFINITY,
40
+ workerData,
41
+ });
42
+ let closed = false;
43
+ const dim = 768; // gte-modernbert-base — matches OnnxEmbedder's EMBED_DIM.
44
+ async function embedBatch(texts) {
45
+ if (closed)
46
+ throw new Error("Embedder pool is closed");
47
+ if (texts.length === 0)
48
+ return [];
49
+ const result = await pool.run({ texts: [...texts] });
50
+ if (result.count === 0)
51
+ return [];
52
+ const flat = new Float32Array(result.buffer);
53
+ const out = [];
54
+ for (let i = 0; i < result.count; i++) {
55
+ // Slice copies into a fresh, non-shared Float32Array so callers can
56
+ // hang onto each vector independently of the transport buffer.
57
+ out.push(flat.slice(i * result.dim, (i + 1) * result.dim));
58
+ }
59
+ return out;
60
+ }
61
+ return {
62
+ dim,
63
+ modelId: embedderModelId(opts.variant),
64
+ async embed(text) {
65
+ const [vec] = await embedBatch([text]);
66
+ if (vec === undefined)
67
+ throw new Error("embedBatch returned empty result");
68
+ return vec;
69
+ },
70
+ embedBatch,
71
+ async close() {
72
+ if (closed)
73
+ return;
74
+ closed = true;
75
+ await pool.destroy();
76
+ },
77
+ };
78
+ }
79
+ //# sourceMappingURL=embedder-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedder-pool.js","sourceRoot":"","sources":["../../../src/pipeline/phases/embedder-pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAA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AAG,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,oEAAoE;YACpE,+DAA+D;YAC/D,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO;QACL,GAAG;QACH,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC;QACtC,KAAK,CAAC,KAAK,CAAC,IAAY;YACtB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACvC,IAAI,GAAG,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAC3E,OAAO,GAAG,CAAC;QACb,CAAC;QACD,UAAU;QACV,KAAK,CAAC,KAAK;YACT,IAAI,MAAM;gBAAE,OAAO;YACnB,MAAM,GAAG,IAAI,CAAC;YACd,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Piscina worker entry point for the embeddings phase.
3
+ *
4
+ * Each worker lazy-opens its own OnnxEmbedder on first task and caches it for
5
+ * the lifetime of the worker. Tasks carry a flat list of chunk texts; the
6
+ * worker returns the vectors in input order.
7
+ *
8
+ * Determinism contract: `openOnnxEmbedder()` pins intraOpNumThreads=1,
9
+ * interOpNumThreads=1, and graphOptimizationLevel="disabled" — the same
10
+ * input produces byte-identical output regardless of which worker processed
11
+ * it. Callers partition work deterministically (block-chunked by batch
12
+ * index) so repeat runs reproduce the same byte-level output.
13
+ */
14
+ export interface EmbedBatchTask {
15
+ readonly texts: readonly string[];
16
+ }
17
+ export interface EmbedBatchResult {
18
+ /**
19
+ * Flat binary payload of `texts.length * dim` float32 values, laid out as
20
+ * `[vec0, vec1, ...]`. Shipping a single ArrayBuffer avoids the per-vector
21
+ * structured-clone overhead when batches are large.
22
+ */
23
+ readonly buffer: ArrayBuffer;
24
+ readonly dim: number;
25
+ readonly count: number;
26
+ }
27
+ export default function embedBatch(task: EmbedBatchTask): Promise<EmbedBatchResult>;
28
+ //# sourceMappingURL=embedder-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedder-worker.d.ts","sourceRoot":"","sources":["../../../src/pipeline/phases/embedder-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAWH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAeD,wBAA8B,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAcxF"}