@aiready/cli 0.9.47 โ†’ 0.10.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.
Files changed (53) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/.turbo/turbo-test.log +5 -6
  3. package/dist/{chunk-6FOVC2OE.mjs โ†’ chunk-EQ2HQSTJ.mjs} +83 -61
  4. package/dist/cli.js +102 -75
  5. package/dist/cli.mjs +30 -25
  6. package/dist/index.js +83 -61
  7. package/dist/index.mjs +1 -1
  8. package/package.json +12 -12
  9. package/src/.aiready/aiready-report-20260305-153847.json +8015 -0
  10. package/src/.aiready/aiready-report-20260305-154121.json +8015 -0
  11. package/src/.aiready/aiready-report-20260305-160026.json +8015 -0
  12. package/src/.aiready/aiready-report-20260305-160752.json +8015 -0
  13. package/src/.aiready/aiready-report-20260305-163858.json +8015 -0
  14. package/src/__tests__/cli.test.ts +6 -6
  15. package/src/commands/scan.ts +27 -22
  16. package/src/commands/visualize.ts +3 -3
  17. package/src/index.ts +108 -92
  18. package/dist/__tests__/cli.test.d.ts +0 -2
  19. package/dist/__tests__/cli.test.d.ts.map +0 -1
  20. package/dist/__tests__/cli.test.js +0 -52
  21. package/dist/__tests__/cli.test.js.map +0 -1
  22. package/dist/agent-grounding-DAOSU4MF.mjs +0 -7
  23. package/dist/chunk-2LXCBVPN.mjs +0 -109
  24. package/dist/chunk-3SG2GLFJ.mjs +0 -118
  25. package/dist/chunk-5GZDRZ3T.mjs +0 -126
  26. package/dist/chunk-DEZVFBPS.mjs +0 -111
  27. package/dist/chunk-G6SDH7ZS.mjs +0 -126
  28. package/dist/chunk-HLBKROD3.mjs +0 -237
  29. package/dist/chunk-JQG7ZATX.mjs +0 -211
  30. package/dist/chunk-LLJMKNBI.mjs +0 -243
  31. package/dist/chunk-M7O2MEM5.mjs +0 -211
  32. package/dist/chunk-MEXEG3IJ.mjs +0 -389
  33. package/dist/chunk-N4SLON5K.mjs +0 -152
  34. package/dist/chunk-OVELUOM6.mjs +0 -112
  35. package/dist/chunk-P3XAXCTK.mjs +0 -110
  36. package/dist/chunk-PDOONNSK.mjs +0 -228
  37. package/dist/chunk-QXQP6BMO.mjs +0 -109
  38. package/dist/chunk-RBWLQRKR.mjs +0 -39
  39. package/dist/chunk-XAF2EW5H.mjs +0 -46
  40. package/dist/chunk-Y6FXYEAI.mjs +0 -10
  41. package/dist/chunk-YIS6WTY5.mjs +0 -35
  42. package/dist/cli.d.mts +0 -1
  43. package/dist/cli.d.ts +0 -3
  44. package/dist/cli.d.ts.map +0 -1
  45. package/dist/cli.js.map +0 -1
  46. package/dist/deps-health-UWVYJ7FZ.mjs +0 -47
  47. package/dist/doc-drift-G7MGAZAE.mjs +0 -47
  48. package/dist/hallucination-risk-XU6E7IGN.mjs +0 -7
  49. package/dist/index.d.mts +0 -33
  50. package/dist/index.d.ts +0 -32
  51. package/dist/index.d.ts.map +0 -1
  52. package/dist/index.js.map +0 -1
  53. package/dist/testability-VDZJZ4MF.mjs +0 -7
@@ -30,8 +30,8 @@ describe('CLI Unified Analysis', () => {
30
30
  tools: ['patterns', 'context'],
31
31
  });
32
32
 
33
- expect(results).toHaveProperty('patterns');
34
- expect(results).toHaveProperty('context');
33
+ expect(results).toHaveProperty('patternDetect');
34
+ expect(results).toHaveProperty('contextAnalyzer');
35
35
  expect(results).toHaveProperty('summary');
