scip-query 0.19.1 → 0.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +18 -2
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-FHLYJVXF.js → chunk-25LPM4DG.js} +2 -2
  5. package/dist/chunk-2CTX5CMX.js +4 -0
  6. package/dist/chunk-2Y373BDD.js +2 -0
  7. package/dist/{chunk-24ET4VLC.js → chunk-2YU7I3QO.js} +2 -2
  8. package/dist/{chunk-63P42UR6.js → chunk-3MJ5YA4Y.js} +2 -2
  9. package/dist/{chunk-ZNK6K3LB.js → chunk-3SVWW4PN.js} +2 -2
  10. package/dist/{chunk-WWCZCH7W.js → chunk-4333ETTV.js} +2 -2
  11. package/dist/{chunk-Q2WEWIKX.js → chunk-4RSI5EMG.js} +2 -2
  12. package/dist/{chunk-CIYUFF24.js → chunk-4SALD7RU.js} +2 -2
  13. package/dist/{chunk-DCDOGW32.js → chunk-4T3LTWUS.js} +2 -2
  14. package/dist/{chunk-34MLC6UI.js → chunk-4XTA5OMB.js} +2 -2
  15. package/dist/chunk-52ZYCAEO.js +2 -0
  16. package/dist/{chunk-SJ6XSCG7.js → chunk-54HA4ZXH.js} +2 -2
  17. package/dist/{chunk-J4MYRIYT.js → chunk-64RFXJT5.js} +2 -2
  18. package/dist/{chunk-FUFNRZFJ.js → chunk-6E7UTQY7.js} +2 -2
  19. package/dist/{chunk-PNESKY2Z.js → chunk-6NSFJYRC.js} +2 -2
  20. package/dist/{chunk-AOSFSYEA.js → chunk-7B3UPBVA.js} +2 -2
  21. package/dist/{chunk-XCPE3G75.js → chunk-7GXM52MI.js} +2 -2
  22. package/dist/{chunk-6O5JOS7T.js → chunk-A2EZV2UM.js} +2 -2
  23. package/dist/{chunk-4BU54UJG.js → chunk-ABMYA4TN.js} +2 -2
  24. package/dist/{chunk-64QITTX7.js → chunk-B5NLK2B3.js} +2 -2
  25. package/dist/{chunk-OLG2YPLS.js → chunk-BTEE5NZQ.js} +2 -2
  26. package/dist/{chunk-MP43RX4O.js → chunk-C7NIYIQ4.js} +1 -1
  27. package/dist/{chunk-AEM24WSF.js → chunk-CFMXJPHH.js} +2 -2
  28. package/dist/{chunk-JJZRS2OP.js → chunk-CNKAGUPL.js} +2 -2
  29. package/dist/{chunk-MQ2B33LQ.js → chunk-D4U5Q3FT.js} +2 -2
  30. package/dist/{chunk-YZXV3CU3.js → chunk-DGAGY7RJ.js} +1 -1
  31. package/dist/{chunk-FRXB74RQ.js → chunk-DLWR3NUU.js} +5 -5
  32. package/dist/{chunk-YGQBJUS6.js → chunk-DZ74OMG6.js} +2 -2
  33. package/dist/{chunk-APLNTJPJ.js → chunk-EOOJGLDU.js} +2 -2
  34. package/dist/{chunk-TYEGFDOP.js → chunk-F6O7AAC3.js} +2 -2
  35. package/dist/{chunk-HFBNIIZX.js → chunk-FECYOO5O.js} +2 -2
  36. package/dist/{chunk-V7J4A3AH.js → chunk-FWUUZTIO.js} +2 -2
  37. package/dist/{chunk-KMOMNTB4.js → chunk-GBQ5NYPR.js} +2 -2
  38. package/dist/{chunk-JBZXJXIS.js → chunk-GPBBJ5Y4.js} +2 -2
  39. package/dist/{chunk-OOUJBAKJ.js → chunk-H7UKLTWJ.js} +2 -2
  40. package/dist/{chunk-YILKXTIY.js → chunk-HEXVUYFQ.js} +2 -2
  41. package/dist/{chunk-J5XJWCB3.js → chunk-HKEHS2AS.js} +2 -2
  42. package/dist/{chunk-5TEUKVSM.js → chunk-I5AWSI2G.js} +2 -2
  43. package/dist/{chunk-XYBNOILR.js → chunk-I5RJM53C.js} +2 -2
  44. package/dist/{chunk-WCZAABYF.js → chunk-IG7N5ZIK.js} +2 -2
  45. package/dist/{chunk-C3KCSAQ4.js → chunk-IUFDSKGG.js} +2 -2
  46. package/dist/{chunk-OQ6TCHBB.js → chunk-IZKFSVBV.js} +2 -2
  47. package/dist/{chunk-5OZCNAVM.js → chunk-J77UIT3I.js} +2 -2
  48. package/dist/{chunk-B2WQKQKP.js → chunk-K2ERX4UT.js} +2 -2
  49. package/dist/{chunk-PYMZU5EG.js → chunk-KP6XRY5Z.js} +2 -2
  50. package/dist/{chunk-FC5K7T35.js → chunk-L7SPDE73.js} +1 -1
  51. package/dist/{chunk-DZXFZAZO.js → chunk-LBMJEAEW.js} +2 -2
  52. package/dist/chunk-LHMNRHGV.js +3 -0
  53. package/dist/{chunk-CKFMZE77.js → chunk-M7AIS73L.js} +2 -2
  54. package/dist/{chunk-53SUJOJA.js → chunk-M7MTH5NR.js} +2 -2
  55. package/dist/{chunk-6PKO2TNZ.js → chunk-MITTUCEH.js} +2 -2
  56. package/dist/chunk-MSWVMDAH.js +122 -0
  57. package/dist/chunk-NH5ALKPW.js +2 -0
  58. package/dist/{chunk-3WLRW5TC.js → chunk-NPKYOIFM.js} +3 -3
  59. package/dist/{chunk-GIHVWNKQ.js → chunk-NRCXJDHL.js} +2 -2
  60. package/dist/{chunk-5GOBZI34.js → chunk-NSS46APD.js} +2 -2
  61. package/dist/{chunk-HCS5LB6U.js → chunk-NZL2DBT7.js} +2 -2
  62. package/dist/{chunk-SYGAA54M.js → chunk-OMPZHGHO.js} +2 -2
  63. package/dist/{chunk-AGTATREV.js → chunk-P2PC2WGR.js} +2 -2
  64. package/dist/{chunk-CAKPEQZB.js → chunk-Q3AFUTGB.js} +2 -2
  65. package/dist/{chunk-ZJGZCBYT.js → chunk-Q4IIEGXJ.js} +2 -2
  66. package/dist/chunk-QDV6RDCP.js +4 -0
  67. package/dist/{chunk-FTRNGQGR.js → chunk-QGXBRIM5.js} +2 -2
  68. package/dist/{chunk-WXVGNFAO.js → chunk-QOKYJ33H.js} +1 -1
  69. package/dist/{chunk-FB6IKAKZ.js → chunk-QRGV2F7L.js} +2 -2
  70. package/dist/chunk-QVWS2VWZ.js +7 -0
  71. package/dist/{chunk-DFQNE73Y.js → chunk-R4FQGQ4X.js} +2 -2
  72. package/dist/{chunk-4CZJ4YJB.js → chunk-RV2FQIX3.js} +2 -2
  73. package/dist/{chunk-4FMT4HPC.js → chunk-S44IULR6.js} +2 -2
  74. package/dist/{chunk-LQUDSHLB.js → chunk-SOAT6NLA.js} +2 -2
  75. package/dist/{chunk-QHKXGMOI.js → chunk-STOL2BTL.js} +2 -2
  76. package/dist/chunk-SVLTAG5O.js +927 -0
  77. package/dist/{chunk-2WCXKANA.js → chunk-U6WNH5GC.js} +2 -2
  78. package/dist/chunk-U7DSEKOM.js +30 -0
  79. package/dist/{chunk-KMUFGAIK.js → chunk-UKZBVX4U.js} +2 -2
  80. package/dist/chunk-UOAV44HR.js +38 -0
  81. package/dist/chunk-V27BEQJN.js +7 -0
  82. package/dist/{chunk-VIKEPD4D.js → chunk-VGRICIQI.js} +2 -2
  83. package/dist/chunk-VMNZB6WI.js +4 -0
  84. package/dist/{chunk-LF5CIKWZ.js → chunk-VTKGCT3V.js} +5 -5
  85. package/dist/{chunk-WFRET75Z.js → chunk-VXQNNXJE.js} +2 -2
  86. package/dist/{chunk-V5WBVF6K.js → chunk-WER3B7MI.js} +2 -2
  87. package/dist/{chunk-SSXEYWN3.js → chunk-WQTAC523.js} +2 -2
  88. package/dist/{chunk-GAE7WCBK.js → chunk-X6D5IC6I.js} +2 -2
  89. package/dist/{chunk-FBUNGRKI.js → chunk-XLTP42QA.js} +2 -2
  90. package/dist/chunk-XTX6QHOF.js +4 -0
  91. package/dist/{chunk-AYRHVJXW.js → chunk-XYADIZHU.js} +5 -5
  92. package/dist/{chunk-WAU7HVDI.js → chunk-YGAGTIDK.js} +2 -2
  93. package/dist/{chunk-BMTBVMA3.js → chunk-YIJ7ZAA4.js} +3 -3
  94. package/dist/{chunk-BBBKPOIT.js → chunk-YNRNA5LK.js} +2 -2
  95. package/dist/{chunk-BCMOTIB6.js → chunk-YVVCVR2L.js} +2 -2
  96. package/dist/{chunk-RPEA7P5Z.js → chunk-ZAIILQNP.js} +3 -3
  97. package/dist/{chunk-7SGOWD2Y.js → chunk-ZGZUZ7XE.js} +2 -2
  98. package/dist/{chunk-YCSTKIYU.js → chunk-ZXJYMGD3.js} +2 -2
  99. package/dist/cli.js +2 -2
  100. package/dist/{command-descriptors-3EJHQLQZ.js → command-descriptors-MFU4BCJ7.js} +174 -167
  101. package/dist/{config-types-BA3xLCfG.d.ts → config-types-D20KuvvZ.d.ts} +67 -0
  102. package/dist/{db-CzA-9_rL.d.ts → db-G_II8yXU.d.ts} +1 -1
  103. package/dist/diff-gate-types-C9BoYwYD.d.ts +10 -0
  104. package/dist/direct-navigation-MRMQFIRB.js +3 -0
  105. package/dist/{health-DYy13GAe.d.ts → health-oblXYgkF.d.ts} +1 -1
  106. package/dist/index.d.ts +2 -2
  107. package/dist/index.js +1 -1
  108. package/dist/queries/affected.d.ts +2 -2
  109. package/dist/queries/affected.js +1 -1
  110. package/dist/queries/architecture.d.ts +86 -4
  111. package/dist/queries/architecture.js +1 -1
  112. package/dist/queries/bottlenecks.d.ts +2 -2
  113. package/dist/queries/bottlenecks.js +1 -1
  114. package/dist/queries/by-kind.d.ts +2 -2
  115. package/dist/queries/by-kind.js +1 -1
  116. package/dist/queries/call-graph.d.ts +2 -2
  117. package/dist/queries/call-graph.js +1 -1
  118. package/dist/queries/change-surface.d.ts +2 -2
  119. package/dist/queries/change-surface.js +1 -1
  120. package/dist/queries/cleanup-plan.d.ts +2 -2
  121. package/dist/queries/cleanup-plan.js +1 -1
  122. package/dist/queries/co-change.d.ts +2 -2
  123. package/dist/queries/co-change.js +1 -1
  124. package/dist/queries/code.d.ts +2 -2
  125. package/dist/queries/code.js +1 -1
  126. package/dist/queries/complexity-hotspots.d.ts +2 -2
  127. package/dist/queries/complexity-hotspots.js +1 -1
  128. package/dist/queries/complexity.d.ts +2 -2
  129. package/dist/queries/complexity.js +1 -1
  130. package/dist/queries/convergence.d.ts +2 -2
  131. package/dist/queries/convergence.js +1 -1
  132. package/dist/queries/coupling.d.ts +2 -2
  133. package/dist/queries/coupling.js +1 -1
  134. package/dist/queries/cycles.d.ts +2 -2
  135. package/dist/queries/cycles.js +1 -1
  136. package/dist/queries/dataflow.d.ts +2 -2
  137. package/dist/queries/dataflow.js +1 -1
  138. package/dist/queries/dead.d.ts +2 -2
  139. package/dist/queries/dead.js +1 -1
  140. package/dist/queries/decorative-checkers.d.ts +2 -2
  141. package/dist/queries/decorative-checkers.js +1 -1
  142. package/dist/queries/deep-chains.d.ts +2 -2
  143. package/dist/queries/deep-chains.js +1 -1
  144. package/dist/queries/deps.d.ts +2 -2
  145. package/dist/queries/deps.js +1 -1
  146. package/dist/queries/diff-gate.d.ts +3 -3
  147. package/dist/queries/diff-gate.js +1 -1
  148. package/dist/queries/diff-impact.d.ts +4 -8
  149. package/dist/queries/diff-impact.js +1 -1
  150. package/dist/queries/doc-drift.d.ts +3 -3
  151. package/dist/queries/doc-drift.js +1 -1
  152. package/dist/queries/drift.d.ts +2 -2
  153. package/dist/queries/drift.js +1 -1
  154. package/dist/queries/duplicate-bodies.d.ts +2 -2
  155. package/dist/queries/duplicate-bodies.js +1 -1
  156. package/dist/queries/extract-candidates.d.ts +2 -2
  157. package/dist/queries/extract-candidates.js +1 -1
  158. package/dist/queries/fan.d.ts +2 -2
  159. package/dist/queries/fan.js +1 -1
  160. package/dist/queries/files.d.ts +2 -2
  161. package/dist/queries/health.d.ts +3 -3
  162. package/dist/queries/health.js +1 -1
  163. package/dist/queries/hierarchy.d.ts +2 -2
  164. package/dist/queries/hierarchy.js +1 -1
  165. package/dist/queries/hotspots.d.ts +2 -2
  166. package/dist/queries/hotspots.js +1 -1
  167. package/dist/queries/imports.d.ts +2 -2
  168. package/dist/queries/imports.js +1 -1
  169. package/dist/queries/incomplete-migration.d.ts +3 -2
  170. package/dist/queries/incomplete-migration.js +1 -1
  171. package/dist/queries/index.d.ts +21 -5
  172. package/dist/queries/index.js +1 -1
  173. package/dist/queries/isolated.d.ts +2 -2
  174. package/dist/queries/isolated.js +1 -1
  175. package/dist/queries/locality-candidates.d.ts +2 -2
  176. package/dist/queries/locality-candidates.js +1 -1
  177. package/dist/queries/members.d.ts +2 -2
  178. package/dist/queries/members.js +1 -1
  179. package/dist/queries/methods.d.ts +2 -2
  180. package/dist/queries/methods.js +1 -1
  181. package/dist/queries/not-implemented.d.ts +2 -2
  182. package/dist/queries/not-implemented.js +1 -1
  183. package/dist/queries/outline.d.ts +2 -2
  184. package/dist/queries/outline.js +1 -1
  185. package/dist/queries/passthrough-candidates.d.ts +2 -2
  186. package/dist/queries/passthrough-candidates.js +1 -1
  187. package/dist/queries/plan-context.d.ts +2 -2
  188. package/dist/queries/plan-context.js +1 -1
  189. package/dist/queries/react-component-duplicates.d.ts +2 -2
  190. package/dist/queries/react-component-duplicates.js +1 -1
  191. package/dist/queries/react-hook-candidates.d.ts +2 -2
  192. package/dist/queries/react-hook-candidates.js +1 -1
  193. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  194. package/dist/queries/react-large-component-pressure.js +1 -1
  195. package/dist/queries/recent-duplicates.d.ts +2 -2
  196. package/dist/queries/recent-duplicates.js +1 -1
  197. package/dist/queries/redundant-reexports.d.ts +2 -2
  198. package/dist/queries/redundant-reexports.js +1 -1
  199. package/dist/queries/refs.d.ts +2 -2
  200. package/dist/queries/refs.js +1 -1
  201. package/dist/queries/self-audit.d.ts +2 -2
  202. package/dist/queries/self-audit.js +1 -1
  203. package/dist/queries/similar-chains.d.ts +2 -2
  204. package/dist/queries/similar-chains.js +1 -1
  205. package/dist/queries/similar-files.d.ts +2 -2
  206. package/dist/queries/similar-files.js +1 -1
  207. package/dist/queries/similar-signatures.d.ts +2 -2
  208. package/dist/queries/similar-signatures.js +1 -1
  209. package/dist/queries/similar.d.ts +2 -2
  210. package/dist/queries/similar.js +1 -1
  211. package/dist/queries/slice.d.ts +2 -2
  212. package/dist/queries/slice.js +1 -1
  213. package/dist/queries/stale-abstractions.d.ts +2 -2
  214. package/dist/queries/stale-abstractions.js +1 -1
  215. package/dist/queries/stats.d.ts +2 -2
  216. package/dist/queries/surface.d.ts +2 -2
  217. package/dist/queries/surface.js +1 -1
  218. package/dist/queries/symbols.d.ts +2 -2
  219. package/dist/queries/symbols.js +1 -1
  220. package/dist/queries/system.d.ts +2 -2
  221. package/dist/queries/system.js +1 -1
  222. package/dist/queries/test-quality.d.ts +2 -2
  223. package/dist/queries/test-quality.js +1 -1
  224. package/dist/queries/trace.d.ts +2 -2
  225. package/dist/queries/trace.js +1 -1
  226. package/dist/queries/twin-ab.d.ts +2 -2
  227. package/dist/queries/twin-ab.js +1 -1
  228. package/dist/queries/twin-drift.d.ts +2 -2
  229. package/dist/queries/twin-drift.js +1 -1
  230. package/dist/queries/unused-imports.d.ts +2 -2
  231. package/dist/queries/unused-imports.js +1 -1
  232. package/dist/queries/unused-params.d.ts +2 -2
  233. package/dist/queries/unused-params.js +1 -1
  234. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  235. package/dist/queries/vue-component-duplicates.js +1 -1
  236. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  237. package/dist/queries/vue-composable-candidates.js +1 -1
  238. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  239. package/dist/queries/vue-large-view-pressure.js +1 -1
  240. package/dist/queries/wrapper-candidates.d.ts +2 -2
  241. package/dist/queries/wrapper-candidates.js +1 -1
  242. package/dist/reindex-worker.js +24 -24
  243. package/dist/reindex.d.ts +3 -3
  244. package/dist/reindex.js +38 -38
  245. package/dist/runtime.d.ts +9 -4
  246. package/dist/runtime.js +2 -2
  247. package/dist/rust-semantic-session-worker.js +1 -1
  248. package/dist/rust-semantic-worker.js +1 -1
  249. package/dist/{scip-cli-1bVKJgXi.d.ts → scip-cli-kRpaexVJ.d.ts} +1 -1
  250. package/dist/watch-server.js +5 -5
  251. package/docs/AI_FAILURE_MODES.md +1 -1
  252. package/docs/COMMAND_REFERENCE.md +1 -1
  253. package/docs/DETECTOR_GUIDE.md +1 -1
  254. package/docs/analyzer-inventory.md +1 -1
  255. package/docs/analyzer-validation-ledger.md +131 -1
  256. package/docs/architecture-coherence-vision.md +29 -0
  257. package/package.json +2 -2
  258. package/dist/chunk-2NA6TYP4.js +0 -120
  259. package/dist/chunk-5W2VAEVR.js +0 -4
  260. package/dist/chunk-7TJJY2C3.js +0 -2
  261. package/dist/chunk-DO775SYA.js +0 -2
  262. package/dist/chunk-DRH3AD7W.js +0 -4
  263. package/dist/chunk-E3KWOHH7.js +0 -5
  264. package/dist/chunk-EMIIOOTM.js +0 -38
  265. package/dist/chunk-ESNRT7QN.js +0 -927
  266. package/dist/chunk-IOOCKVUA.js +0 -6
  267. package/dist/chunk-KC2IFAAU.js +0 -3
  268. package/dist/chunk-NTOBQK5H.js +0 -4
  269. package/dist/chunk-UJKZQLDB.js +0 -2
  270. package/dist/chunk-US44MEVU.js +0 -29
  271. package/dist/chunk-XZXUMGAA.js +0 -7
  272. package/dist/diff-gate-types-CG2YQ_ei.d.ts +0 -4
  273. package/dist/direct-navigation-C2A44KFT.js +0 -3
