@aiready/cli 0.9.47 → 0.10.2
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 +6 -7
- package/dist/{chunk-6FOVC2OE.mjs → chunk-EQ2HQSTJ.mjs} +83 -61
- package/dist/{chunk-MEXEG3IJ.mjs → chunk-VUCNUYI7.mjs} +90 -62
- package/dist/cli.js +105 -75
- package/dist/cli.mjs +30 -25
- package/dist/index.js +86 -61
- package/dist/index.mjs +1 -1
- package/package.json +12 -12
- package/src/.aiready/aiready-report-20260305-153847.json +8015 -0
- package/src/.aiready/aiready-report-20260305-154121.json +8015 -0
- package/src/.aiready/aiready-report-20260305-160026.json +8015 -0
- package/src/.aiready/aiready-report-20260305-160752.json +8015 -0
- package/src/.aiready/aiready-report-20260305-163858.json +8015 -0
- package/src/.aiready/aiready-report-20260305-171001.json +8317 -0
- package/src/.aiready/aiready-report-20260305-201337.json +8317 -0
- package/src/__tests__/cli.test.ts +6 -6
- package/src/commands/scan.ts +27 -22
- package/src/commands/visualize.ts +3 -3
- package/src/index.ts +109 -90
- package/dist/__tests__/cli.test.d.ts +0 -2
- package/dist/__tests__/cli.test.d.ts.map +0 -1
- package/dist/__tests__/cli.test.js +0 -52
- package/dist/__tests__/cli.test.js.map +0 -1
- package/dist/agent-grounding-DAOSU4MF.mjs +0 -7
- package/dist/chunk-2LXCBVPN.mjs +0 -109
- package/dist/chunk-3SG2GLFJ.mjs +0 -118
- package/dist/chunk-5GZDRZ3T.mjs +0 -126
- package/dist/chunk-DEZVFBPS.mjs +0 -111
- package/dist/chunk-G6SDH7ZS.mjs +0 -126
- package/dist/chunk-HLBKROD3.mjs +0 -237
- package/dist/chunk-JQG7ZATX.mjs +0 -211
- package/dist/chunk-LLJMKNBI.mjs +0 -243
- package/dist/chunk-M7O2MEM5.mjs +0 -211
- package/dist/chunk-N4SLON5K.mjs +0 -152
- package/dist/chunk-OVELUOM6.mjs +0 -112
- package/dist/chunk-P3XAXCTK.mjs +0 -110
- package/dist/chunk-PDOONNSK.mjs +0 -228
- package/dist/chunk-QXQP6BMO.mjs +0 -109
- package/dist/chunk-RBWLQRKR.mjs +0 -39
- package/dist/chunk-XAF2EW5H.mjs +0 -46
- package/dist/chunk-Y6FXYEAI.mjs +0 -10
- package/dist/chunk-YIS6WTY5.mjs +0 -35
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/deps-health-UWVYJ7FZ.mjs +0 -47
- package/dist/doc-drift-G7MGAZAE.mjs +0 -47
- package/dist/hallucination-risk-XU6E7IGN.mjs +0 -7
- package/dist/index.d.mts +0 -33
- package/dist/index.d.ts +0 -32
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/testability-VDZJZ4MF.mjs +0 -7
package/dist/cli.js
CHANGED
|
@@ -87,8 +87,11 @@ async function analyzeUnified(options) {
|
|
|
87
87
|
if (options.progressCallback) {
|
|
88
88
|
options.progressCallback({ tool: "patterns", data: patternResult });
|
|
89
89
|
}
|
|
90
|
-
result.
|
|
91
|
-
|
|
90
|
+
result.patternDetect = {
|
|
91
|
+
results: sortBySeverity(patternResult.results),
|
|
92
|
+
summary: patternResult.summary || {},
|
|
93
|
+
duplicates: patternResult.duplicates || []
|
|
94
|
+
};
|
|
92
95
|
result.summary.totalIssues += patternResult.results.reduce(
|
|
93
96
|
(sum, file) => sum + file.issues.length,
|
|
94
97
|
0
|
|
@@ -99,13 +102,18 @@ async function analyzeUnified(options) {
|
|
|
99
102
|
if (options.progressCallback) {
|
|
100
103
|
options.progressCallback({ tool: "context", data: contextResults });
|
|
101
104
|
}
|
|
102
|
-
|
|
105
|
+
const sorted = contextResults.sort((a, b) => {
|
|
103
106
|
const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
|
|
104
107
|
if (severityDiff !== 0) return severityDiff;
|
|
105
108
|
if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
|
|
106
109
|
return b.fragmentationScore - a.fragmentationScore;
|
|
107
110
|
});
|
|
108
|
-
|
|
111
|
+
const { generateSummary: genContextSummary } = await import("@aiready/context-analyzer");
|
|
112
|
+
result.contextAnalyzer = {
|
|
113
|
+
results: sorted,
|
|
114
|
+
summary: genContextSummary(sorted)
|
|
115
|
+
};
|
|
116
|
+
result.summary.totalIssues += sorted.length;
|
|
109
117
|
}
|
|
110
118
|
if (tools.includes("consistency")) {
|
|
111
119
|
const consistencyOptions = {
|
|
@@ -118,10 +126,10 @@ async function analyzeUnified(options) {
|
|
|
118
126
|
if (options.progressCallback) {
|
|
119
127
|
options.progressCallback({ tool: "consistency", data: report });
|
|
120
128
|
}
|
|
121
|
-
|
|
122
|
-
report.results
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
result.consistency = {
|
|
130
|
+
results: report.results ? sortBySeverity(report.results) : [],
|
|
131
|
+
summary: report.summary
|
|
132
|
+
};
|
|
125
133
|
result.summary.totalIssues += report.summary.totalIssues;
|
|
126
134
|
}
|
|
127
135
|
if (tools.includes("doc-drift")) {
|
|
@@ -135,7 +143,10 @@ async function analyzeUnified(options) {
|
|
|
135
143
|
if (options.progressCallback) {
|
|
136
144
|
options.progressCallback({ tool: "doc-drift", data: report });
|
|
137
145
|
}
|
|
138
|
-
result.docDrift =
|
|
146
|
+
result.docDrift = {
|
|
147
|
+
results: report.results || [],
|
|
148
|
+
summary: report.summary || {}
|
|
149
|
+
};
|
|
139
150
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
140
151
|
}
|
|
141
152
|
if (tools.includes("deps-health")) {
|
|
@@ -149,10 +160,13 @@ async function analyzeUnified(options) {
|
|
|
149
160
|
if (options.progressCallback) {
|
|
150
161
|
options.progressCallback({ tool: "deps-health", data: report });
|
|
151
162
|
}
|
|
152
|
-
result.
|
|
163
|
+
result.dependencyHealth = {
|
|
164
|
+
results: report.results || [],
|
|
165
|
+
summary: report.summary || {}
|
|
166
|
+
};
|
|
153
167
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
154
168
|
}
|
|
155
|
-
if (tools.includes("
|
|
169
|
+
if (tools.includes("ai-signal-clarity")) {
|
|
156
170
|
const { analyzeAiSignalClarity } = await import("@aiready/ai-signal-clarity");
|
|
157
171
|
const report = await analyzeAiSignalClarity({
|
|
158
172
|
rootDir: options.rootDir,
|
|
@@ -161,15 +175,19 @@ async function analyzeUnified(options) {
|
|
|
161
175
|
onProgress: options.onProgress
|
|
162
176
|
});
|
|
163
177
|
if (options.progressCallback) {
|
|
164
|
-
options.progressCallback({ tool: "
|
|
178
|
+
options.progressCallback({ tool: "ai-signal-clarity", data: report });
|
|
165
179
|
}
|
|
166
|
-
result.aiSignalClarity =
|
|
180
|
+
result.aiSignalClarity = {
|
|
181
|
+
...report,
|
|
182
|
+
results: report.results || [],
|
|
183
|
+
summary: report.summary || {}
|
|
184
|
+
};
|
|
167
185
|
result.summary.totalIssues += report.results?.reduce(
|
|
168
186
|
(sum, r) => sum + (r.issues?.length || 0),
|
|
169
187
|
0
|
|
170
188
|
) || 0;
|
|
171
189
|
}
|
|
172
|
-
if (tools.includes("grounding")) {
|
|
190
|
+
if (tools.includes("agent-grounding")) {
|
|
173
191
|
const { analyzeAgentGrounding } = await import("@aiready/agent-grounding");
|
|
174
192
|
const report = await analyzeAgentGrounding({
|
|
175
193
|
rootDir: options.rootDir,
|
|
@@ -178,9 +196,13 @@ async function analyzeUnified(options) {
|
|
|
178
196
|
onProgress: options.onProgress
|
|
179
197
|
});
|
|
180
198
|
if (options.progressCallback) {
|
|
181
|
-
options.progressCallback({ tool: "grounding", data: report });
|
|
199
|
+
options.progressCallback({ tool: "agent-grounding", data: report });
|
|
182
200
|
}
|
|
183
|
-
result.
|
|
201
|
+
result.agentGrounding = {
|
|
202
|
+
...report,
|
|
203
|
+
results: report.results || [],
|
|
204
|
+
summary: report.summary || {}
|
|
205
|
+
};
|
|
184
206
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
185
207
|
}
|
|
186
208
|
if (tools.includes("testability")) {
|
|
@@ -194,10 +216,14 @@ async function analyzeUnified(options) {
|
|
|
194
216
|
if (options.progressCallback) {
|
|
195
217
|
options.progressCallback({ tool: "testability", data: report });
|
|
196
218
|
}
|
|
197
|
-
result.testability =
|
|
219
|
+
result.testability = {
|
|
220
|
+
...report,
|
|
221
|
+
results: report.results || [],
|
|
222
|
+
summary: report.summary || {}
|
|
223
|
+
};
|
|
198
224
|
result.summary.totalIssues += report.issues?.length || 0;
|
|
199
225
|
}
|
|
200
|
-
if (tools.includes("
|
|
226
|
+
if (tools.includes("change-amplification")) {
|
|
201
227
|
const { analyzeChangeAmplification } = await import("@aiready/change-amplification");
|
|
202
228
|
const report = await analyzeChangeAmplification({
|
|
203
229
|
rootDir: options.rootDir,
|
|
@@ -206,9 +232,12 @@ async function analyzeUnified(options) {
|
|
|
206
232
|
onProgress: options.onProgress
|
|
207
233
|
});
|
|
208
234
|
if (options.progressCallback) {
|
|
209
|
-
options.progressCallback({ tool: "
|
|
235
|
+
options.progressCallback({ tool: "change-amplification", data: report });
|
|
210
236
|
}
|
|
211
|
-
result.changeAmplification =
|
|
237
|
+
result.changeAmplification = {
|
|
238
|
+
results: report.results || [],
|
|
239
|
+
summary: report.summary || {}
|
|
240
|
+
};
|
|
212
241
|
result.summary.totalIssues += report.summary?.totalIssues || 0;
|
|
213
242
|
}
|
|
214
243
|
result.summary.executionTime = Date.now() - startTime;
|
|
@@ -216,14 +245,14 @@ async function analyzeUnified(options) {
|
|
|
216
245
|
}
|
|
217
246
|
async function scoreUnified(results, options) {
|
|
218
247
|
const toolScores = /* @__PURE__ */ new Map();
|
|
219
|
-
if (results.
|
|
248
|
+
if (results.patternDetect) {
|
|
220
249
|
const { calculatePatternScore } = await import("@aiready/pattern-detect");
|
|
221
250
|
try {
|
|
222
251
|
const patternScore = calculatePatternScore(
|
|
223
|
-
results.duplicates,
|
|
224
|
-
results.
|
|
252
|
+
results.patternDetect.duplicates,
|
|
253
|
+
results.patternDetect.results?.length || 0
|
|
225
254
|
);
|
|
226
|
-
const wastedTokens = results.duplicates.reduce(
|
|
255
|
+
const wastedTokens = results.patternDetect.duplicates.reduce(
|
|
227
256
|
(sum, d) => sum + (d.tokenCost || 0),
|
|
228
257
|
0
|
|
229
258
|
);
|
|
@@ -241,10 +270,10 @@ async function scoreUnified(results, options) {
|
|
|
241
270
|
void err;
|
|
242
271
|
}
|
|
243
272
|
}
|
|
244
|
-
if (results.
|
|
245
|
-
const {
|
|
273
|
+
if (results.contextAnalyzer) {
|
|
274
|
+
const { calculateContextScore } = await import("@aiready/context-analyzer");
|
|
246
275
|
try {
|
|
247
|
-
const ctxSummary =
|
|
276
|
+
const ctxSummary = results.contextAnalyzer.summary;
|
|
248
277
|
const contextScore = calculateContextScore(ctxSummary);
|
|
249
278
|
contextScore.tokenBudget = (0, import_core.calculateTokenBudget)({
|
|
250
279
|
totalContextTokens: ctxSummary.totalTokens,
|
|
@@ -279,10 +308,10 @@ async function scoreUnified(results, options) {
|
|
|
279
308
|
void err;
|
|
280
309
|
}
|
|
281
310
|
}
|
|
282
|
-
if (results.
|
|
311
|
+
if (results.agentGrounding) {
|
|
283
312
|
const { calculateGroundingScore } = await import("@aiready/agent-grounding");
|
|
284
313
|
try {
|
|
285
|
-
const agScore = calculateGroundingScore(results.
|
|
314
|
+
const agScore = calculateGroundingScore(results.agentGrounding);
|
|
286
315
|
toolScores.set("agent-grounding", agScore);
|
|
287
316
|
} catch (err) {
|
|
288
317
|
void err;
|
|
@@ -300,10 +329,10 @@ async function scoreUnified(results, options) {
|
|
|
300
329
|
if (results.docDrift) {
|
|
301
330
|
toolScores.set("doc-drift", {
|
|
302
331
|
toolName: "doc-drift",
|
|
303
|
-
score: results.docDrift.summary.score,
|
|
304
|
-
rawMetrics: results.docDrift.
|
|
332
|
+
score: results.docDrift.summary.score || results.docDrift.summary.totalScore || 0,
|
|
333
|
+
rawMetrics: results.docDrift.summary,
|
|
305
334
|
factors: [],
|
|
306
|
-
recommendations: (results.docDrift.recommendations || []).map(
|
|
335
|
+
recommendations: (results.docDrift.summary.recommendations || []).map(
|
|
307
336
|
(action) => ({
|
|
308
337
|
action,
|
|
309
338
|
estimatedImpact: 5,
|
|
@@ -312,34 +341,30 @@ async function scoreUnified(results, options) {
|
|
|
312
341
|
)
|
|
313
342
|
});
|
|
314
343
|
}
|
|
315
|
-
if (results.
|
|
344
|
+
if (results.dependencyHealth) {
|
|
316
345
|
toolScores.set("dependency-health", {
|
|
317
346
|
toolName: "dependency-health",
|
|
318
|
-
score: results.
|
|
319
|
-
rawMetrics: results.
|
|
347
|
+
score: results.dependencyHealth.summary.score || 0,
|
|
348
|
+
rawMetrics: results.dependencyHealth.summary,
|
|
320
349
|
factors: [],
|
|
321
|
-
recommendations: (results.
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
})
|
|
327
|
-
)
|
|
350
|
+
recommendations: (results.dependencyHealth.summary.recommendations || []).map((action) => ({
|
|
351
|
+
action,
|
|
352
|
+
estimatedImpact: 5,
|
|
353
|
+
priority: "medium"
|
|
354
|
+
}))
|
|
328
355
|
});
|
|
329
356
|
}
|
|
330
357
|
if (results.changeAmplification) {
|
|
331
358
|
toolScores.set("change-amplification", {
|
|
332
359
|
toolName: "change-amplification",
|
|
333
|
-
score: results.changeAmplification.summary.score,
|
|
334
|
-
rawMetrics: results.changeAmplification.
|
|
360
|
+
score: results.changeAmplification.summary.score || 0,
|
|
361
|
+
rawMetrics: results.changeAmplification.summary,
|
|
335
362
|
factors: [],
|
|
336
|
-
recommendations: (results.changeAmplification.recommendations || []).map(
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
})
|
|
342
|
-
)
|
|
363
|
+
recommendations: (results.changeAmplification.summary.recommendations || []).map((action) => ({
|
|
364
|
+
action,
|
|
365
|
+
estimatedImpact: 5,
|
|
366
|
+
priority: "medium"
|
|
367
|
+
}))
|
|
343
368
|
});
|
|
344
369
|
}
|
|
345
370
|
if (toolScores.size === 0) {
|
|
@@ -596,12 +621,12 @@ async function scanAction(directory, options) {
|
|
|
596
621
|
"patterns",
|
|
597
622
|
"context",
|
|
598
623
|
"consistency",
|
|
599
|
-
"
|
|
600
|
-
"grounding",
|
|
624
|
+
"ai-signal-clarity",
|
|
625
|
+
"agent-grounding",
|
|
601
626
|
"testability",
|
|
602
627
|
"doc-drift",
|
|
603
628
|
"deps-health",
|
|
604
|
-
"
|
|
629
|
+
"change-amplification"
|
|
605
630
|
],
|
|
606
631
|
include: void 0,
|
|
607
632
|
exclude: void 0,
|
|
@@ -619,7 +644,11 @@ async function scanAction(directory, options) {
|
|
|
619
644
|
if (options.profile) {
|
|
620
645
|
switch (options.profile.toLowerCase()) {
|
|
621
646
|
case "agentic":
|
|
622
|
-
profileTools = [
|
|
647
|
+
profileTools = [
|
|
648
|
+
"ai-signal-clarity",
|
|
649
|
+
"agent-grounding",
|
|
650
|
+
"testability"
|
|
651
|
+
];
|
|
623
652
|
break;
|
|
624
653
|
case "cost":
|
|
625
654
|
profileTools = ["patterns", "context"];
|
|
@@ -628,7 +657,7 @@ async function scanAction(directory, options) {
|
|
|
628
657
|
profileTools = ["consistency", "testability"];
|
|
629
658
|
break;
|
|
630
659
|
case "onboarding":
|
|
631
|
-
profileTools = ["context", "consistency", "grounding"];
|
|
660
|
+
profileTools = ["context", "consistency", "agent-grounding"];
|
|
632
661
|
break;
|
|
633
662
|
default:
|
|
634
663
|
console.log(
|
|
@@ -941,21 +970,22 @@ async function scanAction(directory, options) {
|
|
|
941
970
|
console.log(
|
|
942
971
|
` Total issues (all tools): ${import_chalk3.default.bold(String(results.summary.totalIssues || 0))}`
|
|
943
972
|
);
|
|
944
|
-
if (results.
|
|
973
|
+
if (results.patternDetect) {
|
|
945
974
|
console.log(
|
|
946
|
-
` Duplicate patterns found: ${import_chalk3.default.bold(String(results.duplicates
|
|
975
|
+
` Duplicate patterns found: ${import_chalk3.default.bold(String(results.patternDetect.duplicates?.length || 0))}`
|
|
947
976
|
);
|
|
948
|
-
if (results.patterns)
|
|
949
977
|
console.log(
|
|
950
|
-
` Pattern files with issues: ${import_chalk3.default.bold(String(results.
|
|
978
|
+
` Pattern files with issues: ${import_chalk3.default.bold(String(results.patternDetect.results.length || 0))}`
|
|
951
979
|
);
|
|
952
|
-
|
|
980
|
+
}
|
|
981
|
+
if (results.contextAnalyzer)
|
|
953
982
|
console.log(
|
|
954
|
-
` Context issues: ${import_chalk3.default.bold(String(results.
|
|
983
|
+
` Context issues: ${import_chalk3.default.bold(String(results.contextAnalyzer.results.length || 0))}`
|
|
984
|
+
);
|
|
985
|
+
if (results.consistency)
|
|
986
|
+
console.log(
|
|
987
|
+
` Consistency issues: ${import_chalk3.default.bold(String(results.consistency.summary?.totalIssues || 0))}`
|
|
955
988
|
);
|
|
956
|
-
console.log(
|
|
957
|
-
` Consistency issues: ${import_chalk3.default.bold(String(results.consistency?.summary?.totalIssues || 0))}`
|
|
958
|
-
);
|
|
959
989
|
if (results.changeAmplification)
|
|
960
990
|
console.log(
|
|
961
991
|
` Change amplification: ${import_chalk3.default.bold(String(results.changeAmplification.summary?.score || 0))}/100`
|
|
@@ -1177,8 +1207,8 @@ async function scanAction(directory, options) {
|
|
|
1177
1207
|
`::notice::AI Readiness Score: ${scoringResult.overall}/100 (threshold: ${threshold})`
|
|
1178
1208
|
);
|
|
1179
1209
|
}
|
|
1180
|
-
if (results.
|
|
1181
|
-
const criticalPatterns = results.
|
|
1210
|
+
if (results.patternDetect) {
|
|
1211
|
+
const criticalPatterns = results.patternDetect.results.flatMap(
|
|
1182
1212
|
(p) => p.issues.filter((i) => i.severity === "critical")
|
|
1183
1213
|
);
|
|
1184
1214
|
criticalPatterns.slice(0, 10).forEach((issue) => {
|
|
@@ -1199,21 +1229,21 @@ async function scanAction(directory, options) {
|
|
|
1199
1229
|
const minSeverity = severityLevels[failOnLevel] || 4;
|
|
1200
1230
|
let criticalCount = 0;
|
|
1201
1231
|
let majorCount = 0;
|
|
1202
|
-
if (results.
|
|
1203
|
-
results.
|
|
1232
|
+
if (results.patternDetect) {
|
|
1233
|
+
results.patternDetect.results.forEach((p) => {
|
|
1204
1234
|
p.issues.forEach((i) => {
|
|
1205
1235
|
if (i.severity === "critical") criticalCount++;
|
|
1206
1236
|
if (i.severity === "major") majorCount++;
|
|
1207
1237
|
});
|
|
1208
1238
|
});
|
|
1209
1239
|
}
|
|
1210
|
-
if (results.
|
|
1211
|
-
results.
|
|
1240
|
+
if (results.contextAnalyzer) {
|
|
1241
|
+
results.contextAnalyzer.results.forEach((c) => {
|
|
1212
1242
|
if (c.severity === "critical") criticalCount++;
|
|
1213
1243
|
if (c.severity === "major") majorCount++;
|
|
1214
1244
|
});
|
|
1215
1245
|
}
|
|
1216
|
-
if (results.consistency
|
|
1246
|
+
if (results.consistency) {
|
|
1217
1247
|
results.consistency.results.forEach((r) => {
|
|
1218
1248
|
r.issues?.forEach((i) => {
|
|
1219
1249
|
if (i.severity === "critical") criticalCount++;
|
|
@@ -1865,11 +1895,11 @@ Or specify a custom report:
|
|
|
1865
1895
|
let devServerStarted = false;
|
|
1866
1896
|
if (useDevMode) {
|
|
1867
1897
|
try {
|
|
1868
|
-
const
|
|
1898
|
+
const localWebDir = (0, import_path7.resolve)(dirPath, "packages/visualizer");
|
|
1869
1899
|
let webDir = "";
|
|
1870
1900
|
let visualizerAvailable = false;
|
|
1871
|
-
if ((0, import_fs5.existsSync)(
|
|
1872
|
-
webDir =
|
|
1901
|
+
if ((0, import_fs5.existsSync)(localWebDir)) {
|
|
1902
|
+
webDir = localWebDir;
|
|
1873
1903
|
visualizerAvailable = true;
|
|
1874
1904
|
} else {
|
|
1875
1905
|
const nodemodulesLocations = [
|
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-VUCNUYI7.mjs";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { Command } from "commander";
|
|
@@ -268,12 +268,12 @@ async function scanAction(directory, options) {
|
|
|
268
268
|
"patterns",
|
|
269
269
|
"context",
|
|
270
270
|
"consistency",
|
|
271
|
-
"
|
|
272
|
-
"grounding",
|
|
271
|
+
"ai-signal-clarity",
|
|
272
|
+
"agent-grounding",
|
|
273
273
|
"testability",
|
|
274
274
|
"doc-drift",
|
|
275
275
|
"deps-health",
|
|
276
|
-
"
|
|
276
|
+
"change-amplification"
|
|
277
277
|
],
|
|
278
278
|
include: void 0,
|
|
279
279
|
exclude: void 0,
|
|
@@ -291,7 +291,11 @@ async function scanAction(directory, options) {
|
|
|
291
291
|
if (options.profile) {
|
|
292
292
|
switch (options.profile.toLowerCase()) {
|
|
293
293
|
case "agentic":
|
|
294
|
-
profileTools = [
|
|
294
|
+
profileTools = [
|
|
295
|
+
"ai-signal-clarity",
|
|
296
|
+
"agent-grounding",
|
|
297
|
+
"testability"
|
|
298
|
+
];
|
|
295
299
|
break;
|
|
296
300
|
case "cost":
|
|
297
301
|
profileTools = ["patterns", "context"];
|
|
@@ -300,7 +304,7 @@ async function scanAction(directory, options) {
|
|
|
300
304
|
profileTools = ["consistency", "testability"];
|
|
301
305
|
break;
|
|
302
306
|
case "onboarding":
|
|
303
|
-
profileTools = ["context", "consistency", "grounding"];
|
|
307
|
+
profileTools = ["context", "consistency", "agent-grounding"];
|
|
304
308
|
break;
|
|
305
309
|
default:
|
|
306
310
|
console.log(
|
|
@@ -613,21 +617,22 @@ async function scanAction(directory, options) {
|
|
|
613
617
|
console.log(
|
|
614
618
|
` Total issues (all tools): ${chalk3.bold(String(results.summary.totalIssues || 0))}`
|
|
615
619
|
);
|
|
616
|
-
if (results.
|
|
620
|
+
if (results.patternDetect) {
|
|
617
621
|
console.log(
|
|
618
|
-
` Duplicate patterns found: ${chalk3.bold(String(results.duplicates
|
|
622
|
+
` Duplicate patterns found: ${chalk3.bold(String(results.patternDetect.duplicates?.length || 0))}`
|
|
619
623
|
);
|
|
620
|
-
if (results.patterns)
|
|
621
624
|
console.log(
|
|
622
|
-
` Pattern files with issues: ${chalk3.bold(String(results.
|
|
625
|
+
` Pattern files with issues: ${chalk3.bold(String(results.patternDetect.results.length || 0))}`
|
|
623
626
|
);
|
|
624
|
-
|
|
627
|
+
}
|
|
628
|
+
if (results.contextAnalyzer)
|
|
625
629
|
console.log(
|
|
626
|
-
` Context issues: ${chalk3.bold(String(results.
|
|
630
|
+
` Context issues: ${chalk3.bold(String(results.contextAnalyzer.results.length || 0))}`
|
|
631
|
+
);
|
|
632
|
+
if (results.consistency)
|
|
633
|
+
console.log(
|
|
634
|
+
` Consistency issues: ${chalk3.bold(String(results.consistency.summary?.totalIssues || 0))}`
|
|
627
635
|
);
|
|
628
|
-
console.log(
|
|
629
|
-
` Consistency issues: ${chalk3.bold(String(results.consistency?.summary?.totalIssues || 0))}`
|
|
630
|
-
);
|
|
631
636
|
if (results.changeAmplification)
|
|
632
637
|
console.log(
|
|
633
638
|
` Change amplification: ${chalk3.bold(String(results.changeAmplification.summary?.score || 0))}/100`
|
|
@@ -849,8 +854,8 @@ async function scanAction(directory, options) {
|
|
|
849
854
|
`::notice::AI Readiness Score: ${scoringResult.overall}/100 (threshold: ${threshold})`
|
|
850
855
|
);
|
|
851
856
|
}
|
|
852
|
-
if (results.
|
|
853
|
-
const criticalPatterns = results.
|
|
857
|
+
if (results.patternDetect) {
|
|
858
|
+
const criticalPatterns = results.patternDetect.results.flatMap(
|
|
854
859
|
(p) => p.issues.filter((i) => i.severity === "critical")
|
|
855
860
|
);
|
|
856
861
|
criticalPatterns.slice(0, 10).forEach((issue) => {
|
|
@@ -871,21 +876,21 @@ async function scanAction(directory, options) {
|
|
|
871
876
|
const minSeverity = severityLevels[failOnLevel] || 4;
|
|
872
877
|
let criticalCount = 0;
|
|
873
878
|
let majorCount = 0;
|
|
874
|
-
if (results.
|
|
875
|
-
results.
|
|
879
|
+
if (results.patternDetect) {
|
|
880
|
+
results.patternDetect.results.forEach((p) => {
|
|
876
881
|
p.issues.forEach((i) => {
|
|
877
882
|
if (i.severity === "critical") criticalCount++;
|
|
878
883
|
if (i.severity === "major") majorCount++;
|
|
879
884
|
});
|
|
880
885
|
});
|
|
881
886
|
}
|
|
882
|
-
if (results.
|
|
883
|
-
results.
|
|
887
|
+
if (results.contextAnalyzer) {
|
|
888
|
+
results.contextAnalyzer.results.forEach((c) => {
|
|
884
889
|
if (c.severity === "critical") criticalCount++;
|
|
885
890
|
if (c.severity === "major") majorCount++;
|
|
886
891
|
});
|
|
887
892
|
}
|
|
888
|
-
if (results.consistency
|
|
893
|
+
if (results.consistency) {
|
|
889
894
|
results.consistency.results.forEach((r) => {
|
|
890
895
|
r.issues?.forEach((i) => {
|
|
891
896
|
if (i.severity === "critical") criticalCount++;
|
|
@@ -1558,11 +1563,11 @@ Or specify a custom report:
|
|
|
1558
1563
|
let devServerStarted = false;
|
|
1559
1564
|
if (useDevMode) {
|
|
1560
1565
|
try {
|
|
1561
|
-
const
|
|
1566
|
+
const localWebDir = resolvePath7(dirPath, "packages/visualizer");
|
|
1562
1567
|
let webDir = "";
|
|
1563
1568
|
let visualizerAvailable = false;
|
|
1564
|
-
if (existsSync2(
|
|
1565
|
-
webDir =
|
|
1569
|
+
if (existsSync2(localWebDir)) {
|
|
1570
|
+
webDir = localWebDir;
|
|
1566
1571
|
visualizerAvailable = true;
|
|
1567
1572
|
} else {
|
|
1568
1573
|
const nodemodulesLocations = [
|