36
36
  });
37
37
 
@@ -41,8 +41,8 @@ describe('CLI Unified Analysis', () => {
41
41
  tools: ['patterns'],
42
42
  });
43
43
 
44
- expect(results).toHaveProperty('patterns');
45
- expect(results).not.toHaveProperty('context');
44
+ expect(results).toHaveProperty('patternDetect');
45
+ expect(results).not.toHaveProperty('contextAnalyzer');
46
46
  expect(results).toHaveProperty('summary');
47
47
  });
48
48
 
@@ -52,8 +52,8 @@ describe('CLI Unified Analysis', () => {
52
52
  tools: ['context'],
53
53
  });
54
54
 
55
- expect(results).not.toHaveProperty('patterns');
56
- expect(results).toHaveProperty('context');
55
+ expect(results).not.toHaveProperty('patternDetect');
56
+ expect(results).toHaveProperty('contextAnalyzer');
57
57
  expect(results).toHaveProperty('summary');
58
58
  });
59
59
  });
@@ -69,12 +69,12 @@ export async function scanAction(directory: string, options: ScanOptions) {
69
69
  'patterns',
70
70
  'context',
71
71
  'consistency',
72
- 'aiSignalClarity',
73
- 'grounding',
72
+ 'ai-signal-clarity',
73
+ 'agent-grounding',
74
74
  'testability',
75
75
  'doc-drift',
76
76
  'deps-health',
77
- 'changeAmplification',
77
+ 'change-amplification',
78
78
  ],
79
79
  include: undefined,
80
80
  exclude: undefined,
