function architecturalTradeOff() {
    const options = [
        {
            name: 'Monolithic implementation',
            pros: ['Simpler to develop', 'Faster initial delivery', 'Easier to debug'],
            cons: ['Harder to scale', 'Tightly coupled components', 'Difficult to maintain long-term'],
            riskIfChosen: 'Technical debt accumulates, refactoring will be costly later',
            riskIfNotChosen: 'Over-engineering for current scope',
            estimatedCostDelta: -8,
        },
        {
            name: 'Modular implementation',
            pros: ['Better separation of concerns', 'Easier to test in isolation', 'Scalable by design'],
            cons: ['Higher upfront complexity', 'More files and boilerplate', 'Steeper learning curve'],
            riskIfChosen: 'Over-engineering if scope does not expand',
            riskIfNotChosen: 'Hard to scale or refactor once monolithic approach is established',
            estimatedCostDelta: 8,
        },
    ];
    return {
        id: 'TO-1',
        description: 'Monolithic vs modular implementation approach',
        options,
        chosenOption: '',
        rationale: '',
    };
}
function incrementalPrTradeOff() {
    const options = [
        {
            name: 'Single large PR',
            pros: ['All changes in one review', 'No partial states in main branch'],
            cons: ['Large PR harder to review', 'Higher merge conflict risk', 'Blocks other work longer'],
            riskIfChosen: 'Reviewers miss issues due to PR fatigue',
            riskIfNotChosen: 'Parallel work may depend on partial changes',
            estimatedCostDelta: -4,
        },
        {
            name: 'Incremental PRs',
            pros: ['Smaller, reviewable chunks', 'Earlier feedback', 'Reduces merge conflicts'],
            cons: ['More coordination overhead', 'Partial features may be live temporarily'],
            riskIfChosen: 'Partial states may cause confusion without feature flags',
            riskIfNotChosen: 'Large PR increases review errors',
            estimatedCostDelta: 4,
        },
    ];
    return {
        id: 'TO-2',
        description: 'Single PR vs incremental PRs for large changeset',
        options,
        chosenOption: '',
        rationale: '',
    };
}
function performanceTradeOff() {
    const options = [
        {
            name: 'Optimize now',
            pros: ['Performance built-in from the start', 'Avoids costly rewrites later'],
            cons: ['Premature optimization risk', 'Adds complexity before problems are confirmed'],
            riskIfChosen: 'Optimizing the wrong bottleneck without profiling data',
            riskIfNotChosen: 'Performance issues at scale require expensive retrofitting',
            estimatedCostDelta: 12,
        },
        {
            name: 'Defer optimization',
            pros: ['Faster initial delivery', 'Optimize based on real profiling data'],
            cons: ['May need rework later', 'Performance issues may reach production'],
            riskIfChosen: 'Technical debt if optimization is never prioritized',
            riskIfNotChosen: 'Early optimization may be unnecessary',
            estimatedCostDelta: -12,
        },
    ];
    return {
        id: 'TO-3',
        description: 'Optimize now vs defer optimization',
        options,
        chosenOption: '',
        rationale: '',
    };
}
function dependencyTradeOff() {
    const options = [
        {
            name: 'Use external dependency',
            pros: ['Faster delivery', 'Battle-tested solution', 'Community support'],
            cons: ['Version lock-in risk', 'Security surface increases', 'License constraints possible'],
            riskIfChosen: 'Dependency may be abandoned or introduce breaking changes',
            riskIfNotChosen: 'Custom solution may lack features or have bugs',
            estimatedCostDelta: -16,
        },
        {
            name: 'Custom implementation',
            pros: ['Full control', 'No external lock-in', 'Tailored to exact needs'],
            cons: ['High development cost', 'Maintenance burden', 'Re-inventing the wheel risk'],
            riskIfChosen: 'Under-resourced maintenance leads to accumulating bugs',
            riskIfNotChosen: 'Dependency risks (abandonment, licensing) remain',
            estimatedCostDelta: 16,
        },
    ];
    return {
        id: 'TO-4',
        description: 'External dependency vs custom implementation',
        options,
        chosenOption: '',
        rationale: '',
    };
}
/**
 * Detect applicable trade-offs based on spec context patterns.
 */
export function detectTradeOffs(ctx) {
    const tradeoffs = [];
    if (ctx.scope === 'architectural') {
        tradeoffs.push(architecturalTradeOff());
    }
    if (ctx.fileCount > 8) {
        tradeoffs.push(incrementalPrTradeOff());
    }
    if (ctx.tags.includes('performance')) {
        tradeoffs.push(performanceTradeOff());
    }
    if (ctx.dependencyCount > 5) {
        tradeoffs.push(dependencyTradeOff());
    }
    return tradeoffs;
}
//# sourceMappingURL=tradeoff-detector.js.map