// tools/challenge-spec/scenarios-scale.ts — Traffic spike and data growth scenarios
import { contentMentions } from './scenarios-utils.js';
export function generateScaleScenarios(spec, content, _knowledge) {
    const scenarios = [];
    const lower = content.toLowerCase();
    // High traffic
    scenarios.push({
        scenario: 'Traffic spike: 10x normal load',
        probability: spec.scope === 'architectural' ? 'medium' : 'low',
        impact: 'high',
        currentHandling: contentMentions(lower, ['cache', 'cdn', 'queue', 'scale', 'auto-scale'])
            ? 'Some scaling strategy mentioned'
            : 'Not addressed',
        requiredHandling: 'Implement caching (Redis/CDN). Use connection pooling. Consider auto-scaling. Load test before launch.',
        dataConsistency: 'Ensure cache invalidation strategy. Handle stale reads gracefully.',
        userExperience: 'Graceful degradation: serve cached content, queue non-critical operations.',
    });
    // Data growth
    if (lower.includes('database') ||
        lower.includes('table') ||
        lower.includes('query') ||
        lower.includes('list') ||
        lower.includes('search')) {
        scenarios.push({
            scenario: 'Database grows to millions of rows, queries slow down',
            probability: 'medium',
            impact: 'medium',
            currentHandling: contentMentions(lower, ['index', 'pagination', 'cursor', 'partition'])
                ? 'Some query optimization mentioned'
                : 'Not addressed',
            requiredHandling: 'Add database indexes on query columns. Use cursor-based pagination. Consider archiving old data.',
            dataConsistency: 'Indexes must be maintained. Monitor query plans.',
            userExperience: 'Consistent response times through pagination. No full-table scans.',
        });
    }
    return scenarios;
}
//# sourceMappingURL=scenarios-scale.js.map