@aiready/change-amplification 0.9.3 → 0.11.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.9.2 build /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.10.0 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,100 +9,16 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
-
13
-  WARN  ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json] 8:22:46 pm
14
-
15
- package.json:33:6:
16
-  33 │ "types": "./dist/index.d.ts"
17
- ╵ ~~~~~~~
18
-
19
- The "import" condition comes earlier and will be used for all "import" statements:
20
-
21
- package.json:31:6:
22
-  31 │ "import": "./dist/index.mjs",
23
- ╵ ~~~~~~~~
24
-
25
- The "require" condition comes earlier and will be used for all "require" calls:
26
-
27
- package.json:32:6:
28
-  32 │ "require": "./dist/index.js",
29
- ╵ ~~~~~~~~~
30
-
31
-
32
-
33
-
34
-  WARN  ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json] 8:22:46 pm
35
-
36
- package.json:38:6:
37
-  38 │ "types": "./dist/cli.d.ts"
38
- ╵ ~~~~~~~
39
-
40
- The "import" condition comes earlier and will be used for all "import" statements:
41
-
42
- package.json:36:6:
43
-  36 │ "import": "./dist/cli.mjs",
44
- ╵ ~~~~~~~~
45
-
46
- The "require" condition comes earlier and will be used for all "require" calls:
47
-
48
- package.json:37:6:
49
-  37 │ "require": "./dist/cli.js",
50
- ╵ ~~~~~~~~~
51
-
52
-
53
-
54
-
55
-  WARN  ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json] 8:22:46 pm
56
-
57
- package.json:33:6:
58
-  33 │ "types": "./dist/index.d.ts"
59
- ╵ ~~~~~~~
60
-
61
- The "import" condition comes earlier and will be used for all "import" statements:
62
-
63
- package.json:31:6:
64
-  31 │ "import": "./dist/index.mjs",
65
- ╵ ~~~~~~~~
66
-
67
- The "require" condition comes earlier and will be used for all "require" calls:
68
-
69
- package.json:32:6:
70
-  32 │ "require": "./dist/index.js",
71
- ╵ ~~~~~~~~~
72
-
73
-
74
-
75
-
76
-  WARN  ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json] 8:22:46 pm
77
-
78
- package.json:38:6:
79
-  38 │ "types": "./dist/cli.d.ts"
80
- ╵ ~~~~~~~
81
-
82
- The "import" condition comes earlier and will be used for all "import" statements:
83
-
84
- package.json:36:6:
85
-  36 │ "import": "./dist/cli.mjs",
86
- ╵ ~~~~~~~~
87
-
88
- The "require" condition comes earlier and will be used for all "require" calls:
89
-
90
- package.json:37:6:
91
-  37 │ "require": "./dist/cli.js",
92
- ╵ ~~~~~~~~~
93
-
94
-
95
-
12
+ ESM dist/index.mjs 1.25 KB
96
13
  ESM dist/cli.mjs 2.78 KB
97
- ESM dist/index.mjs 110.00 B
98
14
  ESM dist/chunk-GLHIV53G.mjs 3.79 KB
99
- ESM âšĦ️ Build success in 126ms
15
+ ESM âšĦ️ Build success in 134ms
16
+ CJS dist/index.js 6.37 KB
100
17
  CJS dist/cli.js 7.98 KB
101
- CJS dist/index.js 5.11 KB
102
- CJS âšĦ️ Build success in 127ms
18
+ CJS âšĦ️ Build success in 134ms
103
19
  DTS Build start
104
- DTS âšĦ️ Build success in 1817ms
20
+ DTS âšĦ️ Build success in 2088ms
105
21
  DTS dist/cli.d.ts 152.00 B
106
- DTS dist/index.d.ts 941.00 B
22
+ DTS dist/index.d.ts 1.05 KB
107
23
  DTS dist/cli.d.mts 152.00 B
108
- DTS dist/index.d.mts 941.00 B
24
+ DTS dist/index.d.mts 1.05 KB
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.1.6 lint /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.9.5 lint /Users/pengcao/projects/aiready/packages/change-amplification
4
4
  > eslint src --ext .ts
5
5
 
@@ -1,16 +1,16 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.9.2 test /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.10.0 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) 4ms
9
+ ✓ src/__tests__/dummy.test.ts (1 test) 2ms
10
10
 
