@aiready/change-amplification 0.13.1 → 0.13.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.13.0 build /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.13.2 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
- ESM dist/chunk-OBBL7HKE.mjs 4.82 KB
13
- ESM dist/index.mjs 2.07 KB
14
- ESM dist/cli.mjs 2.78 KB
15
- ESM ⚡️ Build success in 152ms
16
- CJS dist/index.js 8.30 KB
17
12
  CJS dist/cli.js 9.01 KB
18
- CJS ⚡️ Build success in 153ms
13
+ CJS dist/index.js 7.91 KB
14
+ CJS ⚡️ Build success in 203ms
15
+ ESM dist/cli.mjs 2.78 KB
16
+ ESM dist/index.mjs 1.70 KB
17
+ ESM dist/chunk-OBBL7HKE.mjs 4.82 KB
18
+ ESM ⚡️ Build success in 204ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 3183ms
20
+ DTS ⚡️ Build success in 4162ms
21
21
  DTS dist/cli.d.ts 152.00 B
22
- DTS dist/index.d.ts 1.28 KB
22
+ DTS dist/index.d.ts 1.32 KB
23
23
  DTS dist/cli.d.mts 152.00 B
24
- DTS dist/index.d.mts 1.28 KB
24
+ DTS dist/index.d.mts 1.32 KB
@@ -1,70 +1,24 @@
1
1
 
2
2
  
