scip-query 0.10.7 → 0.10.10

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 (236) hide show
  1. package/README.md +4 -2
  2. package/dist/{chunk-OFO7BIRK.js → chunk-2UYQLFVC.js} +2 -2
  3. package/dist/chunk-2VM46FC5.js +8 -0
  4. package/dist/{chunk-WVRTGVHJ.js → chunk-3DGD6NKW.js} +2 -2
  5. package/dist/chunk-3Q77KKEY.js +2 -0
  6. package/dist/chunk-3VD3JMK2.js +2 -0
  7. package/dist/{chunk-U73YFD3P.js → chunk-4KTOV4QN.js} +2 -2
  8. package/dist/chunk-4N4WONI4.js +102 -0
  9. package/dist/{chunk-GOWLZ4NA.js → chunk-56P7PDST.js} +2 -2
  10. package/dist/{chunk-UBDFQBSE.js → chunk-5NVUWIAN.js} +2 -2
  11. package/dist/{chunk-S7DNZ6IW.js → chunk-5VG7RKEF.js} +2 -2
  12. package/dist/{chunk-MHATKJ3J.js → chunk-65AU3HFZ.js} +2 -2
  13. package/dist/{chunk-GKRRO3WC.js → chunk-6LNQOOTB.js} +2 -2
  14. package/dist/{chunk-OZUJ3VZS.js → chunk-72KY2ZFO.js} +2 -2
  15. package/dist/{chunk-QR337MAA.js → chunk-736BLPHR.js} +2 -2
  16. package/dist/chunk-7JRRXGVZ.js +2 -0
  17. package/dist/{chunk-XBIF45WK.js → chunk-7UQWUVRG.js} +2 -2
  18. package/dist/chunk-A6IDHNMC.js +4 -0
  19. package/dist/chunk-A6TANQNV.js +2 -0
  20. package/dist/{chunk-EOUTP32Q.js → chunk-AW2QHPLL.js} +2 -2
  21. package/dist/chunk-BSN22NRK.js +9 -0
  22. package/dist/{chunk-EW64FEJL.js → chunk-BVRS7RKQ.js} +2 -2
  23. package/dist/{chunk-FXWV2V7K.js → chunk-BZ53S4ZN.js} +2 -2
  24. package/dist/{chunk-MJXJ56LG.js → chunk-C5CTSJ6X.js} +2 -2
  25. package/dist/{chunk-OMGE3V2Q.js → chunk-CCKPYPDI.js} +2 -2
  26. package/dist/chunk-CZ425R2B.js +18 -0
  27. package/dist/{chunk-FPYQA7JK.js → chunk-DQVKIG3D.js} +2 -2
  28. package/dist/chunk-F6ICF7HL.js +40 -0
  29. package/dist/chunk-FAYI6KZ5.js +2 -0
  30. package/dist/{chunk-5JXH6VGF.js → chunk-FDEQIPPK.js} +2 -2
  31. package/dist/chunk-FRPEPTYJ.js +5 -0
  32. package/dist/chunk-GBEYTDY5.js +2 -0
  33. package/dist/{chunk-FXI3AAKO.js → chunk-GRJY65YT.js} +2 -2
  34. package/dist/chunk-HF25DFSC.js +3 -0
  35. package/dist/chunk-HHN2B5KA.js +2 -0
  36. package/dist/{chunk-H6RLM7D7.js → chunk-I46WR7MT.js} +2 -2
  37. package/dist/{chunk-GRZRMELG.js → chunk-IPQTC36U.js} +2 -2
  38. package/dist/{chunk-72QDTW5U.js → chunk-J7RWXLUL.js} +2 -2
  39. package/dist/{chunk-XYI7XRZC.js → chunk-KX5PLFZ5.js} +2 -2
  40. package/dist/{chunk-5LM7RJMQ.js → chunk-LPL4MA6R.js} +2 -2
  41. package/dist/chunk-LZHUWKGD.js +2 -0
  42. package/dist/{chunk-OT6CDRKC.js → chunk-MMLZEGMS.js} +2 -2
  43. package/dist/{chunk-LQSLW7K7.js → chunk-NZ4UDB5N.js} +2 -2
  44. package/dist/{chunk-3LQFMQPY.js → chunk-OBGRLXWF.js} +2 -2
  45. package/dist/chunk-P5RYBRIO.js +4 -0
  46. package/dist/chunk-PKMZCDQD.js +4 -0
  47. package/dist/{chunk-733EF5FD.js → chunk-PTQVNJ4Q.js} +2 -2
  48. package/dist/{chunk-EPPCGQUI.js → chunk-QPU7EXAW.js} +2 -2
  49. package/dist/chunk-QVI3NR7E.js +7 -0
  50. package/dist/{chunk-PTKQNPWX.js → chunk-QX7LLCGB.js} +2 -2
  51. package/dist/{chunk-27FU2KX7.js → chunk-QYB5P7GL.js} +2 -2
  52. package/dist/chunk-RVWSAMTT.js +2 -0
  53. package/dist/{chunk-GIOT3O6P.js → chunk-RXRLZFUL.js} +2 -2
  54. package/dist/{chunk-KT2ZO3CE.js → chunk-RYXW3KRC.js} +2 -2
  55. package/dist/{chunk-OWXN6ZS5.js → chunk-SGLLBSCV.js} +2 -2
  56. package/dist/{chunk-XAYARHNF.js → chunk-SULEXAHO.js} +2 -2
  57. package/dist/{chunk-IL2EVPYP.js → chunk-TH2N6QHW.js} +2 -2
  58. package/dist/{chunk-J43GIAVM.js → chunk-TL6QPNF5.js} +2 -2
  59. package/dist/{chunk-PQ6QG3EX.js → chunk-UDGXK2WA.js} +2 -2
  60. package/dist/{chunk-WMIQMXSK.js → chunk-UFX7EPBA.js} +2 -2
  61. package/dist/chunk-UQLFQLAF.js +2 -0
  62. package/dist/{chunk-WXMVK53S.js → chunk-UWYJDBDW.js} +2 -2
  63. package/dist/{chunk-VA3FJ3AY.js → chunk-UYD7FJ3K.js} +2 -2
  64. package/dist/{chunk-RISLKTKQ.js → chunk-VUKC6F77.js} +2 -2
  65. package/dist/{chunk-FRIASDLG.js → chunk-WG6KRH5F.js} +2 -2
  66. package/dist/{chunk-QMH2D6S5.js → chunk-XIVO4SDZ.js} +2 -2
  67. package/dist/{chunk-QPTVFG4O.js → chunk-XSNRACLV.js} +2 -2
  68. package/dist/chunk-XUGQU7PM.js +41 -0
  69. package/dist/{chunk-SXESPZUX.js → chunk-XXZXDXTD.js} +2 -2
  70. package/dist/chunk-Y6E3JHC4.js +2 -0
  71. package/dist/{chunk-DBTL56LR.js → chunk-YBEEVDJQ.js} +2 -2
  72. package/dist/chunk-YGHUVQLR.js +2 -0
  73. package/dist/chunk-YWDVDAD7.js +2 -0
  74. package/dist/chunk-YWOOQ4FF.js +2 -0
  75. package/dist/{chunk-NIGHS7UP.js → chunk-Z4I7BVIU.js} +2 -2
  76. package/dist/{chunk-TDBTVMHY.js → chunk-ZQO43G2T.js} +2 -2
  77. package/dist/{chunk-YNLK3G63.js → chunk-ZU6PROUY.js} +2 -2
  78. package/dist/cli.js +256 -205
  79. package/dist/{db-BAVwb4Pb.d.ts → db-Djj3Nqrb.d.ts} +2 -0
  80. package/dist/{health-B17sVFYf.d.ts → health-D5J42g4D.d.ts} +1 -1
  81. package/dist/index.d.ts +3 -2
  82. package/dist/index.js +3 -3
  83. package/dist/postinstall.js +1 -1
  84. package/dist/queries/affected.d.ts +1 -1
  85. package/dist/queries/affected.js +1 -1
  86. package/dist/queries/bottlenecks.d.ts +1 -1
  87. package/dist/queries/bottlenecks.js +1 -1
  88. package/dist/queries/by-kind.d.ts +1 -1
  89. package/dist/queries/by-kind.js +1 -1
  90. package/dist/queries/call-graph.d.ts +1 -1
  91. package/dist/queries/call-graph.js +1 -1
  92. package/dist/queries/change-surface.d.ts +1 -1
  93. package/dist/queries/change-surface.js +1 -1
  94. package/dist/queries/cleanup-plan.d.ts +1 -1
  95. package/dist/queries/cleanup-plan.js +1 -1
  96. package/dist/queries/co-change.d.ts +1 -1
  97. package/dist/queries/co-change.js +1 -1
  98. package/dist/queries/code.d.ts +1 -1
  99. package/dist/queries/code.js +1 -1
  100. package/dist/queries/complexity-hotspots.d.ts +1 -1
  101. package/dist/queries/complexity-hotspots.js +1 -1
  102. package/dist/queries/complexity.d.ts +1 -1
  103. package/dist/queries/complexity.js +1 -1
  104. package/dist/queries/convergence.d.ts +1 -1
  105. package/dist/queries/convergence.js +1 -1
  106. package/dist/queries/coupling.d.ts +1 -1
  107. package/dist/queries/coupling.js +1 -1
  108. package/dist/queries/cycles.d.ts +1 -1
  109. package/dist/queries/cycles.js +1 -1
  110. package/dist/queries/dataflow.d.ts +1 -1
  111. package/dist/queries/dataflow.js +1 -1
  112. package/dist/queries/dead.d.ts +1 -1
  113. package/dist/queries/dead.js +1 -1
  114. package/dist/queries/deep-chains.d.ts +1 -1
  115. package/dist/queries/deep-chains.js +1 -1
  116. package/dist/queries/deps.d.ts +1 -1
  117. package/dist/queries/deps.js +1 -1
  118. package/dist/queries/diff-gate.d.ts +1 -1
  119. package/dist/queries/diff-gate.js +1 -1
  120. package/dist/queries/diff-impact.d.ts +1 -1
  121. package/dist/queries/diff-impact.js +1 -1
  122. package/dist/queries/doc-drift.d.ts +1 -1
  123. package/dist/queries/doc-drift.js +1 -1
  124. package/dist/queries/drift.d.ts +2 -1
  125. package/dist/queries/drift.js +1 -1
  126. package/dist/queries/extract-candidates.d.ts +1 -1
  127. package/dist/queries/extract-candidates.js +1 -1
  128. package/dist/queries/fan.d.ts +1 -1
  129. package/dist/queries/fan.js +1 -1
  130. package/dist/queries/files.d.ts +1 -1
  131. package/dist/queries/health.d.ts +2 -2
  132. package/dist/queries/health.js +1 -1
  133. package/dist/queries/hierarchy.d.ts +1 -1
  134. package/dist/queries/hierarchy.js +1 -1
  135. package/dist/queries/hotspots.d.ts +1 -1
  136. package/dist/queries/hotspots.js +1 -1
  137. package/dist/queries/imports.d.ts +1 -1
  138. package/dist/queries/imports.js +1 -1
  139. package/dist/queries/incomplete-migration.d.ts +1 -1
  140. package/dist/queries/incomplete-migration.js +1 -1
  141. package/dist/queries/index.d.ts +2 -2
  142. package/dist/queries/index.js +1 -1
  143. package/dist/queries/isolated.d.ts +1 -1
  144. package/dist/queries/isolated.js +1 -1
  145. package/dist/queries/locality-candidates.d.ts +1 -1
  146. package/dist/queries/locality-candidates.js +1 -1
  147. package/dist/queries/members.d.ts +1 -1
  148. package/dist/queries/members.js +1 -1
  149. package/dist/queries/methods.d.ts +1 -1
  150. package/dist/queries/methods.js +1 -1
  151. package/dist/queries/outline.d.ts +1 -1
  152. package/dist/queries/outline.js +1 -1
  153. package/dist/queries/passthrough-candidates.d.ts +1 -1
  154. package/dist/queries/passthrough-candidates.js +1 -1
  155. package/dist/queries/plan-context.d.ts +1 -1
  156. package/dist/queries/plan-context.js +1 -1
  157. package/dist/queries/react-component-duplicates.d.ts +2 -1
  158. package/dist/queries/react-component-duplicates.js +1 -1
  159. package/dist/queries/react-hook-candidates.d.ts +2 -1
  160. package/dist/queries/react-hook-candidates.js +1 -1
  161. package/dist/queries/react-large-component-pressure.d.ts +1 -1
  162. package/dist/queries/react-large-component-pressure.js +1 -1
  163. package/dist/queries/recent-duplicates.d.ts +1 -1
  164. package/dist/queries/recent-duplicates.js +1 -1
  165. package/dist/queries/redundant-reexports.d.ts +1 -1
  166. package/dist/queries/redundant-reexports.js +1 -1
  167. package/dist/queries/refs.d.ts +1 -1
  168. package/dist/queries/refs.js +1 -1
  169. package/dist/queries/self-audit.d.ts +1 -1
  170. package/dist/queries/self-audit.js +1 -1
  171. package/dist/queries/similar-chains.d.ts +1 -1
  172. package/dist/queries/similar-chains.js +1 -1
  173. package/dist/queries/similar-files.d.ts +1 -1
  174. package/dist/queries/similar-files.js +1 -1
  175. package/dist/queries/similar-signatures.d.ts +1 -1
  176. package/dist/queries/similar-signatures.js +1 -1
  177. package/dist/queries/similar.d.ts +11 -2
  178. package/dist/queries/similar.js +1 -1
  179. package/dist/queries/slice.d.ts +1 -1
  180. package/dist/queries/slice.js +1 -1
  181. package/dist/queries/stale-abstractions.d.ts +1 -1
  182. package/dist/queries/stale-abstractions.js +1 -1
  183. package/dist/queries/stats.d.ts +1 -1
  184. package/dist/queries/surface.d.ts +1 -1
  185. package/dist/queries/surface.js +1 -1
  186. package/dist/queries/symbols.d.ts +1 -1
  187. package/dist/queries/symbols.js +1 -1
  188. package/dist/queries/system.d.ts +1 -1
  189. package/dist/queries/system.js +1 -1
  190. package/dist/queries/trace.d.ts +1 -1
  191. package/dist/queries/trace.js +1 -1
  192. package/dist/queries/unused-imports.d.ts +1 -1
  193. package/dist/queries/unused-imports.js +1 -1
  194. package/dist/queries/unused-params.d.ts +1 -1
  195. package/dist/queries/unused-params.js +1 -1
  196. package/dist/queries/vue-component-duplicates.d.ts +2 -1
  197. package/dist/queries/vue-component-duplicates.js +1 -1
  198. package/dist/queries/vue-composable-candidates.d.ts +2 -1
  199. package/dist/queries/vue-composable-candidates.js +1 -1
  200. package/dist/queries/vue-large-view-pressure.d.ts +1 -1
  201. package/dist/queries/wrapper-candidates.d.ts +1 -1
  202. package/dist/queries/wrapper-candidates.js +1 -1
  203. package/dist/runtime.js +1 -1
  204. package/docs/COMMAND_REFERENCE.md +1 -1
  205. package/docs/analyzer-inventory.md +29 -0
  206. package/docs/analyzer-validation-ledger.md +32 -1
  207. package/package.json +1 -1
  208. package/skills/scip-hyper-optimization/SKILL.md +97 -0
  209. package/skills/scip-hyper-optimization/agents/openai.yaml +4 -0
  210. package/skills/scip-query/SKILL.md +4 -0
  211. package/dist/chunk-3C4NIBY5.js +0 -2
  212. package/dist/chunk-5MHQI4RR.js +0 -3
  213. package/dist/chunk-7AOMEMOA.js +0 -4
  214. package/dist/chunk-BZ2RRK7Y.js +0 -8
  215. package/dist/chunk-C6ROZBJA.js +0 -32
  216. package/dist/chunk-CMXD5VC4.js +0 -2
  217. package/dist/chunk-CQEJU32R.js +0 -2
  218. package/dist/chunk-DOZ2X6TS.js +0 -2
  219. package/dist/chunk-FKYPOK7P.js +0 -5
  220. package/dist/chunk-G2CGUNQU.js +0 -4
  221. package/dist/chunk-HDBQHJNY.js +0 -2
  222. package/dist/chunk-IA7Q6HVP.js +0 -18
  223. package/dist/chunk-JOGZKF5W.js +0 -2
  224. package/dist/chunk-KRGBLZT2.js +0 -7
  225. package/dist/chunk-KUIIQPDA.js +0 -2
  226. package/dist/chunk-LONIY5FF.js +0 -2
  227. package/dist/chunk-M3YEHOCD.js +0 -2
  228. package/dist/chunk-MFWAZFYD.js +0 -2
  229. package/dist/chunk-P3K7LX7M.js +0 -4
  230. package/dist/chunk-PVZMPG5I.js +0 -2
  231. package/dist/chunk-QVS4SYAX.js +0 -7
  232. package/dist/chunk-TJXOD4IK.js +0 -62
  233. package/dist/chunk-UJEVABIR.js +0 -2
  234. package/dist/chunk-W2TIXAGN.js +0 -40
  235. package/dist/chunk-YOCYR7KJ.js +0 -2
  236. package/dist/chunk-ZUTV7DDX.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-XAYARHNF.js";import{a as u}from"./chunk-733EF5FD.js";import{c as i}from"./chunk-JM72FNGA.js";function w(r,b,y,f={}){let s=u(r,b),n=u(r,y);if(!s||!n)return null;let c=new Set(g(r,s,{semantic:f.semantic}).map(e=>e.symbol)),m=new Set(g(r,n,{semantic:f.semantic}).map(e=>e.symbol)),l=[];for(let e of c)m.has(e)&&l.push(e);let o=[];for(let e of c)m.has(e)||o.push(e);let a=[];for(let e of m)c.has(e)||a.push(e);let h=new Set([...c,...m]),d=h.size>0?l.length/h.size:0,t;h.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":l.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&a.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":a.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&a.length<=2?t=`Create a shared function with the ${l.length} common callees. Pass the ${o.length+a.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${l.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${a.length} in B).`;let p=s.endLine-s.startLine+1,A=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:i(s.symbol),file:s.relativePath,loc:p},symbolB:{symbol:n.symbol,shortName:i(n.symbol),file:n.relativePath,loc:A},similarity:d,sharedCallees:l.map(i),uniqueToA:o.map(i),uniqueToB:a.map(i),consolidationStrategy:t}}export{w as a};
