/** * Cancellation and terminal-adoption transitions for the durable remote task * ledger (WFT-25) — rows 7-10 of the project brief's "Conditional transition * contract" table. Split out of `task-ledger-transitions.ts` purely to keep * both files under this repository's file-size ceiling; re-exported from * `task-ledger-transitions.ts` so callers have one import surface. See that * module's doc comment for the shared design notes (pure, storage-agnostic, * `expectedValue` bytes are the caller's responsibility). * * @module server/task-ledger-transitions-cancellation */ import { type TaskLedgerPreconditionResult, type TaskLedgerTransitionResult } from './task-ledger-transition-helpers.ts'; import type { RemoteTaskCancelling, RemoteTaskRecord, RemoteTaskTerminal, RemoteTaskTerminalCancelled } from './task-ledger-types.ts'; export type RecordCancellationIntentInput = Readonly<{ expectedGeneration: number; expectedAttempt: number; cancellationReason: string; /** Unique per cancellation request; fences queued-origin terminal incarnations. */ cancellationToken: string; }>; export declare function recordCancellationIntent(current: RemoteTaskRecord | null, input: RecordCancellationIntentInput, now: number): TaskLedgerTransitionResult; export type CommitCancellationInput = Readonly<{ attemptToken: string; }>; export declare function commitCancellation(current: RemoteTaskRecord | null, input: CommitCancellationInput, now: number): TaskLedgerTransitionResult; export type MarkWorkflowResultAdoptedInput = Readonly<{ expectedResultDigest: string; }>; export declare function markWorkflowResultAdopted(current: RemoteTaskRecord | null, input: MarkWorkflowResultAdoptedInput, now: number): TaskLedgerTransitionResult; export type DeleteRetainedTerminalTaskInput = Readonly<{ expectedRetentionGeneration: number; }>; export declare function canDeleteRetainedTerminalTask(current: RemoteTaskRecord | null, input: DeleteRetainedTerminalTaskInput): TaskLedgerPreconditionResult;