@aiready/context-analyzer 0.21.1 → 0.21.6
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/.aiready/aiready-report-20260314-222254.json +39216 -0
- package/.aiready/aiready-report-20260314-223947.json +3413 -0
- package/.aiready/aiready-report-20260314-224112.json +3413 -0
- package/.aiready/aiready-report-20260314-224302.json +2973 -0
- package/.aiready/aiready-report-20260314-224939.json +3092 -0
- package/.aiready/aiready-report-20260314-225154.json +3092 -0
- package/.turbo/turbo-build.log +13 -12
- package/.turbo/turbo-test.log +32 -341
- package/dist/__tests__/analyzer.test.js +55 -14
- package/dist/__tests__/analyzer.test.js.map +1 -1
- package/dist/__tests__/cluster-detector.test.d.ts +2 -0
- package/dist/__tests__/cluster-detector.test.d.ts.map +1 -0
- package/dist/__tests__/cluster-detector.test.js +121 -0
- package/dist/__tests__/cluster-detector.test.js.map +1 -0
- package/dist/__tests__/contract.test.d.ts +2 -0
- package/dist/__tests__/contract.test.d.ts.map +1 -0
- package/dist/__tests__/contract.test.js +59 -0
- package/dist/__tests__/contract.test.js.map +1 -0
- package/dist/__tests__/enhanced-cohesion.test.js +12 -2
- package/dist/__tests__/enhanced-cohesion.test.js.map +1 -1
- package/dist/__tests__/file-classification.test.d.ts +2 -0
- package/dist/__tests__/file-classification.test.d.ts.map +1 -0
- package/dist/__tests__/file-classification.test.js +749 -0
- package/dist/__tests__/file-classification.test.js.map +1 -0
- package/dist/__tests__/fragmentation-advanced.test.js +2 -8
- package/dist/__tests__/fragmentation-advanced.test.js.map +1 -1
- package/dist/__tests__/fragmentation-coupling.test.js +2 -2
- package/dist/__tests__/fragmentation-coupling.test.js.map +1 -1
- package/dist/__tests__/fragmentation-log.test.js +3 -7
- package/dist/__tests__/fragmentation-log.test.js.map +1 -1
- package/dist/__tests__/provider.test.d.ts +2 -0
- package/dist/__tests__/provider.test.d.ts.map +1 -0
- package/dist/__tests__/provider.test.js +72 -0
- package/dist/__tests__/provider.test.js.map +1 -0
- package/dist/__tests__/remediation.test.d.ts +2 -0
- package/dist/__tests__/remediation.test.d.ts.map +1 -0
- package/dist/__tests__/remediation.test.js +61 -0
- package/dist/__tests__/remediation.test.js.map +1 -0
- package/dist/__tests__/scoring.test.js +196 -16
- package/dist/__tests__/scoring.test.js.map +1 -1
- package/dist/__tests__/structural-cohesion.test.js +8 -2
- package/dist/__tests__/structural-cohesion.test.js.map +1 -1
- package/dist/analyzer.d.ts +31 -94
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +260 -678
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzers/python-context.d.ts.map +1 -1
- package/dist/analyzers/python-context.js +10 -8
- package/dist/analyzers/python-context.js.map +1 -1
- package/dist/ast-utils.d.ts +16 -0
- package/dist/ast-utils.d.ts.map +1 -0
- package/dist/ast-utils.js +81 -0
- package/dist/ast-utils.js.map +1 -0
- package/dist/chunk-64U3PNO3.mjs +94 -0
- package/dist/chunk-CDIVYADN.mjs +2110 -0
- package/dist/chunk-D3SIHB2V.mjs +2118 -0
- package/dist/chunk-FNPSK3CG.mjs +1760 -0
- package/dist/chunk-GXTGOLZT.mjs +92 -0
- package/dist/chunk-LERPI33Y.mjs +2060 -0
- package/dist/chunk-MZP3G7TF.mjs +2118 -0
- package/dist/chunk-NOHK5DLU.mjs +2173 -0
- package/dist/chunk-ORLC5Y4J.mjs +1787 -0
- package/dist/chunk-OTCQL7DY.mjs +2045 -0
- package/dist/chunk-OUYSZZ7X.mjs +1846 -0
- package/dist/chunk-SFK6XTJE.mjs +2110 -0
- package/dist/chunk-U5R2FTCR.mjs +1803 -0
- package/dist/chunk-UU4HZ7ZT.mjs +1849 -0
- package/dist/chunk-W2KNBN6W.mjs +1849 -0
- package/dist/chunk-WKOZOHOU.mjs +2060 -0
- package/dist/chunk-XIXAWCMS.mjs +1760 -0
- package/dist/classifier.d.ts +114 -0
- package/dist/classifier.d.ts.map +1 -0
- package/dist/classifier.js +439 -0
- package/dist/classifier.js.map +1 -0
- package/dist/cli.js +591 -1057
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +63 -533
- package/dist/cluster-detector.d.ts +8 -0
- package/dist/cluster-detector.d.ts.map +1 -0
- package/dist/cluster-detector.js +70 -0
- package/dist/cluster-detector.js.map +1 -0
- package/dist/defaults.d.ts +7 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +54 -0
- package/dist/defaults.js.map +1 -0
- package/dist/graph-builder.d.ts +33 -0
- package/dist/graph-builder.d.ts.map +1 -0
- package/dist/graph-builder.js +225 -0
- package/dist/graph-builder.js.map +1 -0
- package/dist/index.d.mts +24 -31
- package/dist/index.d.ts +24 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +822 -588
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +265 -8
- package/dist/metrics.d.ts +34 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +170 -0
- package/dist/metrics.js.map +1 -0
- package/dist/provider.d.ts +6 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +48 -0
- package/dist/provider.js.map +1 -0
- package/dist/python-context-3GZKN3LR.mjs +162 -0
- package/dist/python-context-O2EN3M6Z.mjs +162 -0
- package/dist/remediation.d.ts +25 -0
- package/dist/remediation.d.ts.map +1 -0
- package/dist/remediation.js +98 -0
- package/dist/remediation.js.map +1 -0
- package/dist/scoring.d.ts +3 -7
- package/dist/scoring.d.ts.map +1 -1
- package/dist/scoring.js +57 -48
- package/dist/scoring.js.map +1 -1
- package/dist/semantic-analysis.d.ts +12 -23
- package/dist/semantic-analysis.d.ts.map +1 -1
- package/dist/semantic-analysis.js +172 -110
- package/dist/semantic-analysis.js.map +1 -1
- package/dist/summary.d.ts +6 -0
- package/dist/summary.d.ts.map +1 -0
- package/dist/summary.js +92 -0
- package/dist/summary.js.map +1 -0
- package/dist/types.d.ts +9 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/output-formatter.d.ts +14 -0
- package/dist/utils/output-formatter.d.ts.map +1 -0
- package/dist/utils/output-formatter.js +338 -0
- package/dist/utils/output-formatter.js.map +1 -0
- package/package.json +2 -2
- package/src/__tests__/analyzer.test.ts +1 -1
- package/src/__tests__/auto-detection.test.ts +1 -1
- package/src/__tests__/contract.test.ts +1 -1
- package/src/__tests__/enhanced-cohesion.test.ts +1 -1
- package/src/__tests__/file-classification.test.ts +1 -1
- package/src/__tests__/fragmentation-advanced.test.ts +1 -1
- package/src/__tests__/fragmentation-coupling.test.ts +1 -1
- package/src/__tests__/fragmentation-log.test.ts +1 -1
- package/src/__tests__/provider.test.ts +1 -1
- package/src/__tests__/scoring.test.ts +217 -9
- package/src/__tests__/structural-cohesion.test.ts +1 -1
- package/src/analyzer.ts +96 -309
- package/src/analyzers/python-context.ts +7 -76
- package/src/cli-action.ts +103 -0
- package/src/cli.ts +12 -693
- package/src/cluster-detector.ts +1 -1
- package/src/graph-builder.ts +9 -85
- package/src/index.ts +6 -0
- package/src/issue-analyzer.ts +143 -0
- package/src/scoring.ts +40 -20
- package/src/semantic-analysis.ts +1 -14
- package/src/summary.ts +62 -106
- package/src/utils/dependency-graph-utils.ts +126 -0
- package/src/utils/output-formatter.ts +411 -0
- package/src/utils/string-utils.ts +17 -0
|
@@ -1,44 +1,33 @@
|
|
|
1
|
-
import type { DependencyGraph, CoUsageData, DomainAssignment, DomainSignals } from './types';
|
|
1
|
+
import type { DependencyGraph, CoUsageData, DomainAssignment, DomainSignals, ExportInfo } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Build co-usage matrix: track which files are imported together
|
|
4
|
-
*
|
|
5
|
-
* Files frequently imported together likely belong to the same semantic domain
|
|
6
4
|
*/
|
|
7
5
|
export declare function buildCoUsageMatrix(graph: DependencyGraph): Map<string, Map<string, number>>;
|
|
8
6
|
/**
|
|
9
7
|
* Extract type dependencies from AST exports
|
|
10
|
-
*
|
|
11
|
-
* Files that share types are semantically related
|
|
12
8
|
*/
|
|
13
9
|
export declare function buildTypeGraph(graph: DependencyGraph): Map<string, Set<string>>;
|
|
14
10
|
/**
|
|
15
11
|
* Find semantic clusters using co-usage patterns
|
|
16
|
-
*
|
|
17
|
-
* Files with high co-usage counts belong in the same cluster
|
|
18
12
|
*/
|
|
19
13
|
export declare function findSemanticClusters(coUsageMatrix: Map<string, Map<string, number>>, minCoUsage?: number): Map<string, string[]>;
|
|
20
|
-
/**
|
|
21
|
-
* Calculate confidence score for domain assignment based on multiple signals
|
|
22
|
-
*/
|
|
23
|
-
export declare function calculateDomainConfidence(signals: DomainSignals): number;
|
|
24
14
|
/**
|
|
25
15
|
* Infer domain from semantic analysis (co-usage + types)
|
|
26
|
-
*
|
|
27
|
-
* This replaces the folder-based heuristic with actual code relationships
|
|
28
16
|
*/
|
|
29
17
|
export declare function inferDomainFromSemantics(file: string, exportName: string, graph: DependencyGraph, coUsageMatrix: Map<string, Map<string, number>>, typeGraph: Map<string, Set<string>>, exportTypeRefs?: string[]): DomainAssignment[];
|
|
18
|
+
export declare function calculateDomainConfidence(signals: DomainSignals): number;
|
|
30
19
|
/**
|
|
31
|
-
*
|
|
20
|
+
* Regex-based export extraction (legacy/fallback)
|
|
32
21
|
*/
|
|
33
|
-
export declare function
|
|
22
|
+
export declare function extractExports(content: string, filePath?: string, domainOptions?: {
|
|
23
|
+
domainKeywords?: string[];
|
|
24
|
+
}, fileImports?: string[]): ExportInfo[];
|
|
34
25
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* High co-usage + shared types = strong consolidation candidate
|
|
26
|
+
* Infer domain from name, path, or imports
|
|
38
27
|
*/
|
|
39
|
-
export declare function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
export declare function inferDomain(name: string, filePath?: string, domainOptions?: {
|
|
29
|
+
domainKeywords?: string[];
|
|
30
|
+
}, fileImports?: string[]): string;
|
|
31
|
+
export declare function getCoUsageData(file: string, coUsageMatrix: Map<string, Map<string, number>>): CoUsageData;
|
|
32
|
+
export declare function findConsolidationCandidates(graph: DependencyGraph, coUsageMatrix: Map<string, Map<string, number>>, typeGraph: Map<string, Set<string>>, minCoUsage?: number, minSharedTypes?: number): any[];
|
|
44
33
|
//# sourceMappingURL=semantic-analysis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-analysis.d.ts","sourceRoot":"","sources":["../src/semantic-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"semantic-analysis.d.ts","sourceRoot":"","sources":["../src/semantic-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,eAAe,GACrB,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAuBlC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,eAAe,GACrB,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAe1B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC/C,UAAU,GAAE,MAAU,GACrB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAqBvB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,eAAe,EACtB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC/C,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACnC,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,gBAAgB,EAAE,CAkEpB;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAexE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EAC7C,WAAW,CAAC,EAAE,MAAM,EAAE,GACrB,UAAU,EAAE,CAoCd;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EAC7C,WAAW,CAAC,EAAE,MAAM,EAAE,GACrB,MAAM,CA0ER;AAgBD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC9C,WAAW,CAMb;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,eAAe,EACtB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC/C,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACnC,UAAU,GAAE,MAAU,EACtB,cAAc,GAAE,MAAU,SA2B3B"}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Build co-usage matrix: track which files are imported together
|
|
3
|
-
*
|
|
4
|
-
* Files frequently imported together likely belong to the same semantic domain
|
|
5
3
|
*/
|
|
6
4
|
export function buildCoUsageMatrix(graph) {
|
|
7
5
|
const coUsageMatrix = new Map();
|
|
8
|
-
|
|
9
|
-
for (const [sourceFile, node] of graph.nodes) {
|
|
6
|
+
for (const [, node] of graph.nodes) {
|
|
10
7
|
const imports = node.imports;
|
|
11
|
-
// For each pair of imports in this file, increment their co-usage count
|
|
12
8
|
for (let i = 0; i < imports.length; i++) {
|
|
13
9
|
const fileA = imports[i];
|
|
14
|
-
if (!coUsageMatrix.has(fileA))
|
|
10
|
+
if (!coUsageMatrix.has(fileA))
|
|
15
11
|
coUsageMatrix.set(fileA, new Map());
|
|
16
|
-
}
|
|
17
12
|
for (let j = i + 1; j < imports.length; j++) {
|
|
18
13
|
const fileB = imports[j];
|
|
19
|
-
// Increment bidirectional co-usage count
|
|
20
14
|
const fileAUsage = coUsageMatrix.get(fileA);
|
|
21
15
|
fileAUsage.set(fileB, (fileAUsage.get(fileB) || 0) + 1);
|
|
22
|
-
if (!coUsageMatrix.has(fileB))
|
|
16
|
+
if (!coUsageMatrix.has(fileB))
|
|
23
17
|
coUsageMatrix.set(fileB, new Map());
|
|
24
|
-
}
|
|
25
18
|
const fileBUsage = coUsageMatrix.get(fileB);
|
|
26
19
|
fileBUsage.set(fileA, (fileBUsage.get(fileA) || 0) + 1);
|
|
27
20
|
}
|
|
@@ -31,8 +24,6 @@ export function buildCoUsageMatrix(graph) {
|
|
|
31
24
|
}
|
|
32
25
|
/**
|
|
33
26
|
* Extract type dependencies from AST exports
|
|
34
|
-
*
|
|
35
|
-
* Files that share types are semantically related
|
|
36
27
|
*/
|
|
37
28
|
export function buildTypeGraph(graph) {
|
|
38
29
|
const typeGraph = new Map();
|
|
@@ -40,9 +31,8 @@ export function buildTypeGraph(graph) {
|
|
|
40
31
|
for (const exp of node.exports) {
|
|
41
32
|
if (exp.typeReferences) {
|
|
42
33
|
for (const typeRef of exp.typeReferences) {
|
|
43
|
-
if (!typeGraph.has(typeRef))
|
|
34
|
+
if (!typeGraph.has(typeRef))
|
|
44
35
|
typeGraph.set(typeRef, new Set());
|
|
45
|
-
}
|
|
46
36
|
typeGraph.get(typeRef).add(file);
|
|
47
37
|
}
|
|
48
38
|
}
|
|
@@ -52,70 +42,35 @@ export function buildTypeGraph(graph) {
|
|
|
52
42
|
}
|
|
53
43
|
/**
|
|
54
44
|
* Find semantic clusters using co-usage patterns
|
|
55
|
-
*
|
|
56
|
-
* Files with high co-usage counts belong in the same cluster
|
|
57
45
|
*/
|
|
58
46
|
export function findSemanticClusters(coUsageMatrix, minCoUsage = 3) {
|
|
59
47
|
const clusters = new Map();
|
|
60
48
|
const visited = new Set();
|
|
61
|
-
// Simple clustering: group files with high co-usage
|
|
62
49
|
for (const [file, coUsages] of coUsageMatrix) {
|
|
63
50
|
if (visited.has(file))
|
|
64
51
|
continue;
|
|
65
52
|
const cluster = [file];
|
|
66
53
|
visited.add(file);
|
|
67
|
-
// Find strongly related files (co-imported >= minCoUsage times)
|
|
68
54
|
for (const [relatedFile, count] of coUsages) {
|
|
69
55
|
if (count >= minCoUsage && !visited.has(relatedFile)) {
|
|
70
56
|
cluster.push(relatedFile);
|
|
71
57
|
visited.add(relatedFile);
|
|
72
58
|
}
|
|
73
59
|
}
|
|
74
|
-
if (cluster.length > 1)
|
|
75
|
-
// Use first file as cluster ID
|
|
60
|
+
if (cluster.length > 1)
|
|
76
61
|
clusters.set(file, cluster);
|
|
77
|
-
}
|
|
78
62
|
}
|
|
79
63
|
return clusters;
|
|
80
64
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Calculate confidence score for domain assignment based on multiple signals
|
|
83
|
-
*/
|
|
84
|
-
export function calculateDomainConfidence(signals) {
|
|
85
|
-
const weights = {
|
|
86
|
-
coUsage: 0.35, // Strongest signal: actual usage patterns
|
|
87
|
-
typeReference: 0.30, // Strong signal: shared types
|
|
88
|
-
exportName: 0.15, // Medium signal: identifier semantics
|
|
89
|
-
importPath: 0.10, // Weaker signal: path structure
|
|
90
|
-
folderStructure: 0.10 // Weakest signal: organization convention
|
|
91
|
-
};
|
|
92
|
-
let confidence = 0;
|
|
93
|
-
if (signals.coUsage)
|
|
94
|
-
confidence += weights.coUsage;
|
|
95
|
-
if (signals.typeReference)
|
|
96
|
-
confidence += weights.typeReference;
|
|
97
|
-
if (signals.exportName)
|
|
98
|
-
confidence += weights.exportName;
|
|
99
|
-
if (signals.importPath)
|
|
100
|
-
confidence += weights.importPath;
|
|
101
|
-
if (signals.folderStructure)
|
|
102
|
-
confidence += weights.folderStructure;
|
|
103
|
-
return confidence;
|
|
104
|
-
}
|
|
105
65
|
/**
|
|
106
66
|
* Infer domain from semantic analysis (co-usage + types)
|
|
107
|
-
*
|
|
108
|
-
* This replaces the folder-based heuristic with actual code relationships
|
|
109
67
|
*/
|
|
110
68
|
export function inferDomainFromSemantics(file, exportName, graph, coUsageMatrix, typeGraph, exportTypeRefs) {
|
|
111
|
-
const assignments = [];
|
|
112
69
|
const domainSignals = new Map();
|
|
113
|
-
// 1. Check co-usage patterns
|
|
114
70
|
const coUsages = coUsageMatrix.get(file) || new Map();
|
|
115
71
|
const strongCoUsages = Array.from(coUsages.entries())
|
|
116
|
-
.filter(([
|
|
72
|
+
.filter(([, count]) => count >= 3)
|
|
117
73
|
.map(([coFile]) => coFile);
|
|
118
|
-
// Extract domains from frequently co-imported files
|
|
119
74
|
for (const coFile of strongCoUsages) {
|
|
120
75
|
const coNode = graph.nodes.get(coFile);
|
|
121
76
|
if (coNode) {
|
|
@@ -128,7 +83,7 @@ export function inferDomainFromSemantics(file, exportName, graph, coUsageMatrix,
|
|
|
128
83
|
typeReference: false,
|
|
129
84
|
exportName: false,
|
|
130
85
|
importPath: false,
|
|
131
|
-
folderStructure: false
|
|
86
|
+
folderStructure: false,
|
|
132
87
|
});
|
|
133
88
|
}
|
|
134
89
|
domainSignals.get(domain).coUsage = true;
|
|
@@ -136,29 +91,28 @@ export function inferDomainFromSemantics(file, exportName, graph, coUsageMatrix,
|
|
|
136
91
|
}
|
|
137
92
|
}
|
|
138
93
|
}
|
|
139
|
-
// 2. Check type references
|
|
140
94
|
if (exportTypeRefs) {
|
|
141
95
|
for (const typeRef of exportTypeRefs) {
|
|
142
96
|
const filesWithType = typeGraph.get(typeRef);
|
|
143
97
|
if (filesWithType) {
|
|
144
98
|
for (const typeFile of filesWithType) {
|
|
145
|
-
if (typeFile
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
domainSignals.get(domain).typeReference = true;
|
|
99
|
+
if (typeFile === file)
|
|
100
|
+
continue;
|
|
101
|
+
const typeNode = graph.nodes.get(typeFile);
|
|
102
|
+
if (typeNode) {
|
|
103
|
+
for (const exp of typeNode.exports) {
|
|
104
|
+
if (exp.inferredDomain && exp.inferredDomain !== 'unknown') {
|
|
105
|
+
const domain = exp.inferredDomain;
|
|
106
|
+
if (!domainSignals.has(domain)) {
|
|
107
|
+
domainSignals.set(domain, {
|
|
108
|
+
coUsage: false,
|
|
109
|
+
typeReference: false,
|
|
110
|
+
exportName: false,
|
|
111
|
+
importPath: false,
|
|
112
|
+
folderStructure: false,
|
|
113
|
+
});
|
|
161
114
|
}
|
|
115
|
+
domainSignals.get(domain).typeReference = true;
|
|
162
116
|
}
|
|
163
117
|
}
|
|
164
118
|
}
|
|
@@ -166,76 +120,184 @@ export function inferDomainFromSemantics(file, exportName, graph, coUsageMatrix,
|
|
|
166
120
|
}
|
|
167
121
|
}
|
|
168
122
|
}
|
|
169
|
-
|
|
123
|
+
const assignments = [];
|
|
170
124
|
for (const [domain, signals] of domainSignals) {
|
|
171
125
|
const confidence = calculateDomainConfidence(signals);
|
|
172
|
-
if (confidence >= 0.3)
|
|
126
|
+
if (confidence >= 0.3)
|
|
173
127
|
assignments.push({ domain, confidence, signals });
|
|
174
|
-
}
|
|
175
128
|
}
|
|
176
|
-
// Sort by confidence (highest first)
|
|
177
129
|
assignments.sort((a, b) => b.confidence - a.confidence);
|
|
178
130
|
return assignments;
|
|
179
131
|
}
|
|
132
|
+
export function calculateDomainConfidence(signals) {
|
|
133
|
+
const weights = {
|
|
134
|
+
coUsage: 0.35,
|
|
135
|
+
typeReference: 0.3,
|
|
136
|
+
exportName: 0.15,
|
|
137
|
+
importPath: 0.1,
|
|
138
|
+
folderStructure: 0.1,
|
|
139
|
+
};
|
|
140
|
+
let confidence = 0;
|
|
141
|
+
if (signals.coUsage)
|
|
142
|
+
confidence += weights.coUsage;
|
|
143
|
+
if (signals.typeReference)
|
|
144
|
+
confidence += weights.typeReference;
|
|
145
|
+
if (signals.exportName)
|
|
146
|
+
confidence += weights.exportName;
|
|
147
|
+
if (signals.importPath)
|
|
148
|
+
confidence += weights.importPath;
|
|
149
|
+
if (signals.folderStructure)
|
|
150
|
+
confidence += weights.folderStructure;
|
|
151
|
+
return confidence;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Regex-based export extraction (legacy/fallback)
|
|
155
|
+
*/
|
|
156
|
+
export function extractExports(content, filePath, domainOptions, fileImports) {
|
|
157
|
+
const exports = [];
|
|
158
|
+
const patterns = [
|
|
159
|
+
/export\s+function\s+(\w+)/g,
|
|
160
|
+
/export\s+class\s+(\w+)/g,
|
|
161
|
+
/export\s+const\s+(\w+)/g,
|
|
162
|
+
/export\s+type\s+(\w+)/g,
|
|
163
|
+
/export\s+interface\s+(\w+)/g,
|
|
164
|
+
/export\s+default/g,
|
|
165
|
+
];
|
|
166
|
+
const types = [
|
|
167
|
+
'function',
|
|
168
|
+
'class',
|
|
169
|
+
'const',
|
|
170
|
+
'type',
|
|
171
|
+
'interface',
|
|
172
|
+
'default',
|
|
173
|
+
];
|
|
174
|
+
patterns.forEach((pattern, index) => {
|
|
175
|
+
let match;
|
|
176
|
+
while ((match = pattern.exec(content)) !== null) {
|
|
177
|
+
const name = match[1] || 'default';
|
|
178
|
+
const type = types[index];
|
|
179
|
+
const inferredDomain = inferDomain(name, filePath, domainOptions, fileImports);
|
|
180
|
+
exports.push({ name, type, inferredDomain });
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return exports;
|
|
184
|
+
}
|
|
180
185
|
/**
|
|
181
|
-
*
|
|
186
|
+
* Infer domain from name, path, or imports
|
|
182
187
|
*/
|
|
188
|
+
export function inferDomain(name, filePath, domainOptions, fileImports) {
|
|
189
|
+
const lower = name.toLowerCase();
|
|
190
|
+
const tokens = Array.from(new Set(lower
|
|
191
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
192
|
+
.replace(/[^a-z0-9]+/gi, ' ')
|
|
193
|
+
.split(' ')
|
|
194
|
+
.filter(Boolean)));
|
|
195
|
+
const defaultKeywords = [
|
|
196
|
+
'authentication',
|
|
197
|
+
'authorization',
|
|
198
|
+
'payment',
|
|
199
|
+
'invoice',
|
|
200
|
+
'customer',
|
|
201
|
+
'product',
|
|
202
|
+
'order',
|
|
203
|
+
'cart',
|
|
204
|
+
'user',
|
|
205
|
+
'admin',
|
|
206
|
+
'repository',
|
|
207
|
+
'controller',
|
|
208
|
+
'service',
|
|
209
|
+
'config',
|
|
210
|
+
'model',
|
|
211
|
+
'view',
|
|
212
|
+
'auth',
|
|
213
|
+
];
|
|
214
|
+
const domainKeywords = domainOptions?.domainKeywords?.length
|
|
215
|
+
? [...domainOptions.domainKeywords, ...defaultKeywords]
|
|
216
|
+
: defaultKeywords;
|
|
217
|
+
for (const keyword of domainKeywords) {
|
|
218
|
+
if (tokens.includes(keyword))
|
|
219
|
+
return keyword;
|
|
220
|
+
}
|
|
221
|
+
for (const keyword of domainKeywords) {
|
|
222
|
+
if (lower.includes(keyword))
|
|
223
|
+
return keyword;
|
|
224
|
+
}
|
|
225
|
+
if (fileImports) {
|
|
226
|
+
for (const importPath of fileImports) {
|
|
227
|
+
const segments = importPath.split('/');
|
|
228
|
+
for (const segment of segments) {
|
|
229
|
+
const segLower = segment.toLowerCase();
|
|
230
|
+
const singularSegment = singularize(segLower);
|
|
231
|
+
for (const keyword of domainKeywords) {
|
|
232
|
+
if (singularSegment === keyword ||
|
|
233
|
+
segLower === keyword ||
|
|
234
|
+
segLower.includes(keyword))
|
|
235
|
+
return keyword;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (filePath) {
|
|
241
|
+
const segments = filePath.split('/');
|
|
242
|
+
for (const segment of segments) {
|
|
243
|
+
const segLower = segment.toLowerCase();
|
|
244
|
+
const singularSegment = singularize(segLower);
|
|
245
|
+
for (const keyword of domainKeywords) {
|
|
246
|
+
if (singularSegment === keyword || segLower === keyword)
|
|
247
|
+
return keyword;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return 'unknown';
|
|
252
|
+
}
|
|
253
|
+
function singularize(word) {
|
|
254
|
+
const irregulars = {
|
|
255
|
+
people: 'person',
|
|
256
|
+
children: 'child',
|
|
257
|
+
men: 'man',
|
|
258
|
+
women: 'woman',
|
|
259
|
+
};
|
|
260
|
+
if (irregulars[word])
|
|
261
|
+
return irregulars[word];
|
|
262
|
+
if (word.endsWith('ies'))
|
|
263
|
+
return word.slice(0, -3) + 'y';
|
|
264
|
+
if (word.endsWith('ses'))
|
|
265
|
+
return word.slice(0, -2);
|
|
266
|
+
if (word.endsWith('s') && word.length > 3)
|
|
267
|
+
return word.slice(0, -1);
|
|
268
|
+
return word;
|
|
269
|
+
}
|
|
183
270
|
export function getCoUsageData(file, coUsageMatrix) {
|
|
184
|
-
const coImportedWith = coUsageMatrix.get(file) || new Map();
|
|
185
|
-
// Find files that import both this file and others
|
|
186
|
-
const sharedImporters = [];
|
|
187
|
-
// This would require inverse mapping from imports, simplified for now
|
|
188
271
|
return {
|
|
189
272
|
file,
|
|
190
|
-
coImportedWith,
|
|
191
|
-
sharedImporters
|
|
273
|
+
coImportedWith: coUsageMatrix.get(file) || new Map(),
|
|
274
|
+
sharedImporters: [],
|
|
192
275
|
};
|
|
193
276
|
}
|
|
194
|
-
/**
|
|
195
|
-
* Find files that should be consolidated based on semantic similarity
|
|
196
|
-
*
|
|
197
|
-
* High co-usage + shared types = strong consolidation candidate
|
|
198
|
-
*/
|
|
199
277
|
export function findConsolidationCandidates(graph, coUsageMatrix, typeGraph, minCoUsage = 5, minSharedTypes = 2) {
|
|
200
278
|
const candidates = [];
|
|
201
|
-
// Find file pairs with both high co-usage AND shared types
|
|
202
279
|
for (const [fileA, coUsages] of coUsageMatrix) {
|
|
203
280
|
const nodeA = graph.nodes.get(fileA);
|
|
204
281
|
if (!nodeA)
|
|
205
282
|
continue;
|
|
206
|
-
for (const [fileB,
|
|
207
|
-
if (fileB <= fileA)
|
|
208
|
-
continue; // Avoid duplicates
|
|
209
|
-
if (coUsageCount < minCoUsage)
|
|
283
|
+
for (const [fileB, count] of coUsages) {
|
|
284
|
+
if (fileB <= fileA || count < minCoUsage)
|
|
210
285
|
continue;
|
|
211
286
|
const nodeB = graph.nodes.get(fileB);
|
|
212
287
|
if (!nodeB)
|
|
213
288
|
continue;
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
if (sharedTypes.length >= minSharedTypes) {
|
|
219
|
-
const strength = (coUsageCount / 10) + (sharedTypes.length / 5);
|
|
220
|
-
candidates.push({
|
|
221
|
-
files: [fileA, fileB],
|
|
222
|
-
reason: `High co-usage (${coUsageCount}x) and ${sharedTypes.length} shared types`,
|
|
223
|
-
strength
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
else if (coUsageCount >= minCoUsage * 2) {
|
|
227
|
-
// Very high co-usage alone is enough
|
|
228
|
-
const strength = coUsageCount / 10;
|
|
289
|
+
const typesA = new Set(nodeA.exports.flatMap((e) => e.typeReferences || []));
|
|
290
|
+
const typesB = new Set(nodeB.exports.flatMap((e) => e.typeReferences || []));
|
|
291
|
+
const sharedTypes = Array.from(typesA).filter((t) => typesB.has(t));
|
|
292
|
+
if (sharedTypes.length >= minSharedTypes || count >= minCoUsage * 2) {
|
|
229
293
|
candidates.push({
|
|
230
294
|
files: [fileA, fileB],
|
|
231
|
-
reason: `
|
|
232
|
-
strength
|
|
295
|
+
reason: `High co-usage (${count}x)`,
|
|
296
|
+
strength: count / 10,
|
|
233
297
|
});
|
|
234
298
|
}
|
|
235
299
|
}
|
|
236
300
|
}
|
|
237
|
-
|
|
238
|
-
candidates.sort((a, b) => b.strength - a.strength);
|
|
239
|
-
return candidates;
|
|
301
|
+
return candidates.sort((a, b) => b.strength - a.strength);
|
|
240
302
|
}
|
|
241
303
|
//# sourceMappingURL=semantic-analysis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-analysis.js","sourceRoot":"","sources":["../src/semantic-analysis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"semantic-analysis.js","sourceRoot":"","sources":["../src/semantic-analysis.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAsB;IAEtB,MAAM,aAAa,GAAG,IAAI,GAAG,EAA+B,CAAC;IAE7D,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC;gBAAE,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;YAEnE,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;gBACzB,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,CA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,CAAC,CAAC,cAAc,IAAI,EAAE,CAAC,CACrD,CAAC;YACF,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,IAAI,EAAE,CAAC,CACrD,CAAC;YACF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,IAAI,WAAW,CAAC,MAAM,IAAI,cAAc,IAAI,KAAK,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;gBACpE,UAAU,CAAC,IAAI,CAAC;oBACd,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;oBACrB,MAAM,EAAE,kBAAkB,KAAK,IAAI;oBACnC,QAAQ,EAAE,KAAK,GAAG,EAAE;iBACrB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ContextAnalysisResult, ContextSummary } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Generate summary of context analysis results
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateSummary(results: ContextAnalysisResult[], options: any): ContextSummary;
|
|
6
|
+
//# sourceMappingURL=summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EAEf,MAAM,SAAS,CAAC;AAIjB;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,qBAAqB,EAAE,EAChC,OAAO,EAAE,GAAG,GACX,cAAc,CA8GhB"}
|
package/dist/summary.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { calculatePathEntropy, calculateDirectoryDistance } from './analyzer';
|
|
2
|
+
import { GLOBAL_SCAN_OPTIONS } from '@aiready/core';
|
|
3
|
+
/**
|
|
4
|
+
* Generate summary of context analysis results
|
|
5
|
+
*/
|
|
6
|
+
export function generateSummary(results, options) {
|
|
7
|
+
const config = options
|
|
8
|
+
? Object.fromEntries(Object.entries(options).filter(([key]) => !GLOBAL_SCAN_OPTIONS.includes(key) || key === 'rootDir'))
|
|
9
|
+
: {};
|
|
10
|
+
const totalFiles = results.length;
|
|
11
|
+
const totalTokens = results.reduce((sum, r) => sum + r.tokens, 0);
|
|
12
|
+
const avgContextBudget = totalFiles > 0 ? totalTokens / totalFiles : 0;
|
|
13
|
+
// Find deep files
|
|
14
|
+
const deepFiles = results
|
|
15
|
+
.filter((r) => r.maxDepth > 5)
|
|
16
|
+
.map((r) => ({ file: r.file, depth: r.maxDepth }));
|
|
17
|
+
const maxImportDepth = Math.max(0, ...results.map((r) => r.maxDepth));
|
|
18
|
+
// Find fragmented modules (clusters)
|
|
19
|
+
const moduleMap = new Map();
|
|
20
|
+
results.forEach((r) => {
|
|
21
|
+
const parts = r.file.split('/');
|
|
22
|
+
// Try to identify domain/module (e.g., packages/core, src/utils)
|
|
23
|
+
let domain = 'root';
|
|
24
|
+
if (parts.length > 2) {
|
|
25
|
+
domain = parts.slice(0, 2).join('/');
|
|
26
|
+
}
|
|
27
|
+
if (!moduleMap.has(domain))
|
|
28
|
+
moduleMap.set(domain, []);
|
|
29
|
+
moduleMap.get(domain).push(r);
|
|
30
|
+
});
|
|
31
|
+
const fragmentedModules = [];
|
|
32
|
+
moduleMap.forEach((files, domain) => {
|
|
33
|
+
const totalTokens = files.reduce((sum, f) => sum + f.tokens, 0);
|
|
34
|
+
const avgEntropy = files.reduce((sum, f) => sum + calculatePathEntropy(f.file), 0) /
|
|
35
|
+
files.length;
|
|
36
|
+
// A module is fragmented if it has many files with high directory distance
|
|
37
|
+
// and relatively low cohesion
|
|
38
|
+
const fragmentationScore = Math.min(1, avgEntropy * (files.length / 10));
|
|
39
|
+
if (fragmentationScore > 0.4) {
|
|
40
|
+
fragmentedModules.push({
|
|
41
|
+
domain,
|
|
42
|
+
files: files.map((f) => f.file),
|
|
43
|
+
fragmentationScore,
|
|
44
|
+
totalTokens,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
fragmentedModules.sort((a, b) => b.fragmentationScore - a.fragmentationScore);
|
|
49
|
+
const avgFragmentation = fragmentedModules.length > 0
|
|
50
|
+
? fragmentedModules.reduce((sum, m) => sum + m.fragmentationScore, 0) /
|
|
51
|
+
fragmentedModules.length
|
|
52
|
+
: 0;
|
|
53
|
+
// Cohesion (dummy for now, uses directory distance)
|
|
54
|
+
const avgCohesion = 1 -
|
|
55
|
+
results.reduce((sum, r) => sum + calculateDirectoryDistance(r.file), 0) /
|
|
56
|
+
(totalFiles || 1) /
|
|
57
|
+
10;
|
|
58
|
+
const lowCohesionFiles = results
|
|
59
|
+
.filter((r) => calculateDirectoryDistance(r.file) > 5)
|
|
60
|
+
.map((r) => r.file);
|
|
61
|
+
// Issues
|
|
62
|
+
const criticalIssues = results.filter((r) => r.severity === 'critical').length;
|
|
63
|
+
const majorIssues = results.filter((r) => r.severity === 'major').length;
|
|
64
|
+
const minorIssues = results.filter((r) => r.severity === 'minor').length;
|
|
65
|
+
const totalPotentialSavings = results.reduce((sum, r) => sum + (r.potentialSavings || 0), 0);
|
|
66
|
+
const topExpensiveFiles = results
|
|
67
|
+
.sort((a, b) => b.tokens - a.tokens)
|
|
68
|
+
.slice(0, 10)
|
|
69
|
+
.map((r) => ({
|
|
70
|
+
file: r.file,
|
|
71
|
+
contextBudget: r.tokens,
|
|
72
|
+
severity: r.severity,
|
|
73
|
+
}));
|
|
74
|
+
return {
|
|
75
|
+
totalFiles,
|
|
76
|
+
totalTokens,
|
|
77
|
+
avgContextBudget,
|
|
78
|
+
maxImportDepth,
|
|
79
|
+
deepFiles,
|
|
80
|
+
avgFragmentation,
|
|
81
|
+
fragmentedModules,
|
|
82
|
+
avgCohesion,
|
|
83
|
+
lowCohesionFiles,
|
|
84
|
+
criticalIssues,
|
|
85
|
+
majorIssues,
|
|
86
|
+
minorIssues,
|
|
87
|
+
totalPotentialSavings,
|
|
88
|
+
topExpensiveFiles,
|
|
89
|
+
config,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAgC,EAChC,OAAY;IAEZ,MAAM,MAAM,GAAG,OAAO;QACpB,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAC5B,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,SAAS,CACnE,CACF;QACH,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAClC,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAClE,MAAM,gBAAgB,GACpB,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,UA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