scip-query 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +255 -884
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-CI3O6PQG.js +2 -0
  5. package/dist/call-graph-6QTUTXH7.js +2 -0
  6. package/dist/call-graph-evidence-lZa2dwQA.d.ts +11 -0
  7. package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
  8. package/dist/chunk-26CT72HM.js +2 -0
  9. package/dist/{chunk-7PIO7NKH.js → chunk-2COFMIVK.js} +2 -2
  10. package/dist/chunk-2H4IAJHO.js +2 -0
  11. package/dist/chunk-2I3RSUWX.js +16 -0
  12. package/dist/chunk-2RP27XLR.js +2 -0
  13. package/dist/chunk-2ZBMOQGG.js +3 -0
  14. package/dist/{chunk-HX4GQPZP.js → chunk-32A42O5B.js} +3 -3
  15. package/dist/chunk-35ELD3RM.js +2 -0
  16. package/dist/chunk-35IW3P4H.js +2 -0
  17. package/dist/{chunk-DQGFVPUV.js → chunk-3653GTR7.js} +3 -3
  18. package/dist/chunk-3EX7DNBC.js +2 -0
  19. package/dist/chunk-3FQ3KMCD.js +2 -0
  20. package/dist/{chunk-5E4WNAVD.js → chunk-3PII3JI5.js} +2 -2
  21. package/dist/chunk-3TNRNKAT.js +2 -0
  22. package/dist/chunk-3VLJ2DCA.js +2 -0
  23. package/dist/{chunk-XSRF6Q77.js → chunk-46JLFIGA.js} +2 -2
  24. package/dist/chunk-4DCKBY6T.js +5 -0
  25. package/dist/chunk-4EXFZP6H.js +2 -0
  26. package/dist/chunk-4IIMPWMR.js +29 -0
  27. package/dist/chunk-4ILHWBYF.js +2 -0
  28. package/dist/chunk-4N6QSEMZ.js +10 -0
  29. package/dist/chunk-4OE2JO6I.js +2 -0
  30. package/dist/{chunk-7BAVHKMJ.js → chunk-4S4DF62J.js} +9 -9
  31. package/dist/chunk-4UUCUASK.js +554 -0
  32. package/dist/chunk-5236NQV3.js +2 -0
  33. package/dist/chunk-54EOGFBR.js +2 -0
  34. package/dist/{chunk-LY4WC4AD.js → chunk-5H7IWVXJ.js} +2 -2
  35. package/dist/chunk-5IZTXSOL.js +117 -0
  36. package/dist/{chunk-AZJQQKDD.js → chunk-5SE323LF.js} +2 -2
  37. package/dist/chunk-5ZJH6DDE.js +2 -0
  38. package/dist/chunk-63MBA7EG.js +3 -0
  39. package/dist/chunk-6BJ7SOY7.js +2 -0
  40. package/dist/chunk-6GJAP4OE.js +2 -0
  41. package/dist/chunk-6IEVHGWG.js +26 -0
  42. package/dist/chunk-6SWA6B24.js +7 -0
  43. package/dist/chunk-6T7H2AFY.js +3 -0
  44. package/dist/chunk-73Z33VFI.js +4 -0
  45. package/dist/chunk-7COHFNJK.js +38 -0
  46. package/dist/chunk-7HU2IJ2T.js +3 -0
  47. package/dist/chunk-7IOAZRVL.js +60 -0
  48. package/dist/chunk-7KCZELVM.js +2 -0
  49. package/dist/chunk-7PPYXENX.js +2 -0
  50. package/dist/chunk-7TWP3MCP.js +2 -0
  51. package/dist/chunk-AA7K3XLM.js +21 -0
  52. package/dist/chunk-AJVMVE7X.js +7 -0
  53. package/dist/chunk-ANWGXPPN.js +4 -0
  54. package/dist/chunk-APLKXICZ.js +3 -0
  55. package/dist/{chunk-JDOEX4E6.js → chunk-AQDWTCDC.js} +2 -2
  56. package/dist/chunk-AUP6YI5M.js +2 -0
  57. package/dist/chunk-B7ECWJAZ.js +2 -0
  58. package/dist/{chunk-ZHXX42OH.js → chunk-BATIVRU2.js} +4 -4
  59. package/dist/chunk-BBEDPVPB.js +4 -0
  60. package/dist/chunk-BBWPOMGU.js +2 -0
  61. package/dist/chunk-BD6CV7PN.js +2 -0
  62. package/dist/{chunk-XKWKXZKW.js → chunk-BHE44MHT.js} +2 -2
  63. package/dist/chunk-BOJ5SVE2.js +2 -0
  64. package/dist/chunk-BZYSGZRK.js +2 -0
  65. package/dist/chunk-CA5RE6H7.js +2 -0
  66. package/dist/chunk-CKDOY6JA.js +2 -0
  67. package/dist/chunk-CN2WGM7D.js +2 -0
  68. package/dist/chunk-COTMS5KM.js +3 -0
  69. package/dist/chunk-CSDDOUA4.js +3 -0
  70. package/dist/chunk-CT5SI2I4.js +2 -0
  71. package/dist/chunk-D5EKVZPI.js +2 -0
  72. package/dist/{chunk-FKSELJQF.js → chunk-D5W4UZY5.js} +2 -2
  73. package/dist/{chunk-RUJURYSV.js → chunk-DEUGHURX.js} +2 -2
  74. package/dist/chunk-DHKBIOXF.js +7 -0
  75. package/dist/chunk-DMQ7ZKJG.js +81 -0
  76. package/dist/chunk-DMUGTKMD.js +2 -0
  77. package/dist/chunk-DOPCR5BY.js +2 -0
  78. package/dist/chunk-DRENNWRG.js +2 -0
  79. package/dist/chunk-E4EJBGDZ.js +2 -0
  80. package/dist/chunk-E7BJXRNV.js +2 -0
  81. package/dist/chunk-EA4SH4U5.js +5 -0
  82. package/dist/{chunk-L7AW2QB5.js → chunk-EKZRF57O.js} +2 -2
  83. package/dist/chunk-ELNRLMC5.js +29 -0
  84. package/dist/chunk-F4FNK44D.js +2 -0
  85. package/dist/chunk-F7WQ337U.js +308 -0
  86. package/dist/chunk-FEQIQ26E.js +2 -0
  87. package/dist/chunk-FGB567HK.js +23 -0
  88. package/dist/chunk-FHV7NMFU.js +29 -0
  89. package/dist/chunk-FN6EJM6Q.js +2 -0
  90. package/dist/chunk-FTSQNONX.js +2 -0
  91. package/dist/chunk-FUG6RPYY.js +6 -0
  92. package/dist/chunk-G2F6T5BV.js +2 -0
  93. package/dist/chunk-G6OGPXJW.js +9 -0
  94. package/dist/chunk-GFLTPNWV.js +3 -0
  95. package/dist/chunk-GTDP2SKQ.js +2 -0
  96. package/dist/chunk-H46QMB7E.js +2 -0
  97. package/dist/chunk-H5EXS3HM.js +2 -0
  98. package/dist/chunk-HEOMG7IM.js +8 -0
  99. package/dist/chunk-HG5YI7PV.js +2 -0
  100. package/dist/{chunk-7SQQWSY3.js → chunk-HGKEAP7F.js} +2 -2
  101. package/dist/chunk-HUZNZ3H2.js +2 -0
  102. package/dist/chunk-HWLCBKFE.js +2 -0
  103. package/dist/chunk-I3U2FN2T.js +13 -0
  104. package/dist/{chunk-JAYYFEQY.js → chunk-I7PFL5P3.js} +2 -2
  105. package/dist/{chunk-2HPVVXM5.js → chunk-ICHBVITH.js} +2 -2
  106. package/dist/chunk-ICUQONOG.js +38 -0
  107. package/dist/chunk-IDPLC3FI.js +5 -0
  108. package/dist/{chunk-A73XVBCR.js → chunk-IGKKTHJR.js} +2 -2
  109. package/dist/chunk-IOKWFRFQ.js +4 -0
  110. package/dist/chunk-IPAL6DP2.js +3 -0
  111. package/dist/chunk-IUJ3ZFEE.js +7 -0
  112. package/dist/chunk-IXJ26KJJ.js +16 -0
  113. package/dist/chunk-IYV2YBHM.js +2 -0
  114. package/dist/chunk-JVZNWJBH.js +2 -0
  115. package/dist/chunk-K5MZYZV7.js +3 -0
  116. package/dist/{chunk-3G66UZBH.js → chunk-KFK7GF5C.js} +2 -2
  117. package/dist/chunk-KTRGJLY7.js +18 -0
  118. package/dist/chunk-KW6B5OL4.js +2 -0
  119. package/dist/chunk-KWARB5FZ.js +2 -0
  120. package/dist/chunk-LHTT5C3Z.js +2 -0
  121. package/dist/chunk-LPGDO2XA.js +3 -0
  122. package/dist/chunk-LXLD46LH.js +21 -0
  123. package/dist/chunk-MEI3PTUK.js +2 -0
  124. package/dist/chunk-MJNV7OCG.js +5 -0
  125. package/dist/chunk-MO226P4Q.js +4 -0
  126. package/dist/{chunk-3CLX5EOX.js → chunk-MOBF2GH6.js} +2 -2
  127. package/dist/chunk-MXNGIEPU.js +3 -0
  128. package/dist/chunk-MYUKI5VN.js +4 -0
  129. package/dist/{chunk-TFRAYKN6.js → chunk-N5C65OFK.js} +2 -2
  130. package/dist/{chunk-PXY7F6Y4.js → chunk-O2RM7E7L.js} +5 -5
  131. package/dist/chunk-OFUBXBYX.js +3 -0
  132. package/dist/chunk-OFY4HTMI.js +2 -0
  133. package/dist/chunk-OIRWZIYL.js +38 -0
  134. package/dist/chunk-OIVZ7PW6.js +438 -0
  135. package/dist/chunk-ORBKAUCH.js +4 -0
  136. package/dist/chunk-OUB4J26T.js +2 -0
  137. package/dist/chunk-OVPS2ILI.js +20 -0
  138. package/dist/chunk-PHSPBQM6.js +5 -0
  139. package/dist/{chunk-JVYA47YU.js → chunk-PIZY2GX6.js} +2 -2
  140. package/dist/chunk-PNISDVYC.js +3 -0
  141. package/dist/chunk-PQOL42AW.js +2 -0
  142. package/dist/chunk-PUVZNFVY.js +11 -0
  143. package/dist/chunk-PZEI2TVL.js +4 -0
  144. package/dist/{chunk-ZK26BAQL.js → chunk-Q2J2VZZT.js} +2 -2
  145. package/dist/chunk-Q7HB7BFJ.js +2 -0
  146. package/dist/{chunk-ZTETIQ35.js → chunk-QBANU5BQ.js} +2 -2
  147. package/dist/chunk-QD7IFBCR.js +10 -0
  148. package/dist/chunk-QDCCHMVZ.js +2 -0
  149. package/dist/chunk-QLQBZOJH.js +3 -0
  150. package/dist/{chunk-PQCI4SQX.js → chunk-QXR5QPSF.js} +2 -2
  151. package/dist/chunk-R2MOKIVO.js +2 -0
  152. package/dist/{chunk-EN3O7VJA.js → chunk-RFWAUHVW.js} +2 -2
  153. package/dist/chunk-RGCJ4646.js +16 -0
  154. package/dist/{chunk-BPAPWKP6.js → chunk-S3RTPPLQ.js} +8 -8
  155. package/dist/chunk-S73HBCGI.js +11 -0
  156. package/dist/chunk-SDPA5DKN.js +210 -0
  157. package/dist/chunk-SEUJVWT2.js +3 -0
  158. package/dist/chunk-SF7X6QNW.js +2 -0
  159. package/dist/chunk-SKUMCCC5.js +2 -0
  160. package/dist/chunk-SSSJO4RG.js +2 -0
  161. package/dist/chunk-SWFAFA4G.js +49 -0
  162. package/dist/chunk-SYUNTKO2.js +2 -0
  163. package/dist/chunk-T6FRID7Y.js +3 -0
  164. package/dist/chunk-TGWNNMPF.js +3 -0
  165. package/dist/chunk-TM5XEDDR.js +4 -0
  166. package/dist/chunk-TNOHGHZQ.js +2 -0
  167. package/dist/chunk-U2GPTA5U.js +3 -0
  168. package/dist/{chunk-SXP2MBJH.js → chunk-U7DR7MJD.js} +2 -2
  169. package/dist/chunk-U7LRSQG6.js +3 -0
  170. package/dist/chunk-UL4VJUMD.js +2 -0
  171. package/dist/chunk-UNORWZIJ.js +16 -0
  172. package/dist/chunk-UQ7XPRWU.js +2 -0
  173. package/dist/{chunk-6SHPK5ZE.js → chunk-URMZLV2N.js} +2 -2
  174. package/dist/chunk-URTX2BEA.js +6 -0
  175. package/dist/chunk-UZFCZ7SJ.js +2 -0
  176. package/dist/{chunk-KMKTIO2G.js → chunk-V7LQZTTZ.js} +2 -2
  177. package/dist/chunk-VETXXOYU.js +3 -0
  178. package/dist/chunk-VGRUM7JI.js +3 -0
  179. package/dist/{chunk-WXZLAAWK.js → chunk-VNKYRJKN.js} +2 -2
  180. package/dist/chunk-VWLIOEEF.js +11 -0
  181. package/dist/chunk-WB6LGCFB.js +6 -0
  182. package/dist/{chunk-W4ETQAXM.js → chunk-WK4FD4PG.js} +2 -2
  183. package/dist/{chunk-O64IZ6UX.js → chunk-WKPZCQLI.js} +2 -2
  184. package/dist/chunk-WSG3DK5H.js +2 -0
  185. package/dist/chunk-WULAPQUD.js +38 -0
  186. package/dist/chunk-WZQFY5S7.js +4 -0
  187. package/dist/chunk-X434XZAI.js +2 -0
  188. package/dist/chunk-X7PJJYKX.js +29 -0
  189. package/dist/chunk-XDAUYDFT.js +2 -0
  190. package/dist/chunk-XITQLISP.js +2 -0
  191. package/dist/chunk-XRXCANFQ.js +4 -0
  192. package/dist/chunk-XVDMJMES.js +3 -0
  193. package/dist/chunk-XXJ7WL3F.js +35 -0
  194. package/dist/chunk-Y4XQ7LES.js +9 -0
  195. package/dist/chunk-YIEFEPG6.js +16 -0
  196. package/dist/chunk-YRVERHJR.js +49 -0
  197. package/dist/{chunk-CJST5ETY.js → chunk-YUFWLWIC.js} +2 -2
  198. package/dist/chunk-YUKYB54I.js +1 -0
  199. package/dist/chunk-Z3GCK3PD.js +3 -0
  200. package/dist/chunk-ZBNL3QCY.js +4 -0
  201. package/dist/chunk-ZD3Z54IW.js +2 -0
  202. package/dist/chunk-ZDVDSDFG.js +4 -0
  203. package/dist/{chunk-32LVLCLN.js → chunk-ZHSARYVS.js} +3 -3
  204. package/dist/{chunk-BDCC2NPY.js → chunk-ZW44MCJM.js} +2 -2
  205. package/dist/{chunk-N5W4YZMK.js → chunk-ZYREOING.js} +2 -2
  206. package/dist/cli-main.js +8 -0
  207. package/dist/cli.js +1 -3
  208. package/dist/code-CczEvHui.d.ts +121 -0
  209. package/dist/code-EQL6ZBLH.js +2 -0
  210. package/dist/code-result-json-6E4J6LGZ.js +2 -0
  211. package/dist/command-descriptors-QH3G2OVD.js +346 -0
  212. package/dist/{config-types-jVM3D7MA.d.ts → config-types-Cm-VSEBb.d.ts} +189 -23
  213. package/dist/dataflow-2BLMUZBP.js +2 -0
  214. package/dist/{db-B5PM5yNk.d.ts → db-LKJXAlNS.d.ts} +1 -1
  215. package/dist/dependence-slice-MGAJDZXB.js +2 -0
  216. package/dist/deps-GQMUYVKW.js +2 -0
  217. package/dist/direct-navigation-6RUJKLAV.js +3 -0
  218. package/dist/entry-map-V2NQP5JU.js +2 -0
  219. package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
  220. package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
  221. package/dist/file-kind-BKCVMNUf.d.ts +10 -0
  222. package/dist/files-VM53I4IU.js +2 -0
  223. package/dist/graph-evidence-CbUPCSKV.d.ts +126 -0
  224. package/dist/graph-exploration-contract-CqDsnPQL.d.ts +7 -0
  225. package/dist/{health-Do5TKSJI.d.ts → health-Wl5G_LRt.d.ts} +33 -34
  226. package/dist/hierarchy-D553WRSZ.js +2 -0
  227. package/dist/imports-DOZAJWLW.js +2 -0
  228. package/dist/index.d.ts +4 -31
  229. package/dist/index.js +1 -1
  230. package/dist/members-HE67475K.js +2 -0
  231. package/dist/methods-K5JK4PPH.js +2 -0
  232. package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
  233. package/dist/output-continuation-command-LKBUTNRL.js +3 -0
  234. package/dist/output-pagination-VAWOGX4R.js +19 -0
  235. package/dist/postinstall.js +1 -1
  236. package/dist/project-reindex-4ARU6QCM.js +3 -0
  237. package/dist/queries/affected.d.ts +22 -4
  238. package/dist/queries/affected.js +1 -1
  239. package/dist/queries/anchors.d.ts +123 -0
  240. package/dist/queries/anchors.js +2 -0
  241. package/dist/queries/architecture.d.ts +3 -2
  242. package/dist/queries/architecture.js +1 -1
  243. package/dist/queries/bottlenecks.d.ts +26 -7
  244. package/dist/queries/bottlenecks.js +1 -1
  245. package/dist/queries/by-kind.d.ts +2 -2
  246. package/dist/queries/by-kind.js +1 -1
  247. package/dist/queries/call-graph.d.ts +17 -3
  248. package/dist/queries/call-graph.js +1 -1
  249. package/dist/queries/change-surface.d.ts +2 -2
  250. package/dist/queries/change-surface.js +1 -1
  251. package/dist/queries/cleanup-plan.d.ts +2 -2
  252. package/dist/queries/cleanup-plan.js +1 -1
  253. package/dist/queries/co-change.d.ts +2 -2
  254. package/dist/queries/co-change.js +1 -1
  255. package/dist/queries/code.d.ts +5 -26
  256. package/dist/queries/code.js +1 -1
  257. package/dist/queries/complexity-hotspots.d.ts +2 -2
  258. package/dist/queries/complexity-hotspots.js +1 -1
  259. package/dist/queries/complexity.d.ts +2 -2
  260. package/dist/queries/complexity.js +1 -1
  261. package/dist/queries/context.d.ts +145 -0
  262. package/dist/queries/context.js +2 -0
  263. package/dist/queries/convergence.d.ts +2 -2
  264. package/dist/queries/convergence.js +1 -1
  265. package/dist/queries/coupling.d.ts +8 -3
  266. package/dist/queries/coupling.js +1 -1
  267. package/dist/queries/cycles.d.ts +34 -7
  268. package/dist/queries/cycles.js +1 -1
  269. package/dist/queries/dataflow.d.ts +40 -14
  270. package/dist/queries/dataflow.js +1 -1
  271. package/dist/queries/dead.d.ts +2 -2
  272. package/dist/queries/dead.js +1 -1
  273. package/dist/queries/decorative-checkers.d.ts +3 -3
  274. package/dist/queries/decorative-checkers.js +1 -1
  275. package/dist/queries/deep-chains.d.ts +4 -38
  276. package/dist/queries/deep-chains.js +1 -1
  277. package/dist/queries/dependence-slice.d.ts +47 -0
  278. package/dist/queries/dependence-slice.js +2 -0
  279. package/dist/queries/dependency-depth.d.ts +49 -0
  280. package/dist/queries/dependency-depth.js +2 -0
  281. package/dist/queries/deps.d.ts +4 -2
  282. package/dist/queries/deps.js +1 -1
  283. package/dist/queries/diff-impact.d.ts +3 -3
  284. package/dist/queries/diff-impact.js +1 -1
  285. package/dist/queries/doc-drift.d.ts +4 -4
  286. package/dist/queries/doc-drift.js +1 -1
  287. package/dist/queries/drift.d.ts +2 -2
  288. package/dist/queries/drift.js +1 -1
  289. package/dist/queries/duplicate-bodies.d.ts +2 -2
  290. package/dist/queries/duplicate-bodies.js +1 -1
  291. package/dist/queries/entry-map.d.ts +121 -0
  292. package/dist/queries/entry-map.js +2 -0
  293. package/dist/queries/evidence.d.ts +70 -0
  294. package/dist/queries/evidence.js +2 -0
  295. package/dist/queries/extract-candidates.d.ts +2 -2
  296. package/dist/queries/extract-candidates.js +1 -1
  297. package/dist/queries/fan.d.ts +18 -5
  298. package/dist/queries/fan.js +1 -1
  299. package/dist/queries/files.d.ts +2 -2
  300. package/dist/queries/files.js +1 -1
  301. package/dist/queries/health.d.ts +4 -3
  302. package/dist/queries/health.js +1 -1
  303. package/dist/queries/hierarchy.d.ts +5 -3
  304. package/dist/queries/hierarchy.js +1 -1
  305. package/dist/queries/hotspots.d.ts +11 -5
  306. package/dist/queries/hotspots.js +1 -1
  307. package/dist/queries/imports.d.ts +2 -2
  308. package/dist/queries/imports.js +1 -1
  309. package/dist/queries/incomplete-migration.d.ts +4 -4
  310. package/dist/queries/incomplete-migration.js +1 -1
  311. package/dist/queries/index.d.ts +56 -136
  312. package/dist/queries/index.js +1 -1
  313. package/dist/queries/isolated.d.ts +2 -2
  314. package/dist/queries/isolated.js +1 -1
  315. package/dist/queries/locality-candidates.d.ts +2 -2
  316. package/dist/queries/locality-candidates.js +1 -1
  317. package/dist/queries/members.d.ts +2 -2
  318. package/dist/queries/members.js +1 -1
  319. package/dist/queries/methods.d.ts +2 -2
  320. package/dist/queries/methods.js +1 -1
  321. package/dist/queries/not-implemented.d.ts +3 -3
  322. package/dist/queries/not-implemented.js +1 -1
  323. package/dist/queries/outline.d.ts +2 -2
  324. package/dist/queries/outline.js +1 -1
  325. package/dist/queries/passthrough-candidates.d.ts +5 -9
  326. package/dist/queries/passthrough-candidates.js +1 -1
  327. package/dist/queries/plan-context.d.ts +27 -64
  328. package/dist/queries/plan-context.js +1 -1
  329. package/dist/queries/react-component-duplicates.d.ts +2 -2
  330. package/dist/queries/react-component-duplicates.js +1 -1
  331. package/dist/queries/react-hook-candidates.d.ts +2 -2
  332. package/dist/queries/react-hook-candidates.js +1 -1
  333. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  334. package/dist/queries/react-large-component-pressure.js +1 -1
  335. package/dist/queries/recent-duplicates.d.ts +2 -2
  336. package/dist/queries/recent-duplicates.js +1 -1
  337. package/dist/queries/redundant-reexports.d.ts +2 -2
  338. package/dist/queries/redundant-reexports.js +1 -1
  339. package/dist/queries/reference-neighborhood.d.ts +4 -0
  340. package/dist/queries/reference-neighborhood.js +2 -0
  341. package/dist/queries/reference-reachability.d.ts +48 -0
  342. package/dist/queries/reference-reachability.js +2 -0
  343. package/dist/queries/refs.d.ts +2 -2
  344. package/dist/queries/refs.js +1 -1
  345. package/dist/queries/self-audit.d.ts +2 -2
  346. package/dist/queries/self-audit.js +1 -1
  347. package/dist/queries/similar-chains.d.ts +2 -2
  348. package/dist/queries/similar-chains.js +1 -1
  349. package/dist/queries/similar-files.d.ts +2 -2
  350. package/dist/queries/similar-files.js +1 -1
  351. package/dist/queries/similar-signatures.d.ts +2 -2
  352. package/dist/queries/similar-signatures.js +1 -1
  353. package/dist/queries/similar.d.ts +2 -2
  354. package/dist/queries/similar.js +1 -1
  355. package/dist/queries/slice.d.ts +3 -36
  356. package/dist/queries/slice.js +1 -1
  357. package/dist/queries/source-inspection.d.ts +209 -0
  358. package/dist/queries/source-inspection.js +2 -0
  359. package/dist/queries/source-search.d.ts +13 -0
  360. package/dist/queries/source-search.js +2 -0
  361. package/dist/queries/stale-abstractions.d.ts +2 -2
  362. package/dist/queries/stale-abstractions.js +1 -1
  363. package/dist/queries/stats.d.ts +2 -2
  364. package/dist/queries/surface.d.ts +13 -4
  365. package/dist/queries/surface.js +1 -1
  366. package/dist/queries/symbols.d.ts +2 -2
  367. package/dist/queries/symbols.js +1 -1
  368. package/dist/queries/system-map.d.ts +449 -0
  369. package/dist/queries/system-map.js +2 -0
  370. package/dist/queries/system.d.ts +5 -3
  371. package/dist/queries/system.js +1 -1
  372. package/dist/queries/test-quality.d.ts +2 -2
  373. package/dist/queries/test-quality.js +1 -1
  374. package/dist/queries/trace.d.ts +47 -3
  375. package/dist/queries/trace.js +1 -1
  376. package/dist/queries/twin-ab.d.ts +3 -3
  377. package/dist/queries/twin-ab.js +1 -1
  378. package/dist/queries/twin-drift.d.ts +3 -3
  379. package/dist/queries/twin-drift.js +1 -1
  380. package/dist/queries/unused-imports.d.ts +2 -2
  381. package/dist/queries/unused-imports.js +1 -1
  382. package/dist/queries/unused-params.d.ts +2 -2
  383. package/dist/queries/unused-params.js +1 -1
  384. package/dist/queries/value-flow.d.ts +43 -0
  385. package/dist/queries/value-flow.js +2 -0
  386. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  387. package/dist/queries/vue-component-duplicates.js +1 -1
  388. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  389. package/dist/queries/vue-composable-candidates.js +1 -1
  390. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  391. package/dist/queries/vue-large-view-pressure.js +1 -1
  392. package/dist/queries/wrapper-candidates.d.ts +2 -2
  393. package/dist/queries/wrapper-candidates.js +1 -1
  394. package/dist/query-service-fastpath.js +6 -0
  395. package/dist/query-service-server.js +5 -0
  396. package/dist/refs-NBHKL4UQ.js +2 -0
  397. package/dist/refs-pagination-BBVTIHMH.js +2 -0
  398. package/dist/reindex-worker.js +27 -45
  399. package/dist/reindex.d.ts +62 -42
  400. package/dist/reindex.js +32 -33
  401. package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
  402. package/dist/runtime.d.ts +286 -7
  403. package/dist/runtime.js +4 -3
  404. package/dist/rust-semantic-session-server.js +1 -1
  405. package/dist/rust-semantic-session-worker.js +1 -1
  406. package/dist/rust-semantic-worker.js +1 -1
  407. package/dist/{scip-cli-BnEwZRLJ.d.ts → scip-cli-CppzF5MK.d.ts} +33 -2
  408. package/dist/slice-U6S6LBSB.js +2 -0
  409. package/dist/source-search-types-Dwz8KeuW.d.ts +79 -0
  410. package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
  411. package/dist/stats-OOJ74B32.js +2 -0
  412. package/dist/surface-C7SS5CDQ.js +2 -0
  413. package/dist/symbol-resolution-3FVEKDTJ.js +2 -0
  414. package/dist/system-6K2NOO5C.js +2 -0
  415. package/dist/trace-II5K2TMH.js +2 -0
  416. package/dist/typescript-mailbox-worker.js +1 -1
  417. package/dist/value-flow-MKFUUE5B.js +2 -0
  418. package/dist/watch-server.js +3 -2
  419. package/docs/AGENT_GUIDE.md +133 -476
  420. package/docs/AI_FAILURE_MODES.md +30 -301
  421. package/docs/API.md +1 -1
  422. package/docs/API_EVOLUTION.md +6 -0
  423. package/docs/CLI_JSON_OUTPUT.md +207 -29
  424. package/docs/COMMAND_REFERENCE.md +255 -154
  425. package/docs/CONFIGURATION_WRITE_SAFETY.md +14 -13
  426. package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +84 -0
  427. package/docs/DETECTOR_GUIDE.md +46 -138
  428. package/docs/DURABILITY.md +7 -1
  429. package/docs/INDEX_GENERATIONS.md +6 -0
  430. package/docs/LOCK_PROTOCOL.md +8 -0
  431. package/docs/REINDEX_METADATA_COMPATIBILITY.md +13 -3
  432. package/docs/SECURITY_MODEL.md +39 -42
  433. package/docs/accuracy-audit-checklist.md +4 -0
  434. package/docs/accuracy-hardening-goal.md +9 -2
  435. package/docs/analyzer-inventory.md +59 -264
  436. package/docs/analyzer-validation-protocol.md +62 -170
  437. package/docs/architecture-coherence-vision.md +18 -12
  438. package/docs/locality-analyzer-design.md +1 -1
  439. package/docs/schemas/cli-json-envelope.schema.json +212 -27
  440. package/docs/schemas/cli-json-export-receipt.schema.json +25 -0
  441. package/docs/schemas/cli-output-page.schema.json +1 -1
  442. package/docs/schemas/observation-receipt.schema.json +164 -0
  443. package/docs/schemas/project-config.schema.json +27 -45
  444. package/docs/schemas/suppression-record.schema.json +1 -34
  445. package/package.json +65 -8
  446. package/skills/concrete-plan/SKILL.md +8 -0
  447. package/skills/concrete-plan/agents/openai.yaml +4 -0
  448. package/skills/scip-explore/SKILL.md +3 -85
  449. package/skills/scip-explore/agents/openai.yaml +3 -3
  450. package/skills/scip-integrity-audit/SKILL.md +185 -0
  451. package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
  452. package/skills/scip-plan/SKILL.md +67 -49
  453. package/skills/scip-plan/agents/openai.yaml +3 -3
  454. package/skills/scip-query/SKILL.md +77 -77
  455. package/skills/scip-query/agents/openai.yaml +3 -3
  456. package/skills/scip-setup/SKILL.md +10 -102
  457. package/skills/scip-setup/agents/openai.yaml +3 -3
  458. package/dist/chunk-26QA6FAI.js +0 -8
  459. package/dist/chunk-2KAZEZ6M.js +0 -2
  460. package/dist/chunk-3ORVDL3H.js +0 -2
  461. package/dist/chunk-46XGSFNI.js +0 -2
  462. package/dist/chunk-4MAK2HOY.js +0 -6
  463. package/dist/chunk-4TURLRL5.js +0 -16
  464. package/dist/chunk-4UQVNCQE.js +0 -2
  465. package/dist/chunk-55Q3WLZX.js +0 -2
  466. package/dist/chunk-5I5G2QOX.js +0 -3
  467. package/dist/chunk-6LDJQXAH.js +0 -2
  468. package/dist/chunk-6O5TICIZ.js +0 -3
  469. package/dist/chunk-7O5IKBTZ.js +0 -16
  470. package/dist/chunk-7S5E7KWT.js +0 -2
  471. package/dist/chunk-7WPLAODU.js +0 -5
  472. package/dist/chunk-AFHORGLH.js +0 -42
  473. package/dist/chunk-AIE7TFJW.js +0 -9
  474. package/dist/chunk-AQOFWNQJ.js +0 -1
  475. package/dist/chunk-B2PX5I6M.js +0 -2
  476. package/dist/chunk-B75HZHUP.js +0 -2
  477. package/dist/chunk-B7PBSLZN.js +0 -2
  478. package/dist/chunk-BBW6JFHN.js +0 -2
  479. package/dist/chunk-BNXCIFVY.js +0 -2
  480. package/dist/chunk-BS2NMXQZ.js +0 -4
  481. package/dist/chunk-C3KV2II6.js +0 -2
  482. package/dist/chunk-C43RDDP4.js +0 -20
  483. package/dist/chunk-DAFAHMNB.js +0 -42
  484. package/dist/chunk-DQLPXMH6.js +0 -8
  485. package/dist/chunk-EKZTZXHZ.js +0 -117
  486. package/dist/chunk-EW2NTSFA.js +0 -18
  487. package/dist/chunk-F3Z4OUDS.js +0 -8
  488. package/dist/chunk-FJH2NW7J.js +0 -66
  489. package/dist/chunk-FTFP6O3L.js +0 -11
  490. package/dist/chunk-FYLK2DEJ.js +0 -2
  491. package/dist/chunk-GH74ASD6.js +0 -11
  492. package/dist/chunk-GMXWZP2B.js +0 -2
  493. package/dist/chunk-GOUBFH5O.js +0 -3
  494. package/dist/chunk-HLF2TX6R.js +0 -2
  495. package/dist/chunk-HX7M4BDI.js +0 -30
  496. package/dist/chunk-HZ72SESS.js +0 -128
  497. package/dist/chunk-IB2N4FIY.js +0 -10
  498. package/dist/chunk-IZYYAFN5.js +0 -2
  499. package/dist/chunk-JFGGXWQF.js +0 -947
  500. package/dist/chunk-JN4NMBEX.js +0 -8
  501. package/dist/chunk-JW56N3KI.js +0 -4
  502. package/dist/chunk-JZ2OXNWB.js +0 -2
  503. package/dist/chunk-KFZNKUNT.js +0 -2
  504. package/dist/chunk-L5GJNV2T.js +0 -8
  505. package/dist/chunk-L7JDSCDF.js +0 -4
  506. package/dist/chunk-LU47HG23.js +0 -14
  507. package/dist/chunk-LVY7NPF7.js +0 -2
  508. package/dist/chunk-MKCDWWGV.js +0 -4
  509. package/dist/chunk-MNE7YG56.js +0 -2
  510. package/dist/chunk-MRXBEXSY.js +0 -26
  511. package/dist/chunk-MV7OWDUX.js +0 -2
  512. package/dist/chunk-NGEXCJJW.js +0 -11
  513. package/dist/chunk-NIW6JDC5.js +0 -29
  514. package/dist/chunk-PBUQFCNB.js +0 -16
  515. package/dist/chunk-POAVPHH7.js +0 -2
  516. package/dist/chunk-QZ4JVECJ.js +0 -2
  517. package/dist/chunk-RDO52JGY.js +0 -2
  518. package/dist/chunk-RJT3TUUZ.js +0 -2
  519. package/dist/chunk-RVLDN63O.js +0 -4
  520. package/dist/chunk-RXOXSKY3.js +0 -2
  521. package/dist/chunk-S7OYBOCK.js +0 -2
  522. package/dist/chunk-SMNXQT5Z.js +0 -3
  523. package/dist/chunk-SRAFT254.js +0 -2
  524. package/dist/chunk-T7YQSHPQ.js +0 -3
  525. package/dist/chunk-UJCOIXDY.js +0 -2
  526. package/dist/chunk-UJPRPGCO.js +0 -13
  527. package/dist/chunk-WCCFZ7V7.js +0 -113
  528. package/dist/chunk-WUPW3UN3.js +0 -3
  529. package/dist/chunk-X54AGLVX.js +0 -2
  530. package/dist/chunk-Y2MVPNKY.js +0 -5
  531. package/dist/chunk-YKUU5AIC.js +0 -3
  532. package/dist/chunk-YLCJLTPL.js +0 -2
  533. package/dist/chunk-YTQVETEO.js +0 -2
  534. package/dist/chunk-Z4N3MZYA.js +0 -38
  535. package/dist/chunk-ZJOOT3BG.js +0 -2
  536. package/dist/command-descriptors-DSS46KXI.js +0 -642
  537. package/dist/diff-gate-types-B0QYpDv1.d.ts +0 -11
  538. package/dist/direct-navigation-6YHV6IB5.js +0 -3
  539. package/dist/queries/diff-gate.d.ts +0 -253
  540. package/dist/queries/diff-gate.js +0 -2
  541. package/docs/COMMITTED_RECORD_COMPATIBILITY.md +0 -154
  542. package/docs/analyzer-validation-ledger.md +0 -516
  543. package/docs/schemas/outcome-event-record.schema.json +0 -95
  544. package/skills/_shared/SKILL.md +0 -101
  545. package/skills/_shared/agents/openai.yaml +0 -4
  546. package/skills/_shared/references/agent-contract-catalog.md +0 -105
  547. package/skills/_shared/references/command-catalog.md +0 -118
  548. package/skills/_shared/references/detector-precision-and-diffgate.md +0 -59
  549. package/skills/_shared/references/evidence-and-dead-code.md +0 -25
  550. package/skills/scip-audit/SKILL.md +0 -77
  551. package/skills/scip-audit/agents/openai.yaml +0 -4
  552. package/skills/scip-audit/references/claims.md +0 -98
  553. package/skills/scip-audit/references/cleanup.md +0 -100
  554. package/skills/scip-audit/references/directory.md +0 -222
  555. package/skills/scip-audit/references/frontend.md +0 -130
  556. package/skills/scip-audit/references/integrity.md +0 -154
  557. package/skills/scip-audit/references/maintainability.md +0 -162
  558. package/skills/scip-audit/references/twin-drift.md +0 -104
  559. package/skills/scip-diagnose/SKILL.md +0 -52
  560. package/skills/scip-diagnose/agents/openai.yaml +0 -4
  561. package/skills/scip-diagnose/references/debug.md +0 -117
  562. package/skills/scip-diagnose/references/probe-reachability.md +0 -77
  563. package/skills/scip-diagnose/references/root-cause.md +0 -145
  564. package/skills/scip-diagnose/references/triage.md +0 -119
  565. package/skills/scip-explore/references/diagrams.md +0 -40
  566. package/skills/scip-explore/references/language-playbook.md +0 -49
  567. package/skills/scip-improve/SKILL.md +0 -56
  568. package/skills/scip-improve/agents/openai.yaml +0 -4
  569. package/skills/scip-improve/references/cleanup-batches.md +0 -53
  570. package/skills/scip-improve/references/directory-moves.md +0 -53
  571. package/skills/scip-improve/references/doc-reconcile.md +0 -30
  572. package/skills/scip-improve/references/frontend-extraction.md +0 -39
  573. package/skills/scip-improve/references/maintainability-mechanism.md +0 -43
  574. package/skills/scip-improve/references/twin-drift.md +0 -35
  575. package/skills/scip-plan/references/api-impact.md +0 -19
  576. package/skills/scip-plan/references/conductor.md +0 -41
  577. package/skills/scip-plan/references/high-assurance.md +0 -43
  578. package/skills/scip-plan/references/hyper-optimization.md +0 -50
  579. package/skills/scip-plan/references/tla-model.md +0 -88
  580. package/skills/scip-setup/references/bootstrap-workflow.md +0 -119
  581. package/skills/scip-setup/references/language-verification.md +0 -61
  582. package/skills/scip-setup/references/lifecycle-commands.md +0 -119
  583. package/skills/scip-setup/references/per-repo-triage.md +0 -24
  584. package/skills/scip-verify/SKILL.md +0 -229
  585. package/skills/scip-verify/agents/openai.yaml +0 -4
  586. package/skills/scip-verify/references/calibrate-detectors.md +0 -170
