scip-query 0.17.2 → 0.18.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 (121) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +2 -1
  3. package/dist/{chunk-KSD6IWF4.js → chunk-2GX3TNOW.js} +2 -2
  4. package/dist/{chunk-Q4GKL4CC.js → chunk-35TZERMO.js} +2 -2
  5. package/dist/{chunk-P6FOIU7O.js → chunk-43QUXX3E.js} +2 -2
  6. package/dist/{chunk-U4G4UYLB.js → chunk-45XOH33S.js} +2 -2
  7. package/dist/{chunk-LEKXKHIQ.js → chunk-4MFMTEJ4.js} +5 -5
  8. package/dist/{chunk-FVLZB54V.js → chunk-ABDXTPCT.js} +2 -2
  9. package/dist/{chunk-N3JH45WR.js → chunk-AV54WZUK.js} +2 -2
  10. package/dist/{chunk-S22ICAWV.js → chunk-BAMVG4WQ.js} +2 -2
  11. package/dist/{chunk-7VR5TNOI.js → chunk-BECOMXAL.js} +2 -2
  12. package/dist/{chunk-K53GNKY3.js → chunk-BJJHBKEC.js} +2 -2
  13. package/dist/{chunk-ROMKXEUM.js → chunk-D5F3IQYP.js} +2 -2
  14. package/dist/{chunk-LFPQFRCX.js → chunk-DDGO34I2.js} +2 -2
  15. package/dist/{chunk-IS7DZ7TB.js → chunk-DUKRAHV2.js} +2 -2
  16. package/dist/{chunk-W7FNZKX5.js → chunk-EJ65IVPV.js} +2 -2
  17. package/dist/{chunk-SON6DQNK.js → chunk-EMEXMHOP.js} +2 -2
  18. package/dist/{chunk-BPMBOZAN.js → chunk-FMD46HAG.js} +2 -2
  19. package/dist/{chunk-4H7T7FIM.js → chunk-GTANVH72.js} +2 -2
  20. package/dist/{chunk-O7NA5FCA.js → chunk-GWCW25ON.js} +2 -2
  21. package/dist/chunk-GWNE2WJN.js +3 -0
  22. package/dist/{chunk-ELLPMCWA.js → chunk-H4JNB7RT.js} +2 -2
  23. package/dist/{chunk-G6DDSHMD.js → chunk-HOZ3IXZ5.js} +2 -2
  24. package/dist/{chunk-RUV4KHWA.js → chunk-L2RE5P3X.js} +2 -2
  25. package/dist/{chunk-7LERNHDG.js → chunk-L2TSLMPT.js} +2 -2
  26. package/dist/{chunk-KA7RMBVU.js → chunk-LADYDOS5.js} +2 -2
  27. package/dist/{chunk-AY44MGWS.js → chunk-MN54AGZ3.js} +2 -2
  28. package/dist/{chunk-DJI446FQ.js → chunk-MNRKD3WP.js} +2 -2
  29. package/dist/{chunk-SXDXR5FH.js → chunk-MPBN5DO4.js} +2 -2
  30. package/dist/{chunk-KJOKTZUE.js → chunk-NQBMGFFD.js} +2 -2
  31. package/dist/{chunk-K4XL4HOK.js → chunk-O5Y3ISO3.js} +2 -2
  32. package/dist/{chunk-BEGHYHOQ.js → chunk-ODH4FT3P.js} +2 -2
  33. package/dist/{chunk-MBVHEPHQ.js → chunk-OM6JHEW3.js} +2 -2
  34. package/dist/{chunk-C7MBQSIC.js → chunk-OSBLECSI.js} +2 -2
  35. package/dist/{chunk-ATC4MEVA.js → chunk-OTTHMUMV.js} +2 -2
  36. package/dist/{chunk-SSGACGAD.js → chunk-OUXPJ4H5.js} +2 -2
  37. package/dist/{chunk-CVWX24IY.js → chunk-OWXNDSG3.js} +2 -2
  38. package/dist/{chunk-OQFA2SUQ.js → chunk-P4L5QQT5.js} +2 -2
  39. package/dist/{chunk-APCXCRED.js → chunk-POGZSZPX.js} +2 -2
  40. package/dist/{chunk-4QBRVI7D.js → chunk-PV3GKBO5.js} +2 -2
  41. package/dist/{chunk-NJD4C5G5.js → chunk-PZV2PGBR.js} +2 -2
  42. package/dist/{chunk-CHJ3QROR.js → chunk-Q4UM4JJP.js} +2 -2
  43. package/dist/{chunk-PQD7P6WB.js → chunk-QPF7CS5W.js} +2 -2
  44. package/dist/{chunk-WD3PAQJT.js → chunk-R4VPIS4D.js} +2 -2
  45. package/dist/{chunk-XLJORP6N.js → chunk-RDX6WWHN.js} +2 -2
  46. package/dist/{chunk-YYYERNQL.js → chunk-S43DIBME.js} +2 -2
  47. package/dist/{chunk-MFIA6EIT.js → chunk-SW7LKHRU.js} +2 -2
  48. package/dist/{chunk-2A7LUMZP.js → chunk-SWJEREML.js} +2 -2
  49. package/dist/{chunk-6AITNECC.js → chunk-VQWDZ34M.js} +127 -127
  50. package/dist/{chunk-A2GX3PYV.js → chunk-VXDMXZKC.js} +2 -2
  51. package/dist/{chunk-XTF6ELXT.js → chunk-W3557RPL.js} +2 -2
  52. package/dist/chunk-W3SKYOTF.js +2 -0
  53. package/dist/{chunk-NJTIAQY7.js → chunk-XEEQX5X3.js} +2 -2
  54. package/dist/cli.js +1 -1
  55. package/dist/{command-descriptors-7UUURHWT.js → command-descriptors-AQWWJNTT.js} +143 -143
  56. package/dist/direct-navigation-K3CTVVBU.js +3 -0
  57. package/dist/index.js +1 -1
  58. package/dist/postinstall.js +1 -1
  59. package/dist/queries/affected.js +1 -1
  60. package/dist/queries/bottlenecks.js +1 -1
  61. package/dist/queries/call-graph.js +1 -1
  62. package/dist/queries/change-surface.js +1 -1
  63. package/dist/queries/cleanup-plan.js +1 -1
  64. package/dist/queries/complexity-hotspots.js +1 -1
  65. package/dist/queries/complexity.js +1 -1
  66. package/dist/queries/convergence.js +1 -1
  67. package/dist/queries/dataflow.js +1 -1
  68. package/dist/queries/dead.js +1 -1
  69. package/dist/queries/decorative-checkers.js +1 -1
  70. package/dist/queries/diff-gate.js +1 -1
  71. package/dist/queries/diff-impact.js +1 -1
  72. package/dist/queries/drift.js +1 -1
  73. package/dist/queries/extract-candidates.js +1 -1
  74. package/dist/queries/health.js +1 -1
  75. package/dist/queries/hotspots.js +1 -1
  76. package/dist/queries/imports.js +1 -1
  77. package/dist/queries/incomplete-migration.js +1 -1
  78. package/dist/queries/index.js +1 -1
  79. package/dist/queries/isolated.js +1 -1
  80. package/dist/queries/locality-candidates.js +1 -1
  81. package/dist/queries/members.js +1 -1
  82. package/dist/queries/methods.js +1 -1
  83. package/dist/queries/not-implemented.js +1 -1
  84. package/dist/queries/passthrough-candidates.js +1 -1
  85. package/dist/queries/plan-context.js +1 -1
  86. package/dist/queries/recent-duplicates.js +1 -1
  87. package/dist/queries/redundant-reexports.js +1 -1
  88. package/dist/queries/refs.js +1 -1
  89. package/dist/queries/self-audit.js +1 -1
  90. package/dist/queries/similar-signatures.js +1 -1
  91. package/dist/queries/similar.js +1 -1
  92. package/dist/queries/slice.js +1 -1
  93. package/dist/queries/stale-abstractions.js +1 -1
  94. package/dist/queries/surface.js +1 -1
  95. package/dist/queries/trace.js +1 -1
  96. package/dist/queries/twin-ab.js +1 -1
  97. package/dist/queries/unused-imports.js +1 -1
  98. package/dist/queries/unused-params.js +1 -1
  99. package/dist/queries/wrapper-candidates.js +1 -1
  100. package/dist/reindex-worker.js +24 -24
  101. package/dist/reindex.js +36 -36
  102. package/dist/runtime.js +1 -1
  103. package/docs/COMMAND_REFERENCE.md +1 -1
  104. package/package.json +1 -1
  105. package/skills/_shared/SKILL.md +1 -1
  106. package/skills/scip-api-impact/SKILL.md +5 -1
  107. package/skills/scip-claim-audit/SKILL.md +1 -0
  108. package/skills/scip-cleanup-audit/SKILL.md +4 -0
  109. package/skills/scip-concrete-plan/SKILL.md +129 -48
  110. package/skills/scip-debug/SKILL.md +6 -1
  111. package/skills/scip-explore/SKILL.md +2 -1
  112. package/skills/scip-integrity-audit/SKILL.md +17 -0
  113. package/skills/scip-maintainability/SKILL.md +6 -1
  114. package/skills/scip-query/SKILL.md +3 -0
  115. package/skills/scip-root-cause/SKILL.md +150 -0
  116. package/skills/scip-root-cause/agents/openai.yaml +4 -0
  117. package/skills/scip-tla-model-system/SKILL.md +7 -9
  118. package/skills/scip-verify/SKILL.md +19 -2
  119. package/dist/chunk-TFWDJDGO.js +0 -2
  120. package/dist/chunk-Z4MCFCGX.js +0 -3
  121. package/dist/direct-navigation-CVCFER5G.js +0 -3
