import type { KernelPaths, TaskActivity, TaskHealth, TaskRecord } from "./types.js"; export declare const WORKER_STATE_PAYLOAD_KEYS: readonly ["next_task", "task_id", "from_activity", "from_health", "to_activity", "to_health", "from_pending_verification", "requested_pending_verification", "to_pending_verification", "pane_id", "session_id", "launch_operation_id", "expected_version", "source_digest", "launch_identity_digest"]; export declare function assertLegalWorkerTransition(fromActivity: TaskActivity, toActivity: TaskActivity, fromHealth: TaskHealth, toHealth: TaskHealth): void; export interface ExactWorkerStateTransition { readonly operation_id: string; readonly digest: string; readonly before: TaskRecord; readonly next: TaskRecord; readonly from_activity: TaskActivity; readonly to_activity: TaskActivity; readonly from_health: TaskHealth; readonly to_health: TaskHealth; readonly from_pending_verification: boolean; readonly requested_pending_verification: boolean; readonly to_pending_verification: boolean; readonly expected_version: number; } /** * Exact outer key set + full next_task + preceding projection continuity. * Does not perform later-lineage/current-projection checks (dispatch adds those). */ export declare function parseExactWorkerStateTransition(paths: KernelPaths, runId: string, record: { readonly operation_id: string; readonly kind: string; readonly payload: Readonly>; }, expected: { readonly taskId: string; readonly paneId: string; readonly sessionId: string; readonly launchOperationId: string; readonly sourceDigest: string; readonly launchIdentityDigest: string; /** When set, require exact requested_pending_verification. */ readonly requestedPending?: boolean; /** When set, require exact target activity/health. */ readonly activity?: TaskActivity; readonly health?: TaskHealth; /** When set, require exact expected_version (CAS before version). */ readonly expectedVersion?: number; }): ExactWorkerStateTransition; /** * Live-basis pending: exact full TaskRecord equality (7A.3B.2 §1). * Direct-load by formula; never catch-and-continue scan. */ export declare function resolveExactPendingResultTransition(paths: KernelPaths, runId: string, bindTask: TaskRecord): { readonly operation_id: string; readonly digest: string; readonly next: TaskRecord; }; /** * Binding-basis pending: sealed authority fields + exact digest (7A.3B.2 §1). * Does not fabricate timestamps or a synthetic full TaskRecord. */ export declare function resolveExactPendingResultTransitionFromSealed(paths: KernelPaths, runId: string, sealed: { readonly run_id: string; readonly task_id: string; readonly task_version: number; readonly attempt: number; readonly max_attempts: number; readonly activity: TaskActivity; readonly health: TaskHealth; readonly source_digest: string; readonly source_snapshot: Readonly>; readonly worktree_id: string; readonly worktree_path: string; readonly base_commit: string; readonly engine: "claude" | "codex"; readonly model: string; readonly advice_operation_id: string; readonly lineage_operation_id: string | null; readonly lineage_digest: string | null; readonly pane_id: string; readonly provider_session_id: string; readonly launch_operation_id: string; readonly launch_identity_digest: string; readonly policy_digest: string; readonly capability_evidence_digest: string; readonly pending_result_operation_id: string; readonly pending_result_digest: string; }): { readonly operation_id: string; readonly digest: string; readonly next: TaskRecord; }; /** Dispatch later-lineage reconstruction (shared with parser / launch predecessor). */ export declare function reconstructTaskLineage(paths: KernelPaths, runId: string, taskId: string, workerOpId: string, options?: { /** * When false, the target operation may omit next_task (launch failure). * Default true for worker_state / launch-success consumers. */ readonly requireTargetNext?: boolean; }): { before: TaskRecord | null; next: TaskRecord | null; later: TaskRecord[]; }; /** * Immediately preceding exact task projection before a journal operation. * Reuses ordered lineage reconstruction — not a second scanner (7A.3B.4 §1). */ export declare function exactPredecessorTaskBeforeOperation(paths: KernelPaths, runId: string, taskId: string, operationId: string): TaskRecord; /** Version/attempt/created_at continuity between predecessor and launch next_task. */ export declare function assertLaunchNextTaskContinuity(predecessor: TaskRecord, next: TaskRecord): void;