scip-query 0.10.2 → 0.10.3
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/dist/{chunk-UNJG7P2I.js → chunk-4HOMAEDD.js} +2 -2
- package/dist/{chunk-FPMVCDIJ.js → chunk-7ADUXFRZ.js} +2 -2
- package/dist/{chunk-CNTEQMHA.js → chunk-EYLXU575.js} +2 -2
- package/dist/{chunk-WDUTG2ZR.js → chunk-GLJAAKDW.js} +2 -2
- package/dist/{chunk-5B53WB6E.js → chunk-I7TSQZ3J.js} +4 -4
- package/dist/chunk-KRGBLZT2.js +7 -0
- package/dist/chunk-UQJGTVHV.js +5 -0
- package/dist/{chunk-MHK7Z53U.js → chunk-X474LKJX.js} +2 -2
- package/dist/{chunk-FGCL6NDB.js → chunk-YVLHL6KQ.js} +2 -2
- package/dist/cli.js +168 -168
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/diff-gate.d.ts +6 -1
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/similar.d.ts +9 -1
- package/dist/queries/similar.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DRAZH77R.js +0 -7
- package/dist/chunk-MHTDOFV7.js +0 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-O3OKSF6O.js";import{a as ne}from"./chunk-3KLLFNT4.js";import{a as te}from"./chunk-QSXQT3NE.js";import{a as ie}from"./chunk-O4L4AB3T.js";import{a as re}from"./chunk-GS33KGAY.js";import{a as Z}from"./chunk-UMNENNTX.js";import{a as ee}from"./chunk-TO54DY4O.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as K}from"./chunk-SPE4YCOT.js";import{a as Q}from"./chunk-ZFMPHDAT.js";import{a as J}from"./chunk-C2QSK7E7.js";import{b as X}from"./chunk-MHTDOFV7.js";import{a as G}from"./chunk-G3WGZU5Q.js";import{a as Y}from"./chunk-DE7MA6OD.js";import{a as j}from"./chunk-7KCSELEV.js";import{a as q}from"./chunk-AW4N6MGC.js";import{a as T,b as I}from"./chunk-C3MZZ2ZN.js";import{b as O}from"./chunk-CNTEQMHA.js";import{b as z,c as N}from"./chunk-DRAZH77R.js";import{a as U}from"./chunk-DAI74TJU.js";import{a as W}from"./chunk-CJJP64OC.js";import{f as A,g as k}from"./chunk-ZQLO2SCU.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Me(e),{breakdown:t,pressure:i}=Be(e),o=se(t,"risk"),n=se(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,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(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},axes:Ae(e),validation:Te(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ae(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:ke(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+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 ke(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:l(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Te(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.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,a=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(n+=g.fixChanges,a+=1);let d=i.size>0?l(o/i.size):0,h=a>0?l(n/a):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=l(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?l(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:d,baselineFixDensity:h,ratio:i.size>0&&h>0?l(d/h):null,byCategory:S}}function l(e){return Math.round(e*100)/100}function ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${ce(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${ce(t)} score-weighted)`}function Me(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,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} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,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 extract or reuse the shared UI concept`,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${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,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 extract or reuse the shared UI concept`,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${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,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${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,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 just forward to one callee \u2014 unnecessary indirection`,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 remove unused abstractions; review single-consumer ownership before 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.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(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`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",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 a=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-a}),r}var ae={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"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","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 se(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 Be(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(u,y,C)=>{y>0&&i.push({axis:u,points:y,detail:C,kind:ae[u]??"hygiene"})},a=(u,y,C,we,Pe,Re,De)=>{let w=Math.max(we,1);if(C<=w)return;let D=C/w,E=Math.min(Pe,Math.ceil(Math.log2(D)*Re));if(E<=0)return;let Ee=ae[u]??"hygiene";o.push({axis:u,category:y,kind:Ee,count:C,threshold:l(w),ratio:l(D),extraPenalty:E}),n(u,E,`${C} ${De} exceed pressure threshold ${l(w)} (${l(D)}x)`)},d=e.dead.count/t;n("dead-code",Math.min(20,Math.round(d*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;n("isolated",Math.min(10,Math.round(h*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 S=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);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 g=m(e.reactHookCandidates),f=g/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),xe=L/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(xe)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Le=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(Le/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);n("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);n("passthroughs",Math.min(3,F),v(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 ye=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(ye*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 u=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(u/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:u},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",u,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",g,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",L,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",_,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("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 Ve}from"v8";var $e=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ve();r.heap_size_limit-r.used_heap_size<$e||e()}var _e=50,Fe=75e3,Ie=5e3,ue=2500,le=50,ze=10,Ne=["overview","dead","isolated","cycles","similar","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"],me={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Ue(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:We(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:qe(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:je(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Ye(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Xe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Qe(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Je(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ke(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Ze(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ge(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:et(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:tt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:rt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:nt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:at(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:it(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:ot(e,t)})};function qt(e,r={}){return he(e,r.full!==!1,(t,i)=>{let o=Oe(e,r.scope,t,i);return M(o)})}function jt(e,r,t={}){return he(e,t.full!==!1,(i,o)=>me[r](e,t.scope,o,i))}function he(e,r,t){let i=J(e),o=st(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Gt(e){return M(ge(e))}function ge(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:de(e,"git-evidence")?.gitEvidence??null,suppressions:de(e,"suppressions")?.suppressions??null}}function de(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Oe(e,r,t,i){return ge(Ne.map(o=>me[o](e,r,i,t)))}function Ue(e,r,t){return s(e,t,"dead",()=>{let i=I(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(lt(e,i.symbols))})}function We(e,r,t){return s(e,t,"isolated",()=>{let i=G(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(dt(e,i))})}function qe(e,r,t){return s(e,t,"cycles",()=>W(e,{scope:r}).filter(o=>o.kind==="real").length)}function je(e,r,t){return s(e,t,"similar",()=>X(e,{scope:r,...p.similar,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ge(e,r,t){return s(e,t,"extract-candidates",()=>j(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ye(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Xe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,mt)})}function Qe(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return pt(i)})}function Je(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ke(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,ht)})}function Ze(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function et(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=K(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,gt)})}function tt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=Y(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ft)})}function rt(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=Q(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,a)=>n+a.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function it(e,r){return s(e,r,"git-evidence",()=>{let t=z(e);if(!t)return null;let i=O(e,void 0,{limit:r.candidateResultLimit}),o={};for(let[n,a]of t)o[n]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:N(e),hiddenCoupling:{pairCount:i.findings.length,scoreCount:$(i.findings.reduce((n,a)=>n+pe(a),0)),top:i.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:pe(n),subjectContext:n.subjectContext}))},fileStats:o}})}function ot(e,r){return s(e,r,"suppressions",()=>{let t=ne(e);return{total:t.total,byCategory:{...t.byCategory}}})}function nt(e,r,t){return s(e,t,"drift",()=>{let i=q(e,{scope:r,...p.drift}),o=i.results.filter(d=>d.kind!=="pattern-deviation"),n=o.filter(d=>d.actionTier==="direct").length,a=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:a}})}function at(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=U(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>_e).length}})}function st(e,r){let t=e.symbols>=Fe||e.documents>=Ie,i=r?Number.POSITIVE_INFINITY:le,o=r?Number.POSITIVE_INFINITY:ze;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ue,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ue} symbols and reported their top ${le} findings. Enable full mode for unbounded candidate counts.`]}}function ct(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){ut(t);try{return i()}finally{ct(e,r)}}function ut(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function lt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(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 fe(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function pt(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 V(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 Ce(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=e.sharedHooks.length>0,t=be({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ve(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function ht(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=be({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ve(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function be(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!He.has(Se(r))).length+Math.min(e.functions.length,3)}function ve(e,r,t){let i=[...e,...r,...t].map(Se);return i.length>0&&i.every(o=>He.has(o))}function Se(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function gt(e){return e.actionTier==="signal"?.25:1}function ft(e){return e.actionTier==="signal"?.25:1}function pe(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 He=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{Ne as a,qt as b,jt as c,Gt as d};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as oe}from"./chunk-O3OKSF6O.js";import{a as ne}from"./chunk-3KLLFNT4.js";import{a as te}from"./chunk-QSXQT3NE.js";import{a as ie}from"./chunk-O4L4AB3T.js";import{a as re}from"./chunk-GS33KGAY.js";import{a as Z}from"./chunk-UMNENNTX.js";import{a as ee}from"./chunk-TO54DY4O.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as K}from"./chunk-SPE4YCOT.js";import{a as Q}from"./chunk-ZFMPHDAT.js";import{a as J}from"./chunk-C2QSK7E7.js";import{b as X}from"./chunk-UQJGTVHV.js";import{a as G}from"./chunk-G3WGZU5Q.js";import{a as Y}from"./chunk-DE7MA6OD.js";import{a as j}from"./chunk-7KCSELEV.js";import{a as q}from"./chunk-AW4N6MGC.js";import{a as T,b as I}from"./chunk-C3MZZ2ZN.js";import{b as O}from"./chunk-EYLXU575.js";import{b as z,c as N}from"./chunk-KRGBLZT2.js";import{a as U}from"./chunk-DAI74TJU.js";import{a as W}from"./chunk-CJJP64OC.js";import{f as A,g as k}from"./chunk-ZQLO2SCU.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Me(e),{breakdown:t,pressure:i}=Be(e),o=se(t,"risk"),n=se(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,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(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},axes:Ae(e),validation:Te(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ae(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:ke(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+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 ke(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:l(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Te(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.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,a=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(n+=g.fixChanges,a+=1);let d=i.size>0?l(o/i.size):0,h=a>0?l(n/a):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=l(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?l(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:d,baselineFixDensity:h,ratio:i.size>0&&h>0?l(d/h):null,byCategory:S}}function l(e){return Math.round(e*100)/100}function ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${ce(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${ce(t)} score-weighted)`}function Me(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,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} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,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 extract or reuse the shared UI concept`,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${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,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 extract or reuse the shared UI concept`,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${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,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${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,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 just forward to one callee \u2014 unnecessary indirection`,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 remove unused abstractions; review single-consumer ownership before 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.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(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`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",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 a=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-a}),r}var ae={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"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","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 se(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 Be(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(u,y,C)=>{y>0&&i.push({axis:u,points:y,detail:C,kind:ae[u]??"hygiene"})},a=(u,y,C,we,Pe,Re,De)=>{let w=Math.max(we,1);if(C<=w)return;let D=C/w,E=Math.min(Pe,Math.ceil(Math.log2(D)*Re));if(E<=0)return;let Ee=ae[u]??"hygiene";o.push({axis:u,category:y,kind:Ee,count:C,threshold:l(w),ratio:l(D),extraPenalty:E}),n(u,E,`${C} ${De} exceed pressure threshold ${l(w)} (${l(D)}x)`)},d=e.dead.count/t;n("dead-code",Math.min(20,Math.round(d*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;n("isolated",Math.min(10,Math.round(h*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 S=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);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 g=m(e.reactHookCandidates),f=g/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),xe=L/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(xe)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Le=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(Le/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);n("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);n("passthroughs",Math.min(3,F),v(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 ye=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(ye*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 u=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(u/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:u},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",u,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",g,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",L,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",_,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("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 Ve}from"v8";var $e=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ve();r.heap_size_limit-r.used_heap_size<$e||e()}var _e=50,Fe=75e3,Ie=5e3,ue=2500,le=50,ze=10,Ne=["overview","dead","isolated","cycles","similar","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"],me={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Ue(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:We(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:qe(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:je(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Ye(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Xe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Qe(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Je(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ke(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Ze(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ge(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:et(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:tt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:rt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:nt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:at(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:it(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:ot(e,t)})};function qt(e,r={}){return he(e,r.full!==!1,(t,i)=>{let o=Oe(e,r.scope,t,i);return M(o)})}function jt(e,r,t={}){return he(e,t.full!==!1,(i,o)=>me[r](e,t.scope,o,i))}function he(e,r,t){let i=J(e),o=st(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Gt(e){return M(ge(e))}function ge(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:de(e,"git-evidence")?.gitEvidence??null,suppressions:de(e,"suppressions")?.suppressions??null}}function de(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Oe(e,r,t,i){return ge(Ne.map(o=>me[o](e,r,i,t)))}function Ue(e,r,t){return s(e,t,"dead",()=>{let i=I(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(lt(e,i.symbols))})}function We(e,r,t){return s(e,t,"isolated",()=>{let i=G(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(dt(e,i))})}function qe(e,r,t){return s(e,t,"cycles",()=>W(e,{scope:r}).filter(o=>o.kind==="real").length)}function je(e,r,t){return s(e,t,"similar",()=>X(e,{scope:r,...p.similar,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ge(e,r,t){return s(e,t,"extract-candidates",()=>j(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ye(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Xe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,mt)})}function Qe(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return pt(i)})}function Je(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ke(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,ht)})}function Ze(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function et(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=K(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,gt)})}function tt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=Y(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ft)})}function rt(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=Q(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,a)=>n+a.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function it(e,r){return s(e,r,"git-evidence",()=>{let t=z(e);if(!t)return null;let i=O(e,void 0,{limit:r.candidateResultLimit}),o={};for(let[n,a]of t)o[n]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:N(e),hiddenCoupling:{pairCount:i.findings.length,scoreCount:$(i.findings.reduce((n,a)=>n+pe(a),0)),top:i.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:pe(n),subjectContext:n.subjectContext}))},fileStats:o}})}function ot(e,r){return s(e,r,"suppressions",()=>{let t=ne(e);return{total:t.total,byCategory:{...t.byCategory}}})}function nt(e,r,t){return s(e,t,"drift",()=>{let i=q(e,{scope:r,...p.drift}),o=i.results.filter(d=>d.kind!=="pattern-deviation"),n=o.filter(d=>d.actionTier==="direct").length,a=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:a}})}function at(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=U(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>_e).length}})}function st(e,r){let t=e.symbols>=Fe||e.documents>=Ie,i=r?Number.POSITIVE_INFINITY:le,o=r?Number.POSITIVE_INFINITY:ze;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ue,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ue} symbols and reported their top ${le} findings. Enable full mode for unbounded candidate counts.`]}}function ct(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){ut(t);try{return i()}finally{ct(e,r)}}function ut(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function lt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(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 fe(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function pt(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 V(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 Ce(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=e.sharedHooks.length>0,t=be({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ve(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function ht(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=be({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ve(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function be(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!He.has(Se(r))).length+Math.min(e.functions.length,3)}function ve(e,r,t){let i=[...e,...r,...t].map(Se);return i.length>0&&i.every(o=>He.has(o))}function Se(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function gt(e){return e.actionTier==="signal"?.25:1}function ft(e){return e.actionTier==="signal"?.25:1}function pe(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 He=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{Ne as a,qt as b,jt as c,Gt as d};
|
|
2
|
+
//# sourceMappingURL=chunk-4HOMAEDD.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as S}from"./chunk-O4L4AB3T.js";import{a as g}from"./chunk-GS33KGAY.js";import{a as f}from"./chunk-UMNENNTX.js";import{a as p}from"./chunk-TO54DY4O.js";import{b as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as S}from"./chunk-O4L4AB3T.js";import{a as g}from"./chunk-GS33KGAY.js";import{a as f}from"./chunk-UMNENNTX.js";import{a as p}from"./chunk-TO54DY4O.js";import{b as y}from"./chunk-UQJGTVHV.js";import{e as h}from"./chunk-KRGBLZT2.js";var v=.7,C=.62,R=.45;function H(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:l}=t,s=h(i);if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let d=A(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:l,scope:a,semantic:t.semantic}).map(o=>I(o,s,e)).filter(o=>o!==null);d.sort((o,r)=>(o.kind===r.kind?0:o.kind==="echo"?-1:1)||r.similarity-o.similarity||o.echoFile.localeCompare(r.echoFile)||o.echoSymbol.localeCompare(r.echoSymbol)||o.domain.localeCompare(r.domain));let b=d.slice(0,n).map(x);return{available:!0,windowCommits:e,findings:b,rootCauseGroups:w(b)}}function A(i,t){let e=K(t.limit);return[...F(i,{scope:t.scope,minSimilarity:t.minSimilarity??v,limit:e,scanLimit:t.scanLimit,semantic:t.semantic}),...B(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit}),...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit}),...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit})]}function F(i,t){return y(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic}).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function B(i,t){return f(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,scanLimit:t.scanLimit}).filter(e=>e.fileA!==e.fileB).map(e=>({domain:"react-component",basis:"jsx-structure",symbolA:e.componentA,fileA:e.fileA,symbolB:e.componentB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:u(["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]),sharedCallees:[]}))}function L(i,t){return p(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,scanLimit:t.scanLimit}).filter(e=>e.fileA!==e.fileB).map(e=>({domain:"react-hook",basis:"react-behavior",symbolA:e.componentA,fileA:e.fileA,symbolB:e.componentB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:u(["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]),sharedCallees:[]}))}function E(i,t){return g(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,scanLimit:t.scanLimit}).filter(e=>e.fileA!==e.fileB).map(e=>({domain:"vue-component",basis:"vue-template",symbolA:c(e.fileA),fileA:e.fileA,symbolB:c(e.fileB),fileB:e.fileB,similarity:e.similarity,sharedEvidence:u(["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]),sharedCallees:[]}))}function k(i,t){return S(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,scanLimit:t.scanLimit}).filter(e=>e.fileA!==e.fileB).map(e=>({domain:"vue-composable",basis:"vue-behavior",symbolA:c(e.fileA),fileA:e.fileA,symbolB:c(e.fileB),fileB:e.fileB,similarity:e.similarity,sharedEvidence:u(["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]),sharedCallees:[]}))}function I(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,l=n!==null&&n<=e,s=a!==null&&a<=e;if(!l&&!s)return null;if(l&&s){let m=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:m?i.symbolA:i.symbolB,echoFile:m?i.fileA:i.fileB,echoAgeCommits:(m?n:a)??0,establishedSymbol:m?i.symbolB:i.symbolA,establishedFile:m?i.fileB:i.fileA,establishedAgeCommits:m?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:l?i.symbolA:i.symbolB,echoFile:l?i.fileA:i.fileB,echoAgeCommits:(l?n:a)??0,establishedSymbol:l?i.symbolB:i.symbolA,establishedFile:l?i.fileB:i.fileA,establishedAgeCommits:l?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function x(i){let t=D(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function D(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function w(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??D(n),l=n.groupKey??`recent-duplicate:${a}`,s=t.get(l);s||(s={groupKey:l,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:N(n)},t.set(l,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let m of n.sharedEvidence)s.sharedEvidence.add(m)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function N(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function u(...i){let t=[],e=new Set;for(let[n,a]of i)for(let l of a){let s=`${n}:${l}`;e.has(s)||(e.add(s),t.push(s))}return t}function c(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7ADUXFRZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as b,f as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as b,f as S}from"./chunk-KRGBLZT2.js";import{b as d}from"./chunk-ZQLO2SCU.js";import{a as h}from"./chunk-AUVBR62P.js";import{existsSync as R}from"fs";import{join as $}from"path";function U(e){return C.test(e)}var C=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function X(e,t,n={}){let{minTogether:s=4,minConfidence:o=.6,limit:a=30,maxFilesPerCommit:c=20}=n,l=b(e),r=t!==void 0,g=S(e,{minTogether:r?Math.min(s,2):s,minConfidence:r?0:o,maxFilesPerCommit:c});if(!l||!g)return{available:!1,commitsAnalyzed:0,findings:[]};let A=h(e),E=x(e),k=L(e,A,E),w=n.includeLinked===!0||r,u=[];for(let i of g){if(C.test(i.fileA)||C.test(i.fileB)||!y(e,i.fileA)||!y(e,i.fileB)||r&&!i.fileA.includes(t)&&!i.fileB.includes(t)||!r&&(d(i.fileA)==="test"||d(i.fileB)==="test"||j(i.fileA,i.fileB)))continue;let m=k(i.fileA,i.fileB);if(!w&&m)continue;let f=v(i.fileA,i.fileB),p=F(i,f,m);if(u.push({...i,structurallyLinked:m,partnerClass:f.partnerClass,partnerClassReasons:f.reasons,...p?{declaredCouplingSuggestion:p}:{}}),u.length>=a)break}return{available:!0,commitsAnalyzed:l.commits.length,findings:u}}function y(e,t){return R($(e.config.projectRoot,t))}function v(e,t){let n=P(e),s=P(t),o=[],a=r=>{o.includes(r)||o.push(r)},c=(r,g)=>n.tags.has(r)&&s.tags.has(g)||n.tags.has(g)&&s.tags.has(r);if(c("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:o};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:o};if(c("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:o};if(c("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:o};if(c("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:o};let l=q(n.tokens,s.tokens).filter(r=>!G.has(r));return T(e,t)||l.length>=2?(a(T(e,t)?"both files live in the same directory":`files share feature tokens: ${l.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:o}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:o})}function F(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!M.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${Z(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 L(e,t=h(e),n=x(e)){return(s,o)=>_(t,n,s,o)}function j(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let o=e.slice(n+1).split(".")[0],a=t.slice(s+1).split(".")[0];return o!==""&&o===a}function x(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function _(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(o=>o.has(n)&&o.has(s))}var I=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,N=/(?:^|\/)(?:\.[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,D=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,O=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,B=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,z=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,M=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),G=new Set(["src","lib","app","test","tests","spec","index","main","utils","util","types","type","config","docs","doc"]);function P(e){let t=e.replace(/\\/g,"/"),n=new Set;return I.test(t)&&n.add("doc"),N.test(t)&&n.add("config"),D.test(t)&&n.add("schema"),O.test(t)&&n.add("script"),B.test(t)&&n.add("model"),z.test(t)&&n.add("view"),d(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:H(t)}}function T(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),o=n>=0?e.slice(0,n):"",a=s>=0?t.slice(0,s):"";return o!==""&&o===a}function H(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 q(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function Z(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{U as a,X as b,v as c,F as d,L as e};
|
|
2
|
+
//# sourceMappingURL=chunk-EYLXU575.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as E,d as I}from"./chunk-
|
|
1
|
+
import{a as E,d as I}from"./chunk-KRGBLZT2.js";import{b as _,c as v,d as N}from"./chunk-A4L36SZS.js";import{existsSync as X,readFileSync as A}from"fs";import{join as D}from"path";function j(t,n){let e=$(t,n)??W(t,n)??G(t,n)??Z(t,n);return J(t,e,n)}function $(t,n){let e=-1,i=null;for(let o=0;o<=n;o+=1){let r=x(t[o]??"");r&&(i===null?(i=r,e=o):r===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let o=n+1;o<t.length;o+=1)if(x(t[o]??"")===i)return{start:e,end:o+1};return{start:e,end:t.length}}function x(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function W(t,n){if(!y(t[n]??""))return null;let e=n;for(;e>0&&y(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&y(t[i]??"");)i+=1;return{start:e,end:i}}function y(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function G(t,n){let e=n;for(;e>=0;){let r=t[e]??"";if(T(r)!==null)break;if(k(r)!==null)return null;e-=1}if(e<0)return null;let i=T(t[e]??"");if(i===null)return null;let o=e+1;for(;o<t.length;){let r=t[o]??"",s=T(r);if(s!==null){if(s<=i)break;o+=1;continue}if(k(r)!==null)break;o+=1}return{start:e,end:o}}function T(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function Z(t,n){let e=t[n]??"";if(L(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&O(t[i-1]??"");)i-=1;let o=n+1;for(;o<t.length&&O(t[o]??"");)o+=1;return{start:i,end:o}}function O(t){return k(t)===null}function k(t){return t.trim().length===0?"blank":L(t)?"heading":x(t)?"fence":y(t)?"table":T(t)!==null?"list":null}function L(t){return/^#{1,6}\s+/.test(t.trim())}function J(t,n,e){let{start:i,end:o}=n;if(o-i>40){let s=Math.floor(20);i=Math.max(i,e-s),o=Math.min(o,i+40),i=Math.max(n.start,o-40)}let r=t.slice(i,o).join(`
|
|
2
2
|
`).trim();return r.length<=2e3?r:`${r.slice(0,2e3).trimEnd()}...`}var p=/\.(?:md|mdx|rst|txt)$/i;function q(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var K=3,H=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function lt(t,n={}){let{doc:e,limit:i=20,minCoupling:o=K}=n,r=Y(t);if(!r)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let s=[];for(let c of r.docFiles){if(e!==void 0&&!c.includes(e)||e===void 0&&!z(t,c)||e!==void 0&&!X(D(t.config.projectRoot,c)))continue;let d=Math.max(0,...r.changeTimes.get(c)??[]),g=Q(t,c),l=new Map,{resolved:a,broken:u,citations:m}=P(t,c,r.tracked,r.trackedBySuffix,r.everSeenInHistory),S=new Map(m.map(f=>[f.file,f.contexts]));for(let f of a){if(f===c||p.test(f))continue;let h=(r.changeTimes.get(f)??[]).filter(b=>b>d).length;h!==0&&l.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:h,...w("reference",g),citationContexts:S.get(f)})}for(let[f,h]of r.coupling.get(c)??[]){if(h<o||!r.tracked.has(f))continue;let b=(r.changeTimes.get(f)??[]).filter(U=>U>d).length;if(b===0)continue;let C=l.get(f);C?(C.evidence="both",C.coChanges=h,Object.assign(C,w("both",g))):l.set(f,{file:f,evidence:"co-change",coChanges:h,changesSinceDocUpdate:b,...w("co-change",g)})}if(l.size===0&&u.length===0)continue;let R=[...l.values()].sort((f,h)=>h.changesSinceDocUpdate-f.changesSinceDocUpdate);s.push({doc:c,docLastChangedAt:d,staleness:R.reduce((f,h)=>f+h.changesSinceDocUpdate,0)+u.length*10,subjects:R.slice(0,8),brokenReferences:u})}return s.sort((c,d)=>d.staleness-c.staleness),{available:!0,commitsAnalyzed:r.historyCommitCount,docsScanned:r.docFiles.length,findings:s.slice(0,i)}}function Q(t,n){let e;try{e=A(D(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
|
|
3
3
|
${e}`.toLowerCase(),o=F(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(o.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${o.join(", ")}`]};let r=F(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return r.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${r.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function F(t,n){return n.filter(e=>t.includes(e))}function w(t,n){return{actionTier:V(t,n.docIntent),docIntent:n.docIntent,docIntentReasons:n.reasons}}function V(t,n){return n==="historical-note"?"support":t==="co-change"?"signal":"direct"}function Y(t){let n=E(t);if(!n)return null;let e=I(t)??new Set,i=new Map,o=new Map,r=new Set;for(let s of n.commits){let c=[...new Set(s.files)],d=c.filter(l=>p.test(l)),g=c.filter(l=>!p.test(l));for(let l of c){r.add(l);let a=i.get(l)??[];a.push(s.timestamp),i.set(l,a)}for(let l of d){let a=o.get(l);a||(a=new Map,o.set(l,a));for(let u of g)a.set(u,(a.get(u)??0)+1)}}return{changeTimes:i,coupling:o,docFiles:[...e].filter(s=>p.test(s)),everSeenInHistory:r,historyCommitCount:n.commits.length,tracked:e,trackedBySuffix:B(e)}}function ut(t,n){let e=I(t)??new Set,i=B(e),o=[];for(let r of e){if(!z(t,r))continue;let{resolved:s,citations:c}=P(t,r,e,i,new Set),d=[...s].filter(g=>n.has(g));if(d.length>0){let g=d.sort(),l=new Set(g),a=c.filter(u=>l.has(u.file));o.push({doc:r,cited:g,citations:a,citedClaims:M(a.flatMap(u=>u.contexts)).slice(0,3)})}}return o}function z(t,n){return p.test(n)&&!q(n)&&X(D(t.config.projectRoot,n))}function B(t){let n=new Map;for(let e of t){let i=e.split("/");for(let o of[2,3]){if(i.length<o)continue;let r=i.slice(-o).join("/"),s=n.get(r)??[];s.push(e),n.set(r,s)}}return n}function P(t,n,e,i,o){let r=new Set,s=new Set,c=et(t,n);if(!c)return{resolved:r,broken:[],citations:[]};let d=tt(t,n,c),g=new Map,l=(a,u)=>{let m=d.get(u);if(!m||m.length===0)return;let S=g.get(a)??[];S.push(...m),g.set(a,M(S).slice(0,3))};for(let a of c){if(e.has(a)){r.add(a),l(a,a);continue}let u=i.get(a);if(u&&u.length===1){r.add(u[0]),l(u[0],a);continue}u&&u.length>1||o.has(a)&&s.add(a)}return{resolved:r,broken:[...s],citations:[...g].map(([a,u])=>({file:a,contexts:u}))}}function tt(t,n,e){let i;try{i=A(D(t.config.projectRoot,n),"utf-8").split(/\r?\n/)}catch{return new Map}let o=new Set(e),r=new Map;for(let s=0;s<i.length;s+=1){let c=i[s]??"";for(let d of c.matchAll(H)){let g=d[0].replace(/^\.?\//,"");if(!o.has(g))continue;let l=j(i,s);if(l.length===0)continue;let a=r.get(g)??[];a.push(l),r.set(g,M(a).slice(0,3))}}return r}function M(t){let n=[];for(let e of new Set(t))n.some(i=>nt(i,e))||n.push(e);return n}function nt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),o=Math.min(e.length,i.length);if(o===0)return!1;if(o<3)return t.includes(n)||n.includes(t);let r=new Set(i),s=e.filter(c=>r.has(c)).length;return s>=3&&s/o>=.6}function et(t,n){let e;try{e=A(D(t.config.projectRoot,n),"utf-8")}catch{return null}let i=_(t,n,e),o=v(t,"doc-path-tokens",n,i);if(o!==null)try{return JSON.parse(o)}catch{}let r=[...new Set([...e.matchAll(H)].map(s=>s[0].replace(/^\.?\//,"")))];return N(t,"doc-path-tokens",n,i,JSON.stringify(r)),r}export{j as a,q as b,lt as c,ut as d};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-GLJAAKDW.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-NNDYO2DX.js";import{a as X}from"./chunk-
|
|
2
|
-
`),{path:r,findingCount:n.length}}function ie(e,i={}){let n=k(e,i.path);if(!se(n))throw new Error(`No baseline found at ${n}. Create one with: scip-query health --write-baseline`);let r=JSON.parse(ae(n,"utf-8")),o=new Set(r.findings??[]),s=ne(e,{scope:i.scope}),t=new Set(s);return{baselinePath:n,baselineCount:o.size,current:s,newFindings:s.filter(c=>!o.has(c)),fixedFindings:[...o].filter(c=>!t.has(c))}}var Bn=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function Mn(e,i={}){let n=i.base??"HEAD",{minTogether:r=6,minConfidence:o=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:t=Number.POSITIVE_INFINITY,minSimilarity:c=.8}=i,a=new Set(i.skip??[]),f=P(e,{base:n}),g=I(e,{base:n,plan:f}),u=g.changedFiles,d=new Set(u),l=new Set(f.changedFileLines),p=Xe(e.config.projectRoot,n,f),h={base:n,changedFiles:u,changedSymbols:g.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],rootCauseGroups:[],note:g.summary.note};if(u.length===0)return h;let m=(b,S)=>{if(a.has(b)){h.skipped.push({check:b,reason:"skipped via --skip"});return}S()};return m("echo",()=>De(e,g.changedSymbols,d,p,s,c,h)),m("incomplete-migration",()=>je(e,n,f,t,h)),m("co-change-partner",()=>Ee(e,d,r,o,h)),m("doc-reference",()=>Me(e,d,l,f.changedRanges,h)),m("unused-params",()=>Je(e,u,h)),m("new-dead",()=>Ze(e,g.changedSymbols,p,h)),m("baseline",()=>tn(e,h)),$e(h,e.config.suppressions??[]),h.rootCauseGroups=be(h.findings),h}function be(e){let i=new Map;for(let n of e){let r=n.groupKey??`${n.check}:${n.id}`,o=i.get(r);o||(o={groupKey:r,check:n.check,severity:n.severity,actionTier:n.actionTier,sourceAnalyzer:n.sourceAnalyzer,rootCauseKey:n.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:n.message,remediation:n.remediation},i.set(r,o)),o.count+=1,o.findingIds.push(n.id),o.severity=Ce(o.severity,n.severity),o.actionTier=Se(o.actionTier,n.actionTier),n.file&&o.files.add(n.file);for(let s of n.relatedFiles??[])o.relatedFiles.add(s)}return[...i.values()].map(n=>({...n,files:[...n.files].sort(),relatedFiles:[...n.relatedFiles].sort()})).sort((n,r)=>r.count-n.count||T(r.severity)-T(n.severity)||n.groupKey.localeCompare(r.groupKey))}function Ce(e,i){return T(i)>T(e)?i:e}function T(e){return e==="error"?2:e==="warning"?1:0}function Se(e,i){return e?i&&te(i)>te(e)?i:e:i}function te(e){return e==="direct"?2:e==="signal"?1:0}function $e(e,i){if(i.length===0||e.findings.length===0)return;let n=[];for(let r of e.findings){let o=i.find(s=>we(s,r));o?e.suppressed.push({finding:r,suppression:o}):n.push(r)}e.findings=n}function we(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function De(e,i,n,r,o,s,t){t.checksRun.push("echo");for(let c of i.slice(0,o)){if(r(c))continue;let a=W(e,c.symbol,{minSimilarity:s,limit:5}),f=[];for(let l of a){let p=l.fileA===c.file?l.fileB:l.fileA,h=l.fileA===c.file?l.shortNameB:l.shortNameA,m=l.fileA===c.file?l.symbolB:l.symbolA;n.has(p)||f.push({otherFile:p,otherShort:h,otherSymbol:m,similarity:l.similarity,similarityBasis:l.similarityBasis??"callees",sharedEvidence:l.sharedCallees})}if(f.length===0)continue;let g=f[0],u=C("echo",c.symbol,c.file,...f.map(l=>`${l.otherSymbol}|${l.otherFile}`).sort()),d=ke(c,f);t.findings.push({id:u,groupKey:u,actionTier:d,check:"echo",severity:"warning",evidence:"heuristic",confidence:g.similarity,file:c.file,symbol:c.symbol,relatedFiles:[...new Set(f.map(l=>l.otherFile))].sort(),message:xe(c,f),why:Ae(c,f),remediation:Ge(d,c.shortName,g.otherShort),suppressionHint:`scip-query: ignore echo ${u} -- <reason>`})}i.length>o&&t.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function ke(e,i){return i.some(r=>Re(e.symbol,r))?"direct":"signal"}function Re(e,i){if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let n=$(e),r=$(i.otherSymbol);return!n||!r?!1:n===r?!0:ve(i.sharedEvidence)?!1:Te(n,r)}function Te(e,i){let n=re(e),r=re(i);if(n.length===0||r.length===0)return!1;let o=new Set(r),s=n.filter(t=>o.has(t)).length;return s>=2&&s/Math.min(n.length,r.length)>=.5}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var Fe=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function ve(e){return e.length>=3&&e.every(i=>Fe.has(i.toLowerCase()))}function xe(e,i){let n=i[0],r=Math.round(n.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${r}% similar to established ${n.otherShort} (${n.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${r}% similar to ${n.otherShort} (${n.otherFile})`}function Ae(e,i){let n=[`${e.shortName} was changed in this diff.`];for(let r of i.slice(0,3))n.push(`${r.otherShort} is outside this diff and scored ${Math.round(r.similarity*100)}% similar by ${r.similarityBasis} evidence.`),n.push(`Shared evidence: ${r.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&n.push(`${i.length-3} additional similar match(es) grouped into this finding.`),n}function Ge(e,i,n){return e==="direct"?`Extract or reuse the shared behavior with ${n}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function je(e,i,n,r,o){let s=X(e,{base:i,maxHelpers:r,diffPlan:n});if(!s.available){o.skipped.push({check:"incomplete-migration",reason:"no git history"});return}o.checksRun.push("incomplete-migration"),s.note&&o.skipped.push({check:"incomplete-migration",reason:s.note});for(let t of s.findings){let c=t.leftovers.map(l=>`${l.shortName} (${l.file}, ${Math.round(l.containment*100)}% helper / ${Math.round(l.siteCoverage*100)}% site, ${l.migrationScope})`).join(", "),a=t.leftovers.map(l=>`${l.shortName}: ${l.migrationScope} (${l.migrationScopeReasons[0]})`).join("; "),f=[...t.migratedFiles,...t.leftovers.map(l=>l.file)],g=t.leftovers.length===0?void 0:Math.max(...t.leftovers.map(l=>Math.min(l.containment,l.siteCoverage))),u=t.leftovers.some(l=>l.migrationScope==="possible-subtype"),d=C("incomplete-migration",t.helperSymbol,t.helperFile,f.join("|"));o.findings.push({id:d,check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:g,file:t.helperFile,symbol:t.helperSymbol,relatedFiles:f,message:`new helper ${t.helperShortName} (${t.helperFile}) is wired into ${t.migratedFiles.length} file(s), but ${t.leftovers.length} similar un-migrated site(s) remain: ${c}`,why:[`${t.helperShortName} is new in this diff and already referenced by ${t.migratedFiles.join(", ")}.`,`Helper shape: ${t.helperShape}; ${t.specificHelperCalleeCount}/${t.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${c}.`,`Migration scope hints: ${a}.`],remediation:u?`Migrate same-scope sites to ${t.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${t.helperShortName}, or confirm they are intentionally different.`,suppressionHint:`scip-query: ignore incomplete-migration ${d} -- <reason>`})}}function Ee(e,i,n,r,o){let s=L(e,{minTogether:n,minConfidence:0,maxFilesPerCommit:20});if(!s){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let t=new Set,c=B(e);for(let a of s){let f=i.has(a.fileA),g=i.has(a.fileB);if(f===g)continue;let u=f?a.fileA:a.fileB,d=f?a.fileB:a.fileA,l=f?a.changesA:a.changesB,p=l>0?a.together/l:0;if(p<r||F(d)||F(u)||!x(`${e.config.projectRoot}/${d}`))continue;let h=`${u}|${d}`;if(t.has(h))continue;t.add(h);let m=C("co-change-partner",u,d,String(a.together)),b=N(u,d),S=K({fileA:u,fileB:d,together:a.together,confidence:p,commitScope:a.commitScope,recency:a.recency,subjectContext:a.subjectContext},b,c(u,d)),A=[u,d].sort().join("|");o.findings.push({id:m,check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${A}`,confidence:p,file:u,relatedFiles:[d],sourceAnalyzer:"co-change",rootCauseKey:A,partnerClass:b.partnerClass,partnerClassReasons:b.reasons,commitScope:a.commitScope,recency:a.recency,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:a.broadCommitRatio,lastTogetherAt:a.lastTogetherAt,recentTogether:a.recentTogether,subjectContext:a.subjectContext,...S?{declaredCouplingSuggestion:S}:{},message:`${u} changed, but ${d} did not \u2014 they change together ${a.together}x (${Math.round(p*100)}% of the time)`,why:[`${u} is in this diff and ${d} is not.`,`Git history shows ${a.together} co-change(s), which is ${Math.round(p*100)}% of changes to the edited side.`,`History context: ${Le(a)}.`,`Subject context: ${Ne(a.subjectContext)}.`,...Ke(a),`Partner class: ${b.partnerClass} (${b.reasons.join("; ")}).`],remediation:S?`Update ${d} alongside this change, declare the coupling "${S.name}", or confirm the coupling no longer holds.`:`Update ${d} alongside this change, or confirm the coupling no longer holds.`,suppressionHint:`scip-query: ignore co-change-partner ${m} -- <reason>`})}}function Le(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${Be(e.lastTogetherAt)}`}function Ne(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",n=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",r=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(o=>`"${o}"`).join("; "):"none";return`labels ${i}; refs ${n}; samples ${r}; external issue/PR labels ${e.externalIssueLabelStatus}`}function Ke(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function Be(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}function Me(e,i,n,r,o){o.checksRun.push("doc-reference");let s=Oe(e,i,r);if(s.size!==0)for(let t of z(e,s)){if(n.has(t.doc))continue;let c=t.citedClaims.length>0?t.citedClaims:Pe(e,t.doc,t.cited),a=Ie(c),f=C("doc-reference",t.doc,t.cited.join("|"));o.findings.push({id:f,check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:a.actionTier,confidence:1,file:t.doc,relatedFiles:t.cited,citationKind:a.citationKind,citationKindReasons:a.reasons,citedClaims:c,message:`${t.doc} cites ${t.cited.join(", ")} as ${_e(a.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${t.cited.join(", ")} changed in this diff.`,`${t.doc} cites the changed file(s) but was not updated in the same diff.`,...a.reasons.map(g=>`Citation kind evidence: ${g}`)],remediation:ze(a.citationKind,t.doc),suppressionHint:`scip-query: ignore doc-reference ${f} -- <reason>`})}}function Ie(e){let i=e.join(`
|
|
3
|
-
`).toLowerCase(),n=[],r=v(i,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(r.length>0)return n.push(`configuration/example terms near citation: ${r.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:n};let o=v(i,["accepted","intentional","intentionally","retained","historical"]);if(o.length>0)return n.push(`intentional-record terms near citation: ${o.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:n};let s=v(i,["command","cli","usage","example","run","workflow"]);return s.length>0?(n.push(`guide/reference terms near citation: ${s.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:n}):(n.push(e.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:n})}function Pe(e,i,n){let r;try{r=oe(`${e.config.projectRoot}/${i}`,"utf-8").split(/\r?\n/)}catch{return[]}let o=n.flatMap(He),s=[];for(let t=0;t<r.length;t+=1){let c=r[t]??"";o.some(a=>c.includes(a))&&s.push(_(r,t))}return s}function He(e){let i=e.split("/");return[e,`./${e}`,i.slice(-3).join("/"),i.slice(-2).join("/")].filter((n,r,o)=>n.length>0&&o.indexOf(n)===r)}function v(e,i){return i.filter(n=>e.includes(n))}function _e(e){switch(e){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function ze(e,i){switch(e){case"behavioral-claim":return`Re-read ${i} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${i} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${i} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${i} is still meant to name this file.`}}function Oe(e,i,n){let r=qe(n),o=new Set;for(let s of i)Ue(e,s,r.get(s)??[])&&o.add(s);return o}function qe(e){let i=new Map;for(let n of e){let r=i.get(n.file)??[];r.push(n),i.set(n.file,r)}return i}function Ue(e,i,n){if(n.length===0)return!1;if(!Ve.test(i))return!0;let r=`${e.config.projectRoot}/${i}`;if(!x(r))return!0;let o=oe(r,"utf-8").split(/\r?\n/),s=We(o);for(let t of n)for(let c=t.startLine;c<=t.endLine;c+=1)if((o[c]??"").trim()!==""&&!s.has(c))return!0;return!1}var Ve=/\.(?:[cm]?[jt]sx?)$/i;function We(e){let i=new Set,n=!1;for(let r=0;r<e.length;r+=1){let o=e[r].trim();!n&&Ye(o)&&(n=!0),n&&(i.add(r),o.endsWith(";")&&(n=!1))}return i}function Ye(e){return/^import(?:\s|$)/.test(e)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(e)}function Je(e,i,n){n.checksRun.push("unused-params");for(let r of ee(e,{files:i,limit:50})){let o=C("unused-params",r.symbol,r.file,r.unusedTrailing.join("|"));n.findings.push({id:o,check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:r.file,startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,message:`${r.shortName} (${r.file}) has trailing unused parameter(s): ${r.unusedTrailing.join(", ")}`,why:[`${r.shortName} is in a changed file.`,`The trailing parameter(s) ${r.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments.",suppressionHint:`scip-query: ignore unused-params ${o} -- <reason>`})}}function Ze(e,i,n,r){r.checksRun.push("new-dead");let o=new j(e);for(let s of i){if(n(s)||s.fanIn>0||o.fileKind(s.file)==="test"||w(e,s.file)||D(e,s.symbol,s.file)||Qe(s.symbol))continue;let t=C("new-dead",s.symbol,s.file);r.findings.push({id:t,check:"new-dead",severity:"warning",evidence:"graph-fact",confidence:.9,file:s.file,symbol:s.symbol,message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,why:[`${s.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:"Wire it up, or remove it before it becomes permanent dead code.",suppressionHint:`scip-query: ignore new-dead ${t} -- <reason>`})}}function Qe(e){if(G(e)!=="type")return!1;let i=$(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function Xe(e,i,n){let r=new Map(n.renamedFiles.map(s=>[s.to,s.from])),o=new Map;return s=>{let t=r.get(s.file)
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as ee}from"./chunk-NNDYO2DX.js";import{a as X}from"./chunk-YVLHL6KQ.js";import{a as y}from"./chunk-B32FX5KB.js";import{a as Q}from"./chunk-SPE4YCOT.js";import{a as J}from"./chunk-ZFMPHDAT.js";import{a as Z}from"./chunk-C2QSK7E7.js";import{a as W,b as Y}from"./chunk-UQJGTVHV.js";import{a as U}from"./chunk-G3WGZU5Q.js";import{a as V}from"./chunk-DE7MA6OD.js";import{a as q}from"./chunk-7KCSELEV.js";import{b as I,c as P,f as H}from"./chunk-NP5HYVLX.js";import{a as _,d as z}from"./chunk-GLJAAKDW.js";import{a as O}from"./chunk-AW4N6MGC.js";import{b as E}from"./chunk-C3MZZ2ZN.js";import{a as F,c as N,d as K,e as B}from"./chunk-EYLXU575.js";import{g as L}from"./chunk-KRGBLZT2.js";import{a as M}from"./chunk-CJJP64OC.js";import{a as j}from"./chunk-3ZYF3ELZ.js";import{f as w,g as D}from"./chunk-ZQLO2SCU.js";import{d as $,e as G}from"./chunk-JM72FNGA.js";import{createHash as ye}from"crypto";import{existsSync as x,readFileSync as oe}from"fs";import{existsSync as se,readFileSync as ae,writeFileSync as ce}from"fs";import{isAbsolute as le,join as fe}from"path";var de=75e3,ue=5e3,he=2500;function ge(e){let i=Z(e);return i.symbols>=de||i.documents>=ue?he:void 0}var pe=".scipquery-baseline.json";function k(e,i){return i&&le(i)?i:fe(e.config.projectRoot,i??pe)}function ne(e,i={}){let{scope:n}=i,r=ge(e),o=[],s=E(e,{scope:n,...y.dead,scanLimit:r});for(let t of s.symbols)w(e,t.relativePath)||D(e,t.symbol,t.relativePath)||t.kind==="dead-code"&&o.push(`dead:${t.relativePath}:${t.shortName}`);for(let t of U(e,{scope:n,...y.isolated,scanLimit:r}))w(e,t.relativePath)||D(e,t.symbol,t.relativePath)||o.push(`isolated:${t.relativePath}:${t.shortName}`);for(let t of M(e,{scope:n}))t.kind==="real"&&o.push(`cycle:${me(t.path)}`);for(let t of Y(e,{scope:n,...y.similar,scanLimit:r}))o.push(`similar:${[t.symbolA,t.symbolB].sort().join("|")}`);for(let t of q(e,{scope:n,...y.extract,scanLimit:r}))o.push(`extract:${t.relativePath}:${t.shortName}`);for(let t of Q(e,{scope:n,...y.wrappers,scanLimit:r}))o.push(`wrapper:${t.file}:${t.shortName}`);for(let t of V(e,{scope:n,...y.passthroughs,scanLimit:r}))o.push(`passthrough:${t.file}:${t.shortName}`);for(let t of J(e,{scope:n,...y.stale,scanLimit:r}))o.push(`stale:${t.file}:${t.shortName}`);for(let t of O(e,{scope:n,...y.drift}).results)t.kind!=="pattern-deviation"&&o.push(`drift:${t.kind}:${t.file}:${t.dep}`);return[...new Set(o)].sort()}function me(e){if(e.length===0)return"";let i=0;for(let n=1;n<e.length;n++)e[n]<e[i]&&(i=n);return[...e.slice(i),...e.slice(0,i)].join(">")}function $n(e,i={}){let n=ne(e,{scope:i.scope}),r=k(e,i.path);return ce(r,JSON.stringify({version:1,findings:n},null,2)+`
|
|
2
|
+
`),{path:r,findingCount:n.length}}function ie(e,i={}){let n=k(e,i.path);if(!se(n))throw new Error(`No baseline found at ${n}. Create one with: scip-query health --write-baseline`);let r=JSON.parse(ae(n,"utf-8")),o=new Set(r.findings??[]),s=ne(e,{scope:i.scope}),t=new Set(s);return{baselinePath:n,baselineCount:o.size,current:s,newFindings:s.filter(c=>!o.has(c)),fixedFindings:[...o].filter(c=>!t.has(c))}}var Bn=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function Mn(e,i={}){let n=i.base??"HEAD",{minTogether:r=6,minConfidence:o=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:t=Number.POSITIVE_INFINITY,minSimilarity:c=.8}=i,a=new Set(i.skip??[]),f=P(e,{base:n}),g=I(e,{base:n,plan:f}),u=g.changedFiles,d=new Set(u),l=new Set(f.changedFileLines),m=Xe(e.config.projectRoot,n,f),h={base:n,changedFiles:u,changedSymbols:g.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],rootCauseGroups:[],note:g.summary.note};if(u.length===0)return h;let p=(b,S)=>{if(a.has(b)){h.skipped.push({check:b,reason:"skipped via --skip"});return}S()};return p("echo",()=>De(e,g.changedSymbols,d,m,s,c,h)),p("incomplete-migration",()=>je(e,n,f,t,h)),p("co-change-partner",()=>Ee(e,d,r,o,h)),p("doc-reference",()=>Me(e,d,l,f.changedRanges,h)),p("unused-params",()=>Je(e,u,h)),p("new-dead",()=>Ze(e,g.changedSymbols,m,h)),p("baseline",()=>tn(e,h)),$e(h,e.config.suppressions??[]),h.rootCauseGroups=be(h.findings),h}function be(e){let i=new Map;for(let n of e){let r=n.groupKey??`${n.check}:${n.id}`,o=i.get(r);o||(o={groupKey:r,check:n.check,severity:n.severity,actionTier:n.actionTier,sourceAnalyzer:n.sourceAnalyzer,rootCauseKey:n.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:n.message,remediation:n.remediation},i.set(r,o)),o.count+=1,o.findingIds.push(n.id),o.severity=Ce(o.severity,n.severity),o.actionTier=Se(o.actionTier,n.actionTier),n.file&&o.files.add(n.file);for(let s of n.relatedFiles??[])o.relatedFiles.add(s)}return[...i.values()].map(n=>({...n,files:[...n.files].sort(),relatedFiles:[...n.relatedFiles].sort()})).sort((n,r)=>r.count-n.count||T(r.severity)-T(n.severity)||n.groupKey.localeCompare(r.groupKey))}function Ce(e,i){return T(i)>T(e)?i:e}function T(e){return e==="error"?2:e==="warning"?1:0}function Se(e,i){return e?i&&te(i)>te(e)?i:e:i}function te(e){return e==="direct"?2:e==="signal"?1:0}function $e(e,i){if(i.length===0||e.findings.length===0)return;let n=[];for(let r of e.findings){let o=i.find(s=>we(s,r));o?e.suppressed.push({finding:r,suppression:o}):n.push(r)}e.findings=n}function we(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function De(e,i,n,r,o,s,t){t.checksRun.push("echo");for(let c of i.slice(0,o)){if(r(c))continue;let a=W(e,c.symbol,{minSimilarity:s,limit:5}),f=[];for(let l of a){let m=l.fileA===c.file?l.fileB:l.fileA,h=l.fileA===c.file?l.shortNameB:l.shortNameA,p=l.fileA===c.file?l.symbolB:l.symbolA;n.has(m)||f.push({otherFile:m,otherShort:h,otherSymbol:p,similarity:l.similarity,similarityBasis:l.similarityBasis??"callees",sharedEvidence:l.sharedCallees})}if(f.length===0)continue;let g=f[0],u=C("echo",c.symbol,c.file,...f.map(l=>`${l.otherSymbol}|${l.otherFile}`).sort()),d=ke(c,f);t.findings.push({id:u,groupKey:u,actionTier:d,check:"echo",severity:"warning",evidence:"heuristic",confidence:g.similarity,file:c.file,symbol:c.symbol,relatedFiles:[...new Set(f.map(l=>l.otherFile))].sort(),message:xe(c,f),why:Ae(c,f),remediation:Ge(d,c.shortName,g.otherShort),suppressionHint:`scip-query: ignore echo ${u} -- <reason>`})}i.length>o&&t.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function ke(e,i){return i.some(r=>Re(e.symbol,r))?"direct":"signal"}function Re(e,i){if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let n=$(e),r=$(i.otherSymbol);return!n||!r?!1:n===r?!0:ve(i.sharedEvidence)?!1:Te(n,r)}function Te(e,i){let n=re(e),r=re(i);if(n.length===0||r.length===0)return!1;let o=new Set(r),s=n.filter(t=>o.has(t)).length;return s>=2&&s/Math.min(n.length,r.length)>=.5}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var Fe=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function ve(e){return e.length>=3&&e.every(i=>Fe.has(i.toLowerCase()))}function xe(e,i){let n=i[0],r=Math.round(n.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${r}% similar to established ${n.otherShort} (${n.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${r}% similar to ${n.otherShort} (${n.otherFile})`}function Ae(e,i){let n=[`${e.shortName} was changed in this diff.`];for(let r of i.slice(0,3))n.push(`${r.otherShort} is outside this diff and scored ${Math.round(r.similarity*100)}% similar by ${r.similarityBasis} evidence.`),n.push(`Shared evidence: ${r.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&n.push(`${i.length-3} additional similar match(es) grouped into this finding.`),n}function Ge(e,i,n){return e==="direct"?`Extract or reuse the shared behavior with ${n}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function je(e,i,n,r,o){let s=X(e,{base:i,maxHelpers:r,diffPlan:n});if(!s.available){o.skipped.push({check:"incomplete-migration",reason:"no git history"});return}o.checksRun.push("incomplete-migration"),s.note&&o.skipped.push({check:"incomplete-migration",reason:s.note});for(let t of s.findings){let c=t.leftovers.map(l=>`${l.shortName} (${l.file}, ${Math.round(l.containment*100)}% helper / ${Math.round(l.siteCoverage*100)}% site, ${l.migrationScope})`).join(", "),a=t.leftovers.map(l=>`${l.shortName}: ${l.migrationScope} (${l.migrationScopeReasons[0]})`).join("; "),f=[...t.migratedFiles,...t.leftovers.map(l=>l.file)],g=t.leftovers.length===0?void 0:Math.max(...t.leftovers.map(l=>Math.min(l.containment,l.siteCoverage))),u=t.leftovers.some(l=>l.migrationScope==="possible-subtype"),d=C("incomplete-migration",t.helperSymbol,t.helperFile,f.join("|"));o.findings.push({id:d,check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:g,file:t.helperFile,symbol:t.helperSymbol,relatedFiles:f,message:`new helper ${t.helperShortName} (${t.helperFile}) is wired into ${t.migratedFiles.length} file(s), but ${t.leftovers.length} similar un-migrated site(s) remain: ${c}`,why:[`${t.helperShortName} is new in this diff and already referenced by ${t.migratedFiles.join(", ")}.`,`Helper shape: ${t.helperShape}; ${t.specificHelperCalleeCount}/${t.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${c}.`,`Migration scope hints: ${a}.`],remediation:u?`Migrate same-scope sites to ${t.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${t.helperShortName}, or confirm they are intentionally different.`,suppressionHint:`scip-query: ignore incomplete-migration ${d} -- <reason>`})}}function Ee(e,i,n,r,o){let s=L(e,i,{minTogether:n,minConfidence:0,maxFilesPerCommit:20});if(!s){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let t=new Set,c;for(let a of s){let f=i.has(a.fileA),g=i.has(a.fileB);if(f===g)continue;let u=f?a.fileA:a.fileB,d=f?a.fileB:a.fileA,l=f?a.changesA:a.changesB,m=l>0?a.together/l:0;if(m<r||F(d)||F(u)||!x(`${e.config.projectRoot}/${d}`))continue;let h=`${u}|${d}`;if(t.has(h))continue;t.add(h);let p=C("co-change-partner",u,d,String(a.together)),b=N(u,d),S=K({fileA:u,fileB:d,together:a.together,confidence:m,commitScope:a.commitScope,recency:a.recency,subjectContext:a.subjectContext},b,(c??=B(e))(u,d)),A=[u,d].sort().join("|");o.findings.push({id:p,check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${A}`,confidence:m,file:u,relatedFiles:[d],sourceAnalyzer:"co-change",rootCauseKey:A,partnerClass:b.partnerClass,partnerClassReasons:b.reasons,commitScope:a.commitScope,recency:a.recency,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:a.broadCommitRatio,lastTogetherAt:a.lastTogetherAt,recentTogether:a.recentTogether,subjectContext:a.subjectContext,...S?{declaredCouplingSuggestion:S}:{},message:`${u} changed, but ${d} did not \u2014 they change together ${a.together}x (${Math.round(m*100)}% of the time)`,why:[`${u} is in this diff and ${d} is not.`,`Git history shows ${a.together} co-change(s), which is ${Math.round(m*100)}% of changes to the edited side.`,`History context: ${Le(a)}.`,`Subject context: ${Ne(a.subjectContext)}.`,...Ke(a),`Partner class: ${b.partnerClass} (${b.reasons.join("; ")}).`],remediation:S?`Update ${d} alongside this change, declare the coupling "${S.name}", or confirm the coupling no longer holds.`:`Update ${d} alongside this change, or confirm the coupling no longer holds.`,suppressionHint:`scip-query: ignore co-change-partner ${p} -- <reason>`})}}function Le(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${Be(e.lastTogetherAt)}`}function Ne(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",n=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",r=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(o=>`"${o}"`).join("; "):"none";return`labels ${i}; refs ${n}; samples ${r}; external issue/PR labels ${e.externalIssueLabelStatus}`}function Ke(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function Be(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}function Me(e,i,n,r,o){o.checksRun.push("doc-reference");let s=Oe(e,i,r);if(s.size!==0)for(let t of z(e,s)){if(n.has(t.doc))continue;let c=t.citedClaims.length>0?t.citedClaims:Pe(e,t.doc,t.cited),a=Ie(c),f=C("doc-reference",t.doc,t.cited.join("|"));o.findings.push({id:f,check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:a.actionTier,confidence:1,file:t.doc,relatedFiles:t.cited,citationKind:a.citationKind,citationKindReasons:a.reasons,citedClaims:c,message:`${t.doc} cites ${t.cited.join(", ")} as ${_e(a.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${t.cited.join(", ")} changed in this diff.`,`${t.doc} cites the changed file(s) but was not updated in the same diff.`,...a.reasons.map(g=>`Citation kind evidence: ${g}`)],remediation:ze(a.citationKind,t.doc),suppressionHint:`scip-query: ignore doc-reference ${f} -- <reason>`})}}function Ie(e){let i=e.join(`
|
|
3
|
+
`).toLowerCase(),n=[],r=v(i,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(r.length>0)return n.push(`configuration/example terms near citation: ${r.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:n};let o=v(i,["accepted","intentional","intentionally","retained","historical"]);if(o.length>0)return n.push(`intentional-record terms near citation: ${o.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:n};let s=v(i,["command","cli","usage","example","run","workflow"]);return s.length>0?(n.push(`guide/reference terms near citation: ${s.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:n}):(n.push(e.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:n})}function Pe(e,i,n){let r;try{r=oe(`${e.config.projectRoot}/${i}`,"utf-8").split(/\r?\n/)}catch{return[]}let o=n.flatMap(He),s=[];for(let t=0;t<r.length;t+=1){let c=r[t]??"";o.some(a=>c.includes(a))&&s.push(_(r,t))}return s}function He(e){let i=e.split("/");return[e,`./${e}`,i.slice(-3).join("/"),i.slice(-2).join("/")].filter((n,r,o)=>n.length>0&&o.indexOf(n)===r)}function v(e,i){return i.filter(n=>e.includes(n))}function _e(e){switch(e){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function ze(e,i){switch(e){case"behavioral-claim":return`Re-read ${i} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${i} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${i} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${i} is still meant to name this file.`}}function Oe(e,i,n){let r=qe(n),o=new Set;for(let s of i)Ue(e,s,r.get(s)??[])&&o.add(s);return o}function qe(e){let i=new Map;for(let n of e){let r=i.get(n.file)??[];r.push(n),i.set(n.file,r)}return i}function Ue(e,i,n){if(n.length===0)return!1;if(!Ve.test(i))return!0;let r=`${e.config.projectRoot}/${i}`;if(!x(r))return!0;let o=oe(r,"utf-8").split(/\r?\n/),s=We(o);for(let t of n)for(let c=t.startLine;c<=t.endLine;c+=1)if((o[c]??"").trim()!==""&&!s.has(c))return!0;return!1}var Ve=/\.(?:[cm]?[jt]sx?)$/i;function We(e){let i=new Set,n=!1;for(let r=0;r<e.length;r+=1){let o=e[r].trim();!n&&Ye(o)&&(n=!0),n&&(i.add(r),o.endsWith(";")&&(n=!1))}return i}function Ye(e){return/^import(?:\s|$)/.test(e)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(e)}function Je(e,i,n){n.checksRun.push("unused-params");for(let r of ee(e,{files:i,limit:50})){let o=C("unused-params",r.symbol,r.file,r.unusedTrailing.join("|"));n.findings.push({id:o,check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:r.file,startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,message:`${r.shortName} (${r.file}) has trailing unused parameter(s): ${r.unusedTrailing.join(", ")}`,why:[`${r.shortName} is in a changed file.`,`The trailing parameter(s) ${r.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments.",suppressionHint:`scip-query: ignore unused-params ${o} -- <reason>`})}}function Ze(e,i,n,r){r.checksRun.push("new-dead");let o=new j(e);for(let s of i){if(n(s)||s.fanIn>0||o.fileKind(s.file)==="test"||w(e,s.file)||D(e,s.symbol,s.file)||Qe(s.symbol))continue;let t=C("new-dead",s.symbol,s.file);r.findings.push({id:t,check:"new-dead",severity:"warning",evidence:"graph-fact",confidence:.9,file:s.file,symbol:s.symbol,message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,why:[`${s.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:"Wire it up, or remove it before it becomes permanent dead code.",suppressionHint:`scip-query: ignore new-dead ${t} -- <reason>`})}}function Qe(e){if(G(e)!=="type")return!1;let i=$(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function Xe(e,i,n){let r=new Map(n.renamedFiles.map(s=>[s.to,s.from])),o=new Map;return s=>{let t=r.get(s.file)??s.file,c=$(s.symbol);if(!c)return!1;let a=o.get(t);return a===void 0&&(a=H(e,i,t),o.set(t,a)),a!==null&&en(a,c)}}function en(e,i){return new RegExp(`\\b${nn(i)}\\b`).test(e)}function nn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tn(e,i){if(!x(k(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let n=ie(e);for(let r of n.newFindings){let o=rn(r),s=C("baseline",r);i.findings.push({id:s,groupKey:`baseline:${o.sourceAnalyzer}:${o.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:o.actionTier,confidence:1,file:o.file,relatedFiles:o.relatedFiles.length>0?o.relatedFiles:void 0,sourceAnalyzer:o.sourceAnalyzer,rootCauseKey:o.rootCauseKey,message:`new ${o.label} vs committed baseline: ${r}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${o.sourceAnalyzer}.`,`Inherited action tier: ${o.actionTier}.`,`Root cause key: ${o.rootCauseKey}.`,...o.why],remediation:o.remediation,suppressionHint:`scip-query: ignore baseline ${s} -- <reason>`})}}function rn(e){let[i,n]=R(e,":"),r=i||"unknown",o=(s={})=>{let t=s.actionTier??on(r);return{sourceAnalyzer:r,actionTier:t,rootCauseKey:s.rootCauseKey??(n||e),label:s.label??`${r} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??sn(t,r),file:s.file}};if(!n)return o({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(r)){let[s,t]=R(n,":");return o({file:s,relatedFiles:s?[s]:[],rootCauseKey:t?`${s}:${t}`:n,label:`${r} finding`,why:t?[`Baseline subject: ${t}.`]:[]})}if(r==="cycle"){let s=n.split(">").filter(Boolean);return o({relatedFiles:s,rootCauseKey:n,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(r==="similar"){let s=n.split("|").filter(Boolean);return o({relatedFiles:[],rootCauseKey:n,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(r==="drift"){let[s,t]=R(n,":"),[c,a]=R(t,":");return o({actionTier:s==="unused-import"?"direct":"signal",file:c,relatedFiles:[...new Set([c,a].filter(Boolean))],rootCauseKey:n,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...a?[`Related dependency: ${a}.`]:[]]})}return o({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function on(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function sn(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function R(e,i){let n=e.indexOf(i);return n<0?[e,""]:[e.slice(0,n),e.slice(n+i.length)]}function C(e,...i){return`SQ${ye("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{ne as a,$n as b,ie as c,Bn as d,Mn as e,Xe as f};
|
|
4
|
+
//# sourceMappingURL=chunk-I7TSQZ3J.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{d as y}from"./chunk-7S5E7KWT.js";import{execFileSync as H}from"child_process";var F=2e3,E=50,j=8,M=3,D=2160*60*60,L=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,O=3,B=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,I=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function S(e){let t=y(e,{clearGroups:["whole-project"]});return(n,r)=>{let i=v(n.config.projectRoot);if(!i)return null;let s=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return s&&s.head===i?s.value:(t.invalidate(n),t.get(n,()=>({head:i,value:r(n.config.projectRoot,i)})).value)}}var N=S("git-commit-history");function x(e){return N(e,k)}function v(e){try{return A(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function A(e,t){return H("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function k(e,t){let n;try{n=A(e,["log","--no-merges","--name-only","-n",String(F),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let r=[],i=0;for(let s of n.split("")){if(s.trim()==="")continue;let a=s.indexOf(`
|
|
2
|
+
`),d=a>=0?s.slice(0,a):s,[g,f,C]=d.split("\0");if(!g||!f)continue;let c=a>=0?s.slice(a+1).split(`
|
|
3
|
+
`).map(o=>o.trim()).filter(o=>o!==""):[];if(c.length>E){i+=1;continue}r.push({hash:g,timestamp:Number(f)||0,subject:C??"",files:c})}return{head:t,commits:r,skippedBulkCommits:i}}function z(e){return L.test(e.subject)}function Y(e){let t=x(e);if(!t)return null;let n=new Map;for(let r of t.commits){let i=z(r);for(let s of r.files){let a=n.get(s)??{changes:0,fixChanges:0,lastChangedAt:0};a.changes+=1,i&&(a.fixChanges+=1),r.timestamp>a.lastChangedAt&&(a.lastChangedAt=r.timestamp),n.set(s,a)}}return n}function ee(e){let t=x(e);if(!t||t.commits.length===0)return null;let n=t.commits.map(r=>r.files.length).filter(r=>r>0).sort((r,i)=>r-i);return n.length===0?null:{medianFilesPerCommit:R(n,.5),p90FilesPerCommit:R(n,.9),commitsAnalyzed:n.length}}function R(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var G=S("git-tracked-files");function te(e){return G(e,t=>{try{let n=A(t,["ls-files"]);return new Set(n.split(`
|
|
4
|
+
`).map(r=>r.trim()).filter(r=>r!==""))}catch{return null}})}var U=S("git-file-adds");function ne(e){return U(e,t=>J(t))}function J(e){let t;try{t=A(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(F),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,r=-1;for(let i of t.split("")){if(i.trim()==="")continue;r+=1;let s=i.indexOf(`
|
|
5
|
+
`),a=s>=0?i.slice(0,s):i,[,d]=a.split("\0"),g=Number(d)||0;if(!(s<0))for(let f of i.slice(s+1).split(`
|
|
6
|
+
`)){let C=f.trim();C!==""&&n.set(C,{commitsAgo:r,addedAt:g})}}return n}function re(e,t={}){let n=x(e);return n?P(n,t):null}function oe(e,t,n={}){let r=x(e);return r?t.size===0?[]:P(r,n,t):null}function P(e,t,n){let{minTogether:r=4,minConfidence:i=.6,maxFilesPerCommit:s=E}=t,a=new Map,d=new Map,g=0;for(let c of e.commits){let o=[...new Set(c.files)].sort();if(o.length>s)continue;c.timestamp>g&&(g=c.timestamp);let u=V(o),p=n===void 0||o.some(l=>n.has(l));for(let l of o)a.set(l,(a.get(l)??0)+1);if(p)for(let l=0;l<o.length;l++)for(let h=l+1;h<o.length;h++){if(n&&!n.has(o[l])&&!n.has(o[h]))continue;let b=`${o[l]}\0${o[h]}`,m=d.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};m.together+=1,u?m.broadTogether+=1:m.focusedTogether+=1,c.timestamp>m.lastTogetherAt&&(m.lastTogetherAt=c.timestamp),m.timestamps.push(c.timestamp),m.subjects.push(c.subject),d.set(b,m)}}let f=[],C=g-D;for(let[c,o]of d){let u=o.together;if(u<r)continue;let[p,l]=c.split("\0"),h=a.get(p)??u,b=a.get(l)??u,m=Math.max(u/h,u/b);if(m<i)continue;let _=o.broadTogether/u,T=o.timestamps.filter(w=>w>=C).length;f.push({fileA:p,fileB:l,together:u,confidence:m,changesA:h,changesB:b,focusedTogether:o.focusedTogether,broadTogether:o.broadTogether,broadCommitRatio:_,lastTogetherAt:o.lastTogetherAt,recentTogether:T,commitScope:W(o.broadTogether,u),recency:T>0?"recent":"stale",subjectContext:X(o.subjects)})}return f.sort((c,o)=>o.together-c.together||o.confidence-c.confidence||c.fileA.localeCompare(o.fileA)),f}function V(e){return e.length>=j?!0:K(e).size>=M}function K(e){let t=new Set;for(let n of e){let r=n.indexOf("/");t.add(r>=0?n.slice(0,r):".")}return t}function W(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function X(e){let t=new Set,n=[],r=[];for(let i of e){!r.includes(i)&&r.length<O&&r.push(i);for(let s of Z(i))t.add(s);for(let s of i.match(B)??[])n.includes(s)||n.push(s)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:r,externalIssueLabelStatus:"unavailable"}}function Z(e){let t=new Set,n=I.exec(e)?.[1]?.toLowerCase();return n&&t.add($(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function $(e){return e==="feat"?"feature":e}export{x as a,Y as b,ee as c,te as d,ne as e,re as f,oe as g};
|
|
7
|
+
//# sourceMappingURL=chunk-KRGBLZT2.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as T,b as x,e as N,f as _}from"./chunk-3UVJJ6Z7.js";import{b as z}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-3ZYF3ELZ.js";import{a as $}from"./chunk-YTR4CO5S.js";import{a as I}from"./chunk-MZ7APUFN.js";import{c as d,d as E,g as D}from"./chunk-JM72FNGA.js";import{b as B}from"./chunk-D322LMSA.js";import{d as F}from"./chunk-7S5E7KWT.js";function Ae(e,n,i={}){let{minSimilarity:t=.4,limit:r=20}=i,s=ie(e,n,{semantic:i.semantic!==!1});if(!s)return[];if(!D(s.symbol))return[];let o=J(e,s,t,{scanLimit:i.scanLimit,semantic:i.semantic!==!1});return o.length>0?o.slice(0,r):me(e,n,{minSimilarity:t,limit:r})}function J(e,n,i,t){let r=se(e,{minCallees:3,scanLimit:t.scanLimit,semantic:t.semantic}),s=ae(n,r),o=N([n,...r.corpus].map(l=>l.callees)),a=[];for(let l of s){if(l.callees.size<3)continue;let c=j(n,l,o,{minSimilarity:i,requireSignificantShared:1,requireSharedCount:0});c&&a.push(c)}return a.sort((l,c)=>c.similarity-l.similarity),a}function j(e,n,i,t){let{similarity:r,significantShared:s}=_(e.callees,n.callees,i);if(r<t.minSimilarity)return null;let o=T(e.callees,n.callees).size;if(s.length<t.requireSignificantShared&&o<t.requireSharedCount)return null;let a=s.length>0?s:[...T(e.callees,n.callees)],l=K(a,"callees");return{symbolA:e.symbol,shortNameA:d(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:d(n.symbol),fileB:n.file,similarity:r,similarityBasis:"callees",sharedCallees:a.map(d),uniqueToA:[...x(e.callees,n.callees)].map(d),uniqueToB:[...x(n.callees,e.callees)].map(d),...l}}function qe(e,n={}){let{minSimilarity:i=.5,limit:t=20,scope:r,minCallees:s=4,crossFileOnly:o=!1,scanLimit:a}=n,l=G(e,{minCallees:s,scope:r,scanLimit:a,semantic:n.semantic!==!1}),c=N(l.map(m=>m.callees)),f=new Map;for(let m of l)for(let u of m.callees)f.set(u,(f.get(u)??0)+1);let w=Math.max(8,Math.ceil(Math.sqrt(l.length))),y=new Map;for(let m=0;m<l.length;m+=1)for(let u of l[m].callees){if((f.get(u)??0)>w)continue;let g=y.get(u);g||(g=[],y.set(u,g)),g.push(m)}let S=[],b=0,h=new Set;for(let m=0;m<l.length;m+=1){let u=l[m],g=new Set;for(let R of u.callees){let C=y.get(R);if(C)for(let p of C)p>m&&g.add(p)}for(let R of g){let C=`${m}|${R}`;if(h.has(C))continue;h.add(C);let p=l[R];if(o&&u.file===p.file)continue;if(u.paramCount>=0&&p.paramCount>=0){let Q=Math.abs(u.paramCount-p.paramCount),Y=Math.max(2,Math.ceil(Math.max(u.paramCount,p.paramCount)*.5));if(Q>Y)continue}let L=j(u,p,c,{minSimilarity:i,requireSignificantShared:2,requireSharedCount:4});L&&(ee(S,L,t,b),b+=1)}}return S.sort((m,u)=>u.result.similarity-m.result.similarity||m.order-u.order),S.map(m=>m.result)}function ee(e,n,i,t){if(i<=0)return;if(e.length<i){e.push({result:n,order:t});return}let r=0;for(let o=1;o<e.length;o+=1){let a=e[o],l=e[r];(a.result.similarity<l.result.similarity||a.result.similarity===l.result.similarity&&a.order>l.order)&&(r=o)}let s=e[r];n.similarity<=s.result.similarity||(e[r]={result:n,order:t})}var ne=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function ie(e,n,i){let t=I(e,n),r=new v(e);if(!t)return null;let s=$(e,t,{semantic:i.semantic});return{symbol:t.symbol,file:t.relativePath,callees:U(s.map(o=>o.symbol)),paramCount:r.callableSignature(t)?.paramCount??-1}}var te=F("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),re=F("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function G(e,n){let{minCallees:i,scope:t,excludeSymbol:r,scanLimit:s}=n,o=n.semantic!==!1,a=te.get(e,()=>new Map),l=`${i}|${t??""}|${s??""}|${o}`,c=a.get(l);return c||(c=le(e,{minCallees:i,scope:t,scanLimit:s,semantic:o}),a.set(l,c)),r===void 0?c:c.filter(f=>f.symbol!==r)}function se(e,n){let{minCallees:i,scope:t,scanLimit:r}=n,s=n.semantic!==!1,o=re.get(e,()=>new Map),a=`${i}|${t??""}|${r??""}|${s}`,l=o.get(a);return l||(l=oe(G(e,{minCallees:i,scope:t,scanLimit:r,semantic:s})),o.set(a,l)),l}function oe(e){let n=new Map;for(let r of e)for(let s of r.callees)n.set(s,(n.get(s)??0)+1);let i=Math.max(8,Math.ceil(Math.sqrt(e.length))),t=new Map;for(let r of e)for(let s of r.callees){if((n.get(s)??0)>i)continue;let o=t.get(s);o||(o=[],t.set(s,o)),o.push(r)}return{corpus:e,candidateByCallee:t,docFreq:n,ubiquityThreshold:i}}function ae(e,n){let i=new Map;for(let t of e.callees)for(let r of n.candidateByCallee.get(t)??[])r.symbol!==e.symbol&&i.set(r.symbol,r);return i.size>0?[...i.values()]:n.corpus.filter(t=>t.symbol!==e.symbol)}function le(e,n){let{minCallees:i,scope:t,scanLimit:r,semantic:s}=n,o=new v(e),a=z(o.productionCallableDefinitions({scope:t,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r),l=o.calleeMap(a,{semantic:s});return a.map(c=>({symbol:c.symbol,file:c.relativePath,callees:U((l.get(c.symbolId)??[]).map(f=>f.symbol)),paramCount:o.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=i)}function U(e){return new Set([...e].filter(n=>!ce(n)))}function ce(e){return ne.some(n=>e.includes(n))}function me(e,n,i){let t=pe(e,n);if(!t||t.tokens.size<3)return[];let r=i.minSimilarity>=.5?i.minSimilarity:.3,s=[],o=Fe(t,he(e));for(let a of o){if(a.symbol===t.symbol||a.tokens.size<3)continue;let l=T(t.tokens,a.tokens);if(l.size<2)continue;let c=new Set([...t.tokens,...a.tokens]),f=c.size>0?l.size/c.size:0;f<r||s.push({symbolA:t.symbol,shortNameA:d(t.symbol),fileA:t.file,symbolB:a.symbol,shortNameB:d(a.symbol),fileB:a.file,similarity:f,similarityBasis:"source-tokens",sharedCallees:[...l].sort(),uniqueToA:[...x(t.tokens,a.tokens)].sort(),uniqueToB:[...x(a.tokens,t.tokens)].sort(),...K([...l],"source-tokens")})}return s.sort((a,l)=>l.similarity-a.similarity||a.shortNameB.localeCompare(l.shortNameB)),s.slice(0,i.limit)}function K(e,n){let i=e.flatMap(A),t=e.flatMap(m=>O(m,n)),r=M(i,V),s=M(i,Z),o=M(t,q),a=[...new Set(t.filter(P))],l=e.filter(m=>{let u=O(m,n);return u.some(g=>q.has(g))&&u.some(P)}).length,c=[];r.length>0&&c.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),s.length>0&&c.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),o.length>0&&c.push(`domain behavior verbs: ${o.slice(0,5).join(", ")}`),o.length>0&&a.length>0&&c.push(`domain-specific terms: ${a.slice(0,5).join(", ")}`);let f=n==="source-tokens"&&i.length>0&&i.every(m=>H.has(m));f&&c.push("shared source tokens are generic scaffolding");let w=o.length>0&&a.length>0,y=r.length+s.length>0,S=n==="callees"&&w&&e.length>=4&&a.length>=4&&l>=2,b=S?"domain-behavior":w?y?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":s.length>0||f?"framework-scaffolding":"structural-overlap";b==="structural-overlap"&&e.length>0&&c.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let h=b==="domain-behavior"&&(e.length>=3||S)?"direct":"signal";return{evidenceClass:b,actionTier:h,evidenceClassReasons:c,recommendation:ue(b,h)}}function ue(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function M(e,n){return[...new Set(e.filter(i=>n.has(i)))]}function A(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function O(e,n){if(n==="source-tokens")return A(e);let i=E(e);return A(i.length>0?i:fe(e))}function fe(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(t=>t.trim()).filter(t=>/[A-Za-z]/.test(t)).at(-1)?.replace(/\.$/,"")??e}function P(e){return e.length>3&&!q.has(e)&&!V.has(e)&&!Z.has(e)&&!H.has(e)&&!ge.has(e)}var q=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),V=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),Z=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),H=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),ge=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function pe(e,n){let i=I(e,n);if(!i||!D(i.symbol))return null;let t=de(e,i);return t?{symbol:i.symbol,file:i.relativePath,tokens:t}:null}function de(e,n){let i=E(n.symbol),t=W(e,n.relativePath,n.startLine,n.endLine,i),r=X(t,i);return r.size>0?r:null}var be=F("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Se=F("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ye(e){return be.get(e,()=>xe(e))}function he(e){return Se.get(e,()=>Ce(ye(e)))}function Ce(e){let n=new Map;for(let r of e)for(let s of r.tokens)n.set(s,(n.get(s)??0)+1);let i=Math.max(8,Math.ceil(Math.sqrt(e.length))),t=new Map;for(let r of e)for(let s of r.tokens){if((n.get(s)??0)>i)continue;let o=t.get(s);o||(o=[],t.set(s,o)),o.push(r)}return{corpus:e,candidateByToken:t,docFreq:n,ubiquityThreshold:i}}function Fe(e,n){let i=new Map;for(let t of e.tokens)for(let r of n.candidateByToken.get(t)??[])r.symbol!==e.symbol&&i.set(r.symbol,r);return i.size>0?[...i.values()]:n.corpus.filter(t=>t.symbol!==e.symbol)}function xe(e){return new v(e).productionCallableDefinitions().map(i=>({symbol:i.symbol,file:i.relativePath,tokens:X(W(e,i.relativePath,i.startLine,i.endLine,i.leaf),i.leaf)})).filter(i=>i.tokens.size>0)}function W(e,n,i,t,r){let s=B(e,n);if(s.length===0)return"";if(t>=i&&t-i<=12)return s.slice(i,t+1).join(`
|
|
2
|
+
`);let o=[new RegExp(`\\bdef\\s+${k(r)}\\b`),new RegExp(`\\bfun\\s+${k(r)}\\b`),new RegExp(`\\bfn\\s+${k(r)}\\b`),new RegExp(`\\bfunction\\s+${k(r)}\\b`),new RegExp(`\\b${k(r)}\\s*\\(`)],a=s.findIndex(l=>o.some(c=>c.test(l)));if(a>=0){let l=a;for(let c=a+1;c<s.length&&c<=a+8;c++){let f=s[c]??"";if(c>a&&we(f)||(l=c,f.trim()===""&&c>a+1))break}return s.slice(a,l+1).join(`
|
|
3
|
+
`)}return s.slice(i,Math.min(s.length,i+8)).join(`
|
|
4
|
+
`)}function X(e,n){if(!e)return new Set;let i=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),t=ke(n),s=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(o=>o.trim()).filter(o=>o.length>1).filter(o=>!i.has(o)).filter(o=>!t.has(o));return new Set(s)}function ke(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function we(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{Ae as a,qe as b,ee as c,G as d,oe as e,ae as f,U as g,K as h};
|
|
5
|
+
//# sourceMappingURL=chunk-UQJGTVHV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as I}from"./chunk-ICXVNWMI.js";import{a as H}from"./chunk-X7ZY6FFF.js";import{a as p}from"./chunk-FIB4JPEX.js";import{a as T}from"./chunk-YQH353VA.js";import{a as G}from"./chunk-3KLLFNT4.js";import{a as k}from"./chunk-EOZIZWW4.js";import{a as v,b as F}from"./chunk-4ZUJJRWT.js";import{b as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as I}from"./chunk-ICXVNWMI.js";import{a as H}from"./chunk-X7ZY6FFF.js";import{a as p}from"./chunk-FIB4JPEX.js";import{a as T}from"./chunk-YQH353VA.js";import{a as G}from"./chunk-3KLLFNT4.js";import{a as k}from"./chunk-EOZIZWW4.js";import{a as v,b as F}from"./chunk-4ZUJJRWT.js";import{b as A}from"./chunk-EYLXU575.js";import{b as P}from"./chunk-KRGBLZT2.js";import{a as j}from"./chunk-ESG4HBEF.js";import{a as S}from"./chunk-CFL2CNIF.js";import{a as D}from"./chunk-Z4VHYJ5U.js";import{a as w}from"./chunk-TM6GVHA6.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?D(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?k(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,C=s?S(t,e,{maxDepth:o,scope:n.scope}):[],i=w(t,e,{semantic:l}),d=v(t,e),g=F(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||C.length>0,file:i!==null||d.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:C,changeSurface:i,deps:d,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=P(t);if(!o)return n;let r=A(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:G(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
|
|
2
|
+
//# sourceMappingURL=chunk-X474LKJX.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{d as E,
|
|
1
|
+
import{d as E,g as D}from"./chunk-UQJGTVHV.js";import{d as _}from"./chunk-3UVJJ6Z7.js";import{a as N,c as P,f as T}from"./chunk-NP5HYVLX.js";import{a as R}from"./chunk-3ZYF3ELZ.js";import{c as S,d as y}from"./chunk-JM72FNGA.js";var A=5;function ne(e,t={}){let{base:i="HEAD",minContainment:r=.7,minCallees:n=3,minSiteCoverage:o=.4,maxHelpers:a=Number.POSITIVE_INFINITY,limit:g=20}=t,c=t.semantic!==!1,p=t.diffPlan??P(e,{base:i}),s={available:p.note!==N,base:i,changedFiles:p.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!s.available||p.changedFiles.length===0)return s;let v=new R(e),M=new Set(p.changedFiles),q=new Map(p.renamedFiles.map(l=>[l.to,l.from])),f=K(e,v,M,i,q);if(f.length===0)return s;let k=f.slice(0,a);f.length>a&&(s.note=`helper scoring capped at ${a} of ${f.length} new symbols`);let H=E(e,{minCallees:Math.min(3,n),semantic:c}),x=z(H),O=v.calleeMap(k,{semantic:c}),$=k.map(l=>({def:l,callees:D((O.get(l.symbolId)??[]).map(m=>m.symbol))}));for(let{def:l,callees:m}of $){let h=S(l.symbol);if(m.size<n){s.skipped.push({helperShortName:h,helperFile:l.relativePath,reason:`fewer than ${n} meaningful callees \u2014 too small to score`});continue}let w=J(m,x);if(w===0){s.skipped.push({helperShortName:h,helperFile:l.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let b=U(e,l.symbolId);if(b.length===0){s.skipped.push({helperShortName:h,helperFile:l.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}s.helpersChecked+=1;let C=j({candidateIndex:x,changed:M,helperCallees:m,helperFile:l.relativePath,helperSymbol:l.symbol,minContainment:r,minSiteCoverage:o,migratedFiles:b});C.length!==0&&(C.sort((u,d)=>L(d.migrationScope)-L(u.migrationScope)||d.containment-u.containment||d.siteCoverage-u.siteCoverage||u.file.localeCompare(d.file)),s.findings.push({helperSymbol:l.symbol,helperShortName:h,helperFile:l.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:m.size,specificHelperCalleeCount:w,migratedFiles:b.sort(),leftovers:C.slice(0,A)}))}return s.findings.sort((l,m)=>(m.leftovers[0]?.containment??0)-(l.leftovers[0]?.containment??0)||l.helperFile.localeCompare(m.helperFile)),s.findings=s.findings.slice(0,g),s}function z(e){let t=new Map,i=new Map;for(let r of e)for(let n of r.callees){t.set(n,(t.get(n)??0)+1);let o=i.get(n);o||(o=[],i.set(n,o)),o.push(r)}return{candidatesByCallee:i,docFreq:t,ubiquityThreshold:Math.max(8,Math.ceil(Math.sqrt(e.length)))}}function j(e){let t=[],i=B(e.helperSymbol,e.helperFile,e.migratedFiles),r=new Set;for(let n of e.helperCallees)for(let o of e.candidateIndex.candidatesByCallee.get(n)??[])r.add(o);for(let n of r){if(n.symbol===e.helperSymbol||e.changed.has(n.file)||n.callees.has(e.helperSymbol))continue;let o=_(e.helperCallees,n.callees);if(o<e.minContainment)continue;let a=[...e.helperCallees].filter(p=>n.callees.has(p)),g=n.callees.size===0?0:a.length/n.callees.size;if(g<e.minSiteCoverage||!a.some(p=>(e.candidateIndex.docFreq.get(p)??0)<=e.candidateIndex.ubiquityThreshold))continue;let c=V(i,n.symbol,n.file);t.push({symbol:n.symbol,shortName:S(n.symbol),file:n.file,...c,containment:o,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,n.callees.size-a.length),sharedCallees:a.map(S).sort()})}return t}function L(e){return e==="same-scope"?2:e==="unknown"?1:0}function B(e,t,i){let r=new Set([...I(t),...F(y(e))]);for(let n of i)for(let o of I(n))r.add(o);return r}function V(e,t,i){let r=new Set([...I(i),...F(y(t))]);if(e.size===0||r.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let n=[...r].filter(o=>e.has(o)).sort();return n.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${n.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var G=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function I(e){return F(e.replace(/\.[^.]+$/,""))}function F(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>1&&!G.has(t))}function J(e,t){let i=0;for(let r of e)(t.docFreq.get(r)??0)<=t.ubiquityThreshold&&(i+=1);return i}function K(e,t,i,r,n){let o=new Map;return t.productionCallableDefinitions({requireFunctionLikeSymbol:!0}).filter(a=>{if(!i.has(a.relativePath))return!1;let g=n.get(a.relativePath)??a.relativePath,c=o.get(g);return c===void 0&&(c=T(e.config.projectRoot,r,g),o.set(g,c)),c===null||!new RegExp(`\\b${W(a.leaf)}\\b`).test(c)})}function U(e,t){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
5
|
WHERE m.symbol_id = ?
|
|
6
6
|
AND m.role != 1
|
|
7
7
|
${e.pathExclusionsFor("ref_d")}`,t).map(r=>r.relative_path)}function W(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{ne as a};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-YVLHL6KQ.js.map
|