import type { EscalationRule } from './types';

export const lowConfidenceRule: EscalationRule = {
  id: 'low-confidence',
  label: 'ביטחון נמוך',
  description: 'הסוכן אינו בטוח מספיק בתשובה',
  async check(ctx) {
    if (ctx.confidence >= ctx.definition.aiConfidenceThreshold) return null;
    return {
      ruleId: 'low-confidence',
      reason: `ביטחון ${ctx.confidence.toFixed(2)} מתחת לסף ${ctx.definition.aiConfidenceThreshold}`,
      severity: 'high',
    };
  },
};
