@aiready/cli 0.10.4 → 0.10.6
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/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-test.log +3 -3
- package/dist/chunk-VQCWYJYJ.mjs +438 -0
- package/dist/cli.js +100 -82
- package/dist/cli.mjs +29 -28
- package/dist/index.js +92 -74
- package/dist/index.mjs +1 -1
- package/package.json +12 -12
- package/src/.aiready/aiready-report-20260306-213155.json +24657 -0
- package/src/.aiready/aiready-report-20260306-213925.json +24657 -0
- package/src/commands/scan.ts +31 -29
- package/src/index.ts +112 -93
package/dist/cli.js
CHANGED
|
@@ -87,11 +87,13 @@ async function analyzeUnified(options) {
|
|
|
87
87
|
if (options.progressCallback) {
|
|
88
88
|
options.progressCallback({ tool: "patterns", data: patternResult });
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
const output = {
|
|
91
91
|
results: sortBySeverity(patternResult.results),
|
|
92
92
|
summary: patternResult.summary || {},
|
|
93
93
|
duplicates: patternResult.duplicates || []
|
|
94
94
|
};
|
|
95
|
+
result[import_core.ToolName.PatternDetect] = output;
|
|
96
|
+
result.patternDetect = output;
|
|
95
97
|
result.summary.totalIssues += patternResult.results.reduce(
|
|
96
98
|
(sum, file) => sum + file.issues.length,
|
|
97
99
|
0
|
|
@@ -109,10 +111,12 @@ async function analyzeUnified(options) {
|
|
|
109
111
|
return b.fragmentationScore - a.fragmentationScore;
|
|
110
112
|
});
|
|
111
113
|
const { generateSummary: genContextSummary } = await import("@aiready/context-analyzer");
|
|
112
|
-
|
|
114
|
+
const output = {
|
|
113
115
|
results: sorted,
|
|
114
116
|
summary: genContextSummary(sorted)
|
|
115
117
|
};
|
|
118
|
+
result[import_core.ToolName.ContextAnalyzer] = output;
|
|
119
|
+
result.contextAnalyzer = output;
|
|
116
120
|
result.summary.totalIssues += sorted.length;
|
|
117
121
|
}
|
|
118
122
|
if (tools.includes("consistency")) {
|
|
@@ -126,7 +130,7 @@ async function analyzeUnified(options) {
|
|
|
126
130
|
if (options.progressCallback) {
|
|
127
131
|
options.progressCallback({ tool: "consistency", data: report });
|
|
128
132
|
}
|
|
129
|
-
result.
|
|
133
|
+
result[import_core.ToolName.NamingConsistency] = {
|
|
130
134
|
results: report.results ? sortBySeverity(report.results) : [],
|
|
131
135
|
summary: report.summary
|
|
132
136
|
};
|
|
@@ -143,7 +147,7 @@ async function analyzeUnified(options) {
|
|
|
143
147
|
if (options.progressCallback) {
|
|
144
148
|
options.progressCallback({ tool: "doc-drift", data: report });
|
|
145
149
|
}
|
|
146
|
-
result.
|
|
150
|
+
result[import_core.ToolName.DocDrift] = {
|
|
147
151
|
results: report.results || report.issues || [],
|
|
148
152
|
summary: report.summary || {}
|
|
149
153
|
};
|
|
@@ -161,7 +165,7 @@ async function analyzeUnified(options) {
|
|
|
161
165
|
if (options.progressCallback) {
|
|
162
166
|
options.progressCallback({ tool: "deps-health", data: report });
|
|
163
167
|
}
|
|
164
|
-
result.
|
|
168
|
+
result[import_core.ToolName.DependencyHealth] = {
|
|
165
169
|
results: report.results || report.issues || [],
|
|
166
170
|
summary: report.summary || {}
|
|
167
171
|
};
|
|
@@ -179,7 +183,7 @@ async function analyzeUnified(options) {
|
|
|
179
183
|
if (options.progressCallback) {
|
|
180
184
|
options.progressCallback({ tool: "ai-signal-clarity", data: report });
|
|
181
185
|
}
|
|
182
|
-
result.
|
|
186
|
+
result[import_core.ToolName.AiSignalClarity] = {
|
|
183
187
|
...report,
|
|
184
188
|
results: report.results || report.issues || [],
|
|
185
189
|
summary: report.summary || {}
|
|
@@ -200,7 +204,7 @@ async function analyzeUnified(options) {
|
|
|
200
204
|
if (options.progressCallback) {
|
|
201
205
|
options.progressCallback({ tool: "agent-grounding", data: report });
|
|
202
206
|
}
|
|
203
|
-
result.
|
|
207
|
+
result[import_core.ToolName.AgentGrounding] = {
|
|
204
208
|
...report,
|
|
205
209
|
results: report.results || report.issues || [],
|
|
206
210
|
summary: report.summary || {}
|
|
@@ -218,7 +222,7 @@ async function analyzeUnified(options) {
|
|
|
218
222
|
if (options.progressCallback) {
|
|
219
223
|
options.progressCallback({ tool: "testability", data: report });
|
|
220
224
|
}
|
|
221
|
-
result.
|
|
225
|
+
result[import_core.ToolName.TestabilityIndex] = {
|
|
222
226
|
...report,
|
|
223
227
|
results: report.results || report.issues || [],
|
|
224
228
|
summary: report.summary || {}
|
|
@@ -236,7 +240,7 @@ async function analyzeUnified(options) {
|
|
|
236
240
|
if (options.progressCallback) {
|
|
237
241
|
options.progressCallback({ tool: "change-amplification", data: report });
|
|
238
242
|
}
|
|
239
|
-
result.
|
|
243
|
+
result[import_core.ToolName.ChangeAmplification] = {
|
|
240
244
|
results: report.results || [],
|
|
241
245
|
summary: report.summary || {}
|
|
242
246
|
};
|
|
@@ -247,14 +251,15 @@ async function analyzeUnified(options) {
|
|
|
247
251
|
}
|
|
248
252
|
async function scoreUnified(results, options) {
|
|
249
253
|
const toolScores = /* @__PURE__ */ new Map();
|
|
250
|
-
if (results.
|
|
254
|
+
if (results[import_core.ToolName.PatternDetect]) {
|
|
255
|
+
const data = results[import_core.ToolName.PatternDetect];
|
|
251
256
|
const { calculatePatternScore } = await import("@aiready/pattern-detect");
|
|
252
257
|
try {
|
|
253
258
|
const patternScore = calculatePatternScore(
|
|
254
|
-
|
|
255
|
-
|
|
259
|
+
data.duplicates,
|
|
260
|
+
data.results?.length || 0
|
|
256
261
|
);
|
|
257
|
-
const wastedTokens =
|
|
262
|
+
const wastedTokens = data.duplicates.reduce(
|
|
258
263
|
(sum, d) => sum + (d.tokenCost || 0),
|
|
259
264
|
0
|
|
260
265
|
);
|
|
@@ -267,15 +272,16 @@ async function scoreUnified(results, options) {
|
|
|
267
272
|
chattiness: 0
|
|
268
273
|
}
|
|
269
274
|
});
|
|
270
|
-
toolScores.set(
|
|
275
|
+
toolScores.set(import_core.ToolName.PatternDetect, patternScore);
|
|
271
276
|
} catch (err) {
|
|
272
277
|
void err;
|
|
273
278
|
}
|
|
274
279
|
}
|
|
275
|
-
if (results.
|
|
280
|
+
if (results[import_core.ToolName.ContextAnalyzer]) {
|
|
281
|
+
const data = results[import_core.ToolName.ContextAnalyzer];
|
|
276
282
|
const { calculateContextScore } = await import("@aiready/context-analyzer");
|
|
277
283
|
try {
|
|
278
|
-
const ctxSummary =
|
|
284
|
+
const ctxSummary = data.summary;
|
|
279
285
|
const contextScore = calculateContextScore(ctxSummary);
|
|
280
286
|
contextScore.tokenBudget = (0, import_core.calculateTokenBudget)({
|
|
281
287
|
totalContextTokens: ctxSummary.totalTokens,
|
|
@@ -285,56 +291,62 @@ async function scoreUnified(results, options) {
|
|
|
285
291
|
chattiness: 0
|
|
286
292
|
}
|
|
287
293
|
});
|
|
288
|
-
toolScores.set(
|
|
294
|
+
toolScores.set(import_core.ToolName.ContextAnalyzer, contextScore);
|
|
289
295
|
} catch (err) {
|
|
290
296
|
void err;
|
|
291
297
|
}
|
|
292
298
|
}
|
|
293
|
-
if (results.
|
|
299
|
+
if (results[import_core.ToolName.NamingConsistency]) {
|
|
300
|
+
const data = results[import_core.ToolName.NamingConsistency];
|
|
294
301
|
const { calculateConsistencyScore } = await import("@aiready/consistency");
|
|
295
302
|
try {
|
|
296
|
-
const issues =
|
|
297
|
-
const totalFiles =
|
|
303
|
+
const issues = data.results?.flatMap((r) => r.issues) || [];
|
|
304
|
+
const totalFiles = data.summary?.filesAnalyzed || 0;
|
|
298
305
|
const consistencyScore = calculateConsistencyScore(issues, totalFiles);
|
|
299
|
-
toolScores.set(
|
|
306
|
+
toolScores.set(import_core.ToolName.NamingConsistency, consistencyScore);
|
|
300
307
|
} catch (err) {
|
|
301
308
|
void err;
|
|
302
309
|
}
|
|
303
310
|
}
|
|
304
|
-
if (results.
|
|
311
|
+
if (results[import_core.ToolName.AiSignalClarity]) {
|
|
305
312
|
const { calculateAiSignalClarityScore } = await import("@aiready/ai-signal-clarity");
|
|
306
313
|
try {
|
|
307
|
-
const hrScore = calculateAiSignalClarityScore(
|
|
308
|
-
|
|
314
|
+
const hrScore = calculateAiSignalClarityScore(
|
|
315
|
+
results[import_core.ToolName.AiSignalClarity]
|
|
316
|
+
);
|
|
317
|
+
toolScores.set(import_core.ToolName.AiSignalClarity, hrScore);
|
|
309
318
|
} catch (err) {
|
|
310
319
|
void err;
|
|
311
320
|
}
|
|
312
321
|
}
|
|
313
|
-
if (results.
|
|
322
|
+
if (results[import_core.ToolName.AgentGrounding]) {
|
|
314
323
|
const { calculateGroundingScore } = await import("@aiready/agent-grounding");
|
|
315
324
|
try {
|
|
316
|
-
const agScore = calculateGroundingScore(results.
|
|
317
|
-
toolScores.set(
|
|
325
|
+
const agScore = calculateGroundingScore(results[import_core.ToolName.AgentGrounding]);
|
|
326
|
+
toolScores.set(import_core.ToolName.AgentGrounding, agScore);
|
|
318
327
|
} catch (err) {
|
|
319
328
|
void err;
|
|
320
329
|
}
|
|
321
330
|
}
|
|
322
|
-
if (results.
|
|
331
|
+
if (results[import_core.ToolName.TestabilityIndex]) {
|
|
323
332
|
const { calculateTestabilityScore } = await import("@aiready/testability");
|
|
324
333
|
try {
|
|
325
|
-
const tbScore = calculateTestabilityScore(
|
|
326
|
-
|
|
334
|
+
const tbScore = calculateTestabilityScore(
|
|
335
|
+
results[import_core.ToolName.TestabilityIndex]
|
|
336
|
+
);
|
|
337
|
+
toolScores.set(import_core.ToolName.TestabilityIndex, tbScore);
|
|
327
338
|
} catch (err) {
|
|
328
339
|
void err;
|
|
329
340
|
}
|
|
330
341
|
}
|
|
331
|
-
if (results.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
342
|
+
if (results[import_core.ToolName.DocDrift]) {
|
|
343
|
+
const data = results[import_core.ToolName.DocDrift];
|
|
344
|
+
toolScores.set(import_core.ToolName.DocDrift, {
|
|
345
|
+
toolName: import_core.ToolName.DocDrift,
|
|
346
|
+
score: data.summary.score || data.summary.totalScore || 0,
|
|
347
|
+
rawMetrics: data.summary,
|
|
336
348
|
factors: [],
|
|
337
|
-
recommendations: (
|
|
349
|
+
recommendations: (data.summary.recommendations || []).map(
|
|
338
350
|
(action) => ({
|
|
339
351
|
action,
|
|
340
352
|
estimatedImpact: 5,
|
|
@@ -343,30 +355,36 @@ async function scoreUnified(results, options) {
|
|
|
343
355
|
)
|
|
344
356
|
});
|
|
345
357
|
}
|
|
346
|
-
if (results.
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
358
|
+
if (results[import_core.ToolName.DependencyHealth]) {
|
|
359
|
+
const data = results[import_core.ToolName.DependencyHealth];
|
|
360
|
+
toolScores.set(import_core.ToolName.DependencyHealth, {
|
|
361
|
+
toolName: import_core.ToolName.DependencyHealth,
|
|
362
|
+
score: data.summary.score || 0,
|
|
363
|
+
rawMetrics: data.summary,
|
|
351
364
|
factors: [],
|
|
352
|
-
recommendations: (
|
|
353
|
-
action
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
365
|
+
recommendations: (data.summary.recommendations || []).map(
|
|
366
|
+
(action) => ({
|
|
367
|
+
action,
|
|
368
|
+
estimatedImpact: 5,
|
|
369
|
+
priority: "medium"
|
|
370
|
+
})
|
|
371
|
+
)
|
|
357
372
|
});
|
|
358
373
|
}
|
|
359
|
-
if (results.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
374
|
+
if (results[import_core.ToolName.ChangeAmplification]) {
|
|
375
|
+
const data = results[import_core.ToolName.ChangeAmplification];
|
|
376
|
+
toolScores.set(import_core.ToolName.ChangeAmplification, {
|
|
377
|
+
toolName: import_core.ToolName.ChangeAmplification,
|
|
378
|
+
score: data.summary.score || 0,
|
|
379
|
+
rawMetrics: data.summary,
|
|
364
380
|
factors: [],
|
|
365
|
-
recommendations: (
|
|
366
|
-
action
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
381
|
+
recommendations: (data.summary.recommendations || []).map(
|
|
382
|
+
(action) => ({
|
|
383
|
+
action,
|
|
384
|
+
estimatedImpact: 5,
|
|
385
|
+
priority: "medium"
|
|
386
|
+
})
|
|
387
|
+
)
|
|
370
388
|
});
|
|
371
389
|
}
|
|
372
390
|
if (toolScores.size === 0) {
|
|
@@ -974,25 +992,25 @@ async function scanAction(directory, options) {
|
|
|
974
992
|
console.log(
|
|
975
993
|
` Total issues (all tools): ${import_chalk3.default.bold(String(results.summary.totalIssues || 0))}`
|
|
976
994
|
);
|
|
977
|
-
if (results.
|
|
995
|
+
if (results[import_core3.ToolName.PatternDetect]) {
|
|
978
996
|
console.log(
|
|
979
|
-
` Duplicate patterns found: ${import_chalk3.default.bold(String(results.
|
|
997
|
+
` Duplicate patterns found: ${import_chalk3.default.bold(String(results[import_core3.ToolName.PatternDetect].duplicates?.length || 0))}`
|
|
980
998
|
);
|
|
981
999
|
console.log(
|
|
982
|
-
` Pattern files with issues: ${import_chalk3.default.bold(String(results.
|
|
1000
|
+
` Pattern files with issues: ${import_chalk3.default.bold(String(results[import_core3.ToolName.PatternDetect].results.length || 0))}`
|
|
983
1001
|
);
|
|
984
1002
|
}
|
|
985
|
-
if (results.
|
|
1003
|
+
if (results[import_core3.ToolName.ContextAnalyzer])
|
|
986
1004
|
console.log(
|
|
987
|
-
` Context issues: ${import_chalk3.default.bold(String(results.
|
|
1005
|
+
` Context issues: ${import_chalk3.default.bold(String(results[import_core3.ToolName.ContextAnalyzer].results.length || 0))}`
|
|
988
1006
|
);
|
|
989
|
-
if (results.
|
|
1007
|
+
if (results[import_core3.ToolName.NamingConsistency])
|
|
990
1008
|
console.log(
|
|
991
|
-
` Consistency issues: ${import_chalk3.default.bold(String(results.
|
|
1009
|
+
` Consistency issues: ${import_chalk3.default.bold(String(results[import_core3.ToolName.NamingConsistency].summary?.totalIssues || 0))}`
|
|
992
1010
|
);
|
|
993
|
-
if (results.
|
|
1011
|
+
if (results[import_core3.ToolName.ChangeAmplification])
|
|
994
1012
|
console.log(
|
|
995
|
-
` Change amplification: ${import_chalk3.default.bold(String(results.
|
|
1013
|
+
` Change amplification: ${import_chalk3.default.bold(String(results[import_core3.ToolName.ChangeAmplification].summary?.score || 0))}/100`
|
|
996
1014
|
);
|
|
997
1015
|
console.log(import_chalk3.default.cyan("===========================\n"));
|
|
998
1016
|
const elapsedTime = (0, import_core3.getElapsedTime)(startTime);
|
|
@@ -1183,15 +1201,15 @@ async function scanAction(directory, options) {
|
|
|
1183
1201
|
allResults.push(normalizedResult);
|
|
1184
1202
|
});
|
|
1185
1203
|
};
|
|
1186
|
-
collect(res.
|
|
1187
|
-
collect(res.
|
|
1188
|
-
collect(res.
|
|
1189
|
-
collect(res.
|
|
1190
|
-
collect(res.
|
|
1191
|
-
collect(res.
|
|
1192
|
-
collect(res.
|
|
1193
|
-
collect(res.
|
|
1194
|
-
collect(res.
|
|
1204
|
+
collect(res[import_core3.ToolName.PatternDetect], import_core3.IssueType.DuplicatePattern);
|
|
1205
|
+
collect(res[import_core3.ToolName.ContextAnalyzer], import_core3.IssueType.ContextFragmentation);
|
|
1206
|
+
collect(res[import_core3.ToolName.NamingConsistency], import_core3.IssueType.NamingInconsistency);
|
|
1207
|
+
collect(res[import_core3.ToolName.DocDrift], import_core3.IssueType.DocDrift);
|
|
1208
|
+
collect(res[import_core3.ToolName.DependencyHealth], import_core3.IssueType.DependencyHealth);
|
|
1209
|
+
collect(res[import_core3.ToolName.AiSignalClarity], import_core3.IssueType.AiSignalClarity);
|
|
1210
|
+
collect(res[import_core3.ToolName.AgentGrounding], import_core3.IssueType.AgentNavigationFailure);
|
|
1211
|
+
collect(res[import_core3.ToolName.TestabilityIndex], import_core3.IssueType.LowTestability);
|
|
1212
|
+
collect(res[import_core3.ToolName.ChangeAmplification], import_core3.IssueType.ChangeAmplification);
|
|
1195
1213
|
return {
|
|
1196
1214
|
...res,
|
|
1197
1215
|
results: allResults,
|
|
@@ -1281,8 +1299,8 @@ async function scanAction(directory, options) {
|
|
|
1281
1299
|
`::notice::AI Readiness Score: ${scoringResult.overall}/100 (threshold: ${threshold})`
|
|
1282
1300
|
);
|
|
1283
1301
|
}
|
|
1284
|
-
if (results.
|
|
1285
|
-
const criticalPatterns = results.
|
|
1302
|
+
if (results[import_core3.ToolName.PatternDetect]) {
|
|
1303
|
+
const criticalPatterns = results[import_core3.ToolName.PatternDetect].results.flatMap(
|
|
1286
1304
|
(p) => p.issues.filter((i) => i.severity === import_core3.Severity.Critical)
|
|
1287
1305
|
);
|
|
1288
1306
|
criticalPatterns.slice(0, 10).forEach((issue) => {
|
|
@@ -1303,22 +1321,22 @@ async function scanAction(directory, options) {
|
|
|
1303
1321
|
const minSeverity = severityLevels[failOnLevel] || 4;
|
|
1304
1322
|
let criticalCount = 0;
|
|
1305
1323
|
let majorCount = 0;
|
|
1306
|
-
if (results.
|
|
1307
|
-
results.
|
|
1324
|
+
if (results[import_core3.ToolName.PatternDetect]) {
|
|
1325
|
+
results[import_core3.ToolName.PatternDetect].results.forEach((p) => {
|
|
1308
1326
|
p.issues.forEach((i) => {
|
|
1309
1327
|
if (i.severity === import_core3.Severity.Critical) criticalCount++;
|
|
1310
1328
|
if (i.severity === import_core3.Severity.Major) majorCount++;
|
|
1311
1329
|
});
|
|
1312
1330
|
});
|
|
1313
1331
|
}
|
|
1314
|
-
if (results.
|
|
1315
|
-
results.
|
|
1332
|
+
if (results[import_core3.ToolName.ContextAnalyzer]) {
|
|
1333
|
+
results[import_core3.ToolName.ContextAnalyzer].results.forEach((c) => {
|
|
1316
1334
|
if (c.severity === import_core3.Severity.Critical) criticalCount++;
|
|
1317
1335
|
if (c.severity === import_core3.Severity.Major) majorCount++;
|
|
1318
1336
|
});
|
|
1319
1337
|
}
|
|
1320
|
-
if (results.
|
|
1321
|
-
results.
|
|
1338
|
+
if (results[import_core3.ToolName.NamingConsistency]) {
|
|
1339
|
+
results[import_core3.ToolName.NamingConsistency].results.forEach((r) => {
|
|
1322
1340
|
r.issues?.forEach((i) => {
|
|
1323
1341
|
if (i.severity === import_core3.Severity.Critical) criticalCount++;
|
|
1324
1342
|
if (i.severity === import_core3.Severity.Major) majorCount++;
|
package/dist/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__require,
|
|
4
4
|
analyzeUnified,
|
|
5
5
|
scoreUnified
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VQCWYJYJ.mjs";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { Command } from "commander";
|
|
@@ -30,7 +30,8 @@ import {
|
|
|
30
30
|
getRatingDisplay,
|
|
31
31
|
getRepoMetadata,
|
|
32
32
|
Severity,
|
|
33
|
-
IssueType
|
|
33
|
+
IssueType,
|
|
34
|
+
ToolName
|
|
34
35
|
} from "@aiready/core";
|
|
35
36
|
|
|
36
37
|
// src/utils/helpers.ts
|
|
@@ -621,25 +622,25 @@ async function scanAction(directory, options) {
|
|
|
621
622
|
console.log(
|
|
622
623
|
` Total issues (all tools): ${chalk3.bold(String(results.summary.totalIssues || 0))}`
|
|
623
624
|
);
|
|
624
|
-
if (results.
|
|
625
|
+
if (results[ToolName.PatternDetect]) {
|
|
625
626
|
console.log(
|
|
626
|
-
` Duplicate patterns found: ${chalk3.bold(String(results.
|
|
627
|
+
` Duplicate patterns found: ${chalk3.bold(String(results[ToolName.PatternDetect].duplicates?.length || 0))}`
|
|
627
628
|
);
|
|
628
629
|
console.log(
|
|
629
|
-
` Pattern files with issues: ${chalk3.bold(String(results.
|
|
630
|
+
` Pattern files with issues: ${chalk3.bold(String(results[ToolName.PatternDetect].results.length || 0))}`
|
|
630
631
|
);
|
|
631
632
|
}
|
|
632
|
-
if (results.
|
|
633
|
+
if (results[ToolName.ContextAnalyzer])
|
|
633
634
|
console.log(
|
|
634
|
-
` Context issues: ${chalk3.bold(String(results.
|
|
635
|
+
` Context issues: ${chalk3.bold(String(results[ToolName.ContextAnalyzer].results.length || 0))}`
|
|
635
636
|
);
|
|
636
|
-
if (results.
|
|
637
|
+
if (results[ToolName.NamingConsistency])
|
|
637
638
|
console.log(
|
|
638
|
-
` Consistency issues: ${chalk3.bold(String(results.
|
|
639
|
+
` Consistency issues: ${chalk3.bold(String(results[ToolName.NamingConsistency].summary?.totalIssues || 0))}`
|
|
639
640
|
);
|
|
640
|
-
if (results.
|
|
641
|
+
if (results[ToolName.ChangeAmplification])
|
|
641
642
|
console.log(
|
|
642
|
-
` Change amplification: ${chalk3.bold(String(results.
|
|
643
|
+
` Change amplification: ${chalk3.bold(String(results[ToolName.ChangeAmplification].summary?.score || 0))}/100`
|
|
643
644
|
);
|
|
644
645
|
console.log(chalk3.cyan("===========================\n"));
|
|
645
646
|
const elapsedTime = getElapsedTime(startTime);
|
|
@@ -830,15 +831,15 @@ async function scanAction(directory, options) {
|
|
|
830
831
|
allResults.push(normalizedResult);
|
|
831
832
|
});
|
|
832
833
|
};
|
|
833
|
-
collect(res.
|
|
834
|
-
collect(res.
|
|
835
|
-
collect(res.
|
|
836
|
-
collect(res.
|
|
837
|
-
collect(res.
|
|
838
|
-
collect(res.
|
|
839
|
-
collect(res.
|
|
840
|
-
collect(res.
|
|
841
|
-
collect(res.
|
|
834
|
+
collect(res[ToolName.PatternDetect], IssueType.DuplicatePattern);
|
|
835
|
+
collect(res[ToolName.ContextAnalyzer], IssueType.ContextFragmentation);
|
|
836
|
+
collect(res[ToolName.NamingConsistency], IssueType.NamingInconsistency);
|
|
837
|
+
collect(res[ToolName.DocDrift], IssueType.DocDrift);
|
|
838
|
+
collect(res[ToolName.DependencyHealth], IssueType.DependencyHealth);
|
|
839
|
+
collect(res[ToolName.AiSignalClarity], IssueType.AiSignalClarity);
|
|
840
|
+
collect(res[ToolName.AgentGrounding], IssueType.AgentNavigationFailure);
|
|
841
|
+
collect(res[ToolName.TestabilityIndex], IssueType.LowTestability);
|
|
842
|
+
collect(res[ToolName.ChangeAmplification], IssueType.ChangeAmplification);
|
|
842
843
|
return {
|
|
843
844
|
...res,
|
|
844
845
|
results: allResults,
|
|
@@ -928,8 +929,8 @@ async function scanAction(directory, options) {
|
|
|
928
929
|
`::notice::AI Readiness Score: ${scoringResult.overall}/100 (threshold: ${threshold})`
|
|
929
930
|
);
|
|
930
931
|
}
|
|
931
|
-
if (results.
|
|
932
|
-
const criticalPatterns = results.
|
|
932
|
+
if (results[ToolName.PatternDetect]) {
|
|
933
|
+
const criticalPatterns = results[ToolName.PatternDetect].results.flatMap(
|
|
933
934
|
(p) => p.issues.filter((i) => i.severity === Severity.Critical)
|
|
934
935
|
);
|
|
935
936
|
criticalPatterns.slice(0, 10).forEach((issue) => {
|
|
@@ -950,22 +951,22 @@ async function scanAction(directory, options) {
|
|
|
950
951
|
const minSeverity = severityLevels[failOnLevel] || 4;
|
|
951
952
|
let criticalCount = 0;
|
|
952
953
|
let majorCount = 0;
|
|
953
|
-
if (results.
|
|
954
|
-
results.
|
|
954
|
+
if (results[ToolName.PatternDetect]) {
|
|
955
|
+
results[ToolName.PatternDetect].results.forEach((p) => {
|
|
955
956
|
p.issues.forEach((i) => {
|
|
956
957
|
if (i.severity === Severity.Critical) criticalCount++;
|
|
957
958
|
if (i.severity === Severity.Major) majorCount++;
|
|
958
959
|
});
|
|
959
960
|
});
|
|
960
961
|
}
|
|
961
|
-
if (results.
|
|
962
|
-
results.
|
|
962
|
+
if (results[ToolName.ContextAnalyzer]) {
|
|
963
|
+
results[ToolName.ContextAnalyzer].results.forEach((c) => {
|
|
963
964
|
if (c.severity === Severity.Critical) criticalCount++;
|
|
964
965
|
if (c.severity === Severity.Major) majorCount++;
|
|
965
966
|
});
|
|
966
967
|
}
|
|
967
|
-
if (results.
|
|
968
|
-
results.
|
|
968
|
+
if (results[ToolName.NamingConsistency]) {
|
|
969
|
+
results[ToolName.NamingConsistency].results.forEach((r) => {
|
|
969
970
|
r.issues?.forEach((i) => {
|
|
970
971
|
if (i.severity === Severity.Critical) criticalCount++;
|
|
971
972
|
if (i.severity === Severity.Major) majorCount++;
|