@aiready/change-amplification 0.13.2 → 0.13.3

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.13.2 build /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.13.3 build /Users/pengcao/projects/aiready/packages/change-amplification
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -9,16 +9,16 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
- CJS dist/cli.js 9.01 KB
13
- CJS dist/index.js 7.91 KB
14
- CJS ⚡️ Build success in 203ms
12
+ CJS dist/index.js 7.93 KB
13
+ CJS dist/cli.js 9.02 KB
14
+ CJS ⚡️ Build success in 30ms
15
+ ESM dist/index.mjs 1.72 KB
15
16
  ESM dist/cli.mjs 2.78 KB
16
- ESM dist/index.mjs 1.70 KB
17
17
  ESM dist/chunk-OBBL7HKE.mjs 4.82 KB
18
- ESM ⚡️ Build success in 204ms
18
+ ESM ⚡️ Build success in 30ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 4162ms
20
+ DTS ⚡️ Build success in 1328ms
21
21
  DTS dist/cli.d.ts 152.00 B
22
- DTS dist/index.d.ts 1.32 KB
22
+ DTS dist/index.d.ts 1.14 KB
23
23
  DTS dist/cli.d.mts 152.00 B
24
- DTS dist/index.d.mts 1.32 KB
24
+ DTS dist/index.d.mts 1.14 KB
@@ -1,6 +1,10 @@
1
-
2
- 
3
- > @aiready/change-amplification@0.11.18 lint /Users/pengcao/projects/aiready/packages/change-amplification
4
- > eslint src --ext .ts
5
-
6
-  ELIFECYCLE  Command failed.
1
+
2
+ > @aiready/change-amplification@0.13.2 lint /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > eslint src --ext .ts
4
+
5
+
6
+ /Users/pengcao/projects/aiready/packages/change-amplification/src/__tests__/cli.test.ts
7
+ 3:13 warning 'analyzer' is defined but never used @typescript-eslint/no-unused-vars
8
+
9
+ ✖ 1 problem (0 errors, 1 warning)
10
+
@@ -1,24 +1,24 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.13.1 test /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.13.2 test /Users/pengcao/projects/aiready/packages/change-amplification
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/change-amplification
8
8
 
9
- ✓ src/__tests__/dummy.test.ts (1 test) 1ms
10
- ✓ src/__tests__/cli.test.ts (2 tests) 2ms
11
- ✓ src/__tests__/scoring.test.ts (2 tests) 55ms
9
+ ✓ src/__tests__/dummy.test.ts (1 test) 14ms
10
+ ✓ src/__tests__/cli.test.ts (2 tests) 4ms
12
11
  stdout | src/__tests__/analyzer.test.ts > analyzeChangeAmplification reproduction > should see how it gets to 0
13
12
  Resulting score for highly coupled: 27
14
13
  Rating: explosive
15
14
 
16
- ✓ src/__tests__/analyzer.test.ts (2 tests) 3ms
17
- ✓ src/__tests__/provider.test.ts (2 tests) 10ms
15
+ ✓ src/__tests__/analyzer.test.ts (2 tests) 4ms
16
+ ✓ src/__tests__/provider.test.ts (2 tests) 2ms
17
+ ✓ src/__tests__/scoring.test.ts (2 tests) 20ms
18
18
 
19
19
   Test Files  5 passed (5)
20
20
   Tests  9 passed (9)
21
-  Start at  02:00:17
22
-  Duration  2.98s (transform 1.32s, setup 0ms, import 6.49s, tests 71ms, environment 0ms)
21
+  Start at  22:20:40
22
+  Duration  2.98s (transform 1.22s, setup 0ms, import 5.77s, tests 45ms, environment 0ms)
23
23
 