package/README.md CHANGED
@@ -1,963 +1,334 @@
1
- <h1 align="center">
2
- <picture>
3
- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/scip-query-logo-dark.svg">
4
- <img src="docs/assets/scip-query-logo.svg" alt="scip-query" width="360">
5
- </picture>
6
- </h1>
7
-
8
- <p align="center">
9
- <strong>Evidence and verification for AI coding agents.</strong>
10
- </p>
11
-
12
- <p align="center">
13
- <em>Map the repo. Reuse what exists. Finish the refactor. Gate the diff.</em>
14
- </p>
15
-
16
- <p align="center">
17
- <a href="https://www.npmjs.com/package/scip-query"><img alt="npm version" src="https://img.shields.io/npm/v/scip-query.svg"></a>
18
- <a href="https://www.npmjs.com/package/scip-query"><img alt="npm downloads" src="https://img.shields.io/npm/dm/scip-query.svg"></a>
19
- <a href="package.json"><img alt="Node version" src="https://img.shields.io/node/v/scip-query.svg"></a>
20
- <a href="https://www.apache.org/licenses/LICENSE-2.0"><img alt="License" src="https://img.shields.io/npm/l/scip-query.svg"></a>
21
- </p>
22
-
23
- Coding agents operate at too concrete a level of abstraction. They work in files and grep, while every decision that actually matters — does a helper for this already exist, what depends on the thing I'm about to change, is this migration finished or just started — lives one level up, in symbols, references, and history. `scip-query` raises agents to that level: a TypeScript CLI and npm package built on SCIP indexes, git history, language-aware source analysis, and your repository's own checks.
24
-
25
- The failure mode it targets is specific. Agents are genuinely good at editing the code in front of them; what they lose is the whole-repository model across a long task. They re-implement helpers they never saw, plan from partial context, migrate three call sites and abandon the other two, miss the file that always changes with the one they touched, and declare a diff finished while it quietly adds duplication, dead code, and docs that now lie. None of that is a syntax error, so nothing stops it — it just accumulates until complexity nukes your development momentum.
26
-
27
- So the loop this tool enforces is evidence at every step: map the target and its blast radius, plan from repository facts, check for reuse before adding a concept, detect unfinished migrations and hidden coupling, and gate the finished diff. It does not replace the compiler, tests, or review. The point is to make structural evidence so cheap to ask for that agents actually ask — and to make "done" something the repository gets a vote on.
28
-
29
- ## How Agents Use It
30
-
31
- Two layers, wired by `scip-query setup`:
32
-
33
- **Ambient** — no invocation required. Session-start hooks supply index state and routing context; the Stop-hook / pre-commit **diff gate** checks every finished diff for echoes of existing code, unfinished migrations, missing co-change partners, stale doc citations, and new dead code — and feeds findings back to the agent.
34
-
35
- **Invoked** — the agent routes work through skills, each carrying its own short command list so it never navigates the full CLI:
36
-
37
- | Phase | Skill | Commands underneath (also usable directly) |
38
- | -------- | ------------------------------------------------ | ----------------------------------------------- |
39
- | Orient | `scip-explore` | `system`, `trace`, `affected`, `call-graph` |
40
- | Plan | `scip-plan` | `plan-context`, `change-surface`, `co-change` |
41
- | Diagnose | `scip-diagnose` | `files`, `trace`, `call-graph`, `outline` |
42
- | Audit | `scip-audit` | `cleanup-plan --verify`, `dead`, `twin-drift` |
43
- | Improve | `scip-improve` | `incomplete-migration`, `recent-duplicates` |
44
- | Verify | `scip-verify` (closeout) + the ambient diff gate | `diff-impact`, `diff-gate`, `health --baseline` |
45
- | Set up | `scip-setup` | `doctor`, `setup`, `setup-hooks`, `setup-agent` |
46
-
47
- The consolidated skills retain the former specialist lenses as routed
48
- scenarios: API impact and formal/performance planning live in `scip-plan`;
49
- root cause and reachability probes live in `scip-diagnose`; integrity,
50
- maintainability, claim, framework, directory, and twin-drift review live in
51
- `scip-audit`; and cleanup or documentation repair lives in `scip-improve`.
52
- Every command remains directly invocable for humans and scripts.
53
-
54
- React and Vue repositories get additional framework-aware checks for repeated component/template structure, hook/composable behavior, and large-component or large-view pressure. These extend the same reuse and completion workflow; the core graph, history, planning, cleanup, and diff-gate commands are not frontend-specific.
1
+ # scip-query
2
+
3
+ scip-query is a compiler-backed repository-understanding system for coding
4
+ agents.
5
+
6
+ A repository-understanding system turns indexed code facts into accurate,
7
+ navigable abstractions of the systems in a codebase. Its essential service is
8
+ structure-preserving compression: an agent can see the relevant regions and
9
+ relationships before an edit, drill into several material regions together,
10
+ and keep exact source identities for its plan without reading every
11
+ implementation. scip-query differs from text search because it uses
12
+ compiler-produced SCIP indexes: two matching words count as the same symbol
13
+ only when the language tooling resolves them to the same definition. It also
14
+ reports coverage gaps, so omitted evidence is not mistaken for evidence that a
15
+ relationship does not exist.
16
+
17
+ The tool helps an agent answer four practical questions:
18
+
19
+ - What is this code connected to?
20
+ - Which systems participate in this behavior from entry to final effect?
21
+ - Who consumes it, and what could a change affect?
22
+ - Does the repository declare a structural rule for this dependency?
23
+ - Where do React, Vue, duplication, drift, complexity, or cleanup detectors
24
+ point to code worth inspecting?
25
+
26
+ The agent still owns the task, plan, implementation, tests, and final judgment.
27
+ scip-query does not create goals, act as an acceptance test, or decide that work
28
+ is complete.
55
29
 