11
11
   Test Files  1 passed (1)
12
12
   Tests  1 passed (1)
13
-  Start at  20:23:03
14
-  Duration  791ms (transform 146ms, setup 0ms, import 169ms, tests 4ms, environment 0ms)
13
+  Start at  09:33:02
14
+  Duration  221ms (transform 39ms, setup 0ms, import 54ms, tests 2ms, environment 0ms)
15
15
 
16
16
  [?25h
package/dist/index.d.mts CHANGED
@@ -1,7 +1,11 @@
1
- import { Issue, IssueType, ScanOptions, AnalysisResult } from '@aiready/core';
1
+ import { ToolProvider, Issue, IssueType, ScanOptions, AnalysisResult } from '@aiready/core';
2
2
 
3
- interface ChangeAmplificationOptions extends ScanOptions {
4
- }
3
+ /**
4
+ * Change Amplification Tool Provider
5
+ */
6
+ declare const ChangeAmplificationProvider: ToolProvider;
7
+
8
+ type ChangeAmplificationOptions = ScanOptions;
5
9
  interface ChangeAmplificationIssue extends Issue {
6
10
  type: IssueType.ChangeAmplification;
7
11
  }
@@ -23,4 +27,4 @@ interface ChangeAmplificationReport {
23
27
 
24
28
  declare function analyzeChangeAmplification(options: ChangeAmplificationOptions): Promise<ChangeAmplificationReport>;
25
29
 
26
- export { type ChangeAmplificationIssue, type ChangeAmplificationOptions, type ChangeAmplificationReport, type FileChangeAmplificationResult, analyzeChangeAmplification };
30
+ export { type ChangeAmplificationIssue, type ChangeAmplificationOptions, ChangeAmplificationProvider, type ChangeAmplificationReport, type FileChangeAmplificationResult, analyzeChangeAmplification };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,11 @@
1
- import { Issue, IssueType, ScanOptions, AnalysisResult } from '@aiready/core';
1
+ import { ToolProvider, Issue, IssueType, ScanOptions, AnalysisResult } from '@aiready/core';
2
2
 
3
- interface ChangeAmplificationOptions extends ScanOptions {
4
- }
3
+ /**
4
+ * Change Amplification Tool Provider
5
+ */
6
+ declare const ChangeAmplificationProvider: ToolProvider;
7
+
8
+ type ChangeAmplificationOptions = ScanOptions;
5
9
  interface ChangeAmplificationIssue extends Issue {
6
10
  type: IssueType.ChangeAmplification;
7
11
  }
@@ -23,4 +27,4 @@ interface ChangeAmplificationReport {
23
27
 
24
28
  declare function analyzeChangeAmplification(options: ChangeAmplificationOptions): Promise<ChangeAmplificationReport>;
25
29
 
26
- export { type ChangeAmplificationIssue, type ChangeAmplificationOptions, type ChangeAmplificationReport, type FileChangeAmplificationResult, analyzeChangeAmplification };
30
+ export { type ChangeAmplificationIssue, type ChangeAmplificationOptions, ChangeAmplificationProvider, type ChangeAmplificationReport, type FileChangeAmplificationResult, analyzeChangeAmplification };
package/dist/index.js CHANGED
@@ -30,9 +30,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ ChangeAmplificationProvider: () => ChangeAmplificationProvider,
33
34
  analyzeChangeAmplification: () => analyzeChangeAmplification
34
35
  });
35
36
  module.exports = __toCommonJS(index_exports);
37
+ var import_core3 = require("@aiready/core");
38
+
39
+ // src/provider.ts
40
+ var import_core2 = require("@aiready/core");
36
41
 
37
42
  // src/analyzer.ts
38
43
  var fs = __toESM(require("fs"));
@@ -136,7 +141,48 @@ async function analyzeChangeAmplification(options) {
136
141
  results
137
142
  };
138
143
  }
