import type { ReviewSessionEvent } from "../review-resource.js"; import { type ReviewQueueSessionState } from "./review-queue-session.js"; export type ReviewSessionReplayIssueCode = "invalid-sequence" | "duplicate-sequence" | "non-contiguous-sequence" | "unknown-active-item" | "unknown-review-item" | "unknown-candidate" | "missing-review-item" | "invalid-workbench-decision" | "decision-candidate-mismatch" | "invalid-conflict-selection" | "decision-status-mismatch" | "decision-resolution-mismatch" | "missing-resolution-reason" | "edited-value-not-editable" | "edited-value-type-mismatch" | "session-conditions-mismatch"; export interface ReviewSessionReplayIssue { readonly code: ReviewSessionReplayIssueCode; readonly eventName: string; readonly sequence: number; readonly reviewItemName?: string; readonly candidateId?: string; readonly message: string; } export declare function validateReviewSessionEventsForSnapshot(snapshot: ReviewQueueSessionState, events: readonly ReviewSessionEvent[]): ReviewSessionReplayIssue[]; /** * A ReviewSessionEvent whose `data.workbenchEditedValue` was rewritten from * legacy editor text to its descriptor-typed value during replay (see * checkEditedValueForItem). Not an error: the apply result still succeeds, and * the warning lets a consumer see that a saved session was normalized. */ export type ReviewSessionReplayWarning = { readonly code: "edited-value-converted-from-text"; readonly eventName: string; readonly sequence: number; readonly reviewItemName: string; readonly originalValue: string; readonly convertedValue: unknown; readonly message: string; } | { /** * An edit that would be refused (see checkEditedValueForItem) on a * decision event that a later decision for the same item superseded. It * never reaches effectiveValue, so it does not fail the session. */ readonly code: "superseded-edited-value-refused"; readonly eventName: string; readonly sequence: number; readonly reviewItemName: string; readonly refusedCode: "edited-value-not-editable" | "edited-value-type-mismatch"; readonly editedValue: unknown; readonly message: string; } | { /** * The session's items came from an extraction import, but the apply * boundary was not given the import record to check them against (see * `DeriveServerReviewSessionApplyResultOptions.extractionImport`). Emitted * by the server apply boundary, never by replay itself. */ readonly code: "unverified-extraction-queue"; readonly itemNames: readonly string[]; readonly message: string; }; /** * Lists the legacy text edits replay converts to typed values, and refused * edits that a later decision superseded. Call it only on an event stream that * validateReviewSessionEventsForSnapshot accepted. */ export declare function reviewSessionReplayWarningsForSnapshot(snapshot: ReviewQueueSessionState, events: readonly ReviewSessionEvent[]): ReviewSessionReplayWarning[];