24
24
  [?25h
package/dist/cli.js CHANGED
@@ -185,7 +185,7 @@ var changeAmplificationAction = async (directory, options) => {
185
185
  }
186
186
  console.log(import_chalk.default.bold("\n\u{1F310} Change Amplification Analysis\n"));
187
187
  console.log(`Rating: ${import_chalk.default.bold(report.summary.rating)}`);
188
- console.log(`Score: ${Math.round(report.summary.score)}/100`);
188
+ console.log(`Score: ${Math.round(report.summary.score ?? 0)}/100`);
189
189
  console.log(`Critical Issues: ${report.summary.criticalIssues}`);
190
190
  console.log(`Major Issues: ${report.summary.majorIssues}`);
191
191
  if (report.summary.recommendations.length > 0) {
package/dist/cli.mjs CHANGED
@@ -25,7 +25,7 @@ var changeAmplificationAction = async (directory, options) => {
25
25
  }
26
26
  console.log(chalk.bold("\n\u{1F310} Change Amplification Analysis\n"));
27
27
  console.log(`Rating: ${chalk.bold(report.summary.rating)}`);
28
- console.log(`Score: ${Math.round(report.summary.score)}/100`);
28
+ console.log(`Score: ${Math.round(report.summary.score ?? 0)}/100`);
29
29
  console.log(`Critical Issues: ${report.summary.criticalIssues}`);
30
30
  console.log(`Major Issues: ${report.summary.majorIssues}`);
31
31
  if (report.summary.recommendations.length > 0) {
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _aiready_core from '@aiready/core';
2
- import { Issue, IssueType, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
2
+ import { Issue, IssueType, ScanOptions, SpokeOutput, AnalysisResult, ToolScoringOutput } from '@aiready/core';
3
3
 
4
4
  /**
5
5
  * Change Amplification Tool Provider
@@ -13,16 +13,7 @@ interface ChangeAmplificationIssue extends Issue {
13
13
  interface FileChangeAmplificationResult extends AnalysisResult {
14
14
  issues: ChangeAmplificationIssue[];
15
15
  }
16
- interface ChangeAmplificationReport {
17
- summary: {
18
- totalFiles: number;
19
- totalIssues: number;
20
- criticalIssues: number;
21
- majorIssues: number;
22
- score: number;
23
- rating: string;
24
- recommendations: string[];
25
- };
16
+ interface ChangeAmplificationReport extends SpokeOutput {
26
17
  results: FileChangeAmplificationResult[];
27
18
  }
28
19
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _aiready_core from '@aiready/core';
2
- import { Issue, IssueType, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
2
+ import { Issue, IssueType, ScanOptions, SpokeOutput, AnalysisResult, ToolScoringOutput } from '@aiready/core';
3
3
 
4
4
  /**
5
5
  * Change Amplification Tool Provider
@@ -13,16 +13,7 @@ interface ChangeAmplificationIssue extends Issue {
13
13
  interface FileChangeAmplificationResult extends AnalysisResult {
14
14
  issues: ChangeAmplificationIssue[];
15
15
  }
16
- interface ChangeAmplificationReport {
17
- summary: {
18
- totalFiles: number;
19
- totalIssues: number;
20
- criticalIssues: number;
21
- majorIssues: number;
22
- score: number;
23
- rating: string;
24
- recommendations: string[];
25
- };
16
+ interface ChangeAmplificationReport extends SpokeOutput {
26
17
  results: FileChangeAmplificationResult[];
27
18
  }
28
19
 
package/dist/index.js CHANGED
@@ -199,18 +199,18 @@ function calculateChangeAmplificationScore(report) {
199
199
  const factors = [
200
200
  {
201
201
  name: "Graph Stability",
202
- impact: Math.round(summary.score - 50),
203
- description: summary.score < 30 ? "High coupling detected in core modules" : "Stable dependency structure"
202
+ impact: Math.round((summary.score ?? 0) - 50),
203
+ description: (summary.score ?? 0) < 30 ? "High coupling detected in core modules" : "Stable dependency structure"
204
204
  }
205
205
  ];
206
206
  const recommendations = summary.recommendations.map((rec) => ({
207
207
  action: rec,
208
208
  estimatedImpact: 10,
209
- priority: summary.score < 50 ? "high" : "medium"
209
+ priority: (summary.score ?? 0) < 50 ? "high" : "medium"
210
210
  }));
211
211
  return {
212
212
  toolName: import_core3.ToolName.ChangeAmplification,
213
- score: summary.score,
213
+ score: summary.score ?? 0,
214
214
  rawMetrics: {
215
215
  totalFiles: summary.totalFiles,
216
216
  totalIssues: summary.totalIssues,
package/dist/index.mjs CHANGED
@@ -40,18 +40,18 @@ function calculateChangeAmplificationScore(report) {
40
40
  const factors = [
41
41
  {
42
42
  name: "Graph Stability",
43
- impact: Math.round(summary.score - 50),
44
- description: summary.score < 30 ? "High coupling detected in core modules" : "Stable dependency structure"
43
+ impact: Math.round((summary.score ?? 0) - 50),
44
+ description: (summary.score ?? 0) < 30 ? "High coupling detected in core modules" : "Stable dependency structure"
45
45
  }
46
46
  ];
47
47
  const recommendations = summary.recommendations.map((rec) => ({
48
48
  action: rec,
49
49
  estimatedImpact: 10,
50
- priority: summary.score < 50 ? "high" : "medium"
50
+ priority: (summary.score ?? 0) < 50 ? "high" : "medium"
51
51
  }));
52
52
  return {
53
53
  toolName: ToolName2.ChangeAmplification,
54
- score: summary.score,
54
+ score: summary.score ?? 0,
55
55
  rawMetrics: {
56
56
  totalFiles: summary.totalFiles,
57
57
  totalIssues: summary.totalIssues,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/change-amplification",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "description": "AI-Readiness: Change Amplification Detection",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -10,7 +10,7 @@
10
10
  "commander": "^14.0.0",
11
11
  "glob": "^13.0.0",
12
12
  "chalk": "^5.3.0",
13
- "@aiready/core": "0.23.2"
13
+ "@aiready/core": "0.23.3"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/node": "^24.0.0",
@@ -1,6 +1,5 @@
1
1
  import { describe, it, expect, vi } from 'vitest';
2
2
  import { changeAmplificationAction } from '../cli';
3
- import * as analyzer from '../analyzer';
4
3
  import * as fs from 'fs';
5
4
 
6
5
  vi.mock('../analyzer', () => ({
package/src/cli.ts CHANGED
@@ -29,7 +29,7 @@ export const changeAmplificationAction = async (
29
29
 
30
30
  console.log(chalk.bold('\n🌐 Change Amplification Analysis\n'));
31
31
  console.log(`Rating: ${chalk.bold(report.summary.rating)}`);
32
- console.log(`Score: ${Math.round(report.summary.score)}/100`);
32
+ console.log(`Score: ${Math.round(report.summary.score ?? 0)}/100`);
33
33
  console.log(`Critical Issues: ${report.summary.criticalIssues}`);
34
34
  console.log(`Major Issues: ${report.summary.majorIssues}`);
35
35
 
package/src/scoring.ts CHANGED
@@ -13,24 +13,24 @@ export function calculateChangeAmplificationScore(
13
13
  const factors: ToolScoringOutput['factors'] = [
14
14
  {
15
15
  name: 'Graph Stability',
16
- impact: Math.round(summary.score - 50),
16
+ impact: Math.round((summary.score ?? 0) - 50),
17
17
  description:
18
- summary.score < 30
18
+ (summary.score ?? 0) < 30
19
19
  ? 'High coupling detected in core modules'
20
20
  : 'Stable dependency structure',
21
21
  },
22
22
  ];
23
23
 
24
24
  const recommendations: ToolScoringOutput['recommendations'] =
25
- summary.recommendations.map((rec) => ({
25
+ summary.recommendations.map((rec: string) => ({
26
26
  action: rec,
27
27
  estimatedImpact: 10,
28
- priority: summary.score < 50 ? 'high' : 'medium',
28
+ priority: (summary.score ?? 0) < 50 ? 'high' : 'medium',
29
29
  }));
30
30
 
31
31
  return {
32
32
  toolName: ToolName.ChangeAmplification,
33
- score: summary.score,
33
+ score: summary.score ?? 0,
34
34
  rawMetrics: {
35
35
  totalFiles: summary.totalFiles,
36
36
  totalIssues: summary.totalIssues,
package/src/types.ts CHANGED
@@ -1,8 +1,9 @@
1
- import type {
1
+ import {
2
2
  ScanOptions,
3
3
  AnalysisResult,
4
4
  Issue,
5
5
  IssueType,
6
+ SpokeOutput,
6
7
  } from '@aiready/core';
7
8
 
8
9
  export type ChangeAmplificationOptions = ScanOptions;
@@ -15,15 +16,6 @@ export interface FileChangeAmplificationResult extends AnalysisResult {
15
16
  issues: ChangeAmplificationIssue[];
16
17
  }
17
18
 
18
- export interface ChangeAmplificationReport {
19
- summary: {
20
- totalFiles: number;
21
- totalIssues: number;
22
- criticalIssues: number;
23
- majorIssues: number;
24
- score: number;
25
- rating: string;
26
- recommendations: string[];
27
- };
19
+ export interface ChangeAmplificationReport extends SpokeOutput {
28
20
  results: FileChangeAmplificationResult[];
29
21
  }