3
- > @aiready/change-amplification@0.13.0 test /Users/pengcao/projects/aiready/packages/change-amplification
3
+ > @aiready/change-amplification@0.13.1 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
- [?2026h
10
-  ❯ src/__tests__/cli.test.ts [queued]
11
-
12
-  Test Files 0 passed (5)
13
-  Tests 0 passed (0)
14
-  Start at 17:20:12
15
-  Duration 697ms
16
- [?2026l[?2026h
17
-  ❯ src/__tests__/analyzer.test.ts [queued]
18
-  ❯ src/__tests__/cli.test.ts [queued]
19
-  ❯ src/__tests__/provider.test.ts [queued]
20
-  ❯ src/__tests__/scoring.test.ts [queued]
21
-
22
-  Test Files 0 passed (5)
23
-  Tests 0 passed (0)
24
-  Start at 17:20:12
25
-  Duration 839ms
26
- [?2026l[?2026h
27
-  ❯ src/__tests__/analyzer.test.ts [queued]
28
-  ❯ src/__tests__/cli.test.ts 0/2
29
-  ❯ src/__tests__/dummy.test.ts [queued]
30
-  ❯ src/__tests__/provider.test.ts [queued]
31
-  ❯ src/__tests__/scoring.test.ts [queued]
32
-
33
-  Test Files 0 passed (5)
34
-  Tests 0 passed (2)
35
-  Start at 17:20:12
36
-  Duration 1.25s
37
- [?2026l[?2026h ✓ src/__tests__/dummy.test.ts (1 test) 3ms
38
- ✓ src/__tests__/cli.test.ts (2 tests) 4ms
39
-
40
-  ❯ src/__tests__/analyzer.test.ts [queued]
41
-  ❯ src/__tests__/provider.test.ts [queued]
42
-  ❯ src/__tests__/scoring.test.ts [queued]
43
-
44
-  Test Files 2 passed (5)
45
-  Tests 3 passed (3)
46
-  Start at 17:20:12
47
-  Duration 1.97s
48
- [?2026l[?2026h
49
-  ❯ src/__tests__/analyzer.test.ts [queued]
50
-  ❯ src/__tests__/provider.test.ts [queued]
51
-  ❯ src/__tests__/scoring.test.ts 0/2
52
-
53
-  Test Files 2 passed (5)
54
-  Tests 3 passed (5)
55
-  Start at 17:20:12
56
-  Duration 2.18s
57
- [?2026l ✓ src/__tests__/scoring.test.ts (2 tests) 2ms
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
58
12
  stdout | src/__tests__/analyzer.test.ts > analyzeChangeAmplification reproduction > should see how it gets to 0
59
13
  Resulting score for highly coupled: 27
60
14
  Rating: explosive
61
15
 
62
- ✓ src/__tests__/analyzer.test.ts (2 tests) 5ms
63
- ✓ src/__tests__/provider.test.ts (2 tests) 14ms
16
+ ✓ src/__tests__/analyzer.test.ts (2 tests) 3ms
17
+ ✓ src/__tests__/provider.test.ts (2 tests) 10ms
64
18
 
65
19
   Test Files  5 passed (5)
66
20
   Tests  9 passed (9)
67
-  Start at  17:20:12
68
-  Duration  2.30s (transform 1.22s, setup 0ms, import 4.72s, tests 28ms, environment 0ms)
21
+  Start at  02:00:17
22
+  Duration  2.98s (transform 1.32s, setup 0ms, import 6.49s, tests 71ms, environment 0ms)
69
23
 
70
24
  [?25h
package/dist/index.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { ToolProvider, Issue, IssueType, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
1
+ import * as _aiready_core from '@aiready/core';
2
+ import { Issue, IssueType, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
2
3
 
3
4
  /**
4
5
  * Change Amplification Tool Provider
5
6
  */
6
- declare const ChangeAmplificationProvider: ToolProvider;
7
+ declare const ChangeAmplificationProvider: _aiready_core.ToolProvider;
7
8
 
8
9
  type ChangeAmplificationOptions = ScanOptions;
9
10
  interface ChangeAmplificationIssue extends Issue {
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { ToolProvider, Issue, IssueType, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
1
+ import * as _aiready_core from '@aiready/core';
2
+ import { Issue, IssueType, ScanOptions, AnalysisResult, ToolScoringOutput } from '@aiready/core';
2
3
 
3
4
  /**
4
5
  * Change Amplification Tool Provider
5
6
  */
6
- declare const ChangeAmplificationProvider: ToolProvider;
7
+ declare const ChangeAmplificationProvider: _aiready_core.ToolProvider;
7
8
 
8
9
  type ChangeAmplificationOptions = ScanOptions;
9
10
  interface ChangeAmplificationIssue extends Issue {
package/dist/index.js CHANGED
@@ -170,41 +170,27 @@ async function analyzeChangeAmplification(options) {
170
170
  }
171
171
 
172
172
  // src/provider.ts
173
- var ChangeAmplificationProvider = {
173
+ var ChangeAmplificationProvider = (0, import_core2.createProvider)({
174
174
  id: import_core2.ToolName.ChangeAmplification,
175
175
  alias: ["change-amp", "change-amplification", "coupling"],
176
- async analyze(options) {
177
- const report = await analyzeChangeAmplification(
178
- options
179
- );
180
- return import_core2.SpokeOutputSchema.parse({
181
- results: report.results,
182
- summary: report.summary,
183
- metadata: {
184
- toolName: import_core2.ToolName.ChangeAmplification,
185
- version: "0.9.5",
186
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
187
- }
188
- });
176
+ version: "0.9.5",
177
+ defaultWeight: 8,
178
+ async analyzeReport(options) {
179
+ return analyzeChangeAmplification(options);
189
180
  },
190
- score(output, options) {
191
- const summary = output.summary;
192
- return {
193
- toolName: import_core2.ToolName.ChangeAmplification,
194
- score: summary.score || 0,
195
- rawMetrics: summary,
196
- factors: [],
197
- recommendations: (summary.recommendations || []).map(
198
- (action) => ({
199
- action,
200
- estimatedImpact: 5,
201
- priority: "medium"
202
- })
203
- )
204
- };
181
+ getResults(report) {
182
+ return report.results;
205
183
  },
206
- defaultWeight: 8
207
- };
184
+ getSummary(report) {
185
+ return report.summary;
186
+ },
187
+ score(output) {
188
+ return (0, import_core2.buildSimpleProviderScore)(
189
+ import_core2.ToolName.ChangeAmplification,
190
+ output.summary
191
+ );
192
+ }
193
+ });
208
194
 
209
195
  // src/scoring.ts
210
196
  var import_core3 = require("@aiready/core");
package/dist/index.mjs CHANGED
@@ -7,44 +7,31 @@ import { ToolRegistry } from "@aiready/core";
7
7
 
8
8
  // src/provider.ts
9
9
  import {
10
+ createProvider,
10
11
  ToolName,
11
- SpokeOutputSchema
12
+ buildSimpleProviderScore
12
13
  } from "@aiready/core";
13
- var ChangeAmplificationProvider = {
14
+ var ChangeAmplificationProvider = createProvider({
14
15
  id: ToolName.ChangeAmplification,
15
16
  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
- });
17
+ version: "0.9.5",
18
+ defaultWeight: 8,
19
+ async analyzeReport(options) {
20
+ return analyzeChangeAmplification(options);
29
21
  },
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
- };
22
+ getResults(report) {
23
+ return report.results;
45
24
  },
46
- defaultWeight: 8
47
- };
25
+ getSummary(report) {
26
+ return report.summary;
27
+ },
28
+ score(output) {
29
+ return buildSimpleProviderScore(
30
+ ToolName.ChangeAmplification,
31
+ output.summary
32
+ );
33
+ }
34
+ });
48
35
 
49
36
  // src/scoring.ts
50
37
  import { ToolName as ToolName2 } from "@aiready/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/change-amplification",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
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.1"
13
+ "@aiready/core": "0.23.2"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/node": "^24.0.0",
@@ -24,7 +24,7 @@ describe('Change Amplification Provider', () => {
24
24
  const output = await ChangeAmplificationProvider.analyze({ rootDir: '.' });
25
25
 
26
26
  expect(output.summary.totalFiles).toBe(1);
27
- expect(output.metadata.toolName).toBe('change-amplification');
27
+ expect(output.metadata!.toolName).toBe('change-amplification');
28
28
  });
29
29
 
30
30
  it('should score an output', () => {
package/src/provider.ts CHANGED
@@ -1,58 +1,33 @@
1
1
  import {
2
- ToolProvider,
2
+ createProvider,
3
3
  ToolName,
4
- SpokeOutput,
5
4
  ScanOptions,
6
- ToolScoringOutput,
7
- AnalysisResult,
8
- SpokeOutputSchema,
5
+ buildSimpleProviderScore,
9
6
  } from '@aiready/core';
10
7
  import { analyzeChangeAmplification } from './analyzer';
11
- import {
12
- ChangeAmplificationOptions,
13
- FileChangeAmplificationResult,
14
- } from './types';
8
+ import { ChangeAmplificationOptions } from './types';
15
9
 
16
10
  /**
17
11
  * Change Amplification Tool Provider
18
12
  */
19
- export const ChangeAmplificationProvider: ToolProvider = {
13
+ export const ChangeAmplificationProvider = createProvider({
20
14
  id: ToolName.ChangeAmplification,
21
15
  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
- });
16
+ version: '0.9.5',
17
+ defaultWeight: 8,
18
+ async analyzeReport(options: ScanOptions) {
19
+ return analyzeChangeAmplification(options as ChangeAmplificationOptions);
37
20
  },
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
- };
21
+ getResults(report) {
22
+ return report.results as any;
55
23
  },
56
-
57
- defaultWeight: 8,
58
- };
24
+ getSummary(report) {
25
+ return report.summary;
26
+ },
27
+ score(output) {
28
+ return buildSimpleProviderScore(
29
+ ToolName.ChangeAmplification,
30
+ output.summary as any
31
+ );
32
+ },
33
+ });