const defaultEntries = [ { task: 'JWT Authentication Implementation', error: 'Token expiration not validated on server side', root_cause: 'Missing expiration check in middleware', fix: 'Added exp claim validation in auth middleware', prevention_rule: 'IF using JWT THEN validate expiration config BECAUSE misconfiguration causes auth issues', success_score: 0.85, tags: ['auth', 'jwt', 'security'], }, { task: 'Database Migration', error: 'Data loss during column rename', root_cause: 'Direct column rename without backup', fix: 'Added backup step and incremental migration', prevention_rule: 'IF modifying schema THEN create backup first BECAUSE direct changes can cause data loss', success_score: 0.72, tags: ['database', 'migration', 'data'], }, { task: 'API Rate Limiting', error: 'Legitimate users blocked', root_cause: 'Rate limit too aggressive for normal usage', fix: 'Adjusted limits based on traffic analysis', prevention_rule: 'IF implementing rate limits THEN analyze traffic patterns first BECAUSE aggressive limits block valid users', success_score: 0.91, tags: ['api', 'rate-limiting', 'performance'], }, ]; function ScoreBar({ score }) { const percentage = Math.round(score * 100); const color = score >= 0.8 ? 'bg-green-500' : score >= 0.6 ? 'bg-yellow-500' : 'bg-red-500'; return (
Self-learning system with past experiences and extracted rules