2
- //# sourceMappingURL=chunk-QMH2D6S5.js.map
1
+ import{a as g}from"./chunk-SULEXAHO.js";import{a as u}from"./chunk-PTQVNJ4Q.js";import{c as i}from"./chunk-JM72FNGA.js";function w(r,b,y,f={}){let s=u(r,b),n=u(r,y);if(!s||!n)return null;let c=new Set(g(r,s,{semantic:f.semantic}).map(e=>e.symbol)),m=new Set(g(r,n,{semantic:f.semantic}).map(e=>e.symbol)),l=[];for(let e of c)m.has(e)&&l.push(e);let o=[];for(let e of c)m.has(e)||o.push(e);let a=[];for(let e of m)c.has(e)||a.push(e);let h=new Set([...c,...m]),d=h.size>0?l.length/h.size:0,t;h.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":l.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&a.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":a.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&a.length<=2?t=`Create a shared function with the ${l.length} common callees. Pass the ${o.length+a.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${l.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${a.length} in B).`;let p=s.endLine-s.startLine+1,A=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:i(s.symbol),file:s.relativePath,loc:p},symbolB:{symbol:n.symbol,shortName:i(n.symbol),file:n.relativePath,loc:A},similarity:d,sharedCallees:l.map(i),uniqueToA:o.map(i),uniqueToB:a.map(i),consolidationStrategy:t}}export{w as a};
2
+ //# sourceMappingURL=chunk-XIVO4SDZ.js.map
@@ -1,3 +1,3 @@
1
- import{p as d}from"./chunk-W2TIXAGN.js";import{a as h}from"./chunk-733EF5FD.js";import{g}from"./chunk-JM72FNGA.js";import{a as m}from"./chunk-DS6QEB3G.js";import{a as p}from"./chunk-64MNV6AB.js";function _(t,r,n={}){let e=h(t,r);if(!e)return[];let l=!g(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=d(t,e,{semantic:n.semantic}).map(o=>({relativePath:o.file,line:o.line})),s=R(t,e),f=new Set,a=[];for(let o of[...l,...c,...s]){let u=`${o.relativePath}:${o.line}`;f.has(u)||(f.add(u),a.push(o))}return a}function R(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=b(r.symbol);if(n.length===0)return[];let e=[];for(let i of p(t,{extensions:[".rb"],includeIgnored:!1})){let l=m(t,i);if(!l)continue;let c=l.split(`
1
+ import{q as d}from"./chunk-F6ICF7HL.js";import{a as h}from"./chunk-PTQVNJ4Q.js";import{g}from"./chunk-JM72FNGA.js";import{a as m}from"./chunk-DS6QEB3G.js";import{a as p}from"./chunk-64MNV6AB.js";function _(t,r,n={}){let e=h(t,r);if(!e)return[];let l=!g(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=d(t,e,{semantic:n.semantic}).map(o=>({relativePath:o.file,line:o.line})),s=R(t,e),f=new Set,a=[];for(let o of[...l,...c,...s]){let u=`${o.relativePath}:${o.line}`;f.has(u)||(f.add(u),a.push(o))}return a}function R(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=b(r.symbol);if(n.length===0)return[];let e=[];for(let i of p(t,{extensions:[".rb"],includeIgnored:!1})){let l=m(t,i);if(!l)continue;let c=l.split(`
2
2
  `);for(let s=0;s<c.length;s++){let f=c[s]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:s})}}return e}function b(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{_ as a};
3
- //# sourceMappingURL=chunk-QPTVFG4O.js.map
3
+ //# sourceMappingURL=chunk-XSNRACLV.js.map
@@ -0,0 +1,41 @@
1
+ import{c as p}from"./chunk-7S5E7KWT.js";import{createHash as h}from"crypto";import{readFileSync as v}from"fs";import{dirname as g,join as f}from"path";import N from"better-sqlite3";var y="evidence.db",d=new WeakMap,m=p("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),L=p("evidence-project-fingerprint",{clearGroups:["whole-project"]}),c="evidence-v1",E="version NOT LIKE 'evidence-%'";function T(n){return h("sha256").update(n).digest("hex")}function A(n,t,e){return m.get(n,t,()=>T(e))}function O(n){return L.get(n,"current",()=>{try{let t=JSON.parse(v(f(g(n.config.dbPath),"meta.json"),"utf-8"));if(t.version!==2&&t.version!==3||t.status!=="complete"||t.fingerprint===void 0)return null;let e=Array.isArray(t.indexedLanguages)?[...t.indexedLanguages].sort():[];return T(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:e}))}catch(t){return u("project fingerprint unavailable",t),null}})}function u(n,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${n}: ${t instanceof Error?t.message:String(t)}`)}function s(n){if(d.has(n))return d.get(n)??null;let t=null;try{let e=new N(f(g(n.config.dbPath),y));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.exec(`
2
+ CREATE TABLE IF NOT EXISTS file_evidence (
3
+ kind TEXT NOT NULL,
4
+ relative_path TEXT NOT NULL,
5
+ content_hash TEXT NOT NULL,
6
+ version TEXT NOT NULL,
7
+ payload TEXT NOT NULL,
8
+ PRIMARY KEY (kind, relative_path)
9
+ );
10
+ CREATE TABLE IF NOT EXISTS semantic_callees (
11
+ relative_path TEXT NOT NULL,
12
+ symbol TEXT NOT NULL,
13
+ content_hash TEXT NOT NULL,
14
+ deps_digest TEXT NOT NULL,
15
+ version TEXT NOT NULL,
16
+ payload TEXT NOT NULL,
17
+ PRIMARY KEY (relative_path, symbol)
18
+ );
19
+ CREATE TABLE IF NOT EXISTS semantic_references (
20
+ relative_path TEXT NOT NULL,
21
+ symbol TEXT NOT NULL,
22
+ project_fingerprint TEXT NOT NULL,
23
+ version TEXT NOT NULL,
24
+ payload TEXT NOT NULL,
25
+ PRIMARY KEY (relative_path, symbol)
26
+ );
27
+ `),t={evidence:e,readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.prepare(`SELECT payload FROM file_evidence
28
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${E}
29
+ ORDER BY version DESC
30
+ LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
31
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.prepare(`SELECT payload FROM semantic_callees
32
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${E}
33
+ ORDER BY version DESC
34
+ LIMIT 1`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
35
+ (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
36
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.prepare(`SELECT payload FROM semantic_references
37
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${E}
38
+ ORDER BY version DESC
39
+ LIMIT 1`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
40
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE project_fingerprint != ?")}}catch(e){u("disabled (open failed)",e)}return d.set(n,t),t}function o(n,t,e){u(`disabled (${t})`,e),d.set(n,null)}function b(n,t,e,a){let r=s(n);if(!r)return null;try{return(r.readFileEvidence.get(t,e,a,c)??r.readLegacyFileEvidence.get(t,e,a))?.payload??null}catch(i){return o(n,"file_evidence read",i),null}}function w(n,t,e,a,r){let i=s(n);if(i)try{i.writeFileEvidence.run(t,e,a,c,r)}catch(l){o(n,"file_evidence write",l)}}function F(n,t,e,a,r){let i=s(n);if(!i)return null;try{return(i.readCallees.get(t,e,a,r,c)??i.readLegacyCallees.get(t,e,a,r))?.payload??null}catch(l){return o(n,"semantic_callees read",l),null}}function I(n,t,e,a){let r=s(n);if(!r)return null;try{return(r.readReferences.get(t,e,a,c)??r.readLegacyReferences.get(t,e,a))?.payload??null}catch(i){return o(n,"semantic_references read",i),null}}function x(n,t){if(t.length===0)return;let e=s(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(r.relativePath,r.contentHash)),e.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,c,r.payload)}})()}catch(a){o(n,"semantic_callees write",a)}}function U(n,t){if(t.length===0)return;let e=s(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t)a.has(r.projectFingerprint)||(a.add(r.projectFingerprint),e.dropStaleReferences.run(r.projectFingerprint)),e.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,c,r.payload)})()}catch(a){o(n,"semantic_references write",a)}}function j(n){return typeof n=="object"&&n!==null}function X(n){return Array.isArray(n)&&n.every(t=>typeof t=="string")?n:null}export{T as a,A as b,O as c,b as d,w as e,F as f,I as g,x as h,U as i,j,X as k};
41
+ //# sourceMappingURL=chunk-XUGQU7PM.js.map
@@ -1,2 +1,2 @@
1
- import{c as m}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-MFWAZFYD.js";import{a as g}from"./chunk-XAYARHNF.js";import{p as y}from"./chunk-W2TIXAGN.js";import{a as c}from"./chunk-733EF5FD.js";import{c as r}from"./chunk-JM72FNGA.js";function v(l,t,n={}){let o=c(l,t);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],s=y(l,o,{semantic:n.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:i}=S(l,o,s,{semantic:n.semantic!==!1});return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:i.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function S(l,t,n,o){let a=m(g(l,t,{limit:30,semantic:o.semantic}).map(i=>({symbol:i.symbol,file:i.file}))),s=m(b(l,t,{limit:30,semantic:o.semantic})),f=s.length>0?s:m(n.map(i=>({symbol:i.enclosingSymbol==="(top-level)"?i.file:i.enclosingSymbol,file:i.file})));return{producers:a,consumers:f}}export{v as a};
2
- //# sourceMappingURL=chunk-SXESPZUX.js.map
1
+ import{c as m}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-UQLFQLAF.js";import{a as g}from"./chunk-SULEXAHO.js";import{q as y}from"./chunk-F6ICF7HL.js";import{a as c}from"./chunk-PTQVNJ4Q.js";import{c as r}from"./chunk-JM72FNGA.js";function v(l,t,n={}){let o=c(l,t);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],s=y(l,o,{semantic:n.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:i}=S(l,o,s,{semantic:n.semantic!==!1});return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:i.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function S(l,t,n,o){let a=m(g(l,t,{limit:30,semantic:o.semantic}).map(i=>({symbol:i.symbol,file:i.file}))),s=m(b(l,t,{limit:30,semantic:o.semantic})),f=s.length>0?s:m(n.map(i=>({symbol:i.enclosingSymbol==="(top-level)"?i.file:i.enclosingSymbol,file:i.file})));return{producers:a,consumers:f}}export{v as a};
2
+ //# sourceMappingURL=chunk-XXZXDXTD.js.map
@@ -0,0 +1,2 @@
1
+ import{a as b}from"./chunk-PFOCOG57.js";import{a as u}from"./chunk-GBEYTDY5.js";import{c as p}from"./chunk-JM72FNGA.js";function C(e,r){let{scope:c,minLoc:l=10,limit:s=30,scanLimit:a}=r??{},o=new u(e);return b({candidates:()=>o.productionCallableDefinitions({scope:c,minLoc:l,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,prepare:t=>({callerMap:o.crossFileCallerMap(t,{semantic:r?.semantic!==!1}),calleeMap:o.calleeMap(t,{semantic:r?.semantic!==!1})}),evaluate:(t,n)=>d(t,n,l),orderResults:(t,n)=>n.score-t.score||n.loc-t.loc,limit:s})}function d(e,r,c){let l=e.endLine-e.startLine+1;if(l<c)return null;let s=r.callerMap.get(e.symbolId)?.size??0,a=r.calleeMap.get(e.symbolId)??[],o=new Set,t=new Set;for(let m of a){let i=`${m.symbol}|${m.file}`;o.add(i),m.file!==e.relativePath&&t.add(i)}let n=t.size,y=o.size;return{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:l,fanIn:s,fanOut:n,calleeCount:y,score:Math.round(l/50*(s/5)*Math.max(n/5,1)*100)/100}}export{C as a};
2
+ //# sourceMappingURL=chunk-Y6E3JHC4.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-LONIY5FF.js";import{a as l}from"./chunk-733EF5FD.js";import{d as o,f as a}from"./chunk-JM72FNGA.js";import{basename as d}from"path";function M(t,c){let n=l(t,c);if(!n)return[];let r=o(n.symbol),s=new m(t).definitionsForFile(n.relativePath).filter(e=>a(e.symbol)),i=s.filter(e=>e.parentTypeName===r||e.symbol.includes(r));return(i.length>0?i:p(d(n.relativePath))===r?s.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:o(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
2
- //# sourceMappingURL=chunk-DBTL56LR.js.map
1
+ import{a as m}from"./chunk-GBEYTDY5.js";import{a as l}from"./chunk-PTQVNJ4Q.js";import{d as o,f as a}from"./chunk-JM72FNGA.js";import{basename as d}from"path";function M(t,c){let n=l(t,c);if(!n)return[];let r=o(n.symbol),s=new m(t).definitionsForFile(n.relativePath).filter(e=>a(e.symbol)),i=s.filter(e=>e.parentTypeName===r||e.symbol.includes(r));return(i.length>0?i:p(d(n.relativePath))===r?s.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:o(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
2
+ //# sourceMappingURL=chunk-YBEEVDJQ.js.map
@@ -0,0 +1,2 @@
1
+ import{b as r}from"./chunk-RYXW3KRC.js";import{j as e}from"./chunk-4N4WONI4.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-YGHUVQLR.js.map
@@ -0,0 +1,2 @@
1
+ import{a as D}from"./chunk-LZHUWKGD.js";import{a as F}from"./chunk-HHN2B5KA.js";import{a as f}from"./chunk-FAYI6KZ5.js";import{a as g}from"./chunk-RVWSAMTT.js";import{c as y}from"./chunk-FRPEPTYJ.js";import{e as h}from"./chunk-BSN22NRK.js";import{d as p}from"./chunk-A536TEU4.js";var v=.7,R=.62,S=.45;function Y(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=h(i);if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let l=I(s,e);if(l.size===0)return{available:!0,windowCommits:e,findings:[]};let d=A(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:l}).map(r=>w(r,s,e)).filter(r=>r!==null);d.sort((r,c)=>(r.kind===c.kind?0:r.kind==="echo"?-1:1)||c.similarity-r.similarity||r.echoFile.localeCompare(c.echoFile)||r.echoSymbol.localeCompare(c.echoSymbol)||r.domain.localeCompare(c.domain));let b=d.slice(0,n).map(T);return{available:!0,windowCommits:e,findings:b,rootCauseGroups:N(b)}}function A(i,t){let e=K(t.limit),n=[...B(i,{scope:t.scope,minSimilarity:t.minSimilarity??v,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=p(i,{scope:t.scope});return a.react&&n.push(...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function B(i,t){return y(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function k(i,t){return u(i,t,{query:f,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:P(...e.evidenceBuckets(n)),sharedCallees:[]}))}function E(i,t){return u(i,t,{query:g,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}function L(i,t){return u(i,t,{query:F,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function x(i,t){return u(i,t,{query:D,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function I(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function w(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let l=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:l?i.symbolA:i.symbolB,echoFile:l?i.fileA:i.fileB,echoAgeCommits:(l?n:a)??0,establishedSymbol:l?i.symbolB:i.symbolA,establishedFile:l?i.fileB:i.fileA,establishedAgeCommits:l?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function T(i){let t=C(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function C(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??C(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:O(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let l of n.sharedEvidence)s.sharedEvidence.add(l)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function O(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function P(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{Y as a};
2
+ //# sourceMappingURL=chunk-YWDVDAD7.js.map
@@ -0,0 +1,2 @@
1
+ function g(r,t){let e=new Set;for(let n of r)t.has(n)&&e.add(n);return e}function l(r,t){let e=new Set;for(let n of r)t.has(n)||e.add(n);return e}function S(r,t){if(r.size===0&&t.size===0)return 0;let e=0;for(let i of r)t.has(i)&&(e+=1);let n=r.size+t.size-e;return n===0?0:e/n}function p(r,t){if(r.size===0)return 0;let e=0;for(let n of r)t.has(n)&&(e+=1);return e/r.size}function M(r,t){if(t<=0)return new Map;let e=new Map;for(let[n,i]of r)i>0&&e.set(n,Math.log(t/i));return e}function m(r){let t=[...r.values()].sort((n,i)=>n-i);if(t.length===0)return 0;let e=Math.floor(t.length/2);return t.length%2===0?(t[e-1]+t[e])/2:t[e]}function b(r,t){let e=0;for(let n of r){let i=t.get(n)??0;e+=i*i}return Math.sqrt(e)}function w(r,t,e,n={}){let i=0,T=0,u=0,d=n.medianIdf??m(e),f=[],h=[];for(let s of r){let o=e.get(s)??0;T+=o*o,t.has(s)&&(i+=o*o,o>=d?f.push(s):h.push(s))}if(f.length===0&&h.length===0)return{similarity:0,significantShared:[],trivialShared:[]};for(let s of t){let o=e.get(s)??0;u+=o*o}let a=Math.sqrt(T)*Math.sqrt(u),c=a>0?i/a:0;return f.sort((s,o)=>(e.get(o)??0)-(e.get(s)??0)),{similarity:c,significantShared:f,trivialShared:h}}function y(r,t,e,n){let i=0,T=n.medianIdf??m(e),u=[],d=[];for(let a of r){if(!t.has(a))continue;let c=e.get(a)??0;i+=c*c,c>=T?u.push(a):d.push(a)}if(u.length===0&&d.length===0)return{similarity:0,significantShared:[],trivialShared:[]};let f=n.magnitudeA*n.magnitudeB,h=f>0?i/f:0;return u.sort((a,c)=>(e.get(c)??0)-(e.get(a)??0)),{similarity:h,significantShared:u,trivialShared:d}}export{g as a,l as b,S as c,p as d,M as e,m as f,b as g,w as h,y as i};
2
+ //# sourceMappingURL=chunk-YWOOQ4FF.js.map
@@ -1,3 +1,3 @@
1
- import{a as d}from"./chunk-733EF5FD.js";import{a as g,c as m}from"./chunk-JM72FNGA.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
1
+ import{a as d}from"./chunk-PTQVNJ4Q.js";import{a as g,c as m}from"./chunk-JM72FNGA.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
2
  WHERE id = ? LIMIT 1`,a.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,c=new Set([t.symbol]);for(;e&&!c.has(e)&&r<20;){c.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,h=1;s>=0;s--,h++){let p=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:p,shortName:p,depth:h})}return b}export{_ as a};
3
- //# sourceMappingURL=chunk-NIGHS7UP.js.map
3
+ //# sourceMappingURL=chunk-Z4I7BVIU.js.map
@@ -1,4 +1,4 @@
1
- import{a as f}from"./chunk-KT2ZO3CE.js";import{a as d}from"./chunk-LONIY5FF.js";import{e as c}from"./chunk-U73YFD3P.js";import{c as u}from"./chunk-JM72FNGA.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
1
+ import{a as f}from"./chunk-RYXW3KRC.js";import{a as d}from"./chunk-GBEYTDY5.js";import{e as c}from"./chunk-4KTOV4QN.js";import{c as u}from"./chunk-JM72FNGA.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
2
2
  WHERE relative_path = ?
3
3
  ${e.pathExclusionsFor("documents")}
4
4
  LIMIT 1`,n)??null}function g(e,n){return new d(e).definitionsForFile(n).sort((i,t)=>i.startLine-t.startLine||i.endLine-t.endLine)}function S(e,n,i,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
@@ -8,4 +8,4 @@ import{a as f}from"./chunk-KT2ZO3CE.js";import{a as d}from"./chunk-LONIY5FF.js";
8
8
  WHERE m.symbol_id = ?
9
9
  AND m.role != 1
10
10
  AND c.document_id != ?`,i.symbolId,n.id);return new Set([...r.map(s=>s.relative_path),...[...t].filter(s=>s!==n.relative_path)]).size}function b(e){return e>10?"high":e>0?"medium":"low"}export{L as a};
11
- //# sourceMappingURL=chunk-TDBTVMHY.js.map
11
+ //# sourceMappingURL=chunk-ZQO43G2T.js.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-PFOCOG57.js";import{a as m}from"./chunk-LONIY5FF.js";import{a as d}from"./chunk-BGBBVSH4.js";import{c as u}from"./chunk-JM72FNGA.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
- //# sourceMappingURL=chunk-YNLK3G63.js.map
1
+ import{a as g}from"./chunk-PFOCOG57.js";import{a as m}from"./chunk-GBEYTDY5.js";import{a as d}from"./chunk-BGBBVSH4.js";import{c as u}from"./chunk-JM72FNGA.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
+ //# sourceMappingURL=chunk-ZU6PROUY.js.map