// engine/paradigm-advisor/tables.ts — Recommendation and migration tables (SPEC-035b)
/** Minimum confidence to surface recommendations (avoids false positives). */
export const MIN_CONFIDENCE_FOR_RECOMMENDATIONS = 0.6;
/** Minimum confidence to surface drift warnings. */
export const MIN_CONFIDENCE_FOR_DRIFT = 0.5;
/**
 * Keywords in spec content that indicate OOP usage.
 */
export const OOP_KEYWORDS = ['class ', 'new ', 'this.', 'extends ', 'implements '];
/**
 * Keywords in spec content that indicate FP usage.
 */
export const FP_KEYWORDS = ['pure function', 'immutable', 'lambda', 'map(', 'reduce(', 'filter('];
export const RECOMMENDATIONS_BY_PARADIGM = {
    functional: [
        {
            type: 'functional',
            message: 'Use pure functions and immutability to avoid unintended side effects.',
            alternatives: ['Consider persistent data structures (Immer, Immutable.js)'],
            urgency: 'medium',
        },
        {
            type: 'functional',
            message: 'Prefer composable transformations over mutating state in place.',
            alternatives: ['Use function composition with pipe/compose utilities'],
            urgency: 'low',
        },
        {
            type: 'functional',
            message: 'Consider property-based tests to verify function correctness at scale.',
            alternatives: ['fast-check for TypeScript', 'Hypothesis for Python'],
            urgency: 'low',
        },
    ],
    'pure-functional': [
        {
            type: 'pure-functional',
            message: 'Use pure functions and immutability to avoid unintended side effects.',
            alternatives: ['Consider persistent data structures (Immer, Immutable.js)'],
            urgency: 'medium',
        },
        {
            type: 'pure-functional',
            message: 'Isolate all side effects in a thin I/O boundary (IO monad pattern).',
            alternatives: ['fp-ts Effect type', 'Purify-ts IO'],
            urgency: 'high',
        },
        {
            type: 'pure-functional',
            message: 'Property-based tests are essential for pure functions — use them widely.',
            alternatives: ['fast-check', 'Hypothesis', 'QuickCheck'],
            urgency: 'medium',
        },
    ],
    oop: [
        {
            type: 'oop',
            message: 'Apply SOLID principles — especially Single Responsibility and Dependency Inversion.',
            alternatives: ['Consider hexagonal architecture for clear port/adapter separation'],
            urgency: 'medium',
        },
        {
            type: 'oop',
            message: 'Define clear interfaces before implementations to avoid tight coupling.',
            alternatives: ['Program to an interface, not an implementation (GoF principle)'],
            urgency: 'medium',
        },
        {
            type: 'oop',
            message: 'Use dependency injection to make components testable in isolation.',
            alternatives: ['InversifyJS', 'tsyringe', 'manual constructor injection'],
            urgency: 'low',
        },
    ],
    reactive: [
        {
            type: 'reactive',
            message: 'Model all state as event streams — avoid imperative mutations.',
            alternatives: ['RxJS', 'xstate for statecharts', 'Signals (Angular/Solid)'],
            urgency: 'high',
        },
        {
            type: 'reactive',
            message: 'Handle backpressure explicitly to prevent memory leaks under load.',
            alternatives: ['throttleTime', 'debounceTime', 'buffer operators in RxJS'],
            urgency: 'high',
        },
        {
            type: 'reactive',
            message: 'Use Observable patterns for async coordination instead of callbacks.',
            alternatives: ['switchMap over nested subscriptions', 'mergeMap for concurrent ops'],
            urgency: 'medium',
        },
    ],
    procedural: [
        {
            type: 'procedural',
            message: 'Organize code with modules to prevent global state pollution.',
            alternatives: ['ES modules', 'Python packages', 'Go packages'],
            urgency: 'medium',
        },
        {
            type: 'procedural',
            message: 'Consider incremental refactoring toward functional style for better testability.',
            alternatives: ['Extract pure functions from stateful procedures first'],
            urgency: 'low',
        },
        {
            type: 'procedural',
            message: 'Keep functions small (< 30 lines) with a single clear purpose.',
            alternatives: ['Extract helper functions', 'Use early returns to reduce nesting'],
            urgency: 'low',
        },
    ],
};
export const GENERIC_RECOMMENDATIONS = [
    {
        type: 'unknown',
        message: 'No dominant paradigm detected — consider establishing clear architectural guidelines.',
        alternatives: ['Choose one paradigm and document it in your CLAUDE.md or ADR'],
        urgency: 'medium',
    },
];
export const MIGRATION_PHASES = {
    'functional->oop': [
        'Identify stateful operations hidden inside closures',
        'Extract classes from closure-based modules',
        'Define interfaces for each new class boundary',
        'Replace function composition with method chains where appropriate',
        'Rewrite unit tests using class mocking patterns',
    ],
    'pure-functional->oop': [
        'Identify stateful operations hidden inside closures',
        'Extract classes from closure-based modules',
        'Define interfaces for each new class boundary',
        'Replace function composition with method chains where appropriate',
        'Rewrite unit tests using class mocking patterns',
    ],
    'oop->functional': [
        'Identify pure functions already embedded in methods',
        'Extract state transformations out of mutable objects',
        'Remove mutations — replace setters with returning new values',
        'Add property-based tests to verify function correctness',
        'Reduce class hierarchy depth — prefer composition over inheritance',
    ],
    'oop->pure-functional': [
        'Identify pure functions already embedded in methods',
        'Extract state transformations out of mutable objects',
        'Remove mutations — replace setters with returning new values',
        'Isolate all side effects in an IO boundary layer',
        'Add property-based tests to verify function correctness',
    ],
};
export const MIGRATION_RISKS = {
    'functional->oop': [
        'Team may find OOP boilerplate increases cognitive load',
        'Composition patterns from FP may not map cleanly to class hierarchies',
        'Test suite will need significant rewrites',
    ],
    'pure-functional->oop': [
        'Team may find OOP boilerplate increases cognitive load',
        'Loss of type-level purity guarantees',
        'Test suite will need significant rewrites',
    ],
    'oop->functional': [
        'Existing framework integrations may rely on class instances',
        'Serialization/deserialization libraries often expect class instances',
        'Incremental migration creates a long "mixed paradigm" period',
    ],
    'oop->pure-functional': [
        'Existing framework integrations may rely on class instances',
        'Stricter purity rules require significant architecture changes',
        'Learning curve for functional patterns is steep',
    ],
};
//# sourceMappingURL=tables.js.map