scip-query 0.10.8 → 0.10.11
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.
- package/README.md +3 -1
- package/dist/chunk-2KHTSEIL.js +102 -0
- package/dist/chunk-3VD3JMK2.js +2 -0
- package/dist/{chunk-MEKSFV6H.js → chunk-4UZO3XCV.js} +2 -2
- package/dist/{chunk-BJWNO6BU.js → chunk-54KGX7EX.js} +2 -2
- package/dist/chunk-5GOLFJEO.js +8 -0
- package/dist/chunk-5OST6GYB.js +2 -0
- package/dist/{chunk-C6BYNIH4.js → chunk-65AU3HFZ.js} +2 -2
- package/dist/{chunk-E2CCBFLR.js → chunk-6GN7FXCH.js} +2 -2
- package/dist/{chunk-RHKMQNFI.js → chunk-6IR2AOBM.js} +2 -2
- package/dist/{chunk-6EO3E3IP.js → chunk-6JRV4MY2.js} +2 -2
- package/dist/{chunk-5SMUKUV5.js → chunk-6LJHXREW.js} +2 -2
- package/dist/chunk-6QSOCTZT.js +18 -0
- package/dist/{chunk-6TDOT7B3.js → chunk-72KY2ZFO.js} +2 -2
- package/dist/{chunk-LGX2Y4BA.js → chunk-7B6LP46R.js} +2 -2
- package/dist/chunk-7GO4EQF5.js +2 -0
- package/dist/chunk-7IVSJJZU.js +7 -0
- package/dist/{chunk-EBIQY3RK.js → chunk-7TWLSZK5.js} +2 -2
- package/dist/{chunk-X3Z4MLVL.js → chunk-AVWPHM2Q.js} +2 -2
- package/dist/{chunk-GZQID3FS.js → chunk-BASVXNY3.js} +2 -2
- package/dist/{chunk-BJG67TCR.js → chunk-BFXPG2VN.js} +2 -2
- package/dist/chunk-BSN22NRK.js +9 -0
- package/dist/{chunk-ZDR4VTOP.js → chunk-BVRS7RKQ.js} +2 -2
- package/dist/{chunk-ANIOISCE.js → chunk-C5CTSJ6X.js} +2 -2
- package/dist/{chunk-VXT7WVIN.js → chunk-CO5GJRP7.js} +2 -2
- package/dist/chunk-CW5YFOCP.js +5 -0
- package/dist/chunk-E35O7UCB.js +2 -0
- package/dist/{chunk-LWTML2AN.js → chunk-EXDQ35NN.js} +2 -2
- package/dist/{chunk-Q34NWRPP.js → chunk-EY43NV4M.js} +2 -2
- package/dist/chunk-FAYI6KZ5.js +2 -0
- package/dist/{chunk-ZL52RLDK.js → chunk-FDEQIPPK.js} +2 -2
- package/dist/{chunk-5G5VI7J4.js → chunk-FFVIFETB.js} +2 -2
- package/dist/{chunk-JUIAOOK7.js → chunk-FKCGBZAC.js} +2 -2
- package/dist/{chunk-JRUKS66S.js → chunk-FXNWFMKW.js} +2 -2
- package/dist/chunk-G5UPYQGL.js +4 -0
- package/dist/chunk-GQBMH2TQ.js +2 -0
- package/dist/{chunk-VFLHKRTW.js → chunk-GRJY65YT.js} +2 -2
- package/dist/chunk-HF25DFSC.js +3 -0
- package/dist/chunk-HHN2B5KA.js +2 -0
- package/dist/{chunk-7KJBH4IP.js → chunk-IHUETYFW.js} +2 -2
- package/dist/{chunk-BEUQVBE3.js → chunk-JATUZIEH.js} +2 -2
- package/dist/chunk-JCLDUKT6.js +38 -0
- package/dist/{chunk-B4EHYG6M.js → chunk-JGN2ZFJR.js} +2 -2
- package/dist/{chunk-L4QKEQ4S.js → chunk-JME7OWD3.js} +2 -2
- package/dist/chunk-KDFONWTW.js +40 -0
- package/dist/{chunk-VMPB52FG.js → chunk-LPL4MA6R.js} +2 -2
- package/dist/{chunk-FGTHPJON.js → chunk-LSET2TXH.js} +2 -2
- package/dist/chunk-LZHUWKGD.js +2 -0
- package/dist/{chunk-JYSAYZNX.js → chunk-M4COR2H6.js} +2 -2
- package/dist/{chunk-QDGKE5HN.js → chunk-NOJAM5ZV.js} +2 -2
- package/dist/chunk-O6ZH6C6Y.js +2 -0
- package/dist/{chunk-3LQFMQPY.js → chunk-OBGRLXWF.js} +2 -2
- package/dist/chunk-OLTESY4K.js +3 -0
- package/dist/chunk-P4KYUPBD.js +4 -0
- package/dist/chunk-P5RYBRIO.js +4 -0
- package/dist/{chunk-6N6QTGSD.js → chunk-P753MDDE.js} +2 -2
- package/dist/{chunk-NWFSC356.js → chunk-P7AL7Y37.js} +2 -2
- package/dist/chunk-QLAUCRDJ.js +2 -0
- package/dist/{chunk-FHWEEQVO.js → chunk-QPU7EXAW.js} +2 -2
- package/dist/{chunk-AA7L7GKI.js → chunk-QYB5P7GL.js} +2 -2
- package/dist/chunk-RNM6LMCF.js +2 -0
- package/dist/chunk-RVWSAMTT.js +2 -0
- package/dist/{chunk-T633QLYF.js → chunk-TK7O5ER5.js} +2 -2
- package/dist/chunk-TQ5W2H3S.js +4 -0
- package/dist/chunk-USPV3T5K.js +2 -0
- package/dist/{chunk-FKUCFCLU.js → chunk-VCQYSG2M.js} +2 -2
- package/dist/{chunk-2YI45TNM.js → chunk-VUKC6F77.js} +2 -2
- package/dist/{chunk-N7F5UM6J.js → chunk-W6BVEKYC.js} +2 -2
- package/dist/{chunk-63MSELOP.js → chunk-WUCEKFQC.js} +2 -2
- package/dist/chunk-XUGQU7PM.js +41 -0
- package/dist/{chunk-KZYHFI2X.js → chunk-Y5NBHMQX.js} +2 -2
- package/dist/{chunk-6BNOACLT.js → chunk-YCOFCT4B.js} +2 -2
- package/dist/{chunk-SHM5D3DQ.js → chunk-YWYFU2V3.js} +2 -2
- package/dist/{chunk-BWL2ECGQ.js → chunk-Z3YYR4OS.js} +2 -2
- package/dist/{chunk-3FYGJ2GY.js → chunk-Z4HICZGY.js} +2 -2
- package/dist/{chunk-24S6MYOC.js → chunk-ZQDIXAF5.js} +2 -2
- package/dist/cli.js +298 -244
- package/dist/{db-BAVwb4Pb.d.ts → db-Djj3Nqrb.d.ts} +2 -0
- package/dist/{health-B17sVFYf.d.ts → health-D5J42g4D.d.ts} +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -3
- package/dist/queries/affected.d.ts +1 -1
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +1 -1
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +1 -1
- package/dist/queries/health.d.ts +2 -2
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +3 -3
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +13 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +1 -1
- package/dist/queries/surface.d.ts +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-imports.d.ts +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +1 -1
- package/dist/queries/wrapper-candidates.d.ts +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/docs/COMMAND_REFERENCE.md +1 -1
- package/docs/analyzer-inventory.md +29 -0
- package/docs/analyzer-validation-ledger.md +32 -1
- package/package.json +1 -1
- package/skills/scip-hyper-optimization/SKILL.md +153 -24
- package/skills/scip-hyper-optimization/agents/openai.yaml +3 -3
- package/dist/chunk-2H57MJLI.js +0 -2
- package/dist/chunk-4TMJDHC6.js +0 -5
- package/dist/chunk-5GVOJOBL.js +0 -2
- package/dist/chunk-7XWXGANX.js +0 -4
- package/dist/chunk-AETMKBZR.js +0 -40
- package/dist/chunk-BTCASU5J.js +0 -3
- package/dist/chunk-C6ROZBJA.js +0 -32
- package/dist/chunk-COUFCH64.js +0 -2
- package/dist/chunk-EKECQP6Z.js +0 -2
- package/dist/chunk-FVA3NH4P.js +0 -2
- package/dist/chunk-I274B3B3.js +0 -7
- package/dist/chunk-J6ADQKQA.js +0 -2
- package/dist/chunk-K7VBTWNR.js +0 -2
- package/dist/chunk-KLXVEBVC.js +0 -2
- package/dist/chunk-KRGBLZT2.js +0 -7
- package/dist/chunk-P3K7LX7M.js +0 -4
- package/dist/chunk-PVZMPG5I.js +0 -2
- package/dist/chunk-RSKOYTSY.js +0 -3
- package/dist/chunk-RY7CAOJF.js +0 -4
- package/dist/chunk-S7YOLFLX.js +0 -2
- package/dist/chunk-SOGKYB5I.js +0 -8
- package/dist/chunk-VAXDTQHE.js +0 -18
- package/dist/chunk-X3BJUFSN.js +0 -62
- package/dist/chunk-XPOZO76D.js +0 -2
- package/dist/chunk-XWC67C3Q.js +0 -2
- package/dist/chunk-YNSVAJR6.js +0 -2
- package/dist/chunk-ZMU6IWDK.js +0 -38
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as re}from"./chunk-B75HZHUP.js";import{a as I}from"./chunk-5OST6GYB.js";import{b as Z,e as J,f as q,g as $}from"./chunk-C5CTSJ6X.js";import{a as ne}from"./chunk-RNM6LMCF.js";import{c as X,d as Q,e as Y,f as w,l as te}from"./chunk-KDFONWTW.js";import{e as ee}from"./chunk-OLTESY4K.js";import{b as p}from"./chunk-TQ5W2H3S.js";import{b as B}from"./chunk-P5RYBRIO.js";import{h as G,o as R}from"./chunk-2KHTSEIL.js";import{c as W,f as H,g as z,h as U,i as K,j as V}from"./chunk-JM72FNGA.js";import{a as j,d as L}from"./chunk-HF25DFSC.js";import{a as D}from"./chunk-DS6QEB3G.js";import{b as A,d as M,e as O}from"./chunk-XUGQU7PM.js";import{a as S}from"./chunk-64MNV6AB.js";import{b as v}from"./chunk-7S5E7KWT.js";var x=new WeakMap;function se(e,t){let n=j(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=D(e,t);if(!r)return[];let s=A(e,t,r),a=M(e,"definition-exclusions",t,s);if(a){let c=Ee(a);if(c)return c}let u=n==="rust"?Ne(e,t):Le(e,t);return O(e,"definition-exclusions",t,s,JSON.stringify(u)),u}function Ee(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(Ce)?null:t}catch{return null}}function Ce(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"?!1:t.containerName===void 0||typeof t.containerName=="string"}var oe=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),ve=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,De=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Le(e,t){let n=D(e,t);if(!n||!we(n))return[];let i=L(e,t);if(!i)return[];let r=x.get(i);if(r)return r;let s=!1,a=i.rootNode;for(let c of a.namedChildren){if(c.type!=="expression_statement")continue;let d=c.namedChild(0);if(!d||d.type!=="call_expression")continue;let o=d.namedChild(0);if(!o)continue;let l=o.type==="member_expression"?o.namedChild(o.namedChildCount-1)?.text:o.text;if(l&&oe.has(l)){s=!0;break}}let u=[];s&&u.push({startLine:0,endLine:a.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let c of a.namedChildren){let d=null,o=null;if(c.type==="function_declaration")d=c.namedChild(0)?.text??null,o=c;else if(c.type==="export_statement"){let l=c.namedChild(0);l?.type==="function_declaration"&&(d=l.namedChild(0)?.text??null,o=l)}else if(c.type==="lexical_declaration"){let l=c.namedChild(0);if(l?.type==="variable_declarator"){let m=l.namedChild(0)?.text,y=l.namedChild(1);m&&(y?.type==="arrow_function"||y?.type==="function_expression")&&(d=m,o=l)}}d&&/^use[A-Z]/.test(d)&&o&&u.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"React custom hook (use*)"})}return u.push(...ae(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),x.set(i,u),u}function we(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of oe)if(e.includes(n)){t=!0;break}return t&&ve.test(e)?!0:e.includes("use")&&De.test(e)}var Ie=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Pe(e){return Ie.test(e)}function ae(e,t,n){let i=[],r=s=>{if(t.has(s.type)&&s.parent){let u=s.parent.children,c=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===s.startIndex&&u[d].type===s.type){c=d;break}if(c>0)for(let d=c-1;d>=0;d-=1){let o=u[d];if(n.has(o.type)){if(Pe(o.text)){i.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(o.type==="attribute_item"||o.type==="inner_attribute_item"))break}}for(let a of s.namedChildren)r(a)};return r(e.rootNode),i}function Ne(e,t){let n=L(e,t);if(!n)return[];let i=x.get(n);if(i)return i;let r=[],s=ke(n);return s?(x.set(n,s),s):(ce(n.rootNode,r,!1,!1),r.push(...ae(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...We(n.rootNode)),x.set(n,r),r)}function ke(e){return He(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function ce(e,t,n,i){let r=n,s=i;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(s=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?Fe(e,t,n,i):i&&Be(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?Te(e,t,n):e.type==="mod_item"&&P(e).some(a=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(a))&&(r=!0);for(let a of e.namedChildren)ce(a,t,r,s)}function Fe(e,t,n,i){let r=P(e),s=null;i?s="trait impl method (dynamic dispatch)":n&&(s="inside #[cfg(test)] mod");for(let a of r){let u=Me(a);if(u){s=u;break}if(le(a)){s="#[allow(dead_code)]";break}}s&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:s})}function Te(e,t,n){let i=P(e),r=e.namedChildren.find(s=>s.type==="type_identifier")?.text;i.some(je)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),i.some(le)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function P(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let s=0;s<n.length;s+=1)if(n[s].startIndex===e.startIndex&&n[s].type===e.type){i=s;break}if(i<=0)return[];let r=[];for(let s=i-1;s>=0;s-=1){let a=n[s];if(a.type==="attribute_item"||a.type==="inner_attribute_item")r.push(a.text);else{if(a.type==="line_comment"||a.type==="block_comment")continue;break}}return r}var Ae=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function Me(e){return Ae.find(({re:t})=>t.test(e))?.reason??null}var Oe=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function je(e){return/#\[\s*derive\s*\(/.test(e)?Oe.some(t=>t.test(e)):!1}function le(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Be(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function We(e){let t=Ue(e);if(t.size===0)return[];let n=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&t.has(r)&&n.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return n}function He(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var ze=/^#!?\[\s*serde\s*\(/,ie=/\bwith\s*=\s*"([^"]+)"/g;function Ue(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!ze.test(n.text))continue;ie.lastIndex=0;let i;for(;(i=ie.exec(n.text))!==null;){let r=i[1],s=r.split("::").pop()??r;s&&t.add(s)}}return t}function ue(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let s=se(e,i);return r={ranges:s.map(a=>({startLine:a.startLine,endLine:a.endLine})),containers:new Set(s.map(a=>a.containerName).filter(a=>!!a))},t.set(i,r),r};return(i,r,s,a)=>{let u=n(i);for(let c of u.ranges)if(r>=c.startLine&&r<=c.endLine)return!0;if(a&&u.containers.has(a))return!0;for(let c of R(s))if(u.containers.has(c))return!0;return!1}}function mt(e,t={}){v(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function de(e,t,n={}){v(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function me(e,t){return t.isIgnoredPath(e.relativePath)?b("ignored-file"):U(e.symbol)?b("module-like-symbol"):fe(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&fe(e.enclosingSymbol)?b("nested-non-callable-value"):!t.includeTests&&!N(e.relativePath)?b("test-file"):!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?b("excluded-file-region"):K(e.symbol)?b("rust-trait-impl-member"):V(e.symbol)?b("rust-test-module"):!t.includeMembers&&!Ke(e)?b("member"):e.endLine-e.startLine+1<t.minLoc?b("below-min-loc"):{accepted:!0}:b("non-value-symbol")}function N(e){return Z(e)!=="test"}function b(e){return{accepted:!1,rejectionReason:e}}function fe(e){return z(e)||e.endsWith("().")||e.endsWith(".")}function Ke(e){return H(e.symbol)||R(e.symbol).length===0}function pe(){return new Map}function be(e,t,n){let i=new Map;for(let r of X(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||E(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function ye(e,t,n){let i=new Set;for(let r of Q(e,t))e.isIgnored(r.relative_path)||n.has(r.relative_path)||i.add(r.symbol_id);return i}function k(e,t){let n=e.get(t);if(!n)return!1;for(let i of n.values())if(i.occurrences>0)return!0;return!1}function _(e,t,n){let i=e.get(t);if(!i)return!1;for(let[r,s]of i)if(r!==n&&s.occurrences>0)return!0;return!1}function ge(e){return e?.occurrences??0}function E(e,t,n,i,r="source-fallback"){if(i<=0)return;let s=xe(e,t,n);s.occurrences+=i,s.sources.add(r)}function he(e,t,n,i,r){if(i<=0)return;let s=xe(e,t,n);s.occurrences=Math.max(i,s.occurrences),s.sources.add(r)}function xe(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r={occurrences:0,sources:new Set},i.set(n,r)),r}var Ve=3e3,Ze=1e3;function jt(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:s=!1,includeMembers:a=!1,deadCodeOnly:u=!1,scanLimit:c,semantic:d=!0}=t,o=0,l=p("dead.candidates",()=>{let f=re(Je(e,{scope:n,minLoc:i,includeTests:r,includeMembers:a}),c);return o=f.length,f},()=>({definitions:o})),m=s?new Set(J(e)):new Set,y=0,g=u?pe():p("dead.mention-reference-counts",()=>{let f=be(e,m,l.map(C=>C.symbolId));return y=f.size,f},()=>({definitions:l.length,symbolsWithReferences:y})),F=0,Re=u?p("dead.mentioned-symbol-ids",()=>{let f=ye(e,l.map(C=>C.symbolId),m);return F=f.size,f},()=>({definitions:l.length,referencedSymbols:F})):new Set,h=u?l.filter(f=>!Re.has(f.symbolId)):l.filter(f=>!_(g,f.symbolId,f.relativePath));u?p("dead.source-fallback.dead-code-only",()=>Qe(e,h,g,m),()=>({definitions:h.length})):p("dead.source-fallback.ast",()=>Xe(e,h,g,m),()=>({definitions:h.length}));let T=u?h.filter(f=>!k(g,f.symbolId)):h.filter(f=>!_(g,f.symbolId,f.relativePath));p("dead.caller-map-supplement",()=>rt(e,T,g,{includeTests:r,inactiveBarrelPaths:m,includeSemantic:!u&&d}),()=>({definitions:T.length,semantic:!u&&d}));let _e=u?h.filter(f=>!k(g,f.symbolId)):l;return Ge(e,qe(_e,g))}function Je(e,t){let n=ue(e),i=[];for(let r of G(e,t.scope))me(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:a=>e.isIgnored(a),isExcludedRegion:n}).accepted&&i.push(r);return i}function qe(e,t){return e.map(n=>$e(n,t)).filter(n=>n.cross_file_refs===0).sort((n,i)=>i.loc-n.loc||n.relative_path.localeCompare(i.relative_path)||n.start_line-i.start_line)}function $e(e,t){let n=t.get(e.symbolId)??new Map,i=ge(n.get(e.relativePath)),r=0;for(let[s,a]of n)s!==e.relativePath&&(r+=a.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:i,cross_file_refs:r}}function Ge(e,t){let n=[],i=0,r=0,s=0;for(let a of t){if(e.isIgnored(a.relative_path)||q(e,a.relative_path)||$(e,a.symbol,a.relative_path))continue;let u=a.same_file_refs===0?"dead-code":"file-internal";u==="dead-code"?i++:r++,s+=a.loc,n.push({relativePath:a.relative_path,startLine:a.start_line,endLine:a.end_line,loc:a.loc,symbol:a.symbol,shortName:W(a.symbol),sameFileRefs:a.same_file_refs,kind:u})}return{symbols:n,counts:{total:n.length,deadCode:i,fileInternal:r,loc:s},totalCount:n.length,deadCodeCount:i,fileInternalCount:r,totalLoc:s}}function Xe(e,t,n,i){if(t.length===0)return;let r=new I(e),s=new Set(t.map(c=>c.symbolId)),a=new Set(t.map(c=>c.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let c of S(e))u.add(c);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:a,skipPath:c=>i.has(c)},c=>{s.has(c.target.symbolId)&&(tt(e,c)||E(n,c.target.symbolId,c.sourceFile,nt(c),"source-fallback"))})}function Qe(e,t,n,i){if(t.length===0)return;let r=new I(e),s=Ye(t),a=new Set(r.sourceFiles());for(let o of S(e))a.add(o);let u=new Set(s.keys()),c=new Map,d=o=>{let l=c.get(o);return l||(l=te(e,o),c.set(o,l)),l};r.scanSourceReferences({paths:a,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:o=>i.has(o),resolveTargets:({sourceFile:o,name:l,kind:m})=>{let y=s.get(l);return y?et(o,l,y,()=>d(o),{permissive:m!=="cross-language-dispatch"}):[]},afterPath:o=>{c.delete(o),de(e,o)}},o=>{let l=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&Se(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:l})||E(n,o.target.symbolId,o.sourceFile,l,"source-fallback")})}function Ye(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let i=t.get(n.leaf)??[];i.push(n),t.set(n.leaf,i)}return t}function et(e,t,n,i,r){let s=n.filter(d=>d.relativePath===e);if(s.length>0)return s;if(!r.permissive&&n.length===1)return[...n];let a=i(),u=a.get(t);if(u)for(let d of u){let o=n.filter(l=>w(d,l.relativePath));if(o.length>0)return o}let c=new Set;for(let d of a.values())for(let o of d)c.add(o);for(let d of c){let o=n.filter(l=>w(d,l.relativePath));if(o.length>0&&o.length===n.length)return o}return r.permissive?[...n]:[]}function tt(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Se(e,t)}function nt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Se(e,t){return t.occurrences>1?!1:B(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function rt(e,t,n,i){let r=i.includeSemantic!==!1,s=r&&t.length>=Ve&&S(e).length>=Ze,a=(o,l)=>{l===o.relativePath||e.isIgnored(l)||i.inactiveBarrelPaths.has(l)||!i.includeTests&&!N(l)||he(n,o.symbolId,l,1,"caller-map")};if(s?p("dead.caller-map.mention-chunks",()=>it(e,t,a),()=>({definitions:t.length})):p("dead.caller-map.per-symbol",()=>{for(let o of t){let l=ne(e,o,{semantic:r});if(l.length!==0)for(let m of l)a(o,m.file)}},()=>({definitions:t.length,semantic:r})),!s)return;let u=0,c=p("dead.caller-map.semantic-candidates",()=>{let o=t.filter(l=>!_(n,l.symbolId,l.relativePath));return u=o.length,o},()=>({definitions:t.length,semanticCandidates:u}));if(c.length===0)return;let d=ee(e,c);for(let o of c){let l=d.get(o.symbolId);if(l)for(let m of l)a(o,m)}}function it(e,t,n){let i=new Map(t.map(r=>[r.symbolId,r]));for(let r of Y(e,[...i.keys()])){let s=i.get(r.symbol_id);s&&n(s,r.relative_path)}}export{mt as a,jt as b};
|
|
2
|
+
//# sourceMappingURL=chunk-USPV3T5K.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as N}from"./chunk-
|
|
1
|
+
import{a as N}from"./chunk-RNM6LMCF.js";import{a as I,b as S}from"./chunk-TK7O5ER5.js";import{f as p,m as g}from"./chunk-2KHTSEIL.js";import{c as h,e as b}from"./chunk-JM72FNGA.js";function x(o,s,r={}){let{maxDepth:c=5,scope:a}=r,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let i=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&i.push(n.symbolMatch)}t=i}return u.sort((e,i)=>e.depth-i.depth||e.file.localeCompare(i.file)),u}function D(o,s,r){let c=N(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!r||t.file.includes(r)),a=new Set(c.map(t=>t.file)),l=[];for(let t of M(o,s,r)){if(a.has(t))continue;let e=p(o,t),i=e.length>0?g(e,e[0].startLine):null;l.push({symbol:i?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=S(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:h(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!_(e.symbol))continue;let i=`${e.symbolId}|${e.relativePath}`;m.has(i)||(m.add(i),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function M(o,s,r){let c=r?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return r&&a.push(`%${r}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
@@ -7,4 +7,4 @@ import{a as N}from"./chunk-YNSVAJR6.js";import{a as I,b as S}from"./chunk-T633QL
|
|
|
7
7
|
AND c.document_id != ?
|
|
8
8
|
${o.pathExclusionsFor("consumer_d")}
|
|
9
9
|
${c}`,...a).map(l=>l.relative_path).filter(l=>!o.isIgnored(l)))}function _(o){let s=b(o);return s==="method"||s==="type"||o.endsWith("().")}export{x as a};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-VCQYSG2M.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-P5RYBRIO.js";import{a}from"./chunk-64MNV6AB.js";import{c as d}from"./chunk-7S5E7KWT.js";var g=d("file-dep-graph",{clearGroups:["whole-project"]});function p(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>f(e,s,n,t,o);for(let t of m(e,i))r(t.from_file,t.to_file);for(let t of n)if(!(i&&!t.includes(i)))for(let o of c(e,t))o.sourcePath&&r(t,o.sourcePath);return s})}function m(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
|
|
2
2
|
d1.relative_path AS from_file,
|
|
3
3
|
d2.relative_path AS to_file
|
|
4
4
|
FROM mentions m
|
|
@@ -17,4 +17,4 @@ import{b as c}from"./chunk-RY7CAOJF.js";import{a}from"./chunk-64MNV6AB.js";impor
|
|
|
17
17
|
AND m.role != 1
|
|
18
18
|
${e.pathExclusionsFor("d1","d2")}
|
|
19
19
|
${s}`)}function f(e,i,s,n,r){if(n===r||e.isIgnored(n)||e.isIgnored(r)||!s.has(r))return;let t=i.get(n);t||(t=new Set,i.set(n,t)),t.add(r)}export{p as a};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-VUKC6F77.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{q as d}from"./chunk-
|
|
1
|
+
import{q as d}from"./chunk-KDFONWTW.js";import{a as h}from"./chunk-TK7O5ER5.js";import{g}from"./chunk-JM72FNGA.js";import{a as m}from"./chunk-DS6QEB3G.js";import{a as p}from"./chunk-64MNV6AB.js";function _(t,r,n={}){let e=h(t,r);if(!e)return[];let l=!g(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=d(t,e,{semantic:n.semantic}).map(o=>({relativePath:o.file,line:o.line})),s=R(t,e),f=new Set,a=[];for(let o of[...l,...c,...s]){let u=`${o.relativePath}:${o.line}`;f.has(u)||(f.add(u),a.push(o))}return a}function R(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=b(r.symbol);if(n.length===0)return[];let e=[];for(let i of p(t,{extensions:[".rb"],includeIgnored:!1})){let l=m(t,i);if(!l)continue;let c=l.split(`
|
|
2
2
|
`);for(let s=0;s<c.length;s++){let f=c[s]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:s})}}return e}function b(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{_ as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-W6BVEKYC.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as P}from"./chunk-LM5SHAN4.js";import{a as x}from"./chunk-PFOCOG57.js";import{a as v}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-LM5SHAN4.js";import{a as x}from"./chunk-PFOCOG57.js";import{a as v}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-5OST6GYB.js";import{a as g,g as p}from"./chunk-C5CTSJ6X.js";import{a as h}from"./chunk-BGBBVSH4.js";import{c as l,d as m,g as u}from"./chunk-JM72FNGA.js";import{b as f}from"./chunk-72KY2ZFO.js";import{b as d}from"./chunk-DS6QEB3G.js";import{basename as y,extname as L}from"path";function X(n,e){let{scope:i,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new b(n);return x({candidates:()=>A(a,i,t),orderCandidates:v,scanLimit:s,prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>S(n,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function S(n,e,i){let t=R(i);if(t.size!==1||!f(n,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=I(n,e,o),a=T(n,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:D(r,s,a)}}function I(n,e,i){return P(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:y(e.relativePath,L(e.relativePath))},{label:"callee module",value:y(i.file,L(i.file))}])}function D(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(C);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return E(n,e)?g(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:p(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function E(n,e){let i=d(n,e.relativePath);if(i.length===0)return!1;let t=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
|
|
2
2
|
`);return j.test(t)?!0:w(i,m(e.symbol))}function w(n,e){if(!e)return!1;let i=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${F(e)}\\b`);return n.some(t=>i.test(t))}function C(n){return n.includes("public surface")}function F(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R(n){let e=n.some(t=>u(t.symbol))?n.filter(t=>u(t.symbol)):n,i=new Map;for(let t of e)i.has(t.symbol)||i.set(t.symbol,t);return i}function A(n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:3,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0})}var j=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function\b|(?:const|let|var)\b)/m;export{X as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-WUCEKFQC.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{c as p}from"./chunk-7S5E7KWT.js";import{createHash as h}from"crypto";import{readFileSync as v}from"fs";import{dirname as g,join as f}from"path";import N from"better-sqlite3";var y="evidence.db",d=new WeakMap,m=p("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),L=p("evidence-project-fingerprint",{clearGroups:["whole-project"]}),c="evidence-v1",E="version NOT LIKE 'evidence-%'";function T(n){return h("sha256").update(n).digest("hex")}function A(n,t,e){return m.get(n,t,()=>T(e))}function O(n){return L.get(n,"current",()=>{try{let t=JSON.parse(v(f(g(n.config.dbPath),"meta.json"),"utf-8"));if(t.version!==2&&t.version!==3||t.status!=="complete"||t.fingerprint===void 0)return null;let e=Array.isArray(t.indexedLanguages)?[...t.indexedLanguages].sort():[];return T(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:e}))}catch(t){return u("project fingerprint unavailable",t),null}})}function u(n,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${n}: ${t instanceof Error?t.message:String(t)}`)}function s(n){if(d.has(n))return d.get(n)??null;let t=null;try{let e=new N(f(g(n.config.dbPath),y));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.exec(`
|
|
2
|
+
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
3
|
+
kind TEXT NOT NULL,
|
|
4
|
+
relative_path TEXT NOT NULL,
|
|
5
|
+
content_hash TEXT NOT NULL,
|
|
6
|
+
version TEXT NOT NULL,
|
|
7
|
+
payload TEXT NOT NULL,
|
|
8
|
+
PRIMARY KEY (kind, relative_path)
|
|
9
|
+
);
|
|
10
|
+
CREATE TABLE IF NOT EXISTS semantic_callees (
|
|
11
|
+
relative_path TEXT NOT NULL,
|
|
12
|
+
symbol TEXT NOT NULL,
|
|
13
|
+
content_hash TEXT NOT NULL,
|
|
14
|
+
deps_digest TEXT NOT NULL,
|
|
15
|
+
version TEXT NOT NULL,
|
|
16
|
+
payload TEXT NOT NULL,
|
|
17
|
+
PRIMARY KEY (relative_path, symbol)
|
|
18
|
+
);
|
|
19
|
+
CREATE TABLE IF NOT EXISTS semantic_references (
|
|
20
|
+
relative_path TEXT NOT NULL,
|
|
21
|
+
symbol TEXT NOT NULL,
|
|
22
|
+
project_fingerprint TEXT NOT NULL,
|
|
23
|
+
version TEXT NOT NULL,
|
|
24
|
+
payload TEXT NOT NULL,
|
|
25
|
+
PRIMARY KEY (relative_path, symbol)
|
|
26
|
+
);
|
|
27
|
+
`),t={evidence:e,readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.prepare(`SELECT payload FROM file_evidence
|
|
28
|
+
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${E}
|
|
29
|
+
ORDER BY version DESC
|
|
30
|
+
LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
|
|
31
|
+
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.prepare(`SELECT payload FROM semantic_callees
|
|
32
|
+
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${E}
|
|
33
|
+
ORDER BY version DESC
|
|
34
|
+
LIMIT 1`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
35
|
+
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
|
|
36
|
+
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.prepare(`SELECT payload FROM semantic_references
|
|
37
|
+
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${E}
|
|
38
|
+
ORDER BY version DESC
|
|
39
|
+
LIMIT 1`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
40
|
+
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE project_fingerprint != ?")}}catch(e){u("disabled (open failed)",e)}return d.set(n,t),t}function o(n,t,e){u(`disabled (${t})`,e),d.set(n,null)}function b(n,t,e,a){let r=s(n);if(!r)return null;try{return(r.readFileEvidence.get(t,e,a,c)??r.readLegacyFileEvidence.get(t,e,a))?.payload??null}catch(i){return o(n,"file_evidence read",i),null}}function w(n,t,e,a,r){let i=s(n);if(i)try{i.writeFileEvidence.run(t,e,a,c,r)}catch(l){o(n,"file_evidence write",l)}}function F(n,t,e,a,r){let i=s(n);if(!i)return null;try{return(i.readCallees.get(t,e,a,r,c)??i.readLegacyCallees.get(t,e,a,r))?.payload??null}catch(l){return o(n,"semantic_callees read",l),null}}function I(n,t,e,a){let r=s(n);if(!r)return null;try{return(r.readReferences.get(t,e,a,c)??r.readLegacyReferences.get(t,e,a))?.payload??null}catch(i){return o(n,"semantic_references read",i),null}}function x(n,t){if(t.length===0)return;let e=s(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(r.relativePath,r.contentHash)),e.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,c,r.payload)}})()}catch(a){o(n,"semantic_callees write",a)}}function U(n,t){if(t.length===0)return;let e=s(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t)a.has(r.projectFingerprint)||(a.add(r.projectFingerprint),e.dropStaleReferences.run(r.projectFingerprint)),e.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,c,r.payload)})()}catch(a){o(n,"semantic_references write",a)}}function j(n){return typeof n=="object"&&n!==null}function X(n){return Array.isArray(n)&&n.every(t=>typeof t=="string")?n:null}export{T as a,A as b,O as c,b as d,w as e,F as f,I as g,x as h,U as i,j,X as k};
|
|
41
|
+
//# sourceMappingURL=chunk-XUGQU7PM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as D}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as D}from"./chunk-5OST6GYB.js";import{p as A}from"./chunk-KDFONWTW.js";import{b as d,d as h,f as y}from"./chunk-OLTESY4K.js";import{c as S}from"./chunk-JM72FNGA.js";function F(e,n={}){let{samples:o=50,scope:r,maxDisagreements:l=5}=n,s=new D(e),i=C(s.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o);if(i.length===0||!R(e,i))return{available:!1,sampleSize:i.length,oracleCoverage:0,scores:[],topDisagreements:[]};let c={references:v(),callees:v()},a=[],g=0,T=y(e,i);for(let t of i){let u=f(t,h(e,t).map(m=>m.file)),b=f(t,(T.get(t.symbolId)??[]).map(m=>m.file));if(u.size===0&&b.size===0)continue;g+=1;let Q=f(t,A(e,t).map(m=>m.file)),I=f(t,(s.calleeMap([t],{semantic:!1}).get(t.symbolId)??[]).map(m=>m.file));x(c.references,t,"references",Q,u,a),x(c.callees,t,"callees",I,b,a)}return a.sort((t,u)=>u.cheapOnly.length+u.oracleOnly.length-(t.cheapOnly.length+t.oracleOnly.length)),{available:!0,sampleSize:i.length,oracleCoverage:i.length>0?p(g/i.length):0,scores:["references","callees"].map(t=>O(t,c[t])),topDisagreements:a.slice(0,l)}}function v(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0}}function C(e,n){let o=[...e].sort((s,i)=>s.symbolId-i.symbolId);if(o.length<=n)return o;let r=o.length/n,l=[];for(let s=0;s<n;s++)l.push(o[Math.floor(s*r)]);return l}function R(e,n){let o=n[0];if(!o)return!1;try{return d(e,o.relativePath).availability().available}catch{return!1}}function f(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function x(e,n,o,r,l,s){if(r.size===0&&l.size===0)return;e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=l.size;let i=[],c=[];for(let a of r)l.has(a)?e.agreed+=1:i.push(a);for(let a of l)r.has(a)||c.push(a);(i.length>0||c.length>0)&&s.push({symbol:S(n.symbol),question:o,cheapOnly:i,oracleOnly:c})}var z={references:!0,callees:!1};function O(e,n){let o=n.oracleTotal>0?n.agreed/n.oracleTotal:1,r=n.cheapTotal-n.agreed;return{question:e,comparedSymbols:n.comparedSymbols,precision:z[e]&&n.cheapTotal>0?p(n.agreed/n.cheapTotal):null,recall:p(o),unverified:r}}function p(e){return Math.round(e*1e3)/1e3}export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-Y5NBHMQX.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-5OST6GYB.js";import{a as l}from"./chunk-TK7O5ER5.js";import{d as o,f as a}from"./chunk-JM72FNGA.js";import{basename as d}from"path";function M(t,c){let n=l(t,c);if(!n)return[];let r=o(n.symbol),s=new m(t).definitionsForFile(n.relativePath).filter(e=>a(e.symbol)),i=s.filter(e=>e.parentTypeName===r||e.symbol.includes(r));return(i.length>0?i:p(d(n.relativePath))===r?s.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:o(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-YCOFCT4B.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-7B6LP46R.js";import{a as h}from"./chunk-TK7O5ER5.js";import{c as p}from"./chunk-JM72FNGA.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
|
|
2
2
|
`),c=Math.max(0,e.startLine-a),i=Math.min(n.length-1,e.endLine+a),u=n.slice(c,i+1).join(`
|
|
3
3
|
`);return{symbol:e.symbol,shortName:p(e.symbol),relativePath:e.relativePath,startLine:c,endLine:i,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let l=m(t,e);if(!l)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",l);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),i;try{i=f(c,"utf-8")}catch{return null}let u=i.split(`
|
|
4
4
|
`),o=Math.max(0,a-1-r),g=Math.min(u.length-1,s-1+r),b=u.slice(o,g+1).join(`
|
|
5
5
|
`);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:g,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-YWYFU2V3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b}from"./chunk-7B6LP46R.js";import{k as f}from"./chunk-2KHTSEIL.js";import{l as d}from"./chunk-JM72FNGA.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-Z3YYR4OS.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-7B6LP46R.js";import{a as d}from"./chunk-5OST6GYB.js";import{e as c}from"./chunk-OLTESY4K.js";import{c as u}from"./chunk-JM72FNGA.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
|
|
2
2
|
WHERE relative_path = ?
|
|
3
3
|
${e.pathExclusionsFor("documents")}
|
|
4
4
|
LIMIT 1`,n)??null}function g(e,n){return new d(e).definitionsForFile(n).sort((i,t)=>i.startLine-t.startLine||i.endLine-t.endLine)}function S(e,n,i,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
|
|
@@ -8,4 +8,4 @@ import{a as f}from"./chunk-LGX2Y4BA.js";import{a as d}from"./chunk-XPOZO76D.js";
|
|
|
8
8
|
WHERE m.symbol_id = ?
|
|
9
9
|
AND m.role != 1
|
|
10
10
|
AND c.document_id != ?`,i.symbolId,n.id);return new Set([...r.map(s=>s.relative_path),...[...t].filter(s=>s!==n.relative_path)]).size}function b(e){return e>10?"high":e>0?"medium":"low"}export{L as a};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-Z4HICZGY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as l}from"./chunk-
|
|
1
|
+
import{b as l}from"./chunk-7B6LP46R.js";import{a}from"./chunk-5OST6GYB.js";import{c as i,f as n}from"./chunk-JM72FNGA.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -26,4 +26,4 @@ import{b as l}from"./chunk-LGX2Y4BA.js";import{a}from"./chunk-XPOZO76D.js";impor
|
|
|
26
26
|
AND ${e.localSymbolPredicate}
|
|
27
27
|
${e.pathExclusionsFor("d1")}
|
|
28
28
|
ORDER BY d1.relative_path`,...r,...r,...r)}function c(e,r){let t=new a(e);return r.flatMap(o=>t.definitionsForFile(o).filter(s=>n(s.symbol)).map(s=>({relative_path:o,symbol:s.symbol})))}function m(e){let r=new Set;return e.filter(t=>{let o=`${t.relative_path}|${t.symbol}`;return r.has(o)?!1:(r.add(o),!0)})}function u(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:i(e.symbol)}}export{_ as a};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-ZQDIXAF5.js.map
|