package/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ All notable changes to `scip-query` are documented here. This file starts at 0.1
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.18.0]
8
+
9
+ ### Skills (semiformal reasoning certificates)
10
+
11
+ - The skill suite now enforces a semiformal certificate discipline calibrated against a 14-ticket plan→implement→review retrospective: `scip-concrete-plan` produces contextual definitions, numbered premises with complete state-authority writer/reader enumeration, counterexample attacks with permanent `HOLE`/`HELD` outcomes, a coverage matrix, per-step deployability declarations, and a derived verdict with hole counts. `scip-verify` refutes a PASS with executed probes before claiming it; `scip-debug` requires a rival hypothesis and an executed discriminator for cross-file root causes; `scip-integrity-audit` attempts the defense before filing an accusation and derives a counted verdict; `scip-maintainability` requires a unifying definition plus a strongest-dissenter check before consolidation; `scip-cleanup-audit` refutes deletions against known blind spots; `scip-claim-audit` and `scip-api-impact` gain completeness counts and consumer disposition tables; `scip-explore` distinguishes descriptions (citations) from conclusions (discriminators).
12
+ - New skill `scip-root-cause`: diagnose the design flaw behind a family of recurring bugs — source-traced bug-family table, falsifiable flaw hypothesis with a rival kill-list, retrodiction plus executed latent-instance hunts, and a four-rung minimal-invasiveness remedy ladder that hands off to `scip-concrete-plan`.
13
+
14
+ ### Fixes (Windows indexer spawn)
15
+
16
+ - Language indexers no longer fail with `spawn EFTYPE` on Windows. Resolved `.js`/`.cjs`/`.mjs` bin targets (the bundled `@sourcegraph/scip-typescript` bin) now run through the current Node executable, Windows binary resolution only accepts real `.exe`/`.com` executables from `where` (npm's `.cmd`/sh shims fall through to the bundled bin), and npm auto-install runs through the shell on Windows. Mechanism-verified with unit tests and a macOS smoke run; not yet confirmed on a Windows machine.
17
+
7
18
  ## [0.17.2]
8
19
 
9
20
  ### Performance (agent command latency)
package/README.md CHANGED
@@ -318,6 +318,7 @@ One-line "essential difference" per skill — read this table before the Routes
318
318
  | `scip-concrete-plan` | Specify ONE change so an executor can't guess. |
319
319
  | `scip-conductor` | Run a multi-phase program (delegate, verify handoffs, pre-registered benchmarks). |
320
320
  | `scip-debug` | Root-cause a failure. |
321
+ | `scip-root-cause` | Diagnose the design flaw behind a family of recurring bugs. |
321
322
  | `scip-triage-issue` | Package a report into an actionable issue+fix plan. |
322
323
  | `scip-verify` | Post-change closeout gate. |
323
324
  | `scip-cleanup-audit` | Rank findings, no edits. |
@@ -340,7 +341,7 @@ One-line "essential difference" per skill — read this table before the Routes
340
341
  | `scip-setup` | Adopt or repair scip-query in a repo. |
341
342
  | `_shared` | Reference loaded by other skills, not user-invoked. |
342
343
 
343
- The confusable clusters, disambiguated: `scip-concrete-plan` (one change) vs `scip-conductor` (a program of changes with delegation); `scip-cleanup-audit` (report only) vs `scip-cleanup-improve` (autonomous fixing loop); `scip-verify` (did this specific change land safely) vs `scip-integrity-audit` (does this code actually work at all) vs `scip-maintainability` (is this well organized) vs `scip-twin-drift` (one drifted same-name pair specifically); `scip-directory-architecture` (folder ownership) vs `scip-maintainability` (deeper structural compression). `skills/scip-query/SKILL.md`'s Tie-Breaks section has the full routing logic.
344
+ The confusable clusters, disambiguated: `scip-debug` (one failure, one minimal fix) vs `scip-root-cause` (a family of recurring bugs traced to a design flaw); `scip-concrete-plan` (one change) vs `scip-conductor` (a program of changes with delegation); `scip-cleanup-audit` (report only) vs `scip-cleanup-improve` (autonomous fixing loop); `scip-verify` (did this specific change land safely) vs `scip-integrity-audit` (does this code actually work at all) vs `scip-maintainability` (is this well organized) vs `scip-twin-drift` (one drifted same-name pair specifically); `scip-directory-architecture` (folder ownership) vs `scip-maintainability` (deeper structural compression). `skills/scip-query/SKILL.md`'s Tie-Breaks section has the full routing logic.
344
345
 
345
346
  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.
346
347
 
@@ -1,4 +1,4 @@
1
- import{b as le,c as O,d as T,e as H,k as be,l as ye}from"./chunk-MBVHEPHQ.js";import{d as re,e as de,f as $,g as ue,l as fe,m as pe}from"./chunk-NJD4C5G5.js";import{D as me,n as ce,x as j}from"./chunk-LEKXKHIQ.js";import{a as te}from"./chunk-QEIGJJBC.js";import{d as ge,e as he}from"./chunk-MTDBHTSF.js";import{e as N,g as oe,s as ie,t as P,y as ae,z as se}from"./chunk-7XP7ZRSI.js";import{k as E,m as ee,p as ne}from"./chunk-JLZUM476.js";import{B as D,c as q}from"./chunk-TLTLJ4SW.js";import{a as Z}from"./chunk-64MNV6AB.js";import{c as z,d as Q,g as G,h as x,j as Y,l as K,q as X,s as _,y as F}from"./chunk-M2TRDR25.js";function Rn(e,n,t={}){let o=Me(e,[n],{additive:t.additive,semantic:t.semantic}),i=t.callableOnly?(o.get(n.symbolId)??[]).filter(s=>oe(s.symbol)||s.source==="ast-callsite"):o.get(n.symbolId)??[];return typeof t.limit=="number"?i.slice(0,t.limit):i}function Ce(e,n,t={}){return U(e,[n],t).get(n.symbolId)??[]}function U(e,n,t={}){let o=De(e)?Ee(e,n,{semantic:t.semantic!==!1}):ke(e);return typeof t.limit!="number"?new Map(n.map(i=>[i.symbolId,o.get(i.symbolId)??[]])):new Map(n.map(i=>[i.symbolId,(o.get(i.symbolId)??[]).slice(0,t.limit)]))}var Le=Q("caller-rows",{clearGroups:["whole-project"]}),_e=2e4;function De(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>_e}function ke(e){return Le.get(e,()=>{let n=P(e),t=Me(e,n),o=new Map;for(let a of n)o.set(a.symbol,a.symbolId);let i=new Map,s=new Map;for(let a of n){let r=t.get(a.symbolId);if(!(!r||r.length===0))for(let d of r){let c=o.get(d.symbol);if(c===void 0||c===a.symbolId)continue;let m=i.get(c);m||(m=[],i.set(c,m),s.set(c,new Set));let b=`${a.symbol}|${a.relativePath}`;s.get(c).has(b)||(s.get(c).add(b),m.push({symbol:a.symbol,file:a.relativePath,source:"caller-map-inversion"}))}}return i})}function Ee(e,n,t){let o=t.semantic?n.flatMap(r=>{let d=ve(e,r);return d?[d]:[]}):[],i=new Map(o.map(r=>[r.symbolId,r])),s=fe(e,o),a=new Map;for(let r of n){let d=[],c=new Set,m=p=>{if(p.symbol===r.symbol)return;let l=`${p.symbol}|${p.file}`;c.has(l)||(c.add(l),d.push(p))};for(let p of ye(e,r))p.file!==r.relativePath&&m({symbol:p.enclosingSymbol??p.file,file:p.file,source:"resolved-reference"});let b=i.get(r.symbolId);if(b)for(let p of s.get(b.symbolId)??[]){if(p.file===r.relativePath||e.isIgnored(p.file))continue;let l=se(ie(e,p.file),p.line);m({symbol:l?.symbol??p.file,file:p.file,source:"semantic-reference"})}a.set(r.symbolId,d)}return a}function ve(e,n){let t=ge().join(", "),o=he().join(", ");return e.get(`SELECT
1
+ import{b as le,c as O,d as T,e as H,k as be,l as ye}from"./chunk-OM6JHEW3.js";import{d as re,e as de,f as $,g as ue,l as fe,m as pe}from"./chunk-PZV2PGBR.js";import{D as me,n as ce,x as j}from"./chunk-4MFMTEJ4.js";import{a as te}from"./chunk-QEIGJJBC.js";import{d as ge,e as he}from"./chunk-MTDBHTSF.js";import{e as N,g as oe,s as ie,t as P,y as ae,z as se}from"./chunk-7XP7ZRSI.js";import{k as E,m as ee,p as ne}from"./chunk-JLZUM476.js";import{B as D,c as q}from"./chunk-TLTLJ4SW.js";import{a as Z}from"./chunk-64MNV6AB.js";import{c as z,d as Q,g as G,h as x,j as Y,l as K,q as X,s as _,y as F}from"./chunk-M2TRDR25.js";function Rn(e,n,t={}){let o=Me(e,[n],{additive:t.additive,semantic:t.semantic}),i=t.callableOnly?(o.get(n.symbolId)??[]).filter(s=>oe(s.symbol)||s.source==="ast-callsite"):o.get(n.symbolId)??[];return typeof t.limit=="number"?i.slice(0,t.limit):i}function Ce(e,n,t={}){return U(e,[n],t).get(n.symbolId)??[]}function U(e,n,t={}){let o=De(e)?Ee(e,n,{semantic:t.semantic!==!1}):ke(e);return typeof t.limit!="number"?new Map(n.map(i=>[i.symbolId,o.get(i.symbolId)??[]])):new Map(n.map(i=>[i.symbolId,(o.get(i.symbolId)??[]).slice(0,t.limit)]))}var Le=Q("caller-rows",{clearGroups:["whole-project"]}),_e=2e4;function De(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>_e}function ke(e){return Le.get(e,()=>{let n=P(e),t=Me(e,n),o=new Map;for(let a of n)o.set(a.symbol,a.symbolId);let i=new Map,s=new Map;for(let a of n){let r=t.get(a.symbolId);if(!(!r||r.length===0))for(let d of r){let c=o.get(d.symbol);if(c===void 0||c===a.symbolId)continue;let m=i.get(c);m||(m=[],i.set(c,m),s.set(c,new Set));let b=`${a.symbol}|${a.relativePath}`;s.get(c).has(b)||(s.get(c).add(b),m.push({symbol:a.symbol,file:a.relativePath,source:"caller-map-inversion"}))}}return i})}function Ee(e,n,t){let o=t.semantic?n.flatMap(r=>{let d=ve(e,r);return d?[d]:[]}):[],i=new Map(o.map(r=>[r.symbolId,r])),s=fe(e,o),a=new Map;for(let r of n){let d=[],c=new Set,m=p=>{if(p.symbol===r.symbol)return;let l=`${p.symbol}|${p.file}`;c.has(l)||(c.add(l),d.push(p))};for(let p of ye(e,r))p.file!==r.relativePath&&m({symbol:p.enclosingSymbol??p.file,file:p.file,source:"resolved-reference"});let b=i.get(r.symbolId);if(b)for(let p of s.get(b.symbolId)??[]){if(p.file===r.relativePath||e.isIgnored(p.file))continue;let l=se(ie(e,p.file),p.line);m({symbol:l?.symbol??p.file,file:p.file,source:"semantic-reference"})}a.set(r.symbolId,d)}return a}function ve(e,n){let t=ge().join(", "),o=he().join(", ");return e.get(`SELECT
2
2
  d.id AS documentId,
3
3
  gs.id AS symbolId,
4
4
  gs.symbol,
@@ -35,4 +35,4 @@ import{b as le,c as O,d as T,e as H,k as be,l as ye}from"./chunk-MBVHEPHQ.js";im
35
35
  ) def_chunk ON def_chunk.symbol_id = gs.id
36
36
  WHERE gs.id IN (${l.map(()=>"?").join(",")})`,...l,...l)),r=J([...n.map(l=>l.documentId),...a.flatMap(l=>l.document_id===null?[]:[l.document_id])]),d=new Map(r.flatMap(l=>e.all(`SELECT id, relative_path FROM documents
37
37
  WHERE id IN (${l.map(()=>"?").join(",")})`,...l).map(g=>[g.id,g.relative_path]))),c=new Map;for(let l of a)c.has(l.symbol_id)||c.set(l.symbol_id,{symbol:l.symbol,file:l.document_id!==null?d.get(l.document_id)??"":""});let m=new Map,b=d,p=Ge(n);for(let[l,g]of p){let C=[...i.get(l)??[]].sort((u,h)=>u.start_line-h.start_line||u.end_line-h.end_line),v=[...g].sort((u,h)=>u.startLine-h.startLine||u.endLine-h.endLine),M=new Set,f=0;for(let u of v){for(;f<C.length&&C[f].start_line<=u.endLine;)M.add(C[f]),f+=1;for(let y of M)y.end_line<u.startLine&&M.delete(y);let h=new Set,k=[],I=null,B=()=>{if(I)return I;let y=b.get(u.documentId)??"",S=new Set;if(y){let w=le(e,y),A=Math.max(0,u.startLine),V=Math.min(w.length-1,u.endLine);for(let L=A;L<=V;L+=1)for(let we of w[L])S.add(we)}return I=S,S};for(let y of M){if(y.symbol_id===u.symbolId)continue;let S=c.get(y.symbol_id);if(!S)continue;if(!(y.start_line>=u.startLine&&y.end_line<=u.endLine)){if(!(y.start_line<=u.endLine&&y.end_line>=u.startLine))continue;let L=N(S.symbol);if(!L||!B().has(L))continue}let A=`${S.symbol}|${y.chunk_id}`;h.has(A)||(h.add(A),k.push({...S,chunkId:y.chunk_id,source:"scip-chunk"}))}m.set(u.symbolId,k)}}return m}var Se=500;function J(e){let n=[...new Set(e)],t=[];for(let o=0;o<n.length;o+=Se)t.push(n.slice(o,o+Se));return t}function Ge(e){let n=new Map;for(let t of e){let o=n.get(t.documentId);o?o.push(t):n.set(t.documentId,[t])}return n}function Ke(e){let n=new Map;for(let[t,o]of e){let i=[];for(let s of o)i.push({symbol:s.symbol,file:s.file,chunkId:-1,source:"semantic-callee"});n.set(t,i)}return n}function Ie(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let i=Z(e,{includeIgnored:!1}),s=H(e),a=n??P(e),r=new Set(a.map(c=>c.symbolId)),d=Ye(a);if(Je(e,o,i,s,r,d),Ue(e,o,a,r),Qe(e,o,i,s,r,d),t.semantic!==!1){let c=$(e);qe(o,c.callerMap(Ze(a)))}return o}function Je(e,n,t,o,i,s){for(let a of t){if(!D(a))continue;let r=E(e,a);if(r)for(let d of r){if(s&&!s.has(d.calleeLeaf))continue;let c=O(a,o.get(d.calleeLeaf)??[]);if(!c||c.length===0)continue;let m=T(e,a,c,d.memberAccess);m&&i.has(m.symbolId)&&m.file!==a&&W(n,m.symbolId,a)}}}function Ue(e,n,t,o){let i=Ve(t);for(let s of We(e,o))e.isIgnored(s.relative_path)||ze(s,i.get(s.symbol_id))||W(n,s.symbol_id,s.relative_path)}function We(e,n){return re(e,n?[...n]:void 0)}function Ve(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function ze(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function Qe(e,n,t,o,i,s){for(let a of t){if(D(a)!=="rust")continue;let r=ee(e,a,{includeRustAttributeNames:!0});if(r.length!==0)for(let{name:d}of r){if(s&&!s.has(d))continue;let c=o.get(d);if(c)for(let m of c)i.has(m.symbolId)&&m.file!==a&&W(n,m.symbolId,a)}}}function W(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function Ye(e){let n=new Set;for(let t of e){let o="leaf"in t&&typeof t.leaf=="string"?t.leaf:"symbol"in t&&typeof t.symbol=="string"?N(t.symbol):"";o&&n.add(o)}return n.size>0?n:null}function Ze(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function qe(e,n){for(let[t,o]of n){let i=e.get(t);i||(i=new Set,e.set(t,i));for(let s of o)i.add(s)}}function Pn(e,n,t={}){return Ce(e,n,t)}function On(e,n,t={}){return U(e,n,t)}function Xe(e,n,t={}){return Ie(e,n,t)}function en(e,n,t={}){return be(e,n,t)}function Tn(e,n,t={}){let o=Xe(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:nn(o,en(e,n))}function nn(e,n){let t=new Map;for(let[o,i]of e)t.set(o,new Set(i));for(let[o,i]of n){let s=t.get(o)??new Set;for(let a of i)s.add(a);t.set(o,s)}return t}export{Rn as a,Me as b,Pn as c,On as d,Xe as e,en as f,Tn as g,nn as h};
38
- //# sourceMappingURL=chunk-KSD6IWF4.js.map
38
+ //# sourceMappingURL=chunk-2GX3TNOW.js.map
@@ -1,2 +1,2 @@
1
- import{b as i}from"./chunk-7LERNHDG.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
2
- //# sourceMappingURL=chunk-Q4GKL4CC.js.map
1
+ import{b as i}from"./chunk-L2TSLMPT.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
2
+ //# sourceMappingURL=chunk-35TZERMO.js.map
@@ -1,4 +1,4 @@
1
- import{a as d}from"./chunk-RUV4KHWA.js";import{a as h}from"./chunk-6JSTKSZH.js";import{d as f}from"./chunk-7XP7ZRSI.js";import{b as u}from"./chunk-JLZUM476.js";import{E as l}from"./chunk-TLTLJ4SW.js";import{readFileSync as E}from"fs";import{join as B}from"path";function j(t,e,s={}){let n=h(t,e);if(!n)return null;let a=new d(t),o=N(t,n),r=n.endLine-n.startLine+1,m=a.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(x=>x.symbol));return{symbol:n.symbol,shortName:f(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:o.branches,estimateBasis:o.estimateBasis,cyclomaticEstimate:o.branches+1,calleeCount:c.size,fanIn:P(t,n.symbolId),fanOut:w(m,n.relativePath)}}function N(t,e){let s=l(t,e.relativePath);if(s){let n=g(s.rootNode,e.startLine,e.endLine);if(n)return{branches:v(n),estimateBasis:"ast"}}return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function H(t,e){let s=new Map,n=new Map;for(let a of e){let o=n.get(a.relativePath)??[];o.push(a),n.set(a.relativePath,o)}for(let[a,o]of n){let r=l(t,a),i=r===null?[]:o.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});C(r.rootNode,i,s)}for(let c of o)m.has(c.symbolId)||s.set(c.symbolId,L(t,c))}return s}function L(t,e){return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function y(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function p(t,e,s,n){try{return E(B(t.config.projectRoot,e),"utf-8").split(`
1
+ import{a as d}from"./chunk-L2RE5P3X.js";import{a as h}from"./chunk-6JSTKSZH.js";import{d as f}from"./chunk-7XP7ZRSI.js";import{b as u}from"./chunk-JLZUM476.js";import{E as l}from"./chunk-TLTLJ4SW.js";import{readFileSync as E}from"fs";import{join as B}from"path";function j(t,e,s={}){let n=h(t,e);if(!n)return null;let a=new d(t),o=N(t,n),r=n.endLine-n.startLine+1,m=a.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(x=>x.symbol));return{symbol:n.symbol,shortName:f(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:o.branches,estimateBasis:o.estimateBasis,cyclomaticEstimate:o.branches+1,calleeCount:c.size,fanIn:P(t,n.symbolId),fanOut:w(m,n.relativePath)}}function N(t,e){let s=l(t,e.relativePath);if(s){let n=g(s.rootNode,e.startLine,e.endLine);if(n)return{branches:v(n),estimateBasis:"ast"}}return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function H(t,e){let s=new Map,n=new Map;for(let a of e){let o=n.get(a.relativePath)??[];o.push(a),n.set(a.relativePath,o)}for(let[a,o]of n){let r=l(t,a),i=r===null?[]:o.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});C(r.rootNode,i,s)}for(let c of o)m.has(c.symbolId)||s.set(c.symbolId,L(t,c))}return s}function L(t,e){return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function y(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function p(t,e,s,n){try{return E(B(t.config.projectRoot,e),"utf-8").split(`
2
2
  `).slice(s,n+1).join(`
3
3
  `)}catch{return""}}function P(t,e){return t.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
4
  FROM mentions m
@@ -13,4 +13,4 @@ import{a as d}from"./chunk-RUV4KHWA.js";import{a as h}from"./chunk-6JSTKSZH.js";
13
13
  WHERE m.symbol_id = ?
14
14
  AND m.role != 1
15
15
  AND sym_def.document_id != c.document_id`,e)?.c??0}function w(t,e){return new Set(t.filter(s=>s.file!==e).map(s=>s.symbol)).size}function v(t){let e=0;return b(t,s=>{e+=S(s)}),e}function C(t,e,s){let n=[...e].sort((a,o)=>a.startLine-o.startLine||o.endLine-a.endLine);b(t,a=>{let o=S(a);if(o===0)return;let r=a.startPosition.row,i=a.endPosition.row;for(let m of n){if(m.startLine>r)break;if(m.endLine<i)continue;let c=s.get(m.symbolId);c&&(c.branches+=o)}})}function b(t,e){e(t);for(let s of t.namedChildren)b(s,e)}function g(t,e,s){if(t.startPosition.row>e||t.endPosition.row<s)return null;for(let n of t.namedChildren){let a=g(n,e,s);if(a)return a}return t}var D=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function S(t){return D.has(t.type)?1:t.type==="binary_expression"&&t.parent?.type!=="binary_expression"&&(t.text.includes("&&")||t.text.includes("||"))?I(t.text):0}function I(t){return(t.match(/&&|\|\|/g)??[]).length}function _(t,e){let s=u(t),n=0,a=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let o of a){let r=s.match(o);r&&(n+=r.length)}if(e==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}return n}export{j as a,N as b,H as c,v as d};
16
- //# sourceMappingURL=chunk-P6FOIU7O.js.map
16
+ //# sourceMappingURL=chunk-43QUXX3E.js.map
@@ -1,2 +1,2 @@
1
- import{a as C}from"./chunk-RUV4KHWA.js";import{m as v}from"./chunk-MBVHEPHQ.js";import{f as O,i as x,m as T}from"./chunk-NJD4C5G5.js";import{d as A}from"./chunk-7XP7ZRSI.js";import{f as b}from"./chunk-JLZUM476.js";import{B as g}from"./chunk-TLTLJ4SW.js";function H(e,n={}){let{samples:o=50,scope:r,maxDisagreements:u=5}=n,l=new C(e),a=B(l.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o),c=K(e,a);if(a.length===0||!c)return{available:!1,sampleSize:a.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:P(),callees:P()},i=[],f=0,m=c==="semantic"?T(e,a):new Map,I=c==="source"?E(e,l,a):null;for(let s of a){let p=S(s,c==="semantic"?x(e,s).map(d=>d.file):[...I?.referencesBySymbolId.get(s.symbolId)??[]]),j=S(s,c==="semantic"?(m.get(s.symbolId)??[]).map(d=>d.file):[...I?.calleesBySymbolId.get(s.symbolId)??[]]);f+=1;let L=S(s,v(e,s).map(d=>d.file)),k=S(s,(l.calleeMap([s],{semantic:!1}).get(s.symbolId)??[]).map(d=>d.file)),w=y(c,"references"),R=y(c,"callees");Q(t.references,s,"references",L,p,w,i),Q(t.callees,s,"callees",k,j,R,i)}return i.sort((s,p)=>p.cheapOnly.length+p.oracleOnly.length-(s.cheapOnly.length+s.oracleOnly.length)),{available:!0,sampleSize:a.length,oracleCoverage:a.length>0?D(f/a.length):0,oracleKind:c,scores:["references","callees"].map(s=>F(s,t[s],c)),topDisagreements:i.slice(0,u)}}function P(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0,skippedOraclePartial:0}}function B(e,n){let o=[...e].sort((l,a)=>l.symbolId-a.symbolId);if(o.length<=n)return o;let r=o.length/n,u=[];for(let l=0;l<n;l++)u.push(o[Math.floor(l*r)]);return u}function K(e,n){let o=n[0];if(!o)return null;if(h(e,o))return"source";try{if(O(e).capability("semantic-references",o.relativePath).available)return"semantic"}catch{}return n.some(r=>h(e,r))?"source":null}function S(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function Q(e,n,o,r,u,l,a){if(!l&&u.size===0){e.skippedOraclePartial+=1;return}e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=u.size;let c=[],t=[];for(let i of r)u.has(i)?e.agreed+=1:c.push(i);for(let i of u)r.has(i)||t.push(i);(c.length>0||t.length>0)&&a.push({symbol:A(n.symbol),question:o,cheapOnly:c,oracleOnly:t})}var z={references:!0,callees:!1};function F(e,n,o){let r=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.cheapTotal-n.agreed,l=y(o,e);return{question:e,comparedSymbols:n.comparedSymbols,precision:l&&n.cheapTotal>0?D(n.agreed/n.cheapTotal):null,recall:D(r),unverified:u,skippedOraclePartial:n.skippedOraclePartial}}function y(e,n){return e==="semantic"?z[n]:!1}function h(e,n){return g(n.relativePath)==="clojure"&&b(e,n.relativePath)!==null}function E(e,n,o){let r=new Map,u=new Map,l=o.filter(t=>h(e,t)),a=new Map;for(let t of l){let i=a.get(t.leaf)??[];i.push(t),a.set(t.leaf,i)}for(let t of n.sourceFiles()){if(g(t)!=="clojure")continue;let i=b(e,t);if(i)for(let f of i.fileIdentifiers)for(let m of a.get(f)??[])M(r,m.symbolId,t)}let c=new Map;for(let t of n.scopedDefinitions()){if(g(t.relativePath)!=="clojure")continue;let i=c.get(t.leaf)??[];i.push(t),c.set(t.leaf,i)}for(let t of l){let i=b(e,t.relativePath);if(i){for(let f of i.callSites)if(!(f.line<t.startLine||f.line>t.endLine))for(let m of c.get(f.calleeLeaf)??[])M(u,t.symbolId,m.relativePath)}}return{referencesBySymbolId:r,calleesBySymbolId:u}}function M(e,n,o){let r=e.get(n);if(r){r.add(o);return}e.set(n,new Set([o]))}function D(e){return Math.round(e*1e3)/1e3}export{H as a};
2
- //# sourceMappingURL=chunk-U4G4UYLB.js.map
1
+ import{a as C}from"./chunk-L2RE5P3X.js";import{m as v}from"./chunk-OM6JHEW3.js";import{f as O,i as x,m as T}from"./chunk-PZV2PGBR.js";import{d as A}from"./chunk-7XP7ZRSI.js";import{f as b}from"./chunk-JLZUM476.js";import{B as g}from"./chunk-TLTLJ4SW.js";function H(e,n={}){let{samples:o=50,scope:r,maxDisagreements:u=5}=n,l=new C(e),a=B(l.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o),c=K(e,a);if(a.length===0||!c)return{available:!1,sampleSize:a.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:P(),callees:P()},i=[],f=0,m=c==="semantic"?T(e,a):new Map,I=c==="source"?E(e,l,a):null;for(let s of a){let p=S(s,c==="semantic"?x(e,s).map(d=>d.file):[...I?.referencesBySymbolId.get(s.symbolId)??[]]),j=S(s,c==="semantic"?(m.get(s.symbolId)??[]).map(d=>d.file):[...I?.calleesBySymbolId.get(s.symbolId)??[]]);f+=1;let L=S(s,v(e,s).map(d=>d.file)),k=S(s,(l.calleeMap([s],{semantic:!1}).get(s.symbolId)??[]).map(d=>d.file)),w=y(c,"references"),R=y(c,"callees");Q(t.references,s,"references",L,p,w,i),Q(t.callees,s,"callees",k,j,R,i)}return i.sort((s,p)=>p.cheapOnly.length+p.oracleOnly.length-(s.cheapOnly.length+s.oracleOnly.length)),{available:!0,sampleSize:a.length,oracleCoverage:a.length>0?D(f/a.length):0,oracleKind:c,scores:["references","callees"].map(s=>F(s,t[s],c)),topDisagreements:i.slice(0,u)}}function P(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0,skippedOraclePartial:0}}function B(e,n){let o=[...e].sort((l,a)=>l.symbolId-a.symbolId);if(o.length<=n)return o;let r=o.length/n,u=[];for(let l=0;l<n;l++)u.push(o[Math.floor(l*r)]);return u}function K(e,n){let o=n[0];if(!o)return null;if(h(e,o))return"source";try{if(O(e).capability("semantic-references",o.relativePath).available)return"semantic"}catch{}return n.some(r=>h(e,r))?"source":null}function S(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function Q(e,n,o,r,u,l,a){if(!l&&u.size===0){e.skippedOraclePartial+=1;return}e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=u.size;let c=[],t=[];for(let i of r)u.has(i)?e.agreed+=1:c.push(i);for(let i of u)r.has(i)||t.push(i);(c.length>0||t.length>0)&&a.push({symbol:A(n.symbol),question:o,cheapOnly:c,oracleOnly:t})}var z={references:!0,callees:!1};function F(e,n,o){let r=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.cheapTotal-n.agreed,l=y(o,e);return{question:e,comparedSymbols:n.comparedSymbols,precision:l&&n.cheapTotal>0?D(n.agreed/n.cheapTotal):null,recall:D(r),unverified:u,skippedOraclePartial:n.skippedOraclePartial}}function y(e,n){return e==="semantic"?z[n]:!1}function h(e,n){return g(n.relativePath)==="clojure"&&b(e,n.relativePath)!==null}function E(e,n,o){let r=new Map,u=new Map,l=o.filter(t=>h(e,t)),a=new Map;for(let t of l){let i=a.get(t.leaf)??[];i.push(t),a.set(t.leaf,i)}for(let t of n.sourceFiles()){if(g(t)!=="clojure")continue;let i=b(e,t);if(i)for(let f of i.fileIdentifiers)for(let m of a.get(f)??[])M(r,m.symbolId,t)}let c=new Map;for(let t of n.scopedDefinitions()){if(g(t.relativePath)!=="clojure")continue;let i=c.get(t.leaf)??[];i.push(t),c.set(t.leaf,i)}for(let t of l){let i=b(e,t.relativePath);if(i){for(let f of i.callSites)if(!(f.line<t.startLine||f.line>t.endLine))for(let m of c.get(f.calleeLeaf)??[])M(u,t.symbolId,m.relativePath)}}return{referencesBySymbolId:r,calleesBySymbolId:u}}function M(e,n,o){let r=e.get(n);if(r){r.add(o);return}e.set(n,new Set([o]))}function D(e){return Math.round(e*1e3)/1e3}export{H as a};
2
+ //# sourceMappingURL=chunk-45XOH33S.js.map