scip-query 0.18.0 → 0.19.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.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-OTTHMUMV.js → chunk-2FAJTZSX.js} +2 -2
- package/dist/{chunk-EJ65IVPV.js → chunk-2ZNZSNVW.js} +2 -2
- package/dist/chunk-35NLDRZC.js +2 -0
- package/dist/{chunk-QPF7CS5W.js → chunk-3KQOIXLO.js} +2 -2
- package/dist/{chunk-VCRMI56V.js → chunk-3OSRXJKK.js} +2 -2
- package/dist/chunk-42QYU6FD.js +3 -0
- package/dist/{chunk-ODH4FT3P.js → chunk-4ZCNFENR.js} +2 -2
- package/dist/{chunk-GWCW25ON.js → chunk-4ZHJAHLE.js} +2 -2
- package/dist/chunk-547VY366.js +18 -0
- package/dist/{chunk-NX2YAXVQ.js → chunk-54UYBTZW.js} +2 -2
- package/dist/{chunk-7ROLM67J.js → chunk-6DHPQS72.js} +2 -2
- package/dist/chunk-6SHX42QQ.js +6 -0
- package/dist/{chunk-ABDXTPCT.js → chunk-7EI4MU5A.js} +2 -2
- package/dist/{chunk-J7IMQRCU.js → chunk-7FG5M53V.js} +2 -2
- package/dist/chunk-A45K6VUK.js +2 -0
- package/dist/{chunk-MPBN5DO4.js → chunk-AEDB4WXE.js} +2 -2
- package/dist/{chunk-O5A7BTMA.js → chunk-AERYQJ52.js} +2 -2
- package/dist/chunk-AM2LGOEX.js +3 -0
- package/dist/{chunk-43QUXX3E.js → chunk-AWSRND4W.js} +2 -2
- package/dist/{chunk-5GAUXLOE.js → chunk-BOXAKNN6.js} +2 -2
- package/dist/{chunk-IKMOYFUM.js → chunk-BYPVNKJT.js} +2 -2
- package/dist/chunk-DQIJMKNE.js +3 -0
- package/dist/{chunk-K65T4TJS.js → chunk-DV6B262O.js} +2 -2
- package/dist/chunk-DWN7QDTV.js +26 -0
- package/dist/{chunk-HOZ3IXZ5.js → chunk-EZGT3NJX.js} +2 -2
- package/dist/{chunk-SW7LKHRU.js → chunk-EZHARAL4.js} +2 -2
- package/dist/chunk-F334Z5UA.js +38 -0
- package/dist/{chunk-SWJEREML.js → chunk-F5L7WEZF.js} +2 -2
- package/dist/{chunk-5CJ6AQN7.js → chunk-FLIF3JWA.js} +2 -2
- package/dist/chunk-FMC3BI4I.js +2 -0
- package/dist/{chunk-YMFHC5J2.js → chunk-G6QQCX45.js} +2 -2
- package/dist/{chunk-35TZERMO.js → chunk-G6RQVDTI.js} +2 -2
- package/dist/chunk-GBB2RUDN.js +927 -0
- package/dist/{chunk-LL5NQB5V.js → chunk-GJ3FR5WG.js} +2 -2
- package/dist/chunk-GMZYT44R.js +5 -0
- package/dist/{chunk-OQFPCIXO.js → chunk-GNJHHPZE.js} +2 -2
- package/dist/chunk-HOXI4F5I.js +4 -0
- package/dist/{chunk-PV3GKBO5.js → chunk-IWK562KR.js} +2 -2
- package/dist/chunk-IXORBCMR.js +120 -0
- package/dist/chunk-J3U47L4Q.js +2 -0
- package/dist/{chunk-O5Y3ISO3.js → chunk-J65FQLDL.js} +2 -2
- package/dist/{chunk-45QWQSWS.js → chunk-J6BR4MD6.js} +2 -2
- package/dist/{chunk-J7WYG63U.js → chunk-JFGUBZWE.js} +2 -2
- package/dist/{chunk-FMD46HAG.js → chunk-KD6TPIXM.js} +2 -2
- package/dist/{chunk-3M2UCPFS.js → chunk-KHE7J5ZN.js} +1 -1
- package/dist/{chunk-IG6X65MG.js → chunk-KWBA6FDD.js} +2 -2
- package/dist/{chunk-LADYDOS5.js → chunk-LJD7V7UO.js} +2 -2
- package/dist/{chunk-D5F3IQYP.js → chunk-MDDF67O2.js} +2 -2
- package/dist/{chunk-BAMVG4WQ.js → chunk-MFBXBLHA.js} +2 -2
- package/dist/{chunk-VXDMXZKC.js → chunk-MTFHE7ZO.js} +2 -2
- package/dist/chunk-NEG77KKH.js +4 -0
- package/dist/{chunk-WA64GKWB.js → chunk-NH7WNNQC.js} +3 -3
- package/dist/{chunk-K3UVTL3J.js → chunk-OGHGTD6Z.js} +2 -2
- package/dist/chunk-OYYZLJVT.js +2 -0
- package/dist/{chunk-MNRKD3WP.js → chunk-PAZFJMXB.js} +2 -2
- package/dist/{chunk-U244OVE6.js → chunk-PBADFBRR.js} +2 -2
- package/dist/{chunk-UWR52GNZ.js → chunk-PKAPOFF5.js} +2 -2
- package/dist/{chunk-POGZSZPX.js → chunk-PXJIEMND.js} +2 -2
- package/dist/{chunk-PZV2PGBR.js → chunk-QB5WSOTY.js} +2 -2
- package/dist/{chunk-MN54AGZ3.js → chunk-QHOUNTDZ.js} +2 -2
- package/dist/chunk-QN67MWDU.js +2 -0
- package/dist/{chunk-JLZUM476.js → chunk-QNMOZ3CJ.js} +2 -2
- package/dist/{chunk-AWYKDRYV.js → chunk-RIGY5DDE.js} +2 -2
- package/dist/chunk-RJLU7IMR.js +10 -0
- package/dist/{chunk-AV54WZUK.js → chunk-S65OEY2G.js} +2 -2
- package/dist/chunk-SATRCB5O.js +20 -0
- package/dist/chunk-T5CSWYAZ.js +2 -0
- package/dist/{chunk-H4T2AST4.js → chunk-TC3X33N6.js} +2 -2
- package/dist/{chunk-3CJXFMR5.js → chunk-TCVRJ56J.js} +2 -2
- package/dist/{chunk-7XP7ZRSI.js → chunk-TDGCALH6.js} +2 -2
- package/dist/chunk-TDZXQAH7.js +2 -0
- package/dist/{chunk-SUYCF4SX.js → chunk-TOYQTO44.js} +2 -2
- package/dist/chunk-UJL3N6TC.js +5 -0
- package/dist/chunk-UVMME4FI.js +16 -0
- package/dist/{chunk-6JSTKSZH.js → chunk-UXOVHGT6.js} +2 -2
- package/dist/chunk-VV5WJLRO.js +67 -0
- package/dist/{chunk-GTANVH72.js → chunk-WT7TOU2C.js} +2 -2
- package/dist/{chunk-4FLF7BHJ.js → chunk-X36LKKVG.js} +2 -2
- package/dist/{chunk-OSBLECSI.js → chunk-X3OOU7CF.js} +2 -2
- package/dist/chunk-X65VYV2S.js +2 -0
- package/dist/chunk-XBN5VO53.js +2 -0
- package/dist/{chunk-TLTLJ4SW.js → chunk-XDSB47KO.js} +2 -2
- package/dist/{chunk-4L4X66GE.js → chunk-XDVT7QPG.js} +2 -2
- package/dist/chunk-XESK6725.js +2 -0
- package/dist/{chunk-P4L5QQT5.js → chunk-XPYXEEDO.js} +2 -2
- package/dist/{chunk-T4P27T6S.js → chunk-XTSVYYAL.js} +2 -2
- package/dist/{chunk-27YDE22N.js → chunk-YBAC3RON.js} +2 -2
- package/dist/{chunk-2DBY4MO7.js → chunk-YHYTDWFT.js} +2 -2
- package/dist/chunk-YYR7ADNB.js +2 -0
- package/dist/chunk-ZL5Y23AJ.js +3 -0
- package/dist/{chunk-CMLHZWRS.js → chunk-ZNSLF5AC.js} +2 -2
- package/dist/chunk-ZXWFN7CK.js +2 -0
- package/dist/cli.js +2 -2
- package/dist/{command-descriptors-AQWWJNTT.js → command-descriptors-SWFWGIFK.js} +173 -167
- package/dist/{config-types-70s7NxKB.d.ts → config-types-BA3xLCfG.d.ts} +28 -1
- package/dist/{db-BBmJ0v3b.d.ts → db-CzA-9_rL.d.ts} +6 -18
- package/dist/direct-navigation-RKMPBXMI.js +3 -0
- package/dist/{health-CWpFL_6z.d.ts → health-DYy13GAe.d.ts} +3 -1
- package/dist/index.d.ts +23 -41
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +83 -0
- package/dist/queries/architecture.js +2 -0
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +5 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +27 -10
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +2 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +5 -4
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +2 -2
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +24 -24
- package/dist/reindex.d.ts +12 -10
- package/dist/reindex.js +38 -38
- package/dist/runtime.d.ts +10 -9
- package/dist/runtime.js +2 -1
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/{scip-cli-CoMzb7Zu.d.ts → scip-cli-1bVKJgXi.d.ts} +1 -1
- package/dist/watch-server.js +7 -6
- package/docs/AI_FAILURE_MODES.md +1 -0
- package/docs/COMMAND_REFERENCE.md +3 -2
- package/docs/DETECTOR_GUIDE.md +5 -3
- package/docs/analyzer-inventory.md +16 -6
- package/docs/analyzer-validation-ledger.md +12 -1
- package/docs/architecture-coherence-vision.md +219 -0
- package/package.json +5 -1
- package/skills/_shared/SKILL.md +4 -3
- package/skills/scip-conductor/SKILL.md +1 -1
- package/skills/scip-directory-architecture/SKILL.md +116 -2
- package/skills/scip-maintainability/SKILL.md +3 -3
- package/skills/scip-query/SKILL.md +1 -1
- package/skills/scip-twin-drift/SKILL.md +1 -1
- package/skills/scip-verify/SKILL.md +1 -1
- package/dist/chunk-2GX3TNOW.js +0 -38
- package/dist/chunk-45XOH33S.js +0 -2
- package/dist/chunk-4MFMTEJ4.js +0 -5
- package/dist/chunk-BECOMXAL.js +0 -2
- package/dist/chunk-BJJHBKEC.js +0 -2
- package/dist/chunk-DDGO34I2.js +0 -26
- package/dist/chunk-DUKRAHV2.js +0 -2
- package/dist/chunk-EMEXMHOP.js +0 -7
- package/dist/chunk-GWNE2WJN.js +0 -3
- package/dist/chunk-H4JNB7RT.js +0 -3
- package/dist/chunk-L2RE5P3X.js +0 -2
- package/dist/chunk-L2TSLMPT.js +0 -5
- package/dist/chunk-NQBMGFFD.js +0 -2
- package/dist/chunk-OINSINYW.js +0 -2
- package/dist/chunk-OM6JHEW3.js +0 -16
- package/dist/chunk-OUXPJ4H5.js +0 -3
- package/dist/chunk-OWXNDSG3.js +0 -2
- package/dist/chunk-Q4UM4JJP.js +0 -2
- package/dist/chunk-QEIGJJBC.js +0 -20
- package/dist/chunk-R4VPIS4D.js +0 -10
- package/dist/chunk-RDX6WWHN.js +0 -4
- package/dist/chunk-RUQE7DZT.js +0 -2
- package/dist/chunk-S43DIBME.js +0 -18
- package/dist/chunk-SALRDXWM.js +0 -121
- package/dist/chunk-SMBIGBGN.js +0 -67
- package/dist/chunk-VQWDZ34M.js +0 -928
- package/dist/chunk-W3557RPL.js +0 -3
- package/dist/chunk-W3SKYOTF.js +0 -2
- package/dist/chunk-XEEQX5X3.js +0 -3
- package/dist/direct-navigation-K3CTVVBU.js +0 -3
package/dist/chunk-L2TSLMPT.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as ie,b as N,e as V,f as j,g as E,h as te,i as re}from"./chunk-KMVGRIO2.js";import{b as _}from"./chunk-B75HZHUP.js";import{a as q}from"./chunk-L2RE5P3X.js";import{a as ne}from"./chunk-2GX3TNOW.js";import{a as D}from"./chunk-6JSTKSZH.js";import{d as I,e as K,h as $}from"./chunk-7XP7ZRSI.js";import{a as B}from"./chunk-JLZUM476.js";import{a as Y}from"./chunk-64MNV6AB.js";import{d as z,h as J,q as A,s as y,v as Q,x as ee,y as U,z as H}from"./chunk-M2TRDR25.js";function Ie(e,n,t={}){let{minSimilarity:i=.4,limit:r=20}=t,s=Ee(e,n,{semantic:t.semantic!==!1});if(!s)return[];if(!$(s.symbol))return[];if(s.callees.size===0)return se(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"});let a=we(e,s,i,{scanLimit:t.scanLimit,semantic:t.semantic!==!1});return a.length>0?a.slice(0,r):se(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"})}function vn(e,n,t,i={}){let r=D(e,n),s=D(e,t);if(!r||!s)return null;let a=Ie(e,r.symbol,{minSimilarity:0,limit:Number.POSITIVE_INFINITY,semantic:i.semantic,scanLimit:i.scanLimit}).find(m=>m.symbolB===s.symbol||m.symbolA===s.symbol);if(!a)return null;let l=r.endLine-r.startLine+1,c=s.endLine-s.startLine+1;return{symbolA:{symbol:r.symbol,shortName:I(r.symbol),file:r.relativePath,loc:l},symbolB:{symbol:s.symbol,shortName:I(s.symbol),file:s.relativePath,loc:c},similarity:a.similarity,similarityBasis:a.similarityBasis??"callees",sharedEvidence:a.sharedCallees,uniqueToA:a.uniqueToA,uniqueToB:a.uniqueToB,evidenceClass:a.evidenceClass,actionTier:a.actionTier,recommendation:a.recommendation,consolidationStrategy:ve(a)}}function ve(e){let n=e.similarityBasis==="source-tokens"?"source-token":"tracked callee";return e.sharedCallees.length===0?`No shared ${n} evidence survived similar's weighting. Inspect the source before attempting consolidation.`:e.uniqueToA.length===0&&e.uniqueToB.length===0?`The functions have identical ${n} evidence under similar's weighting. Verify signatures, guards, and return values before consolidating.`:e.uniqueToA.length===0?`A's ${n} evidence is a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic first.`:e.uniqueToB.length===0?`B's ${n} evidence is a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic first.`:e.uniqueToA.length<=2&&e.uniqueToB.length<=2?`Create a shared helper around the ${e.sharedCallees.length} shared ${n}(s). Pass the ${e.uniqueToA.length+e.uniqueToB.length} divergent point(s) as parameters or callbacks.`:`Extract the ${e.sharedCallees.length} shared ${n}(s) into a common helper. Keep each function's unique logic outside that helper (${e.uniqueToA.length} item(s) in A, ${e.uniqueToB.length} in B).`}function we(e,n,t,i){let r=G(e).calleeIndex({minCallees:3,scanLimit:i.scanLimit,semantic:i.semantic}),s=_e(n,r.corpus),a=Pe(s,r),l=Me(s,r),c=j(l),m=E(s.callees,l),g=[];for(let f of a){if(f.callees.size<3)continue;let o=E(f.callees,l),u=ce(s,f,l,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0,medianIdf:c,magnitudeA:m,magnitudeB:o});u&&g.push(u)}return g.sort((f,o)=>o.similarity-f.similarity),g}function Me(e,n){let t=new Map(n.docFreq);for(let i of e.callees)t.set(i,(t.get(i)??0)+1);return V(t,n.corpus.length+1)}function ce(e,n,t,i){let r=Le(e,n,t,i);if(!Re(r,i))return null;let{similarity:s,significantShared:a,trivialShared:l}=r,c=a.length>0?a:l,m=pe(c,"callees");return{symbolA:e.symbol,shortNameA:I(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:I(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:c.map(I),uniqueToA:[...N(e.callees,n.callees)].map(I),uniqueToB:[...N(n.callees,e.callees)].map(I),...m}}function Te(e,n,t,i){let r=i.magnitudeA??E(e.callees,t),s=i.magnitudeB??E(n.callees,t),a=0,l=0,c=0,m=i.medianIdf??j(t);for(let o of e.callees){if(!n.callees.has(o))continue;let u=t.get(o)??0;a+=u*u,c+=1,u>=m&&(l+=1)}if(c===0)return!1;let g=r*s;return(g>0?a/g:0)<i.minSimilarity?!1:l>=i.requireSignificantShared||c>=i.requireSharedCount}function Le(e,n,t,i){return i.magnitudeA===void 0||i.magnitudeB===void 0?te(e.callees,n.callees,t,{medianIdf:i.medianIdf}):re(e.callees,n.callees,t,{medianIdf:i.medianIdf,magnitudeA:i.magnitudeA,magnitudeB:i.magnitudeB})}function Re(e,n){if(e.similarity<n.minSimilarity)return!1;let t=e.significantShared.length+e.trivialShared.length;return e.significantShared.length>=n.requireSignificantShared||t>=n.requireSharedCount}function wn(e,n={}){let{minSimilarity:t=.5,limit:i=20,scope:r,minCallees:s=4,crossFileOnly:a=!1,scanLimit:l}=n,c=n.semantic!==!1,m=A(),g=0,f=0,o=0,u=0,d=0,p=0,S=0;return y("similar.all",()=>{let b=G(e).calleeIndex({minCallees:s,scope:r,scanLimit:l,semantic:c}),C=b.corpus;g=C.length;let v=n.focusFiles,k=[],P=0;return y("similar.all.pair-scan",()=>{for(let x=0;x<C.length;x+=1){let F=C[x],T=v?.has(F.file)??!1,w=b.weightedMagnitudes[x],M=new Set;for(let O of F.callees){let L=b.candidateIndexesByCallee.get(O);if(L)for(let R of L)R<=x||v&&!T&&!v.has(C[R].file)||M.add(R)}m&&(o+=M.size,M.size>0&&(f+=1));for(let O of M){let L=C[O];if(a&&F.file===L.file){m&&(d+=1);continue}if(ue(F,L)){m&&(p+=1);continue}m&&(u+=1);let R=ce(F,L,b.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:b.medianIdf,magnitudeA:w,magnitudeB:b.weightedMagnitudes[O]});R&&(Ae(k,R,i,P),m&&(S+=1),P+=1)}}},()=>({corpusSize:g,candidateSets:f,candidatePairs:o,comparedPairs:u,crossFileSkips:d,signatureSkips:p,insertedResults:S,topResults:k.length})),y("similar.all.sort-project",()=>(k.sort((x,F)=>F.result.similarity-x.result.similarity||x.order-F.order),k.map(x=>x.result)),()=>({topResults:k.length}))},()=>({minSimilarity:t,limit:i,scope:r,minCallees:s,crossFileOnly:a,scanLimit:l,semantic:c,corpusSize:g,candidateSets:f,candidatePairs:o,comparedPairs:u,crossFileSkips:d,signatureSkips:p,insertedResults:S}))}function Mn(e,n={}){let{minSimilarity:t=.5,scope:i,minCallees:r=4,crossFileOnly:s=!1,scanLimit:a}=n,l=n.semantic!==!1,c=A(),m=0,g=0,f=0,o=0,u=0,d=0,p=0;return y("similar.all-count",()=>{let h=G(e).calleeIndex({minCallees:r,scope:i,scanLimit:a,semantic:l}),b=h.corpus;m=b.length;let C=n.focusFiles;return y("similar.all-count.pair-scan",()=>{for(let v=0;v<b.length;v+=1){let k=b[v],P=C?.has(k.file)??!1,x=h.weightedMagnitudes[v],F=new Set;for(let T of k.callees){let w=h.candidateIndexesByCallee.get(T);if(w)for(let M of w)M<=v||C&&!P&&!C.has(b[M].file)||F.add(M)}c&&(f+=F.size,F.size>0&&(g+=1));for(let T of F){let w=b[T];if(s&&k.file===w.file){c&&(u+=1);continue}if(ue(k,w)){c&&(d+=1);continue}c&&(o+=1),Te(k,w,h.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:h.medianIdf,magnitudeA:x,magnitudeB:h.weightedMagnitudes[T]})&&(p+=1)}}},()=>({corpusSize:m,candidateSets:g,candidatePairs:f,comparedPairs:o,crossFileSkips:u,signatureSkips:d,insertedResults:p})),p},()=>({minSimilarity:t,scope:i,minCallees:r,crossFileOnly:s,scanLimit:a,semantic:l,corpusSize:m,candidateSets:g,candidatePairs:f,comparedPairs:o,crossFileSkips:u,signatureSkips:d,insertedResults:p}))}function ue(e,n){if(e.paramCount<0||n.paramCount<0)return!1;let t=Math.abs(e.paramCount-n.paramCount),i=Math.max(2,Math.ceil(Math.max(e.paramCount,n.paramCount)*.5));return t>i}var me=Q({kind:"source-fingerprints",invalidation:ee("source-fingerprints"),serialize:ln,deserialize:on});function Ae(e,n,t,i){if(t<=0)return;if(e.length<t){e.push({result:n,order:i});return}let r=0;for(let a=1;a<e.length;a+=1){let l=e[a],c=e[r];(l.result.similarity<c.result.similarity||l.result.similarity===c.result.similarity&&l.order>c.order)&&(r=a)}let s=e[r];n.similarity<=s.result.similarity||(e[r]={result:n,order:i})}var Be=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function Ee(e,n,t){let i=D(e,n);if(!i||!$(i.symbol))return null;let r=new q(e),s=ne(e,i,{semantic:t.semantic});return{symbol:i.symbol,file:i.relativePath,callees:ge(s.map(a=>a.symbol)),paramCount:r.callableSignature(i)?.paramCount??-1}}var ze=z("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),De=z("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function de(e,n){let{minCallees:t,scope:i,excludeSymbol:r,scanLimit:s}=n,a=n.semantic!==!1,l=ze.get(e,()=>new Map),c=`${t}|${i??""}|${s??""}|${a}`,m=!0,g=0,f=0;return y("similar.callee-fingerprints.resolve",()=>{let o=l.get(c);if(m=o!==void 0,o||(o=Oe(e,{minCallees:t,scope:i,scanLimit:s,semantic:a}),l.set(c,o)),g=o.length,r===void 0)return o;let u=o.filter(d=>d.symbol!==r);return f=o.length-u.length,u},()=>({minCallees:t,scope:i,scanLimit:s,semantic:a,cacheHit:m,corpusSize:g,excludeSymbol:r!==void 0,excludedSymbols:f}))}function qe(e,n){let{minCallees:t,scope:i,scanLimit:r}=n,s=n.semantic!==!1,a=De.get(e,()=>new Map),l=`${t}|${i??""}|${r??""}|${s}`,c=!0,m=0,g=0,f=0;return y("similar.callee-index.resolve",()=>{let o=a.get(l);return c=o!==void 0,o||(o=Ne(de(e,{minCallees:t,scope:i,scanLimit:r,semantic:s})),a.set(l,o)),m=o.corpus.length,g=o.docFreq.size,f=o.candidateIndexesByCallee.size,o},()=>({minCallees:t,scope:i,scanLimit:r,semantic:s,cacheHit:c,corpusSize:m,indexedCallees:g,candidateBuckets:f}))}function G(e){return{calleeCorpus:n=>de(e,n),calleeIndex:n=>qe(e,n),sourceCorpus:(n={})=>Ce(e,n),sourceIndex:(n={})=>le(e,n),sourceCandidates:(n,t)=>(t.candidateMode??"full")==="target-pruned"?Ye(e,n,{minSimilarity:t.minSimilarity,scanLimit:t.scanLimit}):Je(n,le(e,{scanLimit:t.scanLimit}))}}function Ne(e){let n=A(),t=0,i=y("similar.callee-index.doc-frequency",()=>{let o=new Map;for(let u of e)for(let d of u.callees)o.set(d,(o.get(d)??0)+1);return t=o.size,o},()=>({corpusSize:e.length,uniqueCallees:t})),r=Math.max(8,Math.ceil(Math.sqrt(e.length))),s=y("similar.callee-index.idf-weights",()=>V(i,e.length),()=>({corpusSize:e.length,uniqueCallees:i.size})),a=y("similar.callee-index.weighted-magnitudes",()=>e.map(o=>E(o.callees,s)),()=>({corpusSize:e.length})),l=0,c=0,m=0,g=y("similar.callee-index.candidate-buckets",()=>{let o=new Map;for(let u=0;u<e.length;u+=1){let d=e[u];for(let p of d.callees){if((i.get(p)??0)>r){n&&(c+=1);continue}let S=o.get(p);S||(S=[],o.set(p,S)),S.push(u),n&&(l+=1)}}return n&&(m=o.size),o},()=>({corpusSize:e.length,buckets:m,candidateRefs:l,ubiquitousSkips:c,ubiquityThreshold:r})),f=y("similar.callee-index.median-idf",()=>j(s),()=>({uniqueCallees:s.size}));return{corpus:e,candidateIndexesByCallee:g,docFreq:i,idfWeights:s,weightedMagnitudes:a,medianIdf:f,ubiquityThreshold:r}}function Pe(e,n){let t=new Map;for(let i of e.callees)for(let r of n.candidateIndexesByCallee.get(i)??[]){let s=n.corpus[r];s.symbol!==e.symbol&&t.set(s.symbol,s)}return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function Oe(e,n){let{minCallees:t,scope:i,scanLimit:r,semantic:s}=n,a=A(),l=new q(e),c=0,m=y("similar.callee-fingerprints.candidates",()=>{let p=_(l.productionCallableDefinitions({scope:i,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r);return c=p.length,p},()=>({scope:i,scanLimit:r,candidateCount:c})),g=0,f=y("similar.callee-fingerprints.callee-map",()=>{let p=l.calleeMap(m,{semantic:s});if(a)for(let S of p.values())g+=S.length;return p},()=>({candidateCount:c,semantic:s,calleeEdges:g})),o=0,u=0,d=0;return y("similar.callee-fingerprints.shape",()=>{let p=m.map(b=>({symbol:b.symbol,file:b.relativePath,callees:ge((f.get(b.symbolId)??[]).map(C=>C.symbol)),paramCount:l.callableSignature(b)?.paramCount??-1})),S=$e(p);a&&(d=S.filter((b,C)=>b.callees.size!==p[C].callees.size).length);let h=S.filter(b=>b.callees.size>=t);return o=h.length,a&&(u=h.reduce((b,C)=>b+C.callees.size,0)),h},()=>({candidateCount:c,fingerprintCount:o,retainedCalleeCount:u,minCallees:t,siblingSaturatedFingerprints:d}))}var fe=5;function $e(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=new Map,n.set(t.file,i));for(let r of t.callees)i.set(r,(i.get(r)??0)+1)}return e.map(t=>{let i=n.get(t.file);if(!i)return t;let r=[...t.callees].filter(a=>(i.get(a)??0)>=fe);if(r.length===0)return t;let s=new Set(t.callees);for(let a of r)s.delete(a);return{...t,callees:s}})}function _e(e,n){let t=new Map;for(let s of n)if(!(s.file!==e.file||s.symbol===e.symbol))for(let a of s.callees)t.set(a,(t.get(a)??0)+1);let i=[...e.callees].filter(s=>(t.get(s)??0)+1>=fe);if(i.length===0)return e;let r=new Set(e.callees);for(let s of i)r.delete(s);return{...e,callees:r}}function ge(e){return new Set([...e].filter(n=>!je(n)))}function je(e){return Be.some(n=>e.includes(n))}function se(e,n,t){let i=Ke(e,n);if(!i||i.tokens.size<3)return[];let r=t.minSimilarity>=.5?t.minSimilarity:.3,s=[],a=t.candidateMode??"full",l=0,c=0,m=0,g=0;return y("similar.source-shape",()=>{let o=G(e).sourceCandidates(i,{minSimilarity:r,scanLimit:t.scanLimit,candidateMode:a});l=o.length;for(let u of o){if(u.symbol===i.symbol||u.tokens.size<3)continue;c+=1;let d=ie(i.tokens,u.tokens);if(d.size<2){m+=1;continue}let p=new Set([...i.tokens,...u.tokens]),S=p.size>0?d.size/p.size:0;if(S<r){g+=1;continue}s.push({symbolA:i.symbol,shortNameA:I(i.symbol),fileA:i.file,symbolB:u.symbol,shortNameB:I(u.symbol),fileB:u.file,similarity:S,similarityBasis:"source-tokens",sharedCallees:[...d].sort(),uniqueToA:[...N(i.tokens,u.tokens)].sort(),uniqueToB:[...N(u.tokens,i.tokens)].sort(),...pe([...d],"source-tokens")})}return s.sort((u,d)=>d.similarity-u.similarity||u.shortNameB.localeCompare(d.shortNameB)),s.slice(0,t.limit)},()=>({symbol:i.symbol,file:i.file,targetTokens:i.tokens.size,candidateMode:a,candidates:l,comparedPairs:c,sharedSkips:m,similaritySkips:g,results:s.length}))}function pe(e,n){let t=e.flatMap(W),i=e.flatMap(S=>ae(S,n)),r=Z(t,Se),s=Z(t,be),a=Z(i,X),l=[...new Set(i.filter(oe))],c=e.filter(S=>{let h=ae(S,n);return h.some(b=>X.has(b))&&h.some(oe)}).length,m=[];r.length>0&&m.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),s.length>0&&m.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),a.length>0&&m.push(`domain behavior verbs: ${a.slice(0,5).join(", ")}`),a.length>0&&l.length>0&&m.push(`domain-specific terms: ${l.slice(0,5).join(", ")}`);let g=n==="source-tokens"&&t.length>0&&t.every(S=>ye.has(S));g&&m.push("shared source tokens are generic scaffolding");let f=a.length>0&&l.length>0,o=r.length+s.length>0,u=n==="callees"&&f&&e.length>=4&&l.length>=4&&c>=2,d=u?"domain-behavior":f?o?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":s.length>0||g?"framework-scaffolding":"structural-overlap";d==="structural-overlap"&&e.length>0&&m.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let p=d==="domain-behavior"&&(e.length>=3||u)?"direct":"signal";return{evidenceClass:d,actionTier:p,evidenceClassReasons:m,recommendation:Ge(d,p)}}function Ge(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function Z(e,n){return[...new Set(e.filter(t=>n.has(t)))]}function W(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function ae(e,n){if(n==="source-tokens")return W(e);let t=K(e);return W(t.length>0?t:Ue(e))}function Ue(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(i=>i.trim()).filter(i=>/[A-Za-z]/.test(i)).at(-1)?.replace(/\.$/,"")??e}function oe(e){return e.length>3&&!X.has(e)&&!Se.has(e)&&!be.has(e)&&!ye.has(e)&&!He.has(e)}var X=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),Se=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),be=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),ye=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),He=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function Ke(e,n){let t=D(e,n);if(!t||!$(t.symbol))return null;let i=Ve(e,t);return i?{symbol:t.symbol,file:t.relativePath,tokens:i}:null}function Ve(e,n){let t=K(n.symbol),i=rn(e,n.relativePath,n.startLine,n.endLine,t),r=ke(i,t);return r.size>0?r:null}var Ze=z("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),We=z("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function he(e){return`${e.scanLimit??""}`}function Ce(e,n={}){let t=Ze.get(e,()=>new Map),i=he(n),r=t.get(i);return r||(r=tn(e,n),t.set(i,r)),r}function le(e,n={}){let t=We.get(e,()=>new Map),i=he(n),r=t.get(i);return r||(r=Xe(Ce(e,n)),t.set(i,r)),r}function Xe(e){let n=new Map;for(let r of e)for(let s of r.tokens)n.set(s,(n.get(s)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=new Map;for(let r of e)for(let s of r.tokens){if((n.get(s)??0)>t)continue;let a=i.get(s);a||(a=[],i.set(s,a)),a.push(r)}return{corpus:e,candidateByToken:i,docFreq:n,ubiquityThreshold:t}}function Je(e,n){let t=new Map;for(let i of e.tokens)for(let r of n.candidateByToken.get(i)??[])r.symbol!==e.symbol&&t.set(r.symbol,r);return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function Ye(e,n,t){let i=A(),r=new q(e),s=Qe(n.tokens.size,t.minSimilarity),a=0,l=0,c=0,m=y("similar.source-shape.target-files",()=>{let d=[...n.tokens],p=[];for(let S of Y(e,{includeIgnored:!1})){a+=1;let h=U(e,S);h&&(l+=1,en(h,d,s)&&p.push(S))}return c=p.length,p},()=>({symbol:n.symbol,targetTokens:n.tokens.size,requiredSharedTokens:s,scannedFiles:a,readableFiles:l,candidateFiles:c})),g=0,f=y("similar.source-shape.target-definitions",()=>{let d=_(r.productionCallableDefinitions({files:m,sortByLocDesc:typeof t.scanLimit=="number"&&t.scanLimit>0}),t.scanLimit);return g=d.length,d},()=>({symbol:n.symbol,candidateFiles:c,scanLimit:t.scanLimit,definitionCount:g})),o=0;return y("similar.source-shape.target-fingerprints",()=>{let d=Fe(e,f);return i&&(o=d.length),d},()=>({symbol:n.symbol,definitionCount:g,fingerprintCount:o})).filter(d=>d.symbol!==n.symbol)}function Qe(e,n){return Math.max(2,Math.ceil(e*n))}function en(e,n,t){if(n.length<t)return!1;let i=e.toLowerCase(),r=0;for(let s of n)if(nn(i,s)&&(r+=1,r>=t))return!0;return!1}function nn(e,n){return n==="num"?/\b\d+\b/.test(e):e.includes(n)}function tn(e,n={}){let t=new q(e),{scanLimit:i}=n,r=_(t.productionCallableDefinitions({sortByLocDesc:typeof i=="number"&&i>0}),i);return Fe(e,r)}function Fe(e,n){let t=new Map;for(let r of n){let s=t.get(r.relativePath)??[];s.push(r),t.set(r.relativePath,s)}let i=new Map;for(let[r,s]of t){let a=U(e,r);if(!a)continue;let l=J(e,r,a),c=an(e,r,l),m=!1,g=null;for(let f of s){let o=sn(f),u=c.get(o),d=u?new Set(u.tokens):null;d||(g??=H(e,r),d=ke(xe(g,f.startLine,f.endLine,f.leaf),f.leaf),c.set(o,{key:o,symbol:f.symbol,startLine:f.startLine,endLine:f.endLine,leaf:f.leaf,tokens:[...d].sort()}),m=!0),d.size>0&&i.set(f.symbol,{symbol:f.symbol,file:f.relativePath,tokens:d})}m&&cn(e,r,l,c)}return n.map(r=>i.get(r.symbol)).filter(r=>!!r)}function rn(e,n,t,i,r){let s=H(e,n);return s.length===0?"":xe(s,t,i,r)}function xe(e,n,t,i){if(t>=n&&t-n<=12)return e.slice(n,t+1).join(`
|
|
2
|
-
`);let r=[new RegExp(`\\bdef\\s+${B(i)}\\b`),new RegExp(`\\bfun\\s+${B(i)}\\b`),new RegExp(`\\bfn\\s+${B(i)}\\b`),new RegExp(`\\bfunction\\s+${B(i)}\\b`),new RegExp(`\\b${B(i)}\\s*\\(`)],s=e.findIndex(a=>r.some(l=>l.test(a)));if(s>=0){let a=s;for(let l=s+1;l<e.length&&l<=s+8;l++){let c=e[l]??"";if(l>s&&mn(c)||(a=l,c.trim()===""&&l>s+1))break}return e.slice(s,a+1).join(`
|
|
3
|
-
`)}return e.slice(n,Math.min(e.length,n+8)).join(`
|
|
4
|
-
`)}function sn(e){return`${e.symbol}\0${e.startLine}\0${e.endLine}\0${e.leaf}`}function an(e,n,t){return me.read(e,n,t)??new Map}function on(e){try{let n=JSON.parse(e);if(!Array.isArray(n.entries))return null;let t=new Map;for(let i of n.entries){if(!i||typeof i.key!="string"||typeof i.symbol!="string"||typeof i.startLine!="number"||typeof i.endLine!="number"||typeof i.leaf!="string"||!Array.isArray(i.tokens)||!i.tokens.every(r=>typeof r=="string"))return null;t.set(i.key,i)}return t}catch{return null}}function ln(e){let n={entries:[...e.values()].sort((t,i)=>t.key.localeCompare(i.key))};return JSON.stringify(n)}function cn(e,n,t,i){me.write(e,n,t,new Map(i))}function ke(e,n){if(!e)return new Set;let t=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),i=un(n),s=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(a=>a.trim()).filter(a=>a.length>1).filter(a=>!t.has(a)).filter(a=>!i.has(a));return new Set(s)}function un(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function mn(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}export{Ie as a,vn as b,Me as c,ce as d,wn as e,Mn as f,Ae as g,de as h,qe as i,G as j,Ne as k,Pe as l,fe as m,$e as n,ge as o,pe as p};
|
|
5
|
-
//# sourceMappingURL=chunk-L2TSLMPT.js.map
|
package/dist/chunk-NQBMGFFD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as n}from"./chunk-B75HZHUP.js";import{a as m,c as a}from"./chunk-2GX3TNOW.js";import{a as i}from"./chunk-6JSTKSZH.js";import{d as o,h as r}from"./chunk-7XP7ZRSI.js";function R(s,c,y={}){let e=i(s,c);if(!e)return null;let t=y.semantic!==!1,b=a(s,e,{semantic:t}).filter(l=>r(l.symbol)).slice(0,50),f=n(m(s,e,{limit:50,additive:!0,callableOnly:!0,semantic:t}));return{symbol:e.symbol,shortName:o(e.symbol),callers:b.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file})),callees:f.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file}))}}export{R as a};
|
|
2
|
-
//# sourceMappingURL=chunk-NQBMGFFD.js.map
|
package/dist/chunk-OINSINYW.js
DELETED
package/dist/chunk-OM6JHEW3.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{d as A,i as T}from"./chunk-PZV2PGBR.js";import{d as I}from"./chunk-6JSTKSZH.js";import{e as d,s as w,z as P}from"./chunk-7XP7ZRSI.js";import{a as v,b as F,f as h,p as y}from"./chunk-JLZUM476.js";import{B as k,L as R,a as D,c as p}from"./chunk-TLTLJ4SW.js";import{c as u,d as M,y as m}from"./chunk-M2TRDR25.js";function L(e,r,n,t={}){if(!n)return[];let i=m(e,r);return i?i.indexOf(n)===-1?[]:(x(e,r).get(n)??[]).filter(o=>!J(o,t)):[]}function J(e,r){return typeof r.excludeStartLine=="number"&&typeof r.excludeEndLine=="number"&&e>=r.excludeStartLine&&e<=r.excludeEndLine}var Y=u("file-identifiers",{clearGroups:["whole-project","source-file"]});function O(e,r){let n=h(e,r);return n?n.fileIdentifiers:Y.get(e,r,()=>new Set(x(e,r).keys()))}var W=u("file-ident-lines",{clearGroups:["whole-project","source-file"]});function x(e,r){let n=h(e,r);return n?n.identifierLineMap:W.get(e,r,()=>X(e,r))}var V=u("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function pe(e,r){let n=h(e,r);return n?n.identifiersByLine:V.get(e,r,()=>{let t=x(e,r),i=0;for(let o of t.values()){let c=o[o.length-1];c!==void 0&&c>i&&(i=c)}let a=new Array(i+1);for(let o=0;o<=i;o+=1)a[o]=new Set;for(let[o,c]of t)for(let s of c)a[s].add(o);return a})}function X(e,r){let n=new Map,t=(c,s)=>{let l=n.get(c);if(!l){n.set(c,[s]);return}l[l.length-1]!==s&&l.push(s)},i=m(e,r);if(!i)return n;let a=F(i).split(/\r?\n/),o=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<a.length;c+=1){let s=a[c]??"";for(let l of s.matchAll(o))l[1]&&t(l[1],c)}return n}function Le(e,r){let n=z(e);return n?r.filter(t=>z(t.file)===n):r}function _e(e,r,n,t){let i=n.find(a=>a.file===r);if(i)return i;if(t){let a=new Set(y(e,r).map(o=>o.sourcePath).filter(o=>!!o));for(let o of n)for(let c of a)if(p(c,o.file))return o;return null}return n.length===1?n[0]:null}function z(e){let r=k(e);return r?r==="typescript"||r==="tsx"||r==="javascript"?"javascript-family":r:null}var q=M("global-leaf-index",{clearGroups:["whole-project"]});function E(e){return q.get(e,()=>{let r=e.all(`SELECT gs.id, gs.symbol,
|
|
2
|
-
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
3
|
-
FROM global_symbols gs
|
|
4
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
5
|
-
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
6
|
-
LEFT JOIN (
|
|
7
|
-
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
8
|
-
FROM mentions m
|
|
9
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
-
JOIN documents d ON c.document_id = d.id
|
|
11
|
-
WHERE m.role = 1
|
|
12
|
-
GROUP BY m.symbol_id
|
|
13
|
-
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
14
|
-
WHERE 1 = 1
|
|
15
|
-
${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of r){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let i=d(t.symbol);if(!i)continue;let a=n.get(i);a||(a=[],n.set(i,a)),a.some(o=>o.symbolId===t.id)||a.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}var K=u("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function $(e,r){let n=D(r);return K.get(e,n,()=>Q(e,n))}function Q(e,r){let n=new Map;for(let t of y(e,r)){if(!t.sourcePath)continue;let i=t.localName??t.importedName;if(i&&j(n,i,t.sourcePath),t.kind==="namespace")for(let a of t.usedMembers)j(n,a,t.sourcePath)}return n}function j(e,r,n){let t=e.get(r);t||(t=new Set,e.set(r,t)),t.add(n)}var B=/[A-Za-z_$][A-Za-z0-9_$]*/g,G=/^[A-Za-z_$][A-Za-z0-9_$]*$/,ee=512;function C(e){let r=[],n=!1;for(let t of e)t&&(n=!0,G.test(t)||r.push(t));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:r}}function H(e,r){let n=te(r)?r:C(r);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;if(n.candidateNames.size<=ee){for(let i of n.candidateNames)if(i){if(G.test(i)){if(ne(i).test(e))return!0;continue}if(e.includes(i))return!0}return!1}B.lastIndex=0;let t;for(;(t=B.exec(e))!==null;)if(n.candidateNames.has(t[0]))return!0;for(let i of n.nonIdentifierNames)if(e.includes(i))return!0;return!1}function te(e){return"candidateNames"in e}function ne(e){return new RegExp(`(?<![A-Za-z_$0-9])${v(e)}(?![A-Za-z_$0-9])`)}function N(e,r,n){let t=E(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[g(t[0])];let i=t.filter(s=>s.file===r);if(i.length>0)return i.map(g);let a=$(e,r),o=a.get(n);if(o)for(let s of o){let l=t.filter(f=>p(s,f.file));if(l.length>0)return l.map(g)}let c=new Set;for(let s of a.values())for(let l of s)c.add(l);for(let s of c){let l=t.filter(f=>p(s,f.file));if(l.length>0&&l.length===t.length)return l.map(g)}return[]}function Be(e,r,n){let t=N(e,r,n);if(t.length>0)return t;let i=E(e).get(n);return!i||i.length===0?[]:i.map(g)}function U(e,r,n={}){let t=I(e,r);if(!t)return[];let i=d(t.symbol);if(!i)return[];if(n.semantic!==!1){let o=T(e,{...t,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(o.length>0){let c=new Map;for(let s of o){let l=c.get(s.file)??[];l.push(s.line),c.set(s.file,l)}return _(e,c)}}let a=new Map;for(let o of R(e)){let c=m(e,o);if(!c||c.indexOf(i)===-1||o!==t.relativePath&&!N(e,o,i).some(f=>f.symbolId===t.symbolId))continue;let s=L(e,o,i,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});s.length>0&&a.set(o,s)}return _(e,a)}function Ge(e,r,n={}){let t=new Map;for(let s of r){if(!s.leaf)continue;let l=t.get(s.leaf)??[];l.push(s),t.set(s.leaf,l)}if(t.size===0)return new Map;let i=new Set(r.map(s=>s.symbolId)),a=new Set(t.keys()),o=C(a),c=new Map;for(let s of R(e)){if(n.skipPath?.(s)||!H(m(e,s),o))continue;let l=O(e,s);if(l.size!==0){for(let f of l)if(t.has(f))for(let b of N(e,s,f)){if(!i.has(b.symbolId)||s===b.relativePath)continue;let S=c.get(b.symbolId);S||(S=new Set,c.set(b.symbolId,S)),S.add(s)}}}return c}function g(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function _(e,r){let n=[],t=new Set;for(let[i,a]of r){let o=w(e,i);for(let c of a){let s=P(o,c),l=`${i}|${c}|${s?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:s?.symbol??null}))}}return n}function re(e,r){let n=le(e,r);return n?_(e,oe(e,n.match,n.identifier)):[]}function Ve(e,r,n={}){return ie(e,r,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function ie(e,r,n={}){let t=U(e,r,{semantic:n.semantic}),i=t.length>0?Z(t,"source-attribution"):Z(re(e,r),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(a=>!e.isIgnored(a.file))}function Z(e,r){return e.map(n=>({...n,provenance:r}))}function oe(e,r,n){let t=new Map;for(let[i,a]of se(e,r.symbolId))t.set(i,ae(e,i,a,r,n));return t}function se(e,r){let n=new Map;for(let t of A(e,[r])){if(e.isIgnored(t.relative_path))continue;let i=n.get(t.relative_path);i||(i=[],n.set(t.relative_path,i)),i.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function ae(e,r,n,t,i){let a=r===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},o=i?L(e,r,i,a):[];return n.flatMap(c=>ce(o,c))}function ce(e,r){let n=e.filter(t=>t>=r.start_line&&t<=r.end_line);return n.length>0?n:[r.start_line]}function le(e,r){let n=I(e,r);return n?{match:n,identifier:d(n.symbol)||null}:null}export{x as a,pe as b,Le as c,_e as d,E as e,C as f,H as g,$ as h,N as i,Be as j,Ge as k,re as l,Ve as m};
|
|
16
|
-
//# sourceMappingURL=chunk-OM6JHEW3.js.map
|
package/dist/chunk-OUXPJ4H5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as $e}from"./chunk-FMD46HAG.js";import{a as Se}from"./chunk-ABDXTPCT.js";import{a as se,c as ae,d as ce,e as D}from"./chunk-2DBY4MO7.js";import{a as Ce}from"./chunk-BAMVG4WQ.js";import{a as ye}from"./chunk-GTANVH72.js";import{a as be}from"./chunk-C2QSK7E7.js";import{a as ge}from"./chunk-OSBLECSI.js";import{a as he}from"./chunk-O5Y3ISO3.js";import{a as fe}from"./chunk-S43DIBME.js";import{a as ue}from"./chunk-MN54AGZ3.js";import{b as re}from"./chunk-J7IMQRCU.js";import{a as ne,b as oe}from"./chunk-O5A7BTMA.js";import{a as Q,b as X,c as ee,g as M,h as K}from"./chunk-MNRKD3WP.js";import{a as ie,b as F,e as te}from"./chunk-IG6X65MG.js";import{b as de}from"./chunk-XEEQX5X3.js";import{a as B,c as J,d as Y,e as Z}from"./chunk-AWYKDRYV.js";import{a as V}from"./chunk-4XTPZ5CR.js";import{a as me,e as pe}from"./chunk-L2TSLMPT.js";import{a as le}from"./chunk-27YDE22N.js";import{a as W}from"./chunk-L2RE5P3X.js";import{f as T,g as A}from"./chunk-5CJ6AQN7.js";import{e as q}from"./chunk-OM6JHEW3.js";import{e as R,f as U,g as N}from"./chunk-7XP7ZRSI.js";import{a as O}from"./chunk-JLZUM476.js";import{e as H}from"./chunk-TLTLJ4SW.js";import{s as z}from"./chunk-M2TRDR25.js";import{createHash as ei}from"crypto";import{existsSync as _}from"fs";function we(e){let[i,t]=j(e,":"),o=i||"unknown",n=(a={})=>{let s=a.actionTier??Me(o);return{sourceAnalyzer:o,actionTier:s,rootCauseKey:a.rootCauseKey??(t||e),label:a.label??`${o} finding`,relatedFiles:a.relatedFiles??[],why:a.why??[],remediation:a.remediation??Ke(s,o),file:a.file}};if(!t)return n({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(o)){let[a,s]=j(t,":");return n({file:a,relatedFiles:a?[a]:[],rootCauseKey:s?`${a}:${s}`:t,label:`${o} finding`,why:s?[`Baseline subject: ${s}.`]:[]})}if(o==="cycle"){let a=t.split(">").filter(Boolean);return n({relatedFiles:a,rootCauseKey:t,label:"cycle finding",why:a.length>0?[`Cycle path: ${a.join(" > ")}.`]:[]})}if(o==="similar"){let a=t.split("|").filter(Boolean);return n({relatedFiles:[],rootCauseKey:t,label:"similarity finding",why:a.length>0?[`Similar symbols: ${a.join(" | ")}.`]:[]})}if(o==="drift"){let[a,s]=j(t,":"),[c,d]=j(s,":");return n({actionTier:a==="unused-import"?"direct":"signal",file:c,relatedFiles:[...new Set([c,d].filter(Boolean))],rootCauseKey:t,label:`${a||"drift"} finding`,why:[...a?[`Drift kind: ${a}.`]:[],...d?[`Related dependency: ${d}.`]:[]]})}return n({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function Me(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function Ke(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function j(e,i){let t=e.indexOf(i);return t<0?[e,""]:[e.slice(0,t),e.slice(t+i.length)]}import{existsSync as Le,readFileSync as Pe,writeFileSync as _e}from"fs";import{isAbsolute as He,join as ze}from"path";var Oe=25e3,Ue=2500,qe=2500;function We(e){let i=be(e);return i.symbols>=Oe||i.documents>=Ue?qe:void 0}var Ve=".scipquery-baseline.json";function E(e,i){return i&&He(i)?i:ze(e.config.projectRoot,i??Ve)}function De(e,i={}){let{scope:t}=i,o=We(e),n=[],a=de(e,{scope:t,...D.dead,scanLimit:o});for(let s of a.symbols)T(e,s.relativePath)||A(e,s.symbol,s.relativePath)||s.kind==="dead-code"&&n.push(`dead:${s.relativePath}:${s.shortName}`);for(let s of he(e,{scope:t,...D.isolated,scanLimit:o}))T(e,s.relativePath)||A(e,s.symbol,s.relativePath)||n.push(`isolated:${s.relativePath}:${s.shortName}`);for(let s of le(e,{scope:t}))s.kind==="real"&&n.push(`cycle:${Je(s.path)}`);for(let s of pe(e,{scope:t,...D.similar,scanLimit:o}))n.push(`similar:${[s.symbolA,s.symbolB].sort().join("|")}`);for(let s of ne(e,{scope:t,...D.duplicateBodies,scanLimit:o}))n.push(`duplicate-bodies:${s.hash}:${s.functions.map(c=>c.symbol).sort().join("|")}`);for(let s of ue(e,{scope:t,...D.extract,scanLimit:o}))n.push(`extract:${s.relativePath}:${s.shortName}`);for(let s of Ce(e,{scope:t,...D.wrappers,scanLimit:o}))n.push(`wrapper:${s.file}:${s.shortName}`);for(let s of ge(e,{scope:t,...D.passthroughs,scanLimit:o}))n.push(`passthrough:${s.file}:${s.shortName}`);for(let s of ye(e,{scope:t,...D.stale,scanLimit:o}))n.push(`stale:${s.file}:${s.shortName}`);for(let s of fe(e,{scope:t,...D.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY}).results)n.push(`drift:${s.kind}:${s.file}:${s.dep}`);return[...new Set(n)].sort()}function Je(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function qi(e,i={}){let t=De(e,{scope:i.scope}),o=E(e,i.path);return _e(o,JSON.stringify({version:1,findings:t},null,2)+`
|
|
2
|
-
`),{path:o,findingCount:t.length}}function ke(e,i={}){let t=E(e,i.path);if(!Le(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let o=JSON.parse(Pe(t,"utf-8")),n=new Set(o.findings??[]),a=De(e,{scope:i.scope}),s=new Set(a);return{baselinePath:t,baselineCount:n.size,current:a,newFindings:a.filter(c=>!n.has(c)),fixedFindings:[...n].filter(c=>!s.has(c))}}import{existsSync as Ye,mkdirSync as Ji,readdirSync as Ze,readFileSync as Qe,writeFileSync as Yi}from"fs";import{createHash as Qi}from"crypto";import{join as L}from"path";var x=L(".scipquery","suppressions");function Xe(e){return L(e,x)}function ve(e){let i=Xe(e);if(!Ye(i))return{suppressions:[],warnings:[]};let t=[],o=[];for(let n of Ze(i).sort()){if(!n.endsWith(".json"))continue;let a=L(i,n),s;try{s=JSON.parse(Qe(a,"utf-8"))}catch{o.push(`${x}/${n}: malformed JSON \u2014 ignored`);continue}if(typeof s!="object"||s===null||Array.isArray(s)){o.push(`${x}/${n}: not a suppression object \u2014 ignored`);continue}let c=s;if(typeof c.reason!="string"||c.reason.trim()===""){o.push(`${x}/${n}: missing reason \u2014 ignored`);continue}if(!c.id&&!c.check){o.push(`${x}/${n}: needs an id or a check \u2014 ignored`);continue}t.push(c)}return{suppressions:t,warnings:o}}var kt=["echo","incomplete-migration","co-change-partner","twin-partner","coverage-contract","doc-reference","unused-params","new-dead","baseline"];function vt(e,i={}){let t=i.base??"HEAD",{minTogether:o=6,minConfidence:n=.6,maxEchoChecks:a=Number.POSITIVE_INFINITY,maxHelpers:s=Number.POSITIVE_INFINITY,minSimilarity:c=.8,includeBaseline:d=!1,scanLimit:r}=i,f=i.semantic!==!1,m=i.historyMode??"bounded",u=new Set(i.skip??[]),h=ee(e,{base:t}),p=X(e,{base:t,plan:h}),y=p.changedFiles,S=new Set(y),l=new Set(h.changedFileLines),w=new Set([...S,...l]),$=M(e.config.projectRoot,t,K(h,y)),C=Ri(e.config.projectRoot,t,h,$),g={base:t,changedFiles:y,changedSymbols:p.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],attributionNotes:p.attributionNotes,rootCauseGroups:[],note:p.summary.note};if(y.length===0)return g;let k=(G,Ee)=>{if(u.has(G)){g.skipped.push({check:G,reason:"skipped via --skip"});return}let Ie=g.findings.length,Ne=g.skipped.length,Be=g.checksRun.length;z(`diff-gate.check.${G}`,Ee,()=>({check:G,changedFiles:y.length,changedSymbols:p.changedSymbols.length,findingsAdded:g.findings.length-Ie,skippedAdded:g.skipped.length-Ne,checksRunAdded:g.checksRun.length-Be}))};return k("echo",()=>oi(e,p.changedSymbols,S,C,a,c,r,f,g)),k("incomplete-migration",()=>di(e,t,h,s,r,f,$,g)),k("co-change-partner",()=>fi(e,w,o,n,m,g)),k("twin-partner",()=>ui(e,p.changedSymbols,S,r,g)),k("coverage-contract",()=>hi(e,w,g)),k("doc-reference",()=>bi(e,S,l,h.changedRanges,h.renamedFiles,g)),k("unused-params",()=>wi(e,y,g)),k("new-dead",()=>Di(e,p.changedSymbols,C,g)),d&&k("baseline",()=>Ai(e,g)),ti(g,[...e.config.suppressions??[],...ve(e.config.projectRoot).suppressions]),g.rootCauseGroups=ii(g.findings),g}function Ft(e){return e.checksRun.length===0&&e.note===Q}function Rt(e){return e.filter(i=>!i.advisory)}function ii(e){let i=new Map;for(let t of e){let o=t.groupKey??`${t.check}:${t.id}`,n=i.get(o);n||(n={groupKey:o,check:t.check,severity:t.severity,actionTier:t.actionTier,sourceAnalyzer:t.sourceAnalyzer,rootCauseKey:t.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:t.message,remediation:t.remediation},i.set(o,n)),n.count+=1,n.findingIds.push(t.id),n.severity=Ge(n.severity,t.severity),n.actionTier=je(n.actionTier,t.actionTier),t.file&&n.files.add(t.file);for(let a of t.relatedFiles??[])n.relatedFiles.add(a)}return[...i.values()].map(t=>({...t,files:[...t.files].sort(),relatedFiles:[...t.relatedFiles].sort()})).sort((t,o)=>o.count-t.count||I(o.severity)-I(t.severity)||t.groupKey.localeCompare(o.groupKey))}function Ge(e,i){return I(i)>I(e)?i:e}function I(e){return e==="error"?2:e==="warning"?1:0}function je(e,i){return e?i&&Fe(i)>Fe(e)?i:e:i}function Fe(e){return e==="direct"?2:e==="signal"?1:0}function ti(e,i){if(i.length===0||e.findings.length===0)return;let t=[];for(let o of e.findings){let n=i.find(a=>ni(a,o));n?e.suppressed.push({finding:o,suppression:n}):t.push(o)}e.findings=t}function ni(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id&&!i.legacySuppressionIds?.includes(e.id)||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function v(e,i){e.findings.push({...i,suppressionHint:`scip-query: ignore ${i.check} ${i.id} -- <reason>`})}function oi(e,i,t,o,n,a,s,c,d){d.checksRun.push("echo");for(let r of i.slice(0,n)){if(!N(r.symbol)||o(r))continue;let f=oe(e,r.symbol,{maxLoc:15,scanLimit:s}).filter(l=>!t.has(l.file)).slice(0,5).map(l=>({otherFile:l.file,otherShort:l.shortName,otherSymbol:l.symbol,similarity:1,similarityBasis:"exact-body",sharedEvidence:[`exact normalized body (${l.loc} LOC)`]}));if(f.length>0){let l=b("echo",r.symbol,r.file),w=b("echo",r.symbol,r.file,...f.map(C=>`${C.otherSymbol}|${C.otherFile}`).sort()),$=f[0];v(d,{id:l,legacySuppressionIds:w===l?void 0:[w],groupKey:l,actionTier:"direct",check:"echo",severity:"warning",evidence:"heuristic",confidence:1,file:r.file,symbol:r.symbol,relatedFiles:[...new Set(f.map(C=>C.otherFile))].sort(),sourceAnalyzer:"duplicate-bodies",rootCauseKey:`${r.symbol}:${$.otherSymbol}`,message:Te(r,f),why:Ae(r,f),remediation:xe("direct",r.shortName,$.otherShort)});continue}let m=me(e,r.symbol,{minSimilarity:a,limit:5,scanLimit:s,semantic:c,sourceCandidateMode:"target-pruned"}),u=[];for(let l of m){let w=l.fileA===r.file?l.fileB:l.fileA,$=l.fileA===r.file?l.shortNameB:l.shortNameA,C=l.fileA===r.file?l.symbolB:l.symbolA;t.has(w)||u.push({otherFile:w,otherShort:$,otherSymbol:C,similarity:l.similarity,similarityBasis:l.similarityBasis??"callees",sharedEvidence:l.sharedCallees})}if(u.length===0)continue;let h=u[0],p=b("echo",r.symbol,r.file,...u.map(l=>`${l.otherSymbol}|${l.otherFile}`).sort()),y=b("echo",r.symbol,r.file),S=ri(r,u);v(d,{id:y,legacySuppressionIds:p===y?void 0:[p],groupKey:y,actionTier:S,check:"echo",severity:"warning",evidence:"heuristic",confidence:h.similarity,file:r.file,symbol:r.symbol,relatedFiles:[...new Set(u.map(l=>l.otherFile))].sort(),message:Te(r,u),why:Ae(r,u),remediation:xe(S,r.shortName,h.otherShort)})}i.length>n&&d.skipped.push({check:"echo",reason:`echo check capped at ${n} of ${i.length} changed symbols`})}function ri(e,i){return i.some(o=>si(e.symbol,o))?"direct":"signal"}function si(e,i){if(i.similarityBasis==="exact-body")return!0;if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let t=R(e),o=R(i.otherSymbol);return!t||!o?!1:t===o?!0:li(i.sharedEvidence)?!1:ai(t,o)}function ai(e,i){let t=Re(e),o=Re(i);if(t.length===0||o.length===0)return!1;let n=new Set(o),a=t.filter(s=>n.has(s)).length;return a>=2&&a/Math.min(t.length,o.length)>=.5}function Re(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var ci=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function li(e){return e.length>=3&&e.every(i=>ci.has(i.toLowerCase()))}function Te(e,i){let t=i[0],o=Math.round(t.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${o}% similar to established ${t.otherShort} (${t.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${o}% similar to ${t.otherShort} (${t.otherFile})`}function Ae(e,i){let t=[`${e.shortName} was changed in this diff.`];for(let o of i.slice(0,3))t.push(`${o.otherShort} is outside this diff and scored ${Math.round(o.similarity*100)}% similar by ${o.similarityBasis} evidence.`),t.push(`Shared evidence: ${o.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&t.push(`${i.length-3} additional similar match(es) grouped into this finding.`),t}function xe(e,i,t){return e==="direct"?`Extract or reuse the shared behavior with ${t}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function di(e,i,t,o,n,a,s,c){let d=Se(e,{base:i,maxHelpers:o,diffPlan:t,scanLimit:n,semantic:a,baseContentAt:s});if(!d.available){c.skipped.push({check:"incomplete-migration",reason:"no git history"});return}c.checksRun.push("incomplete-migration"),d.note&&c.skipped.push({check:"incomplete-migration",reason:d.note});for(let r of d.findings){let f=r.leftovers.map(l=>`${l.shortName} (${l.file}, ${Math.round(l.containment*100)}% helper / ${Math.round(l.siteCoverage*100)}% site, ${l.migrationScope})`).join(", "),m=r.leftovers.map(l=>`${l.shortName}: ${l.migrationScope} (${l.migrationScopeReasons[0]})`).join("; "),u=[...r.migratedFiles,...r.leftovers.map(l=>l.file)],h=r.leftovers.length===0?void 0:Math.max(...r.leftovers.map(l=>Math.min(l.containment,l.siteCoverage))),p=r.leftovers.some(l=>l.migrationScope==="possible-subtype"),y=b("incomplete-migration",r.helperSymbol,r.helperFile,u.join("|")),S=b("incomplete-migration",r.helperSymbol,r.helperFile);v(c,{id:S,legacySuppressionIds:y===S?void 0:[y],check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:h,file:r.helperFile,symbol:r.helperSymbol,relatedFiles:u,message:`new helper ${r.helperShortName} (${r.helperFile}) is wired into ${r.migratedFiles.length} file(s), but ${r.leftovers.length} similar un-migrated site(s) remain: ${f}`,why:[`${r.helperShortName} is new in this diff and already referenced by ${r.migratedFiles.join(", ")}.`,`Helper shape: ${r.helperShape}; ${r.specificHelperCalleeCount}/${r.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${f}.`,`Migration scope hints: ${m}.`],remediation:p?`Migrate same-scope sites to ${r.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${r.helperShortName}, or confirm they are intentionally different.`})}}function fi(e,i,t,o,n,a){let s=V(e,{historyMode:n}).directionalCoChangePairsForFiles(i,{minTogether:t,minConfidence:0,maxFilesPerCommit:20});if(!s){a.skipped.push({check:"co-change-partner",reason:"no git history"});return}a.checksRun.push("co-change-partner");let c=new Set,d;for(let r of s){let f=i.has(r.fileA),m=i.has(r.fileB);if(f===m)continue;let u=f?r.fileA:r.fileB,h=f?r.fileB:r.fileA,p=f?r.changesA:r.changesB,y=p>0?r.together/p:0;if(y<o||B(h)||B(u)||!_(`${e.config.projectRoot}/${h}`))continue;let S=`${u}|${h}`;if(c.has(S))continue;c.add(S);let l=b("co-change-partner",u,h,String(r.together)),w=b("co-change-partner",u,h),$=J(u,h),C=Y({fileA:u,fileB:h,together:r.together,confidence:y,commitScope:r.commitScope,recency:r.recency,subjectContext:r.subjectContext},$,(d??=Z(e))(u,h)),g=[u,h].sort().join("|");a.findings.push({id:w,legacySuppressionIds:l===w?void 0:[l],check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${g}`,confidence:y,file:u,relatedFiles:[h],sourceAnalyzer:"co-change",rootCauseKey:g,partnerClass:$.partnerClass,partnerClassReasons:$.reasons,commitScope:r.commitScope,recency:r.recency,focusedTogether:r.focusedTogether,broadTogether:r.broadTogether,broadCommitRatio:r.broadCommitRatio,lastTogetherAt:r.lastTogetherAt,recentTogether:r.recentTogether,subjectContext:r.subjectContext,...C?{declaredCouplingSuggestion:C}:{},message:`${u} changed, but ${h} did not \u2014 they change together ${r.together}x (${Math.round(y*100)}% of the time)`,why:[`${u} is in this diff and ${h} is not.`,`Git history shows ${r.together} co-change(s), which is ${Math.round(y*100)}% of changes to the edited side.`,`History context: ${gi(r)}.`,`Subject context: ${mi(r.subjectContext)}.`,...pi(r),`Partner class: ${$.partnerClass} (${$.reasons.join("; ")}).`],remediation:C?`Update ${h} alongside this change, declare the coupling "${C.name}", or confirm the coupling no longer holds.`:`Update ${h} alongside this change, or confirm the coupling no longer holds.`})}}function ui(e,i,t,o,n){n.checksRun.push("twin-partner");let a=re(e,{scanLimit:o}).filter(d=>d.relationship==="divergent"||d.relationship==="identical");if(a.length===0)return;let s=new Map;for(let d of a)for(let r of d.members)s.set(r.symbol,d);let c=new Set;for(let d of i){if(!N(d.symbol))continue;let r=s.get(d.symbol);if(!r)continue;let f=r.members.filter(p=>p.symbol!==d.symbol&&!t.has(p.file));if(f.length===0)continue;let m=[d.symbol,...f.map(p=>p.symbol)].sort().join("|");if(c.has(m))continue;c.add(m);let u=f[0],h=b("twin-partner",d.symbol,d.file,u.symbol);v(n,{id:h,groupKey:`twin-partner:${m}`,check:"twin-partner",severity:"warning",evidence:"heuristic",actionTier:"signal",advisory:!0,confidence:r.relationship==="identical"?1:Math.max(0,1-r.maxDivergence),file:d.file,symbol:d.symbol,relatedFiles:f.map(p=>p.file).sort(),sourceAnalyzer:"twin-drift",rootCauseKey:m,message:`${d.shortName} (${d.file}) changed but its same-name twin ${u.shortName} (${u.file}) did not \u2014 verify the change shouldn't apply to both, or consolidate them.`,why:[`${d.symbol} is in this diff.`,`${u.symbol} shares its (near-)name and is classified '${r.relationship}' with it, but ${u.file} is not in this diff.`,r.relationship==="divergent"?`The two bodies already diverge (~${Math.round(r.maxDivergence*100)}% token difference) \u2014 this diff may widen or narrow that drift.`:"The two bodies were byte-identical before this diff.","Advisory: twin-partner never fails the gate by itself \u2014 see the twin-partner entry in the diff-gate checks table."],remediation:`Update ${u.file} alongside this change, consolidate ${d.shortName}/${u.shortName} into one helper, or confirm the twin should diverge on purpose.`})}}function hi(e,i,t){t.checksRun.push("coverage-contract");let o=e.config.coverageContracts??[];for(let n of o){if(!ae(n,i))continue;let a=se(e,n);if(a.status==="ok")continue;let s=b("coverage-contract",n.name,n.file);v(t,{id:s,groupKey:`coverage-contract:${n.name}`,check:"coverage-contract",severity:a.status==="unavailable"?"warning":"error",evidence:"graph-fact",actionTier:"direct",file:n.file,sourceAnalyzer:"coverage-contracts",rootCauseKey:n.name,message:ce(a),why:[`Contract "${n.name}" declares that ${n.file} (${n.keys.type}) must track ${n.mustEqual.type}.`,a.status==="unavailable"?`The declared side could not be evaluated: ${a.unavailableReason}.`:`Missing: ${a.missing.join(", ")||"none"}. Extra: ${a.extra.join(", ")||"none"}.`,"Either side of this contract changed in this diff."],remediation:a.status==="unavailable"?"Investigate why the declared key set could not be parsed (see the reason above) \u2014 do not treat this as a pass.":`Update ${n.file} so its ${n.keys.type==="object-literal-keys"||n.keys.type==="string-array"?n.keys.identifier:n.keys.marker} matches ${n.mustEqual.type}, or fix the ground-truth source if the declared set is right.`})}}function gi(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${yi(e.lastTogetherAt)}`}function mi(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",t=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",o=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(n=>`"${n}"`).join("; "):"none";return`labels ${i}; refs ${t}; samples ${o}; external issue/PR labels ${e.externalIssueLabelStatus}`}function pi(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function yi(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}var P=3;function bi(e,i,t,o,n,a){a.checksRun.push("doc-reference");let s=F.referenceTargets(e,i,o);if(s.size===0)return;let c=new Set(n.map(r=>r.from)),d=[];for(let r of te(e,s))t.has(r.doc)||ie(e,r.doc)||d.push(Ci(e,r,c));for(let r of Si(d))v(a,r)}function Ci(e,i,t){let o=i.citedClaims.length>0?i.citedClaims:F.citationContexts(e,i.doc,i.cited),n=F.classifyCitation(o),a=F.hasLineAnchoredCitation(i.citations),s=i.cited.some(m=>t.has(m)||!_(`${e.config.projectRoot}/${m}`)),c=!(a||s),d=i.cited[0]??"",r=b("doc-reference",i.doc,i.cited.join("|")),f=b("doc-reference",i.doc,d);return{id:f,legacySuppressionIds:r===f?void 0:[r],check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:n.actionTier,groupKey:`doc-reference:${d}`,rootCauseKey:d,confidence:1,file:i.doc,relatedFiles:i.cited,citationKind:n.citationKind,citationKindReasons:n.reasons,citedClaims:o,...c?{advisory:!0}:{},message:`${i.doc} cites ${i.cited.join(", ")} as ${F.citationKindLabel(n.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${i.cited.join(", ")} changed in this diff.`,`${i.doc} cites the changed file(s) but was not updated in the same diff.`,...n.reasons.map(m=>`Citation kind evidence: ${m}`),c?"Advisory: bare file-mention citation (no line anchor, cited file still present under the same path) \u2014 21.2 calibration found this citation shape low-precision; verify at your leisure.":a?"Blocking: citation includes a line anchor that may now point at the wrong lines.":"Blocking: the cited file was deleted or renamed in this diff \u2014 the citation almost certainly needs an update."],remediation:F.citationRemediation(n.citationKind,i.doc)}}function Si(e){let i=new Map;for(let o of e){let n=o.rootCauseKey??"",a=i.get(n);a?a.push(o):i.set(n,[o])}let t=[];for(let[o,n]of i)n.length<=P?t.push(...n):t.push($i(o,n));return t}function $i(e,i){let t=[...i].sort((f,m)=>(f.file??"").localeCompare(m.file??"")),o=t.slice(0,P).map(f=>({doc:f.file??"",citedClaims:f.citedClaims??[]})),n=t.length-o.length,a=t.every(f=>f.advisory===!0),s=t.reduce((f,m)=>Ge(f,m.severity),"info"),c=t.reduce((f,m)=>je(f,m.actionTier),void 0),d=t.map(f=>f.file??"").filter(f=>f.length>0),r=[...new Set(t.flatMap(f=>[f.id,...f.legacySuppressionIds??[]]))];return{id:b("doc-reference","hub-cluster",e),memberFindingIds:r,check:"doc-reference",severity:s,evidence:"change-graph",actionTier:c,groupKey:`doc-reference:${e}`,rootCauseKey:e,confidence:1,file:o[0]?.doc,relatedFiles:[e],citationCount:t.length,citationExemplars:o,suppressedCount:n,...a?{advisory:!0}:{},message:`${e} is cited by ${t.length} doc(s) changed in this diff, doc(s) untouched \u2014 showing ${o.length} example(s), ${n} more damped`,why:[`${e} changed in this diff.`,`${t.length} doc(s) cite it but were not updated in the same diff: ${d.join(", ")}.`,...o.map(f=>`Example \u2014 ${f.doc}: ${f.citedClaims[0]??"(no captured citation text)"}`),`${n} additional doc(s) also cite this file, past the per-hub-file cascade cap (${P}) \u2014 not silently dropped: counted in citationCount/suppressedCount and individually addressable via memberFindingIds.`,a?"Advisory: every citation in this cluster is a bare file-mention (no line anchor, cited file still present).":"Blocking: at least one citation in this cluster is line-anchored or cites a deleted/renamed file."],remediation:`Review the ${o.length} example doc(s) above; ${t.length} total doc(s) cite ${e} the same way \u2014 see citationExemplars and memberFindingIds in --json for the complete list.`}}function wi(e,i,t){t.checksRun.push("unused-params");for(let o of $e(e,{files:i,limit:50})){let n=b("unused-params",o.symbol,o.file,o.unusedTrailing.join("|")),a=b("unused-params",o.symbol,o.file);v(t,{id:a,legacySuppressionIds:n===a?void 0:[n],check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:o.file,startLine:o.startLine,endLine:o.endLine,symbol:o.symbol,message:`${o.shortName} (${o.file}) has trailing unused parameter(s): ${o.unusedTrailing.join(", ")}`,why:[`${o.shortName} is in a changed file.`,`The trailing parameter(s) ${o.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function Di(e,i,t,o){o.checksRun.push("new-dead");let n=new W(e),a=H(e.config.projectRoot),s=a.length>1;for(let c of i){if(t(c)||c.fanIn>0||n.fileKind(c.file)==="test"||T(e,c.file)||A(e,c.symbol,c.file)||Fi(c.symbol))continue;let d=b("new-dead",c.symbol,c.file),r=s&&ki(a,c.file)&&vi(e,c.symbol);v(o,{id:d,check:"new-dead",severity:"warning",evidence:r?"heuristic":"graph-fact",confidence:r?.4:.9,file:c.file,symbol:c.symbol,message:r?`${c.shortName} (${c.file}) unconfirmed (cross-package ambiguous-name resolution gap): zero indexed consumers found, but this name is ambiguous project-wide and lives in a workspace package \u2014 verify manually before treating as dead`:`${c.shortName} (${c.file}) was changed but has zero indexed consumers`,why:r?[`${c.shortName} is a changed production symbol in a workspace package.`,"The index, semantic, and source-fallback layers all report zero consumers for this symbol.","Its leaf name is ambiguous project-wide (a same-named definition exists elsewhere), and cross-package consumers reached only through a re-exporting barrel are a known unresolvable shape for this tool \u2014 see docs/plans/2026-07-02-followups.md item 2."]:[`${c.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:r?"Verify with a direct code search before deleting; this tool cannot confidently resolve this symbol.":"Wire it up, or remove it before it becomes permanent dead code."})}}function ki(e,i){return e.some(t=>i===t.relativeDir||i.startsWith(`${t.relativeDir}/`))}function vi(e,i){let t=R(i);return t?(q(e).get(t)?.length??0)>1:!1}function Fi(e){if(U(e)!=="type")return!1;let i=R(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function Ri(e,i,t,o){let n=new Map(t.renamedFiles.map(s=>[s.to,s.from])),a=o??M(e,i,K(t));return s=>{let c=n.get(s.file)??s.file,d=R(s.symbol);if(!d)return!1;let r=a(c);return r!==null&&Ti(r,d)}}function Ti(e,i){return new RegExp(`\\b${O(i)}\\b`).test(e)}function Ai(e,i){if(!_(E(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=ke(e);for(let o of t.newFindings){let n=we(o),a=b("baseline",o);v(i,{id:a,groupKey:`baseline:${n.sourceAnalyzer}:${n.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:n.actionTier,confidence:1,file:n.file,relatedFiles:n.relatedFiles.length>0?n.relatedFiles:void 0,sourceAnalyzer:n.sourceAnalyzer,rootCauseKey:n.rootCauseKey,message:`new ${n.label} vs committed baseline: ${o}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${n.sourceAnalyzer}.`,`Inherited action tier: ${n.actionTier}.`,`Root cause key: ${n.rootCauseKey}.`,...n.why],remediation:n.remediation})}}function b(e,...i){return`SQ${ei("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{De as a,qi as b,ke as c,kt as d,vt as e,Ft as f,Rt as g,Ri as h};
|
|
3
|
-
//# sourceMappingURL=chunk-OUXPJ4H5.js.map
|
package/dist/chunk-OWXNDSG3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as D}from"./chunk-J7IMQRCU.js";import{f as m,g as p}from"./chunk-O5A7BTMA.js";import{a as L}from"./chunk-UWR52GNZ.js";import{b as v}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-L2RE5P3X.js";import{a as C}from"./chunk-BGBBVSH4.js";import{a as y}from"./chunk-2GX3TNOW.js";import{b}from"./chunk-6JSTKSZH.js";import{d as f,s as g}from"./chunk-7XP7ZRSI.js";import{c as u,f as h}from"./chunk-JLZUM476.js";var A=/^(?:validate|verify|check|assert)(?:[A-Z].*)?$/,N=/^(?:is|has)(?:[A-Z].*)?$/,S=/[{,]\s*(?:ok|success|valid|isValid)\s*:\s*false\b/,d=/\breturn\b/g,k=/\bfunction\b|=>|\)\s*(?::\s*[^{;=]+)?\s*\{/,I=/\.(?:addIssue|push)\s*\(/;function Y(e,t={}){let{scope:n,limit:i=30,scanLimit:l}=t,a=new E(e),r=v(a.productionCallableDefinitions({scope:n,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),s=[];for(let o of r){let c=w(e,o);c&&s.push({symbol:o.symbol,shortName:f(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:C(o),...c})}return s.sort((o,c)=>o.file.localeCompare(c.file)||o.startLine-c.startLine||o.loc-c.loc),i?s.slice(0,i):s}function _(e){return A.test(e)?"imperative":N.test(e)?"predicate":null}function w(e,t){let n=_(t.leaf);if(!n||L(e,t))return null;let i=m(e,t);if(!i||!k.test(i))return null;let l=h(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine);if(n==="predicate"&&l?.paramCount===0)return null;if(D(i)){let r=K(e,t);return!r||T(r.body,R(r.snippet))||x(r.body)?null:{nameKind:n,resolvedVia:"one-hop-delegate",delegateTarget:r.shortName}}let a=p(i);return T(a,R(i))||x(a)?null:{nameKind:n,resolvedVia:"direct"}}var P=new Set(["if","for","while","switch","catch","function"]);function x(e){let t=u(e);for(let n of t.matchAll(/\b([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g))if(!P.has(n[1]))return!0;return!1}function R(e){let t=e.indexOf("=>");return t===-1?!1:!/^\s*\{/.test(e.slice(t+2))}function T(e,t){let n=u(e);if(/\bthrow\b/.test(n)||/\.reject\s*\(/.test(n)||S.test(n)||I.test(n))return!0;let i=F(n);if(t&&i.length===0){let l=n.trim();return l!==""&&l!=="true"}for(let l of i)if(l!==""&&l!=="true")return!0;return!1}function F(e){let t=[];d.lastIndex=0;let n;for(;n=d.exec(e);){let i=n.index+n[0].length,l=0,a=e.length;for(let r=i;r<e.length;r+=1){let s=e[r];if(s==="("||s==="["||s==="{")l+=1;else if(s===")"||s==="]"||s==="}"){if(l===0){a=r;break}l-=1}else if(s===";"&&l===0){a=r;break}}t.push(e.slice(i,a).trim()),d.lastIndex=a}return t}function K(e,t){let n=y(e,t,{callableOnly:!0,limit:3}),i=[...new Set(n.map(o=>o.symbol))].filter(o=>o!==t.symbol);if(i.length!==1)return null;let a=b(e,i[0]).match;if(!a)return null;let r=g(e,a.relativePath).find(o=>o.symbolId===a.symbolId);if(!r)return null;let s=m(e,r);return s?{body:p(s),snippet:s,shortName:f(r.symbol)}:null}export{Y as a};
|
|
2
|
-
//# sourceMappingURL=chunk-OWXNDSG3.js.map
|
package/dist/chunk-Q4UM4JJP.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-L2RE5P3X.js";import{a as h}from"./chunk-2GX3TNOW.js";import{m as S}from"./chunk-OM6JHEW3.js";import{a as d,c as b}from"./chunk-6JSTKSZH.js";import{d as m,z as y}from"./chunk-7XP7ZRSI.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{v as a};
|
|
2
|
-
//# sourceMappingURL=chunk-Q4UM4JJP.js.map
|
package/dist/chunk-QEIGJJBC.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{p as C}from"./chunk-JLZUM476.js";import{a as _}from"./chunk-64MNV6AB.js";import{c as F,g as S,i as I,s as f,w as D,x as P}from"./chunk-M2TRDR25.js";var N=D({kind:"file-dependency-graph",invalidation:P("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:R}),O=F("file-dep-graph",{clearGroups:["whole-project"]});function K(e,r,o={}){let t=o.scipEdges??"all-references";return O.get(e,`${t}:${r??""}`,()=>{let s=new Set(_(e,{includeIgnored:!1})),i=I(e),a=b(r,t),d=0,l=0,m=null,h=!1,c=0,y=0;return f("file-dep-graph.product",()=>{if(i){let n=N.read(e,a,i);if(n){h=!0;let u=w(n);return d=n.sourceFileCount,l=n.sourceEdgeCount,c=n.scipEdgeCount,y=u.size,m=n.sourceImportFingerprint,u}}let p=f("file-dep-graph.source-imports",()=>{let n=A(e,s,r);return d=n.files.length,l=n.edges.length,m=n.fingerprint,n},()=>({scope:r??null,files:d,edges:l})),g=new Map,E=(n,u)=>M(e,g,s,n,u);f("file-dep-graph.scip-edges",()=>{for(let n of J(e,r,t))c+=1,E(n.from_file,n.to_file)},()=>({scope:r??null,edges:c}));for(let n of p.edges)E(n.fromFile,n.toFile);return y=g.size,i&&N.write(e,a,i,{sourceImportFingerprint:p.fingerprint,sourceFileCount:p.files.length,sourceEdgeCount:p.edges.length,scipEdgeCount:c,graph:v(g)}),g},()=>({scope:r??null,available:i!==null,hit:h,files:d,sourceEdges:l,scipEdges:c,graphFiles:y,sourceImportFingerprint:m}))})}function A(e,r,o){let t=[],s=[];for(let i of r)if(!(o&&!i.includes(o))){t.push(i);for(let a of C(e,i))a.sourcePath&&s.push({fromFile:i,toFile:a.sourcePath})}return{files:t,edges:s,fingerprint:G(t,s)}}function G(e,r){let o=r.map(t=>`${t.fromFile}\0${t.toFile}`).sort();return S(JSON.stringify({files:e,edges:o}))}function b(e,r){return`edge-mode-v2:${r}:${e??"<all>"}`}function v(e){return[...e].map(([r,o])=>[r,[...o]])}function w(e){return new Map(e.graph.map(([r,o])=>[r,new Set(o)]))}function R(e){let r=JSON.parse(e);return $(r)?r:null}function $(e){if(!e||typeof e!="object")return!1;let r=e;return typeof r.sourceImportFingerprint=="string"&&typeof r.sourceFileCount=="number"&&typeof r.sourceEdgeCount=="number"&&typeof r.scipEdgeCount=="number"&&Array.isArray(r.graph)&&r.graph.every(k)}function k(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(r=>typeof r=="string")}function J(e,r,o){let t=r?"AND d1.relative_path LIKE ?":"",s=r?[`%${r}%`]:[],i=o==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
|
|
2
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
${i}
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${t}`,...s)}function M(e,r,o,t,s){if(t===s||e.isIgnored(t)||e.isIgnored(s)||!o.has(s))return;let i=r.get(t);i||(i=new Set,r.set(t,i)),i.add(s)}export{K as a};
|
|
20
|
-
//# sourceMappingURL=chunk-QEIGJJBC.js.map
|
package/dist/chunk-R4VPIS4D.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{d as D}from"./chunk-2GX3TNOW.js";import{a as M,c as N}from"./chunk-6JSTKSZH.js";import{d as b,f as g,s as I,z as S}from"./chunk-7XP7ZRSI.js";import{B as p}from"./chunk-TLTLJ4SW.js";function E(o,n,l={}){let{maxDepth:u=5,scope:m}=l,r=M(o,n);if(!r)return[];let a=[],d=new Set([r.symbolId]),c=new Set,i=[r];for(let e=1;e<=u&&i.length!==0;e++){let t=[],f=D(o,i,{limit:500});for(let y of i)for(let s of R(o,y,m,f.get(y.symbolId)??[])){let h=`${s.file}|${s.shortName}`;if(s.symbolId!==null){if(d.has(s.symbolId))continue;d.add(s.symbolId)}else if(c.has(h))continue;c.add(h),a.push({symbol:s.symbol,shortName:s.shortName,file:s.file,depth:e}),s.symbolId!==null&&s.symbolMatch&&t.push(s.symbolMatch)}i=t}return a.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),a}function R(o,n,l,u){let m=u.filter(e=>!o.isIgnored(e.file)).filter(e=>!l||e.file.includes(l)),r=new Set(m.map(e=>e.file)),a=[];for(let e of w(o,n,l)){if(r.has(e))continue;let t=I(o,e),f=t.length>0?S(t,t[0].startLine):null;a.push({symbol:f?.symbol??e,file:e})}let d=[...m,...a],c=[],i=new Set;for(let e of d){let t=N(o,e.symbol);if(!t){let y=`${e.file}|${e.symbol}`;if(i.has(y))continue;i.add(y),c.push({symbolId:null,symbol:e.symbol,shortName:b(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===n.symbolId||o.isIgnored(t.relativePath)||!A(t))continue;let f=`${t.symbolId}|${t.relativePath}`;i.has(f)||(i.add(f),c.push({symbolId:t.symbolId,symbol:t.symbol,shortName:b(t.symbol),file:t.relativePath,symbolMatch:t}))}return c}function w(o,n,l){let u=l?"AND consumer_d.relative_path LIKE ?":"",m=[n.symbolId,n.documentId];return l&&m.push(`%${l}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
AND c.document_id != ?
|
|
8
|
-
${o.pathExclusionsFor("consumer_d")}
|
|
9
|
-
${u}`,...m).map(r=>r.relative_path).filter(r=>!o.isIgnored(r)))}function A(o){if(o.symbol.startsWith("scip-clojure ")||p(o.relativePath)==="clojure")return!0;let n=g(o.symbol);return n==="method"||n==="type"||o.symbol.endsWith("().")}export{E as a};
|
|
10
|
-
//# sourceMappingURL=chunk-R4VPIS4D.js.map
|
package/dist/chunk-RDX6WWHN.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{m as f}from"./chunk-OM6JHEW3.js";import{a as d}from"./chunk-6JSTKSZH.js";import{d as s,h as u,p as m,q as g}from"./chunk-7XP7ZRSI.js";import{y as c}from"./chunk-M2TRDR25.js";function E(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:y(a,t?.display_name??null,n.symbol),source:S(e,n.relativePath,n.startLine,n.endLine)}],b=f(e,n,{semantic:i.semantic}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:b}}function S(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
|
|
2
|
-
`).slice(i,n+1).join(`
|
|
3
|
-
`).trimEnd();return o.length>0?o:null}function y(e,r,i){let n=m(e);if(n&&!p(n))return n;let t=(r??"").trim();return t?u(i)&&!t.endsWith("()")?`${t}()`:t:s(i)}function p(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{E as a};
|
|
4
|
-
//# sourceMappingURL=chunk-RDX6WWHN.js.map
|
package/dist/chunk-RUQE7DZT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as k}from"./chunk-QEIGJJBC.js";function $(r,t={}){let{limit:a=10,scope:l,minDepth:m=3}=t,p=k(r,l),w=new Map,h=[],g=new Map,d=new Map,S=new Set,y=[],u=0;for(let e of p.keys()){if(g.has(e))continue;let s=[],o=(p.get(e)??new Set).values();for(g.set(e,u),d.set(e,u),u+=1,y.push(e),S.add(e),s.push({node:e,iter:o,pendingChild:null});s.length>0;){let n=s[s.length-1];if(n.pendingChild!==null){let f=n.pendingChild;n.pendingChild=null,d.set(n.node,Math.min(d.get(n.node),d.get(f)))}let c=n.iter.next();if(c.done){if(d.get(n.node)===g.get(n.node)){let f=[];for(;;){let C=y.pop();if(S.delete(C),f.push(C),w.set(C,h.length),C===n.node)break}h.push(f)}s.pop();continue}let i=c.value;if(g.has(i))S.has(i)&&d.set(n.node,Math.min(d.get(n.node),g.get(i)));else{g.set(i,u),d.set(i,u),u+=1,y.push(i),S.add(i);let f=(p.get(i)??new Set).values();n.pendingChild=i,s.push({node:i,iter:f,pendingChild:null})}}}let b=new Map;for(let e=0;e<h.length;e++)b.set(e,new Set);for(let[e,s]of p){let o=w.get(e);for(let n of s){let c=w.get(n);c!==o&&b.get(o).add(c)}}let I=new Array(h.length),R=new Array(h.length);for(let e=0;e<h.length;e++){let s=[],o=0;for(let n of b.get(e)){let c=R[n];c>o&&(o=c,s=I[n])}I[e]=[e,...s],R[e]=1+o}function x(e){return I[e]}let M=h.map(e=>[...e].sort()),v=new Set,D=[];for(let e=0;e<h.length;e++){let o=x(e).map(i=>M[i]),n=o.map(i=>i[0]);if(o.length<m)continue;let c=n.join(" ");v.has(c)||(v.add(c),D.push(T(n,o)))}return D.sort((e,s)=>s.depth-e.depth),F(D).slice(0,a)}function T(r,t){let a=t.reduce((m,p)=>m+p.length,0),l=t.filter(m=>m.length>1).length;return{chain:r,components:t,depth:t.length,fileCount:a,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${t.length} condensed dependency component(s) form the representative transitive path`,`${a} file(s) are represented; ${l} component(s) contain a dependency cycle`,"cycles count once toward depth and retain their full membership separately"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(r){let t=[];for(let a of r)t.some(l=>L(a.chain,l.chain))||t.push(a);return t}function L(r,t){if(r.length>=t.length)return!1;let a=t.length-r.length;for(let l=0;l<r.length;l++)if(r[l]!==t[a+l])return!1;return!0}export{$ as a};
|
|
2
|
-
//# sourceMappingURL=chunk-RUQE7DZT.js.map
|
package/dist/chunk-S43DIBME.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-L2RE5P3X.js";import{b as D}from"./chunk-5CJ6AQN7.js";import{h as v}from"./chunk-PZV2PGBR.js";import{p as y}from"./chunk-JLZUM476.js";import{a as b}from"./chunk-64MNV6AB.js";import p from"path";var w={analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),domain:new Set([]),instrumentation:new Set([]),"language-parsers":new Set(["core","domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["core","domain","language-parsers","queries","reindex","resolution","semantic","source","storage","symbols","tla"]),semantic:new Set(["core","domain","language-parsers","reindex","resolution","runtime","source","storage","symbols"]),source:new Set(["core","domain","resolution","storage"]),storage:new Set(["analysis","domain","queries","source"]),symbols:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage"]),tla:new Set(["core","domain","queries","source","storage","symbols"])};function f(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length<=1?"(root)":t.length>=3&&["src","lib","app","server","client"].includes(t[0])?`${t[0]}/${t[1]}`:t[0]}function h(e,n){if(e===n)return"ok";let t=g(e),i=g(n);return t&&i?!m(t)||!m(i)?null:P(t,i)?"ok":"violation":E(e,n)}function k(e,n){let t=g(f(e)),i=g(f(n));return!!t&&!!i&&m(t)&&m(i)}function R(e,n){let t=g(e),i=g(n);return!!t&&!!i&&(!m(t)||!m(i))}function g(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function P(e,n){return n==="instrumentation"||n==="domain"?!0:e==="domain"?!1:w[e]?.has(n)??!1}function m(e){return Object.hasOwn(w,e)}function E(e,n){if(n==="shared")return"ok";let t={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return t[e]?t[e].has(n)?"ok":"violation":null}function re(e,n){let{scope:t,minDeviation:i=5,limit:r=50}=n??{},a=n?.semantic!==!1,c=n?.includePatternDeviations===!0,s=new S(e).fileDependencyGraph(t),l=F([...I(e,s,{scope:t,semantic:a}),...M(s),...c?N(s,i):[]]);return r<=0||l.results.length<=r?l:{...l,results:l.results.slice(0,r),totalResults:l.results.length}}function I(e,n,t){let i=T(e,t.scope),r=[],a=new Set;for(let[o,s]of n){if(d(o))continue;let l=i.get(o)??new Set;for(let u of s)d(u)||l.has(u)||_(e,o,u,t)||(r.push({file:o,dep:u}),a.add(o))}a.size>0&&B(e,i,{paths:[...a]});let c=[];for(let{file:o,dep:s}of r)(i.get(o)??new Set).has(s)||c.push({file:o,kind:"unused-import",description:`Depends on ${s} but references none of its symbols`,dep:s,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${o} to ${s}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return c}function _(e,n,t,i){return J(e,n,t)||z(e,n,t)||V(t)||W(e,n,t)||K(t)?!0:i.semantic&&C(e,n,t)}function M(e){let n=[],t=U(e);for(let[i,r]of e){if(d(i))continue;let a=f(i);for(let c of r){if(d(c))continue;let o=f(c);if(a===o)continue;let s=h(a,o),l=s===null&&R(a,o),u=s?"explicit":l?"unknown-layer":"inferred";if((l?"violation":s??t.get(`${a}->${o}`))==="violation"){let $=u==="explicit"?"direct":"signal";n.push({file:i,kind:"layer-violation",description:`Imports from ${o}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${a}/ should not depend on ${o}/`,actionTier:$,policyBasis:u,evidenceReasons:[`dependency edge exists from ${i} to ${c}`,O(u,a,o)],recommendation:u==="explicit"?"Move the dependency behind an allowed layer boundary or document a policy change.":u==="unknown-layer"?"Add a layer policy entry before treating this as a boundary violation.":"Review whether this is a real boundary break or an intentional exception before moving code."})}}}return n}function O(e,n,t){return e==="explicit"?`explicit layer policy rejects ${n}/ -> ${t}/`:e==="unknown-layer"?`source layer policy has no entry for ${n}/ -> ${t}/`:`rare cross-layer edge ${n}/ -> ${t}/ is inferred as a violation`}function N(e,n){let t=[];for(let[i,r]of A(e)){let a=r.filter(o=>!d(o));if(a.length<n)continue;let c=L(e,a);for(let o of a)for(let s of e.get(o)??[])d(s)||(c.get(s)??0)===1&&p.dirname(s)!==i&&p.dirname(s)!==p.dirname(i)&&(k(o,s)||t.push({file:o,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${s}`,dep:s,actionTier:"signal",evidenceReasons:[`${a.length} sibling file(s) in ${i}/ were compared`,`${o} is the only non-skipped sibling depending on ${s}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."}))}return t}function F(e){return{results:e,unusedImports:e.filter(n=>n.kind==="unused-import").length,layerViolations:e.filter(n=>n.kind==="layer-violation").length,patternDeviations:e.filter(n=>n.kind==="pattern-deviation").length}}function A(e){let n=new Map;for(let t of e.keys()){let i=p.dirname(t),r=n.get(i);r||(r=[],n.set(i,r)),r.push(t)}return n}function L(e,n){let t=new Map;for(let i of n)for(let r of e.get(i)??[])d(r)||t.set(r,(t.get(r)??0)+1);return t}function T(e,n){let t=new Map;return j(e,t,n),t}function j(e,n,t){for(let i of q(e,t))x(e,n,i.from_file,i.to_file)}function q(e,n){let t=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[];return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
5
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
JOIN (
|
|
7
|
-
SELECT m2.symbol_id, c2.document_id
|
|
8
|
-
FROM mentions m2
|
|
9
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
-
WHERE m2.role = 1
|
|
11
|
-
GROUP BY m2.symbol_id
|
|
12
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
13
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
14
|
-
WHERE d1.id != d2.id
|
|
15
|
-
AND m.role != 1
|
|
16
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
17
|
-
${t}`,...i)}function B(e,n,t={}){new S(e).scanSourceReferences({paths:t.paths??b(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},r=>{r.target.relativePath!==r.sourceFile&&(e.isIgnored(r.target.relativePath)||x(e,n,r.sourceFile,r.target.relativePath))})}function x(e,n,t,i){if(e.isIgnored(t)||e.isIgnored(i))return;let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(i)}function U(e){let n=new Map;for(let[i,r]of e){if(d(i))continue;let a=f(i);for(let c of r){if(d(c))continue;let o=f(c);if(a===o||h(a,o))continue;let s=`${a}->${o}`;n.set(s,(n.get(s)??0)+1)}}let t=new Map;for(let[i,r]of n)t.set(i,r<=2?"violation":"ok");return t}function V(e){return e.includes("types")||e.endsWith(".d.ts")}function C(e,n,t){let i=v(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.isUsed)}function J(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.used)}function z(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function K(e){return e.endsWith(".vue")}function W(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function d(e){let n=D(e);return!!(n==="entry"||n==="barrel"||n==="test"||n==="worker"||H(p.basename(e)))}function H(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{re as a};
|
|
18
|
-
//# sourceMappingURL=chunk-S43DIBME.js.map
|