144
+
145
+ // src/provider.ts
146
+ var ChangeAmplificationProvider = {
147
+ id: import_core2.ToolName.ChangeAmplification,
148
+ alias: ["change-amp", "change-amplification", "coupling"],
149
+ async analyze(options) {
150
+ const report = await analyzeChangeAmplification(
151
+ options
152
+ );
153
+ return import_core2.SpokeOutputSchema.parse({
154
+ results: report.results,
155
+ summary: report.summary,
156
+ metadata: {
157
+ toolName: import_core2.ToolName.ChangeAmplification,
158
+ version: "0.9.5",
159
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
160
+ }
161
+ });
162
+ },
163
+ score(output, options) {
164
+ const summary = output.summary;
165
+ return {
166
+ toolName: import_core2.ToolName.ChangeAmplification,
167
+ score: summary.score || 0,
168
+ rawMetrics: summary,
169
+ factors: [],
170
+ recommendations: (summary.recommendations || []).map(
171
+ (action) => ({
172
+ action,
173
+ estimatedImpact: 5,
174
+ priority: "medium"
175
+ })
176
+ )
177
+ };
178
+ },
179
+ defaultWeight: 8
180
+ };
181
+
182
+ // src/index.ts
183
+ import_core3.ToolRegistry.register(ChangeAmplificationProvider);
139
184
  // Annotate the CommonJS export names for ESM import in node:
140
185
  0 && (module.exports = {
186
+ ChangeAmplificationProvider,
141
187
  analyzeChangeAmplification
142
188
  });
package/dist/index.mjs CHANGED
@@ -1,6 +1,54 @@
1
1
  import {
2
2
  analyzeChangeAmplification
3
3
  } from "./chunk-GLHIV53G.mjs";
4
+
5
+ // src/index.ts
6
+ import { ToolRegistry } from "@aiready/core";
7
+
8
+ // src/provider.ts
9
+ import {
10
+ ToolName,
11
+ SpokeOutputSchema
12
+ } from "@aiready/core";
13
+ var ChangeAmplificationProvider = {
14
+ id: ToolName.ChangeAmplification,
15
+ alias: ["change-amp", "change-amplification", "coupling"],
16
+ async analyze(options) {
17
+ const report = await analyzeChangeAmplification(
18
+ options
19
+ );
20
+ return SpokeOutputSchema.parse({
21
+ results: report.results,
22
+ summary: report.summary,
23
+ metadata: {
24
+ toolName: ToolName.ChangeAmplification,
25
+ version: "0.9.5",
26
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
27
+ }
28
+ });
29
+ },
30
+ score(output, options) {
31
+ const summary = output.summary;
32
+ return {
33
+ toolName: ToolName.ChangeAmplification,
34
+ score: summary.score || 0,
35
+ rawMetrics: summary,
36
+ factors: [],
37
+ recommendations: (summary.recommendations || []).map(
38
+ (action) => ({
39
+ action,
40
+ estimatedImpact: 5,
41
+ priority: "medium"
42
+ })
43
+ )
44
+ };
45
+ },
46
+ defaultWeight: 8
47
+ };
48
+
49
+ // src/index.ts
50
+ ToolRegistry.register(ChangeAmplificationProvider);
4
51
  export {
52
+ ChangeAmplificationProvider,
5
53
  analyzeChangeAmplification
6
54
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/change-amplification",
3
- "version": "0.9.3",
3
+ "version": "0.11.0",
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.19.3"
13
+ "@aiready/core": "0.21.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/node": "^24.0.0",
@@ -21,14 +21,14 @@
21
21
  },
