function buildChosenApproach(ctx) {
    return `${ctx.type} implementation with ${ctx.scope} scope for ${ctx.language}${ctx.framework ? ` using ${ctx.framework}` : ''}`;
}
function buildAdvantages(ctx) {
    const advantages = [
        'Follows SDD methodology with full traceability from spec to implementation',
        'Acceptance criteria defined upfront reduce rework',
    ];
    if (ctx.framework !== null) {
        advantages.push(`Leverages ${ctx.framework} ecosystem and conventions`);
    }
    if (ctx.scope === 'trivial' || ctx.scope === 'feature') {
        advantages.push('Contained scope minimizes regression risk');
    }
    if (ctx.difficulty <= 2) {
        advantages.push('Low difficulty allows rapid delivery and early feedback');
    }
    if (ctx.tags.includes('performance')) {
        advantages.push('Performance considerations integrated into design from the start');
    }
    return advantages;
}
function buildDisadvantages(ctx) {
    const disadvantages = [];
    if (ctx.difficulty >= 4) {
        disadvantages.push('High complexity requires senior engineering involvement');
    }
    if (ctx.scope === 'architectural') {
        disadvantages.push('Architectural changes require broad team coordination and extended review');
    }
    if (ctx.scope === 'cross-module') {
        disadvantages.push('Cross-module changes increase regression testing surface');
    }
    if (ctx.framework === null) {
        disadvantages.push('Absence of a defined framework increases design decisions needed');
    }
    if (ctx.dependencyCount > 5) {
        disadvantages.push('High dependency count increases coordination and upgrade overhead');
    }
    if (disadvantages.length === 0) {
        disadvantages.push('Standard trade-offs apply for this scope and complexity level');
    }
    return disadvantages;
}
function buildLimitations(ctx) {
    const limitations = [
        'Does not cover runtime performance testing unless explicitly scoped',
        'Spec does not address infrastructure provisioning unless tagged as infra',
    ];
    if (!ctx.tags.includes('security')) {
        limitations.push('Security audit is out of scope for this spec');
    }
    if (ctx.type !== 'docs') {
        limitations.push('Documentation updates are tracked separately');
    }
    return limitations;
}
function buildFutureConsiderations(ctx) {
    const considerations = [
        'Monitor metrics post-deployment to validate estimates',
        'Revisit approach if scope expands significantly',
    ];
    if (ctx.scope === 'feature') {
        considerations.push('Consider extracting reusable patterns for future specs');
    }
    if (ctx.difficulty >= 3) {
        considerations.push('Document lessons learned for estimation calibration');
    }
    if (ctx.tags.includes('migration')) {
        considerations.push('Plan rollback strategy before migration execution');
    }
    return considerations;
}
/**
 * Generate an approach analysis for a spec context.
 */
export function analyzeApproach(ctx) {
    return {
        chosenApproach: buildChosenApproach(ctx),
        advantages: buildAdvantages(ctx),
        disadvantages: buildDisadvantages(ctx),
        limitations: buildLimitations(ctx),
        futureConsiderations: buildFutureConsiderations(ctx),
    };
}
//# sourceMappingURL=approach-analyzer.js.map