@@ -1,6 +0,0 @@
1
- import{a as t}from"./chunk-LM72NQ7T.js";import{execFileSync as a}from"child_process";import{createRequire as S}from"module";import{existsSync as y}from"fs";import{platform as s,arch as g}from"os";var f="v0.8.1",l="https://github.com/sourcegraph/scip",h="SCIP_QUERY_SCIP_BIN";function x(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let r=e.env[h];if(r&&e.fileExists(r))return{source:"env",path:r};if(e.platform==="win32"){let n=e.resolveSidecar(e.arch);if(n&&e.fileExists(n))return{source:"sidecar",path:n}}return null}function C(e){let r=S(import.meta.url);for(let n of e==="arm64"?["arm64","x64"]:[e])try{return r.resolve(`scip-query-scip-windows/scip-win32-${n}.exe`)}catch{}return null}function m(e=process.env){return x({platform:s(),arch:g(),env:e,isOnPath:t,fileExists:y,resolveSidecar:C})?.path??null}function N(){return m()!==null}function O(){let e=m();if(!e)return null;try{return a(e,["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function P(){let e=s(),r=g(),n,o,c;switch(e){case"darwin":n="darwin",c="tar.gz";break;case"linux":n="linux",c="tar.gz";break;default:return null}switch(r){case"arm64":o="arm64";break;case"x64":o="amd64";break;default:return null}let u=`scip-${n}-${o}.${c}`;return{url:`${l}/releases/download/${f}/${u}`,filename:u}}function j(){let e=P();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),s()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
2
- `),console.log("Or download manually:")):s()==="win32"?(console.log("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(" npm install -g scip-query-scip-windows"),console.log(`Or set ${h} to a local scip.exe path.
3
- `),console.log("Upstream release page:")):console.log("Download from:"),console.log(e?` ${e.url}
4
- `:` ${l}/releases/tag/${f}
5
- `),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function L(e){if(s()==="darwin"&&t("brew")){e("Installing scip CLI via Homebrew...");try{if(a("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),t("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let n=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${n}`)}}if(t("go")){e("Installing scip CLI via go install...");try{if(a("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),t("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let n=r instanceof Error?r.message:String(r);e(`go install failed: ${n}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${l}/releases`),!1}import{createHash as w}from"crypto";import{mkdirSync as I,realpathSync as b}from"fs";import{homedir as E}from"os";import{join as i,resolve as d}from"path";function _(e,r){let n=process.env.SCIP_QUERY_CACHE_DIR;if(n)return p(n);if(r?.dbPath)return p(d(e,r.dbPath));let o=R(e);return p(o)}function v(){let e=process.env.XDG_CACHE_HOME;return i(e||i(E(),".cache"),"scip-query")}function R(e){let r=d(e);try{r=b(r)}catch{}let n=w("sha256").update(r).digest("hex").slice(0,12);return i(v(),"projects",n)}function J(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);return i(v(),"repositories",e)}function T(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function z(e,r){let n=_(e,r);return{cacheDir:n,dbPath:i(n,"index.db"),indexPath:i(n,"index.scip"),metaPath:i(n,"meta.json")}}function p(e){return I(e,{recursive:!0}),e}export{m as a,N as b,O as c,j as d,L as e,R as f,J as g,T as h,z as i};
6
- //# sourceMappingURL=chunk-IOOCKVUA.js.map
@@ -1,3 +0,0 @@
1
- import{a as Ae}from"./chunk-WFRET75Z.js";import{a as Te}from"./chunk-CKFMZE77.js";import{a as ce,b as F,e as le}from"./chunk-FRXB74RQ.js";import{a as he,c as ge,d as pe,e as v}from"./chunk-24ET4VLC.js";import{a as Re}from"./chunk-XZXUMGAA.js";import{a as De}from"./chunk-5W2VAEVR.js";import{a as Fe}from"./chunk-C2QSK7E7.js";import{a as we}from"./chunk-7SGOWD2Y.js";import{a as $e}from"./chunk-OOUJBAKJ.js";import{a as Ce}from"./chunk-GIHVWNKQ.js";import{a as Se}from"./chunk-YCSTKIYU.js";import{a as me}from"./chunk-5GOBZI34.js";import{b as ue}from"./chunk-53SUJOJA.js";import{a as de,b as fe}from"./chunk-WWCZCH7W.js";import{a as oe,b as se,c as ae,g as _,h as H}from"./chunk-3WLRW5TC.js";import{b as be}from"./chunk-B2WQKQKP.js";import{a as L,c as ie,d as ne,e as re}from"./chunk-FB6IKAKZ.js";import{a as te}from"./chunk-KMOMNTB4.js";import{a as ke,e as ve}from"./chunk-JJZRS2OP.js";import{a as I,c as z,d as O,e as ye}from"./chunk-DO775SYA.js";import{a as ee}from"./chunk-7TJJY2C3.js";import{f as x,g as G}from"./chunk-CAKPEQZB.js";import{e as Q}from"./chunk-DZXFZAZO.js";import{d as M,e as R,f as Z,g as P}from"./chunk-AYRHVJXW.js";import{a as X}from"./chunk-GAE7WCBK.js";import{e as V}from"./chunk-WAU7HVDI.js";import{s as Y}from"./chunk-FC5K7T35.js";import{createHash as ct}from"crypto";import{existsSync as K}from"fs";function U(e){let[t,i]=T(e,":"),r=t||"unknown",n=(a={})=>{let s=a.actionTier??We(r);return{sourceAnalyzer:r,actionTier:s,rootCauseKey:a.rootCauseKey??(i||e),label:a.label??`${r} finding`,relatedFiles:a.relatedFiles??[],why:a.why??[],remediation:a.remediation??Je(s,r),file:a.file}};if(!i)return n({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(r)){let[a,s]=T(i,":");return n({file:a,relatedFiles:a?[a]:[],rootCauseKey:s?`${a}:${s}`:i,label:`${r} finding`,why:s?[`Baseline subject: ${s}.`]:[]})}if(r==="cycle"){let a=i.split(">").filter(Boolean);return n({relatedFiles:a,rootCauseKey:i,label:"cycle finding",why:a.length>0?[`Cycle path: ${a.join(" > ")}.`]:[]})}if(r==="similar"){let a=i.split("|").filter(Boolean);return n({relatedFiles:[],rootCauseKey:i,label:"similarity finding",why:a.length>0?[`Similar symbols: ${a.join(" | ")}.`]:[]})}if(r==="architecture"){let[a,s]=T(i,":");if(a==="forbidden-edge"){let[c,l]=T(s,":"),o=N(c),f=N(l);return n({actionTier:"direct",rootCauseKey:i,label:"architecture boundary violation",why:[`Declared boundary rule rejects ${o} -> ${f}.`],remediation:`Move the dependency behind an allowed boundary, or deliberately update the ${o} dependency rule and baseline.`})}if(a==="cycle"){let c=s.split("|").filter(Boolean).map(N);return n({actionTier:"direct",rootCauseKey:i,label:"forbidden architecture cycle",why:[`requireAcyclic rejects the connected boundary group: ${c.join(", ")}.`],remediation:"Break the boundary cycle, or deliberately revise the acyclicity rule and baseline."})}if(a==="missing-policy-row"){let c=N(s);return n({actionTier:"direct",rootCauseKey:i,label:"incomplete architecture policy",why:[`requireCompletePolicy rejects the missing outgoing dependency row for ${c}.`],remediation:`Declare the allowed outgoing dependencies for ${c}, including an empty row when it must depend on nothing.`})}}if(r==="drift"){let[a,s]=T(i,":"),[c,l]=T(s,":");return n({actionTier:a==="unused-import"?"direct":"signal",file:c,relatedFiles:[...new Set([c,l].filter(Boolean))],rootCauseKey:i,label:`${a||"drift"} finding`,why:[...a?[`Drift kind: ${a}.`]:[],...l?[`Related dependency: ${l}.`]:[]]})}return n({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function We(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":case"architecture":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function Je(e,t){return e==="direct"?`Fix the new ${t} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${t} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function T(e,t){let i=e.indexOf(t);return i<0?[e,""]:[e.slice(0,i),e.slice(i+t.length)]}function N(e){try{return decodeURIComponent(e)}catch{return e}}import{existsSync as xe,readFileSync as Ge,writeFileSync as Ve}from"fs";import{isAbsolute as Ye,join as Xe}from"path";var Ze=25e3,Qe=2500,et=2500;function tt(e){let t=Fe(e);return t.symbols>=Ze||t.documents>=Qe?et:void 0}var it=".scipquery-baseline.json";function q(e){if(e.startsWith("similar:")){let t=e.slice(8).split("|");return t.length!==2?e:`similar:${t.map(M).sort().join("|")}`}if(e.startsWith("duplicate-bodies:")){let t=e.slice(17),i=t.indexOf(":");if(i<0)return e;let r=t.slice(0,i),n=t.slice(i+1).split("|");return n.length<2?e:`duplicate-bodies:${r}:${n.map(M).sort().join("|")}`}return e}function A(e,t){return t&&Ye(t)?t:Xe(e.config.projectRoot,t??it)}function Ee(e,t={}){let{scope:i}=t,r=tt(e),n=[],a=be(e,{scope:i,...v.dead,scanLimit:r});for(let s of a.symbols)x(e,s.relativePath)||G(e,s.symbol,s.relativePath)||s.kind==="dead-code"&&n.push(`dead:${s.relativePath}:${s.shortName}`);for(let s of $e(e,{scope:i,...v.isolated,scanLimit:r}))x(e,s.relativePath)||G(e,s.symbol,s.relativePath)||n.push(`isolated:${s.relativePath}:${s.shortName}`);for(let s of me(e,{scope:i}))s.kind==="real"&&n.push(`cycle:${nt(s.path)}`);for(let s of ve(e,{scope:i,...v.similar,scanLimit:r}))n.push(`similar:${[s.symbolA,s.symbolB].sort().join("|")}`);for(let s of de(e,{scope:i,...v.duplicateBodies,scanLimit:r}))n.push(`duplicate-bodies:${s.hash}:${s.functions.map(c=>c.symbol).sort().join("|")}`);for(let s of Se(e,{scope:i,...v.extract,scanLimit:r}))n.push(`extract:${s.relativePath}:${s.shortName}`);for(let s of Re(e,{scope:i,...v.wrappers,scanLimit:r}))n.push(`wrapper:${s.file}:${s.shortName}`);for(let s of we(e,{scope:i,...v.passthroughs,scanLimit:r}))n.push(`passthrough:${s.file}:${s.shortName}`);for(let s of De(e,{scope:i,...v.stale,scanLimit:r}))n.push(`stale:${s.file}:${s.shortName}`);for(let s of Ce(e,{scope:i,...v.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY}).results)s.kind!=="architecture-violation"&&n.push(`drift:${s.kind}:${s.file}:${s.dep}`);return n.push(...O(z(e,{scope:i}))),[...new Set(n.map(q))].sort()}function nt(e){if(e.length===0)return"";let t=0;for(let i=1;i<e.length;i++)e[i]<e[t]&&(t=i);return[...e.slice(t),...e.slice(0,t)].join(">")}function ni(e,t={}){let i=Ee(e,{scope:t.scope}),r=A(e,t.path);return Ve(r,JSON.stringify({version:1,findings:i},null,2)+`
2
- `),{path:r,findingCount:i.length}}function je(e,t={}){let i=A(e,t.path);if(!xe(i))throw new Error(`No baseline found at ${i}. Create one with: scip-query health --write-baseline`);let r=JSON.parse(Ge(i,"utf-8")),n=new Set((r.findings??[]).map(q)),a=Ee(e,{scope:t.scope}),s=new Set(a);return{baselinePath:i,baselineCount:n.size,current:a,newFindings:a.filter(c=>!n.has(c)),fixedFindings:[...n].filter(c=>!s.has(c))}}function Ie(e,t={}){let i=A(e,t.path);if(!xe(i))throw new Error(`No baseline found at ${i}. Create one with: scip-query health --write-baseline`);let r=JSON.parse(Ge(i,"utf-8")),n=new Set((r.findings??[]).map(q).filter(c=>c.startsWith(I))),a=O(z(e,{scope:t.scope})),s=new Set(a);return{baselinePath:i,baselineCount:n.size,current:a,newFindings:a.filter(c=>!n.has(c)),fixedFindings:[...n].filter(c=>!s.has(c))}}import{existsSync as rt,mkdirSync as si,readdirSync as ot,readFileSync as st,writeFileSync as ai}from"fs";import{createHash as li}from"crypto";import{join as W}from"path";var E=W(".scipquery","suppressions");function at(e){return W(e,E)}function Ne(e){let t=at(e);if(!rt(t))return{suppressions:[],warnings:[]};let i=[],r=[];for(let n of ot(t).sort()){if(!n.endsWith(".json"))continue;let a=W(t,n),s;try{s=JSON.parse(st(a,"utf-8"))}catch{r.push(`${E}/${n}: malformed JSON \u2014 ignored`);continue}if(typeof s!="object"||s===null||Array.isArray(s)){r.push(`${E}/${n}: not a suppression object \u2014 ignored`);continue}let c=s;if(typeof c.reason!="string"||c.reason.trim()===""){r.push(`${E}/${n}: missing reason \u2014 ignored`);continue}if(!c.id&&!c.check){r.push(`${E}/${n}: needs an id or a check \u2014 ignored`);continue}i.push(c)}return{suppressions:i,warnings:r}}var Bi=["echo","incomplete-migration","co-change-partner","twin-partner","coverage-contract","architecture","doc-reference","unused-params","new-dead","baseline"];function Ki(e,t={}){let i=t.base??"HEAD",{minTogether:r=6,minConfidence:n=.6,maxEchoChecks:a=Number.POSITIVE_INFINITY,maxHelpers:s=Number.POSITIVE_INFINITY,minSimilarity:c=.8,includeBaseline:l=!1,scanLimit:o}=t,f=t.semantic!==!1,p=t.historyMode??"bounded",u=new Set(t.skip??[]),h=ae(e,{base:i}),m=se(e,{base:i,plan:h}),y=m.changedFiles,S=new Set(y),d=new Set(h.changedFileLines),w=new Set([...S,...d]),$=_(e.config.projectRoot,i,H(h,y)),C=Nt(e.config.projectRoot,i,h,$),g={base:i,changedFiles:y,changedSymbols:m.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],attributionNotes:m.attributionNotes,rootCauseGroups:[],note:m.summary.note};if(y.length===0)return g;let k=(j,ze)=>{if(u.has(j)){g.skipped.push({check:j,reason:"skipped via --skip"});return}let Oe=g.findings.length,Ue=g.skipped.length,qe=g.checksRun.length;Y(`diff-gate.check.${j}`,ze,()=>({check:j,changedFiles:y.length,changedSymbols:m.changedSymbols.length,findingsAdded:g.findings.length-Oe,skippedAdded:g.skipped.length-Ue,checksRunAdded:g.checksRun.length-qe}))};return k("echo",()=>ut(e,m.changedSymbols,S,C,a,c,o,f,g)),k("incomplete-migration",()=>bt(e,i,h,s,o,f,$,g)),k("co-change-partner",()=>Ct(e,w,r,n,p,g)),k("twin-partner",()=>St(e,m.changedSymbols,S,o,g)),k("coverage-contract",()=>$t(e,w,g)),k("architecture",()=>Mt(e,g)),k("doc-reference",()=>Ft(e,S,d,h.changedRanges,h.renamedFiles,g)),k("unused-params",()=>xt(e,y,g)),k("new-dead",()=>Gt(e,m.changedSymbols,C,g)),l&&k("baseline",()=>Kt(e,g)),dt(g,[...e.config.suppressions??[],...Ne(e.config.projectRoot).suppressions]),g.rootCauseGroups=lt(g.findings),g}function Mi(e){return e.checksRun.length===0&&e.note===oe}function Pi(e){return e.filter(t=>!t.advisory)}function lt(e){let t=new Map;for(let i of e){let r=i.groupKey??`${i.check}:${i.id}`,n=t.get(r);n||(n={groupKey:r,check:i.check,severity:i.severity,actionTier:i.actionTier,sourceAnalyzer:i.sourceAnalyzer,rootCauseKey:i.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:i.message,remediation:i.remediation},t.set(r,n)),n.count+=1,n.findingIds.push(i.id),n.severity=_e(n.severity,i.severity),n.actionTier=He(n.actionTier,i.actionTier),i.file&&n.files.add(i.file);for(let a of i.relatedFiles??[])n.relatedFiles.add(a)}return[...t.values()].map(i=>({...i,files:[...i.files].sort(),relatedFiles:[...i.relatedFiles].sort()})).sort((i,r)=>r.count-i.count||B(r.severity)-B(i.severity)||i.groupKey.localeCompare(r.groupKey))}function _e(e,t){return B(t)>B(e)?t:e}function B(e){return e==="error"?2:e==="warning"?1:0}function He(e,t){return e?t&&Be(t)>Be(e)?t:e:t}function Be(e){return e==="direct"?2:e==="signal"?1:0}function dt(e,t){if(t.length===0||e.findings.length===0)return;let i=[];for(let r of e.findings){let n=t.find(a=>ft(a,r));n?e.suppressed.push({finding:r,suppression:n}):i.push(r)}e.findings=i}function ft(e,t){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==t.id&&!t.legacySuppressionIds?.includes(e.id)||e.check&&e.check!==t.check||e.file&&e.file!==t.file?!1:!!(e.id||e.check)}function D(e,t){e.findings.push({...t,suppressionHint:`scip-query: ignore ${t.check} ${t.id} -- <reason>`})}function ut(e,t,i,r,n,a,s,c,l){l.checksRun.push("echo");for(let o of t.slice(0,n)){if(!P(o.symbol)||r(o))continue;let f=fe(e,o.symbol,{maxLoc:15,scanLimit:s}).filter(d=>!i.has(d.file)).slice(0,5).map(d=>({otherFile:d.file,otherShort:d.shortName,otherSymbol:d.symbol,similarity:1,similarityBasis:"exact-body",sharedEvidence:[`exact normalized body (${d.loc} LOC)`]}));if(f.length>0){let d=b("echo",o.symbol,o.file),w=b("echo",o.symbol,o.file,...f.map(C=>`${C.otherSymbol}|${C.otherFile}`).sort()),$=f[0];D(l,{id:d,legacySuppressionIds:w===d?void 0:[w],groupKey:d,actionTier:"direct",check:"echo",severity:"warning",evidence:"heuristic",confidence:1,file:o.file,symbol:o.symbol,relatedFiles:[...new Set(f.map(C=>C.otherFile))].sort(),sourceAnalyzer:"duplicate-bodies",rootCauseKey:`${o.symbol}:${$.otherSymbol}`,message:Me(o,f),why:Pe(o,f),remediation:Le("direct",o.shortName,$.otherShort)});continue}let p=ke(e,o.symbol,{minSimilarity:a,limit:5,scanLimit:s,semantic:c,sourceCandidateMode:"target-pruned"}),u=[];for(let d of p){let w=d.fileA===o.file?d.fileB:d.fileA,$=d.fileA===o.file?d.shortNameB:d.shortNameA,C=d.fileA===o.file?d.symbolB:d.symbolA;i.has(w)||u.push({otherFile:w,otherShort:$,otherSymbol:C,similarity:d.similarity,similarityBasis:d.similarityBasis??"callees",sharedEvidence:d.sharedCallees})}if(u.length===0)continue;let h=u[0],m=b("echo",o.symbol,o.file,...u.map(d=>`${d.otherSymbol}|${d.otherFile}`).sort()),y=b("echo",o.symbol,o.file),S=ht(o,u);D(l,{id:y,legacySuppressionIds:m===y?void 0:[m],groupKey:y,actionTier:S,check:"echo",severity:"warning",evidence:"heuristic",confidence:h.similarity,file:o.file,symbol:o.symbol,relatedFiles:[...new Set(u.map(d=>d.otherFile))].sort(),message:Me(o,u),why:Pe(o,u),remediation:Le(S,o.shortName,h.otherShort)})}t.length>n&&l.skipped.push({check:"echo",reason:`echo check capped at ${n} of ${t.length} changed symbols`})}function ht(e,t){return t.some(r=>gt(e.symbol,r))?"direct":"signal"}function gt(e,t){if(t.similarityBasis==="exact-body")return!0;if(t.similarityBasis!=="source-tokens"||t.similarity<.98||t.sharedEvidence.length>8)return!1;let i=R(e),r=R(t.otherSymbol);return!i||!r?!1:i===r?!0:yt(t.sharedEvidence)?!1:pt(i,r)}function pt(e,t){let i=Ke(e),r=Ke(t);if(i.length===0||r.length===0)return!1;let n=new Set(r),a=i.filter(s=>n.has(s)).length;return a>=2&&a/Math.min(i.length,r.length)>=.5}function Ke(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}var mt=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function yt(e){return e.length>=3&&e.every(t=>mt.has(t.toLowerCase()))}function Me(e,t){let i=t[0],r=Math.round(i.similarity*100);return t.length===1?`${e.shortName} (${e.file}) is ${r}% similar to established ${i.otherShort} (${i.otherFile})`:`${e.shortName} (${e.file}) resembles ${t.length} established symbol(s); strongest is ${r}% similar to ${i.otherShort} (${i.otherFile})`}function Pe(e,t){let i=[`${e.shortName} was changed in this diff.`];for(let r of t.slice(0,3))i.push(`${r.otherShort} is outside this diff and scored ${Math.round(r.similarity*100)}% similar by ${r.similarityBasis} evidence.`),i.push(`Shared evidence: ${r.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return t.length>3&&i.push(`${t.length-3} additional similar match(es) grouped into this finding.`),i}function Le(e,t,i){return e==="direct"?`Extract or reuse the shared behavior with ${i}, or keep the duplicate with a suppression reason.`:`Review whether ${t} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function bt(e,t,i,r,n,a,s,c){let l=Te(e,{base:t,maxHelpers:r,diffPlan:i,scanLimit:n,semantic:a,baseContentAt:s});if(!l.available){c.skipped.push({check:"incomplete-migration",reason:"no git history"});return}c.checksRun.push("incomplete-migration"),l.note&&c.skipped.push({check:"incomplete-migration",reason:l.note});for(let o of l.findings){let f=o.leftovers.map(d=>`${d.shortName} (${d.file}, ${Math.round(d.containment*100)}% helper / ${Math.round(d.siteCoverage*100)}% site, ${d.migrationScope})`).join(", "),p=o.leftovers.map(d=>`${d.shortName}: ${d.migrationScope} (${d.migrationScopeReasons[0]})`).join("; "),u=[...o.migratedFiles,...o.leftovers.map(d=>d.file)],h=o.leftovers.length===0?void 0:Math.max(...o.leftovers.map(d=>Math.min(d.containment,d.siteCoverage))),m=o.leftovers.some(d=>d.migrationScope==="possible-subtype"),y=b("incomplete-migration",o.helperSymbol,o.helperFile,u.join("|")),S=b("incomplete-migration",o.helperSymbol,o.helperFile);D(c,{id:S,legacySuppressionIds:y===S?void 0:[y],check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:h,file:o.helperFile,symbol:o.helperSymbol,relatedFiles:u,message:`new helper ${o.helperShortName} (${o.helperFile}) is wired into ${o.migratedFiles.length} file(s), but ${o.leftovers.length} similar un-migrated site(s) remain: ${f}`,why:[`${o.helperShortName} is new in this diff and already referenced by ${o.migratedFiles.join(", ")}.`,`Helper shape: ${o.helperShape}; ${o.specificHelperCalleeCount}/${o.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${f}.`,`Migration scope hints: ${p}.`],remediation:m?`Migrate same-scope sites to ${o.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${o.helperShortName}, or confirm they are intentionally different.`})}}function Ct(e,t,i,r,n,a){let s=te(e,{historyMode:n}).directionalCoChangePairsForFiles(t,{minTogether:i,minConfidence:0,maxFilesPerCommit:20});if(!s){a.skipped.push({check:"co-change-partner",reason:"no git history"});return}a.checksRun.push("co-change-partner");let c=new Set,l;for(let o of s){let f=t.has(o.fileA),p=t.has(o.fileB);if(f===p)continue;let u=f?o.fileA:o.fileB,h=f?o.fileB:o.fileA,m=f?o.changesA:o.changesB,y=m>0?o.together/m:0;if(y<r||L(h)||L(u)||!K(`${e.config.projectRoot}/${h}`))continue;let S=`${u}|${h}`;if(c.has(S))continue;c.add(S);let d=b("co-change-partner",u,h,String(o.together)),w=b("co-change-partner",u,h),$=ie(u,h),C=ne({fileA:u,fileB:h,together:o.together,confidence:y,commitScope:o.commitScope,recency:o.recency,subjectContext:o.subjectContext},$,(l??=re(e))(u,h)),g=[u,h].sort().join("|");a.findings.push({id:w,legacySuppressionIds:d===w?void 0:[d],check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${g}`,confidence:y,file:u,relatedFiles:[h],sourceAnalyzer:"co-change",rootCauseKey:g,partnerClass:$.partnerClass,partnerClassReasons:$.reasons,commitScope:o.commitScope,recency:o.recency,focusedTogether:o.focusedTogether,broadTogether:o.broadTogether,broadCommitRatio:o.broadCommitRatio,lastTogetherAt:o.lastTogetherAt,recentTogether:o.recentTogether,subjectContext:o.subjectContext,...C?{declaredCouplingSuggestion:C}:{},message:`${u} changed, but ${h} did not \u2014 they change together ${o.together}x (${Math.round(y*100)}% of the time)`,why:[`${u} is in this diff and ${h} is not.`,`Git history shows ${o.together} co-change(s), which is ${Math.round(y*100)}% of changes to the edited side.`,`History context: ${wt(o)}.`,`Subject context: ${kt(o.subjectContext)}.`,...vt(o),`Partner class: ${$.partnerClass} (${$.reasons.join("; ")}).`],remediation:C?`Update ${h} alongside this change, declare the coupling "${C.name}", or confirm the coupling no longer holds.`:`Update ${h} alongside this change, or confirm the coupling no longer holds.`})}}function St(e,t,i,r,n){n.checksRun.push("twin-partner");let a=ue(e,{scanLimit:r}).filter(l=>l.relationship==="divergent"||l.relationship==="identical");if(a.length===0)return;let s=new Map;for(let l of a)for(let o of l.members)s.set(o.symbol,l);let c=new Set;for(let l of t){if(!P(l.symbol))continue;let o=s.get(l.symbol);if(!o)continue;let f=o.members.filter(m=>m.symbol!==l.symbol&&!i.has(m.file));if(f.length===0)continue;let p=[l.symbol,...f.map(m=>m.symbol)].sort().join("|");if(c.has(p))continue;c.add(p);let u=f[0],h=b("twin-partner",l.symbol,l.file,u.symbol);D(n,{id:h,groupKey:`twin-partner:${p}`,check:"twin-partner",severity:"warning",evidence:"heuristic",actionTier:"signal",advisory:!0,confidence:o.relationship==="identical"?1:Math.max(0,1-o.maxDivergence),file:l.file,symbol:l.symbol,relatedFiles:f.map(m=>m.file).sort(),sourceAnalyzer:"twin-drift",rootCauseKey:p,message:`${l.shortName} (${l.file}) changed but its same-name twin ${u.shortName} (${u.file}) did not \u2014 verify the change shouldn't apply to both, or consolidate them.`,why:[`${l.symbol} is in this diff.`,`${u.symbol} shares its (near-)name and is classified '${o.relationship}' with it, but ${u.file} is not in this diff.`,o.relationship==="divergent"?`The two bodies already diverge (~${Math.round(o.maxDivergence*100)}% token difference) \u2014 this diff may widen or narrow that drift.`:"The two bodies were byte-identical before this diff.","Advisory: twin-partner never fails the gate by itself \u2014 see the twin-partner entry in the diff-gate checks table."],remediation:`Update ${u.file} alongside this change, consolidate ${l.shortName}/${u.shortName} into one helper, or confirm the twin should diverge on purpose.`})}}function $t(e,t,i){i.checksRun.push("coverage-contract");let r=e.config.coverageContracts??[];for(let n of r){if(!ge(n,t))continue;let a=he(e,n);if(a.status==="ok")continue;let s=b("coverage-contract",n.name,n.file);D(i,{id:s,groupKey:`coverage-contract:${n.name}`,check:"coverage-contract",severity:a.status==="unavailable"?"warning":"error",evidence:"graph-fact",actionTier:"direct",file:n.file,sourceAnalyzer:"coverage-contracts",rootCauseKey:n.name,message:pe(a),why:[`Contract "${n.name}" declares that ${n.file} (${n.keys.type}) must track ${n.mustEqual.type}.`,a.status==="unavailable"?`The declared side could not be evaluated: ${a.unavailableReason}.`:`Missing: ${a.missing.join(", ")||"none"}. Extra: ${a.extra.join(", ")||"none"}.`,"Either side of this contract changed in this diff."],remediation:a.status==="unavailable"?"Investigate why the declared key set could not be parsed (see the reason above) \u2014 do not treat this as a pass.":`Update ${n.file} so its ${n.keys.type==="object-literal-keys"||n.keys.type==="string-array"?n.keys.identifier:n.keys.marker} matches ${n.mustEqual.type}, or fix the ground-truth source if the declared set is right.`})}}function wt(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${Dt(e.lastTogetherAt)}`}function kt(e){let t=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",i=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",r=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(n=>`"${n}"`).join("; "):"none";return`labels ${t}; refs ${i}; samples ${r}; external issue/PR labels ${e.externalIssueLabelStatus}`}function vt(e){let t=[];return e.commitScope==="broad-sweep"&&t.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&t.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),t}function Dt(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}var J=3;function Ft(e,t,i,r,n,a){a.checksRun.push("doc-reference");let s=F.referenceTargets(e,t,r);if(s.size===0)return;let c=new Set(n.map(o=>o.from)),l=[];for(let o of le(e,s))i.has(o.doc)||ce(e,o.doc)||l.push(Rt(e,o,c));for(let o of Tt(l))D(a,o)}function Rt(e,t,i){let r=t.citedClaims.length>0?t.citedClaims:F.citationContexts(e,t.doc,t.cited),n=F.classifyCitation(r),a=F.hasLineAnchoredCitation(t.citations),s=t.cited.some(p=>i.has(p)||!K(`${e.config.projectRoot}/${p}`)),c=!(a||s),l=t.cited[0]??"",o=b("doc-reference",t.doc,t.cited.join("|")),f=b("doc-reference",t.doc,l);return{id:f,legacySuppressionIds:o===f?void 0:[o],check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:n.actionTier,groupKey:`doc-reference:${l}`,rootCauseKey:l,confidence:1,file:t.doc,relatedFiles:t.cited,citationKind:n.citationKind,citationKindReasons:n.reasons,citedClaims:r,...c?{advisory:!0}:{},message:`${t.doc} cites ${t.cited.join(", ")} as ${F.citationKindLabel(n.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${t.cited.join(", ")} changed in this diff.`,`${t.doc} cites the changed file(s) but was not updated in the same diff.`,...n.reasons.map(p=>`Citation kind evidence: ${p}`),c?"Advisory: bare file-mention citation (no line anchor, cited file still present under the same path) \u2014 21.2 calibration found this citation shape low-precision; verify at your leisure.":a?"Blocking: citation includes a line anchor that may now point at the wrong lines.":"Blocking: the cited file was deleted or renamed in this diff \u2014 the citation almost certainly needs an update."],remediation:F.citationRemediation(n.citationKind,t.doc)}}function Tt(e){let t=new Map;for(let r of e){let n=r.rootCauseKey??"",a=t.get(n);a?a.push(r):t.set(n,[r])}let i=[];for(let[r,n]of t)n.length<=J?i.push(...n):i.push(At(r,n));return i}function At(e,t){let i=[...t].sort((f,p)=>(f.file??"").localeCompare(p.file??"")),r=i.slice(0,J).map(f=>({doc:f.file??"",citedClaims:f.citedClaims??[]})),n=i.length-r.length,a=i.every(f=>f.advisory===!0),s=i.reduce((f,p)=>_e(f,p.severity),"info"),c=i.reduce((f,p)=>He(f,p.actionTier),void 0),l=i.map(f=>f.file??"").filter(f=>f.length>0),o=[...new Set(i.flatMap(f=>[f.id,...f.legacySuppressionIds??[]]))];return{id:b("doc-reference","hub-cluster",e),memberFindingIds:o,check:"doc-reference",severity:s,evidence:"change-graph",actionTier:c,groupKey:`doc-reference:${e}`,rootCauseKey:e,confidence:1,file:r[0]?.doc,relatedFiles:[e],citationCount:i.length,citationExemplars:r,suppressedCount:n,...a?{advisory:!0}:{},message:`${e} is cited by ${i.length} doc(s) changed in this diff, doc(s) untouched \u2014 showing ${r.length} example(s), ${n} more damped`,why:[`${e} changed in this diff.`,`${i.length} doc(s) cite it but were not updated in the same diff: ${l.join(", ")}.`,...r.map(f=>`Example \u2014 ${f.doc}: ${f.citedClaims[0]??"(no captured citation text)"}`),`${n} additional doc(s) also cite this file, past the per-hub-file cascade cap (${J}) \u2014 not silently dropped: counted in citationCount/suppressedCount and individually addressable via memberFindingIds.`,a?"Advisory: every citation in this cluster is a bare file-mention (no line anchor, cited file still present).":"Blocking: at least one citation in this cluster is line-anchored or cites a deleted/renamed file."],remediation:`Review the ${r.length} example doc(s) above; ${i.length} total doc(s) cite ${e} the same way \u2014 see citationExemplars and memberFindingIds in --json for the complete list.`}}function xt(e,t,i){i.checksRun.push("unused-params");for(let r of Ae(e,{files:t,limit:50})){let n=b("unused-params",r.symbol,r.file,r.unusedTrailing.join("|")),a=b("unused-params",r.symbol,r.file);D(i,{id:a,legacySuppressionIds:n===a?void 0:[n],check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:r.file,startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,message:`${r.shortName} (${r.file}) has trailing unused parameter(s): ${r.unusedTrailing.join(", ")}`,why:[`${r.shortName} is in a changed file.`,`The trailing parameter(s) ${r.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function Gt(e,t,i,r){r.checksRun.push("new-dead");let n=new ee(e),a=V(e.config.projectRoot),s=a.length>1;for(let c of t){if(i(c)||c.fanIn>0||n.fileKind(c.file)==="test"||x(e,c.file)||G(e,c.symbol,c.file)||It(c.symbol))continue;let l=b("new-dead",c.symbol,c.file),o=s&&Et(a,c.file)&&jt(e,c.symbol);D(r,{id:l,check:"new-dead",severity:"warning",evidence:o?"heuristic":"graph-fact",confidence:o?.4:.9,file:c.file,symbol:c.symbol,message:o?`${c.shortName} (${c.file}) unconfirmed (cross-package ambiguous-name resolution gap): zero indexed consumers found, but this name is ambiguous project-wide and lives in a workspace package \u2014 verify manually before treating as dead`:`${c.shortName} (${c.file}) was changed but has zero indexed consumers`,why:o?[`${c.shortName} is a changed production symbol in a workspace package.`,"The index, semantic, and source-fallback layers all report zero consumers for this symbol.","Its leaf name is ambiguous project-wide (a same-named definition exists elsewhere), and cross-package consumers reached only through a re-exporting barrel are a known unresolvable shape for this tool \u2014 see docs/plans/2026-07-02-followups.md item 2."]:[`${c.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:o?"Verify with a direct code search before deleting; this tool cannot confidently resolve this symbol.":"Wire it up, or remove it before it becomes permanent dead code."})}}function Et(e,t){return e.some(i=>t===i.relativeDir||t.startsWith(`${i.relativeDir}/`))}function jt(e,t){let i=R(t);return i?(Q(e).get(i)?.length??0)>1:!1}function It(e){if(Z(e)!=="type")return!1;let t=R(e);return t.startsWith("_Assert")||t.startsWith("Assert")}function Nt(e,t,i,r){let n=new Map(i.renamedFiles.map(s=>[s.to,s.from])),a=r??_(e,t,H(i));return s=>{let c=n.get(s.file)??s.file,l=R(s.symbol);if(!l)return!1;let o=a(c);return o!==null&&Bt(o,l)}}function Bt(e,t){return new RegExp(`\\b${X(t)}\\b`).test(e)}function Kt(e,t){if(!K(A(e))){t.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}t.checksRun.push("baseline");let i=je(e);for(let r of i.newFindings.filter(n=>!n.startsWith(I))){let n=U(r),a=b("baseline",r);D(t,{id:a,groupKey:`baseline:${n.sourceAnalyzer}:${n.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:n.actionTier,confidence:1,file:n.file,relatedFiles:n.relatedFiles.length>0?n.relatedFiles:void 0,sourceAnalyzer:n.sourceAnalyzer,rootCauseKey:n.rootCauseKey,message:`new ${n.label} vs committed baseline: ${r}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${n.sourceAnalyzer}.`,`Inherited action tier: ${n.actionTier}.`,`Root cause key: ${n.rootCauseKey}.`,...n.why],remediation:n.remediation})}}function Mt(e,t){if(!ye(e.config.architecture)){t.skipped.push({check:"architecture",reason:"no closed architecture dependency rows, requireCompletePolicy rule, or requireAcyclic rule configured"});return}if(!K(A(e))){t.skipped.push({check:"architecture",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}t.checksRun.push("architecture");let i=Ie(e);for(let r of i.newFindings){let n=U(r),a=b("architecture",r);D(t,{id:a,groupKey:`architecture:${n.rootCauseKey}`,check:"architecture",severity:"error",evidence:"baseline",actionTier:"direct",confidence:1,sourceAnalyzer:"architecture",rootCauseKey:n.rootCauseKey,message:`new ${n.label} vs committed baseline: ${r}`,why:["The project declares an enforceable architecture rule.","The current boundary graph contains a violation not present in the committed baseline.",...n.why],remediation:n.remediation})}}function b(e,...t){return`SQ${ct("sha256").update([e,...t].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{Ee as a,ni as b,je as c,Bi as d,Ki as e,Mi as f,Pi as g,Nt as h};
3
- //# sourceMappingURL=chunk-KC2IFAAU.js.map
@@ -1,4 +0,0 @@
1
- import{a as M}from"./chunk-FBUNGRKI.js";import{c as C}from"./chunk-63P42UR6.js";import{a as I}from"./chunk-7TJJY2C3.js";import{h as f}from"./chunk-EMIIOOTM.js";import{f as d}from"./chunk-US44MEVU.js";import{d as h}from"./chunk-MTDBHTSF.js";import{d as g}from"./chunk-AYRHVJXW.js";import{f as y}from"./chunk-GAE7WCBK.js";var x=new Set(h());function N(e,n){let{scope:o,minLoc:r=10,limit:i=30,scanLimit:t}=n??{},s=new I(e);return M({candidates:()=>s.productionCallableDefinitions({scope:o,minLoc:r,requireFunctionLikeSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof t=="number"&&t>0}),scanLimit:t,filterCandidate:S,profile:{name:"complexity-hotspots"},prepare:a=>{let l=B(e,a),m=n?.semantic!==!1,c=m?d(e):null;c?.materializeReferences(a,{prefetchCallees:!0});let u=s.crossFileCallerMap(a,{semantic:!1});return{callerMap:c?f(u,c.callerMap(a)):u,calleeMap:s.calleeMap(a,{semantic:m}),languageByFile:l,clojureCallableIds:D(e,a,l),branchEstimates:C(e,a)}},evaluate:(a,l)=>L(a,l,r),orderResults:(a,l)=>l.score-a.score||l.loc-a.loc,limit:i})}function S(e){return e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&x.has(e.kind):!0}function L(e,n,o){if(n.languageByFile.get(e.relativePath)==="clojure"&&!n.clojureCallableIds.has(e.symbolId))return null;let r=e.endLine-e.startLine+1;if(r<o)return null;let i=n.callerMap.get(e.symbolId)?.size??0,t=n.calleeMap.get(e.symbolId)??[],s=new Set,a=new Set;for(let p of t){let b=`${p.symbol}|${p.file}`;s.add(b),p.file!==e.relativePath&&a.add(b)}let l=a.size,m=s.size,c=n.branchEstimates.get(e.symbolId)??{branches:0,estimateBasis:"regex-fallback"},u=c.branches+1;return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:r,fanIn:i,fanOut:l,calleeCount:m,branches:c.branches,estimateBasis:c.estimateBasis,score:Math.round(r/50*(i/5)*Math.max(l/5,1)*Math.max(u/5,1)*100)/100}}function B(e,n){let o=[...new Set(n.map(t=>t.relativePath))];if(o.length===0)return new Map;let r=o.map(()=>"?").join(", "),i=e.all(`SELECT relative_path, language
2
- FROM documents
3
- WHERE relative_path IN (${r})`,...o);return new Map(i.map(t=>[t.relative_path,t.language?.toLowerCase()??null]))}function D(e,n,o){let r=new Set,i=new Map;for(let t of n){if(o.get(t.relativePath)!=="clojure")continue;let s=i.get(t.relativePath);s||(s=new Set((y(e,t.relativePath)?.callables??[]).map(a=>`${a.name}:${a.startLine}`)),i.set(t.relativePath,s)),s.has(`${t.leaf}:${t.startLine}`)&&r.add(t.symbolId)}return r}export{N as a};
4
- //# sourceMappingURL=chunk-NTOBQK5H.js.map
@@ -1,2 +0,0 @@
1
- import{b as r}from"./chunk-SJ6XSCG7.js";import{x as e}from"./chunk-AYRHVJXW.js";function l(t,s){let o=r(t,s);return e(t,o).map(({relativePath:n,...a})=>a)}export{l as a};
2
- //# sourceMappingURL=chunk-UJKZQLDB.js.map
@@ -1,29 +0,0 @@
1
- import{B as W,C as Z,i as te,j as ie,k as re,l as $,w as B,x,z as G}from"./chunk-E3KWOHH7.js";import{a as J}from"./chunk-GAE7WCBK.js";import{d as X,g as U,i as z,k as ee,m as ne,q as O,s as P,v as L,w as j,x as F}from"./chunk-FC5K7T35.js";import{existsSync as Re,readFileSync as Ie}from"fs";import{resolve as De}from"path";function Je(n,e){return N(n,e,t=>{let i=t?`AND m.symbol_id IN (${t.map(()=>"?").join(",")})`:"";return n.all(`SELECT
2
- m.symbol_id,
3
- d.relative_path,
4
- COUNT(*) AS ref_count
5
- FROM mentions m
6
- JOIN chunks c ON m.chunk_id = c.id
7
- JOIN documents d ON c.document_id = d.id
8
- WHERE m.role != 1
9
- ${i}
10
- ${n.pathExclusionsFor("d")}
11
- GROUP BY m.symbol_id, d.relative_path`,...t??[])})}function $e(n,e){return N(n,e,t=>{let i=t?`AND m.symbol_id IN (${t.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id, d.relative_path
12
- FROM mentions m
13
- JOIN chunks c ON m.chunk_id = c.id
14
- JOIN documents d ON c.document_id = d.id
15
- WHERE m.role != 1
16
- ${i}
17
- ${n.pathExclusionsFor("d")}`,...t??[])}).filter(t=>t.symbol_id!==null)}function Be(n,e){return N(n,e,t=>{let i=t?`AND m.symbol_id IN (${t.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id
18
- FROM mentions m
19
- WHERE m.role != 1
20
- ${i}`,...t??[])}).filter(t=>t.symbol_id!==null)}function ae(n,e){return N(n,e,t=>{let i=t?`AND m.symbol_id IN (${t.map(()=>"?").join(",")})`:"";return n.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
21
- c.start_line AS chunk_start, c.end_line AS chunk_end
22
- FROM mentions m
23
- JOIN chunks c ON m.chunk_id = c.id
24
- JOIN documents d ON c.document_id = d.id
25
- WHERE m.role != 1
26
- ${i}
27
- ${n.pathExclusionsFor("d")}
28
- ORDER BY d.relative_path, c.start_line`,...t??[])})}function N(n,e,t){if(!e)return t();if(e.length===0)return[];let i=[];for(let r=0;r<e.length;r+=750)i.push(...t(e.slice(r,r+750)));return i}var ve=/^[A-Za-z_][A-Za-z0-9_]*$/,oe=/\bDefault::default\b/g,Me=/^\.\.\s*Default::default\b/;function se(n,e){let t=new Map,i=new Map;for(let r of e){let a=Y(n,r,i);a!==null&&t.set(r.symbolId,a)}return t}function Y(n,e,t=new Map){let i=xe(e.symbol);if(!i)return null;let r=ae(n,[e.symbolId]);if(r.length===0)return null;let a=new RegExp(`(^|[^A-Za-z0-9_])${J(i)}::default\\b`,"g"),o=new RegExp(`(^|[^A-Za-z0-9_])${J(i)}\\s*$`),f=Ce(n,e.symbolId),m=[];for(let S of r){let d=Ee(n,S.relative_path,t);if(d===null)return null;let l=d.split(/\r?\n/),u=0,p=[],b=0;for(let R=S.chunk_start;R<=S.chunk_end&&R<l.length;R+=1){let D=l[R]??"",w=new Set;a.lastIndex=0;let M;for(;M=a.exec(D);)m.push({file:S.relative_path,line:R,column:M.index+M[1].length+i.length+2}),b+=1;for(let c=0;c<D.length;c+=1){let y=Me.exec(D.slice(c));if(y){if(f&&p.includes(u)){let g=c+y[0].lastIndexOf("default");m.push({file:S.relative_path,line:R,column:g}),w.add(g),b+=1}c+=y[0].length-1;continue}let h=D[c];if(h==="{"){let g=o.test(D.slice(0,c));u+=1,g&&p.push(u);continue}if(h==="}")for(u=Math.max(0,u-1);p.length>0&&p[p.length-1]>u;)p.pop()}for(oe.lastIndex=0;M=oe.exec(D);){let c=M.index+9;if(!w.has(c))return null}}if(b===0)return null}return te(m)}function Ce(n,e){return n.get("SELECT 1 AS present FROM mentions WHERE symbol_id = ? AND role = 1 LIMIT 1",e)?.present===1}function xe(n){let e=/impl#\[([^\]]+)\]\[Default\]default\(\)\./.exec(n)?.[1]??null;return!e||!ve.test(e)?null:e}function Ee(n,e,t){if(t.has(e))return t.get(e)??null;let i=n.get("SELECT text FROM documents WHERE relative_path = ?",e),r=typeof i?.text=="string"?i.text:_e(n,e);return t.set(e,r),r}function _e(n,e){let t=De(n.config.projectRoot,e);if(!Re(t))return null;try{return Ie(t,"utf8")}catch{return null}}function ce(n){let e=new Map;for(let t of n){let i=e.get(t.relativePath)??[];i.push(t),e.set(t.relativePath,i)}return e}var Pe="typescript-import-usage-v1",we="typescript-signatures-v1",Q=X("semantic-prefetched-callees",{clearGroups:["whole-project","source-file","semantic-provider"]}),le=j({kind:"semantic-import-usage",invalidation:F("semantic-import-usage"),serialize:n=>JSON.stringify(n),deserialize:he}),ue=j({kind:"semantic-signatures",invalidation:F("semantic-signatures"),serialize:n=>JSON.stringify(n),deserialize:Le}),fe=L({kind:"typescript-import-usage",invalidation:F("typescript-import-usage"),serialize:n=>JSON.stringify(n),deserialize:he}),me=L({kind:"typescript-signatures",invalidation:F("typescript-signatures"),serialize:n=>JSON.stringify(n),deserialize:je});function k(n){let e=new Map,t=new Set;return{capability:(i,r)=>ye(n,i,r),importUsage:i=>Fe(n,i),references:i=>de(n,i),materializeReferences:(i,r)=>ge(n,i,e,t,r),callerMap:i=>Ae(n,i,e,t),calleeMap:i=>He(n,i),signature:i=>Ue(n,i)}}function Te(n,e){if(e.size===0)return;let t=Q.get(n,()=>new Map);for(let[i,r]of e)t.set(i,[...r])}function fn(n,e){if(!Q.has(n))return{hits:[],misses:[...e]};let t=Q.get(n,()=>new Map),i=[],r=[];for(let a of e)t.has(a.symbolId)?i.push({definition:a,callees:t.get(a.symbolId)??[]}):r.push(a);return{hits:i,misses:r}}function mn(n,e){return k(n).importUsage(e)}function Fe(n,e){if(x(e)==="typescript"){let a="fallback",o=0,f=0,m=0,S=0;return P("typescript.import-usage.materialize",()=>{let d=G(n,e,Pe);if(d?.key){o=1;let u=fe.read(n,e,d.key);if(u)return a="hit",f=1,u;m=1;let p=E(n,e);if(!p)return a="unavailable",[];let b=p.importUsage(e);return fe.write(n,e,d.key,b),a="computed",b}S=1;let l=E(n,e);return l?(a="direct-fallback",l.importUsage(e)):(a="unavailable",[])},()=>({state:a,eligible:o,cacheHits:f,cacheMisses:m,fallbacks:S}))}let t=Se(n,"semantic-import-usage",e);if(t){let a=le.read(n,e,t);if(a)return a}let i=E(n,e);if(!i)return[];let r=i.importUsage(e);return t&&le.write(n,e,t,r),r}function pn(n,e){return k(n).references(e)}function de(n,e){let t=Y(n,e);if(t)return t;let i=re(n,e);if(i)return i;let r=E(n,e.relativePath);return r?r.referencesFor(e):[]}function dn(n,e){return k(n).callerMap(e)}function gn(n,e){let t=new Map,i=new Map;for(let r of e){if(x(r.relativePath)==="typescript"){let a=E(n,r.relativePath);if(!a)continue;let o=i.get(a)??[];o.push(r),i.set(a,o);continue}K(n,t,r,de(n,r))}for(let[r,a]of i){let o=Z(n,a),f=o?.references??(r.referencesForDefinitions?r.referencesForDefinitions(a,{exact:!0}):new Map(a.map(m=>[m.symbolId,r.referencesFor(m)])));!o&&O()&&W(n,a,f);for(let m of a)K(n,t,m,f.get(m.symbolId)??[])}return t}function Ae(n,e,t=new Map,i=new Set){let r=new Map,a=ge(n,e,t,i),o=0;return P("semantic.callers.from-references",()=>{for(let f of e)o+=K(n,r,f,t.get(f.symbolId)??[])},()=>({definitions:e.length,materialized:a.definitions,inMemoryHits:a.inMemoryHits,incompleteInMemoryHits:a.incompleteInMemoryHits,resultRows:r.size,callerFiles:o})),r}function ge(n,e,t,i,r={}){let a=z(n),o=[],f=[],m=[],S=0,d=0,l=0,u=0,p=0,b=0,R=0,_=0,D=0,w=0,M=0,c=0,y=[],h=new Map,g=e.filter(s=>x(s.relativePath)==="typescript"&&!t.has(s.symbolId)&&!i.has(s.symbolId)),v=Z(n,g);if(v){D=g.length,w=v.cacheHits,M=v.cacheMisses,c=v.computedFiles;for(let s of g)t.set(s.symbolId,v.references.get(s.symbolId)??[])}if(P("semantic.references.cache-scan",()=>{for(let[s,I]of ce(e)){let T=[];for(let C of I)t.has(C.symbolId)?d+=1:i.has(C.symbolId)?_+=1:T.push(C);if(T.length===0){R+=1;continue}let H=ke(n,a,s);if(!H){for(let C of T)x(C.relativePath)||(S+=1),m.push(C);continue}b+=1;let be=ee(n,s,H);for(let C of T){let V=be.get(C.symbol)??null;if(V!==null){let q=Ne(V);if(q){l+=1,t.set(C.symbolId,q);continue}u+=1}f.push({definition:C,cacheFingerprint:H})}}},()=>({definitions:e.length,skippedUnsupportedLanguage:S,cacheHits:l,parseFailures:u,misses:f.length,unkeyed:m.length,inMemoryHits:d,incompleteInMemoryHits:_,fullyInMemoryFiles:R,cacheReadFiles:b})),f.length>0||m.length>0){y=[...m,...f.map(s=>s.definition)],h=P("semantic.references.compute-misses",()=>{let s=Oe(n,y,r);return p=s.size,s},()=>({definitions:y.length,misses:f.length,unkeyed:m.length,rows:p}));for(let s of y)h.has(s.symbolId)?(t.set(s.symbolId,h.get(s.symbolId)??[]),i.delete(s.symbolId)):i.add(s.symbolId);for(let{definition:s,cacheFingerprint:I}of f)h.has(s.symbolId)&&ye(n,"semantic-references",s.relativePath).available&&o.push({relativePath:s.relativePath,symbol:s.symbol,projectFingerprint:I,payload:JSON.stringify(h.get(s.symbolId)??[])})}return o.length>0&&P("semantic.references.cache-write",()=>ne(n,o),()=>({entries:o.length})),h.size>0&&W(n,y,h),{definitions:e.length,inMemoryHits:d,incompleteInMemoryHits:_,cacheHits:l,misses:f.length,unkeyed:m.length,skippedUnsupportedLanguage:S,parseFailures:u,computed:p,incomplete:i.size,cacheWrites:o.length,fragmentDefinitions:D,fragmentCacheHits:w,fragmentCacheMisses:M,fragmentComputedFiles:c}}function ke(n,e,t){if(!e)return null;let i=x(t);return i==="typescript"?e:i==="rust"?U(JSON.stringify({kind:"semantic-references",language:i,engine:$(n.config.projectRoot),projectFingerprint:e})):null}function Oe(n,e,t={}){let i=O(),r=new Map,a=0,o=0,f=0,m=0,S=0,d=0,l=0,u=0,p=0;return P("semantic.references.provider-loop",()=>{let b=se(n,e),R=ie(n,e),_=new Map,D=t.prefetchCallees?new Map:null,w=[];for(let c of e){let y,h=()=>(y??=E(n,c.relativePath),y);if(D){let I=h();if(I?.referencesAndCalleesForDefinitions){let T=D.get(I);T?T.push(c):D.set(I,[c]),p+=1}}let g=b.get(c.symbolId);if(g){f+=1,m+=g.length,A(r,c.symbolId,g,i,I=>{l+=1,u+=I});continue}let v=R.get(c.symbolId);if(v){S+=1,d+=v.length,A(r,c.symbolId,v,i,I=>{l+=1,u+=I});continue}let s=h();if(!s){i&&(o+=1);continue}if(i&&(a+=1),s.referencesForDefinitions){let I=_.get(s);I?I.push(c):_.set(s,[c])}else w.push({provider:s,definition:c})}let M=new Set;if(D)for(let[c,y]of D){if(!c.referencesAndCalleesForDefinitions)continue;let h=_.get(c)??[],g=c.referencesAndCalleesForDefinitions(h,y);M.add(c),Te(n,g.callees);for(let v of h){if(!g.references.has(v.symbolId))continue;let s=g.references.get(v.symbolId)??[];A(r,v.symbolId,s,i,I=>{l+=1,u+=I})}}for(let[c,y]of _){if(M.has(c))continue;let h=c.referencesForDefinitions(y);for(let g of y){if(!h.has(g.symbolId))continue;let v=h.get(g.symbolId)??[];A(r,g.symbolId,v,i,s=>{l+=1,u+=s})}}for(let{provider:c,definition:y}of w){let h=c.referencesFor(y);A(r,y.symbolId,h,i,g=>{l+=1,u+=g})}return r},()=>({definitions:e.length,providerHits:a,providerMisses:o,rustDefaultFastPathRows:f,rustDefaultFastPathReferences:m,rustScipOccurrenceFastPathRows:S,rustScipOccurrenceFastPathReferences:d,prefetchCalleeDefinitions:p,definitionsWithReferences:l,referenceCount:u,rows:r.size}))}function A(n,e,t,i,r){n.set(e,t),i&&t.length>0&&r(t.length)}function K(n,e,t,i){let r=0;for(let a of i){if(a.file===t.relativePath||n.isIgnored(a.file))continue;let o=e.get(t.symbolId);o||(o=new Set,e.set(t.symbolId,o));let f=o.size;o.add(a.file),o.size!==f&&(r+=1)}return r}function Ne(n){try{return JSON.parse(n)}catch{return null}}function Sn(n,e){return k(n).calleeMap(e)}function He(n,e){let t=O(),i=new Map,r=0,a=0,o=0,f=0;return P("semantic.callees.provider-loop",()=>{let m=new Map,S=[];for(let d of e){let l=E(n,d.relativePath);if(!l){t&&(a+=1);continue}t&&(r+=1);let u=d;if(l.calleesForDefinitions){let p=m.get(l);p?p.push(u):m.set(l,[u])}else S.push({provider:l,definition:u})}for(let[d,l]of m){let u=d.calleesForDefinitions(l);for(let p of l){let b=u.get(p.symbolId)??[];pe(i,p.symbolId,b,t,R=>{o+=1,f+=R})}}for(let{provider:d,definition:l}of S){let u=d.calleesFor(l);pe(i,l.symbolId,u,t,p=>{o+=1,f+=p})}return i},()=>({definitions:e.length,providerHits:r,providerMisses:a,definitionsWithCallees:o,calleeCount:f,rows:i.size}))}function pe(n,e,t,i,r){t.length>0&&(n.set(e,t),i&&r(t.length))}function hn(n,e){return k(n).signature(e)}function Ue(n,e){if(x(e.relativePath)==="typescript"){let o="fallback",f=0,m=0,S=0,d=0;return P("typescript.signature.materialize",()=>{let l=G(n,e.relativePath,we);if(l?.key){f=1;let p=me.read(n,e.relativePath,l.key)??{};if(Object.prototype.hasOwnProperty.call(p,e.symbol))return o="hit",m=1,p[e.symbol]??null;S=1;let b=E(n,e.relativePath);if(!b)return o="unavailable",null;let R=b.signatureFor(e);return me.write(n,e.relativePath,l.key,{...p,[e.symbol]:R}),o="computed",R}d=1;let u=E(n,e.relativePath);return u?(o="direct-fallback",u.signatureFor(e)):(o="unavailable",null)},()=>({state:o,eligible:f,cacheHits:m,cacheMisses:S,fallbacks:d}))}let t=Se(n,"semantic-signatures",e.relativePath),i=ze(e);if(t){let o=ue.read(n,i,t);if(o)return o.signature}let r=E(n,e.relativePath);if(!r)return null;let a=r.signatureFor(e);return t&&ue.write(n,i,t,{signature:a}),a}function Se(n,e,t){let i=z(n);if(!i)return null;let r=x(t);return r!=="rust"?null:U(JSON.stringify({kind:e,language:r,engine:$(n.config.projectRoot),projectFingerprint:i}))}function ze(n){return`${n.relativePath}\0${n.symbol}`}function he(n){try{let e=JSON.parse(n);return Array.isArray(e)?e:null}catch{return null}}function Le(n){try{let e=JSON.parse(n);if(!e||typeof e!="object")return null;let t=e.signature;return t!==null&&typeof t!="string"?null:{signature:t}}catch{return null}}function je(n){try{let e=JSON.parse(n);if(!e||typeof e!="object"||Array.isArray(e))return null;for(let t of Object.values(e))if(t!==null&&typeof t!="string")return null;return e}catch{return null}}function ye(n,e,t){let i=x(t);if(!i)return{slot:e,language:"typescript",available:!1,reason:"semantic evidence is only available for TypeScript or Rust files"};try{return{slot:e,language:i,...B(n,t).availability()}}catch(r){return{slot:e,language:i,available:!1,reason:r instanceof Error?r.message:String(r)}}}function E(n,e){if(!x(e))return null;let t=B(n,e);return t.availability().available?t:null}export{Je as a,$e as b,Be as c,ae as d,ce as e,k as f,fn as g,mn as h,pn as i,dn as j,gn as k,Oe as l,Sn as m,hn as n};
29
- //# sourceMappingURL=chunk-US44MEVU.js.map
@@ -1,7 +0,0 @@
1
- import{a as j}from"./chunk-J5XJWCB3.js";import{a as N,b as g,c as R}from"./chunk-AGTATREV.js";import{a as _}from"./chunk-FBUNGRKI.js";import{a as P}from"./chunk-7TJJY2C3.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as k}from"./chunk-BGBBVSH4.js";import{h as C}from"./chunk-EMIIOOTM.js";import{a as w}from"./chunk-DZXFZAZO.js";import{d,e as y,k as v,z as L}from"./chunk-AYRHVJXW.js";import{i as S}from"./chunk-GAE7WCBK.js";import{s as x}from"./chunk-FC5K7T35.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=N(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&x("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=T(t,c.symbolId,D);if(!M)continue;let p=W(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=T(t,e.symbolId,o);if(!r)return null;let s=W(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(a=>!S(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return R(t,e,o).realConsumers}function T(t,n,e){return t.get(`SELECT c.start_line, c.end_line
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d ON c.document_id = d.id
5
- WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
- LIMIT 1`,n,e)}function W(t,n,e,i,a){let o=t.definitionsForFile(e),r=q(n,e,i,a.start_line,a.end_line);return L(o,r)}function J(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:G(n,e),source:"file"}}function q(t,n,e,i,a){let o=y(e);if(!o)return i;let r=w(t,n).get(o);if(!r||r.length===0)return i;for(let s of r)if(s>=i&&s<=a)return s;return i}function z(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function G(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,b(n)),a=0;for(let[o,r]of t)o!==n&&m(o,b(o))===i&&r>a&&(a=r);return a}function H(t,n,e,i){return j(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ae as a};
7
- //# sourceMappingURL=chunk-XZXUMGAA.js.map
@@ -1,4 +0,0 @@
1
- type DiffGateActionTier = 'direct' | 'signal' | 'support';
2
- type DocCitationKind = 'behavioral-claim' | 'configuration-example' | 'guide-reference' | 'intentional-record';
3
-
4
- export type { DiffGateActionTier as D, DocCitationKind as a };
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as a}from"./chunk-RPEA7P5Z.js";import"./chunk-ESNRT7QN.js";export{a as directNavigationQueryCommandDescriptors};
3
- //# sourceMappingURL=direct-navigation-C2A44KFT.js.map