@veewo/gitnexus 1.3.9 → 1.3.10
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/dist/cli/ai-context.js +1 -1
- package/dist/cli/analyze-multi-scope-regression.test.js +1 -1
- package/dist/cli/analyze-options.d.ts +19 -0
- package/dist/cli/analyze-options.js +35 -0
- package/dist/cli/analyze-options.test.js +42 -1
- package/dist/cli/analyze.d.ts +1 -0
- package/dist/cli/analyze.js +53 -26
- package/dist/cli/index.js +1 -0
- package/dist/cli/repo-manager-alias.test.js +24 -1
- package/dist/mcp/resources.js +1 -1
- package/dist/mcp/staleness.js +1 -1
- package/dist/storage/repo-manager.d.ts +6 -0
- package/package.json +3 -3
- package/dist/cli/analyze-custom-modules-regression.test.d.ts +0 -1
- package/dist/cli/analyze-custom-modules-regression.test.js +0 -75
- package/dist/cli/analyze-modules-diagnostics.test.d.ts +0 -1
- package/dist/cli/analyze-modules-diagnostics.test.js +0 -36
- package/dist/core/ingestion/modules/assignment-engine.d.ts +0 -33
- package/dist/core/ingestion/modules/assignment-engine.js +0 -179
- package/dist/core/ingestion/modules/assignment-engine.test.d.ts +0 -1
- package/dist/core/ingestion/modules/assignment-engine.test.js +0 -111
- package/dist/core/ingestion/modules/config-loader.d.ts +0 -2
- package/dist/core/ingestion/modules/config-loader.js +0 -186
- package/dist/core/ingestion/modules/config-loader.test.d.ts +0 -1
- package/dist/core/ingestion/modules/config-loader.test.js +0 -57
- package/dist/core/ingestion/modules/rule-matcher.d.ts +0 -12
- package/dist/core/ingestion/modules/rule-matcher.js +0 -63
- package/dist/core/ingestion/modules/rule-matcher.test.d.ts +0 -1
- package/dist/core/ingestion/modules/rule-matcher.test.js +0 -58
- package/dist/core/ingestion/modules/types.d.ts +0 -44
- package/dist/core/ingestion/modules/types.js +0 -2
- package/dist/mcp/local/cluster-aggregation.d.ts +0 -20
- package/dist/mcp/local/cluster-aggregation.js +0 -48
- package/dist/mcp/local/cluster-aggregation.test.d.ts +0 -1
- package/dist/mcp/local/cluster-aggregation.test.js +0 -22
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export type ModuleMode = 'auto' | 'mixed';
|
|
2
|
-
export type ModuleField = 'symbol.name' | 'symbol.kind' | 'symbol.fqn' | 'file.path';
|
|
3
|
-
export type ModuleOperator = 'eq' | 'contains' | 'regex' | 'in';
|
|
4
|
-
export interface ModuleCondition {
|
|
5
|
-
field: ModuleField;
|
|
6
|
-
op: ModuleOperator;
|
|
7
|
-
value: string | string[];
|
|
8
|
-
}
|
|
9
|
-
export interface ModuleRuleWhen {
|
|
10
|
-
all?: ModuleCondition[];
|
|
11
|
-
any?: ModuleCondition[];
|
|
12
|
-
}
|
|
13
|
-
export interface ModuleRule {
|
|
14
|
-
id: string;
|
|
15
|
-
priority?: number;
|
|
16
|
-
when: ModuleRuleWhen;
|
|
17
|
-
}
|
|
18
|
-
export interface ModuleDefinition {
|
|
19
|
-
name: string;
|
|
20
|
-
defaultPriority: number;
|
|
21
|
-
rules: ModuleRule[];
|
|
22
|
-
}
|
|
23
|
-
export interface ModuleConfig {
|
|
24
|
-
version: 1;
|
|
25
|
-
mode: ModuleMode;
|
|
26
|
-
modules: ModuleDefinition[];
|
|
27
|
-
}
|
|
28
|
-
export interface ModuleConfigLoadDiagnostics {
|
|
29
|
-
configPath: string;
|
|
30
|
-
usedFallbackAuto: boolean;
|
|
31
|
-
warnings: string[];
|
|
32
|
-
}
|
|
33
|
-
export interface LoadModuleConfigInput {
|
|
34
|
-
repoPath: string;
|
|
35
|
-
defaultMode?: ModuleMode;
|
|
36
|
-
}
|
|
37
|
-
export interface ModuleConfigLoadResult {
|
|
38
|
-
mode: ModuleMode;
|
|
39
|
-
config: ModuleConfig | null;
|
|
40
|
-
diagnostics: ModuleConfigLoadDiagnostics;
|
|
41
|
-
usedFallbackAuto: boolean;
|
|
42
|
-
}
|
|
43
|
-
export declare const MODULE_FIELDS: readonly ModuleField[];
|
|
44
|
-
export declare const MODULE_OPERATORS: readonly ModuleOperator[];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface RawCluster {
|
|
2
|
-
id: string;
|
|
3
|
-
label?: string;
|
|
4
|
-
heuristicLabel?: string;
|
|
5
|
-
cohesion?: number;
|
|
6
|
-
symbolCount?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface AggregatedCluster {
|
|
9
|
-
id: string;
|
|
10
|
-
label: string;
|
|
11
|
-
heuristicLabel: string;
|
|
12
|
-
symbolCount: number;
|
|
13
|
-
cohesion: number;
|
|
14
|
-
subCommunities: number;
|
|
15
|
-
}
|
|
16
|
-
export interface ClusterAggregationOptions {
|
|
17
|
-
minSymbolCount?: number;
|
|
18
|
-
configuredIdPrefix?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare function aggregateClusters(clusters: RawCluster[], options?: ClusterAggregationOptions): AggregatedCluster[];
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const DEFAULT_MIN_SYMBOL_COUNT = 5;
|
|
2
|
-
const DEFAULT_CONFIGURED_ID_PREFIX = 'comm_cfg_';
|
|
3
|
-
export function aggregateClusters(clusters, options = {}) {
|
|
4
|
-
const minSymbolCount = options.minSymbolCount ?? DEFAULT_MIN_SYMBOL_COUNT;
|
|
5
|
-
const configuredIdPrefix = options.configuredIdPrefix ?? DEFAULT_CONFIGURED_ID_PREFIX;
|
|
6
|
-
const groups = new Map();
|
|
7
|
-
for (const cluster of clusters) {
|
|
8
|
-
const label = cluster.heuristicLabel || cluster.label || 'Unknown';
|
|
9
|
-
const symbols = cluster.symbolCount || 0;
|
|
10
|
-
const cohesion = cluster.cohesion || 0;
|
|
11
|
-
const isConfigured = cluster.id.startsWith(configuredIdPrefix);
|
|
12
|
-
const existing = groups.get(label);
|
|
13
|
-
if (!existing) {
|
|
14
|
-
groups.set(label, {
|
|
15
|
-
ids: [cluster.id],
|
|
16
|
-
totalSymbols: symbols,
|
|
17
|
-
weightedCohesion: cohesion * symbols,
|
|
18
|
-
largest: cluster,
|
|
19
|
-
hasConfigured: isConfigured,
|
|
20
|
-
});
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
existing.ids.push(cluster.id);
|
|
24
|
-
existing.totalSymbols += symbols;
|
|
25
|
-
existing.weightedCohesion += cohesion * symbols;
|
|
26
|
-
existing.hasConfigured = existing.hasConfigured || isConfigured;
|
|
27
|
-
if (symbols > (existing.largest.symbolCount || 0)) {
|
|
28
|
-
existing.largest = cluster;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return Array.from(groups.entries())
|
|
32
|
-
.map(([label, g]) => ({
|
|
33
|
-
id: g.largest.id,
|
|
34
|
-
label,
|
|
35
|
-
heuristicLabel: label,
|
|
36
|
-
symbolCount: g.totalSymbols,
|
|
37
|
-
cohesion: g.totalSymbols > 0 ? g.weightedCohesion / g.totalSymbols : 0,
|
|
38
|
-
subCommunities: g.ids.length,
|
|
39
|
-
hasConfigured: g.hasConfigured,
|
|
40
|
-
}))
|
|
41
|
-
.filter((c) => c.symbolCount >= minSymbolCount || c.hasConfigured)
|
|
42
|
-
.sort((a, b) => {
|
|
43
|
-
if (a.symbolCount !== b.symbolCount)
|
|
44
|
-
return b.symbolCount - a.symbolCount;
|
|
45
|
-
return a.heuristicLabel.localeCompare(b.heuristicLabel);
|
|
46
|
-
})
|
|
47
|
-
.map(({ hasConfigured: _hasConfigured, ...rest }) => rest);
|
|
48
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import test from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { aggregateClusters } from './cluster-aggregation.js';
|
|
4
|
-
test('keeps auto tiny clusters filtered but includes empty configured modules', () => {
|
|
5
|
-
const out = aggregateClusters([
|
|
6
|
-
{ id: 'comm_1', label: 'AutoTiny', heuristicLabel: 'AutoTiny', cohesion: 0.2, symbolCount: 1 },
|
|
7
|
-
{ id: 'comm_cfg_battle', label: 'Battle', heuristicLabel: 'Battle', cohesion: 0, symbolCount: 0 },
|
|
8
|
-
{ id: 'comm_2', label: 'Gameplay', heuristicLabel: 'Gameplay', cohesion: 0.8, symbolCount: 9 },
|
|
9
|
-
], { minSymbolCount: 5, configuredIdPrefix: 'comm_cfg_' });
|
|
10
|
-
assert.ok(out.some((c) => c.heuristicLabel === 'Battle' && c.symbolCount === 0));
|
|
11
|
-
assert.ok(!out.some((c) => c.heuristicLabel === 'AutoTiny'));
|
|
12
|
-
assert.ok(out.some((c) => c.heuristicLabel === 'Gameplay' && c.symbolCount === 9));
|
|
13
|
-
});
|
|
14
|
-
test('aggregates same-name clusters with weighted cohesion', () => {
|
|
15
|
-
const out = aggregateClusters([
|
|
16
|
-
{ id: 'comm_1', label: 'Gameplay', heuristicLabel: 'Gameplay', cohesion: 0.5, symbolCount: 4 },
|
|
17
|
-
{ id: 'comm_2', label: 'Gameplay', heuristicLabel: 'Gameplay', cohesion: 1.0, symbolCount: 6 },
|
|
18
|
-
], { minSymbolCount: 5, configuredIdPrefix: 'comm_cfg_' });
|
|
19
|
-
assert.equal(out.length, 1);
|
|
20
|
-
assert.equal(out[0].symbolCount, 10);
|
|
21
|
-
assert.equal(Math.round(out[0].cohesion * 100), 80);
|
|
22
|
-
});
|