56
30
  ## Install
57
31
 
58
- `npm install` only installs the package — it does not touch your home directory, your shell config, or any agent's skill/hook setup. Every write happens explicitly, when you ask for it:
32
+ scip-query requires Node.js 22 or newer. Node.js 24 LTS is recommended.
59
33
 
60
34
  ```bash
61
- npm install -g scip-query@latest
62
- scip-query setup # interactive checklist in a terminal
35
+ npm install -g scip-query
36
+ cd your-repository
37
+ scip-query setup
63
38
  ```
64
39
 
65
- The setup checklist detects the repository's languages and offers to install or
66
- repair the matching SCIP indexers, Tree-sitter AST parsers, agent skills, and
67
- checkout-local hooks. It enables demand-started automatic incremental indexing,
68
- builds the first index, verifies semantic and checker capabilities, and can run
69
- the optional full health audit. Use the arrow keys and Space to change the
70
- selection, then Enter to continue.
71
-
72
- For automation, use `scip-query setup --yes` to accept recommended defaults or
73
- `scip-query setup --json` for a non-interactive machine-readable report. Use
74
- `--no-hooks`, `--no-skills`, `--no-parsers`, or `--no-health` only when that
75
- scope is intentionally managed elsewhere. Or run without a global install:
76
- `npx scip-query@latest setup`.
77
-
78
- Human output is the default for people and agents: reports retain their
79
- sections, while `code` preserves indentation and one-based source line
80
- numbers. Oversized human results paginate at complete line boundaries whenever
81
- possible, so continuation pages preserve that hierarchy. Every public
82
- JSON-capable command also supports the same structured forms: `--json` emits
83
- the stable envelope, `--json --result-only` emits only the command result, and
84
- `--json --compact` minifies output for a program. See the
85
- [CLI output contract](docs/CLI_JSON_OUTPUT.md) for mode selection,
86
- compatibility, pagination, the decoder API, and machine-readable schemas.
87
-
88
- Logical `refs --limit` pages use a generation-bound `(path, line)` cursor, so
89
- ordinary continuations resume after the prior row instead of rebuilding and
90
- discarding it. Follow every emitted `refs --cursor` continuation before
91
- claiming a complete reference set. JSON identifies semantic, Ruby, or SCIP
92
- fallback providers that still require complete analysis as
93
- `pagination.producer: "complete-only"`.
94
-
95
- Contributors changing exported TypeScript declarations should also follow the
96
- [public API evolution workflow](docs/API_EVOLUTION.md). Its committed manifest
97
- makes every package-subpath signature change explicit before release.
98
-
99
- ### If npm warns about install scripts
100
-
101
- On npm setups with script approval enabled (`allow-scripts`), the install prints warnings like
102
- `15 packages have install scripts not yet covered by allowScripts` — and **skips those scripts**,
103
- which leaves the affected native modules unbuilt. Every remaining script on that list is expected:
104
-
105
- - `scip-query` — its own postinstall (non-fatal by construction: `... || true`)
106
- - `tree-sitter` + the per-language grammars — native parsers behind multi-language source facts
107
-
108
- `better-sqlite3` 13 does not need lifecycle-script approval: it ships stable
109
- N-API SQLite binaries for the supported platforms inside its npm package.
110
- Although npm infers a default `node-gyp rebuild` from the addon's source
111
- metadata, scip-query explicitly denies that unnecessary fallback in its own
112
- development install policy. A real database test verifies that the bundled
113
- binary works with scripts disabled.
114
- Seeing `prebuild-install` during a scip-query install therefore means an older
115
- scip-query dependency tree was selected.
116
-
117
- Approve them and re-run the builds (`--allow-scripts-pending` only _lists_ — the approving forms
118
- are `npm approve-scripts <pkg> ...` or `--all`):
40
+ Setup detects supported languages, installs or checks their indexers, builds
41
+ the local index, installs the bundled skills, and writes concise agent guidance.
42
+ When the repository declares valid architecture rules, setup also installs one
43
+ checkout-local Stop hook that checks those rules after indexed source changes.
44
+ It does not install a completion gate, pre-commit gate, or CI enforcement.
45
+
46
+ Check a setup with:
119
47
 
