@fraction12/deepclean 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +171 -0
- package/dist/args.d.ts +9 -0
- package/dist/args.js +105 -0
- package/dist/args.js.map +1 -0
- package/dist/candidates.d.ts +6 -0
- package/dist/candidates.js +319 -0
- package/dist/candidates.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +521 -0
- package/dist/cli.js.map +1 -0
- package/dist/clusters.d.ts +7 -0
- package/dist/clusters.js +399 -0
- package/dist/clusters.js.map +1 -0
- package/dist/defaults.d.ts +5 -0
- package/dist/defaults.js +130 -0
- package/dist/defaults.js.map +1 -0
- package/dist/discovery.d.ts +10 -0
- package/dist/discovery.js +48 -0
- package/dist/discovery.js.map +1 -0
- package/dist/evidence.d.ts +16 -0
- package/dist/evidence.js +853 -0
- package/dist/evidence.js.map +1 -0
- package/dist/ids.d.ts +4 -0
- package/dist/ids.js +16 -0
- package/dist/ids.js.map +1 -0
- package/dist/json.d.ts +3 -0
- package/dist/json.js +12 -0
- package/dist/json.js.map +1 -0
- package/dist/plans.d.ts +3 -0
- package/dist/plans.js +171 -0
- package/dist/plans.js.map +1 -0
- package/dist/reporting.d.ts +13 -0
- package/dist/reporting.js +227 -0
- package/dist/reporting.js.map +1 -0
- package/dist/reviewers.d.ts +22 -0
- package/dist/reviewers.js +461 -0
- package/dist/reviewers.js.map +1 -0
- package/dist/state.d.ts +41 -0
- package/dist/state.js +211 -0
- package/dist/state.js.map +1 -0
- package/dist/synthesis.d.ts +17 -0
- package/dist/synthesis.js +396 -0
- package/dist/synthesis.js.map +1 -0
- package/dist/types.d.ts +389 -0
- package/dist/types.js +236 -0
- package/dist/types.js.map +1 -0
- package/dist/verification.d.ts +11 -0
- package/dist/verification.js +111 -0
- package/dist/verification.js.map +1 -0
- package/docs/privacy-and-trust.md +33 -0
- package/docs/public-readiness.md +19 -0
- package/docs/reviewer-references.md +33 -0
- package/docs/troubleshooting.md +80 -0
- package/package.json +55 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
export const reviewerRubrics = [
|
|
2
|
+
{
|
|
3
|
+
id: "architecture-deepening",
|
|
4
|
+
title: "Architecture and module deepening",
|
|
5
|
+
basis: [
|
|
6
|
+
"Deepclean native reviewer",
|
|
7
|
+
"Matt Pocock skills: improve-codebase-architecture",
|
|
8
|
+
],
|
|
9
|
+
purpose: "Find places where working code lacks real module boundaries, ownership, or durable seams.",
|
|
10
|
+
lookFor: [
|
|
11
|
+
"domain logic trapped in UI components, routes, scripts, or orchestration files",
|
|
12
|
+
"large files acting as mixed controllers, services, DTO stores, and policy holders",
|
|
13
|
+
"missing module boundaries where several files share one concept but no named home",
|
|
14
|
+
"helper modules with many callers but unclear ownership or unstable APIs",
|
|
15
|
+
"dependencies flowing from stable/domain code toward volatile UI/runtime code",
|
|
16
|
+
"shallow modules whose interface is nearly as complex as their implementation",
|
|
17
|
+
"modules that fail the deletion test because removing them would remove complexity rather than concentrate it",
|
|
18
|
+
],
|
|
19
|
+
reject: [
|
|
20
|
+
"single large file findings with no architectural consequence",
|
|
21
|
+
"abstract advice to add layers without citing files and evidence",
|
|
22
|
+
"renaming-only suggestions",
|
|
23
|
+
],
|
|
24
|
+
output: [
|
|
25
|
+
"name the missing or weak boundary",
|
|
26
|
+
"explain the current ownership problem",
|
|
27
|
+
"suggest the smallest durable module shape a future agent should investigate",
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "deep-module-discipline",
|
|
32
|
+
title: "Deep module discipline",
|
|
33
|
+
basis: [
|
|
34
|
+
"Matt Pocock skills: improve-codebase-architecture/DEEPENING.md",
|
|
35
|
+
"Matt Pocock skills: tdd/deep-modules.md",
|
|
36
|
+
],
|
|
37
|
+
purpose: "Find cleanup work that would increase leverage and locality by moving complexity behind smaller, more durable interfaces.",
|
|
38
|
+
lookFor: [
|
|
39
|
+
"places where callers know too much about ordering, config, data shape, or error modes",
|
|
40
|
+
"logic spread across shallow helper layers where each layer adds little leverage",
|
|
41
|
+
"candidate modules where a small public interface could hide a larger implementation",
|
|
42
|
+
"dependencies that should be classified before deepening: in-process, local-substitutable, remote owned, or true external",
|
|
43
|
+
"seams that are only hypothetical because there is one adapter and no real second use such as tests",
|
|
44
|
+
"tests that should move to the deepened module interface after shallow modules are collapsed",
|
|
45
|
+
],
|
|
46
|
+
reject: [
|
|
47
|
+
"suggestions to add interfaces or ports without evidence of two adapters or a real substitution need",
|
|
48
|
+
"refactors that merely split files without improving leverage or locality",
|
|
49
|
+
"test-only extractions that make production design shallower",
|
|
50
|
+
],
|
|
51
|
+
output: [
|
|
52
|
+
"state the interface pressure callers currently feel",
|
|
53
|
+
"classify the dependency shape that constrains the cleanup",
|
|
54
|
+
"recommend a small deepening step that improves both maintainability and testability",
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "duplication-consolidation",
|
|
59
|
+
title: "Conceptual duplication and consolidation",
|
|
60
|
+
purpose: "Find repeated behavior or policy that should become one source of truth.",
|
|
61
|
+
lookFor: [
|
|
62
|
+
"duplicate code blocks that reflect duplicated domain decisions",
|
|
63
|
+
"same validation, formatting, permission, API, or config behavior across feature areas",
|
|
64
|
+
"parallel frontend/admin/backend implementations that are likely to drift",
|
|
65
|
+
"repeated literals or branching rules that encode the same concept",
|
|
66
|
+
],
|
|
67
|
+
reject: [
|
|
68
|
+
"incidental duplicated syntax with no shared domain meaning",
|
|
69
|
+
"test fixture repetition",
|
|
70
|
+
"framework boilerplate",
|
|
71
|
+
],
|
|
72
|
+
output: [
|
|
73
|
+
"identify the repeated concept",
|
|
74
|
+
"state which callers must stay behaviorally compatible",
|
|
75
|
+
"recommend the consolidation target without prescribing a broad rewrite",
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "dependency-graph",
|
|
80
|
+
title: "Dependency graph and blast radius",
|
|
81
|
+
purpose: "Use import/reference structure to find hotspots, direction problems, and risky cleanup order.",
|
|
82
|
+
lookFor: [
|
|
83
|
+
"files with high incoming and outgoing edges",
|
|
84
|
+
"directories with high cross-boundary traffic",
|
|
85
|
+
"central utility files that mix unrelated policies",
|
|
86
|
+
"feature code importing across boundaries instead of through stable modules",
|
|
87
|
+
"cleanup candidates that should be handled as a cluster because their graph is connected",
|
|
88
|
+
],
|
|
89
|
+
reject: [
|
|
90
|
+
"hotspot claims based only on file count",
|
|
91
|
+
"dependency conclusions that ignore the supplied graph evidence",
|
|
92
|
+
],
|
|
93
|
+
output: [
|
|
94
|
+
"explain the graph shape and why it matters",
|
|
95
|
+
"call out likely blast radius",
|
|
96
|
+
"suggest a safe sequencing strategy for later cleanup",
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "testability",
|
|
101
|
+
title: "Testability and verification gaps",
|
|
102
|
+
basis: [
|
|
103
|
+
"Deepclean native reviewer",
|
|
104
|
+
"Matt Pocock skills: tdd",
|
|
105
|
+
"Matt Pocock skills: diagnose",
|
|
106
|
+
],
|
|
107
|
+
purpose: "Find cleanup work that needs tests or seams before agents can safely refactor.",
|
|
108
|
+
lookFor: [
|
|
109
|
+
"complex or central files without nearby tests",
|
|
110
|
+
"logic embedded where it cannot be unit-tested directly",
|
|
111
|
+
"duplicated behavior with no shared regression test",
|
|
112
|
+
"clusters whose verification requires both typecheck and targeted tests",
|
|
113
|
+
"missing fast deterministic feedback loops for risky cleanup",
|
|
114
|
+
"tests coupled to implementation details rather than public behavior",
|
|
115
|
+
],
|
|
116
|
+
reject: [
|
|
117
|
+
"generic add-more-tests advice",
|
|
118
|
+
"test gap claims for files already covered by obvious nearby tests unless evidence says otherwise",
|
|
119
|
+
],
|
|
120
|
+
output: [
|
|
121
|
+
"state the cleanup risk caused by the missing tests",
|
|
122
|
+
"propose narrow regression checks",
|
|
123
|
+
"include practical verification commands",
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: "feedback-loop-discipline",
|
|
128
|
+
title: "Feedback loop discipline",
|
|
129
|
+
basis: [
|
|
130
|
+
"Matt Pocock skills: diagnose",
|
|
131
|
+
"Matt Pocock skills: tdd",
|
|
132
|
+
"Matt Pocock skills: tdd/refactoring.md",
|
|
133
|
+
],
|
|
134
|
+
purpose: "Find candidates where cleanup is unsafe until a future agent has a fast, behavior-level pass/fail loop.",
|
|
135
|
+
lookFor: [
|
|
136
|
+
"areas where the proposed cleanup needs one failing regression test or tracer-bullet test before refactoring",
|
|
137
|
+
"bug-prone or high-churn code with no sharp verification command",
|
|
138
|
+
"test suites that would break on implementation refactors while missing observable behavior",
|
|
139
|
+
"cleanup candidates that need a minimal harness, CLI invocation, HTTP script, or browser check before changes",
|
|
140
|
+
"places where duplication, primitive obsession, feature envy, or long methods are only safely addressable after green behavior coverage exists",
|
|
141
|
+
],
|
|
142
|
+
reject: [
|
|
143
|
+
"generic requests for more tests without naming the behavior and interface",
|
|
144
|
+
"horizontal-slice plans that write many speculative tests before proving one path works",
|
|
145
|
+
"verification plans that require manual inspection when an agent-runnable loop is plausible",
|
|
146
|
+
],
|
|
147
|
+
output: [
|
|
148
|
+
"name the first behavior-level feedback loop a future agent should build",
|
|
149
|
+
"explain why cleanup is risky without that loop",
|
|
150
|
+
"prefer one vertical tracer bullet over broad test-suite expansion",
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "domain-language",
|
|
155
|
+
title: "Domain language and naming drift",
|
|
156
|
+
basis: [
|
|
157
|
+
"Deepclean native reviewer",
|
|
158
|
+
"Matt Pocock skills: grill-with-docs",
|
|
159
|
+
],
|
|
160
|
+
purpose: "Find places where the code lacks clear names for real concepts, causing sprawl.",
|
|
161
|
+
lookFor: [
|
|
162
|
+
"same concept represented by several names across UI, API, and services",
|
|
163
|
+
"generic names like manager, helper, utils, data, handler, processor hiding domain policy",
|
|
164
|
+
"business rules spread through technical plumbing instead of named domain modules",
|
|
165
|
+
"missing glossary or context boundary that would help future agents avoid drift",
|
|
166
|
+
],
|
|
167
|
+
reject: [
|
|
168
|
+
"pure cosmetic naming preferences",
|
|
169
|
+
"claims about product semantics not supported by paths, titles, or evidence summaries",
|
|
170
|
+
],
|
|
171
|
+
output: [
|
|
172
|
+
"name the likely domain concept",
|
|
173
|
+
"identify where naming drift appears",
|
|
174
|
+
"suggest what context or module name should be clarified",
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: "agent-ready-slices",
|
|
179
|
+
title: "Agent-ready cleanup slices",
|
|
180
|
+
basis: [
|
|
181
|
+
"Matt Pocock skills: to-issues",
|
|
182
|
+
"Matt Pocock skills: triage",
|
|
183
|
+
"Matt Pocock skills: handoff",
|
|
184
|
+
],
|
|
185
|
+
purpose: "Keep synthesis output shaped as independently grabbable cleanup work for coding agents.",
|
|
186
|
+
lookFor: [
|
|
187
|
+
"findings that can be turned into a thin vertical slice with clear acceptance criteria",
|
|
188
|
+
"cleanup work that is AFK-agent ready versus work needing human design judgment",
|
|
189
|
+
"candidate dependencies that should block or sequence later cleanup plans",
|
|
190
|
+
"missing agent brief details: established facts, unresolved questions, constraints, verification, and expected output",
|
|
191
|
+
"themes that should be split because they cross too many modules or require multiple decisions",
|
|
192
|
+
],
|
|
193
|
+
reject: [
|
|
194
|
+
"broad modernization themes that no agent could complete in one bounded pass",
|
|
195
|
+
"plans that describe layers to edit instead of end-to-end behavior to preserve",
|
|
196
|
+
"findings with unresolved product or domain questions presented as ready-to-fix",
|
|
197
|
+
],
|
|
198
|
+
output: [
|
|
199
|
+
"state whether the candidate is agent-ready or design-needed",
|
|
200
|
+
"name the narrowest useful slice a future agent can take",
|
|
201
|
+
"include sequencing and blockers when the cleanup should not start immediately",
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: "ai-slop-patterns",
|
|
206
|
+
title: "AI-slop cleanup patterns",
|
|
207
|
+
purpose: "Find code shapes that often result from fast agentic implementation and become expensive later.",
|
|
208
|
+
lookFor: [
|
|
209
|
+
"shallow wrappers that do not protect a real boundary",
|
|
210
|
+
"copy-pasted near-solutions instead of shared policy",
|
|
211
|
+
"overgrown files that mix fetching, mapping, validation, rendering, and error handling",
|
|
212
|
+
"adapter layers that mirror implementation details without simplifying callers",
|
|
213
|
+
"places where a future agent is likely to add another special case instead of improving structure",
|
|
214
|
+
],
|
|
215
|
+
reject: [
|
|
216
|
+
"vague accusations that code is AI-generated",
|
|
217
|
+
"style-only complaints",
|
|
218
|
+
"cleanup suggestions that would be larger than the evidence justifies",
|
|
219
|
+
],
|
|
220
|
+
output: [
|
|
221
|
+
"describe the slop shape in concrete engineering terms",
|
|
222
|
+
"explain how it will get worse",
|
|
223
|
+
"recommend a constrained cleanup direction",
|
|
224
|
+
],
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: "critic-pass",
|
|
228
|
+
title: "Finding quality critic",
|
|
229
|
+
purpose: "Reject weak findings and keep only work an agent can act on with evidence.",
|
|
230
|
+
lookFor: [
|
|
231
|
+
"candidates supported by multiple evidence types or a strong graph/duplication signal",
|
|
232
|
+
"clear impact, root cause, and future-agent handoff value",
|
|
233
|
+
"bounded cleanup work rather than broad modernization",
|
|
234
|
+
],
|
|
235
|
+
reject: [
|
|
236
|
+
"one-metric findings presented as architectural conclusions",
|
|
237
|
+
"anything without valid evidence IDs",
|
|
238
|
+
"claims that require reading source that was not provided",
|
|
239
|
+
"recommendations to rewrite large areas without a staged verification plan",
|
|
240
|
+
],
|
|
241
|
+
output: [
|
|
242
|
+
"prefer fewer stronger findings",
|
|
243
|
+
"downgrade confidence when evidence is thin",
|
|
244
|
+
"use notes for rejected evidence themes instead of forcing candidates",
|
|
245
|
+
],
|
|
246
|
+
},
|
|
247
|
+
];
|
|
248
|
+
export function buildCleanupSurfaces(evidence, candidates, limit = 12) {
|
|
249
|
+
const surfaces = new Map();
|
|
250
|
+
for (const candidate of candidates) {
|
|
251
|
+
const areas = candidate.files.length > 0
|
|
252
|
+
? unique(candidate.files.map((file) => surfaceArea(file.path)))
|
|
253
|
+
: [`candidate:${candidate.category}`];
|
|
254
|
+
for (const area of areas) {
|
|
255
|
+
const surface = getSurface(surfaces, area);
|
|
256
|
+
surface.candidateIds.add(candidate.id);
|
|
257
|
+
surface.score += 6;
|
|
258
|
+
surface.signals.add(`${candidate.priority} ${candidate.category}: ${candidate.title}`);
|
|
259
|
+
for (const id of candidate.evidenceIds) {
|
|
260
|
+
surface.evidenceIds.add(id);
|
|
261
|
+
}
|
|
262
|
+
for (const file of candidate.files) {
|
|
263
|
+
addFile(surface, file);
|
|
264
|
+
}
|
|
265
|
+
for (const reviewerId of reviewersForCandidate(candidate)) {
|
|
266
|
+
surface.reviewerIds.add(reviewerId);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
for (const record of evidence) {
|
|
271
|
+
const areas = evidenceAreas(record);
|
|
272
|
+
for (const area of areas) {
|
|
273
|
+
const surface = getSurface(surfaces, area);
|
|
274
|
+
surface.evidenceIds.add(record.id);
|
|
275
|
+
surface.score += scoreEvidence(record);
|
|
276
|
+
surface.signals.add(`${record.kind}: ${record.title}`);
|
|
277
|
+
for (const file of record.files) {
|
|
278
|
+
addFile(surface, file);
|
|
279
|
+
}
|
|
280
|
+
for (const reviewerId of reviewersForEvidence(record)) {
|
|
281
|
+
surface.reviewerIds.add(reviewerId);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
addGraphDirectorySurfaces(surfaces, evidence);
|
|
286
|
+
return [...surfaces.values()]
|
|
287
|
+
.filter((surface) => surface.evidenceIds.size > 0 || surface.candidateIds.size > 0)
|
|
288
|
+
.sort((a, b) => b.score - a.score || a.key.localeCompare(b.key))
|
|
289
|
+
.slice(0, limit)
|
|
290
|
+
.map((surface, index) => ({
|
|
291
|
+
id: `surface-${String(index + 1).padStart(3, "0")}`,
|
|
292
|
+
title: surface.title,
|
|
293
|
+
focus: surface.focus,
|
|
294
|
+
reviewerIds: [...surface.reviewerIds].sort(),
|
|
295
|
+
evidenceIds: [...surface.evidenceIds].sort(),
|
|
296
|
+
candidateIds: [...surface.candidateIds].sort(),
|
|
297
|
+
files: [...surface.files.values()].slice(0, 12),
|
|
298
|
+
signals: [...surface.signals].slice(0, 10),
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
function getSurface(surfaces, key) {
|
|
302
|
+
const existing = surfaces.get(key);
|
|
303
|
+
if (existing) {
|
|
304
|
+
return existing;
|
|
305
|
+
}
|
|
306
|
+
const surface = {
|
|
307
|
+
key,
|
|
308
|
+
title: `Cleanup surface: ${key}`,
|
|
309
|
+
focus: `Review ${key} as one maintainability surface, not as isolated files.`,
|
|
310
|
+
reviewerIds: new Set(["critic-pass"]),
|
|
311
|
+
evidenceIds: new Set(),
|
|
312
|
+
candidateIds: new Set(),
|
|
313
|
+
files: new Map(),
|
|
314
|
+
signals: new Set(),
|
|
315
|
+
score: 0,
|
|
316
|
+
};
|
|
317
|
+
surfaces.set(key, surface);
|
|
318
|
+
return surface;
|
|
319
|
+
}
|
|
320
|
+
function addGraphDirectorySurfaces(surfaces, evidence) {
|
|
321
|
+
for (const record of evidence) {
|
|
322
|
+
if (record.kind !== "code-graph-summary") {
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
const directories = arrayOfRecords(record.data["directories"]);
|
|
326
|
+
const hotspots = arrayOfRecords(record.data["hotspots"]);
|
|
327
|
+
for (const directory of directories.slice(0, 12)) {
|
|
328
|
+
const directoryPath = stringValue(directory["path"]);
|
|
329
|
+
if (!directoryPath) {
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
const fileCount = numberValue(directory["fileCount"]);
|
|
333
|
+
const internalEdges = numberValue(directory["internalEdges"]);
|
|
334
|
+
const incomingEdges = numberValue(directory["incomingEdges"]);
|
|
335
|
+
const outgoingEdges = numberValue(directory["outgoingEdges"]);
|
|
336
|
+
const graphScore = fileCount + internalEdges + incomingEdges + outgoingEdges;
|
|
337
|
+
if (graphScore < 5) {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
const surface = getSurface(surfaces, directoryPath);
|
|
341
|
+
surface.title = `Graph surface: ${directoryPath}`;
|
|
342
|
+
surface.focus = "Review this directory as a graph-connected cleanup surface.";
|
|
343
|
+
surface.evidenceIds.add(record.id);
|
|
344
|
+
surface.reviewerIds.add("dependency-graph");
|
|
345
|
+
surface.reviewerIds.add("architecture-deepening");
|
|
346
|
+
surface.reviewerIds.add("deep-module-discipline");
|
|
347
|
+
surface.score += graphScore;
|
|
348
|
+
surface.signals.add(`graph: ${fileCount} files, ${internalEdges} internal edges, ${incomingEdges} incoming edges, ${outgoingEdges} outgoing edges`);
|
|
349
|
+
for (const hotspot of hotspots) {
|
|
350
|
+
const hotspotPath = stringValue(hotspot["path"]);
|
|
351
|
+
if (hotspotPath?.startsWith(`${directoryPath}/`)) {
|
|
352
|
+
addFile(surface, { path: hotspotPath, startLine: 1, endLine: 1 });
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
function evidenceAreas(record) {
|
|
359
|
+
const fileAreas = record.files.map((file) => surfaceArea(file.path));
|
|
360
|
+
if (fileAreas.length > 0) {
|
|
361
|
+
return unique(fileAreas);
|
|
362
|
+
}
|
|
363
|
+
return [record.kind];
|
|
364
|
+
}
|
|
365
|
+
function addFile(surface, file) {
|
|
366
|
+
const existing = surface.files.get(file.path);
|
|
367
|
+
if (existing) {
|
|
368
|
+
const startLine = Math.min(existing.startLine ?? 1, file.startLine ?? 1);
|
|
369
|
+
const endLine = Math.max(existing.endLine ?? 1, file.endLine ?? 1);
|
|
370
|
+
surface.files.set(file.path, { path: file.path, startLine, endLine });
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
surface.files.set(file.path, {
|
|
374
|
+
path: file.path,
|
|
375
|
+
startLine: file.startLine ?? 1,
|
|
376
|
+
endLine: file.endLine ?? 1,
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
function reviewersForCandidate(candidate) {
|
|
380
|
+
switch (candidate.category) {
|
|
381
|
+
case "architecture":
|
|
382
|
+
return ["architecture-deepening", "deep-module-discipline", "dependency-graph"];
|
|
383
|
+
case "complexity":
|
|
384
|
+
return ["architecture-deepening", "deep-module-discipline", "testability", "feedback-loop-discipline"];
|
|
385
|
+
case "duplication":
|
|
386
|
+
return ["duplication-consolidation"];
|
|
387
|
+
case "testability":
|
|
388
|
+
return ["testability", "feedback-loop-discipline"];
|
|
389
|
+
case "ai-slop":
|
|
390
|
+
return ["ai-slop-patterns", "architecture-deepening", "agent-ready-slices"];
|
|
391
|
+
case "domain-drift":
|
|
392
|
+
return ["domain-language", "architecture-deepening"];
|
|
393
|
+
case "dead-weight":
|
|
394
|
+
return ["dependency-graph", "ai-slop-patterns", "agent-ready-slices"];
|
|
395
|
+
case "diagnostic":
|
|
396
|
+
return ["critic-pass"];
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function reviewersForEvidence(record) {
|
|
400
|
+
switch (record.kind) {
|
|
401
|
+
case "duplicate-cluster":
|
|
402
|
+
return ["duplication-consolidation"];
|
|
403
|
+
case "dependency-hotspot":
|
|
404
|
+
case "code-graph-summary":
|
|
405
|
+
return ["dependency-graph", "architecture-deepening", "deep-module-discipline"];
|
|
406
|
+
case "large-file":
|
|
407
|
+
case "complex-function":
|
|
408
|
+
return ["architecture-deepening", "deep-module-discipline", "testability", "feedback-loop-discipline"];
|
|
409
|
+
case "shallow-wrapper-cluster":
|
|
410
|
+
return ["ai-slop-patterns", "architecture-deepening", "deep-module-discipline"];
|
|
411
|
+
case "test-gap":
|
|
412
|
+
return ["testability", "feedback-loop-discipline"];
|
|
413
|
+
default:
|
|
414
|
+
return ["critic-pass"];
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function scoreEvidence(record) {
|
|
418
|
+
const confidenceScore = record.confidence === "high" ? 5 : record.confidence === "medium" ? 3 : 1;
|
|
419
|
+
const kindScore = record.kind === "code-graph-summary" ? 4
|
|
420
|
+
: record.kind === "duplicate-cluster" ? 5
|
|
421
|
+
: record.kind === "dependency-hotspot" ? 4
|
|
422
|
+
: 2;
|
|
423
|
+
return confidenceScore + kindScore;
|
|
424
|
+
}
|
|
425
|
+
function surfaceArea(filePath) {
|
|
426
|
+
const parts = filePath.split("/").filter(Boolean);
|
|
427
|
+
if (parts.length === 0) {
|
|
428
|
+
return ".";
|
|
429
|
+
}
|
|
430
|
+
const srcIndex = parts.indexOf("src");
|
|
431
|
+
if (srcIndex >= 0) {
|
|
432
|
+
const end = Math.min(parts.length - 1, srcIndex + 3);
|
|
433
|
+
return parts.slice(0, end).join("/") || (parts[0] ?? ".");
|
|
434
|
+
}
|
|
435
|
+
if (parts.length >= 3 && ["backend", "core", "frontend", "admin", "api"].includes(parts[0] ?? "")) {
|
|
436
|
+
return parts.slice(0, 2).join("/");
|
|
437
|
+
}
|
|
438
|
+
if (parts.length <= 2) {
|
|
439
|
+
return parts.length === 1 ? "." : parts[0] ?? ".";
|
|
440
|
+
}
|
|
441
|
+
return parts.slice(0, 2).join("/");
|
|
442
|
+
}
|
|
443
|
+
function unique(values) {
|
|
444
|
+
return [...new Set(values)];
|
|
445
|
+
}
|
|
446
|
+
function arrayOfRecords(value) {
|
|
447
|
+
if (!Array.isArray(value)) {
|
|
448
|
+
return [];
|
|
449
|
+
}
|
|
450
|
+
return value.filter(isRecord);
|
|
451
|
+
}
|
|
452
|
+
function isRecord(value) {
|
|
453
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
454
|
+
}
|
|
455
|
+
function stringValue(value) {
|
|
456
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
457
|
+
}
|
|
458
|
+
function numberValue(value) {
|
|
459
|
+
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
460
|
+
}
|
|
461
|
+
//# sourceMappingURL=reviewers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewers.js","sourceRoot":"","sources":["../src/reviewers.ts"],"names":[],"mappings":"AAmCA,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C;QACE,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,mCAAmC;QAC1C,KAAK,EAAE;YACL,2BAA2B;YAC3B,mDAAmD;SACpD;QACD,OAAO,EAAE,2FAA2F;QACpG,OAAO,EAAE;YACP,gFAAgF;YAChF,mFAAmF;YACnF,mFAAmF;YACnF,yEAAyE;YACzE,8EAA8E;YAC9E,8EAA8E;YAC9E,8GAA8G;SAC/G;QACD,MAAM,EAAE;YACN,8DAA8D;YAC9D,iEAAiE;YACjE,2BAA2B;SAC5B;QACD,MAAM,EAAE;YACN,mCAAmC;YACnC,uCAAuC;YACvC,6EAA6E;SAC9E;KACF;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,wBAAwB;QAC/B,KAAK,EAAE;YACL,gEAAgE;YAChE,yCAAyC;SAC1C;QACD,OAAO,EAAE,2HAA2H;QACpI,OAAO,EAAE;YACP,uFAAuF;YACvF,iFAAiF;YACjF,qFAAqF;YACrF,0HAA0H;YAC1H,oGAAoG;YACpG,6FAA6F;SAC9F;QACD,MAAM,EAAE;YACN,qGAAqG;YACrG,0EAA0E;YAC1E,6DAA6D;SAC9D;QACD,MAAM,EAAE;YACN,qDAAqD;YACrD,2DAA2D;YAC3D,qFAAqF;SACtF;KACF;IACD;QACE,EAAE,EAAE,2BAA2B;QAC/B,KAAK,EAAE,0CAA0C;QACjD,OAAO,EAAE,0EAA0E;QACnF,OAAO,EAAE;YACP,gEAAgE;YAChE,uFAAuF;YACvF,0EAA0E;YAC1E,mEAAmE;SACpE;QACD,MAAM,EAAE;YACN,4DAA4D;YAC5D,yBAAyB;YACzB,uBAAuB;SACxB;QACD,MAAM,EAAE;YACN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;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,MAAM,CAAC,MAAgB;IAC9B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC"}
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type CandidateRecord, type ClusterRecord, type DeepcleanConfig, type EvidenceRecord, type HandoffRecord, type PlanRecord, type ReportRecord, type RunRecord, type TriageRecord } from "./types.js";
|
|
2
|
+
export interface StatePaths {
|
|
3
|
+
root: string;
|
|
4
|
+
stateDir: string;
|
|
5
|
+
configPath: string;
|
|
6
|
+
runsDir: string;
|
|
7
|
+
evidenceDir: string;
|
|
8
|
+
candidatesDir: string;
|
|
9
|
+
clustersDir: string;
|
|
10
|
+
reportsDir: string;
|
|
11
|
+
triageDir: string;
|
|
12
|
+
handoffsDir: string;
|
|
13
|
+
plansDir: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveStatePaths(options: {
|
|
16
|
+
cwd: string;
|
|
17
|
+
root?: string | undefined;
|
|
18
|
+
stateDir?: string | undefined;
|
|
19
|
+
config?: string | undefined;
|
|
20
|
+
}): StatePaths;
|
|
21
|
+
export declare function ensureState(paths: StatePaths): Promise<DeepcleanConfig>;
|
|
22
|
+
export declare function readConfig(paths: StatePaths): Promise<DeepcleanConfig>;
|
|
23
|
+
export declare function writeRun(paths: StatePaths, run: RunRecord): Promise<string>;
|
|
24
|
+
export declare function writeEvidence(paths: StatePaths, runId: string, records: EvidenceRecord[]): Promise<string>;
|
|
25
|
+
export declare function writeCandidates(paths: StatePaths, runId: string, records: CandidateRecord[]): Promise<string>;
|
|
26
|
+
export declare function writeReport(paths: StatePaths, report: ReportRecord, markdown: string): Promise<{
|
|
27
|
+
jsonPath: string;
|
|
28
|
+
markdownPath: string;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function writeClusters(paths: StatePaths, runId: string, records: ClusterRecord[]): Promise<string>;
|
|
31
|
+
export declare function writeTriage(paths: StatePaths, triage: TriageRecord): Promise<string>;
|
|
32
|
+
export declare function writeHandoff(paths: StatePaths, handoff: HandoffRecord): Promise<string>;
|
|
33
|
+
export declare function writePlan(paths: StatePaths, plan: PlanRecord): Promise<string>;
|
|
34
|
+
export declare function latestRunId(paths: StatePaths): Promise<string | undefined>;
|
|
35
|
+
export declare function readLatestCandidates(paths: StatePaths): Promise<CandidateRecord[]>;
|
|
36
|
+
export declare function readLatestClusters(paths: StatePaths): Promise<ClusterRecord[]>;
|
|
37
|
+
export declare function readLatestEvidence(paths: StatePaths): Promise<EvidenceRecord[]>;
|
|
38
|
+
export declare function readClusters(paths: StatePaths, runId: string): Promise<ClusterRecord[]>;
|
|
39
|
+
export declare function readCandidates(paths: StatePaths, runId: string): Promise<CandidateRecord[]>;
|
|
40
|
+
export declare function readEvidence(paths: StatePaths, runId: string): Promise<EvidenceRecord[]>;
|
|
41
|
+
export declare function updateLatestCandidates(paths: StatePaths, candidates: CandidateRecord[]): Promise<string>;
|