scip-query 0.19.1 → 0.19.4
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 +25 -0
- package/README.md +18 -2
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-FHLYJVXF.js → chunk-25LPM4DG.js} +2 -2
- package/dist/chunk-2CTX5CMX.js +4 -0
- package/dist/chunk-2Y373BDD.js +2 -0
- package/dist/{chunk-24ET4VLC.js → chunk-2YU7I3QO.js} +2 -2
- package/dist/{chunk-63P42UR6.js → chunk-3MJ5YA4Y.js} +2 -2
- package/dist/{chunk-ZNK6K3LB.js → chunk-3SVWW4PN.js} +2 -2
- package/dist/{chunk-WWCZCH7W.js → chunk-4333ETTV.js} +2 -2
- package/dist/{chunk-Q2WEWIKX.js → chunk-4RSI5EMG.js} +2 -2
- package/dist/{chunk-CIYUFF24.js → chunk-4SALD7RU.js} +2 -2
- package/dist/{chunk-DCDOGW32.js → chunk-4T3LTWUS.js} +2 -2
- package/dist/{chunk-34MLC6UI.js → chunk-4XTA5OMB.js} +2 -2
- package/dist/chunk-52ZYCAEO.js +2 -0
- package/dist/{chunk-SJ6XSCG7.js → chunk-54HA4ZXH.js} +2 -2
- package/dist/{chunk-J4MYRIYT.js → chunk-64RFXJT5.js} +2 -2
- package/dist/{chunk-FUFNRZFJ.js → chunk-6E7UTQY7.js} +2 -2
- package/dist/{chunk-PNESKY2Z.js → chunk-6NSFJYRC.js} +2 -2
- package/dist/{chunk-AOSFSYEA.js → chunk-7B3UPBVA.js} +2 -2
- package/dist/{chunk-XCPE3G75.js → chunk-7GXM52MI.js} +2 -2
- package/dist/{chunk-6O5JOS7T.js → chunk-A2EZV2UM.js} +2 -2
- package/dist/{chunk-4BU54UJG.js → chunk-ABMYA4TN.js} +2 -2
- package/dist/{chunk-64QITTX7.js → chunk-B5NLK2B3.js} +2 -2
- package/dist/{chunk-OLG2YPLS.js → chunk-BTEE5NZQ.js} +2 -2
- package/dist/{chunk-MP43RX4O.js → chunk-C7NIYIQ4.js} +1 -1
- package/dist/{chunk-AEM24WSF.js → chunk-CFMXJPHH.js} +2 -2
- package/dist/{chunk-JJZRS2OP.js → chunk-CNKAGUPL.js} +2 -2
- package/dist/{chunk-MQ2B33LQ.js → chunk-D4U5Q3FT.js} +2 -2
- package/dist/{chunk-YZXV3CU3.js → chunk-DGAGY7RJ.js} +1 -1
- package/dist/{chunk-FRXB74RQ.js → chunk-DLWR3NUU.js} +5 -5
- package/dist/{chunk-YGQBJUS6.js → chunk-DZ74OMG6.js} +2 -2
- package/dist/{chunk-APLNTJPJ.js → chunk-EOOJGLDU.js} +2 -2
- package/dist/{chunk-TYEGFDOP.js → chunk-F6O7AAC3.js} +2 -2
- package/dist/{chunk-HFBNIIZX.js → chunk-FECYOO5O.js} +2 -2
- package/dist/{chunk-V7J4A3AH.js → chunk-FWUUZTIO.js} +2 -2
- package/dist/{chunk-KMOMNTB4.js → chunk-GBQ5NYPR.js} +2 -2
- package/dist/{chunk-JBZXJXIS.js → chunk-GPBBJ5Y4.js} +2 -2
- package/dist/{chunk-OOUJBAKJ.js → chunk-H7UKLTWJ.js} +2 -2
- package/dist/{chunk-YILKXTIY.js → chunk-HEXVUYFQ.js} +2 -2
- package/dist/{chunk-J5XJWCB3.js → chunk-HKEHS2AS.js} +2 -2
- package/dist/{chunk-5TEUKVSM.js → chunk-I5AWSI2G.js} +2 -2
- package/dist/{chunk-XYBNOILR.js → chunk-I5RJM53C.js} +2 -2
- package/dist/{chunk-WCZAABYF.js → chunk-IG7N5ZIK.js} +2 -2
- package/dist/{chunk-C3KCSAQ4.js → chunk-IUFDSKGG.js} +2 -2
- package/dist/{chunk-OQ6TCHBB.js → chunk-IZKFSVBV.js} +2 -2
- package/dist/{chunk-5OZCNAVM.js → chunk-J77UIT3I.js} +2 -2
- package/dist/{chunk-B2WQKQKP.js → chunk-K2ERX4UT.js} +2 -2
- package/dist/{chunk-PYMZU5EG.js → chunk-KP6XRY5Z.js} +2 -2
- package/dist/{chunk-FC5K7T35.js → chunk-L7SPDE73.js} +1 -1
- package/dist/{chunk-DZXFZAZO.js → chunk-LBMJEAEW.js} +2 -2
- package/dist/chunk-LHMNRHGV.js +3 -0
- package/dist/{chunk-CKFMZE77.js → chunk-M7AIS73L.js} +2 -2
- package/dist/{chunk-53SUJOJA.js → chunk-M7MTH5NR.js} +2 -2
- package/dist/{chunk-6PKO2TNZ.js → chunk-MITTUCEH.js} +2 -2
- package/dist/chunk-MSWVMDAH.js +122 -0
- package/dist/chunk-NH5ALKPW.js +2 -0
- package/dist/{chunk-3WLRW5TC.js → chunk-NPKYOIFM.js} +3 -3
- package/dist/{chunk-GIHVWNKQ.js → chunk-NRCXJDHL.js} +2 -2
- package/dist/{chunk-5GOBZI34.js → chunk-NSS46APD.js} +2 -2
- package/dist/{chunk-HCS5LB6U.js → chunk-NZL2DBT7.js} +2 -2
- package/dist/{chunk-SYGAA54M.js → chunk-OMPZHGHO.js} +2 -2
- package/dist/{chunk-AGTATREV.js → chunk-P2PC2WGR.js} +2 -2
- package/dist/{chunk-CAKPEQZB.js → chunk-Q3AFUTGB.js} +2 -2
- package/dist/{chunk-ZJGZCBYT.js → chunk-Q4IIEGXJ.js} +2 -2
- package/dist/chunk-QDV6RDCP.js +4 -0
- package/dist/{chunk-FTRNGQGR.js → chunk-QGXBRIM5.js} +2 -2
- package/dist/{chunk-WXVGNFAO.js → chunk-QOKYJ33H.js} +1 -1
- package/dist/{chunk-FB6IKAKZ.js → chunk-QRGV2F7L.js} +2 -2
- package/dist/chunk-QVWS2VWZ.js +7 -0
- package/dist/{chunk-DFQNE73Y.js → chunk-R4FQGQ4X.js} +2 -2
- package/dist/{chunk-4CZJ4YJB.js → chunk-RV2FQIX3.js} +2 -2
- package/dist/{chunk-4FMT4HPC.js → chunk-S44IULR6.js} +2 -2
- package/dist/{chunk-LQUDSHLB.js → chunk-SOAT6NLA.js} +2 -2
- package/dist/{chunk-QHKXGMOI.js → chunk-STOL2BTL.js} +2 -2
- package/dist/chunk-SVLTAG5O.js +927 -0
- package/dist/{chunk-2WCXKANA.js → chunk-U6WNH5GC.js} +2 -2
- package/dist/chunk-U7DSEKOM.js +30 -0
- package/dist/{chunk-KMUFGAIK.js → chunk-UKZBVX4U.js} +2 -2
- package/dist/chunk-UOAV44HR.js +38 -0
- package/dist/chunk-V27BEQJN.js +7 -0
- package/dist/{chunk-VIKEPD4D.js → chunk-VGRICIQI.js} +2 -2
- package/dist/chunk-VMNZB6WI.js +4 -0
- package/dist/{chunk-LF5CIKWZ.js → chunk-VTKGCT3V.js} +5 -5
- package/dist/{chunk-WFRET75Z.js → chunk-VXQNNXJE.js} +2 -2
- package/dist/{chunk-V5WBVF6K.js → chunk-WER3B7MI.js} +2 -2
- package/dist/{chunk-SSXEYWN3.js → chunk-WQTAC523.js} +2 -2
- package/dist/{chunk-GAE7WCBK.js → chunk-X6D5IC6I.js} +2 -2
- package/dist/{chunk-FBUNGRKI.js → chunk-XLTP42QA.js} +2 -2
- package/dist/chunk-XTX6QHOF.js +4 -0
- package/dist/{chunk-AYRHVJXW.js → chunk-XYADIZHU.js} +5 -5
- package/dist/{chunk-WAU7HVDI.js → chunk-YGAGTIDK.js} +2 -2
- package/dist/{chunk-BMTBVMA3.js → chunk-YIJ7ZAA4.js} +3 -3
- package/dist/{chunk-BBBKPOIT.js → chunk-YNRNA5LK.js} +2 -2
- package/dist/{chunk-BCMOTIB6.js → chunk-YVVCVR2L.js} +2 -2
- package/dist/{chunk-RPEA7P5Z.js → chunk-ZAIILQNP.js} +3 -3
- package/dist/{chunk-7SGOWD2Y.js → chunk-ZGZUZ7XE.js} +2 -2
- package/dist/{chunk-YCSTKIYU.js → chunk-ZXJYMGD3.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/{command-descriptors-3EJHQLQZ.js → command-descriptors-MFU4BCJ7.js} +174 -167
- package/dist/{config-types-BA3xLCfG.d.ts → config-types-D20KuvvZ.d.ts} +67 -0
- package/dist/{db-CzA-9_rL.d.ts → db-G_II8yXU.d.ts} +1 -1
- package/dist/diff-gate-types-C9BoYwYD.d.ts +10 -0
- package/dist/direct-navigation-MRMQFIRB.js +3 -0
- package/dist/{health-DYy13GAe.d.ts → health-oblXYgkF.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +86 -4
- package/dist/queries/architecture.js +1 -1
- 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 +3 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +4 -8
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +3 -3
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- 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 +3 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +21 -5
- 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 +3 -3
- package/dist/reindex.js +38 -38
- package/dist/runtime.d.ts +9 -4
- package/dist/runtime.js +2 -2
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-1bVKJgXi.d.ts → scip-cli-kRpaexVJ.d.ts} +1 -1
- package/dist/watch-server.js +5 -5
- package/docs/AI_FAILURE_MODES.md +1 -1
- package/docs/COMMAND_REFERENCE.md +1 -1
- package/docs/DETECTOR_GUIDE.md +1 -1
- package/docs/analyzer-inventory.md +1 -1
- package/docs/analyzer-validation-ledger.md +131 -1
- package/docs/architecture-coherence-vision.md +29 -0
- package/package.json +2 -2
- package/dist/chunk-2NA6TYP4.js +0 -120
- package/dist/chunk-5W2VAEVR.js +0 -4
- package/dist/chunk-7TJJY2C3.js +0 -2
- package/dist/chunk-DO775SYA.js +0 -2
- package/dist/chunk-DRH3AD7W.js +0 -4
- package/dist/chunk-E3KWOHH7.js +0 -5
- package/dist/chunk-EMIIOOTM.js +0 -38
- package/dist/chunk-ESNRT7QN.js +0 -927
- package/dist/chunk-IOOCKVUA.js +0 -6
- package/dist/chunk-KC2IFAAU.js +0 -3
- package/dist/chunk-NTOBQK5H.js +0 -4
- package/dist/chunk-UJKZQLDB.js +0 -2
- package/dist/chunk-US44MEVU.js +0 -29
- package/dist/chunk-XZXUMGAA.js +0 -7
- package/dist/diff-gate-types-CG2YQ_ei.d.ts +0 -4
- package/dist/direct-navigation-C2A44KFT.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as y}from"./chunk-MITTUCEH.js";import{a as F}from"./chunk-25LPM4DG.js";import{a as B}from"./chunk-HEXVUYFQ.js";import{a as j}from"./chunk-4RSI5EMG.js";import{a as z}from"./chunk-F6O7AAC3.js";import{a as $}from"./chunk-I5AWSI2G.js";import{a as v,b as G}from"./chunk-BTEE5NZQ.js";import{a as O}from"./chunk-WER3B7MI.js";import{b as k}from"./chunk-QRGV2F7L.js";import{a as T}from"./chunk-GBQ5NYPR.js";import{a as E}from"./chunk-3MJ5YA4Y.js";import{a as I}from"./chunk-YIJ7ZAA4.js";import{a as H}from"./chunk-4T3LTWUS.js";import{s as A}from"./chunk-L7SPDE73.js";function ne(n,e,o={}){let i=o.impactDepth??3,r=o.sliceDepth??3,c=o.semantic,a=!N(e),u=a?l("trace",e,()=>j(n,e,{semantic:c}),t=>({definitions:t.definitions.length,references:t.referencedBy.length})):{definitions:[],referencedBy:[]},s=a?l("call-graph",e,()=>H(n,e,{semantic:c}),t=>({callers:t?.callers.length??0,callees:t?.callees.length??0})):null,d=a?l("complexity",e,()=>E(n,e,{semantic:c}),t=>({callees:t?.calleeCount??0})):null,g=a?l("dataflow",e,()=>$(n,e,{semantic:c}),t=>({references:t?.usageSites.length??0,producers:t?.producers.length??0,consumers:t?.consumers.length??0})):null,C=a?l("backward-slice",e,()=>y(n,e,{direction:"backward",maxDepth:r,semantic:c}),t=>({maxDepth:r,connectedSymbols:t?.connectedSymbols.length??0})):null,x=a?l("forward-slice",e,()=>y(n,e,{direction:"forward",maxDepth:r,semantic:c}),t=>({maxDepth:r,connectedSymbols:t?.connectedSymbols.length??0})):null,R=a?l("affected",e,()=>I(n,e,{maxDepth:i,scope:o.scope}),t=>({maxDepth:i,affectedSymbols:t.length})):[],h=l("change-surface",e,()=>O(n,e,{semantic:c}),t=>({symbols:t?.symbols.length??0,externalConsumers:t?.totalExternalConsumers??0})),p=l("system",e,()=>B(n,e),t=>({files:t.files.length,symbols:t.symbols.length})),m=p.files.length===1,b=l("deps",e,()=>m?p.dependsOn.map(t=>({relativePath:t})):v(n,e),t=>({files:t.length,reusedSystem:m})),S=l("rdeps",e,()=>m?p.dependedOnBy.map(t=>({relativePath:t})):G(n,e),t=>({files:t.length,reusedSystem:m})),w=l("surface",e,()=>F(n,e),t=>({consumers:t.length})),f={symbol:u.definitions.length>0||u.referencedBy.length>0||s!==null||d!==null||g!==null||C!==null||x!==null||R.length>0,file:h!==null||b.length>0||S.length>0,module:p.files.length>0||p.symbols.length>0||w.length>0},D=[];!f.symbol&&!f.file&&!f.module&&D.push("No symbol, file, or module matched target.");let P=h?.file??u.definitions[0]?.relativePath??null;return{target:e,matched:f,history:l("history",P??e,()=>L(n,P,o.gitHead)),trace:u,callGraph:s,complexity:d,dataflow:g,backwardSlice:C,forwardSlice:x,affected:R,changeSurface:h,deps:b,rdeps:S,system:p,surface:w,warnings:D}}function l(n,e,o,i=()=>({})){let r;return A(`plan-context.${n}`,()=>(r=o(),r),()=>({target:e,...i(r)}))}function L(n,e,o){let i={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return i;let r=T(n,o?{head:o}:{}),c=l("history.churn",e,()=>r.fileChurn(),s=>({files:s?.size??0}));if(!c)return i;let a=l("history.co-change",e,()=>k(n,e,{limit:5,...o?{head:o}:{}}),s=>({commits:s.commitsAnalyzed,partners:s.findings.length})),u=l("history.suppressions",e,()=>z(n).byFile.get(e)??0,s=>({suppressions:s}));return{available:!0,file:e,churn:c.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:a.findings.map(s=>({file:s.fileA===e?s.fileB:s.fileA,together:s.together,confidence:s.confidence,subjectContext:s.subjectContext})),suppressionsInFile:u}}function N(n){return n.includes("/")||n.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(n)}export{ne as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NZL2DBT7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as se}from"./chunk-C3KCSAQ4.js";import{a as ce}from"./chunk-YGQBJUS6.js";import{a as ne}from"./chunk-OQ6TCHBB.js";import{a as ae}from"./chunk-TYEGFDOP.js";import{a as re}from"./chunk-AEM24WSF.js";import{a as ie}from"./chunk-4FMT4HPC.js";import{a as oe}from"./chunk-PNESKY2Z.js";import{b as W,e as m}from"./chunk-24ET4VLC.js";import{a as te}from"./chunk-XZXUMGAA.js";import{a as Z}from"./chunk-5W2VAEVR.js";import{a as ee}from"./chunk-C2QSK7E7.js";import{a as Q}from"./chunk-7SGOWD2Y.js";import{a as X}from"./chunk-OOUJBAKJ.js";import{a as Y}from"./chunk-GIHVWNKQ.js";import{a as K}from"./chunk-YCSTKIYU.js";import{a as U}from"./chunk-5GOBZI34.js";import{b as G}from"./chunk-53SUJOJA.js";import{a as j}from"./chunk-WWCZCH7W.js";import{a as A,b as q}from"./chunk-B2WQKQKP.js";import{b as N}from"./chunk-FB6IKAKZ.js";import{a as z}from"./chunk-KMOMNTB4.js";import{a as ue}from"./chunk-NTOBQK5H.js";import{f as J}from"./chunk-JJZRS2OP.js";import{f as k,g as M}from"./chunk-CAKPEQZB.js";import{n as I}from"./chunk-FC5K7T35.js";function de(e,r){let t=new Map;for(let o of e){let n=t.get(o.check)??[];n.push(o),t.set(o.check,n)}let i=[];for(let[o,n]of t){let c=n.filter(d=>d.outcome==="resolved").length,s=n.filter(d=>d.outcome==="suppressed").length,l=n.filter(d=>d.outcome==="still-open").length,h=n.length,C=n.filter(d=>d.outcome==="still-open").sort((d,b)=>d.firstSeen-b.firstSeen)[0];i.push({check:o,seen:h,resolved:c,suppressed:s,stillOpen:l,resolutionRate:h>0?c/h:0,suppressionRate:h>0?s/h:0,oldestOpenAgeDays:C?Math.floor((r-C.firstSeen)/Oe):null})}return i.sort((o,n)=>o.check.localeCompare(n.check))}var Oe=864e5;function le(e){return I(e).map(r=>({check:r.check,findingId:r.findingId,firstSeen:r.firstSeen,lastSeen:r.lastSeen,timesShown:r.timesShown,outcome:r.outcome}))}function f(e){return e.scoreCount??e.count}function B(e){let r=ze(e),{breakdown:t,pressure:i}=Ne(e),o=me(t,"risk"),n=me(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:f(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:f(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:f(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:Ve(e),validation:Ie(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0,detectorPrecision:[]}}function Ve(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:_e(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function _e(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:g(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Ie(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,n=0,c=0;for(let[C,d]of Object.entries(r))i.has(C)?o+=d.fixChanges:(n+=d.fixChanges,c+=1);let s=i.size>0?g(o/i.size):0,l=c>0?g(n/c):0,h={};for(let[C,d]of Object.entries(t)){let b=new Set(d);if(b.size===0)continue;let S=0;for(let D of b)S+=r[D]?.fixChanges??0;let y=g(S/b.size);h[C]={flaggedFiles:b.size,fixDensity:y,lift:l>0?g(y/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?g(s/l):null,byCategory:h,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function g(e){return Math.round(e*100)/100}function he(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function L(e,r="existing shared infrastructure discount"){let t=f(e);return Math.abs(t-e.count)<.01?"":` (${he(t)} score-weighted after ${r})`}function w(e,r){let t=f(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${he(t)} score-weighted)`}function ze(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${L(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${L(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${L(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&o.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query diff-gate\` or \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+L({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,n)=>{let c=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-c}),r}var pe={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function me(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Ne(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(p,H,v)=>{H>0&&i.push({axis:p,points:H,detail:v,kind:pe[p]??"hygiene"})},c=(p,H,v,Ae,Be,Te,Fe)=>{let x=Math.max(Ae,1);if(v<=x)return;let P=v/x,E=Math.min(Be,Math.ceil(Math.log2(P)*Te));if(E<=0)return;let $e=pe[p]??"hygiene";o.push({axis:p,category:H,kind:$e,count:v,threshold:g(x),ratio:g(P),extraPenalty:E}),n(p,E,`${v} ${Fe} exceed pressure threshold ${g(x)} (${g(P)}x)`)},s=e.dead.count/t;n("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;n("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let h=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(h)),`${e.similarCount} similar function pair(s)`);let C=e.duplicateBodies.count/t*1e3;n("duplicate-bodies",Math.min(10,Math.round(C*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let d=e.twinDrift.count/t*1e3;n("twin-drift",Math.min(10,Math.round(d*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let S=f(e.reactHookCandidates),y=S/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(y)),w(e.reactHookCandidates,"duplicated React behavior pair(s)"));let D=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(D/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Pe=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(Pe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let O=f(e.vueComposableCandidates),Ee=O/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(Ee)),w(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let ke=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(ke/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let V=f(e.wrappers);n("wrappers",Math.min(3,V),w(e.wrappers,"wrapper candidate(s)"));let _=f(e.passthroughs);n("passthroughs",Math.min(3,_),w(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Me=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(Me*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(p/10)),w({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:p},"co-changing pair(s) without a structural link"))}if(c("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),c("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;c("hidden-coupling-pressure","Hidden coupling",p,50,10,4,"score-weighted co-changing pair(s)")}return c("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),c("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),c("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),c("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),c("react-hook-candidates-pressure","Duplicated React hook behavior",S,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),c("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),c("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),c("vue-composable-candidates-pressure","Duplicated Vue behavior",O,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),c("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),c("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),c("wrappers-pressure","Wrapper functions",V,50,4,2,"wrapper candidate(s)"),c("passthroughs-pressure","Passthrough functions",_,50,4,2,"passthrough candidate(s)"),c("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),c("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as je}from"v8";var Ge=64*1024*1024;function T(){let e=globalThis.gc;if(!e)return;let r=je();r.heap_size_limit-r.used_heap_size<Ge||e()}var We=50,Ue=25e3,qe=2500,ge=2500,fe=50,Ye=10,Ke=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],ve={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Je(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:Ze(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:et(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:tt(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:it(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:ot(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:nt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:ct(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:st(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:at(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:ut(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:dt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:rt(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:lt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:pt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:mt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:Ct(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:bt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:ht(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:gt(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:ft(e,t)})};function dr(e,r={}){return Se(e,r.full!==!1,(t,i)=>{let o=Qe(e,r.scope,t,i),n=B(o);return n.detectorPrecision=de(le(e),Date.now()),n})}function lr(e,r,t={}){return Xe(e,[r],t)[0]}function Xe(e,r,t={}){return Se(e,t.full!==!1,(i,o)=>{let n={...o,releaseCachesBetweenPhases:!1};return r.map(c=>ve[c](e,t.scope,n,i))})}function Se(e,r,t){let i=ee(e),o=vt(i,r);try{return t(i,o)}finally{A(e,{semanticProvider:!0}),T()}}function pr(e){return B(we(e))}function we(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Ce(e,"git-evidence")?.gitEvidence??null,suppressions:Ce(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Ce(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Qe(e,r,t,i){return we(Ke.map(o=>ve[o](e,r,i,t)))}function Je(e,r,t){return a(e,t,"dead",()=>{let i=q(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return R(yt(e,i.symbols))})}function Ze(e,r,t){return a(e,t,"isolated",()=>{let i=X(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return R(Ht(e,i))})}function et(e,r,t){return a(e,t,"cycles",()=>U(e,{scope:r}).filter(o=>o.kind==="real").length)}function tt(e,r,t){let i=a(e,t,"similar",()=>J(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function rt(e,r,t){return a(e,t,"extract-candidates",()=>K(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function it(e,r,t){return a(e,t,"duplicate-bodies",()=>{let i=j(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=new Set,n=0;for(let c of i)for(let s of c.functions.slice(1))o.add(s.file),n+=s.loc;return{count:i.length,loc:n,files:[...o]}})}function ot(e,r,t){return a(e,t,"twin-drift",()=>{let i=G(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(c=>c.relationship==="divergent"||c.relationship==="identical"),o=new Set,n=0;for(let c of i)for(let s of c.members)o.add(s.file),n+=s.loc;return{count:i.length,loc:n,files:[...o].sort()}})}function nt(e,r,t){return a(e,t,"react-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function ct(e,r,t){return a(e,t,"react-hook-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return He(i,Lt)})}function st(e,r,t){return a(e,t,"react-large-component-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return xt(i)})}function at(e,r,t){return a(e,t,"vue-component-duplicates",()=>{let i=ne(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function ut(e,r,t){return a(e,t,"vue-composable-candidates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return He(i,Rt)})}function dt(e,r,t){return a(e,t,"vue-large-view-pressure",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function lt(e,r,t){return a(e,t,"wrapper-candidates",()=>{let i=te(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return ye(i,Dt)})}function pt(e,r,t){return a(e,t,"passthrough-candidates",()=>{let i=Q(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return ye(i,Pt)})}function mt(e,r,t){return a(e,t,"stale-abstractions",()=>{let i=Z(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,c)=>n+c.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function ht(e,r){return a(e,r,"git-evidence",()=>{let t=z(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let o=t.commitHistory(),n=N(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),c={};for(let[s,l]of i)c[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:n.findings.length,scoreCount:$(n.findings.reduce((s,l)=>s+be(l),0)),top:n.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:be(s),subjectContext:s.subjectContext}))},fileStats:c,commitsScanned:o?.commits.length??0}})}function gt(e,r){return a(e,r,"suppressions",()=>{let t=ae(e);return{total:t.total,byCategory:{...t.byCategory}}})}function ft(e,r){return a(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],o=W(e,t).filter(n=>n.status!=="ok");return{count:o.length,loc:0,files:[...new Set(o.map(n=>n.file))].sort()}})}function Ct(e,r,t){return a(e,t,"drift",()=>{let i=Y(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),o=i.results.filter(s=>s.kind!=="pattern-deviation"),n=o.filter(s=>s.actionTier==="direct").length,c=o.length-n;return{count:o.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:n,signal:c}})}function bt(e,r,t){return a(e,t,"complexity-hotspots",()=>{let i=ue(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>We).length}})}function vt(e,r){let t=e.symbols>=Ue||e.documents>=qe,i=r?Number.POSITIVE_INFINITY:fe,o=r?Number.POSITIVE_INFINITY:Ye;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ge,candidateResultLimit:i,complexityResultLimit:o,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ge} symbols and reported their top ${fe} findings. Enable full mode for unbounded candidate counts.`]}}function St(e,r){r.releaseCachesBetweenPhases&&(A(e),T())}function a(e,r,t,i){wt(t);try{return i()}finally{St(e,r)}}function wt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function yt(e,r){return r.filter(t=>!k(e,t.relativePath)&&!M(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ht(e,r){return r.filter(t=>!k(e,t.relativePath)&&!M(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function ye(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function xt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function F(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function He(e,r){return{...F(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function Lt(e){let r=e.sharedHooks.length>0,t=xe({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Le(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Rt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=xe({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Le(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function xe(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!De.has(Re(r))).length+Math.min(e.functions.length,3)}function Le(e,r,t){let i=[...e,...r,...t].map(Re);return i.length>0&&i.every(o=>De.has(o))}function Re(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Dt(e){return e.actionTier==="signal"?.25:1}function Pt(e){return e.actionTier==="signal"?.25:1}function be(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var De=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Ke as a,dr as b,lr as c,Xe as d,pr as e};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as se}from"./chunk-IUFDSKGG.js";import{a as ce}from"./chunk-DZ74OMG6.js";import{a as ne}from"./chunk-IZKFSVBV.js";import{a as ae}from"./chunk-F6O7AAC3.js";import{a as re}from"./chunk-CFMXJPHH.js";import{a as ie}from"./chunk-S44IULR6.js";import{a as oe}from"./chunk-6NSFJYRC.js";import{b as W,e as m}from"./chunk-2YU7I3QO.js";import{a as te}from"./chunk-QVWS2VWZ.js";import{a as Z}from"./chunk-QDV6RDCP.js";import{a as ee}from"./chunk-C2QSK7E7.js";import{a as Q}from"./chunk-ZGZUZ7XE.js";import{a as X}from"./chunk-H7UKLTWJ.js";import{a as Y}from"./chunk-NRCXJDHL.js";import{a as K}from"./chunk-ZXJYMGD3.js";import{a as U}from"./chunk-NSS46APD.js";import{b as G}from"./chunk-M7MTH5NR.js";import{a as j}from"./chunk-4333ETTV.js";import{a as A,b as q}from"./chunk-K2ERX4UT.js";import{b as N}from"./chunk-QRGV2F7L.js";import{a as z}from"./chunk-GBQ5NYPR.js";import{a as ue}from"./chunk-XTX6QHOF.js";import{f as J}from"./chunk-CNKAGUPL.js";import{f as k,g as M}from"./chunk-Q3AFUTGB.js";import{n as I}from"./chunk-L7SPDE73.js";function de(e,r){let t=new Map;for(let o of e){let n=t.get(o.check)??[];n.push(o),t.set(o.check,n)}let i=[];for(let[o,n]of t){let c=n.filter(d=>d.outcome==="resolved").length,s=n.filter(d=>d.outcome==="suppressed").length,l=n.filter(d=>d.outcome==="still-open").length,h=n.length,C=n.filter(d=>d.outcome==="still-open").sort((d,b)=>d.firstSeen-b.firstSeen)[0];i.push({check:o,seen:h,resolved:c,suppressed:s,stillOpen:l,resolutionRate:h>0?c/h:0,suppressionRate:h>0?s/h:0,oldestOpenAgeDays:C?Math.floor((r-C.firstSeen)/Oe):null})}return i.sort((o,n)=>o.check.localeCompare(n.check))}var Oe=864e5;function le(e){return I(e).map(r=>({check:r.check,findingId:r.findingId,firstSeen:r.firstSeen,lastSeen:r.lastSeen,timesShown:r.timesShown,outcome:r.outcome}))}function f(e){return e.scoreCount??e.count}function B(e){let r=ze(e),{breakdown:t,pressure:i}=Ne(e),o=me(t,"risk"),n=me(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:f(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:f(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:f(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:Ve(e),validation:Ie(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0,detectorPrecision:[]}}function Ve(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:_e(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function _e(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:g(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Ie(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,n=0,c=0;for(let[C,d]of Object.entries(r))i.has(C)?o+=d.fixChanges:(n+=d.fixChanges,c+=1);let s=i.size>0?g(o/i.size):0,l=c>0?g(n/c):0,h={};for(let[C,d]of Object.entries(t)){let b=new Set(d);if(b.size===0)continue;let S=0;for(let D of b)S+=r[D]?.fixChanges??0;let y=g(S/b.size);h[C]={flaggedFiles:b.size,fixDensity:y,lift:l>0?g(y/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?g(s/l):null,byCategory:h,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function g(e){return Math.round(e*100)/100}function he(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function L(e,r="existing shared infrastructure discount"){let t=f(e);return Math.abs(t-e.count)<.01?"":` (${he(t)} score-weighted after ${r})`}function w(e,r){let t=f(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${he(t)} score-weighted)`}function ze(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} indexed symbols with no visible repository references \u2014 review runtime/framework roots and the capability disclosure, then verify any deletion with cleanup-plan --verify`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} indexed dependency cycle(s) \u2014 inspect ownership and runtime order before choosing whether or how to break them`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs share disclosed call or source-token evidence beyond imports \u2014 review domain identity before considering consolidation`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 determine whether they represent the same concept before acting`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${L(e.reactHookCandidates)} \u2014 review whether a common hook would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 review whether local product intent justifies reuse`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${L(e.vueComposableCandidates)} \u2014 review whether a common composable would preserve ownership and lifecycle semantics`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${L(e.wrappers,"boundary-evidence discount")} \u2014 inspect whether each is indirection or an intentional API, framework, or ownership boundary`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that literally forward to one callee \u2014 inspect whether each is unnecessary indirection or an intentional boundary`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 review public, runtime-registration, and ownership evidence before removing, moving, or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.architectureViolations>0&&o.push(`${e.drift.architectureViolations} declared architecture violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 repair direct dependency-rule breaks; inspect boundary signals with \`drift --architecture\``,effort:e.drift.architectureViolations>0?"medium":"low",impact:e.drift.architectureViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query diff-gate\` or \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+L({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 inspect whether a shared concept, generated artifact, or coordinated contract explains the history",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,n)=>{let c=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-c}),r}var pe={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function me(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Ne(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(p,H,v)=>{H>0&&i.push({axis:p,points:H,detail:v,kind:pe[p]??"hygiene"})},c=(p,H,v,Ae,Be,Te,Fe)=>{let x=Math.max(Ae,1);if(v<=x)return;let P=v/x,E=Math.min(Be,Math.ceil(Math.log2(P)*Te));if(E<=0)return;let $e=pe[p]??"hygiene";o.push({axis:p,category:H,kind:$e,count:v,threshold:g(x),ratio:g(P),extraPenalty:E}),n(p,E,`${v} ${Fe} exceed pressure threshold ${g(x)} (${g(P)}x)`)},s=e.dead.count/t;n("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;n("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let h=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(h)),`${e.similarCount} similar function pair(s)`);let C=e.duplicateBodies.count/t*1e3;n("duplicate-bodies",Math.min(10,Math.round(C*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let d=e.twinDrift.count/t*1e3;n("twin-drift",Math.min(10,Math.round(d*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let S=f(e.reactHookCandidates),y=S/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(y)),w(e.reactHookCandidates,"duplicated React behavior pair(s)"));let D=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(D/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Pe=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(Pe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let O=f(e.vueComposableCandidates),Ee=O/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(Ee)),w(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let ke=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(ke/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let V=f(e.wrappers);n("wrappers",Math.min(3,V),w(e.wrappers,"wrapper candidate(s)"));let _=f(e.passthroughs);n("passthroughs",Math.min(3,_),w(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Me=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(Me*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(p/10)),w({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:p},"co-changing pair(s) without a structural link"))}if(c("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),c("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;c("hidden-coupling-pressure","Hidden coupling",p,50,10,4,"score-weighted co-changing pair(s)")}return c("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),c("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),c("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),c("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),c("react-hook-candidates-pressure","Duplicated React hook behavior",S,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),c("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),c("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),c("vue-composable-candidates-pressure","Duplicated Vue behavior",O,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),c("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),c("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),c("wrappers-pressure","Wrapper functions",V,50,4,2,"wrapper candidate(s)"),c("passthroughs-pressure","Passthrough functions",_,50,4,2,"passthrough candidate(s)"),c("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),c("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as je}from"v8";var Ge=64*1024*1024;function T(){let e=globalThis.gc;if(!e)return;let r=je();r.heap_size_limit-r.used_heap_size<Ge||e()}var We=50,Ue=25e3,qe=2500,ge=2500,fe=50,Ye=10,Ke=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],ve={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Je(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:Ze(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:et(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:tt(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:it(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:ot(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:nt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:ct(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:st(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:at(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:ut(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:dt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:rt(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:lt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:pt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:mt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:Ct(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:bt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:ht(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:gt(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:ft(e,t)})};function dr(e,r={}){return Se(e,r.full!==!1,(t,i)=>{let o=Qe(e,r.scope,t,i),n=B(o);return n.detectorPrecision=de(le(e),Date.now()),n})}function lr(e,r,t={}){return Xe(e,[r],t)[0]}function Xe(e,r,t={}){return Se(e,t.full!==!1,(i,o)=>{let n={...o,releaseCachesBetweenPhases:!1};return r.map(c=>ve[c](e,t.scope,n,i))})}function Se(e,r,t){let i=ee(e),o=vt(i,r);try{return t(i,o)}finally{A(e,{semanticProvider:!0}),T()}}function pr(e){return B(we(e))}function we(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Ce(e,"git-evidence")?.gitEvidence??null,suppressions:Ce(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Ce(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Qe(e,r,t,i){return we(Ke.map(o=>ve[o](e,r,i,t)))}function Je(e,r,t){return a(e,t,"dead",()=>{let i=q(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit,semantic:t.semantic});return R(yt(e,i.symbols))})}function Ze(e,r,t){return a(e,t,"isolated",()=>{let i=X(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit,semantic:t.semantic});return R(Ht(e,i))})}function et(e,r,t){return a(e,t,"cycles",()=>U(e,{scope:r}).filter(o=>o.kind==="real").length)}function tt(e,r,t){let i=a(e,t,"similar",()=>J(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit,semantic:t.semantic}));return Math.min(i,t.candidateResultLimit)}function rt(e,r,t){return a(e,t,"extract-candidates",()=>K(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}).length)}function it(e,r,t){return a(e,t,"duplicate-bodies",()=>{let i=j(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=new Set,n=0;for(let c of i)for(let s of c.functions.slice(1))o.add(s.file),n+=s.loc;return{count:i.length,loc:n,files:[...o]}})}function ot(e,r,t){return a(e,t,"twin-drift",()=>{let i=G(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(c=>c.relationship==="divergent"||c.relationship==="identical"),o=new Set,n=0;for(let c of i)for(let s of c.members)o.add(s.file),n+=s.loc;return{count:i.length,loc:n,files:[...o].sort()}})}function nt(e,r,t){return a(e,t,"react-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function ct(e,r,t){return a(e,t,"react-hook-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return He(i,Lt)})}function st(e,r,t){return a(e,t,"react-large-component-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return xt(i)})}function at(e,r,t){return a(e,t,"vue-component-duplicates",()=>{let i=ne(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function ut(e,r,t){return a(e,t,"vue-composable-candidates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return He(i,Rt)})}function dt(e,r,t){return a(e,t,"vue-large-view-pressure",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function lt(e,r,t){return a(e,t,"wrapper-candidates",()=>{let i=te(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return ye(i,Dt)})}function pt(e,r,t){return a(e,t,"passthrough-candidates",()=>{let i=Q(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return ye(i,Pt)})}function mt(e,r,t){return a(e,t,"stale-abstractions",()=>{let i=Z(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,c)=>n+c.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function ht(e,r){return a(e,r,"git-evidence",()=>{let t=z(e,{historyMode:r.gitHistoryMode}),i=t.fileChurn();if(!i)return null;let o=t.commitHistory(),n=N(e,void 0,{limit:r.candidateResultLimit,historyMode:r.gitHistoryMode}),c={};for(let[s,l]of i)c[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:n.findings.length,scoreCount:$(n.findings.reduce((s,l)=>s+be(l),0)),top:n.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:be(s),subjectContext:s.subjectContext}))},fileStats:c,commitsScanned:o?.commits.length??0}})}function gt(e,r){return a(e,r,"suppressions",()=>{let t=ae(e);return{total:t.total,byCategory:{...t.byCategory}}})}function ft(e,r){return a(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],o=W(e,t).filter(n=>n.status!=="ok");return{count:o.length,loc:0,files:[...new Set(o.map(n=>n.file))].sort()}})}function Ct(e,r,t){return a(e,t,"drift",()=>{let i=Y(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY,semantic:t.semantic}),o=i.results.filter(s=>s.kind!=="pattern-deviation"),n=o.filter(s=>s.actionTier==="direct").length,c=o.length-n;return{count:o.length,unusedImports:i.unusedImports,architectureViolations:i.architectureViolations,layerViolations:i.layerViolations,direct:n,signal:c}})}function bt(e,r,t){return a(e,t,"complexity-hotspots",()=>{let i=ue(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:t.semantic});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>We).length}})}function vt(e,r){let t=e.symbols>=Ue||e.documents>=qe,i=r?Number.POSITIVE_INFINITY:fe,o=r?Number.POSITIVE_INFINITY:Ye;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,semantic:!0,gitHistoryMode:r?"full":"bounded",releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ge,candidateResultLimit:i,complexityResultLimit:o,semantic:!1,gitHistoryMode:"bounded",releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ge} symbols and reported their top ${fe} findings. Enable full mode for unbounded candidate counts.`]}}function St(e,r){r.releaseCachesBetweenPhases&&(A(e),T())}function a(e,r,t,i){wt(t);try{return i()}finally{St(e,r)}}function wt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function yt(e,r){return r.filter(t=>!k(e,t.relativePath)&&!M(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ht(e,r){return r.filter(t=>!k(e,t.relativePath)&&!M(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function ye(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function xt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function F(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function He(e,r){return{...F(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function Lt(e){let r=e.sharedHooks.length>0,t=xe({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:Le(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Rt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=xe({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:Le(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function xe(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!De.has(Re(r))).length+Math.min(e.functions.length,3)}function Le(e,r,t){let i=[...e,...r,...t].map(Re);return i.length>0&&i.every(o=>De.has(o))}function Re(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Dt(e){return e.actionTier==="signal"?.25:1}function Pt(e){return e.actionTier==="signal"?.25:1}function be(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var De=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Ke as a,dr as b,lr as c,Xe as d,pr as e};
|
|
2
|
+
//# sourceMappingURL=chunk-OMPZHGHO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{l as I}from"./chunk-U7DSEKOM.js";import{a as y,e as g}from"./chunk-XYADIZHU.js";import{B as v}from"./chunk-YGAGTIDK.js";import{c as b,h as D,i as _,q as F,s as p,v as E,x}from"./chunk-L7SPDE73.js";import{spawnSync as O}from"child_process";import{createHash as U}from"crypto";import{existsSync as k}from"fs";import{dirname as L,join as T}from"path";import{fileURLToPath as j}from"url";var N=b("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]}),M=E({kind:"consumer-file-usage",invalidation:x("consumer-file-usage"),serialize:Q,deserialize:W});function Le(e,n){return{forDefinitions(r,i){return V(e,n,r,i)}}}function Me(e){let n=new Map;for(let[r,i]of e)n.set(r,new Set(i.files.map(t=>t.file)));return n}function Re(e,n,r){return w(e,n,r).partition}function V(e,n,r,i){let t=h(r.length),s=F()?_(e):null,a=s?B(r,i,s):void 0,o=a?{workIdentity:a,workOutcome:"computed"}:{};return p("consumer-evidence.product",()=>{let l=p("consumer-evidence.provenance",()=>z(e,n,r,i),()=>({...o,definitions:r.length,semantic:i.semantic,sourceFallback:i.sourceFallback!==!1})),u=new Map;t={...t,...l.counters};let c=Y(r,l.sources);return p("consumer-evidence.classify",()=>{let f=q(e,r,l.sources,c);for(let d of r){let m=f.get(d.symbolId)??H();t.realFiles+=m.partition.realConsumers.length,t.reexportOnlyFiles+=m.partition.barrelConsumers,t.importOnlyFiles+=m.partition.importOnlyConsumers,u.set(d.symbolId,{definition:d,files:m.files,...m.partition})}},()=>({...o,...c,realFiles:t.realFiles,reexportOnlyFiles:t.reexportOnlyFiles,importOnlyFiles:t.importOnlyFiles})),u},()=>({...o,...t}))}function B(e,n,r){let i=U("sha256").update("consumer-evidence-v1\0").update(r).update("\0").update(n.semantic?"semantic\0":"indexed\0").update(n.sourceFallback===!1?"no-source-fallback":"source-fallback");for(let t of e.map(s=>s.symbol).sort())i.update("\0").update(t);return i.digest("hex").slice(0,24)}function h(e){return{definitions:e,indexedFiles:0,semanticFiles:0,fallbackFiles:0,totalFiles:0,realFiles:0,reexportOnlyFiles:0,importOnlyFiles:0}}function z(e,n,r,i){let t=h(r.length),s=new Map;return S(s,t,"indexed",n.crossFileCallerMap(r,{semantic:!1})),i.semantic&&S(s,t,"semantic",I(e,r)),i.sourceFallback!==!1&&S(s,t,"source-fallback",n.sourceFallbackCallerFiles(r)),t.totalFiles=[...s.values()].reduce((a,o)=>a+o.size,0),{sources:s,counters:t}}function Y(e,n){return{definitions:e.length,consumerFiles:[...n.values()].reduce((r,i)=>r+i.size,0),nativeAttempted:!1,nativeUsed:!1,nativeReason:"not-attempted"}}function S(e,n,r,i){let t=0;for(let[s,a]of i){let o=e.get(s);o||(o=new Map,e.set(s,o));for(let l of a){t++;let u=o.get(l)??new Set;u.add(r),o.set(l,u)}}r==="indexed"?n.indexedFiles+=t:r==="semantic"?n.semanticFiles+=t:n.fallbackFiles+=t}function q(e,n,r,i){let t=re(e,n,r,i);return t||$(e,n,r)}function $(e,n,r){let i=new Map;for(let t of n){let s=r.get(t.symbolId)??new Map;i.set(t.symbolId,w(e,t,[...s.keys()],s))}return i}function w(e,n,r,i=new Map){let t=[],s=0,a=0,o=g(n.symbol),l=[];for(let u of r){let c;X(e,u,n.relativePath,o)?(s++,c="reexport-only"):J(e,u,o)?(a++,c="import-only"):(t.push(u),c="real"),l.push({file:u,sources:[...i.get(u)??[]],classification:c})}return{partition:{realConsumers:t,barrelConsumers:s,importOnlyConsumers:a},files:l}}function H(){return{partition:{realConsumers:[],barrelConsumers:0,importOnlyConsumers:0},files:[]}}function J(e,n,r){if(!r)return!1;let i=v(n);if(!i)return!1;let t=N.get(e,n,()=>A(e,n,i));return t.importedLeaves.has(r)&&!t.usedLeaves.has(r)}function A(e,n,r){let i=y(e).forFile(n,{text:!0,ast:!0}),t=i.text;if(!t)return G();let s=D(e,n,t),a=M.read(e,n,s);if(a)return a;let o=K(i.ast,r);return M.write(e,n,s,o),o}function K(e,n){let r=new Set,i=new Set;if(!e)return{importedLeaves:r,usedLeaves:i};let t=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),s=(a,o)=>{let l=o||t.has(a.type);(a.type==="identifier"||a.type==="type_identifier"||a.type==="property_identifier"||a.type==="field_identifier")&&(l?r.add(a.text):i.add(a.text));for(let u of a.children)s(u,l)};return s(e.rootNode,!1),{importedLeaves:r,usedLeaves:i}}function G(){return{importedLeaves:new Set,usedLeaves:new Set}}function Q(e){return JSON.stringify({importedLeaves:[...e.importedLeaves],usedLeaves:[...e.usedLeaves]})}function W(e){try{let n=JSON.parse(e);return!Array.isArray(n.importedLeaves)||!Array.isArray(n.usedLeaves)?null:{importedLeaves:new Set(n.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(n.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function X(e,n,r,i){if(!i)return!1;let t=y(e).forFile(n,{lines:!0,reexports:!0}),s=t.lines??[];if(s.length===0)return!1;let a=t.reexports??[];return P(s,a,i)}function P(e,n,r){if(e.length===0||n.length===0)return!1;let i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`\\b${i}\\b`),s=0;for(let a=0;a<e.length;a++){if(!t.test(e[a]??""))continue;if(s++,!n.find(l=>l.startLine<=a&&a<=l.endLine))return!1}return s>0}var Z="SCIP_QUERY_NATIVE_CONSUMER_CLASSIFY",ee="SCIP_QUERY_NATIVE_KERNELS_BIN",ne="SCIP_QUERY_NATIVE_CONSUMER_CLASSIFY_MIN_FILES",R=1e3,ie=5e3,te=64*1024*1024,C;function re(e,n,r,i){let t=process.env[Z]?.toLowerCase();if(t!=="1"&&t!=="true")return i.nativeReason=t==="0"||t==="false"?"disabled":"opt-in-required",null;if(i.consumerFiles<fe())return i.nativeReason="below-threshold",null;let s=me();if(!s)return i.nativeReason="binary-missing",null;i.nativeAttempted=!0;let a=se(e,n,r),o=O(s,["consumer-classify"],{input:JSON.stringify(a),encoding:"utf8",timeout:ie,maxBuffer:te});if(o.status!==0||o.error)return i.nativeReason=o.error?`spawn-error:${o.error.message}`:`exit-${o.status??"null"}`,null;try{let l=JSON.parse(o.stdout),u=ae(l,n);return u?(i.nativeUsed=!0,i.nativeReason="used",u):(i.nativeReason="invalid-response",null)}catch{return i.nativeReason="invalid-json",null}}function se(e,n,r){let i=new Map,t=[];for(let o of n){let l=g(o.symbol),c=[...(r.get(o.symbolId)??new Map).entries()].map(([f,d])=>{let m=i.get(f)??new Set;return l&&m.add(l),i.set(f,m),{file:f,sources:[...d]}});t.push({symbol_id:o.symbolId,leaf:l,consumer_files:c})}let s={},a={};for(let[o,l]of i){let u=v(o);if(u){let f=N.get(e,o,()=>A(e,o,u));s[o]={imported_leaves:[...f.importedLeaves],used_leaves:[...f.usedLeaves]}}let c=oe(e,o,l);c.length>0&&(a[o]=c)}return{definitions:t,file_usages:s,reexport_only_leaves:a}}function oe(e,n,r){if(r.size===0)return[];let i=y(e).forFile(n,{lines:!0,reexports:!0}),t=i.lines??[],s=i.reexports??[];return t.length===0||s.length===0?[]:[...r].filter(a=>P(t,s,a))}function ae(e,n){if(!Array.isArray(e.entries)||e.entries.length!==n.length)return null;let r=new Set(n.map(t=>t.symbolId)),i=new Map;for(let t of e.entries){let s=le(t);if(!s||!r.has(s.symbol_id))return null;i.set(s.symbol_id,{partition:{realConsumers:s.real_consumers,barrelConsumers:s.barrel_consumers,importOnlyConsumers:s.import_only_consumers},files:s.files})}for(let t of r)if(!i.has(t))return null;return i}function le(e){if(!e||typeof e!="object")return null;let n=e;if(typeof n.symbol_id!="number"||!Array.isArray(n.real_consumers)||typeof n.barrel_consumers!="number"||typeof n.import_only_consumers!="number"||!Array.isArray(n.files)||!n.real_consumers.every(i=>typeof i=="string"))return null;let r=[];for(let i of n.files){if(!i||typeof i!="object")return null;let t=i;if(typeof t.file!="string"||!Array.isArray(t.sources)||!t.sources.every(ue)||!ce(t.classification))return null;r.push({file:t.file,sources:t.sources,classification:t.classification})}return{symbol_id:n.symbol_id,real_consumers:n.real_consumers,barrel_consumers:n.barrel_consumers,import_only_consumers:n.import_only_consumers,files:r}}function ue(e){return e==="indexed"||e==="semantic"||e==="source-fallback"}function ce(e){return e==="real"||e==="reexport-only"||e==="import-only"}function fe(){let e=process.env[ne];if(!e)return R;let n=Number(e);return Number.isFinite(n)&&n>=0?n:R}function me(){if(C!==void 0)return C;let e=process.env[ee],n=process.platform==="win32"?"scip-query-kernels.exe":"scip-query-kernels";return C=[...e?[e]:[],...de().map(i=>T(i,"target","release",n))].find(i=>k(i))??null,C}function de(){let e=new Set,n=L(j(import.meta.url));for(let r=0;r<5;r++)e.add(n),n=L(n);return[...e]}export{Le as a,Me as b,Re as c,J as d};
|
|
2
|
+
//# sourceMappingURL=chunk-P2PC2WGR.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
1
|
+
import{a as k}from"./chunk-7B3UPBVA.js";import{a as T,e as x,s as R}from"./chunk-XYADIZHU.js";import{o as w}from"./chunk-X6D5IC6I.js";import{b as l}from"./chunk-YGAGTIDK.js";import{d as g,z as _}from"./chunk-L7SPDE73.js";import{a as S}from"./chunk-64MNV6AB.js";import{existsSync as d,readFileSync as B,readdirSync as $}from"fs";import{join as p}from"path";var H={files:new Set,pathPrefixes:[]},y=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,K=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,A=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],Y=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),q=4,J=g("package-surface",{clearGroups:["whole-project"]});function Q(t){return J.get(t,()=>Z(t.config.projectRoot))}function E(t,e){let r=Q(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function Z(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of z(t))for(let n of tt(s))et(t,i,n,e,r);return e.size===0&&r.length===0?H:{files:e,pathPrefixes:r}}function z(t){let e=[],r=O(t,"");return r&&e.push({manifest:r,packageRoot:""}),D(t,"",e,0),e}function D(t,e,r,s){if(s>=q)return;let i=p(t,e);if(d(i))for(let n of $(i,{withFileTypes:!0})){if(!n.isDirectory()||Y.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name,o=O(t,a);o&&r.push({manifest:o,packageRoot:a}),D(t,a,r,s+1)}}function O(t,e){try{let r=B(p(t,e,"package.json"),"utf-8"),s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function tt(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return F(t.exports,e),e}function F(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))F(r,e)}function et(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let a=n.indexOf("*");if(a>=0){let c=n.slice(0,a);for(let u of j(c))u!==""&&i.push(f(e,u));return}let o=n.replace(K,"");for(let c of j(o)){c===o&&c===n&&s.add(f(e,n));for(let u of A)rt(t,s,e,c+u)}s.add(f(e,n))}function j(t){let e=[t];return y.test(t)&&(e.push(t.replace(y,"src/")),e.push(t.replace(y,""))),e}function rt(t,e,r,s){let i=f(r,s);if(e.add(i),!s.startsWith("src/")||d(p(t,i)))return;let n=A.find(P=>s.endsWith(P));if(!n)return;let a=s.slice(0,-n.length);st(t,e,r,a,n);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),u=a.slice(o+1);for(let P of N(t,r,c,`${u}${n}`))e.add(P)}function st(t,e,r,s,i){let n=f(r,`${s}/index${i}`);d(p(t,n))&&e.add(n)}function N(t,e,r,s){let i=p(t,e,r);if(!d(i))return[];let n=[];for(let a of $(i,{withFileTypes:!0})){let o=`${r}/${a.name}`;a.isDirectory()?n.push(...N(t,e,o,s)):a.isFile()&&a.name===s&&n.push(f(e,o))}return n}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as h,readFileSync as nt,readdirSync as it}from"fs";import{dirname as at,join as b}from"path";var ot={rootFiles:new Set,sourcePrefixes:[]},ct=new Set([".git",".scipquery","node_modules","target"]),ut=6,ft=g("rust-library-surface",{clearGroups:["whole-project"]});function L(t,e,r){if(!r.endsWith(".rs")||!pt(lt(t),r))return!1;let s=R(t,r).find(i=>i.symbol===e);return s?St(_(t,r)[s.startLine]??""):!1}function lt(t){return ft.get(t,()=>gt(t.config.projectRoot))}function gt(t){let e=new Set,r=new Set;for(let s of dt(t)){let i=b(t,s,"Cargo.toml"),n=nt(i,"utf8"),a=ht(n),o=f(s,"src/lib.rs"),c=a?f(s,a):!bt(n)&&h(b(t,o))?o:null;if(!c)continue;e.add(c);let u=at(c).replaceAll("\\","/");r.add(u==="."?"":`${u}/`)}return e.size===0?ot:{rootFiles:e,sourcePrefixes:[...r].sort()}}function pt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:mt(e)?!1:t.sourcePrefixes.some(r=>e.startsWith(r)):!1}function St(t){return/^\s*pub\s+(?!\()/.test(t)}function dt(t){if(!h(t))return[];let e=[];return C(t,"",e,0),e}function C(t,e,r,s){let i=b(t,e);if(h(i)&&(h(b(i,"Cargo.toml"))&&r.push(e),!(s>=ut)))for(let n of it(i,{withFileTypes:!0})){if(!n.isDirectory()||ct.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name;C(t,a,r,s+1)}}function ht(t){let e=!1;for(let r of t.split(`
|
|
2
2
|
`)){let s=r.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(s);if(i){e=i[1]==="lib";continue}if(!e)continue;let n=/^path\s*=\s*["']([^"']+)["']/.exec(s)?.[1];if(n)return n.replaceAll("\\","/").replace(/^\.\//,"")}return null}function bt(t){let e=!1;for(let r of t.split(`
|
|
3
3
|
`)){let s=r.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(s);if(i){e=i[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(s))return!0}return!1}function mt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function m(t){let e=l(t);return Mt(e)?"test":It(e)?"worker":vt(e)?"entry":Vt(e)?"barrel":"source"}function Pt(t){return m(t)==="barrel"}function I(t){return xt.get(t,()=>{let r=S(t,{includeIgnored:!1}).filter(a=>{let o=m(a);return o==="entry"||o==="worker"});if(r.length===0)return new Set;let s=k(t),i=new Set,n=new Set;for(;r.length>0;){let a=r.shift();if(!i.has(a)){i.add(a),m(a)==="barrel"&&n.add(a);for(let o of s.get(a)??[])i.has(o)||r.push(o)}}return n})}var xt=g("live-barrels",{clearGroups:["whole-project"]});function yt(t,e){return I(t).has(l(e))}function ce(t){let e=I(t);return S(t,{includeIgnored:!1}).filter(r=>Pt(r)&&!e.has(r)&&!Et(t,r))}function Et(t,e){let r=l(e),s=T(t).forFile(r,{facts:!0}).facts?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
4
4
|
FROM defn_enclosing_ranges der
|
|
5
5
|
JOIN documents d ON d.id = der.document_id
|
|
6
6
|
WHERE d.relative_path = ?
|
|
7
7
|
AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function ue(t,e){let r=l(e),s=m(e);return s==="entry"||s==="worker"||Nt(r)||yt(t,r)}function fe(t,e,r){let s=l(r);if(E(t,s)||wt(t,e,s)||L(t,e,s)||Ft(e,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>l(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(l(n)))||i.qualifiedVars?.some(n=>Xt(e,n))||i.symbolPatterns?.some(n=>{try{return new RegExp(n).test(e)}catch{return!1}})):!1}var _t=g("package-surface-reachability",{clearGroups:["whole-project"]});function wt(t,e,r){let s=kt(t).get(r);return s===void 0?!1:s===null||s.has(x(e))}function kt(t){return _t.get(t,()=>{let e=new Map,r=[];for(let s of S(t,{includeIgnored:!1}))E(t,s)&&(e.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=e.get(s);if(i!==void 0)for(let n of w(t,s)){if(!n.sourcePath||t.isIgnored(n.sourcePath))continue;let a=Tt(i,n);a!==void 0&&Rt(e,n.sourcePath,a)&&r.push(n.sourcePath)}}return e})}function Tt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return;let r=e.names.filter(s=>t.has(s));return r.length>0?new Set(r):void 0}function Rt(t,e,r){if(!t.has(e))return t.set(e,r),!0;let s=t.get(e);if(s===void 0)return!1;if(s===null||r===null)return s===null?!1:(t.set(e,null),!0);let i=!1;for(let n of r)s.has(n)||(s.add(n),i=!0);return i}var v=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),jt=new Set(["default","generateMetadata","generateStaticParams"]),$t=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),At=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Dt=new Set(["load","actions","entries",...v]),Ot=new Set(["default"]);function Ft(t,e){let r=x(t);return r===""?!1:V(e)?v.has(r):X(e)?jt.has(r):W(e)?$t.has(r):G(e)?At.has(r):U(e)?Dt.has(r):Ct(e)?Ot.has(r):!1}function Nt(t){return V(t)||X(t)||W(t)||Lt(t)||G(t)||U(t)}function V(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function X(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function W(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Lt(t){let e="(?:middleware|proxy|instrumentation)\\.(?:ts|js|mts|mjs)";return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function G(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function U(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function Ct(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function Mt(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function It(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function vt(t){let e=t.split("/"),r=e[e.length-1]??t;return r==="cli.ts"||r==="cli.js"||r==="postinstall.ts"||r==="postinstall.js"||r==="main.ts"||r==="main.js"||r==="main.rs"||r==="main.go"||r==="main.py"||r==="build.rs"||r==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:r==="index.ts"||r==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:e.length<=2:!1}function Vt(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function Xt(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let s=e.slice(0,r),i=e.slice(r+1);return t.includes(M(s)+"/")&&t.includes(M(i)+".")}function M(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{E as a,m as b,Pt as c,yt as d,ce as e,ue as f,fe as g};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-Q3AFUTGB.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _}from"./chunk-
|
|
1
|
+
import{a as _}from"./chunk-54HA4ZXH.js";import{a as r}from"./chunk-FECYOO5O.js";import{a as l}from"./chunk-7B3UPBVA.js";import{d as c}from"./chunk-XYADIZHU.js";function y(n,o){let e=r(n,o);if(!e)return[];let i=n.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN (
|
|
@@ -70,4 +70,4 @@ import{a as _}from"./chunk-SJ6XSCG7.js";import{a as r}from"./chunk-HFBNIIZX.js";
|
|
|
70
70
|
GROUP BY d.id
|
|
71
71
|
ORDER BY symbol_count DESC
|
|
72
72
|
LIMIT ?`,...m,e).filter(t=>!n.isIgnored(t.relative_path)).map(t=>({name:t.relative_path,count:t.symbol_count}))}export{y as a,b,p as c,I as d};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
73
|
+
//# sourceMappingURL=chunk-Q4IIEGXJ.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as D,b as v,c as $,d as B}from"./chunk-P2PC2WGR.js";import{a as K}from"./chunk-XLTP42QA.js";import{b as I,c as A}from"./chunk-NH5ALKPW.js";import{b as M,g as R}from"./chunk-Q3AFUTGB.js";import{a as g}from"./chunk-BGBBVSH4.js";import{b as k,d as F,e as b}from"./chunk-XYADIZHU.js";import{l as w}from"./chunk-X6D5IC6I.js";import{y as C}from"./chunk-L7SPDE73.js";function de(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:l=!1,scanLimit:o}=e??{},d=e?.semantic!==!1,a=new A(t),m=a.scopedDefinitions(n),y=Q(a,n),p={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,m,{minLoc:i,maxLoc:s}),orderCandidates:(u,c)=>g(c)-g(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:o,profile:{name:"stale-abstractions"},prepare:u=>{let c=U(u),f=W(t,a,u,c,{semantic:d}),h=u.filter(P=>{let x=S(t,P,f,c);return x.realConsumers.length<=1&&!x.transitivelyReachable&&j(P,x.realConsumers.length,y)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,h,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=S(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,y))return null;let h=V(t,f);return!l&&h.confidence==="low"?null:h},orderResults:(u,c)=>p[u.confidence]-p[c.confidence]||c.loc-u.loc||u.file.localeCompare(c.file)||u.startLine-c.startLine,limit:r})}function O(t,e,n,i){return n.filter(s=>s.isTypeLike&&g(s)>=i.minLoc).filter(s=>g(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>!s.relativePath.endsWith(".d.ts")).filter(s=>M(s.relativePath)!=="test").filter(s=>!R(t,s.symbol,s.relativePath)).filter(s=>!X(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function L(t,e,n,i){return v(D(t,e).forDefinitions(n,{semantic:i.semantic,sourceFallback:i.sourceFallback}))}function W(t,e,n,i,s){let r=L(t,e,n,{semantic:!1,sourceFallback:!1}),l=n.filter(a=>{let m=S(t,a,r,i);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&T(a.relativePath))}),o=s.semantic&&l.length>0?I(r,L(t,e,l,{semantic:!0,sourceFallback:!1})):r,d=l.filter(a=>S(t,a,o,i).realConsumers.length<=1);return I(o,L(t,e,d,{semantic:!1,sourceFallback:!0}))}function U(t){let e=new Map;for(let n of t){let i=e.get(n.relativePath);i||(i=new Map,e.set(n.relativePath,i));let s=b(n.symbol);s&&i.set(s,n)}return e}function S(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:l,barrelConsumers:o,importOnlyConsumers:d}=$(t,e,r),a=Y(t,e,n,i);return{definition:e,realConsumers:l,barrelConsumers:o+d,transitivelyReachable:a}}function V(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),i=T(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:s,reason:r}=ne(e.realConsumers.length,n,i),l=z(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:F(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:g(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:r,actionTier:l.actionTier,stalenessKind:l.stalenessKind,recommendation:l.recommendation}}function z(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,i,s){let r=_(t,Z(n),i),l=r.map(a=>a.singleton);if(r.length===0)return new Set;let o=v(D(t,e).forDefinitions(l,{semantic:s.semantic,sourceFallback:!0})),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,o)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let i=b(n.symbol);i&&e.set(N(n.relativePath,i),n)}return e}function _(t,e,n){let i=[];for(let s of n){let r=q(t,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let i=b(n.symbol);if(!i)return null;let s=J(t,n.relativePath,i);return s?e.get(N(n.relativePath,s))??null:null}function G(t,e,n){let i=b(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,i))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let i=C(t,e);if(!i)return null;let s=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(r)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=k(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let i=n[n.length-1],s=n[n.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function T(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(T(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,i){let s=w(t,e.relativePath),r=b(e.symbol);if(!r)return!1;let l=i.get(e.relativePath);if(!l)return!1;let o=[...s.get(r)??[]],d=new Set;for(;o.length>0;){let a=o.pop();if(d.has(a))continue;d.add(a);let m=l.get(a);if(!m)continue;let y=n.get(m.symbolId);if(y){for(let p of y)if(p!==e.relativePath&&!t.isIgnored(p))return!0}for(let p of s.get(a)??[])o.push(p)}return!1}function E(t,e,n){let i=C(t,e);if(!i)return"other";let s=i.split(`
|
|
2
|
+
`),r=Math.max(0,n-2),l=Math.min(s.length-1,n+2);for(let o=r;o<=l;o++){let a=(s[o]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function ee(t,e){let n=C(t,e.relativePath);if(!n)return!1;let i=b(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),l=n.split(`
|
|
3
|
+
`);for(let o=0;o<l.length;o++)if(!(o>=e.startLine&&o<=e.endLine)&&r.test(l[o]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{de as a};
|
|
4
|
+
//# sourceMappingURL=chunk-QDV6RDCP.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as y}from"./chunk-
|
|
1
|
+
import{b as y}from"./chunk-GBQ5NYPR.js";import{b as w}from"./chunk-Q3AFUTGB.js";import{b as I}from"./chunk-B75HZHUP.js";import{d as k}from"./chunk-X6D5IC6I.js";import{L as R}from"./chunk-YGAGTIDK.js";import{y as b}from"./chunk-L7SPDE73.js";var C=60;function nt(t,s={}){let{scope:n,limit:e=30,scanLimit:i,rotDays:r=C}=s,c=I(R(t,{extensions:[".ts",".tsx",".js",".jsx",".mjs",".cjs"]}).filter(a=>w(a)==="test").filter(a=>!n||a.includes(n)).filter(a=>!t.isIgnored(a)).sort(),i),o=[],l=[],p=[];for(let a of c){let d=b(t,a);if(!d)continue;let x=k(d),h=K(d);for(let u of j(x,h))h.add(u);let O=P(x);for(let u of O){if(u.skip){l.push(H(t,a,u,r));continue}if(u.kind==="describe")continue;let S=F(d,u.argsStart),m=x.slice(u.argsStart,u.callEnd),M=d.slice(u.argsStart,u.callEnd);_(m,h)||o.push({file:a,startLine:f(d,u.callStart),endLine:f(d,u.callEnd),title:S,severity:/\bawait\b/.test(m)?"low":"high"});let A=B(m,M);A&&p.push({file:a,startLine:f(d,u.callStart),endLine:f(d,u.callEnd),title:S,echoedValue:A})}}return{assertionFree:e?o.slice(0,e):o,skipped:e?l.slice(0,e):l,mockEcho:e?p.slice(0,e):p}}var E=/(?<!\.)\b(?:x(it|test|describe)|(it|test|describe)(?:\.\s*(skip|only|todo|each\s*\([^)]*\)))?)\s*\(/g;function P(t){let s=[];E.lastIndex=0;let n;for(;n=E.exec(t);){let e=n[1],i=e??n[2];if(!i)continue;let r=n[3]?.split(/\s*\(/)[0],c=n.index,o=n.index+n[0].length-1,l=g(t,o);E.lastIndex=o+1,r!=="each"&&s.push({kind:i,skip:e!==void 0||r==="skip"||r==="todo",skipKind:r==="todo"?"todo":"skip",callStart:c,argsStart:o+1,callEnd:l+1})}return s}function g(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0))return e}return t.length-1}function f(t,s){let n=0;for(let e=0;e<s&&e<t.length;e+=1)t[e]===`
|
|
2
2
|
`&&(n+=1);return n}function F(t,s){let n=t.slice(s,s+400),e=/^\s*(['"`])((?:\\.|(?!\1)[\s\S])*)\1/.exec(n);return e?e[2]:"(anonymous)"}var D=new Set(["vitest","chai","jest","@jest/globals","assert","node:assert","node:assert/strict","assert/strict","uvu/assert","expect","chai-as-promised"]),L=/import\s+(?:\*\s+as\s+(\w+)|\{([^}]*)\}|(\w+))\s+from\s+['"]([^'"]+)['"]/g;function K(t){let s=new Set(["expect","assert"]);L.lastIndex=0;let n;for(;n=L.exec(t);){let[,e,i,r,c]=n;if(!(!c||!D.has(c))&&(e&&s.add(e),r&&s.add(r),i))for(let o of i.split(",")){let l=o.trim().replace(/^type\s+/,"");if(!l)continue;let p=/^(\w+)\s+as\s+(\w+)$/.exec(l);s.add(p?p[2]:l)}}return s}function _(t,s){if(/\.should\b/.test(t)||/\bawait\s+(?:[\w$.]+\.)?findBy[A-Z]\w*\s*\(/.test(t)||/\bawait\s+\w*waitFor(?:Text|Value|Condition|Result|Event)\s*\(/.test(t)||/\bthrow\b/.test(t))return!0;for(let n of s){let e=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${e}\\s*(?:<[^<>]*>)?\\s*[.(]`).test(t))return!0}return!1}var v=/\bfunction\s+(\w+)\s*\(/g,V=/\b(?:const|let)\s+(\w+)\s*=\s*(?:async\s*)?\(/g,$=60;function j(t,s){let n=new Set;for(let e of[v,V]){e.lastIndex=0;let i;for(;i=e.exec(t);){let r=i[1],c=i.index+i[0].length-1,o=g(t,c),l=t.indexOf("{",o+1);if(l===-1||l-o>$)continue;let p=Q(t,l),a=t.slice(l+1,p);_(a,s)&&n.add(r)}}return n}function Q(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="{")n+=1;else if(i==="}"&&(n-=1,n===0))return e}return t.length-1}var U=/\bmock(?:ReturnValue|ResolvedValue)(?:Once)?\s*\(/g,T=/\bexpect\s*\(/g,q=/^\s*\.\s*(?:toBe|toEqual|toStrictEqual)\s*\(/,N=/^(?:-?\d+(?:\.\d+)?|(['"`]).+\1)$/;function B(t,s){let n=G(t,s,U);if(n.length===0)return null;let e=Y(t,s);for(let i of e)if(n.includes(i))return i;return null}function G(t,s,n){let e=[];n.lastIndex=0;let i;for(;i=n.exec(t);){let r=i.index+i[0].length-1,c=g(t,r),o=s.slice(r+1,c).trim();N.test(o)&&e.push(o),n.lastIndex=c+1}return e}function Y(t,s){let n=[];T.lastIndex=0;let e;for(;e=T.exec(t);){let i=e.index+e[0].length-1,r=g(t,i),c=t.slice(r+1),o=q.exec(c);if(T.lastIndex=r+1,!o)continue;let l=r+1+o[0].length-1,p=g(t,l),a=s.slice(l+1,p).trim();N.test(a)&&n.push(a)}return n}function H(t,s,n,e){let i=b(t,s),r=F(i,n.argsStart),c=f(i,n.callStart),o=X(t.config.projectRoot,s,c),l=o===null?"unknown":o>=e?"rot":"workflow";return{file:s,startLine:c,title:r,skipKind:n.skipKind,blockKind:n.kind,ageDays:o,rot:l}}function X(t,s,n){let e=n+1;try{let i=y(t,["blame","-L",`${e},${e}`,"--porcelain","--",s]),r=/^author-time (\d+)$/m.exec(i);if(!r)return null;let c=Number(r[1]);return Number.isFinite(c)?Math.max(0,Math.round((Date.now()/1e3-c)/86400)):null}catch{return null}}export{nt as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-QGXBRIM5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function i(t){let n=new Map;for(let a of t){let e=n.get(a.file);e||(e=[],n.set(a.file,e)),e.push(a)}return n}export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-QOKYJ33H.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as y}from"./chunk-GBQ5NYPR.js";import{b as u}from"./chunk-Q3AFUTGB.js";import{a as p}from"./chunk-7B3UPBVA.js";import{existsSync as v}from"fs";import{join as w}from"path";function ne(e){return b.test(e)}var b=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|uv\.lock|poetry\.lock|Pipfile\.lock|bun\.lockb?|\.SRCINFO|CHANGELOG(?:\.[a-z]+)?|.*\.(?:map|tsbuildinfo))$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function se(e,t,n={}){let{minTogether:s=4,minConfidence:i=.6,limit:a=30,maxFilesPerCommit:l=20}=n,g=y(e,{historyMode:n.historyMode,...n.head?{head:n.head}:{}}),r=g.commitHistory(),c=t!==void 0,d=g.coChangePairs({minTogether:c?Math.min(s,2):s,minConfidence:c?0:i,maxFilesPerCommit:l});if(!r||!d)return{available:!1,commitsAnalyzed:0,findings:[]};let f=typeof n.scanLimit=="number"?d.slice(0,n.scanLimit):d,E=p(e),R=k(e),j=F(e,E,R),L=n.includeLinked===!0||c,m=[];for(let o of f){if(b.test(o.fileA)||b.test(o.fileB)||!x(e,o.fileA)||!x(e,o.fileB)||c&&!o.fileA.includes(t)&&!o.fileB.includes(t)||!c&&(u(o.fileA)==="test"||u(o.fileB)==="test"||D(o.fileA,o.fileB)||N(o.fileA,o.fileB)))continue;let h=j(o.fileA,o.fileB);if(!L&&h)continue;let C=$(o.fileA,o.fileB),S=_(o,C,h);if(m.push({...o,structurallyLinked:h,partnerClass:C.partnerClass,partnerClassReasons:C.reasons,...S?{declaredCouplingSuggestion:S}:{}}),m.length>=a)break}return{available:!0,commitsAnalyzed:r.commits.length,findings:m}}function x(e,t){return v(w(e.config.projectRoot,t))}function $(e,t){let n=T(e),s=T(t),i=[],a=r=>{i.includes(r)||i.push(r)},l=(r,c)=>n.tags.has(r)&&s.tags.has(c)||n.tags.has(c)&&s.tags.has(r);if(l("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:i};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:i};if(l("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:i};if(l("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:i};if(l("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:i};let g=U(n.tokens,s.tokens).filter(r=>!J.has(r));return A(e,t)||g.length>=2?(a(A(e,t)?"both files live in the same directory":`files share feature tokens: ${g.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:i}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:i})}function _(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!Z.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${V(s)}`,files:s,reason:`${t.partnerClass} pair changed together ${e.together}x with ${Math.round(e.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function F(e,t=p(e),n=k(e)){return(s,i)=>B(t,n,s,i)}var I=/(?:^|\/)(?:locales|i18n)\//i;function P(e){return I.test(e)}function N(e,t){return P(e)&&P(t)?!0:O(e,t)}function O(e,t){if(!e.endsWith(".json")||!t.endsWith(".json"))return!1;let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(n<0||s<0)return!1;let i=e.slice(0,n),a=t.slice(0,s);if(i===a)return!1;let l=e.slice(n+1),g=t.slice(s+1);if(l!==g)return!1;let r=i.lastIndexOf("/"),c=a.lastIndexOf("/"),d=r>=0?i.slice(0,r):"",f=c>=0?a.slice(0,c):"";return d===f}function D(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let i=e.slice(n+1).split(".")[0],a=t.slice(s+1).split(".")[0];return i!==""&&i===a}function k(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function B(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(i=>i.has(n)&&i.has(s))}var M=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,z=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,G=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,H=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,q=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,W=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,Z=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),J=new Set(["src","lib","app","apps","packages","frontend","backend","examples","python","typescript","javascript","test","tests","spec","index","main","utils","util","types","type","config","docs","doc","package","requirements","ts","tsx","js","jsx","mjs","cjs","vue","py","md","mdx","json","yaml","yml","toml","txt"]);function T(e){let t=e.replace(/\\/g,"/"),n=new Set;return M.test(t)&&n.add("doc"),z.test(t)&&n.add("config"),G.test(t)&&n.add("schema"),H.test(t)&&n.add("script"),q.test(t)&&n.add("model"),W.test(t)&&n.add("view"),u(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:K(t)}}function A(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),i=n>=0?e.slice(0,n):"",a=s>=0?t.slice(0,s):"";return i!==""&&i===a}function K(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}function U(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function V(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{ne as a,se as b,$ as c,_ as d,F as e};
|
|
2
|
+
//# sourceMappingURL=chunk-QRGV2F7L.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as j}from"./chunk-HKEHS2AS.js";import{a as N,b as g,c as R}from"./chunk-P2PC2WGR.js";import{a as _}from"./chunk-XLTP42QA.js";import{b as C,c as P}from"./chunk-NH5ALKPW.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as k}from"./chunk-BGBBVSH4.js";import{a as w}from"./chunk-LBMJEAEW.js";import{d,e as y,k as v,z as L}from"./chunk-XYADIZHU.js";import{i as S}from"./chunk-X6D5IC6I.js";import{s as x}from"./chunk-L7SPDE73.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=N(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&x("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=T(t,c.symbolId,D);if(!M)continue;let p=W(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=T(t,e.symbolId,o);if(!r)return null;let s=W(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(a=>!S(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return R(t,e,o).realConsumers}function T(t,n,e){return t.get(`SELECT c.start_line, c.end_line
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents d ON c.document_id = d.id
|
|
5
|
+
WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
|
|
6
|
+
LIMIT 1`,n,e)}function W(t,n,e,i,a){let o=t.definitionsForFile(e),r=q(n,e,i,a.start_line,a.end_line);return L(o,r)}function J(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:G(n,e),source:"file"}}function q(t,n,e,i,a){let o=y(e);if(!o)return i;let r=w(t,n).get(o);if(!r||r.length===0)return i;for(let s of r)if(s>=i&&s<=a)return s;return i}function z(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function G(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,b(n)),a=0;for(let[o,r]of t)o!==n&&m(o,b(o))===i&&r>a&&(a=r);return a}function H(t,n,e,i){return j(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ae as a};
|
|
7
|
+
//# sourceMappingURL=chunk-QVWS2VWZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as f}from"./chunk-NH5ALKPW.js";import{a as h}from"./chunk-FECYOO5O.js";import{e as s,g as u}from"./chunk-XYADIZHU.js";import{f as d}from"./chunk-X6D5IC6I.js";import{B as c}from"./chunk-YGAGTIDK.js";import{basename as p}from"path";function N(r,o){let t=h(r,o);if(!t)return[];let e=s(t.symbol),a=new f(r).definitionsForFile(t.relativePath).filter(n=>u(n.symbol)),l=a.filter(n=>n.parentTypeName===e||n.symbol.includes(e)),m=(l.length>0?l:L(p(t.relativePath))===e?a.filter(n=>n.symbol.includes("<invalid-global-code>")):[]).map(n=>({startLine:n.startLine,endLine:n.endLine,name:s(n.symbol)}));return c(t.relativePath)!=="clojure"?m:b(m,M(r,t))}function L(r){return r.replace(/\.[^.]+$/,"")}function M(r,o){let t=s(o.symbol);return t?(d(r,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function b(r,o){let t=new Map;for(let e of[...r,...o])t.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...t.values()].sort((e,i)=>e.startLine-i.startLine||e.endLine-i.endLine)}export{N as a};
|
|
2
|
+
//# sourceMappingURL=chunk-R4FQGQ4X.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b}from"./chunk-54HA4ZXH.js";import{m as d,x as f}from"./chunk-XYADIZHU.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-RV2FQIX3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R,b as H}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R,b as H}from"./chunk-U6WNH5GC.js";import{a as B,b,c as y,e as h,f as k}from"./chunk-B3X6KU75.js";import{a as p,b as g}from"./chunk-KMVGRIO2.js";import{N as v}from"./chunk-YGAGTIDK.js";function V(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:i=6,limit:o=20,scope:c,scanLimit:n,filePattern:d,focusFiles:f}=s,l=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,i),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),t=R(l,r=>r.tokens);return H({profiles:l,limit:o,filePattern:d,focusFiles:f,candidateIndex:t,profile:{name:"react-hook-candidates"},compare:(r,a)=>C(r,a,m,i),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.componentA.localeCompare(a.componentA)||r.fileB.localeCompare(a.fileB)||r.componentB.localeCompare(a.componentB)})}function C(e,s,m,i){let o=p(e.tokens,s.tokens);if(o.size<i||!E(o))return null;let c=b(e.tokens,s.tokens);if(c<m)return null;let n=h(o,"hook:"),d=h(o,"react-hook:"),f=h(o,"effect:"),l=h(o,"state:"),t=h(o,"request:"),r=h(o,"handler:"),a=h(o,"handler-verb:"),u=A({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:k(o),sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){return B({genericWords:q,stripPrefixes:w,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:S})}function S(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,m=0,i=0,o=0,c=0,n=0,d=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?m+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?c+=1:t.startsWith("state:")?n+=1:t.startsWith("state-hook:")&&(d+=1);let f=n+d,l=s+m+i+o+c+f;return y([{name:"requests",count:o},{name:"customHooks",count:s},{name:"namedStates",count:n},{name:"handlers",count:c},{name:"effects",count:i},{name:"reactHooks",count:m},{name:"namedBehavior",count:l}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var q=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),w=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
|
|
2
|
+
//# sourceMappingURL=chunk-S44IULR6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as f}from"./chunk-NH5ALKPW.js";import{a as L}from"./chunk-FECYOO5O.js";import{d as i,e as b,f as u,l as c}from"./chunk-XYADIZHU.js";import{f as l}from"./chunk-X6D5IC6I.js";import{B as a}from"./chunk-YGAGTIDK.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SOAT6NLA.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{m as h,n as R}from"./chunk-
|
|
1
|
+
import{m as h,n as R}from"./chunk-LBMJEAEW.js";import{a as g}from"./chunk-FECYOO5O.js";import{h as d}from"./chunk-XYADIZHU.js";import{y as p}from"./chunk-L7SPDE73.js";import{a as m}from"./chunk-64MNV6AB.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
|
|
2
2
|
`);for(let o=0;o<c.length;o++){let f=c[o]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:o})}}return e}function S(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{D as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-STOL2BTL.js.map
|