scip-query 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -1132
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-NSTZMBAB.js → chunk-2EC4JTHC.js} +2 -2
- package/dist/{chunk-ZXFTC5ET.js → chunk-46ILZVMX.js} +2 -2
- package/dist/chunk-4A4JFNWG.js +2 -0
- package/dist/{chunk-GAQGJ52J.js → chunk-4B7YLRXX.js} +2 -2
- package/dist/chunk-64UY7VTR.js +63 -0
- package/dist/chunk-66ORT3LS.js +2 -0
- package/dist/{chunk-QPRIYXH4.js → chunk-6G76D2YM.js} +2 -2
- package/dist/{chunk-VUBQBW7H.js → chunk-6P5W4U6G.js} +2 -2
- package/dist/chunk-6ZFKI5EP.js +40 -0
- package/dist/{chunk-ZNUPGRPR.js → chunk-7I6KNKE3.js} +2 -2
- package/dist/{chunk-23YIGCYF.js → chunk-7TYJD45F.js} +5 -5
- package/dist/chunk-7UZWNW4E.js +2 -0
- package/dist/{chunk-4STLJYHI.js → chunk-AGW2MVIO.js} +2 -2
- package/dist/chunk-APLCSDXL.js +4 -0
- package/dist/chunk-BCFED24F.js +2 -0
- package/dist/chunk-CVRXOP6M.js +3 -0
- package/dist/chunk-D43L5PQF.js +2 -0
- package/dist/chunk-DJTJ3DLZ.js +7 -0
- package/dist/chunk-EAU4RDFG.js +2 -0
- package/dist/{chunk-BI4F6GXI.js → chunk-EKP7XJ6L.js} +2 -2
- package/dist/{chunk-33SSUPCB.js → chunk-EM2PPDN7.js} +2 -2
- package/dist/{chunk-ROOHENEP.js → chunk-FIPE5AQT.js} +2 -2
- package/dist/chunk-FTBT4RP2.js +7 -0
- package/dist/{chunk-WPLKHAH7.js → chunk-GD7XRHSV.js} +2 -2
- package/dist/{chunk-WJQY2LGT.js → chunk-GMEBYEMU.js} +2 -2
- package/dist/chunk-GTZAU7OL.js +2 -0
- package/dist/chunk-HVGNOUYP.js +2 -0
- package/dist/chunk-HVXIXDLV.js +2 -0
- package/dist/{chunk-KJ3ZJIE5.js → chunk-I7OTKWNY.js} +2 -2
- package/dist/{chunk-2JEFS2YJ.js → chunk-JAMU6FLN.js} +2 -2
- package/dist/chunk-JTCEWV7Q.js +2 -0
- package/dist/chunk-K4Z3FCUJ.js +6 -0
- package/dist/{chunk-FD37DBTD.js → chunk-K6YIGVL7.js} +2 -2
- package/dist/chunk-MKE7SEEX.js +2 -0
- package/dist/chunk-N5D5ZCBW.js +7 -0
- package/dist/{chunk-ROZNBWIF.js → chunk-NGLRXEWN.js} +2 -2
- package/dist/{chunk-J6Z5YKGQ.js → chunk-NK7TQQG4.js} +2 -2
- package/dist/chunk-NOVKLH2F.js +2 -0
- package/dist/chunk-OIMM7KMI.js +2 -0
- package/dist/chunk-OQSV6OS2.js +2 -0
- package/dist/chunk-PBGTMPJ7.js +2 -0
- package/dist/{chunk-ARBZM2NF.js → chunk-PCMVXWDC.js} +4 -4
- package/dist/{chunk-U75WH4XG.js → chunk-PE4EJOLN.js} +2 -2
- package/dist/chunk-PLFYFZX3.js +2 -0
- package/dist/{chunk-A2AVLALL.js → chunk-QYQXPPDI.js} +2 -2
- package/dist/{chunk-3OUC276S.js → chunk-RCRK4E7E.js} +2 -2
- package/dist/chunk-RIXOMSOR.js +20 -0
- package/dist/chunk-SB6I6O3P.js +2 -0
- package/dist/{chunk-KNA6Z7JB.js → chunk-SDGCKEB7.js} +2 -2
- package/dist/chunk-SLOIQKY7.js +2 -0
- package/dist/chunk-SOGLYIJ4.js +62 -0
- package/dist/chunk-SSINY7HL.js +4 -0
- package/dist/{chunk-563HLCDW.js → chunk-TFO4OMJZ.js} +2 -2
- package/dist/chunk-TH4JVC34.js +71 -0
- package/dist/chunk-TQTVM27C.js +6 -0
- package/dist/{chunk-LDV2B7ET.js → chunk-TR5AU6A5.js} +2 -2
- package/dist/{chunk-WODJHE6Z.js → chunk-UQE3DSXY.js} +2 -2
- package/dist/{chunk-72JOIFXL.js → chunk-UUDYI3FF.js} +2 -2
- package/dist/chunk-VDZL45XI.js +2 -0
- package/dist/{chunk-QWJBIBE6.js → chunk-VN6B6HFB.js} +2 -2
- package/dist/{chunk-DFK54IRN.js → chunk-WC43FMAB.js} +2 -2
- package/dist/chunk-WEJYUS5O.js +2 -0
- package/dist/chunk-WQFOZIID.js +4 -0
- package/dist/chunk-XBFLIGWU.js +3 -0
- package/dist/chunk-XSZ5NC4O.js +2 -0
- package/dist/{chunk-2IYEIFPP.js → chunk-Z2AJQ7VA.js} +2 -2
- package/dist/chunk-ZIIQ55VK.js +2 -0
- package/dist/chunk-ZJ737ZMD.js +2 -0
- package/dist/cli.js +171 -174
- package/dist/health-C6r2VgpA.d.ts +234 -0
- package/dist/index.d.ts +16 -30
- package/dist/index.js +1 -1
- package/dist/postinstall.js +4 -4
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +66 -0
- package/dist/queries/cleanup-plan.js +2 -0
- package/dist/queries/co-change.d.ts +42 -0
- package/dist/queries/co-change.js +2 -0
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +52 -0
- package/dist/queries/diff-gate.js +2 -0
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +69 -0
- package/dist/queries/doc-drift.js +2 -0
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/index.d.ts +38 -2
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +1 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +65 -0
- package/dist/queries/plan-context.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +48 -0
- package/dist/queries/recent-duplicates.js +2 -0
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +58 -0
- package/dist/queries/self-audit.js +2 -0
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +6 -0
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-params.d.ts +38 -0
- package/dist/queries/unused-params.js +2 -0
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.js +16 -16
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.js +2 -2
- package/package.json +34 -1
- package/skills/concrete-plan/SKILL.md +37 -7
- package/skills/scip-ai-cleanup/SKILL.md +145 -0
- package/skills/scip-debloat/SKILL.md +37 -7
- package/skills/scip-explore/SKILL.md +22 -9
- package/skills/scip-language-playbook/SKILL.md +4 -4
- package/skills/scip-maintainability/SKILL.md +264 -0
- package/skills/scip-verify/SKILL.md +2 -2
- package/dist/chunk-3GNFUVFA.js +0 -2
- package/dist/chunk-5TT47UMX.js +0 -44
- package/dist/chunk-6H2XIIPY.js +0 -71
- package/dist/chunk-7H4RJ4MC.js +0 -2
- package/dist/chunk-7O4MJYIW.js +0 -63
- package/dist/chunk-7OX2O53H.js +0 -62
- package/dist/chunk-BOVNTAKQ.js +0 -3
- package/dist/chunk-CKIO6SVS.js +0 -2
- package/dist/chunk-D6Z67MZL.js +0 -2
- package/dist/chunk-FOQQDXE7.js +0 -2
- package/dist/chunk-IODTPF5H.js +0 -20
- package/dist/chunk-JB4PUN5S.js +0 -40
- package/dist/chunk-JTXKS5GK.js +0 -3
- package/dist/chunk-KJ6CW6EK.js +0 -2
- package/dist/chunk-MDAYGS6T.js +0 -2
- package/dist/chunk-NHDPYW7O.js +0 -2
- package/dist/chunk-NKJKI6SE.js +0 -2
- package/dist/chunk-NYEMZHUC.js +0 -6
- package/dist/chunk-OHEIZWIA.js +0 -4
- package/dist/chunk-QAEDNTY7.js +0 -2
- package/dist/chunk-QE6MGGUY.js +0 -2
- package/dist/chunk-RCJEFQOK.js +0 -4
- package/dist/chunk-TGK5DFBJ.js +0 -2
- package/dist/chunk-TRNAQABL.js +0 -7
- package/dist/chunk-V53J46BX.js +0 -2
- package/dist/chunk-XO6R3X5J.js +0 -2
- package/dist/chunk-YSZNAG4G.js +0 -2
- package/dist/health-x7B4Xu_6.d.ts +0 -119
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { S as ScipDatabase } from './db-DdTPetj5.js';
|
|
2
|
+
import { stats } from './queries/stats.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Structural copy of analysis/git-history's ChangeAmplification — defined
|
|
6
|
+
* here so the report envelope consumed by runtime/ does not pull analysis/
|
|
7
|
+
* types across the layer boundary.
|
|
8
|
+
*/
|
|
9
|
+
interface ChangeAmplificationSummary {
|
|
10
|
+
medianFilesPerCommit: number;
|
|
11
|
+
p90FilesPerCommit: number;
|
|
12
|
+
commitsAnalyzed: number;
|
|
13
|
+
}
|
|
14
|
+
interface CountLocSummary {
|
|
15
|
+
count: number;
|
|
16
|
+
loc: number;
|
|
17
|
+
/** Files contributing findings — feeds fix-density validation. */
|
|
18
|
+
files?: string[];
|
|
19
|
+
}
|
|
20
|
+
interface StaleSummary extends CountLocSummary {
|
|
21
|
+
unused: number;
|
|
22
|
+
singleUse: number;
|
|
23
|
+
}
|
|
24
|
+
interface DriftSummary {
|
|
25
|
+
count: number;
|
|
26
|
+
unusedImports: number;
|
|
27
|
+
layerViolations: number;
|
|
28
|
+
}
|
|
29
|
+
interface ComplexitySummary {
|
|
30
|
+
top: Array<{
|
|
31
|
+
symbol: string;
|
|
32
|
+
score: number;
|
|
33
|
+
file?: string;
|
|
34
|
+
}>;
|
|
35
|
+
extremeCount: number;
|
|
36
|
+
}
|
|
37
|
+
interface GitEvidenceSummary {
|
|
38
|
+
amplification: ChangeAmplificationSummary | null;
|
|
39
|
+
hiddenCoupling: {
|
|
40
|
+
pairCount: number;
|
|
41
|
+
top: Array<{
|
|
42
|
+
fileA: string;
|
|
43
|
+
fileB: string;
|
|
44
|
+
together: number;
|
|
45
|
+
confidence: number;
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
/** Per-file change counts over the analyzed window (tracked files only). */
|
|
49
|
+
fileStats: Record<string, {
|
|
50
|
+
changes: number;
|
|
51
|
+
fixChanges: number;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
interface SuppressionSummary {
|
|
55
|
+
total: number;
|
|
56
|
+
byCategory: Record<string, number>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
type FindingEvidence = 'graph-fact' | 'heuristic' | 'change-graph';
|
|
60
|
+
interface HealthAction {
|
|
61
|
+
category: string;
|
|
62
|
+
description: string;
|
|
63
|
+
effort: 'low' | 'medium' | 'high';
|
|
64
|
+
impact: 'low' | 'medium' | 'high';
|
|
65
|
+
count: number;
|
|
66
|
+
locRecoverable: number;
|
|
67
|
+
/** What kind of evidence backs this action — agents should trust accordingly. */
|
|
68
|
+
evidence: FindingEvidence;
|
|
69
|
+
}
|
|
70
|
+
/** One deduction line — the score is the sum of these, so it is auditable. */
|
|
71
|
+
interface ScoreDeduction {
|
|
72
|
+
axis: string;
|
|
73
|
+
points: number;
|
|
74
|
+
detail: string;
|
|
75
|
+
/** Risk deductions are empirically validated predictors; hygiene are tidiness signals. */
|
|
76
|
+
kind: 'risk' | 'hygiene';
|
|
77
|
+
}
|
|
78
|
+
interface HealthAxes {
|
|
79
|
+
/** LOC provably removable with behavior preserved (dead + isolated). */
|
|
80
|
+
deletable: {
|
|
81
|
+
loc: number;
|
|
82
|
+
symbols: number;
|
|
83
|
+
};
|
|
84
|
+
cycles: {
|
|
85
|
+
count: number;
|
|
86
|
+
};
|
|
87
|
+
/** Files touched per commit — the measured cost of one conceptual change. */
|
|
88
|
+
changeAmplification: ChangeAmplificationSummary | null;
|
|
89
|
+
/** File pairs that co-change without a dependency edge — concepts the reference graph can't see. */
|
|
90
|
+
hiddenCoupling: {
|
|
91
|
+
pairCount: number;
|
|
92
|
+
top: Array<{
|
|
93
|
+
fileA: string;
|
|
94
|
+
fileB: string;
|
|
95
|
+
together: number;
|
|
96
|
+
confidence: number;
|
|
97
|
+
}>;
|
|
98
|
+
} | null;
|
|
99
|
+
/** Complexity hotspots weighted by churn — complex code nobody touches costs nothing. */
|
|
100
|
+
churnWeightedComplexity: Array<{
|
|
101
|
+
symbol: string;
|
|
102
|
+
file?: string;
|
|
103
|
+
score: number;
|
|
104
|
+
changes: number;
|
|
105
|
+
weighted: number;
|
|
106
|
+
}> | null;
|
|
107
|
+
/** What fraction of findings rest on graph facts vs heuristics, and how many the user has rejected. */
|
|
108
|
+
evidenceQuality: {
|
|
109
|
+
graphFindings: number;
|
|
110
|
+
heuristicFindings: number;
|
|
111
|
+
userSuppressed: number;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** Do flagged files attract more fix commits than the rest? The falsifiability check. */
|
|
115
|
+
interface HealthValidation {
|
|
116
|
+
flaggedFiles: number;
|
|
117
|
+
flaggedFixDensity: number;
|
|
118
|
+
baselineFixDensity: number;
|
|
119
|
+
/** > 1 means findings concentrate where fixes happen — predictive signal. */
|
|
120
|
+
ratio: number | null;
|
|
121
|
+
/** Per-detector lift — which detectors actually predict fixes, auditable. */
|
|
122
|
+
byCategory: Record<string, {
|
|
123
|
+
flaggedFiles: number;
|
|
124
|
+
fixDensity: number;
|
|
125
|
+
lift: number | null;
|
|
126
|
+
}>;
|
|
127
|
+
}
|
|
128
|
+
interface HealthReport {
|
|
129
|
+
/** Headline = min(riskScore, hygieneScore); kept for compatibility. */
|
|
130
|
+
score: number;
|
|
131
|
+
/** Empirically validated predictors only (graph facts, change-graph signals). */
|
|
132
|
+
riskScore: number;
|
|
133
|
+
/** Tidiness signals (candidate detectors) — real but not fix-predictive. */
|
|
134
|
+
hygieneScore: number;
|
|
135
|
+
scoreBreakdown: ScoreDeduction[];
|
|
136
|
+
overview: {
|
|
137
|
+
documents: number;
|
|
138
|
+
symbols: number;
|
|
139
|
+
indexSizeBytes: number;
|
|
140
|
+
};
|
|
141
|
+
findings: {
|
|
142
|
+
deadSymbols: number;
|
|
143
|
+
deadLoc: number;
|
|
144
|
+
isolatedSymbols: number;
|
|
145
|
+
isolatedLoc: number;
|
|
146
|
+
cycles: number;
|
|
147
|
+
similarPairs: number;
|
|
148
|
+
extractionCandidates: number;
|
|
149
|
+
wrappers: number;
|
|
150
|
+
passthroughs: number;
|
|
151
|
+
staleTypes: number;
|
|
152
|
+
driftedFiles: number;
|
|
153
|
+
complexityHotspotCount: number;
|
|
154
|
+
hiddenCouplingPairs: number | null;
|
|
155
|
+
};
|
|
156
|
+
axes: HealthAxes;
|
|
157
|
+
validation: HealthValidation | null;
|
|
158
|
+
suppressions: {
|
|
159
|
+
total: number;
|
|
160
|
+
byCategory: Record<string, number>;
|
|
161
|
+
} | null;
|
|
162
|
+
actions: HealthAction[];
|
|
163
|
+
topComplexity: Array<{
|
|
164
|
+
symbol: string;
|
|
165
|
+
score: number;
|
|
166
|
+
file?: string;
|
|
167
|
+
}>;
|
|
168
|
+
warnings?: string[];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
declare const HEALTH_PHASES: readonly ["overview", "dead", "isolated", "cycles", "similar", "extract-candidates", "wrapper-candidates", "passthrough-candidates", "stale-abstractions", "drift", "complexity-hotspots", "git-evidence", "suppressions"];
|
|
172
|
+
type HealthPhaseName = typeof HEALTH_PHASES[number];
|
|
173
|
+
type HealthPhaseResult = {
|
|
174
|
+
phase: 'overview';
|
|
175
|
+
statsResult: ReturnType<typeof stats>;
|
|
176
|
+
warnings: string[];
|
|
177
|
+
} | {
|
|
178
|
+
phase: 'dead';
|
|
179
|
+
dead: CountLocSummary;
|
|
180
|
+
} | {
|
|
181
|
+
phase: 'isolated';
|
|
182
|
+
isolated: CountLocSummary;
|
|
183
|
+
} | {
|
|
184
|
+
phase: 'cycles';
|
|
185
|
+
realCycleCount: number;
|
|
186
|
+
} | {
|
|
187
|
+
phase: 'similar';
|
|
188
|
+
similarCount: number;
|
|
189
|
+
} | {
|
|
190
|
+
phase: 'extract-candidates';
|
|
191
|
+
extractCount: number;
|
|
192
|
+
} | {
|
|
193
|
+
phase: 'wrapper-candidates';
|
|
194
|
+
wrappers: CountLocSummary;
|
|
195
|
+
} | {
|
|
196
|
+
phase: 'passthrough-candidates';
|
|
197
|
+
passthroughs: CountLocSummary;
|
|
198
|
+
} | {
|
|
199
|
+
phase: 'stale-abstractions';
|
|
200
|
+
stale: StaleSummary;
|
|
201
|
+
} | {
|
|
202
|
+
phase: 'drift';
|
|
203
|
+
drift: DriftSummary;
|
|
204
|
+
} | {
|
|
205
|
+
phase: 'complexity-hotspots';
|
|
206
|
+
complexity: ComplexitySummary;
|
|
207
|
+
} | {
|
|
208
|
+
phase: 'git-evidence';
|
|
209
|
+
gitEvidence: GitEvidenceSummary | null;
|
|
210
|
+
} | {
|
|
211
|
+
phase: 'suppressions';
|
|
212
|
+
suppressions: SuppressionSummary;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Single composite health report that runs all de-bloat analyses
|
|
216
|
+
* and produces a prioritized action list.
|
|
217
|
+
*
|
|
218
|
+
* The scoring formula accounts for common false positives:
|
|
219
|
+
* - Entry points (CLI, workers, barrels) appearing as "dead code"
|
|
220
|
+
* - Typed result interfaces with 1 consumer (normal for APIs)
|
|
221
|
+
* - Consistent import patterns across sibling modules (not duplication)
|
|
222
|
+
* - Barrel and orchestrator files deviating from sibling patterns (expected)
|
|
223
|
+
*/
|
|
224
|
+
declare function health(db: ScipDatabase, opts?: {
|
|
225
|
+
scope?: string;
|
|
226
|
+
full?: boolean;
|
|
227
|
+
}): HealthReport;
|
|
228
|
+
declare function healthPhase(db: ScipDatabase, phase: HealthPhaseName, opts?: {
|
|
229
|
+
scope?: string;
|
|
230
|
+
full?: boolean;
|
|
231
|
+
}): HealthPhaseResult;
|
|
232
|
+
declare function healthReportFromPhases(phaseResults: HealthPhaseResult[]): HealthReport;
|
|
233
|
+
|
|
234
|
+
export { HEALTH_PHASES as H, type HealthAction as a, type HealthReport as b, healthPhase as c, healthReportFromPhases as d, type HealthPhaseName as e, health as h };
|
package/dist/index.d.ts
CHANGED
|
@@ -125,9 +125,12 @@ declare function buildCalleeMap(db: ScipDatabase, definitions: ReadonlyArray<Sym
|
|
|
125
125
|
|
|
126
126
|
declare function buildFileDepGraph(db: ScipDatabase, scope?: string): Map<string, Set<string>>;
|
|
127
127
|
|
|
128
|
-
declare function
|
|
128
|
+
declare function crossFileCallerEvidenceMap(db: ScipDatabase, definitions?: ReadonlyArray<SymbolMatch>, opts?: {
|
|
129
129
|
semantic?: boolean;
|
|
130
130
|
}): Map<number, Set<string>>;
|
|
131
|
+
declare function sourceFallbackCallerEvidenceMap(db: ScipDatabase, definitions: ReadonlyArray<IndexedDefinition>): Map<number, Set<string>>;
|
|
132
|
+
|
|
133
|
+
type FrameworkSourceReferenceKind = 'cross-language-dispatch' | 'rust-attribute';
|
|
131
134
|
|
|
132
135
|
/**
|
|
133
136
|
* Identifier-attribution module — one owner of "given a textual identifier
|
|
@@ -163,33 +166,8 @@ interface SymbolRef {
|
|
|
163
166
|
* signal applies.
|
|
164
167
|
*/
|
|
165
168
|
declare function attributeIdentifier(db: ScipDatabase, file: string, identifier: string): SymbolRef[];
|
|
166
|
-
/**
|
|
167
|
-
* For each symbol in `candidates`, which files reference it?
|
|
168
|
-
*
|
|
169
|
-
* Bulk variant of `findReferences` — one file walk credits every
|
|
170
|
-
* candidate-leaf hit in the file at once, instead of N walks per
|
|
171
|
-
* candidate. Used by the dead-code source-fallback path.
|
|
172
|
-
*/
|
|
173
|
-
declare function findCallerFiles(db: ScipDatabase, candidates: ReadonlyArray<IndexedDefinition>): Map<number, Set<string>>;
|
|
174
|
-
|
|
175
|
-
interface CallableSignature {
|
|
176
|
-
paramCount: number;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Pull a function's parameter count from the AST. Used by similar-pair
|
|
180
|
-
* filtering to avoid declaring a 1-arg helper similar to a 7-arg orchestrator
|
|
181
|
-
* just because they happen to share infrastructure callees.
|
|
182
|
-
*
|
|
183
|
-
* On first call per file, walks the entire AST once and indexes every
|
|
184
|
-
* callable's signature by (startLine, endLine). Subsequent calls are O(1)
|
|
185
|
-
* Map lookups — critical when called for thousands of candidates.
|
|
186
|
-
*
|
|
187
|
-
* scip-query: ignore-wrapper — public AST-signature primitive used through
|
|
188
|
-
* ProjectIndex; callers should not know the per-tree signature cache shape.
|
|
189
|
-
*/
|
|
190
|
-
declare function getCallableSignature(db: ScipDatabase, relativePath: string, startLine: number, endLine: number): CallableSignature | null;
|
|
191
169
|
|
|
192
|
-
type SourceReferenceKind = 'identifier' |
|
|
170
|
+
type SourceReferenceKind = 'identifier' | FrameworkSourceReferenceKind;
|
|
193
171
|
type DefaultSourceReferenceTarget = ReturnType<typeof attributeIdentifier>[number];
|
|
194
172
|
interface SourceReferenceTarget {
|
|
195
173
|
symbolId: number;
|
|
@@ -228,6 +206,12 @@ interface ProductionCallableDefinitionsOptions {
|
|
|
228
206
|
excludeSymbol?: string;
|
|
229
207
|
excludeEntrySurfaces?: boolean;
|
|
230
208
|
excludeTypesFiles?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Skip externally-live symbols (package surface / entryRoots config).
|
|
211
|
+
* For detectors whose advice is "inline or delete this" — published API
|
|
212
|
+
* has consumers the index cannot see, so that advice would be wrong.
|
|
213
|
+
*/
|
|
214
|
+
excludeRootedSymbols?: boolean;
|
|
231
215
|
excludeRustTraitImplMembers?: boolean;
|
|
232
216
|
includeSuppressed?: boolean;
|
|
233
217
|
requireFunctionLikeSymbol?: boolean;
|
|
@@ -246,8 +230,8 @@ declare class ProjectIndex {
|
|
|
246
230
|
}): ReturnType<typeof buildCalleeMap>;
|
|
247
231
|
crossFileCallerMap(definitions?: ReadonlyArray<SymbolMatch>, opts?: {
|
|
248
232
|
semantic?: boolean;
|
|
249
|
-
}): ReturnType<typeof
|
|
250
|
-
sourceFallbackCallerFiles(definitions: ReadonlyArray<IndexedDefinition>): ReturnType<typeof
|
|
233
|
+
}): ReturnType<typeof crossFileCallerEvidenceMap>;
|
|
234
|
+
sourceFallbackCallerFiles(definitions: ReadonlyArray<IndexedDefinition>): ReturnType<typeof sourceFallbackCallerEvidenceMap>;
|
|
251
235
|
callerFileMap(definitions: ReadonlyArray<IndexedDefinition>, opts?: {
|
|
252
236
|
semantic?: boolean;
|
|
253
237
|
sourceFallback?: boolean;
|
|
@@ -262,7 +246,9 @@ declare class ProjectIndex {
|
|
|
262
246
|
hasSuppressionComment(definition: Pick<IndexedDefinition, 'relativePath' | 'startLine'>): boolean;
|
|
263
247
|
sourceFiles(): string[];
|
|
264
248
|
scanSourceReferences(opts: Parameters<typeof scanSourceReferences>[1], visit: Parameters<typeof scanSourceReferences>[2]): void;
|
|
265
|
-
callableSignature(definition: Pick<IndexedDefinition, 'relativePath' | 'startLine' | 'endLine'>):
|
|
249
|
+
callableSignature(definition: Pick<IndexedDefinition, 'relativePath' | 'startLine' | 'endLine'>): {
|
|
250
|
+
paramCount: number;
|
|
251
|
+
} | null;
|
|
266
252
|
}
|
|
267
253
|
|
|
268
254
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a}from"./chunk-TKDJQ2WD.js";import{
|
|
1
|
+
import{a}from"./chunk-TKDJQ2WD.js";import{a as s}from"./chunk-NOVKLH2F.js";import"./chunk-TQTVM27C.js";import"./chunk-RIXOMSOR.js";import"./chunk-EAU4RDFG.js";import"./chunk-PCMVXWDC.js";import"./chunk-6ZFKI5EP.js";import"./chunk-64UY7VTR.js";import"./chunk-7I6KNKE3.js";import"./chunk-APLCSDXL.js";import"./chunk-WEJYUS5O.js";import"./chunk-PBGTMPJ7.js";import{a as i,c as n,d as l}from"./chunk-SOGLYIJ4.js";import"./chunk-WQFOZIID.js";import"./chunk-NN3O7TPH.js";import"./chunk-VDZL45XI.js";import c from"better-sqlite3";var d=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".scipquery-cache","__pycache__",".venv","venv"],o=class{db;config;pathFilter;constructor(t,e){this.config=t,this.pathFilter=e??null,this.db=new c(t.dbPath,{readonly:!0}),this.db.pragma("busy_timeout = 5000")}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
|
|
2
2
|
EXISTS (
|
|
3
3
|
SELECT 1
|
|
4
4
|
FROM defn_enclosing_ranges local_der
|
package/dist/postinstall.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as
|
|
3
|
-
${
|
|
4
|
-
scip CLI not found on PATH. Attempting auto-install...`),
|
|
5
|
-
scip CLI: ${
|
|
2
|
+
import{b as k,c as g,d as f,e as m}from"./chunk-LWYIGRHR.js";import{existsSync as p,mkdirSync as L,symlinkSync as v,readlinkSync as b,unlinkSync as C}from"fs";import{join as s,dirname as S,resolve as d}from"path";import{homedir as u,platform as q}from"os";import{fileURLToPath as N}from"url";var R=q()==="win32",T=["concrete-plan","scip-ai-cleanup","scip-explore","scip-debloat","scip-maintainability","scip-verify","scip-language-playbook"];function A(n={}){let e=n.quiet?()=>{}:console.log,o=N(import.meta.url),I=d(S(o),"..","skills"),$=[s(u(),".claude","skills"),s(u(),".codex","skills"),s(u(),".agents","skills")],i={installed:[],skipped:[],alreadyLinked:[]};for(let r of $){let h=S(r);if(!p(h))continue;L(r,{recursive:!0});let t=j(r);for(let l of T){let a=s(I,l),c=s(r,l);if(!p(a)){i.skipped.push(`${t}/${l}`);continue}if(p(c)){try{let x=b(c);if(d(x)===d(a)){i.alreadyLinked.push(`${t}/${l}`),e(` ok: ${l} \u2192 ${t} (already linked)`);continue}}catch{i.skipped.push(`${t}/${l}`),e(` skip: ${l} \u2192 ${t} (exists, not a symlink)`);continue}C(c)}v(a,c,R?"junction":"dir"),i.installed.push(`${t}/${l}`),e(` done: ${l} \u2192 ${t}`)}}return i}function j(n){return n.includes(".codex")?"Codex":n.includes(".agents")?"Agents":"Claude"}function y(){console.log("scip-query: installing skills...");let n=A({quiet:!1});if(n.installed.length+n.alreadyLinked.length>0&&console.log(`
|
|
3
|
+
${n.installed.length} skill(s) installed, ${n.alreadyLinked.length} already linked.`),!k())console.log(`
|
|
4
|
+
scip CLI not found on PATH. Attempting auto-install...`),m(console.log)||f();else{let o=g();console.log(`
|
|
5
|
+
scip CLI: ${o??"installed"}`)}console.log("")}y();
|
|
6
6
|
//# sourceMappingURL=postinstall.js.map
|
package/dist/queries/affected.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-UUDYI3FF.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as affected};
|
|
2
2
|
//# sourceMappingURL=affected.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-XSZ5NC4O.js";import"../chunk-MX6F756F.js";import"../chunk-NOVKLH2F.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as bottlenecks};
|
|
2
2
|
//# sourceMappingURL=bottlenecks.js.map
|
package/dist/queries/by-kind.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-RCRK4E7E.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as byKind,b as kindCounts};
|
|
2
2
|
//# sourceMappingURL=by-kind.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-D43L5PQF.js";import"../chunk-MX6F756F.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as callGraph};
|
|
2
2
|
//# sourceMappingURL=call-graph.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-4B7YLRXX.js";import"../chunk-WC43FMAB.js";import"../chunk-NOVKLH2F.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as changeSurface};
|
|
2
2
|
//# sourceMappingURL=change-surface.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { S as ScipDatabase } from '../db-DdTPetj5.js';
|
|
2
|
+
import 'better-sqlite3';
|
|
3
|
+
import '../config-types-CGIeLEpY.js';
|
|
4
|
+
|
|
5
|
+
interface CleanupPlanEntry {
|
|
6
|
+
symbol: string;
|
|
7
|
+
shortName: string;
|
|
8
|
+
file: string;
|
|
9
|
+
startLine: number;
|
|
10
|
+
endLine: number;
|
|
11
|
+
loc: number;
|
|
12
|
+
/**
|
|
13
|
+
* 'graph-fact': zero references anywhere — deletable today.
|
|
14
|
+
* 'cascade': becomes dead once earlier batches are deleted.
|
|
15
|
+
*/
|
|
16
|
+
evidence: 'graph-fact' | 'cascade';
|
|
17
|
+
}
|
|
18
|
+
interface CleanupBatch {
|
|
19
|
+
/** 0 = deletable now; n = deletable after batch n-1 is applied. */
|
|
20
|
+
depth: number;
|
|
21
|
+
entries: CleanupPlanEntry[];
|
|
22
|
+
loc: number;
|
|
23
|
+
/** Files whose every definition is removed once this batch lands. */
|
|
24
|
+
filesEmptied: string[];
|
|
25
|
+
}
|
|
26
|
+
interface CleanupPlanResult {
|
|
27
|
+
batches: CleanupBatch[];
|
|
28
|
+
totalSymbols: number;
|
|
29
|
+
totalLoc: number;
|
|
30
|
+
/** Cascade candidates blocked by references outside the removal set. */
|
|
31
|
+
blocked: Array<{
|
|
32
|
+
shortName: string;
|
|
33
|
+
file: string;
|
|
34
|
+
blockingFiles: string[];
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Cascade cleanup plan: dead-code analysis is single-pass, but deletion
|
|
39
|
+
* cascades — once batch 0 is gone, symbols referenced only from batch 0
|
|
40
|
+
* become dead too. This runs the fixpoint and emits an ordered plan.
|
|
41
|
+
*
|
|
42
|
+
* Cascade rule (conservative): a symbol joins batch n+1 only when every
|
|
43
|
+
* resolved reference site lies inside an already-removed definition's range.
|
|
44
|
+
* Any reference that can't be placed inside the removal set — including
|
|
45
|
+
* unattributable file-level references — blocks the cascade for that symbol.
|
|
46
|
+
*
|
|
47
|
+
* Apply batch by batch, re-running the project's typecheck between batches.
|
|
48
|
+
*/
|
|
49
|
+
declare function cleanupPlan(db: ScipDatabase, opts?: {
|
|
50
|
+
scope?: string;
|
|
51
|
+
minLoc?: number;
|
|
52
|
+
maxDepth?: number;
|
|
53
|
+
scanLimit?: number;
|
|
54
|
+
}): CleanupPlanResult;
|
|
55
|
+
/** Line-range membership for the removal set, per file. */
|
|
56
|
+
declare class RemovedRangeIndex {
|
|
57
|
+
private readonly ranges;
|
|
58
|
+
add(entry: {
|
|
59
|
+
file: string;
|
|
60
|
+
startLine: number;
|
|
61
|
+
endLine: number;
|
|
62
|
+
}): void;
|
|
63
|
+
contains(file: string, line: number): boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { type CleanupBatch, type CleanupPlanEntry, type CleanupPlanResult, RemovedRangeIndex, cleanupPlan };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"../chunk-FTBT4RP2.js";import"../chunk-OIMM7KMI.js";import"../chunk-MX6F756F.js";import"../chunk-NOVKLH2F.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{b as RemovedRangeIndex,a as cleanupPlan};
|
|
2
|
+
//# sourceMappingURL=cleanup-plan.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { S as ScipDatabase } from '../db-DdTPetj5.js';
|
|
2
|
+
import 'better-sqlite3';
|
|
3
|
+
import '../config-types-CGIeLEpY.js';
|
|
4
|
+
|
|
5
|
+
interface CoChangeFinding {
|
|
6
|
+
fileA: string;
|
|
7
|
+
fileB: string;
|
|
8
|
+
/** Commits in the analyzed window where both files changed. */
|
|
9
|
+
together: number;
|
|
10
|
+
/** max(P(B|A), P(A|B)) over the analyzed window. */
|
|
11
|
+
confidence: number;
|
|
12
|
+
changesA: number;
|
|
13
|
+
changesB: number;
|
|
14
|
+
/** True when a dependency edge already explains the coupling. */
|
|
15
|
+
structurallyLinked: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface CoChangeResult {
|
|
18
|
+
/** False when git history is unavailable (not a repo, git missing). */
|
|
19
|
+
available: boolean;
|
|
20
|
+
commitsAnalyzed: number;
|
|
21
|
+
findings: CoChangeFinding[];
|
|
22
|
+
}
|
|
23
|
+
declare function isCoChangeNoiseFile(file: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Hidden coupling from the change graph: file pairs that repeatedly change
|
|
26
|
+
* in the same commits but have NO dependency edge between them.
|
|
27
|
+
*
|
|
28
|
+
* The reference graph cannot see that two mechanisms implement one concept —
|
|
29
|
+
* a config list and the test that checks it share no symbols. The commit
|
|
30
|
+
* history can: if editing one reliably means editing the other, a maintainer
|
|
31
|
+
* who edits only one is probably introducing drift. With a `file` argument,
|
|
32
|
+
* reports that file's co-change partners instead (including structurally
|
|
33
|
+
* linked ones — exploration mode).
|
|
34
|
+
*/
|
|
35
|
+
declare function coChange(db: ScipDatabase, file?: string, opts?: {
|
|
36
|
+
minTogether?: number;
|
|
37
|
+
minConfidence?: number;
|
|
38
|
+
limit?: number;
|
|
39
|
+
includeLinked?: boolean;
|
|
40
|
+
}): CoChangeResult;
|
|
41
|
+
|
|
42
|
+
export { type CoChangeFinding, type CoChangeResult, coChange, isCoChangeNoiseFile };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"../chunk-4A4JFNWG.js";import"../chunk-N5D5ZCBW.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{b as coChange,a as isCoChangeNoiseFile};
|
|
2
|
+
//# sourceMappingURL=co-change.js.map
|
package/dist/queries/code.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-Z2AJQ7VA.js";import"../chunk-WC43FMAB.js";import"../chunk-7I6KNKE3.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as code};
|
|
2
2
|
//# sourceMappingURL=code.js.map
|
|
@@ -20,7 +20,7 @@ interface ComplexityHotspot {
|
|
|
20
20
|
*
|
|
21
21
|
* Score = (loc / 50) * (fanIn / 5) * max(fanOut / 5, 1)
|
|
22
22
|
*
|
|
23
|
-
* Bulk fan-in/out via
|
|
23
|
+
* Bulk fan-in/out via caller evidence + buildCalleeMap so we pay
|
|
24
24
|
* one SQL pass per kind regardless of how many definitions we score —
|
|
25
25
|
* replaces the previous per-symbol getCaller/CalleeRowsForSymbol calls
|
|
26
26
|
* that were O(symbols × files) on large indexes.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-K6YIGVL7.js";import"../chunk-V76FCF5F.js";import"../chunk-MX6F756F.js";import"../chunk-NOVKLH2F.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as complexityHotspots};
|
|
2
2
|
//# sourceMappingURL=complexity-hotspots.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-EM2PPDN7.js";import"../chunk-NOVKLH2F.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as complexity};
|
|
2
2
|
//# sourceMappingURL=complexity.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-I7OTKWNY.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as convergence};
|
|
2
2
|
//# sourceMappingURL=convergence.js.map
|
package/dist/queries/coupling.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-46ILZVMX.js";import"../chunk-WC43FMAB.js";import"../chunk-7I6KNKE3.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as coupling,b as topCoupling};
|
|
2
2
|
//# sourceMappingURL=coupling.js.map
|
package/dist/queries/cycles.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-EKP7XJ6L.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as cycles};
|
|
2
2
|
//# sourceMappingURL=cycles.js.map
|
package/dist/queries/dataflow.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-BCFED24F.js";import"../chunk-MX6F756F.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as dataflow};
|
|
2
2
|
//# sourceMappingURL=dataflow.js.map
|
package/dist/queries/dead.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"../chunk-
|
|
1
|
+
import{b as a}from"../chunk-OIMM7KMI.js";import"../chunk-MX6F756F.js";import"../chunk-NOVKLH2F.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as dead};
|
|
2
2
|
//# sourceMappingURL=dead.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-PE4EJOLN.js";import"../chunk-RIXOMSOR.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as deepChains};
|
|
2
2
|
//# sourceMappingURL=deep-chains.js.map
|
package/dist/queries/deps.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-AGW2MVIO.js";import"../chunk-WC43FMAB.js";import"../chunk-7I6KNKE3.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as deps,b as rdeps};
|
|
2
2
|
//# sourceMappingURL=deps.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { S as ScipDatabase } from '../db-DdTPetj5.js';
|
|
2
|
+
import 'better-sqlite3';
|
|
3
|
+
import '../config-types-CGIeLEpY.js';
|
|
4
|
+
|
|
5
|
+
type DiffGateCheck = 'echo' | 'co-change-partner' | 'doc-reference' | 'unused-params' | 'new-dead' | 'baseline';
|
|
6
|
+
interface DiffGateFinding {
|
|
7
|
+
check: DiffGateCheck;
|
|
8
|
+
message: string;
|
|
9
|
+
/** Concrete remediation an agent can act on without human triage. */
|
|
10
|
+
remediation: string;
|
|
11
|
+
}
|
|
12
|
+
interface DiffGateResult {
|
|
13
|
+
base: string;
|
|
14
|
+
changedFiles: string[];
|
|
15
|
+
changedSymbols: number;
|
|
16
|
+
checksRun: DiffGateCheck[];
|
|
17
|
+
/** Checks that could not run (no git history, no baseline file, ...). */
|
|
18
|
+
skipped: Array<{
|
|
19
|
+
check: DiffGateCheck;
|
|
20
|
+
reason: string;
|
|
21
|
+
}>;
|
|
22
|
+
findings: DiffGateFinding[];
|
|
23
|
+
note?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Slop prevention at the moment of creation: every detector, scoped to what
|
|
27
|
+
* THIS diff introduces. O(diff), no LLM calls, exit-code friendly — the
|
|
28
|
+
* leading-indicator companion to the repo-wide ratchet.
|
|
29
|
+
*
|
|
30
|
+
* Checks:
|
|
31
|
+
* - echo: a symbol this diff touched closely resembles
|
|
32
|
+
* established code elsewhere — likely re-implementation.
|
|
33
|
+
* - co-change-partner: a changed file's strong historical partner is NOT in
|
|
34
|
+
* the diff — the change-graph contract says they move
|
|
35
|
+
* together (auto-derived sync enforcement).
|
|
36
|
+
* - doc-reference: a doc cites a changed file but isn't updated in the
|
|
37
|
+
* diff — the drift starts here.
|
|
38
|
+
* - unused-params: changed files now contain trailing parameters no body
|
|
39
|
+
* uses — speculative generality landing fresh.
|
|
40
|
+
* - new-dead: changed symbols with zero indexed consumers — possibly
|
|
41
|
+
* a half-wired feature.
|
|
42
|
+
* - baseline: the committed health baseline gained new findings.
|
|
43
|
+
*/
|
|
44
|
+
declare function diffGate(db: ScipDatabase, opts?: {
|
|
45
|
+
base?: string;
|
|
46
|
+
minTogether?: number;
|
|
47
|
+
minConfidence?: number;
|
|
48
|
+
maxEchoChecks?: number;
|
|
49
|
+
minSimilarity?: number;
|
|
50
|
+
}): DiffGateResult;
|
|
51
|
+
|
|
52
|
+
export { type DiffGateCheck, type DiffGateFinding, type DiffGateResult, diffGate };
|