120
48
  ```bash
121
- npm approve-scripts --all # approve every pending install script (review the list first
122
- # with: npm approve-scripts --allow-scripts-pending)
123
- npm rebuild # run the now-approved build scripts
124
- scip-query status --capabilities # verify: languages should show as available
49
+ scip-query doctor
50
+ scip-query capabilities
125
51
  ```
126
52
 
127
- This approval is deliberately yours to make — a package cannot approve its own install scripts,
128
- and one that tried would be exactly the kind of supply-chain behavior to distrust.
53
+ ## The normal workflow
129
54
 
130
- ## Start with One Change
55
+ Use scip-query as the primary reading surface for indexed source. First name the
56
+ few material repository facts the answer depends on. Locate exact referents with
57
+ `search` for trustworthy text, `outline` for a known file, or `entrypoints` for
58
+ an external callable surface. Then select exact symbols or file/line constructs
59
+ and project only the relationship families and directions capable of establishing
60
+ those facts. scip-query resolves identity, typed edges, evidence strength, provider
61
+ support, and bounded coverage; it does not decide which facts matter to the task.
131
62
 
132
63
  ```bash
133
- # Before editing: establish structure, consumers, history, and blast radius
134
- scip-query plan-context <symbol-or-file>
135
-
136
- # Before creating a helper or abstraction: look for the existing concept
137
- scip-query similar <closest-symbol>
138
-
139
- # After an extraction or migration: find sites that still contain old logic
140
- scip-query incomplete-migration
141
-
142
- # Before declaring the work complete: gate the diff. Reindex only when status
143
- # reports stale and no live watcher or hook refresh is already responsible.
144
- scip-query diff-gate
145
- ```
146
-
147
- For a repository-wide cleanup pass:
64
+ scip-query search 'work_session_stream_events'
65
+ scip-query evidence \
66
+ --symbol 'appendWorkSessionStreamEvents' \
67
+ --edge execution \
68
+ --edge runtime \
69
+ --direction both \
70
+ --depth 2 \
71
+ --max-edges 32
72
+ ```
73
+
74
+ Treat the evidence inventory, facts, calibration, coverage, and recovery paths as
75
+ one contract. Missing output is not evidence of absence. If a material fact still
76
+ requires implementation behavior, batch its exact constructs into `inspect --view
77
+ behavior`. Use `code` only when exact syntax can change the decision. Do not reread
78
+ source already rendered by either command, and do not expand unrelated frontiers.
79
+
80
+ Before answering, audit the draft itself against the material claims. A fact
81
+ seen in evidence but left implicit in the answer is not recovered. Copy returned
82
+ file and line identities exactly rather than reconstructing citation paths.
83
+
84
+ A broad literal is counted exactly and returned with recoverable structural scopes.
85
+ Narrow only when a named material fact requires one of those scopes.
86
+
87
+ `code` accepts up to 24 exact symbols, ranges, or indexed file paths. A file
88
+ path returns its exported definitions—or its top-level definitions when the
89
+ language has no explicit export surface—plus the file-local definitions they
90
+ reference, then lists every omitted local definition as an exact range. This
91
+ keeps the default source surface small without hiding what remains available.
92
+ Use `--members all` only when the complete file matters. If a proposed packet
93
+ would exceed the active output budget, `code` emits no partial source and
94
+ prints exact complete-packet splits; narrow to the exact units still needed
95
+ before deciding whether every split remains necessary.
96
+
97
+ Start an unknown path with `search`; batch related text, symbol, and file-line
98
+ anchors with `inspect`; use `evidence` when one symbol and its real uses are the
99
+ center of the question. For tracked nonbinary repository content, keep
100
+ exploration on scip-query. Native tools are for applying edits, running checks,
101
+ binary content, or a specific unsupported gap that scip-query has explicitly
102
+ reported.
148
103
 
149
104
  ```bash
150
- scip-query health
151
- scip-query recent-duplicates
152
- scip-query cleanup-plan --verify
153
- scip-query health --write-baseline
154
- ```
105
+ scip-query search work_session_stream_events
106
+ scip-query inspect --search sessionStreamEvents --search work_session_stream_events --view behavior
107
+ scip-query evidence appendWorkSessionStreamEvents --include definition,references,callers,callees
108
+ ```
109
+
110
+ `inspect --view behavior` returns the cheapest faithful syntax-derived view of
111
+ each complete source unit. Compact units stay raw. Larger units become
112
+ hierarchical outlines only when that representation is materially smaller;
113
+ every source statement is represented, and unsupported or
114
+ compression-sensitive statements are copied verbatim. Coverage reports the
115
+ represented, copied, and omitted counts. Exact source can be requested for any
116
+ unit whose complete implementation matters. `inspect --symbol` includes definitions,
117
+ references, callers, callees, dependencies, and consumers by default.
118
+
119
+ Search, location, and relationship evidence is deduplicated into one ranked
120
+ packet. Exact locations and definitions rank first; later units must add new
121
+ file, role, scope, symbol, or behavior coverage. A default packet materializes
122
+ at most 12 matching lines per text selector, then applies a soft ceiling of 48
123
+ units or 60,000 displayed-evidence characters without clipping a returned
124
+ syntax unit. Its omission ledger groups everything withheld by scope and role,
125
+ reports what each group contains, and gives an exact command for drilling into
126
+ that group. Drill into several relevant groups together; use `--full` only when
127
+ all omitted evidence can change the decision. Large rendered output from other
128
+ commands can still use the universal byte-transport continuation printed by
129
+ every command.
130
+
131
+ Before a nonlocal change:
155
132
 
