Lines 391-431javascript
391Indexer readiness:`);for(let o of r.indexers){let s=o.runnable?" OK":o.installed?" WARN":" MISSING",a=o.resolvedBinary?` (${o.resolvedBinary})`:"";console.log(`${s} ${o.language}: ${o.binaryLabel}${a}`),o.note&&console.log(` ${o.note}`),!o.installed&&o.installUrl&&console.log(` install: ${o.installUrl}`),o.runnable||(e=!0)}let i=vp(r);i.length>0&&console.log(`
392Semantic provider readiness:`);for(let o of i){let s=o.available?" OK":o.dependencyAvailable?" WARN":" MISSING";console.log(`${s} ${o.language}: ${pR(o)}${xp(o)}`),o.reason&&console.log(` ${o.reason}`)}process.exitCode=e?1:0}function rp(e){op(e,"capabilities")}function ip(e){b(G(e),"json")||console.error('note: capability-matrix is deprecated; use "scip-query capabilities --matrix".'),op(e,"capability-matrix")}function op(e,t){let n=G(e),{projectRoot:r,config:i,paths:o,dbPath:s}=Fe(),a=he(r,i),c=Oe(r,i,o),l=Je(a,{hasIndexedGraph:ke(s)&&c.state!=="missing"});if(b(n,"json")){I(t,[],n,l);re ...
393${m} finding(s) verified fixed against a stable comparison base, ${f} suppressed, ${g} disappeared without comparable evidence \u2014 overall precision ${Math.round(m/h*100)}%.`):g>0&&console.log(`
394${g} finding(s) disappeared without comparable comparison-base evidence; precision is not available.`)}function dp(e){let t=G(e),{report:n,hasIndexerProblems:r,hasErrors:i}=up("doctor");b(t,"json")?I("doctor",[],t,n):cR(n,r),process.exitCode=i?1:0}function up
395Agents reading this project now know to route through the scip-query skills and gate their diffs.`),console.log("Keep the index fresh (`scip-query reindex` or `scip-query watch`) so the gate sees current code.")}async function mp(e){let t=G(e);try{let n={gitHook:b(t,"gitHook"),noHooks:b(t,"noHooks")||t.hooks===!1,dossierDir:w(t,"dossierDir"),runHealth:b(t,"yes")?!1:t.health!==!1,installSkills:t.skills!==!1,installAstParsers:t.parsers!==!1,...b(t,"yes")?{automaticRefresh:!0}:{}},r=b(t,"json"),i=!r&&!b(t,"yes")&&process.stdin.isTTY&&process.stdout.isTTY;(b(t,"guided")||i)&&(n=await rR(n,{json:b( ...
396Reindex complete in ${(R/1e3).toFixed(1)}s`)},onError:R=>{console.error(`
397Watch error: ${R.message}`)}});console.log(`Watching ${n}`),console.log(`Debounce: ${h.debounceMs}ms | Cooldown: ${h.cooldownMs}ms | Git poll: ${h.gitPollMs}ms`),console.log(`Press Ctrl+C to stop.
398`),k.start(),process.on("SIGINT",()=>{k.stop(),x.release(),console.log(`
399Stopped.`),process.exit(0)}),process.once("exit",x.release)}function yp(e,t=!0){let{classification:n}=e;switch(n.kind){case"stopped":return e.lockIsLive&&e.lock?{enabled:t,state:"running",mode:"foreground-or-starting",pid:e.lock.pid,projectRoot:e.identity.projectRoot,worktreeId:e.identity.worktreeId,startedAt:e.lock.startedAt}:{enabled:t,state:"stopped",mode:"none"};
400Language matrix:`);for(let t of e.matrix){console.log(` ${t.language}`);for(let n of[t.indexing,t.sourceFacts,t.semantic,t.detectors,t.cleanupVerification])console.log(` ${n.status.toUpperCase().padEnd(11)} ${n.label}`),console.log(` ${n.reason}`)}}}function rn(e){return{...e,options:C(e.options)}}function Ie({query:e,format:t,emptyMessage:n,heuristicLabel:r,before:i,toJson:o,after:s,...a}){let c=rn(a);return{...c,renderShape:"list",handler:dc({commandName:c.id,query:e,format:t,emptyMessage:n,heuristicLabel:r,before:i,toJson:o,after:s})}}function Sr({query:e,format:t,emptyMes ...
401 Deletion candidates -- confirm with cleanup-plan --verify before deleting.`,_,{count:m.length,loc:h}),!x&&m.length>k.length&&console.log(`
402 Showing top ${k.length} by LOC. Re-run with --full for the remaining ${m.length-k.length}.`)),f.length>0&&(m.length>0&&console.log(""),$r(R,"FILE-INTERNAL ONLY",` Used only within the same file (no cross-file callers). Could be a
403 single-use helper, an abstraction-in-progress, or a callback registered
404 through a framework path that static analysis cannot trace (signal
405 handlers, event listeners, dependency injection). NOT necessarily dead \u2014
406 review case by case.`,z,{count:f.length,loc:y}),!x&&f.length>R.length&&console.log(`
407 Showing top ${R.length} by LOC. Re-run with --full for the remaining ${f.length-R.length}.`)),g.length>0&&((m.length>0||f.length>0)&&console.log(""),$r(D,"IMPLICIT USAGE",` Traits, macros, attributes, ABI exports, or reflection provide a
408 consumer that the static reference graph cannot trace. Investigation
409 signals only \u2014 not deletion candidates and not counted as dead code.`,T,{count:g.length,loc:S}),!x&&g.length>D.length&&console.log(`
410 Showing top ${D.length} by LOC. Re-run with --full for the remaining ${g.length-D.length}.`));let Z=[];l&&Z.push(`${m.length} dead code (${h} LOC)`),d&&Z.push(`${f.length} file-internal (${y} LOC)`),u&&Z.push(`${g.length} implicit usage (${S} LOC)`),console.log(`
411\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`),console.log(`Total: ${m.length+f.length+g.length} symbols \u2014 ${Z.join(" + ")}`)}),Vp=ue("unused-imports",{query:({db:e,args:t,budget:n})=>Rs(e,L(t,
412${e.length} unused import(s)`)}),Hp=gc("isolated",{query:({db:e,opts:t,budget:n})=>Ls(e,{scope:w(t,"scope"),minLoc:P(t,"minLoc",3),scanLimit:n.scanLimit,semantic:n.semantic}),format:e=>` ${oe(e.startLine,
413${e.length} isolated symbol(s)`)}),Wp=K("extract-candidates",({db:e,args:t,opts:n,budget:r})=>{let i=zs(e,{scope:w(n,"scope"),minLoc:P(n,"minLoc",10),minCallees:P(n,"minCallees",6),limit:
414${M(o.relativePath,o.startLine,o.endLine)} ${o.shortName} (${o.loc} LOC, ${o.totalCallees} callees)`),console.log(` Kind: ${o.extractionKind}; tier: ${o.actionTier}`),console.log(` Recommendation: ${o.recommendation}`);
415${i.length} extraction candidate(s) found.`)}),Gp=K("locality-candidates",({db:e,args:t,opts:n,budget:r})=>{let i=Ks(e,{target:B(t,0)||void 0,scope:w(n,"scope"),minConsumers:P(n,"minConsumers",
416${s} ${o.sourceUnit.shortName}`),console.log(` Current directory: ${o.currentDirectory}; tier: ${o.recommendedTier}; action: ${o.actionTier}`),console.log(` Consumer coverage: ${o.consumerCoverage}; consumers: ${o.consumerFiles.length}`),o.nearestCommonOwner&&console.log(` Nearest common owner: ${o.nearestCommonOwner}`),o.suggestedHome&&console.log(` Suggested home: ${o.suggestedHome}`),o.whyNoSuggestedHome&&console.log(` Suggested home withheld: ${o.whyNoSuggestedHome}`),o.boundaryMarkers.length>0&&console.log(` Boundary markers: ${o.boundaryMarkers.join("; ")}`),console.log(` Recomme ...
417${i.length} locality candidate(s) found.`)}),Up=ue("wrapper-candidates",{query:({db:e,opts:t,budget:n})=>aa(e,{scope:w(t,"scope"),maxLoc:P(t,"maxLoc",15),limit:A(t,"limit",30),scanLimit:n.scanLimit,semantic:n.semantic}),format:e=>` ${M(e.file,e.startLine,e.endLine)} ${e.shortName} (${e.loc} LOC)
418 Only called by: ${e.singleCallerShort} (fan-in: ${e.callerFanIn}, tier: ${e.actionTier})`+(e.boundaryEvidence.length>0?`
419 Boundary evidence: ${e.boundaryEvidence.join("; ")}`:""),emptyMessage:()=>"No wrapper candidates found.",heuristicLabel:"wrapper candidates",after:e=>console.log(`
420${e.length} wrapper candidate(s).`)}),Jp=ue("passthrough-candidates",{query:({db:e,opts:t,budget:n})=>oa(e,{scope:w(t,"scope"),maxLoc:P(t,"maxLoc",15),limit:A(t,"limit",30),scanLimit:n.scanLimit,semantic:n.semantic}),format:e=>` ${M(e.file,e.startLine,e.endLine)} ${e.shortName} (${e.loc} LOC)
421 Forwards to: ${e.forwardsToShort} (${e.forwardsToFile}, tier: ${e.actionTier})
422 Recommendation: ${e.recommendation}`+(e.boundaryEvidence.length>0?`
423 Boundary evidence: ${e.boundaryEvidence.join("; ")}`:"")+(e.publicFacadeEvidence.length>0?`
424 Public facade evidence: ${e.publicFacadeEvidence.join("; ")}`:""),emptyMessage:()=>"No passthrough candidates found.",heuristicLabel:"passthrough candidates",after:e=>console.log(`
425${e.length} passthrough candidate(s).`)}),zp=ue("stale-abstractions",{query:({db:e,opts:t,budget:n})=>sa(e,{scope:w(t,"scope"),minLoc:P(t,"minLoc",3),limit:A(t,"limit",30),includeLowConfidence:b(t,"includeLowConfidence"),scanLimit:n.scanLimit,semantic:n.semantic}),format:e=>{let t=e.consumers===0?"unused":`${e.consumers} consumer`,n=e.barrelConsumers>0?`, +${e.barrelConsumers} barrel`:"";return` [${e.confidence}] ${M(e.file,e.startLine,e.endLine)} ${e.shortName} (${e.kind}, ${e.loc} LOC, ${t}${n})
427 Kind: ${e.stalenessKind}; tier: ${e.actionTier}
428 Recommendation: ${e.recommendation}`},emptyMessage:()=>"No stale abstractions found.",heuristicLabel:"stale abstraction candidates",after:e=>console.log(`
429${e.length} stale abstraction(s).`)}),Kp=Dn("complexity-hotspots",{headers:["score"," LOC","fan-in","fan-out","callees","symbol"],query:({db:e,opts:t,budget:n})=>ka(e,{scope:w(t,"scope"),minLoc:P(t,"minLoc",10),limit:A(t,"limit",20),scanLimit:n.scanLimit,semantic:n.semantic}),format:e=>` ${e.score.toFixed(1).padStart(5)} ${String(e.loc).padStart(4)} ${String(e.fanIn).padStart(6)} ${String(e.fanOut).padStart(7)} ${String(e.calleeCount).padStart(7)} ${e.shortName}`,emptyMessage:()=>"No complexity hotspots found.",heuristicLabel:"complexity hotspot candidates",dashWidths:[5,4,6,7,7,6]}),Qp= ...
430${Math.round(t.similarity*100)}% ${n}
431`),console.log(` A: ${t.symbolA.shortName} (${t.symbolA.file}, ${t.symbolA.loc} LOC)`),console.log(` B: ${t.symbolB.shortName} (${t.symbolB.file}, ${t.symbolB.loc} LOC)`),console.log(` Evidence class: ${
Long lines were clipped for display.