semantic-complexity 0.0.6-dd9be98d → 0.0.13-2aaf183b
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/__tests__/analyzers.test.d.ts +5 -0
- package/dist/__tests__/analyzers.test.d.ts.map +1 -0
- package/dist/__tests__/analyzers.test.js +357 -0
- package/dist/__tests__/analyzers.test.js.map +1 -0
- package/dist/__tests__/gate.test.d.ts +5 -0
- package/dist/__tests__/gate.test.d.ts.map +1 -0
- package/dist/__tests__/gate.test.js +140 -0
- package/dist/__tests__/gate.test.js.map +1 -0
- package/dist/analyzers/bread.d.ts +63 -0
- package/dist/analyzers/bread.d.ts.map +1 -0
- package/dist/analyzers/bread.js +415 -0
- package/dist/analyzers/bread.js.map +1 -0
- package/dist/analyzers/cheese.d.ts +111 -0
- package/dist/analyzers/cheese.d.ts.map +1 -0
- package/dist/analyzers/cheese.js +881 -0
- package/dist/analyzers/cheese.js.map +1 -0
- package/dist/analyzers/ham.d.ts +33 -0
- package/dist/analyzers/ham.d.ts.map +1 -0
- package/dist/analyzers/ham.js +264 -0
- package/dist/analyzers/ham.js.map +1 -0
- package/dist/analyzers/index.d.ts +7 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +7 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/budget/index.d.ts +50 -0
- package/dist/budget/index.d.ts.map +1 -0
- package/dist/budget/index.js +138 -0
- package/dist/budget/index.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +103 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/gate/index.d.ts +31 -0
- package/dist/gate/index.d.ts.map +1 -0
- package/dist/gate/index.js +117 -0
- package/dist/gate/index.js.map +1 -0
- package/dist/gate/waiver.d.ts +54 -0
- package/dist/gate/waiver.d.ts.map +1 -0
- package/dist/gate/waiver.js +280 -0
- package/dist/gate/waiver.js.map +1 -0
- package/dist/index.d.ts +8 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -49
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +140 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/recommend/index.d.ts +32 -0
- package/dist/recommend/index.d.ts.map +1 -0
- package/dist/recommend/index.js +169 -0
- package/dist/recommend/index.js.map +1 -0
- package/dist/simplex/index.d.ts +26 -0
- package/dist/simplex/index.d.ts.map +1 -0
- package/dist/simplex/index.js +100 -0
- package/dist/simplex/index.js.map +1 -0
- package/dist/types/index.d.ts +39 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +27 -52
- package/LICENSE +0 -21
- package/README.md +0 -72
- package/dist/ast/index.d.ts +0 -2
- package/dist/ast/index.d.ts.map +0 -1
- package/dist/ast/index.js +0 -2
- package/dist/ast/index.js.map +0 -1
- package/dist/ast/parser.d.ts +0 -27
- package/dist/ast/parser.d.ts.map +0 -1
- package/dist/ast/parser.js +0 -273
- package/dist/ast/parser.js.map +0 -1
- package/dist/canonical/convergence.d.ts +0 -56
- package/dist/canonical/convergence.d.ts.map +0 -1
- package/dist/canonical/convergence.js +0 -149
- package/dist/canonical/convergence.js.map +0 -1
- package/dist/canonical/index.d.ts +0 -11
- package/dist/canonical/index.d.ts.map +0 -1
- package/dist/canonical/index.js +0 -11
- package/dist/canonical/index.js.map +0 -1
- package/dist/canonical/profiles.d.ts +0 -40
- package/dist/canonical/profiles.d.ts.map +0 -1
- package/dist/canonical/profiles.js +0 -182
- package/dist/canonical/profiles.js.map +0 -1
- package/dist/canonical/types.d.ts +0 -124
- package/dist/canonical/types.d.ts.map +0 -1
- package/dist/canonical/types.js +0 -46
- package/dist/canonical/types.js.map +0 -1
- package/dist/compare.d.ts +0 -31
- package/dist/compare.d.ts.map +0 -1
- package/dist/compare.js +0 -354
- package/dist/compare.js.map +0 -1
- package/dist/context/index.d.ts +0 -41
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -253
- package/dist/context/index.js.map +0 -1
- package/dist/gates/delta.d.ts +0 -45
- package/dist/gates/delta.d.ts.map +0 -1
- package/dist/gates/delta.js +0 -260
- package/dist/gates/delta.js.map +0 -1
- package/dist/gates/index.d.ts +0 -9
- package/dist/gates/index.d.ts.map +0 -1
- package/dist/gates/index.js +0 -9
- package/dist/gates/index.js.map +0 -1
- package/dist/gates/types.d.ts +0 -96
- package/dist/gates/types.d.ts.map +0 -1
- package/dist/gates/types.js +0 -59
- package/dist/gates/types.js.map +0 -1
- package/dist/graph/call.d.ts +0 -63
- package/dist/graph/call.d.ts.map +0 -1
- package/dist/graph/call.js +0 -240
- package/dist/graph/call.js.map +0 -1
- package/dist/graph/dependency.d.ts +0 -52
- package/dist/graph/dependency.d.ts.map +0 -1
- package/dist/graph/dependency.js +0 -296
- package/dist/graph/dependency.js.map +0 -1
- package/dist/graph/index.d.ts +0 -3
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js +0 -3
- package/dist/graph/index.js.map +0 -1
- package/dist/metrics/cognitive.d.ts +0 -42
- package/dist/metrics/cognitive.d.ts.map +0 -1
- package/dist/metrics/cognitive.js +0 -204
- package/dist/metrics/cognitive.js.map +0 -1
- package/dist/metrics/cyclomatic.d.ts +0 -31
- package/dist/metrics/cyclomatic.d.ts.map +0 -1
- package/dist/metrics/cyclomatic.js +0 -121
- package/dist/metrics/cyclomatic.js.map +0 -1
- package/dist/metrics/dimensional.d.ts +0 -32
- package/dist/metrics/dimensional.d.ts.map +0 -1
- package/dist/metrics/dimensional.js +0 -560
- package/dist/metrics/dimensional.js.map +0 -1
- package/dist/metrics/index.d.ts +0 -26
- package/dist/metrics/index.d.ts.map +0 -1
- package/dist/metrics/index.js +0 -120
- package/dist/metrics/index.js.map +0 -1
- package/dist/metrics/meta.d.ts +0 -90
- package/dist/metrics/meta.d.ts.map +0 -1
- package/dist/metrics/meta.js +0 -144
- package/dist/metrics/meta.js.map +0 -1
- package/dist/tensor/canonical.d.ts +0 -53
- package/dist/tensor/canonical.d.ts.map +0 -1
- package/dist/tensor/canonical.js +0 -192
- package/dist/tensor/canonical.js.map +0 -1
- package/dist/tensor/index.d.ts +0 -22
- package/dist/tensor/index.d.ts.map +0 -1
- package/dist/tensor/index.js +0 -22
- package/dist/tensor/index.js.map +0 -1
- package/dist/tensor/matrix.d.ts +0 -62
- package/dist/tensor/matrix.d.ts.map +0 -1
- package/dist/tensor/matrix.js +0 -187
- package/dist/tensor/matrix.js.map +0 -1
- package/dist/tensor/scoring.d.ts +0 -82
- package/dist/tensor/scoring.d.ts.map +0 -1
- package/dist/tensor/scoring.js +0 -233
- package/dist/tensor/scoring.js.map +0 -1
- package/dist/tensor/types.d.ts +0 -186
- package/dist/tensor/types.d.ts.map +0 -1
- package/dist/tensor/types.js +0 -15
- package/dist/tensor/types.js.map +0 -1
- package/dist/types.d.ts +0 -341
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -22
- package/dist/types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* semantic-complexity
|
|
3
|
-
*
|
|
4
|
-
* Core 엔진 모듈
|
|
5
|
-
*
|
|
6
|
-
* v0.0.3 Features:
|
|
7
|
-
* - Second-order tensor: score = v^T M v + <v, w>
|
|
8
|
-
* - ε-regularization for convergence
|
|
9
|
-
* - Module-type canonical profiles
|
|
10
|
-
* - Hodge decomposition of complexity space
|
|
2
|
+
* semantic-complexity
|
|
3
|
+
* Multi-dimensional code complexity analyzer (Bread-Cheese-Ham sandwich model)
|
|
11
4
|
*/
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export type { ModuleType, ModuleTypeInfo, MetaDimensions, MetaWeights, Range, CanonicalLevel, CanonicalProfile, Vector3D, Deviation, ConvergenceResult, Snapshot, ConvergenceStatus, ConvergenceAdvice, } from './canonical/index.js';
|
|
19
|
-
export { MODULE_TYPE_INFO, DEFAULT_META_WEIGHTS, LEVEL_RANGES, CANONICAL_PROFILES, levelToRange, levelToMidpoint, getIdealMetaDimensions, getProfile, isWithinCanonicalRange, isCanonical, inferModuleType, calculateDeviation, calculateConvergenceVector, calculateConvergenceRate, analyzeConvergence, analyzeAllModuleTypes, findBestFitModuleType, getConvergenceStatus, generateConvergenceAdvice, } from './canonical/index.js';
|
|
20
|
-
export type { GateType, GateInfo, ViolationSeverity, Violation, DeltaAnalysis, DeltaThresholds, GateDecision, GateResult, GatePipelineResult, } from './gates/index.js';
|
|
21
|
-
export { GATE_RESPONSIBILITIES, GATE_INFO, DEFAULT_DELTA_THRESHOLDS, calculateDelta, calculateDeltaPercent, detectViolations, analyzeDelta, checkGate, runGatePipeline, createSnapshot, } from './gates/index.js';
|
|
22
|
-
export { calculateSecurity, calculateContext, calculateBehavior, toMetaDimensions, calculateMetaWeightedSum, normalizeMetaDimensions, metaDistance, addMetaDimensions, subtractMetaDimensions, ZERO_META, } from './metrics/meta.js';
|
|
23
|
-
export type { Vector5D, ModuleType as TensorModuleType, Matrix5x5, TensorScore, ConvergenceStatus as TensorConvergenceStatus, ConvergenceAnalysis, HodgeDecomposition, ComplexityLevel, DeviationResult, RefactoringRecommendation, CanonicalBounds, } from './tensor/index.js';
|
|
24
|
-
export { IDX_CONTROL, IDX_NESTING, IDX_STATE, IDX_ASYNC, IDX_COUPLING, DEFAULT_MATRIX, MODULE_MATRICES, DEFAULT_WEIGHTS, CANONICAL_5D_PROFILES, } from './tensor/index.js';
|
|
25
|
-
export { getInteractionMatrix, vectorToArray, arrayToVector, zeroVector, vectorNorm, dotProduct, quadraticForm, isPositiveSemidefinite, euclideanDistance, mahalanobisDistance, } from './tensor/index.js';
|
|
26
|
-
export { calculateTensorScore, calculateRawSum, calculateRawSumThreshold, convergenceScore, estimateLipschitz, analyzeConvergence as analyzeTensorConvergence, hodgeDecomposition, classifyComplexityLevel, recommendRefactoring, isSafe, needsReview, isViolation, } from './tensor/index.js';
|
|
27
|
-
export { getCanonicalProfile, getProfileCentroid, isWithinCanonicalBounds, getViolationDimensions, isOrphan, analyzeDeviation, findBestModuleType as findBestTensorModuleType, } from './tensor/index.js';
|
|
28
|
-
import type { FileAnalysisResult } from './types.js';
|
|
29
|
-
/**
|
|
30
|
-
* 파일 경로로 복잡도 분석
|
|
31
|
-
*/
|
|
32
|
-
export declare function analyzeFilePath(filePath: string): FileAnalysisResult;
|
|
33
|
-
/**
|
|
34
|
-
* 소스 코드 문자열로 복잡도 분석
|
|
35
|
-
*/
|
|
36
|
-
export declare function analyzeSource(source: string, fileName?: string): FileAnalysisResult;
|
|
5
|
+
export * from './types/index.js';
|
|
6
|
+
export * from './analyzers/index.js';
|
|
7
|
+
export * from './simplex/index.js';
|
|
8
|
+
export * from './gate/index.js';
|
|
9
|
+
export * from './budget/index.js';
|
|
10
|
+
export * from './recommend/index.js';
|
|
37
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,52 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* semantic-complexity
|
|
3
|
-
*
|
|
4
|
-
* Core 엔진 모듈
|
|
5
|
-
*
|
|
6
|
-
* v0.0.3 Features:
|
|
7
|
-
* - Second-order tensor: score = v^T M v + <v, w>
|
|
8
|
-
* - ε-regularization for convergence
|
|
9
|
-
* - Module-type canonical profiles
|
|
10
|
-
* - Hodge decomposition of complexity space
|
|
2
|
+
* semantic-complexity
|
|
3
|
+
* Multi-dimensional code complexity analyzer (Bread-Cheese-Ham sandwich model)
|
|
11
4
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
export { DependencyGraph, CallGraph, exportToDot, exportToMermaid, } from './graph/index.js';
|
|
19
|
-
// Context
|
|
20
|
-
export { ContextCollector, quickAnalyze } from './context/index.js';
|
|
21
|
-
export { MODULE_TYPE_INFO, DEFAULT_META_WEIGHTS, LEVEL_RANGES, CANONICAL_PROFILES, levelToRange, levelToMidpoint, getIdealMetaDimensions, getProfile, isWithinCanonicalRange, isCanonical, inferModuleType, calculateDeviation, calculateConvergenceVector, calculateConvergenceRate, analyzeConvergence, analyzeAllModuleTypes, findBestFitModuleType, getConvergenceStatus, generateConvergenceAdvice, } from './canonical/index.js';
|
|
22
|
-
export { GATE_RESPONSIBILITIES, GATE_INFO, DEFAULT_DELTA_THRESHOLDS, calculateDelta, calculateDeltaPercent, detectViolations, analyzeDelta, checkGate, runGatePipeline, createSnapshot, } from './gates/index.js';
|
|
23
|
-
// Meta Dimensions (v0.0.2)
|
|
24
|
-
export { calculateSecurity, calculateContext, calculateBehavior, toMetaDimensions, calculateMetaWeightedSum, normalizeMetaDimensions, metaDistance, addMetaDimensions, subtractMetaDimensions, ZERO_META, } from './metrics/meta.js';
|
|
25
|
-
// Tensor constants
|
|
26
|
-
export { IDX_CONTROL, IDX_NESTING, IDX_STATE, IDX_ASYNC, IDX_COUPLING, DEFAULT_MATRIX, MODULE_MATRICES, DEFAULT_WEIGHTS, CANONICAL_5D_PROFILES, } from './tensor/index.js';
|
|
27
|
-
// Tensor matrix operations
|
|
28
|
-
export { getInteractionMatrix, vectorToArray, arrayToVector, zeroVector, vectorNorm, dotProduct, quadraticForm, isPositiveSemidefinite, euclideanDistance, mahalanobisDistance, } from './tensor/index.js';
|
|
29
|
-
// Tensor scoring
|
|
30
|
-
export { calculateTensorScore, calculateRawSum, calculateRawSumThreshold, convergenceScore, estimateLipschitz, analyzeConvergence as analyzeTensorConvergence, hodgeDecomposition, classifyComplexityLevel, recommendRefactoring, isSafe, needsReview, isViolation, } from './tensor/index.js';
|
|
31
|
-
// Tensor canonical profiles
|
|
32
|
-
export { getCanonicalProfile, getProfileCentroid, isWithinCanonicalBounds, getViolationDimensions, isOrphan, analyzeDeviation, findBestModuleType as findBestTensorModuleType, } from './tensor/index.js';
|
|
33
|
-
// ─── Convenience Functions ───────────────────────────────────────
|
|
34
|
-
import * as fs from 'node:fs';
|
|
35
|
-
import { parseSourceFile } from './ast/index.js';
|
|
36
|
-
import { analyzeFile } from './metrics/index.js';
|
|
37
|
-
/**
|
|
38
|
-
* 파일 경로로 복잡도 분석
|
|
39
|
-
*/
|
|
40
|
-
export function analyzeFilePath(filePath) {
|
|
41
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
42
|
-
const sourceFile = parseSourceFile(filePath, content);
|
|
43
|
-
return analyzeFile(sourceFile);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* 소스 코드 문자열로 복잡도 분석
|
|
47
|
-
*/
|
|
48
|
-
export function analyzeSource(source, fileName = 'input.ts') {
|
|
49
|
-
const sourceFile = parseSourceFile(fileName, source);
|
|
50
|
-
return analyzeFile(sourceFile);
|
|
51
|
-
}
|
|
5
|
+
export * from './types/index.js';
|
|
6
|
+
export * from './analyzers/index.js';
|
|
7
|
+
export * from './simplex/index.js';
|
|
8
|
+
export * from './gate/index.js';
|
|
9
|
+
export * from './budget/index.js';
|
|
10
|
+
export * from './recommend/index.js';
|
|
52
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA+JH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1C"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* semantic-complexity MCP Server
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
6
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { readFileSync } from 'fs';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { dirname, join } from 'path';
|
|
10
|
+
import { analyzeBread } from '../analyzers/bread.js';
|
|
11
|
+
import { analyzeCheese } from '../analyzers/cheese.js';
|
|
12
|
+
import { analyzeHam } from '../analyzers/ham.js';
|
|
13
|
+
import { normalize, calculateEquilibrium } from '../simplex/index.js';
|
|
14
|
+
import { checkGate } from '../gate/index.js';
|
|
15
|
+
// package.json에서 버전 동적으로 읽기
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = dirname(__filename);
|
|
18
|
+
const packageJson = JSON.parse(readFileSync(join(__dirname, '../../package.json'), 'utf-8'));
|
|
19
|
+
const server = new Server({
|
|
20
|
+
name: 'semantic-complexity',
|
|
21
|
+
version: packageJson.version,
|
|
22
|
+
}, {
|
|
23
|
+
capabilities: {
|
|
24
|
+
tools: {},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
// List available tools
|
|
28
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
29
|
+
tools: [
|
|
30
|
+
{
|
|
31
|
+
name: 'analyze_sandwich',
|
|
32
|
+
description: 'Analyze code complexity using Bread-Cheese-Ham model',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
source: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Source code to analyze',
|
|
39
|
+
},
|
|
40
|
+
file_path: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'Optional file path for context',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
required: ['source'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'check_gate',
|
|
50
|
+
description: 'Check if code passes PoC/MVP/Production gate',
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
properties: {
|
|
54
|
+
source: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'Source code to check',
|
|
57
|
+
},
|
|
58
|
+
gate_type: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
enum: ['poc', 'mvp', 'production'],
|
|
61
|
+
description: 'Gate type (default: mvp)',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
required: ['source'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'analyze_cheese',
|
|
69
|
+
description: 'Analyze cognitive accessibility (Cheese axis)',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
properties: {
|
|
73
|
+
source: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
description: 'Source code to analyze',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
required: ['source'],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
}));
|
|
83
|
+
// Handle tool calls
|
|
84
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
85
|
+
const { name, arguments: args } = request.params;
|
|
86
|
+
switch (name) {
|
|
87
|
+
case 'analyze_sandwich': {
|
|
88
|
+
const source = args?.source;
|
|
89
|
+
const bread = analyzeBread(source);
|
|
90
|
+
const cheese = analyzeCheese(source);
|
|
91
|
+
const ham = analyzeHam(source);
|
|
92
|
+
const simplex = normalize(bread, cheese, ham);
|
|
93
|
+
const equilibrium = calculateEquilibrium(simplex);
|
|
94
|
+
return {
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: 'text',
|
|
98
|
+
text: JSON.stringify({ bread, cheese, ham, simplex, equilibrium }, null, 2),
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
case 'check_gate': {
|
|
104
|
+
const source = args?.source;
|
|
105
|
+
const gateType = args?.gate_type || 'mvp';
|
|
106
|
+
const cheese = analyzeCheese(source);
|
|
107
|
+
const ham = analyzeHam(source);
|
|
108
|
+
const result = checkGate(gateType, cheese, ham);
|
|
109
|
+
return {
|
|
110
|
+
content: [
|
|
111
|
+
{
|
|
112
|
+
type: 'text',
|
|
113
|
+
text: JSON.stringify(result, null, 2),
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
case 'analyze_cheese': {
|
|
119
|
+
const source = args?.source;
|
|
120
|
+
const cheese = analyzeCheese(source);
|
|
121
|
+
return {
|
|
122
|
+
content: [
|
|
123
|
+
{
|
|
124
|
+
type: 'text',
|
|
125
|
+
text: JSON.stringify(cheese, null, 2),
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
default:
|
|
131
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
// Start server
|
|
135
|
+
export async function main() {
|
|
136
|
+
const transport = new StdioServerTransport();
|
|
137
|
+
await server.connect(transport);
|
|
138
|
+
}
|
|
139
|
+
main().catch(console.error);
|
|
140
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,4BAA4B;AAC5B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAC7D,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;I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AM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAED,KAAK,gBAAgB,CAAC,CAAC,CAAC;YACtB,MAAM,MAAM,GAAG,IAAI,EAAE,MAAgB,CAAC;YACtC,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;YAErC,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,eAAe;AACf,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gradient-based Recommender
|
|
3
|
+
*
|
|
4
|
+
* 균형점으로 향하는 리팩토링 권장사항 생성
|
|
5
|
+
*/
|
|
6
|
+
import type { CheeseResult } from '../analyzers/cheese.js';
|
|
7
|
+
import type { SimplexCoordinates, EquilibriumResult } from '../types/index.js';
|
|
8
|
+
export type Axis = 'bread' | 'cheese' | 'ham';
|
|
9
|
+
export interface Recommendation {
|
|
10
|
+
axis: Axis;
|
|
11
|
+
priority: number;
|
|
12
|
+
action: string;
|
|
13
|
+
reason: string;
|
|
14
|
+
expectedImpact: Record<string, number>;
|
|
15
|
+
targetEquilibrium: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type Severity = 'none' | 'mild' | 'moderate' | 'severe';
|
|
18
|
+
export interface DegradationResult {
|
|
19
|
+
degraded: boolean;
|
|
20
|
+
severity: Severity;
|
|
21
|
+
indicators: string[];
|
|
22
|
+
beforeAccessible: boolean;
|
|
23
|
+
afterAccessible: boolean;
|
|
24
|
+
deltaNesting: number;
|
|
25
|
+
deltaHiddenDeps: number;
|
|
26
|
+
deltaViolations: number;
|
|
27
|
+
}
|
|
28
|
+
export declare const CHEESE_ANTI_PATTERNS: string[][];
|
|
29
|
+
export declare function suggestRefactor(simplex: SimplexCoordinates, equilibrium: EquilibriumResult, cheeseResult?: CheeseResult, maxRecommendations?: number): Recommendation[];
|
|
30
|
+
export declare function getPriorityAction(simplex: SimplexCoordinates, equilibrium: EquilibriumResult, cheeseResult?: CheeseResult): Recommendation | null;
|
|
31
|
+
export declare function checkDegradation(before: CheeseResult, after: CheeseResult): DegradationResult;
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recommend/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAM/E,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAgCD,eAAO,MAAM,oBAAoB,YAKhC,CAAC;AAuBF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,iBAAiB,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,kBAAkB,SAAI,GACrB,cAAc,EAAE,CAsDlB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,iBAAiB,EAC9B,YAAY,CAAC,EAAE,YAAY,GAC1B,cAAc,GAAG,IAAI,CAGvB;AAMD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,YAAY,GAClB,iBAAiB,CA0DnB"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gradient-based Recommender
|
|
3
|
+
*
|
|
4
|
+
* 균형점으로 향하는 리팩토링 권장사항 생성
|
|
5
|
+
*/
|
|
6
|
+
// =============================================================
|
|
7
|
+
// Refactoring Actions by Axis
|
|
8
|
+
// =============================================================
|
|
9
|
+
const BREAD_ACTIONS = {
|
|
10
|
+
increase: [
|
|
11
|
+
['Add explicit trust boundary', 'Define trust boundary in code explicitly'],
|
|
12
|
+
['Apply auth decorators', 'Add @Auth, @Protected decorators to endpoints'],
|
|
13
|
+
['Add input validation', 'Add validation for external inputs'],
|
|
14
|
+
],
|
|
15
|
+
decrease: [
|
|
16
|
+
['Separate security logic', 'Extract security logic from business logic'],
|
|
17
|
+
['Extract common security middleware', 'Move repeated security patterns to middleware'],
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
const CHEESE_ACTIONS = {
|
|
21
|
+
increase: [
|
|
22
|
+
['Add proper error handling', 'Add exception handling for edge cases'],
|
|
23
|
+
],
|
|
24
|
+
decrease: [
|
|
25
|
+
['Flatten nesting (early return)', 'Use early return to reduce nesting depth'],
|
|
26
|
+
['Extract function', 'Extract complex blocks to separate functions (no param bundling)'],
|
|
27
|
+
['Simplify conditions', 'Extract complex conditions to named variables'],
|
|
28
|
+
['Separate state logic', 'Split state×async×retry into separate concerns'],
|
|
29
|
+
['Switch → polymorphism', 'Replace switch with Strategy pattern'],
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
// 🚫 Anti-patterns (LLM should not use these)
|
|
33
|
+
export const CHEESE_ANTI_PATTERNS = [
|
|
34
|
+
['No rest parameters abuse', '...args to hide parameter count is a complexity evasion trick'],
|
|
35
|
+
['No config object bundling', 'Do not bundle unrelated params into config objects'],
|
|
36
|
+
['No tuple/dict params', 'params: any[] or options: object hides meaning'],
|
|
37
|
+
['No inline substitution', 'Do not replace named variables with inline expressions'],
|
|
38
|
+
];
|
|
39
|
+
const HAM_ACTIONS = {
|
|
40
|
+
increase: [
|
|
41
|
+
['Add golden tests', 'Write golden tests for critical paths'],
|
|
42
|
+
['Add contract tests', 'Write API contract tests'],
|
|
43
|
+
['Organize test fixtures', 'Structure test code better'],
|
|
44
|
+
],
|
|
45
|
+
decrease: [
|
|
46
|
+
['Remove duplicate tests', 'Clean up unnecessary test duplication'],
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
const AXIS_ACTIONS = {
|
|
50
|
+
bread: BREAD_ACTIONS,
|
|
51
|
+
cheese: CHEESE_ACTIONS,
|
|
52
|
+
ham: HAM_ACTIONS,
|
|
53
|
+
};
|
|
54
|
+
// =============================================================
|
|
55
|
+
// Recommender
|
|
56
|
+
// =============================================================
|
|
57
|
+
export function suggestRefactor(simplex, equilibrium, cheeseResult, maxRecommendations = 3) {
|
|
58
|
+
const recommendations = [];
|
|
59
|
+
// If in equilibrium, no recommendations needed
|
|
60
|
+
if (equilibrium.inEquilibrium) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
// state×async×retry violation is highest priority
|
|
64
|
+
if (cheeseResult?.stateAsyncRetry.violated) {
|
|
65
|
+
recommendations.push({
|
|
66
|
+
axis: 'cheese',
|
|
67
|
+
priority: 0,
|
|
68
|
+
action: 'Separate state×async×retry',
|
|
69
|
+
reason: `Cognitive invariant violation - ${cheeseResult.stateAsyncRetry.axes.join('×')} must be separated`,
|
|
70
|
+
expectedImpact: { cheese: -20 },
|
|
71
|
+
targetEquilibrium: true,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
// Generate recommendations based on dominant axis
|
|
75
|
+
const { bread, cheese, ham } = simplex;
|
|
76
|
+
const ideal = 1 / 3;
|
|
77
|
+
const deviations = [
|
|
78
|
+
{ axis: 'bread', deviation: bread - ideal, direction: bread > ideal ? 'decrease' : 'increase' },
|
|
79
|
+
{ axis: 'cheese', deviation: cheese - ideal, direction: cheese > ideal ? 'decrease' : 'increase' },
|
|
80
|
+
{ axis: 'ham', deviation: ham - ideal, direction: ham > ideal ? 'decrease' : 'increase' },
|
|
81
|
+
];
|
|
82
|
+
// Sort by absolute deviation (largest first)
|
|
83
|
+
deviations.sort((a, b) => Math.abs(b.deviation) - Math.abs(a.deviation));
|
|
84
|
+
let priority = recommendations.length + 1;
|
|
85
|
+
for (const { axis, deviation, direction } of deviations) {
|
|
86
|
+
if (recommendations.length >= maxRecommendations)
|
|
87
|
+
break;
|
|
88
|
+
if (Math.abs(deviation) < 0.1)
|
|
89
|
+
continue; // Skip small deviations
|
|
90
|
+
const actions = AXIS_ACTIONS[axis][direction];
|
|
91
|
+
if (actions && actions.length > 0) {
|
|
92
|
+
const [action, reason] = actions[0];
|
|
93
|
+
recommendations.push({
|
|
94
|
+
axis,
|
|
95
|
+
priority,
|
|
96
|
+
action,
|
|
97
|
+
reason,
|
|
98
|
+
expectedImpact: { [axis]: direction === 'decrease' ? -Math.abs(deviation) * 100 : Math.abs(deviation) * 100 },
|
|
99
|
+
targetEquilibrium: true,
|
|
100
|
+
});
|
|
101
|
+
priority++;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return recommendations;
|
|
105
|
+
}
|
|
106
|
+
export function getPriorityAction(simplex, equilibrium, cheeseResult) {
|
|
107
|
+
const recommendations = suggestRefactor(simplex, equilibrium, cheeseResult, 1);
|
|
108
|
+
return recommendations[0] || null;
|
|
109
|
+
}
|
|
110
|
+
// =============================================================
|
|
111
|
+
// Degradation Detection
|
|
112
|
+
// =============================================================
|
|
113
|
+
export function checkDegradation(before, after) {
|
|
114
|
+
const indicators = [];
|
|
115
|
+
// 1. Accessibility state transition
|
|
116
|
+
const accessibilityLost = before.accessible && !after.accessible;
|
|
117
|
+
if (accessibilityLost) {
|
|
118
|
+
indicators.push('Accessibility lost (accessible: true → false)');
|
|
119
|
+
}
|
|
120
|
+
// 2. Nesting depth increase
|
|
121
|
+
const deltaNesting = after.maxNesting - before.maxNesting;
|
|
122
|
+
if (deltaNesting > 0) {
|
|
123
|
+
indicators.push(`Nesting depth increased: +${deltaNesting} (${before.maxNesting} → ${after.maxNesting})`);
|
|
124
|
+
}
|
|
125
|
+
// 3. Hidden dependencies increase
|
|
126
|
+
const deltaHiddenDeps = after.hiddenDependencies - before.hiddenDependencies;
|
|
127
|
+
if (deltaHiddenDeps > 0) {
|
|
128
|
+
indicators.push(`Hidden dependencies increased: +${deltaHiddenDeps}`);
|
|
129
|
+
}
|
|
130
|
+
// 4. state×async×retry violation introduced
|
|
131
|
+
const sarBefore = before.stateAsyncRetry.violated;
|
|
132
|
+
const sarAfter = after.stateAsyncRetry.violated;
|
|
133
|
+
if (!sarBefore && sarAfter) {
|
|
134
|
+
indicators.push(`state×async×retry violation introduced: ${after.stateAsyncRetry.axes.join(' × ')}`);
|
|
135
|
+
}
|
|
136
|
+
// 5. Violations increase
|
|
137
|
+
const deltaViolations = after.violations.length - before.violations.length;
|
|
138
|
+
if (deltaViolations > 0) {
|
|
139
|
+
indicators.push(`Violations increased: +${deltaViolations}`);
|
|
140
|
+
}
|
|
141
|
+
// Severity determination
|
|
142
|
+
let severity;
|
|
143
|
+
if (indicators.length === 0) {
|
|
144
|
+
severity = 'none';
|
|
145
|
+
}
|
|
146
|
+
else if (accessibilityLost) {
|
|
147
|
+
severity = 'severe';
|
|
148
|
+
}
|
|
149
|
+
else if (indicators.length >= 3) {
|
|
150
|
+
severity = 'severe';
|
|
151
|
+
}
|
|
152
|
+
else if (indicators.length >= 2) {
|
|
153
|
+
severity = 'moderate';
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
severity = 'mild';
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
degraded: indicators.length > 0,
|
|
160
|
+
severity,
|
|
161
|
+
indicators,
|
|
162
|
+
beforeAccessible: before.accessible,
|
|
163
|
+
afterAccessible: after.accessible,
|
|
164
|
+
deltaNesting,
|
|
165
|
+
deltaHiddenDeps,
|
|
166
|
+
deltaViolations,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recommend/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiCH,gEAAgE;AAChE,8BAA8B;AAC9B,gEAAgE;AAEhE,MAAM,aAAa,GAAG;IACpB,QAAQ,EAAE;QACR,CAAC,6BAA6B,EAAE,0CAA0C,CAAC;QAC3E,CAAC,uBAAuB,EAAE,+CAA+C,CAAC;QAC1E,CAAC,sBAAsB,EAAE,oCAAoC,CAAC;KAC/D;IACD,QAAQ,EAAE;QACR,CAAC,yBAAyB,EAAE,4CAA4C,CAAC;QACzE,CAAC,oCAAoC,EAAE,+CAA+C,CAAC;KACxF;CACF,CAAC;AAEF,MA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AAkB,CAAC;IACvB,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,QAAQ,GAAG,MAAM,CAAC;IACpB,CAAC;SAAM,IAAI,iBAAiB,EAAE,CAAC;QAC7B,QAAQ,GAAG,QAAQ,CAAC;IACtB,CAAC;SAAM,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAClC,QAAQ,GAAG,QAAQ,CAAC;IACtB,CAAC;SAAM,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAClC,QAAQ,GAAG,UAAU,CAAC;IACxB,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,MAAM,CAAC;IACpB,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC;QAC/B,QAAQ;QACR,UAAU;QACV,gBAAgB,EAAE,MAAM,CAAC,UAAU;QACnC,eAAe,EAAE,KAAK,CAAC,UAAU;QACjC,YAAY;QACZ,eAAe;QACf,eAAe;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplex - Normalization & Equilibrium
|
|
3
|
+
*
|
|
4
|
+
* Normalizes Bread, Cheese, Ham scores to simplex coordinates
|
|
5
|
+
* and calculates equilibrium state.
|
|
6
|
+
*/
|
|
7
|
+
import type { BreadResult } from '../analyzers/bread.js';
|
|
8
|
+
import type { CheeseResult } from '../analyzers/cheese.js';
|
|
9
|
+
import type { HamResult } from '../analyzers/ham.js';
|
|
10
|
+
import type { SimplexCoordinates, EquilibriumResult } from '../types/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Normalize scores to simplex coordinates (sum = 1)
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalize(bread: BreadResult, cheese: CheeseResult, ham: HamResult): SimplexCoordinates;
|
|
15
|
+
/**
|
|
16
|
+
* Calculate equilibrium state
|
|
17
|
+
*/
|
|
18
|
+
export declare function calculateEquilibrium(simplex: SimplexCoordinates): EquilibriumResult;
|
|
19
|
+
/**
|
|
20
|
+
* Get label based on dominant axis
|
|
21
|
+
*/
|
|
22
|
+
export declare function getLabel(simplex: SimplexCoordinates): {
|
|
23
|
+
label: 'bread' | 'cheese' | 'ham' | 'balanced';
|
|
24
|
+
confidence: number;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simplex/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE/E;;GAEG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,SAAS,GACb,kBAAkB,CAiBpB;AA4CD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,kBAAkB,GAC1B,iBAAiB,CA0BnB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG;IACrD,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAC;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB,CAWA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplex - Normalization & Equilibrium
|
|
3
|
+
*
|
|
4
|
+
* Normalizes Bread, Cheese, Ham scores to simplex coordinates
|
|
5
|
+
* and calculates equilibrium state.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Normalize scores to simplex coordinates (sum = 1)
|
|
9
|
+
*/
|
|
10
|
+
export function normalize(bread, cheese, ham) {
|
|
11
|
+
// Convert to raw scores (0-1 range, higher = more issues)
|
|
12
|
+
const breadRaw = calculateBreadRaw(bread);
|
|
13
|
+
const cheeseRaw = calculateCheeseRaw(cheese);
|
|
14
|
+
const hamRaw = calculateHamRaw(ham);
|
|
15
|
+
const total = breadRaw + cheeseRaw + hamRaw;
|
|
16
|
+
if (total === 0) {
|
|
17
|
+
return { bread: 1 / 3, cheese: 1 / 3, ham: 1 / 3 };
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
bread: breadRaw / total,
|
|
21
|
+
cheese: cheeseRaw / total,
|
|
22
|
+
ham: hamRaw / total,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function calculateBreadRaw(bread) {
|
|
26
|
+
let score = 0;
|
|
27
|
+
// Trust boundary
|
|
28
|
+
if (bread.trustBoundaryCount === 0)
|
|
29
|
+
score += 0.3;
|
|
30
|
+
// Auth explicitness
|
|
31
|
+
score += (1 - bread.authExplicitness) * 0.2;
|
|
32
|
+
// Secrets
|
|
33
|
+
const highSecrets = bread.secretPatterns.filter(s => s.severity === 'high').length;
|
|
34
|
+
score += Math.min(highSecrets * 0.15, 0.3);
|
|
35
|
+
// Hidden deps
|
|
36
|
+
score += Math.min(bread.hiddenDeps.total * 0.02, 0.2);
|
|
37
|
+
return Math.min(score, 1.0);
|
|
38
|
+
}
|
|
39
|
+
function calculateCheeseRaw(cheese) {
|
|
40
|
+
let score = 0;
|
|
41
|
+
// Nesting depth (normalized to 0-1, threshold = 4)
|
|
42
|
+
score += Math.min(cheese.maxNesting / 10, 0.3);
|
|
43
|
+
// State×Async×Retry violation
|
|
44
|
+
if (cheese.stateAsyncRetry.violated)
|
|
45
|
+
score += 0.3;
|
|
46
|
+
// Accessibility
|
|
47
|
+
if (!cheese.accessible)
|
|
48
|
+
score += 0.3;
|
|
49
|
+
// Additional violations
|
|
50
|
+
score += Math.min(cheese.violations.length * 0.05, 0.1);
|
|
51
|
+
return Math.min(score, 1.0);
|
|
52
|
+
}
|
|
53
|
+
function calculateHamRaw(ham) {
|
|
54
|
+
// Inverse of coverage (1.0 coverage = 0 raw score)
|
|
55
|
+
return 1 - ham.goldenTestCoverage;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Calculate equilibrium state
|
|
59
|
+
*/
|
|
60
|
+
export function calculateEquilibrium(simplex) {
|
|
61
|
+
const { bread, cheese, ham } = simplex;
|
|
62
|
+
const ideal = 1 / 3;
|
|
63
|
+
// Energy = sum of squared deviations from ideal
|
|
64
|
+
const energy = Math.pow(bread - ideal, 2) +
|
|
65
|
+
Math.pow(cheese - ideal, 2) +
|
|
66
|
+
Math.pow(ham - ideal, 2);
|
|
67
|
+
// Find dominant axis (if any)
|
|
68
|
+
const max = Math.max(bread, cheese, ham);
|
|
69
|
+
const threshold = 0.5; // Dominant if > 50%
|
|
70
|
+
let dominantAxis = null;
|
|
71
|
+
if (max > threshold) {
|
|
72
|
+
if (bread === max)
|
|
73
|
+
dominantAxis = 'bread';
|
|
74
|
+
else if (cheese === max)
|
|
75
|
+
dominantAxis = 'cheese';
|
|
76
|
+
else
|
|
77
|
+
dominantAxis = 'ham';
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
inEquilibrium: energy < 0.1,
|
|
81
|
+
energy,
|
|
82
|
+
dominantAxis,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get label based on dominant axis
|
|
87
|
+
*/
|
|
88
|
+
export function getLabel(simplex) {
|
|
89
|
+
const { bread, cheese, ham } = simplex;
|
|
90
|
+
const max = Math.max(bread, cheese, ham);
|
|
91
|
+
if (max < 0.4) {
|
|
92
|
+
return { label: 'balanced', confidence: 1 - max * 2 };
|
|
93
|
+
}
|
|
94
|
+
if (bread === max)
|
|
95
|
+
return { label: 'bread', confidence: bread };
|
|
96
|
+
if (cheese === max)
|
|
97
|
+
return { label: 'cheese', confidence: cheese };
|
|
98
|
+
return { label: 'ham', confidence: ham };
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simplex/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,MAAM,UAAU,SAAS,CACvB,KAAkB,EAClB,MAAoB,EACpB,GAAc;IAEd,0DAA0D;IAC1D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAEpC,MAAM,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAE5C,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;IACrD,CAAC;IAED,OAAO;QACL,KAAK,EAAE,QAAQ,GAAG,KAAK;QACvB,MAAM,EAAE,SAAS,GAAG,KAAK;QACzB,GAAG,EAAE,MAAM,GAAG,KAAK;KACpB,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAkB;IAC3C,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,iBAAiB;IACjB,IAAI,KAAK,CAAC,kBAAkB,KAAK,CAAC;QAAE,KAAK,IAAI,GAAG,CAAC;IAEjD,oBAAoB;IACpB,KAAK,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC;IAE5C,UAAU;IACV,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QA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