156
- ## Evidence and Confidence
157
-
158
- A claim you can't trace to evidence is a vibe. `scip-query` labels every answer with where it came from and how much weight it deserves:
159
-
160
- ```mermaid
161
- flowchart LR
162
- A["SCIP graph facts"] --> F["evidence-ranked findings"]
163
- B["semantic augmentation"] --> F
164
- C["source-backed candidates"] --> F
165
- D["git-history signals"] --> F
166
- E["repository checks"] --> F
167
- ```
168
-
169
- 1. **SCIP graph facts** for definitions, references, imports, calls, and dependencies.
170
- 2. **Semantic augmentation** for TypeScript where the SCIP index needs more detail.
171
- 3. **Source-backed candidates** for similarity, maintainability, and cleanup checks.
172
- 4. **Git-history signals** for churn, co-change, recency, and documentation drift.
173
- 5. **Repository-toolchain verification** for supported cleanup plans.
174
-
175
- Heuristic findings are candidates for inspection, not verdicts — the finding always sounds right, because it was generated to; only the code knows. Run `scip-query capabilities` to see which evidence and verification layers are available for the current repository and language.
176
-
177
- ## Language and Framework Coverage
178
-
179
- Graph navigation works through supported [SCIP](https://github.com/sourcegraph/scip) indexers. Higher-confidence augmentation and verification vary by language and project toolchain. TypeScript currently has the richest semantic augmentation. React and Vue add built-in framework-aware maintainability checks on top of the core workflow.
180
-
181
- Rust projects are indexed through rust-analyzer's SCIP output. Compiler-backed
182
- Rust reference, callee, signature, and module/use evidence runs through a
183
- demand-started durable rust-analyzer session with bounded worker fallback.
184
- Capability and status output distinguish indexer readiness, semantic readiness,
185
- the selected transport, and whether the idle helper is currently stopped or
186
- live.
187
-
188
- Clojure projects are indexed through `scip-clojure`. Source fallback adds namespace imports, callable/callsite evidence, and protocol/record member evidence for `.clj`, `.cljs`, and `.cljc` files. When the project has `clj-kondo` available, cleanup-plan verification can use `clj-kondo --lint .`. Clojure does not currently have a scip-query semantic provider equivalent to TypeScript's `ts-morph` layer; capability output reports that boundary explicitly.
189
-
190
- ## Cleaning Up AI-Generated Code
191
-
192
- Every check here exists because I watched the failure mode happen — in AI-generated codebases I inherited and rebuilt, and in my own agent sessions. AI-assisted development doesn't rot a codebase in general; it rots it in specific, recurring shapes, and each shape gets its own detector. The full catalog, with prevention wiring for each one, is in [docs/AI_FAILURE_MODES.md](docs/AI_FAILURE_MODES.md):
193
-
194
- **1. Find the echoes.** Agents re-implement helpers, hooks, composables, and frontend components they didn't know existed. `recent-duplicates` makes similarity _directional_ using git file ages - which side is the established original, which is the recent echo.
195
-
196
- Illustrative output:
197
-
198
- ```
199
- 91% ECHO react-component src/components/ProjectCardVisual.tsx ProjectCardVisual (added 62 commits ago)
200
- duplicates established src/pages/HomePage.tsx RecentProjectRow()
201
- basis: jsx-structure
202
- shared: component:ProjectCard, prop:title, event:click
203
- 100% TWIN src/workflows/a.ts ensureAccessible() / src/workflows/b.ts ensureAccessible()
204
- (both new - one agent session duplicated itself; consolidate before they diverge)
133
+ ```bash
134
+ scip-query context RetryPolicy
205
135
  ```
206
136
 
207
- **2. Finish the half-done extraction.** Agents extract a helper, rewire one or two call sites, and abandon the rest — the extracted logic survives inline at every site they missed. `incomplete-migration` finds helpers that are new in the diff, confirms they were wired in somewhere, and lists the established sites that still contain the helper's logic but never call it (containment scoring, because a missed site holds the helper's logic _plus_ its own).
137
+ `context` returns a bounded evidence packet for a symbol, file, or module. It
138
+ combines definitions, references, calls, data flow, dependencies, consumers,
139
+ change risk, history, suppressions, and possible reuse sites. A bounded packet
140
+ is a deliberately limited result: it is useful for a decision but does not
141
+ claim to contain every possible relationship.
208
142
 
209
- Illustrative output:
143
+ After a coherent edit:
210
144
 
211
- ```
212
- src/utils/priceLabel.ts priceLabel()
213
- wired into: src/cards/price-summary-a.ts
214
- un-migrated: 100% buildReportB() (src/cards/price-summary-b.ts)
215
- un-migrated: 100% buildReportC() (src/cards/price-summary-c.ts)
145
+ ```bash
146
+ scip-query diff-impact
216
147
  ```
217
148
 
218
- **3. Catch your standards docs lying.** If you keep in-repo standards for agents to read before implementing, a stale standard is worse than none. `doc-drift` reads every doc's file citations _and_ its co-change history, then flags docs whose code moved on without them — including **broken references** to files that no longer exist:
149
+ `diff-impact` maps changed symbols to downstream consumers. It is a change map,
150
+ not a pass/fail gate. The agent uses it with native tests and source inspection.
219
151
 
220
- ```
221
- staleness 94 product/domain-model.md
222
- BROKEN REFERENCE: cites src/api/servicePlans.ts — that file no longer exists
223
- 22 change(s) since doc update src/workflows/serviceTasks.ts (referenced by doc)
224
- ```
152
+ When structure matters:
225
153
 
226
- **4. Delete with project checks.** `cleanup-plan` runs dead-code analysis to a _fixpoint_ — deleting batch 0 makes batch 1 dead, and the plan shows the cascade. `--verify` applies each batch in a throwaway git worktree and runs the supported checker detected for your project (differentially, so pre-existing errors don't drown the signal):
227
-
228
- ```
229
- ── Batch 0: deletable now (graph-fact, 67 LOC) ──
230
- ── Batch 1: dead once batch 0 lands (cascade, 21 LOC) ──
231
- Batch 0: COMPILER-VERIFIED
154
+ ```bash
155
+ scip-query architecture
232
156
  ```
233
157
 
234
- When verification _fails_, the errors name the exact references the static evidence missed — that failure has caught real detector mistakes and stopped build-breaking deletions.
235
- Before applying a verified batch, run
236
- `scip-query cleanup-apply --verified --batch <n> --dry-run`. The preview reruns
237
- the verifier and dirty-tree checks, names every file, symbol range, and LOC,
238
- and stops at the source-mutation boundary. Apply by repeating the command
239
- without `--dry-run`; use `--all` only when the entire printed target set is
240
- intended.
241
-
242
- **5. Trim speculative generality.** `unused-params` finds trailing parameters no body ever uses (the classic "options for later"), scoped to removals that are type-safe by construction.
243
-
244
- **6. Keep frontend reuse honest.** React and Vue have dedicated frontend hygiene checks: component-duplicate commands compare JSX/template structure, hook/composable commands compare state/effect/request behavior, and large-component/view commands flag files that concentrate too many reasons to change. `health` includes these as hygiene pressure, while `incomplete-migration` remains the direct check for a hook/composable/helper extraction that was wired into some sites but not all of them.
158
+ An architecture rule is repository policy that permits or forbids dependency
159
+ edges between named file groups. Its defining trait is that it states a team
160
+ constraint, not a detector guess. Rules live in `.scipquery.json` and can cover
161
+ closed dependency rows, cycles, unresolved boundaries, fan-out, boundary size,
162
+ and test placement.
245
163
 
246
- **7. Surface hidden coupling.** `co-change` finds file pairs that repeatedly change in the same commits with _no_ dependency edge — schema ↔ generated inventory ↔ doc triangles, backend schemas ↔ frontend stores, `.env.example` ↔ its parser. The reference graph cannot see these; the change graph can.
164
+ When cleanup or drift matters:
247
165
 
248
- **8. Gate every diff.** `diff-gate` runs a defined set of checks scoped to what a change _introduces_ and exits nonzero with remediation text for each finding. Baseline regressions are included when you pass `--baseline`.
249
-
250
- <!-- BEGIN GENERATED DIFF-GATE CHECKS -->
251
-
252
- | Check | What it catches | When it runs |
253
- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
254
- | `echo` | Changed symbols that newly echo established code elsewhere. | Default diff gate. |
255
- | `incomplete-migration` | New helpers or abstractions wired into some sites while older inline sites remain. | Default diff gate. |
256
- | `co-change-partner` | Historically coupled files that usually change together but are missing from this diff. | Default diff gate. |
257
- | `twin-partner` | A changed symbol has a same-(near-)name twin (identical or already-divergent) elsewhere that this diff left untouched. | Default diff gate. Advisory: findings print but never cause a nonzero exit by themselves. |
258
- | `coverage-contract` | A configured `coverageContracts` entry (.scipquery.json) drifted: its declared key set no longer matches its ground-truth source. | Default diff gate, only when either side of a configured contract changed. |
259
- | `architecture` | A declared architecture boundary rule has a violation absent from the committed health baseline. | Default diff gate when closed dependency rows, requireCompletePolicy, requireAcyclic, requireResolvedBoundaries, requireMinimalPolicy, maxBoundaryFanOut/maxBoundaryFiles, or testPaths are configured and a baseline exists. |
260
- | `doc-reference` | Docs that cite changed files and may need a matching update. Dated snapshot docs (docs.snapshotPaths) are excluded by policy. | Default diff gate. Advisory (21.2) for bare file-mention citations; blocking when the citation has a line anchor or the cited file was deleted/renamed. |
261
- | `unused-params` | Fresh trailing parameters or options that no changed body uses. | Default diff gate. |
262
- | `new-dead` | Changed production symbols with zero indexed consumers. | Default diff gate. |
263
- | `baseline` | New health finding identities compared with the committed health baseline. | Only with `diff-gate --baseline`. |
264
-
265
- <!-- END GENERATED DIFF-GATE CHECKS -->
266
-
267
- Illustrative output:
268
-
269
- ```
270
- [co-change-partner] schema.prisma changed, but scripts/scope-inventory.mjs did not — they change together 12x (86% of the time)
271
- -> Update scripts/scope-inventory.mjs alongside this change, or confirm the coupling no longer holds.
166
+ ```bash
167
+ scip-query health --full
272
168
  ```
273
169
 
274
- **9. Ratchet it in CI.** `health --write-baseline` snapshots finding identities into a committable file; `health --baseline` exits 1 on any _new_ finding. "Don't get worse" is an objective gate that no score arithmetic can game.
275
-
276
- **10. Catch byte-identical tiny helpers `similar`'s fingerprints miss.** `duplicate-bodies` normalizes and hashes small callable bodies (comments/whitespace stripped, default `--min-loc 3`) and reports exact matches spanning multiple files — the "escapeRegex copy-pasted into seven files" shape that shape-based similarity scoring is too coarse to flag.
277
-
278
- **11. Catch a same-name function that drifted apart.** `twin-drift` finds functions with the same (or near-same) name in different files whose bodies have diverged — a strong signal one side got a bug fix, edge case, or feature the other never received. Synthetic leaves and test-only groups are excluded by default.
170
+ Health is a collection of repository analyses, not a correctness grade. It
171
+ reports graph facts and heuristic candidates separately. A heuristic candidate
172
+ is a source location selected by a pattern that may indicate a problem; the
173
+ agent must read the source before treating it as a defect.
279
174
 
280
- Baseline finding identities are keyed as `detector:file:shortName`. A rename can therefore appear as one fixed identity plus one new identity; refresh the baseline after intentional renames once the changed code has been reviewed.
175
+ ## React and Vue
281
176
 
282
- Accepted findings can be recorded without weakening the rest of the gate:
177
+ React and Vue analysis remains a first-class part of the product.
283
178
 
284
179
  ```bash
285
- scip-query suppress SQABC123DEF456 \
286
- --check echo \
287
- --reason-code compatibility-shim \
288
- --evidence source:src/compat.ts \
289
- --reason "the v1 export remains an intentional compatibility surface"
290
- ```
291
-
292
- This writes one file per suppression under `.scipquery/suppressions/` — commit
293
- it with your change. One-file-per-suppression means two branches suppressing
294
- different findings merge without conflict. The command requires an exact
295
- current finding ID, a controlled reason code, and at least one inspectable
296
- counterevidence referent. `source:`, `config:`, and `test:` referents are
297
- content-hashed when the record is written, so changing their bytes reopens the
298
- finding. A `graph:` referent is an exact `scip-query ...` command:
180
+ scip-query react-component-duplicates --full
181
+ scip-query react-hook-candidates --full
182
+ scip-query react-large-component-pressure --full
299
183
 
300
- ```bash
301
- scip-query suppress SQABC123DEF456 \
302
- --reason-code detector-counterexample \
303
- --evidence 'graph:scip-query refs CompatExport --full' \
304
- --reason "all compiler-resolved consumers still require this export"
184
+ scip-query vue-component-duplicates --full
185
+ scip-query vue-composable-candidates --full
186
+ scip-query vue-large-view-pressure --full
305
187
  ```
306
188
 
307
- The model may create these narrow records without human approval. Admission is
308
- still decided by scip-query's policy: broad, legacy, expired, invalidated,
309
- incompatible, or anomalously high-volume decisions remain findings and appear
310
- as policy escalations. A successful gate with accepted records reports
311
- `pass-with-suppressions`, not an ordinary clean pass. The legacy
312
- `suppressions[]` array in `.scipquery.json` and v1 record files remain readable,
313
- but do not automatically waive findings until explicitly replaced with
314
- structured counterevidence. `diff-gate` reports active findings,
315
- accepted suppressions, escalation reasons, and summary counts.
316
-
317
- The first suppression for an identity is created exclusively. Repeating the
318
- same decision is idempotent, but a different reason, expiry, check, or file is
319
- a policy change and never silently overwrites the existing file. The command
320
- reports the existing SHA-256 revision:
321
-
322
- ```text
323
- error: A different suppression decision already exists at ...
324
- Current revision: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.
325
- ```
189
+ These commands find repeated component structure, hook or composable behavior
190
+ that may deserve reuse, and files carrying unusually broad responsibility.
191
+ They tell an agent where to inspect and clean up. They do not order an automatic
192
+ refactor: intentional variation and real framework constraints must survive.
326
193
 
327
- After reviewing the committed decision, replace exactly that revision:
194
+ Vue repositories can add source facts when their indexer needs them:
328
195
 
329
196
  ```bash
330
- scip-query suppress SQABC123DEF456 --check echo \
331
- --reason-code compatibility-shim \
332
- --evidence source:src/compat.ts \
333
- --reason "superseded by a narrower compatibility exception" \
334
- --replace 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
197
+ scip-query augment-vue
335
198
  ```
336
199
 
337
- If another writer changes the record first, the stale replacement is rejected
338
- and the newer bytes remain intact. New records declare their schema version,
339
- record kind, stable suppression identity, writer version, adjudication policy,
340
- counterevidence, and invalidation conditions. Older unversioned and v1 records
341
- remain readable and are upgraded only by an explicit replacement. If a
342
- malformed or future record cannot be used, `diff-gate` reports exact
343
- incomplete-coverage counts and keeps findings conservatively unsuppressed. The
344
- wire schemas and merge rules are documented in
345
- [`docs/COMMITTED_RECORD_COMPATIBILITY.md`](docs/COMMITTED_RECORD_COMPATIBILITY.md).
200
+ ## Cleanup and drift commands
346
201
 
347
- **12. Observe how the gate is handled.** Every completed `diff-gate` run, including JSON and installed Stop-hook runs, writes each finding transition to its own committed `.scipquery/events/*.json` file. Independent branches add independent paths instead of editing one shared ledger file, so ordinary event writes do not create merge conflicts. Each event stores the logical gate-run identity, observer provenance, index/worktree receipt, and immutable Git commit used as its comparison base. A finding is a verified fix when it disappears under that same comparison—either directly or after scip-query cleanly replays the original base against a newer committed `HEAD`. Merely committing the finding cannot clear it: if replay still finds it, the outcome stays open; if the worktree is dirty or Git cannot reproduce the base, verification waits. Historical reconciliation is deliberately incremental: one run replays at most one stored comparison base, reports the exact deferred base and finding counts, and leaves every deferred finding open for a later gate. A suppressed finding was noise or an accepted trade-off:
202
+ The health report is an overview. Focused commands expose the evidence behind
203
+ particular kinds of pressure:
348
204
 
349
205
  ```bash
350
- scip-query effectiveness --since 30d
351
- ```
206
+ scip-query duplicate-bodies --full
207
+ scip-query twin-drift --full
208
+ scip-query recent-duplicates --full
209
+ scip-query incomplete-migration --full
210
+ scip-query doc-drift --full
211
+ scip-query unused-params --full
212
+ scip-query dead --full
213
+ scip-query isolated --full
214
+ scip-query cycles --full
215
+ scip-query co-change --full
216
+ ```
217
+
218
+ `incomplete-migration` looks for a new helper used at some matching sites while
219
+ older inline forms remain. `twin-drift` looks for same-concept implementations
220
+ that have diverged. `co-change` uses Git history to find files that repeatedly
221
+ change together without a visible dependency edge. Each is evidence for
222
+ inspection, not proof that code must be rewritten.
223
+
224
+ For compiler-checked dead-code removal:
352
225
 
226
+ ```bash
227
+ scip-query cleanup-plan --verify
353
228
  ```
354
- check caught fixed suppressed open moved unverified resolution-vs-suppression evaluation-precision authority median-days-to-fix
355
- echo 14 10 2 1 0 1 83% - local-writable-telemetry 0.8
356
- new-dead 6 5 0 1 0 0 100% - local-writable-telemetry 0.3
357
- ```
358
-
359
- `resolution-vs-suppression` is verified fixed ÷ (verified fixed + suppressed). Repository-local event and suppression files are writable by the same agent doing the work, so this ratio is operational telemetry, not an independent correctness grade. `evaluation-precision` is populated only when a protected external evaluator supplies both protected-CI records and a separately controlled attestation for their gate-run IDs; a JSON field cannot attest itself. Ordinary local-agent and local-human runs leave it blank. `moved` separates rename churn, while `unverified` is reserved for legacy or otherwise non-comparable resolutions that lack replay proof. Run diff-gate once to record the finding and again after the repair; a pre-commit rerun uses the same base directly, while clean post-commit runs advance through stored bases incrementally. Filter with `--check <name>`, window with `--since 30d|12w|<ISO date>`, and get machine-readable provenance, anomaly samples, and record-compatibility counts with `--json`. Local runs default to `local-agent`; a person running the gate directly may set `SCIP_QUERY_OUTCOME_OBSERVER_KIND=local-human` and optionally `SCIP_QUERY_OUTCOME_OBSERVER_SOURCE=<label>`. Both remain `repository-writable`; neither environment variable can claim protected authority. Because the event files are committed, the numbers survive re-clones and aggregate across every machine and agent working the repo, but missing or deliberately deleted history cannot be inferred from the remaining directory. Current event files carry an additive v1 discriminator, stable semantic identity, writer version, gate-run identity, observer authority, and observation receipt; existing unversioned files remain readable. `effectiveness` reports accepted and omitted record counts when history is partial, and cross-HEAD verification defers fixes rather than trusting an incomplete lifecycle. Legacy `.scipquery/ledger/events.jsonl` records remain readable and are migrated to individual files on the next gate write only when every non-empty line is compatible; otherwise the source ledger is preserved. Historical cross-`HEAD` events without stored comparison evidence remain unverified rather than being reclassified speculatively. Standalone health/cleanup commands are not yet outcome-tracked because they do not all expose a complete-scan contract.
360
229
 
361
- `diff-gate` is also single-flight per project: a second CLI or Stop-hook gate
362
- returns the live owner's PID and start time instead of duplicating the same
363
- CPU-heavy work. The gate runs in an owned child process with a 60-second
364
- deadline, or 180 seconds with `--full`; timeout terminates and reaps that child
365
- and fails the gate explicitly. Before and after every detector, the child
366
- publishes a private progress record; a timeout therefore names the active
367
- detector or phase and the last completed detector instead of reporting only
368
- the total elapsed time. Operators may set
369
- `SCIP_QUERY_DIFF_GATE_TIMEOUT_MS` to a positive millisecond value, capped at
370
- 10 minutes.
230
+ Review its batches before applying them. Cleanup is complete only when the
231
+ retired path, unused wiring, and misleading residue are gone and native checks
232
+ still pass.
371
233
 
372
- The health report also keeps a worktree-local repeat counter in `evidence.db`.
373
- A logical observation is one completed detector evaluation named by an
374
- observation ID; unlike a process attempt, a retry of that evaluation reuses the
375
- same ID. SQLite serializes these observations before deriving their
376
- transitions. Two different IDs that report the same finding therefore add two
377
- to `timesShown`, while an exact retry with the same ID and evidence adds
378
- nothing. Reusing an ID for different evidence is rejected and reported. A
379
- writer-lock timeout skips the local counter update rather than delaying or
380
- changing the gate decision, and the next distinct run may try again. The
381
- dedupe records live as long as that rebuildable `evidence.db`; deleting the
382
- database resets both the counters and their retry memory. These local counters
383
- feed detector-precision hints, not the committed `effectiveness` totals above.
234
+ ## Focused graph queries
384
235
 
385
- Before any edit, `plan-context <target>` bundles the structural picture — definitions, references, call graph, blast radius — plus a HISTORY section: churn, fix-commit density, and the files that usually change together with the target ("editing this usually means editing these").
236
+ Use the aggregate `context` command first for ordinary planning. Reach for a
237
+ focused query when one unresolved relationship can change the decision:
386
238
 
387
- ## A Health Score You Can Argue With
388
-
389
- `scip-query health` refuses to be a vanity number.
390
-
391
- Illustrative output:
392
-
393
- ```
394
- Codebase Health Score: 95/100
395
- Risk: 95/100 (history-correlated signals: graph facts + change graph)
396
- Hygiene: 100/100 (tidiness candidates)
397
-
398
- Score Breakdown (100 minus the following):
399
- - 5 hidden-coupling: 5 co-changing pair(s) without a dependency edge
400
-
401
- Axes:
402
- Deletable: 1,027 LOC across 89 symbols
403
- Change amplification: 5 files/commit median, 23 p90
404
- Evidence quality: 5 graph-fact, 150 heuristic, 0 user-suppressed
405
- Validation: flagged fix-density 0.12 vs baseline 0.20 (0.6x)
239
+ ```bash
240
+ scip-query refs SomeSymbol --full
241
+ scip-query trace SomeSymbol
242
+ scip-query call-graph SomeSymbol
243
+ scip-query value-flow SomeSymbol
244
+ scip-query affected SomeSymbol --full
245
+ scip-query system src/payments
246
+ scip-query surface src/payments
247
+ scip-query deps src/payments/service.ts
248
+ scip-query rdeps src/payments/service.ts
406
249
  ```
407
250
 
408
- - **Risk vs. Hygiene** are separate claims: risk components are tied to graph facts and repository-history signals; hygiene components are tidiness. Blending them is how scores become meaningless.
409
- - **Every deduction is itemized** — the scalar is auditable, not vibes.
410
- - **The validation axis is a falsifiability loop**: it measures whether flagged files actually attract more fix commits than the rest _in your repo_, per detector. On some codebases a detector tracks repeated fixes; on others it is mostly noise — the tool reports which, instead of assuming.
411
- - **Suppressions are data**: every `// scip-query: ignore-*` comment is a precision label, counted and reported.
412
-
413
- ## Accuracy Model
251
+ Do not repeat an unchanged query after context compaction. Re-run when source,
252
+ the index generation, the command input, or the required coverage changed.
414
253
 
415
- Evidence tiers are kept explicit, strongest first:
254
+ ## Suppressions
416
255
 
417
- 1. **Compiler-backed facts** from the SCIP database (`trace`, `refs`, `deps`, `outline`, ...).
418
- 2. **Semantic augmentation** via `ts-morph` for TypeScript — verified references, callers, callees when SCIP alone is incomplete.
419
- 3. **Source-backed heuristics** (AST/text) for cleanup signals. Always labeled: _"these are candidates, not exact compiler facts."_
420
- 4. **Compiler verification** for deletions — the only tier that earns the word "safe."
421
-
422
- And because accuracy you don't measure is a feeling, `self-audit` samples symbols and scores the cheap paths against the TypeScript compiler.
423
-
424
- Illustrative output:
425
-
426
- ```
427
- references precision 1.0 recall 0.9 (the cheap path doesn't fabricate; it occasionally misses)
428
- ```
429
-
430
- Heuristic detectors carry guardrails learned from real codebases: published `package.json` surfaces are exempt from "unused" advice, `contracts/` and `types/` modules are exempt from "definer never uses it," test files and component-sibling files don't count as hidden coupling, and changelogs-by-policy aren't drift.
431
-
432
- ## Agent Skills
433
-
434
- `scip-query install-skills` symlinks bundled skills into Claude Code, Codex, and shared agent roots (`~/.agents/skills/`) so they update automatically with the package. The `scip-query` router skill dispatches codebase work to the specialist below; when unsure which owns a task, start there.
435
-
436
- ### Bundled skills
437
-
438
- One-line "essential difference" per skill — read this table before the Routes table in `skills/scip-query/SKILL.md` if two names sound alike.
439
-
440
- | Skill | Essential difference |
441
- | --------------- | ------------------------------------------------------------------------------ |
442
- | `scip-query` | Router: select the smallest workflow that answers the request. |
443
- | `scip-explore` | Understand or diagram existing code without changing it. |
444
- | `scip-plan` | Prove the blast radius and specify one change or a multi-phase program. |
445
- | `scip-diagnose` | Trace a failure, recurring design flaw, issue, or unreachable branch to cause. |
446
- | `scip-audit` | Classify integrity, maintainability, drift, framework, and cleanup evidence. |
447
- | `scip-improve` | Act on confirmed audit or documentation findings and ratchet the result. |
448
- | `scip-verify` | Test and challenge a finished change before declaring it complete. |
449
- | `scip-setup` | Adopt or repair scip-query in a repository. |
450
- | `_shared` | Manual-only command/evidence reference loaded by another workflow when needed. |
451
-
452
- The important boundary is read-only versus mutating work: `scip-audit`
453
- classifies current evidence, while `scip-improve` changes confirmed findings.
454
- `scip-plan` is prospective evidence before implementation; `scip-verify`
455
- challenges a concrete finished diff. `scip-explore` explains working behavior;
456
- `scip-diagnose` starts from a failure or contradiction.
457
-
458
- Project setup writes reviewable checkout-local lifecycle hooks for Codex and Claude Code (`.codex/hooks.json` and `.claude/settings.local.json`). A checkout-local hook is an agent-tool preference whose defining trait is that it applies to one clone rather than expressing team policy. Setup adds both paths to that clone's `.git/info/exclude`, so they do not appear in commits, and refuses to rewrite either path if it is already tracked. `setup-hooks --shared` remains accepted only as a deprecated compatibility flag; it no longer writes `.claude/settings.json`. These hooks add scip-query context at session start, route prompts toward the right skill, and run an advisory Stop-hook wrapper around the diff gate only for that repository. The Stop hook sends feedback to the agent by default instead of blocking; set `SCIP_QUERY_STOP_HOOK_MODE=warn` for a warning-only hook response, or `SCIP_QUERY_STOP_HOOK_MODE=block` to enforce the gate. Set `SCIP_QUERY_SKIP_HOOK_INSTALL=1` or run `scip-query setup --no-hooks` to skip hook installation during setup, and run `scip-query setup-hooks --json` later to repair the current checkout's hooks. Preview hook removal with `scip-query setup-hooks --remove --dry-run`; `--force` is an installation-only mode and cannot be combined with removal. A scope-free `scip-query uninstall --dry-run` safely previews both global and project integrations, while real uninstall requires exactly one of `--global` or `--project`.
459
-
460
- Setup/configuration writers are conflict-aware. They reread the latest file
461
- under a short token-owned lock, preserve unknown JSON fields and prose outside
462
- owned Markdown markers, and publish complete bytes with flushed files and,
463
- where the host supports it, a synchronized complete directory path. An unrelated
464
- intervening JSON edit is merged; a stale decision about the same project-config
465
- field, malformed latest JSON, malformed managed markers, or an edit that wins
466
- the final revision check produces an explicit conflict and leaves the latest
467
- file untouched. Reload the file and rerun the command after resolving that
468
- conflict. See [Configuration and setup write safety](docs/CONFIGURATION_WRITE_SAFETY.md).
469
-
470
- For a project, run `scip-query setup`. It enables demand-started automatic
471
- indexing unless the project already has an explicit `watch.enabled: false`,
472
- starts or reuses the project service, verifies its clean-idle deadline, and
473
- reports Rust's final durable/worker semantic selection and lifecycle state.
474
- The status read is passive; the setup health audit may make a semantic request
475
- that wakes rust-analyzer, after which the helper exits on clean idle.
476
- It also installs/refreshes skills, configures project-local hooks unless
477
- skipped, checks indexer readiness, performs explicitly approved pinned indexer
478
- remediation,
479
- refreshes the index, smoke-tests representative command families, writes
480
- `docs/scip-query/health-dossier.md` and `.json` when the optional health pass is
481
- selected, reports the health score and items needing attention, and seeds
482
- AGENTS.md/CLAUDE.md guidance. Use
483
- the default terminal checklist to accept or decline the recommended automatic
484
- indexing action and other project-local changes (`--guided` requires an
485
- interactive terminal and reopens it explicitly; automation should use
486
- `--yes` or `--json`). After setup,
487
- `scip-audit` confirms raw signals and `scip-improve` keeps
488
- fixing the worst confirmed items until no safe confirmed cleanup remains. Use
489
- `scip-query setup --git-hook` when you also want a local pre-commit diff gate.
490
- Non-interactive setup and ordinary reindex report missing global tools without
491
- installing them; pass `--install-missing` only when that operation may install
492
- the reviewed immutable package versions. CI setup is intentionally separate.
493
-
494
- Setup classifies every change by where its facts belong:
495
-
496
- - **Repository records (commit):** shared project policy and history whose value comes from surviving clones and branches, including `.scipquery.json`, AGENTS/CLAUDE guidance, health dossiers, `.scipquery/suppressions/*.json`, and `.scipquery/ledger/`.
497
- - **Checkout preferences (do not commit):** integration settings for one clone, including `.codex/hooks.json`, `.claude/settings.local.json`, `.git/info/exclude`, and an optional `.git/hooks/pre-commit` backstop.
498
- - **User environment:** installed skills and language indexers used across checkouts on that machine.
499
-
500
- Rebuildable indexes, caches, and service state are runtime state: generated working data whose defining trait is that source plus configuration can reproduce it. They remain outside the repository by default. `setup --guided` labels each question with its scope, and both human and JSON setup reports return the resulting scope buckets.
501
-
502
- ## Formal Models (TLA+)
503
-
504
- For the parts of a system where the risk lives in interleaving — retries, concurrency, partial failure, money, a state machine with guards — `scip-query` scaffolds a TLA+ model tied to indexed code and keeps it honest against that code:
256
+ A suppression is a versioned repository record that says one detector finding
257
+ is accepted or is not actionable for a stated reason. Its defining trait is
258
+ that it addresses one finding without weakening unrelated analysis.
505
259
 
506
260
  ```bash
507
- scip-query tla scaffold src/queue/store.ts # draft spec + config + mapping from indexed code
508
- scip-query tla verify specs/queue/Queue.tla # mechanical conformance: referents, reads/writes, calls, model checker
509
- scip-query tla instrument specs/queue/Queue.tla # generate a trace recorder + wiring sites for each mapped action
510
- scip-query tla trace-check specs/queue/Queue.tla --trace traces/run1.json # check a recorded execution against Next
511
- scip-query tla fetch-tools # download the pinned tla2tools.jar into the cache
261
+ scip-query suppress SQ123 \
262
+ --check twin-drift \
263
+ --file src/example.ts \
264
+ --reason-code intentional-variation \
265
+ --reason "The two implementations follow different external contracts."
512
266
  ```
513
267
 
514
- `tla verify` checks the mapping contract against the model text and the indexed code: variable and action referents must resolve to value-like symbols (not types), declared reads/writes are checked against a static scan, and every waiver requires a reason and is counted in the output. At scale, findings are grouped by `(category, modelElement)` with up to 3 exemplars per group by default — pass `--full` to print every finding ungrouped. The `scip-plan` formal-model scenario (`scip-query install-skills`) walks the scaffold → verify → instrument → trace-check loop end to end.
268
+ Commit relevant `.scipquery/suppressions/*.json` files with the code or policy
269
+ that justifies them. Suppressions are merge-friendly because each finding uses
270
+ its own file.
515
271
 
516
- `tla fetch-tools` allows five minutes and 256 MiB for the pinned download by
517
- default. It streams bytes through the SHA-256 verifier instead of buffering the
518
- response, rejects malformed or oversized `Content-Length`, and enforces the
519
- same ceiling when the header is absent. Callers for one cache path serialize on
520
- a token-owned lock and recheck the winner's checksum before fetching. Failed,
521
- aborted, or competing operations remove only their random-token staging file;
522
- the previously accepted cache remains available. Successful promotion flushes
523
- the verified file and its containing directory before acknowledging the new
524
- cache where the platform supports directory sync.
272
+ ## Output and coverage
525
273
 
526
- File-backed state uses an explicit visibility-versus-crash-durability
527
- classification. See [Filesystem Publication and Durability](docs/DURABILITY.md)
528
- for the guarantees, failure outcomes, Windows limitation, and call-site matrix.
529
- Process coordination uses one versioned, token-owned format with conservative
530
- malformed-file recovery; see
531
- [Process Lock Ownership and Recovery](docs/LOCK_PROTOCOL.md).
532
-
533
- ## Quick Start
274
+ Human output is the default because it keeps hierarchy, whitespace, and source
275
+ line numbers readable. Programmatic consumers can use:
534
276
 
535
277
  ```bash
536
- scip-query setup # interactive: languages, indexers, parsers, hooks, indexing, capabilities
537
- scip-query status --capabilities
538
-
539
- scip-query stats
540
- scip-query system src/auth
541
- scip-query plan-context login
542
- scip-query diff-impact
543
- scip-query health
544
- scip-query cleanup-plan --verify
545
- scip-query health --write-baseline # start the ratchet
278
+ scip-query context RetryPolicy --json --result-only
546
279
  ```
547
280
 
548
- ## Prerequisites
549
-
550
- - Node.js 24 LTS is recommended. Node.js 22 is the minimum supported runtime;
551
- Node.js 22, 24, and 26 are tested.
552
- - `scip` CLI, from [Sourcegraph SCIP releases](https://github.com/sourcegraph/scip/releases)
553
- - A language-specific SCIP indexer for your project
554
-
555
- On Windows, the `scip` binary is installed automatically from npm:
556
- `scip-query-scip-windows` is an OS-gated optional dependency (universal
557
- package, x64 + ARM64) that only Windows installs fetch. Resolution order:
558
- `scip` on PATH, then `SCIP_QUERY_SCIP_BIN`, then the sidecar package. Run
559
- `scip-query check-deps` for platform-specific install instructions. The
560
- [Windows sidecar release guide](docs/WINDOWS_SIDECAR_RELEASE.md) defines its
561
- executable provenance, fail-closed build/pack checks, and registry identity
562
- gate. Release operators can run `npm run verify:scip-windows-registry` for a
563
- sidecar-only read, or `npm run release:npm:dry-run` for the complete
564
- main-plus-sidecar preflight and registry reconciliation without publication.
565
- The publishing command is `npm run release:npm`; direct `npm publish` refuses
566
- to run because it cannot own the recoverable two-package ordering.
567
-
568
- | Language | Indexer | Install |
569
- | ----------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------- |
570
- | TypeScript / JavaScript / Vue | scip-typescript | `npm install -g @sourcegraph/scip-typescript` |
571
- | Java / Scala / Kotlin | scip-java | [releases](https://github.com/sourcegraph/scip-java/releases) |
572
- | Rust | rust-analyzer | Ships with rust-analyzer: `rust-analyzer scip` |
573
- | Python | scip-python-plus | `npm install -g scip-python-plus` |
574
- | Go | scip-go | `go install github.com/sourcegraph/scip-go@latest` |
575
- | Ruby | scip-ruby | [releases](https://github.com/sourcegraph/scip-ruby/releases) |
576
- | C / C++ | scip-clang | [releases](https://github.com/sourcegraph/scip-clang/releases) |
577
- | C# / VB | scip-dotnet | [releases](https://github.com/sourcegraph/scip-dotnet/releases) |
578
- | Dart | scip-dart | [releases](https://github.com/Workiva/scip-dart/releases) or `dart pub global activate scip_dart` |
579
- | PHP | scip-php | [releases](https://github.com/davidrjenni/scip-php/releases) or Composer package `davidrjenni/scip-php` |
580
- | Clojure / ClojureScript | scip-clojure | Requires a `scip-clojure` binary on PATH; source: [PlunderStruck/scip-clojure](https://github.com/PlunderStruck/scip-clojure) |
581
-
582
- For Python, the executable may be `scip-python`, `scip-python-plus`, or both. `scip-query` accepts either name.
583
-
584
- Vue single-file components are handled through the JavaScript/TypeScript indexer. `scip-query` also extracts the `<script>` or `<script setup>` block so symbol, reference, and import queries cover Vue components alongside regular `.ts` and `.js` files.
585
-
586
- `augment-vue` uses one in-process Volar context by default. Calibrated projects
587
- can opt into parallel computation with `SCIP_QUERY_AUGMENT_VUE_WORKERS=<count>`.
588
- The CLI then owns every worker until exit: a timeout or peer failure terminates
589
- and awaits all unfinished workers before removing their private result
590
- directory. `SCIP_QUERY_AUGMENT_VUE_WORKER_TIMEOUT_MS` defaults to five minutes,
591
- and `SCIP_QUERY_AUGMENT_VUE_WORKER_RESULT_MAX_BYTES` defaults to 64 MiB per
592
- worker. Every result carries its run, worker, and task identities and is
593
- size-checked before parsing, so a stale, partial, or mismatched result cannot
594
- enter the deterministic worker-order merge.
595
-
596
- `scip-query capabilities` prints project-level readiness plus a per-language matrix for SCIP indexing, source fallback evidence, semantic provider support, cleanup detector support, and cleanup verification coverage. Use it when you need to know whether a finding is graph-backed, semantic, heuristic, or compiler-verified for the language in front of you.
597
-
598
- ## How It Works
599
-
600
- 1. A SCIP indexer analyzes source code with the actual compiler, type checker, or language server and produces `index.scip`.
601
- 2. The `scip` CLI converts that protobuf file to a SQLite database: `index.db`.
602
- 3. `scip-query` runs SQL queries, language-aware source augmentation, and git-history analysis against it.
603
-
604
- By default, indexes live in `~/.cache/scip-query/projects/<hash>/`, keeping project directories clean. Override paths with `.scipquery.json` or `SCIP_QUERY_*` environment variables. Reindexing writes per-language SCIP shards next to the SQLite index, so a mixed-language repo can reuse unchanged language outputs and rerun only the languages whose source/config inputs changed.
605
-
606
- Each accepted worktree-local index is also stored beneath an immutable
607
- `.scipquery-generations/<identity>/` directory. An atomic `state.json` pointer
608
- selects the database, SCIP companion, and metadata as one unit; every
609
- `ScipDatabase` retains that unit for its lifetime. The familiar top-level
610
- `index.db`, `index.scip`, and `meta.json` files remain compatibility mirrors,
611
- but internal queries do not reread them after opening a generation. This keeps
612
- cursor identities and semantic requests attached to the same rows even during
613
- a concurrent reindex. Each live reader publishes a process-identity lease.
614
- Automatic collection retains the current and recovery generations, every
615
- live-reader generation, and enough recent generations to stay within both an
616
- eight-generation and 2 GiB logical default bound. Malformed reader ownership
617
- fails closed; dead readers are reclaimed. `status` reports retained count,
618
- logical bytes, oldest age, protected/readers counts, limits, and the last
619
- collection result. The publication, crash, legacy-overlap, and retention rules
620
- are documented in [Local Index Generations](docs/INDEX_GENERATIONS.md).
621
-
622
- All `meta.json` consumers share one version decoder and an explicit capability
623
- matrix. Version 2 remains readable, version 3 is current, and version 4 is a
624
- reserved unsupported migration boundary. See
625
- [Reindex Metadata Compatibility](docs/REINDEX_METADATA_COMPATIBILITY.md).
626
-
627
- Git worktrees in the same repository also share immutable generations under
628
- `~/.cache/scip-query/repositories/<repository-id>/`. A shared generation is a
629
- complete index for one exact committed tree, indexing configuration, artifact
630
- schema, and scip-query producer version; its immutability lets several
631
- worktrees trust it without sharing later writes.
632
- Before an index-reading command opens SQLite, a clean worktree with an exact
633
- generation clones it into that worktree's normal writable cache. Filesystem
634
- copy-on-write cloning is used when available, with an ordinary copy fallback;
635
- hard links are never used. Dirty edits, watcher refreshes, locks, and local
636
- `evidence.db` state therefore remain private to the worktree.
637
-
638
- Each worktree lease names the exact shared generation protected from
639
- collection. Lease publication, liveness touches, and repository cleanup share
640
- one repository-cache lock. A touch rereads the current lease only after
641
- acquiring that lock, validates its ownership checksum and current local
642
- generation, and changes only `lastSeenAt`. If a newer generation was attached,
643
- the lease was deleted or recreated, or its ownership changed while the touch
644
- waited, the touch preserves that current state instead of replaying its stale
645
- observation.
646
-
647
- Automatic refresh follows the same boundary. When `watch.enabled` is true,
648
- the first watcher-eligible command in each worktree starts or reuses a daemon
649
- identified by that checkout's Git worktree ID. A Git worktree ID is a checkout
650
- identifier derived from its filesystem path after symbolic-link redirects are
651
- resolved and its checkout-specific Git control directory; that combination
652
- distinguishes sibling worktrees even though they share repository objects. The
653
- daemon observes only that worktree's files and Git index, and every reindex
654
- child writes only to that worktree's writable `index.scip` and `index.db`. A
655
- cross-platform source watcher maintains the directory subscriptions needed to
656
- detect ordinary unstaged edits even when Node does not provide recursive
657
- filesystem events, while separate Git polling detects commit and staging-state
658
- changes. File events that arrive during a reindex still mark the watcher dirty,
659
- but the queued rerun is suppressed when the completed index's source
660
- fingerprint proves those events are already represented; a stale or unreadable
661
- fingerprint always preserves the rerun. If the host refuses an event-backed
662
- subscription because its open-file allowance is exhausted, that project
663
- retries with 500 ms file polling; ordinary event-backed watchers do not pay
664
- that polling cost. A
665
- shared generation is only a warm starting snapshot; it never implies a shared
666
- watcher or shared later writes. A daemon that exits after its configured idle
667
- timeout starts warm again when that worktree is next used.
668
-
669
- Command-triggered refresh intent is stored separately from disposable activity
670
- timestamps. Each accepted demand is an immutable request with a deadline and
671
- optional idempotency key; the daemon claims pending requests exclusively,
672
- coalesces them deliberately, and acknowledges them only after the corresponding
673
- reindex completes. A failed attempt returns its requests to pending, and a
674
- successor daemon recovers claims left by a crashed owner. `watch --status`
675
- reports pending, claimed, completed, and expired counts. The complete
676
- at-least-once and retention contract is documented in
677
- [Watch Refresh Requests](docs/WATCH_REFRESH_REQUESTS.md).
678
-
679
- The primary checkout is only a possible source of a generation, never an
680
- authority for a linked worktree. If its local cache already contains
681
- uncommitted changes that are absent from a new worktree's `HEAD`, the full
682
- source fingerprint differs and that cache is rejected. The new worktree uses
683
- an existing immutable generation for its own `HEAD` or performs the one clean
684
- build that creates it.
685
-
686
- The same behavior applies whether a worktree was created by Git, Conductor, or
687
- an agent. Concurrent cold worktrees at one snapshot coordinate one shared
688
- publication. A removed managed worktree cache is deleted by the next
689
- opportunistic sweep after its watcher, hydration, and index-build processes
690
- have exited; a shared generation stays while a live worktree or process
691
- references it, then remains for one unreferenced hour unless the 2 GiB
692
- repository budget requires earlier eviction. Ownership checksums and physical
693
- path containment prevent cleanup from following forged records or symlinks.
694
- Explicit `dbPath`, `SCIP_QUERY_CACHE_DIR`, and
695
- `SCIP_QUERY_INDEX_DB` locations are never shared or automatically deleted.
696
- Those explicit overrides also bypass default path isolation, so pointing two
697
- worktrees at the same mutable override is intentionally outside automatic
698
- per-worktree protection.
699
- Set `SCIP_QUERY_SHARED_CACHE=0` to restore worktree-local-only behavior.
700
-
701
- Each rebuilt generation also records an affected-set shadow beside the index:
702
- the files a future incremental writer would recompute, the normalized
703
- documents/facts that the authoritative full rebuild actually changed, recall,
704
- and any conservative fallback reason. `scip-query status` shows a compact
705
- summary and telemetry path; `status --json` exposes the structured
706
- `affectedSetShadow` object. Shadow results are observational in this phase and
707
- never decide which indexer runs or which generation publishes.
708
- Historical shadow rows are compact calibration summaries. They rotate at
709
- 8 MiB and retain one previous segment, bounding history near 16 MiB per
710
- project; the complete latest record remains available for status diagnostics.
711
- After acquiring a project's exclusive reindex lock, each reindex also removes
712
- staging directories abandoned by interrupted earlier reindexes.
713
- Watch and watcher-triggered reindex ownership records include the operating
714
- system process start identity as well as the PID. `watch stop`, daemon
715
- replacement, and manual preemption verify both values before signaling. A
716
- legacy record or a platform lookup failure therefore fails closed with an
717
- explicit recovery error instead of treating a reused PID as the old
718
- tool-owned process.
719
- Watcher shutdown stops new work and gives subscriptions and active reindex
720
- ownership five seconds to drain. A dedicated watch service that cannot prove a
721
- clean stop reports a degraded shutdown and exits so the operating system can
722
- close stuck descriptors. `watch stop` allows six seconds for that graceful
723
- path, then revalidates the exact process-start identity before forced
724
- termination and waits up to one additional second to observe exit. A changed
725
- or unavailable identity is never signaled, and ownership files are not cleaned
726
- until the original process is known to have exited.
727
-
728
- Finite subprocesses use explicit wall-time and output budgets. Quick binary
729
- probes default to 10 seconds, Git operations to 30 seconds, isolated analysis
730
- workers to 180 seconds, installers and index conversion to 300 seconds, and
731
- language indexers to 600 seconds. Set `SCIP_QUERY_INDEXER_TIMEOUT_MS` to a
732
- positive integer to override the indexer deadline. Command-specific checker,
733
- TLA+, benchmark, and Rust semantic budgets continue to use their documented
734
- options or environment settings. When an asynchronous finite child exceeds
735
- its deadline or output budget, scip-query drains both streams, sends `TERM`,
736
- escalates to `KILL` after a one-second grace period only while the recorded
737
- process identity still matches, and reports completion only after the child
738
- has closed. Detached watch and semantic services are deliberate exceptions:
739
- their persisted identity, lease, request deadlines, and stop protocol own
740
- their lifetime.
741
-
742
- TypeScript monorepos can opt into project sharding with `indexer.typescript.projectMode: "workspace"`. In that mode, `scip-query` discovers repo-local TypeScript project roots, runs one `scip-typescript` process per project with bounded concurrency, merges the shard protobufs, and still publishes one TypeScript language index. Set `indexer.typescript.projects` to an explicit list of project directories or tsconfig paths when automatic discovery is too broad. When `projects` is set to a non-empty list, it is authoritative: only the listed projects are indexed, automatic discovery does not run, and the repo root is not re-added alongside them (even if the root tsconfig covers subdirectories) — files that are only covered by an excluded root tsconfig (e.g. shared ambient `.d.ts` files) drop out of the index, so pick the list deliberately. An empty or absent `projects` falls back to full discovery, unchanged. Workspace mode also caches each project shard: reindexing after an edit reruns only the changed projects and their dependents (workspace `package.json` dependencies and tsconfig `paths`/`references` targets count as dependencies), serves untouched projects from `language-indexes/typescript-projects/`, and reports every reuse decision in `reindex --json` shard diagnostics. Set `indexerConcurrency` when a repo needs a persistent worker cap; CLI `--indexer-concurrency` and `SCIP_QUERY_INDEXER_CONCURRENCY` still override ad hoc runs.
743
- Use `indexer.typescript.pnpmWorkspaces` only with the default single-project mode; workspace mode passes explicit projects instead.
744
-
745
- Do not enable workspace mode merely because a repository uses TypeScript. Use
746
- it when the repository has multiple real tsconfig/project boundaries and the
747
- setup/readiness evidence confirms them. Single-project repositories already
748
- reuse unchanged TypeScript documents and keep a persistent ts-morph Project in
749
- the demand-started service.
750
-
751
- Clojure projects can pass a project-local `scip-clojure` config file through `.scipquery.json`:
752
-
753
- ```json
754
- {
755
- "$schema": "./node_modules/scip-query/docs/schemas/project-config.schema.json",
756
- "schemaVersion": 2,
757
- "languages": ["clojure"],
758
- "indexer": {
759
- "clojure": {
760
- "configPath": ".scip-clojure.json"
761
- }
762
- }
763
- }
764
- ```
281
+ Search output separates a complete occurrence ledger from source
282
+ materialization. Every exact matching path and line is listed with its owner;
283
+ the default expands only a representative source subset. Use the emitted
284
+ batched drilldowns for selected owners. `search --full` expands every source
285
+ window and is not needed to establish complete text-match coverage.
765
286
 
766
- Most read-only commands accept `--json` and use the same versioned envelope.
767
- Add `--result-only` when a program needs just the command payload:
768
-
769
- ```json
770
- {
771
- "kind": "scip-query-result",
772
- "schemaVersion": 1,
773
- "producer": { "name": "scip-query", "version": "0.20.0" },
774
- "command": "fan-in",
775
- "resultSchemaVersion": 1,
776
- "args": ["login"],
777
- "options": { "json": true },
778
- "result": []
779
- }
780
- ```
287
+ Cross-command evidence citations are off by default. With an explicit
288
+ `SCIP_QUERY_SESSION`, a complete source unit, a byte-identical exact subset of a
289
+ prior exact source read, or a graph unit/edge may be replaced by a visible
290
+ receipt from the same index generation. Preview coverage never suppresses an
291
+ exact unit. Changed bytes, changed graph content, a new generation, or
292
+ `--reemit` force full evidence.
781
293
 
782
- ## Configuration
294
+ If output prints `Continue exactly:`, run the emitted command unchanged until
295
+ transport is complete. Transport completion means every rendered character was
296
+ retrieved; it does not make bounded analysis exhaustive.
783
297
 
784
- Run this in a project root:
298
+ Use `--full` only when complete command coverage can change a decision. Always
299
+ read a command's coverage note before claiming that every caller, consumer, or
300
+ finding was considered.
785
301
 
786
- ```bash
787
- scip-query init
788
- ```
302
+ ## Configuration
789
303
 
790
- It creates a minimal `.scipquery.json`:
791
-
792
- ```json
793
- {
794
- "$schema": "./node_modules/scip-query/docs/schemas/project-config.schema.json",
795
- "schemaVersion": 2,
796
- "languages": ["typescript"],
797
- "watch": {
798
- "enabled": true,
799
- "debounceMs": 250,
800
- "cooldownMs": 5000,
801
- "gitPollMs": 2000,
802
- "idleTimeoutMs": 600000,
803
- "autoRefresh": true
804
- }
805
- }
806
- ```
304
+ Project policy lives in `.scipquery.json`. Common sections configure source
305
+ paths, generated or vendor exclusions, documentation snapshots, architecture
306
+ boundaries, declared coupling, coverage contracts, and watcher behavior.
807
307
 
808
- `schemaVersion` identifies the meaning of the persisted fields. Version 2 is
809
- the current format. The CLI reads both unversioned/explicit-v1 legacy files
810
- and version 2. A setup command migrates a legacy file on its next authorized
811
- config write, preserving fields it does not own. An unsupported future
812
- version or malformed discriminator fails before any option is used and is
813
- left byte-for-byte unchanged. `$schema` points editors at the JSON Schema
814
- bundled with the installed package.
815
-
816
- Creation is exclusive: if another process creates `.scipquery.json` first,
817
- `init` preserves that complete file rather than replacing it.
818
-
819
- Add optional fields such as `indexerConcurrency`, `indexer`, `entryRoots`,
820
- `declaredCouplings`, and `suppressions` only when the project needs them.
821
-
822
- `scip-query init` and a first `scip-query setup` enable this lifecycle. An
823
- existing explicit `watch.enabled: false` remains an opt-out unless guided setup
824
- selects the recommended enable action. With `watch.enabled`, normal commands
825
- and agent hooks wake one per-project
826
- background service. Relevant file/Git activity keeps it alive; it exits after
827
- `idleTimeoutMs` of clean inactivity and wakes on the next command. Set the idle
828
- timeout to `0` to keep it running. `scip-query watch` still provides foreground
829
- mode, while `watch --daemon`, `watch --status`, and `watch --stop` expose the
830
- background lifecycle. Command-line timing flags are process-local and apply
831
- only when a foreground watcher or daemon starts; a live daemon refuses those
832
- flags and names the required stop/start sequence instead of pretending its
833
- timing changed. The default 5-second cooldown coalesces change bursts
834
- into one refresh plus, when necessary, one trailing refresh; explicitly setting
835
- `cooldownMs` to `0` opts into immediate scheduling. Both modes share one project
836
- lock, so only one can own an
837
- index cache. Stopping is an asynchronous drain: the watcher first rejects new
838
- refreshes, continuously consumes a bounded tail of the active worker's output,
839
- closes every source subscription, and waits for the worker to exit after
840
- `TERM`/`KILL` escalation before it removes service state or releases the lock.
841
- `watch --status` reports `Stopping safely` while that work is in progress. If a
842
- subscription cannot close or worker exit cannot be established, the service
843
- keeps an explicit degraded draining record and its ownership files instead of
844
- advertising a clean stop; the reported reason is the recovery evidence.
845
- Elapsed waits and idle control use a process-local monotonic clock; shared
846
- heartbeats remain civil-time diagnostics and never authorize replacement or a
847
- process signal by age alone. See [Time Semantics](docs/TIME_SEMANTICS.md).
848
-
849
- The same demand-started service lazily owns TypeScript compiler Projects after
850
- the first command that needs ts-morph semantics. Separate CLI processes reuse
851
- that session through a repository-local bounded mailbox; source-only index
852
- generations refresh the existing Projects, while configuration or uncertain
853
- changes replace them. `watch --status` reports Project/session/request counts.
854
- Current TypeScript and durable Rust mailbox operations use stable
855
- content-derived identities, pending/inflight/response states, atomic
856
- owner-expiring claims, retained idempotent completions, FIFO enqueue ordering,
857
- typed item/byte backpressure, bounded cleanup, and pressure telemetry. Client
858
- timeout or exit no longer deletes shared work; a service crash before response
859
- is reclaimable, while a response published before a crash prevents
860
- re-execution. The service rereads the clock before each claimed operation and
861
- again after handler completion, so time spent on an earlier request cannot let
862
- a later expired request begin or publish success. Idle mailbox polling backs
863
- off from 50 ms to 250 ms and returns to 10 ms while draining work; mailbox
864
- directories are initialized once per service ownership rather than on every
865
- poll. The precise state machine, default limits, legacy overlap, and
866
- failure matrix are documented in
867
- [`docs/MAILBOX_LIFECYCLE.md`](docs/MAILBOX_LIFECYCLE.md).
868
- Rust v3 additionally binds every accepted response to its request ID,
869
- operation ID, mailbox-session identity, and authoritative absolute deadline;
870
- its old/current/future compatibility matrix is in
871
- [`docs/RUST_DURABLE_SESSION_PROTOCOL.md`](docs/RUST_DURABLE_SESSION_PROTOCOL.md).
872
- The Rust semantic worker retains at most four rust-analyzer sessions. Linked
873
- Cargo projects are resolved, deduplicated, and sorted before session reuse, so
874
- equivalent project sets share one session regardless of input order. When the
875
- capacity is full, the least-recently-used session completes its LSP shutdown
876
- and process-tree reap before a replacement starts; an unproven shutdown blocks
877
- replacement instead of allowing overlapping language servers.
878
- It also reports a rolling 24-hour reindex activity summary: rebuilt, reused,
879
- failed, and freshness-proven suppressed refreshes plus estimated logical output
880
- bytes. The estimate counts scip-query artifacts emitted by rebuilt refreshes;
881
- it is not a measurement of physical SSD writes. The underlying
882
- `reindex-activity.jsonl` history uses two bounded 1 MiB segments. Append,
883
- rotation, and retained-set reads share a process-instance lock; incomplete
884
- crash tails are trimmed or ignored without deleting earlier complete lines.
885
- Status labels the resulting summary `complete`, `partial`, or `unavailable`
886
- and reports read, invalid, skipped, read-error, and incomplete-tail counts.
887
- Telemetry append failure never changes the authoritative reindex result, but
888
- it is returned to the caller and surfaced as a warning or watch-state error
889
- instead of disappearing. These observations are process-visible rather than
890
- crash-durable. See
891
- [`docs/TELEMETRY_RETENTION.md`](docs/TELEMETRY_RETENTION.md).
892
- The refresh-request counters reported beside it describe durable demand
893
- admission and processing state, not reindex frequency.
894
- If the service is stopped, incompatible, busy beyond its bound, or returns an
895
- invalid response, the command falls back to the existing in-process ts-morph
896
- provider.
897
-
898
- Rust semantic requests use a separate demand-started durable rust-analyzer
899
- session by default. It remains stopped until a Rust semantic request needs it,
900
- exits after its clean idle period, and automatically falls back to the
901
- per-command worker on helper/readiness/timeout/request failure. Set
902
- `SCIP_RUST_SEMANTIC_DURABLE_SESSION=0` for an explicit worker-only opt-out.
903
- The LSP transport accepts at most a 16 KiB response header and a 64 MiB JSON
904
- message by default, with a 64 KiB header ceiling and a 256 MiB combined
905
- wire-buffer ceiling even for programmatic overrides. Missing, invalid,
906
- duplicate, unsafe, or oversized `Content-Length` framing kills that transport
907
- once, clears its retained bytes, and fails all outstanding semantic/readiness
908
- work so the normal worker or graph/source fallback can take over.
909
-
910
- Use `declaredCouplings` for files that intentionally form one maintenance unit.
911
- These pairs are treated as structurally linked by `co-change` and health, while
912
- still appearing in file-specific exploration. The cleanup detector example
913
- keeps dead-code, isolated-callable, and stale-abstraction detectors together
914
- because they share candidate and evidence policy changes:
915
-
916
- ```json
917
- {
918
- "declaredCouplings": [
919
- {
920
- "name": "cleanup detector family",
921
- "reason": "These detectors share candidate, evidence, and health policy changes.",
922
- "files": [
923
- "src/queries/cleanup/dead.ts",
924
- "src/queries/cleanup/isolated.ts",
925
- "src/queries/cleanup/stale-abstractions.ts"
926
- ]
927
- }
928
- ]
929
- }
930
- ```
308
+ Validate it with:
931
309
 
932
- The consumer evidence product migration kept this declared-coupling example
933
- current: `src/queries/cleanup/stale-abstractions.ts` still belongs to the
934
- cleanup detector family and still shares candidate/evidence policy with the
935
- dead and isolated cleanup detectors.
936
-
937
- Useful environment variables:
310
+ ```bash
311
+ scip-query config-validate
312
+ ```
938
313
 
939
- | Variable | Purpose |
940
- | ------------------------- | ----------------------------------------------------------------------- |
941
- | `SCIP_QUERY_PROJECT_ROOT` | Override the project root directory |
942
- | `SCIP_QUERY_INDEX_DB` | Override the SQLite database path and bypass automatic worktree sharing |
943
- | `SCIP_QUERY_INDEX_SCIP` | Override the SCIP protobuf path |
944
- | `SCIP_QUERY_CACHE_DIR` | Override the cache directory and bypass automatic worktree sharing |
945
- | `SCIP_QUERY_SHARED_CACHE` | Set to `0` to disable shared generations, evidence, leases, and cleanup |
946
- | `SCIP_QUERY_SCIP_BIN` | Path to a local `scip` binary (overrides PATH and the Windows sidecar) |
314
+ Keep configuration small. Add a rule only when an observed repository fact or
315
+ team policy requires it.
947
316
 
948
- Query results are filtered through the project's `.gitignore`. If none exists, common generated directories such as `dist/`, `target/`, `node_modules/`, and `.venv/` are excluded by default.
317
+ ## Command reference
949
318
 
950
- ## Documentation
319
+ The generated syntax catalog is in
320
+ [`docs/COMMAND_REFERENCE.md`](docs/COMMAND_REFERENCE.md). The one bundled
321
+ `scip-query` skill teaches mapping, ordinary planning, architecture checks,
322
+ and focused use of the React, Vue, and general cleanup detectors.
951
323
 
952
- - [AI Failure Modes](docs/AI_FAILURE_MODES.md): every specific way AI coding rots a codebase, the detector built for it, and how to wire prevention in.
953
- - [Detector Guide](docs/DETECTOR_GUIDE.md): what each detector measures, the differences between the confusable ones, and which check to run after which kind of change.
954
- - [Agent Guide](docs/AGENT_GUIDE.md): goal-oriented workflows for tracing, planning, cleanup, quality checks, and change verification.
955
- - [Command Reference](docs/COMMAND_REFERENCE.md): generated command syntax, descriptions, and options.
956
- - [CLI JSON output contract](docs/CLI_JSON_OUTPUT.md): versioned envelopes, compatibility rules, and schema.
957
- - [Security model](docs/SECURITY_MODEL.md): untrusted-checkout boundaries, authority flags, input budgets, and complete-output pagination.
958
- - [Programmatic API](docs/API.md): using the query functions from TypeScript.
959
- - [Historical plans](https://github.com/PlunderStruck/scip-query/tree/main/docs/plans): implementation notes and completed cleanup plans.
324
+ ## Development
960
325
 
961
- ## License
326
+ ```bash
327
+ npm install
328
+ npm run typecheck
329
+ npm test
330
+ npm run build
331
+ ```
962
332
 
963
- Apache-2.0
333
+ The React and Vue detector suites are part of the normal test surface and must
334
+ remain passing when the workflow or command surface changes.