@@ -95,7 +95,11 @@ export async function scanAction(directory: string, options: ScanOptions) {
95
95
  if (options.profile) {
96
96
  switch (options.profile.toLowerCase()) {
97
97
  case 'agentic':
98
- profileTools = ['aiSignalClarity', 'grounding', 'testability'];
98
+ profileTools = [
99
+ 'ai-signal-clarity',
100
+ 'agent-grounding',
101
+ 'testability',
102
+ ];
99
103
  break;
100
104
  case 'cost':
101
105
  profileTools = ['patterns', 'context'];
@@ -104,7 +108,7 @@ export async function scanAction(directory: string, options: ScanOptions) {
104
108
  profileTools = ['consistency', 'testability'];
105
109
  break;
106
110
  case 'onboarding':
107
- profileTools = ['context', 'consistency', 'grounding'];
111
+ profileTools = ['context', 'consistency', 'agent-grounding'];
108
112
  break;
109
113
  default:
110
114
  console.log(
@@ -463,21 +467,22 @@ export async function scanAction(directory: string, options: ScanOptions) {
463
467
  console.log(
464
468
  ` Total issues (all tools): ${chalk.bold(String(results.summary.totalIssues || 0))}`
465
469
  );
466
- if (results.duplicates)
470
+ if (results.patternDetect) {
467
471
  console.log(
468
- ` Duplicate patterns found: ${chalk.bold(String(results.duplicates.length || 0))}`
472
+ ` Duplicate patterns found: ${chalk.bold(String(results.patternDetect.duplicates?.length || 0))}`
469
473
  );
470
- if (results.patterns)
471
474
  console.log(
472
- ` Pattern files with issues: ${chalk.bold(String(results.patterns.length || 0))}`
475
+ ` Pattern files with issues: ${chalk.bold(String(results.patternDetect.results.length || 0))}`
473
476
  );
474
- if (results.context)
477
+ }
478
+ if (results.contextAnalyzer)
475
479
  console.log(
476
- ` Context issues: ${chalk.bold(String(results.context.length || 0))}`
480
+ ` Context issues: ${chalk.bold(String(results.contextAnalyzer.results.length || 0))}`
481
+ );
482
+ if (results.consistency)
483
+ console.log(
484
+ ` Consistency issues: ${chalk.bold(String(results.consistency.summary?.totalIssues || 0))}`
477
485
  );
478
- console.log(
479
- ` Consistency issues: ${chalk.bold(String(results.consistency?.summary?.totalIssues || 0))}`
480
- );
481
486
  if (results.changeAmplification)
482
487
  console.log(
483
488
  ` Change amplification: ${chalk.bold(String(results.changeAmplification.summary?.score || 0))}/100`
@@ -750,9 +755,9 @@ export async function scanAction(directory: string, options: ScanOptions) {
750
755
  }
751
756
 
752
757
  // Output annotations for critical issues
753
- if (results.patterns) {
754
- const criticalPatterns = results.patterns.flatMap((p: any) =>
755
- p.issues.filter((i: any) => i.severity === 'critical')
758
+ if (results.patternDetect) {
759
+ const criticalPatterns = results.patternDetect.results.flatMap(
760
+ (p: any) => p.issues.filter((i: any) => i.severity === 'critical')
756
761
  );
757
762
  criticalPatterns.slice(0, 10).forEach((issue: any) => {
758
763
  console.log(
@@ -781,21 +786,21 @@ export async function scanAction(directory: string, options: ScanOptions) {
781
786
  let criticalCount = 0;
782
787
  let majorCount = 0;
783
788
 
784
- if (results.patterns) {
785
- results.patterns.forEach((p: any) => {
789
+ if (results.patternDetect) {
790
+ results.patternDetect.results.forEach((p: any) => {
786
791
  p.issues.forEach((i: any) => {
787
792
  if (i.severity === 'critical') criticalCount++;
788
793
  if (i.severity === 'major') majorCount++;
789
794
  });
790
795
  });
791
796
  }
792
- if (results.context) {
793
- results.context.forEach((c: any) => {
797
+ if (results.contextAnalyzer) {
798
+ results.contextAnalyzer.results.forEach((c: any) => {
794
799
  if (c.severity === 'critical') criticalCount++;
795
800
  if (c.severity === 'major') majorCount++;
796
801
  });
797
802
  }
798
- if (results.consistency?.results) {
803
+ if (results.consistency) {
799
804
  results.consistency.results.forEach((r: any) => {
800
805
  r.issues?.forEach((i: any) => {
801
806
  if (i.severity === 'critical') criticalCount++;
@@ -85,12 +85,12 @@ export async function visualizeAction(
85
85
 
86
86
  if (useDevMode) {
87
87
  try {
88
- const monorepoWebDir = resolvePath(dirPath, 'packages/visualizer');
88
+ const localWebDir = resolvePath(dirPath, 'packages/visualizer');
89
89
  let webDir = '';
90
90
  let visualizerAvailable = false;
91
91
 
92
- if (existsSync(monorepoWebDir)) {
93
- webDir = monorepoWebDir;
92
+ if (existsSync(localWebDir)) {
93
+ webDir = localWebDir;
94
94
  visualizerAvailable = true;
95
95
  } else {
96
96
  // Try to resolve installed @aiready/visualizer package from node_modules
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { analyzePatterns } from '@aiready/pattern-detect';
2
2
  import { analyzeContext } from '@aiready/context-analyzer';
3
3
  import { analyzeConsistency } from '@aiready/consistency';
4
- import type { AnalysisResult, ScanOptions } from '@aiready/core';
4
+ import type { AnalysisResult, ScanOptions, SpokeOutput } from '@aiready/core';
5
5
  import {
6
6
  calculateOverallScore,
7
7
  type ToolScoringOutput,
@@ -9,12 +9,6 @@ import {
9
9
  calculateTokenBudget,
10
10
  } from '@aiready/core';
11
11
  export type { ToolScoringOutput, ScoringResult };
12
- import type { ContextAnalysisResult } from '@aiready/context-analyzer';
13
- import type { DuplicatePattern } from '@aiready/pattern-detect';
14
- import type {
15
- ConsistencyReport,
16
- ConsistencyOptions,
17
- } from '@aiready/consistency';
18
12
 
19
13
  export interface UnifiedAnalysisOptions extends ScanOptions {
20
14
  tools?: (
@@ -23,31 +17,32 @@ export interface UnifiedAnalysisOptions extends ScanOptions {
23
17
  | 'consistency'
24
18
  | 'doc-drift'
25
19
  | 'deps-health'
26
- | 'aiSignalClarity'
27
- | 'grounding'
20
+ | 'ai-signal-clarity'
21
+ | 'agent-grounding'
28
22
  | 'testability'
29
- | 'changeAmplification'
23
+ | 'change-amplification'
30
24
  )[];
31
25
  minSimilarity?: number;
32
26
  minLines?: number;
33
27
  maxCandidatesPerBlock?: number;
34
28
  minSharedTokens?: number;
35
29
  useSmartDefaults?: boolean;
36
- consistency?: Partial<ConsistencyOptions>;
30
+ consistency?: any;
37
31
  progressCallback?: (event: { tool: string; data: any }) => void;
38
32
  }
39
33
 
40
34
  export interface UnifiedAnalysisResult {
41
- patterns?: AnalysisResult[];
42
- duplicates?: DuplicatePattern[]; // Store actual duplicates for scoring
43
- context?: ContextAnalysisResult[];
44
- consistency?: ConsistencyReport;
45
- docDrift?: any;
46
- deps?: any;
47
- aiSignalClarity?: any;
48
- grounding?: any;
49
- testability?: any;
50
- changeAmplification?: any;
35
+ // Standardized keys matching tool names
36
+ patternDetect?: SpokeOutput & { duplicates: any[] };
37
+ contextAnalyzer?: SpokeOutput;
38
+ consistency?: SpokeOutput;
39
+ docDrift?: SpokeOutput;
40
+ dependencyHealth?: SpokeOutput;
41
+ aiSignalClarity?: SpokeOutput;
42
+ agentGrounding?: SpokeOutput;
43
+ testability?: SpokeOutput;
44
+ changeAmplification?: SpokeOutput;
45
+
51
46
  summary: {
52
47
  totalIssues: number;
53
48
  toolsRun: string[];
@@ -116,15 +111,14 @@ export async function analyzeUnified(
116
111
  // Run pattern detection
117
112
  if (tools.includes('patterns')) {
118
113
  const patternResult = await analyzePatterns(options);
119
- // Emit progress for patterns
120
114
  if (options.progressCallback) {
121
115
  options.progressCallback({ tool: 'patterns', data: patternResult });
122
116
  }
123
- // Sort results by severity
124
- result.patterns = sortBySeverity(patternResult.results);
125
- // Store duplicates for scoring
126
- result.duplicates = patternResult.duplicates;
127
- // Count actual issues, not file count
117
+ result.patternDetect = {
118
+ results: sortBySeverity(patternResult.results),
119
+ summary: patternResult.summary || {},
120
+ duplicates: patternResult.duplicates || [],
121
+ };
128
122
  result.summary.totalIssues += patternResult.results.reduce(
129
123
  (sum, file) => sum + file.issues.length,
130
124
  0
@@ -137,22 +131,25 @@ export async function analyzeUnified(
137
131
  if (options.progressCallback) {
138
132
  options.progressCallback({ tool: 'context', data: contextResults });
139
133
  }
140
- // Sort context results by severity (most severe first)
141
- result.context = contextResults.sort((a, b) => {
134
+ const sorted = contextResults.sort((a, b) => {
142
135
  const severityDiff =
143
136
  (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
144
137
  if (severityDiff !== 0) return severityDiff;
145
- // If same severity, sort by token cost (higher cost first)
146
138
  if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
147
- // Finally, sort by fragmentation score (higher fragmentation first)
148
139
  return b.fragmentationScore - a.fragmentationScore;
149
140
  });
150
- result.summary.totalIssues += result.context?.length || 0;
141
+
142
+ const { generateSummary: genContextSummary } =
143
+ await import('@aiready/context-analyzer');
144
+ result.contextAnalyzer = {
145
+ results: sorted,
146
+ summary: genContextSummary(sorted),
147
+ };
148
+ result.summary.totalIssues += sorted.length;
151
149
  }
152
150
 
153
151
  // Run consistency analysis
154
152
  if (tools.includes('consistency')) {
155
- // Use config fields if present, fallback to defaults
156
153
  const consistencyOptions = {
157
154
  rootDir: options.rootDir,
158
155
  include: options.include,
@@ -163,11 +160,10 @@ export async function analyzeUnified(
163
160
  if (options.progressCallback) {
164
161
  options.progressCallback({ tool: 'consistency', data: report });
165
162
  }
166
- // Sort consistency results by severity
167
- if (report.results) {
168
- report.results = sortBySeverity(report.results);
169
- }
170
- result.consistency = report;
163
+ result.consistency = {
164
+ results: report.results ? sortBySeverity(report.results) : [],
165
+ summary: report.summary,
166
+ };
171
167
  result.summary.totalIssues += report.summary.totalIssues;
172
168
  }
173
169
 
@@ -183,7 +179,10 @@ export async function analyzeUnified(
183
179
  if (options.progressCallback) {
184
180
  options.progressCallback({ tool: 'doc-drift', data: report });
185
181
  }
186
- result.docDrift = report;
182
+ result.docDrift = {
183
+ results: report.results || [],
184
+ summary: report.summary || {},
185
+ };
187
186
  result.summary.totalIssues += report.issues?.length || 0;
188
187
  }
189
188
 
@@ -199,12 +198,15 @@ export async function analyzeUnified(
199
198
  if (options.progressCallback) {
200
199
  options.progressCallback({ tool: 'deps-health', data: report });
201
200
  }
202
- result.deps = report;
201
+ result.dependencyHealth = {
202
+ results: report.results || [],
203
+ summary: report.summary || {},
204
+ };
203
205
  result.summary.totalIssues += report.issues?.length || 0;
204
206
  }
205
207
 
206
208
  // Run AI Signal Clarity analysis
207
- if (tools.includes('aiSignalClarity')) {
209
+ if (tools.includes('ai-signal-clarity')) {
208
210
  const { analyzeAiSignalClarity } =
209
211
  await import('@aiready/ai-signal-clarity');
210
212
  const report = await analyzeAiSignalClarity({
@@ -214,9 +216,12 @@ export async function analyzeUnified(
214
216
  onProgress: options.onProgress,
215
217
  });
216
218
  if (options.progressCallback) {
217
- options.progressCallback({ tool: 'aiSignalClarity', data: report });
219
+ options.progressCallback({ tool: 'ai-signal-clarity', data: report });
218
220
  }
219
- result.aiSignalClarity = report;
221
+ result.aiSignalClarity = {
222
+ results: report.results || [],
223
+ summary: report.summary || {},
224
+ };
220
225
  result.summary.totalIssues +=
221
226
  report.results?.reduce(
222
227
  (sum: number, r: any) => sum + (r.issues?.length || 0),
@@ -225,7 +230,7 @@ export async function analyzeUnified(
225
230
  }
226
231
 
227
232
  // Run Agent Grounding analysis
228
- if (tools.includes('grounding')) {
233
+ if (tools.includes('agent-grounding')) {
229
234
  const { analyzeAgentGrounding } = await import('@aiready/agent-grounding');
230
235
  const report = await analyzeAgentGrounding({
231
236
  rootDir: options.rootDir,
@@ -234,9 +239,12 @@ export async function analyzeUnified(
234
239
  onProgress: options.onProgress,
235
240
  });
236
241
  if (options.progressCallback) {
237
- options.progressCallback({ tool: 'grounding', data: report });
242
+ options.progressCallback({ tool: 'agent-grounding', data: report });
238
243
  }
239
- result.grounding = report;
244
+ result.agentGrounding = {
245
+ results: report.results || [],
246
+ summary: report.summary || {},
247
+ };
240
248
  result.summary.totalIssues += report.issues?.length || 0;
241
249
  }
242
250
 
@@ -252,12 +260,15 @@ export async function analyzeUnified(
252
260
  if (options.progressCallback) {
253
261
  options.progressCallback({ tool: 'testability', data: report });
254
262
  }
255
- result.testability = report;
263
+ result.testability = {
264
+ results: report.results || [],
265
+ summary: report.summary || {},
266
+ };
256
267
  result.summary.totalIssues += report.issues?.length || 0;
257
268
  }
258
269
 
259
270
  // Run Change Amplification analysis
260
- if (tools.includes('changeAmplification')) {
271
+ if (tools.includes('change-amplification')) {
261
272
  const { analyzeChangeAmplification } =
262
273
  await import('@aiready/change-amplification');
263
274
  const report = await analyzeChangeAmplification({
@@ -267,9 +278,12 @@ export async function analyzeUnified(
267
278
  onProgress: options.onProgress,
268
279
  });
269
280
  if (options.progressCallback) {
270
- options.progressCallback({ tool: 'changeAmplification', data: report });
281
+ options.progressCallback({ tool: 'change-amplification', data: report });
271
282
  }
272
- result.changeAmplification = report;
283
+ result.changeAmplification = {
284
+ results: report.results || [],
285
+ summary: report.summary || {},
286
+ };
273
287
  result.summary.totalIssues += report.summary?.totalIssues || 0;
274
288
  }
275
289
 
@@ -284,16 +298,16 @@ export async function scoreUnified(
284
298
  const toolScores: Map<string, ToolScoringOutput> = new Map();
285
299
 
286
300
  // Patterns score
287
- if (results.duplicates) {
301
+ if (results.patternDetect) {
288
302
  const { calculatePatternScore } = await import('@aiready/pattern-detect');
289
303
  try {
290
304
  const patternScore = calculatePatternScore(
291
- results.duplicates,
292
- results.patterns?.length || 0
305
+ results.patternDetect.duplicates,
306
+ results.patternDetect.results?.length || 0
293
307
  );
294
308
 
295
309
  // Calculate token budget for patterns (waste = duplication)
296
- const wastedTokens = results.duplicates.reduce(
310
+ const wastedTokens = results.patternDetect.duplicates.reduce(
297
311
  (sum: number, d: any) => sum + (d.tokenCost || 0),
298
312
  0
299
313
  );
@@ -313,11 +327,10 @@ export async function scoreUnified(
313
327
  }
314
328
 
315
329
  // Context score
316
- if (results.context) {
317
- const { generateSummary: genContextSummary, calculateContextScore } =
318
- await import('@aiready/context-analyzer');
330
+ if (results.contextAnalyzer) {
331
+ const { calculateContextScore } = await import('@aiready/context-analyzer');
319
332
  try {
320
- const ctxSummary = genContextSummary(results.context);
333
+ const ctxSummary = results.contextAnalyzer.summary;
321
334
  const contextScore = calculateContextScore(ctxSummary);
322
335
 
323
336
  // Calculate token budget for context (waste = fragmentation + depth overhead)
@@ -363,11 +376,11 @@ export async function scoreUnified(
363
376
  }
364
377
 
365
378
  // Agent grounding score
366
- if (results.grounding) {
379
+ if (results.agentGrounding) {
367
380
  const { calculateGroundingScore } =
368
381
  await import('@aiready/agent-grounding');
369
382
  try {
370
- const agScore = calculateGroundingScore(results.grounding);
383
+ const agScore = calculateGroundingScore(results.agentGrounding);
371
384
  toolScores.set('agent-grounding', agScore);
372
385
  } catch (err) {
373
386
  void err;
@@ -389,10 +402,13 @@ export async function scoreUnified(
389
402
  if (results.docDrift) {
390
403
  toolScores.set('doc-drift', {
391
404
  toolName: 'doc-drift',
392
- score: results.docDrift.summary.score,
393
- rawMetrics: results.docDrift.rawData,
405
+ score:
406
+ results.docDrift.summary.score ||
407
+ results.docDrift.summary.totalScore ||
408
+ 0,
409
+ rawMetrics: results.docDrift.summary,
394
410
  factors: [],
395
- recommendations: (results.docDrift.recommendations || []).map(
411
+ recommendations: (results.docDrift.summary.recommendations || []).map(
396
412
  (action: string) => ({
397
413
  action,
398
414
  estimatedImpact: 5,
@@ -403,19 +419,19 @@ export async function scoreUnified(
403
419
  }
404
420
 
405
421
  // Dependency Health score
406
- if (results.deps) {
422
+ if (results.dependencyHealth) {
407
423
  toolScores.set('dependency-health', {
408
424
  toolName: 'dependency-health',
409
- score: results.deps.summary.score,
410
- rawMetrics: results.deps.rawData,
425
+ score: results.dependencyHealth.summary.score || 0,
426
+ rawMetrics: results.dependencyHealth.summary,
411
427
  factors: [],
412
- recommendations: (results.deps.recommendations || []).map(
413
- (action: string) => ({
414
- action,
415
- estimatedImpact: 5,
416
- priority: 'medium',
417
- })
418
- ),
428
+ recommendations: (
429
+ results.dependencyHealth.summary.recommendations || []
430
+ ).map((action: string) => ({
431
+ action,
432
+ estimatedImpact: 5,
433
+ priority: 'medium',
434
+ })),
419
435
  });
420
436
  }
421
437
 
@@ -423,16 +439,16 @@ export async function scoreUnified(
423
439
  if (results.changeAmplification) {
424
440
  toolScores.set('change-amplification', {
425
441
  toolName: 'change-amplification',
426
- score: results.changeAmplification.summary.score,
427
- rawMetrics: results.changeAmplification.rawData,
442
+ score: results.changeAmplification.summary.score || 0,
443
+ rawMetrics: results.changeAmplification.summary,
428
444
  factors: [],
429
- recommendations: (results.changeAmplification.recommendations || []).map(
430
- (action: string) => ({
431
- action,
432
- estimatedImpact: 5,
433
- priority: 'medium',
434
- })
435
- ),
445
+ recommendations: (
446
+ results.changeAmplification.summary.recommendations || []
447
+ ).map((action: string) => ({
448
+ action,
449
+ estimatedImpact: 5,
450
+ priority: 'medium',
451
+ })),
436
452
  });
437
453
  }
438
454
 
@@ -463,12 +479,12 @@ export function generateUnifiedSummary(result: UnifiedAnalysisResult): string {
463
479
  output += ` Total issues found: ${summary.totalIssues}\n`;
464
480
  output += ` Execution time: ${(summary.executionTime / 1000).toFixed(2)}s\n\n`;
465
481
 
466
- if (result.patterns) {
467
- output += `๐Ÿ” Pattern Analysis: ${result.patterns.length} issues\n`;
482
+ if (result.patternDetect) {
483
+ output += `๐Ÿ” Pattern Analysis: ${result.patternDetect.results.length} issues\n`;
468
484
  }
469
485
 
470
- if (result.context) {
471
- output += `๐Ÿง  Context Analysis: ${result.context.length} issues\n`;
486
+ if (result.contextAnalyzer) {
487
+ output += `๐Ÿง  Context Analysis: ${result.contextAnalyzer.results.length} issues\n`;
472
488
  }
473
489
 
474
490
  if (result.consistency) {
@@ -476,23 +492,23 @@ export function generateUnifiedSummary(result: UnifiedAnalysisResult): string {
476
492
  }
477
493
 
478
494
  if (result.docDrift) {
479
- output += `๐Ÿ“ Doc Drift Analysis: ${result.docDrift.issues?.length || 0} issues\n`;
495
+ output += `๐Ÿ“ Doc Drift Analysis: ${result.docDrift.results?.length || 0} issues\n`;
480
496
  }
481
497
 
482
- if (result.deps) {
483
- output += `๐Ÿ“ฆ Dependency Health: ${result.deps.issues?.length || 0} issues\n`;
498
+ if (result.dependencyHealth) {
499
+ output += `๐Ÿ“ฆ Dependency Health: ${result.dependencyHealth.results?.length || 0} issues\n`;
484
500
  }
485
501
 
486
502
  if (result.aiSignalClarity) {
487
503
  output += `๐Ÿง  AI Signal Clarity: ${result.aiSignalClarity.summary?.totalSignals || 0} signals\n`;
488
504
  }
489
505
 
490
- if (result.grounding) {
491
- output += `๐Ÿงญ Agent Grounding: ${result.grounding.issues?.length || 0} issues\n`;
506
+ if (result.agentGrounding) {
507
+ output += `๐Ÿงญ Agent Grounding: ${result.agentGrounding.results?.length || 0} issues\n`;
492
508
  }
493
509
 
494
510
  if (result.testability) {
495
- output += `๐Ÿงช Testability Index: ${result.testability.issues?.length || 0} issues\n`;
511
+ output += `๐Ÿงช Testability Index: ${result.testability.results?.length || 0} issues\n`;
496
512
  }
497
513
 
498
514
  if (result.changeAmplification) {
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=cli.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/cli.test.ts"],"names":[],"mappings":""}
@@ -1,52 +0,0 @@
1
- import { describe, it, expect, vi } from 'vitest';
2
- import { analyzeUnified } from '../index';
3
- // Mock the individual tools
4
- vi.mock('@aiready/pattern-detect', () => ({
5
- analyzePatterns: vi.fn().mockResolvedValue({
6
- results: [],
7
- duplicates: [],
8
- files: [],
9
- }),
10
- generateSummary: vi.fn().mockReturnValue({
11
- totalDuplicateLines: 0,
12
- potentialSavings: 0,
13
- }),
14
- }));
15
- vi.mock('@aiready/context-analyzer', () => ({
16
- analyzeContext: vi.fn().mockResolvedValue([]),
17
- generateSummary: vi.fn().mockReturnValue({
18
- totalFiles: 0,
19
- averageCohesion: 0,
20
- averageFragmentation: 0,
21
- }),
22
- }));
23
- describe('CLI Unified Analysis', () => {
24
- it('should run unified analysis with both tools', async () => {
25
- const results = await analyzeUnified({
26
- rootDir: '/test',
27
- tools: ['patterns', 'context'],
28
- });
29
- expect(results).toHaveProperty('patterns');
30
- expect(results).toHaveProperty('context');
31
- expect(results).toHaveProperty('summary');
32
- });
33
- it('should run analysis with only patterns tool', async () => {
34
- const results = await analyzeUnified({
35
- rootDir: '/test',
36
- tools: ['patterns'],
37
- });
38
- expect(results).toHaveProperty('patterns');
39
- expect(results).not.toHaveProperty('context');
40
- expect(results).toHaveProperty('summary');
41
- });
42
- it('should run analysis with only context tool', async () => {
43
- const results = await analyzeUnified({
44
- rootDir: '/test',
45
- tools: ['context'],
46
- });
47
- expect(results).not.toHaveProperty('patterns');
48
- expect(results).toHaveProperty('context');
49
- expect(results).toHaveProperty('summary');
50
- });
51
- });
52
- //# sourceMappingURL=cli.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.test.js","sourceRoot":"","sources":["../../src/__tests__/cli.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,4BAA4B;AAC5B,EAAE,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,CAAC;IACxC,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC;QACzC,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,EAAE;KACV,CAAC;IACF,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC;QACvC,mBAAmB,EAAE,CAAC;QACtB,gBAAgB,EAAE,CAAC;KACpB,CAAC;CACH,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1C,cAAc,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC7C,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC;QACvC,UAAU,EAAE,CAAC;QACb,eAAe,EAAE,CAAC;QAClB,oBAAoB,EAAE,CAAC;KACxB,CAAC;CACH,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC;YACnC,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;SAC/B,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAC1C,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC;YACnC,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,CAAC,UAAU,CAAC;SACpB,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAC9C,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC;YACnC,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,CAAC,SAAS,CAAC;SACnB,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAC1C,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import {
2
- agentGroundingAction
3
- } from "./chunk-YIS6WTY5.mjs";
4
- import "./chunk-Y6FXYEAI.mjs";
5
- export {
6
- agentGroundingAction
7
- };