报告创建请求、校正入口和同名类型改从 contracts 推导;同义的对象判断与 sha256 改走共享函数。调用处用 import 别名保留原名,使 diff 低于 1500 行。行为、哈希和状态字符串不变。 Co-Authored-By: Grok (agent loop)
79 lines
2.1 KiB
TypeScript
79 lines
2.1 KiB
TypeScript
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<OpenRectificationCaseResponseWire, "status"> & {
|
|
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<LatestResumableWire, "status"> & {
|
|
readonly status: RectificationCaseStatus;
|
|
}) | null;
|
|
latestTerminal: (Omit<LatestTerminalWire, "status"> & {
|
|
readonly status: RectificationCaseStatus;
|
|
}) | null;
|
|
}>;
|