export const RECTIFICATION_CASE_STATUSES = [ "draft", "collecting_evidence", "candidate_ready", "candidate_accepted", "needs_rebaseline", "paused", "confirmed", "closed", "abandoned", "superseded", ] as const; export type RectificationCaseStatus = (typeof RECTIFICATION_CASE_STATUSES)[number]; /** Statuses that may be resumed by the user. */ export const RESUMABLE_CASE_STATUSES: readonly RectificationCaseStatus[] = [ "draft", "collecting_evidence", "candidate_ready", "candidate_accepted", "needs_rebaseline", "paused", ]; /** Statuses that only allow read-only history access. */ export const TERMINAL_CASE_STATUSES: readonly RectificationCaseStatus[] = [ "confirmed", "closed", "abandoned", "superseded", ]; export type OpenRectificationDisposition = "created" | "resumed" | "readonly"; /** Wire shape. Status stays a string so cached and older payloads still parse. */ export type OpenRectificationCaseResponseWire = Readonly<{ disposition: OpenRectificationDisposition; caseId: string; sessionId: string; status: string; shouldStartOpening: boolean; skillVersion: string; }>; export type OpenRectificationCaseResponse = Omit & { readonly status: RectificationCaseStatus; }; type LatestResumableWire = Readonly<{ caseId: string; status: string; lastActivityAt: string; }>; type LatestTerminalWire = Readonly<{ caseId: string; status: string; hasUsableTime: boolean; }>; export type RectificationEntrySummaryWire = Readonly<{ hasResumableCase: boolean; hasTerminalCaseWithTime: boolean; latestResumable: LatestResumableWire | null; latestTerminal: LatestTerminalWire | null; }>; export type RectificationEntrySummary = Readonly<{ hasResumableCase: boolean; hasTerminalCaseWithTime: boolean; latestResumable: (Omit & { readonly status: RectificationCaseStatus; }) | null; latestTerminal: (Omit & { readonly status: RectificationCaseStatus; }) | null; }>;