import type { AuditVerdict, DriftSeverity } from '../../services/audit/types'; export interface SeverityVisual { icon: string; color: 'red' | 'yellow' | 'green' | 'gray'; label: string; } export const SEVERITY_VISUALS: Record = { blocked: { icon: '×', color: 'red', label: 'BLOCKED' }, // Deliberately NOT green and NOT gray. An unmeasured check is not a pass and // is not a reminder — it is a hole in what celilo knows. unmeasured: { icon: '?', color: 'yellow', label: 'UNMEASURED' }, drift: { icon: '▲', color: 'yellow', label: 'DRIFT' }, todo: { icon: '➤', color: 'gray', label: 'TODO' }, }; export const VERDICT_VISUALS: Record = { BLOCKED: { icon: '×', color: 'red', label: 'BLOCKED' }, UNKNOWN: { icon: '?', color: 'yellow', label: 'UNKNOWN' }, DRIFT: { icon: '▲', color: 'yellow', label: 'DRIFT' }, READY: { icon: '✓', color: 'green', label: 'READY' }, }; // Lower rank = higher priority (sorts first when listing). todo is // the lowest priority — operators can scan past them when triaging // what actually needs attention. export function severityRank(s: DriftSeverity): number { if (s === 'blocked') return 0; // Above drift, for the same reason UNKNOWN outranks DRIFT: you cannot act on // a diff you are not sure you have. if (s === 'unmeasured') return 1; if (s === 'drift') return 2; return 3; // todo }