22
22
  "exports": {
23
23
  ".": {
24
+ "types": "./dist/index.d.ts",
24
25
  "import": "./dist/index.mjs",
25
- "require": "./dist/index.js",
26
- "types": "./dist/index.d.ts"
26
+ "require": "./dist/index.js"
27
27
  },
28
28
  "./cli": {
29
+ "types": "./dist/cli.d.ts",
29
30
  "import": "./dist/cli.mjs",
30
- "require": "./dist/cli.js",
31
- "types": "./dist/cli.d.ts"
31
+ "require": "./dist/cli.js"
32
32
  },
33
33
  "./dist/cli.js": {
34
34
  "require": "./dist/cli.js",
package/src/analyzer.ts CHANGED
@@ -99,7 +99,8 @@ export async function analyzeChangeAmplification(
99
99
  if (hotspot.amplificationFactor > 20) {
100
100
  issues.push({
101
101
  type: IssueType.ChangeAmplification,
102
- severity: hotspot.amplificationFactor > 40 ? Severity.Critical : Severity.Major,
102
+ severity:
103
+ hotspot.amplificationFactor > 40 ? Severity.Critical : Severity.Major,
103
104
  message: `High change amplification detected (Factor: ${hotspot.amplificationFactor}). Changes here cascade heavily.`,
104
105
  location: { file: hotspot.file, line: 1 },
105
106
  suggestion: `Reduce coupling. Fan-out is ${hotspot.fanOut}, Fan-in is ${hotspot.fanIn}.`,
@@ -128,7 +129,8 @@ export async function analyzeChangeAmplification(
128
129
  0
129
130
  ),
130
131
  majorIssues: results.reduce(
131
- (sum, r) => sum + r.issues.filter((i) => getLevel(i.severity) === 3).length,
132
+ (sum, r) =>
133
+ sum + r.issues.filter((i) => getLevel(i.severity) === 3).length,
132
134
  0
133
135
  ),
134
136
  score: riskResult.score,
package/src/index.ts CHANGED
@@ -1,4 +1,11 @@
1
+ import { ToolRegistry } from '@aiready/core';
2
+ import { ChangeAmplificationProvider } from './provider';
3
+
4
+ // Register with global registry
5
+ ToolRegistry.register(ChangeAmplificationProvider);
6
+
1
7
  export { analyzeChangeAmplification } from './analyzer';
8
+ export { ChangeAmplificationProvider };
2
9
  export type {
3
10
  ChangeAmplificationOptions,
4
11
  ChangeAmplificationReport,
@@ -0,0 +1,58 @@
1
+ import {
2
+ ToolProvider,
3
+ ToolName,
4
+ SpokeOutput,
5
+ ScanOptions,
6
+ ToolScoringOutput,
7
+ AnalysisResult,
8
+ SpokeOutputSchema,
9
+ } from '@aiready/core';
10
+ import { analyzeChangeAmplification } from './analyzer';
11
+ import {
12
+ ChangeAmplificationOptions,
13
+ FileChangeAmplificationResult,
14
+ } from './types';
15
+
16
+ /**
17
+ * Change Amplification Tool Provider
18
+ */
19
+ export const ChangeAmplificationProvider: ToolProvider = {
20
+ id: ToolName.ChangeAmplification,
21
+ alias: ['change-amp', 'change-amplification', 'coupling'],
22
+
23
+ async analyze(options: ScanOptions): Promise<SpokeOutput> {
24
+ const report = await analyzeChangeAmplification(
25
+ options as ChangeAmplificationOptions
26
+ );
27
+
28
+ return SpokeOutputSchema.parse({
29
+ results: report.results as AnalysisResult[],
30
+ summary: report.summary,
31
+ metadata: {
32
+ toolName: ToolName.ChangeAmplification,
33
+ version: '0.9.5',
34
+ timestamp: new Date().toISOString(),
35
+ },
36
+ });
37
+ },
38
+
39
+ score(output: SpokeOutput, options: ScanOptions): ToolScoringOutput {
40
+ const summary = output.summary as any;
41
+
42
+ return {
43
+ toolName: ToolName.ChangeAmplification,
44
+ score: summary.score || 0,
45
+ rawMetrics: summary,
46
+ factors: [],
47
+ recommendations: (summary.recommendations || []).map(
48
+ (action: string) => ({
49
+ action,
50
+ estimatedImpact: 5,
51
+ priority: 'medium',
52
+ })
53
+ ),
54
+ };
55
+ },
56
+
57
+ defaultWeight: 8,
58
+ };
package/src/types.ts CHANGED
@@ -1,6 +1,11 @@
1
- import type { ScanOptions, AnalysisResult, Issue, IssueType } from '@aiready/core';
1
+ import type {
2
+ ScanOptions,
3
+ AnalysisResult,
4
+ Issue,
5
+ IssueType,
6
+ } from '@aiready/core';
2
7
 
3
- export interface ChangeAmplificationOptions extends ScanOptions {}
8
+ export type ChangeAmplificationOptions = ScanOptions;
4
9
 
5
10
  export interface ChangeAmplificationIssue extends Issue {
6
11
  type: IssueType.ChangeAmplification;