export declare const BACKLOG_DRAIN_CAPABILITY = "sortie_enable_backlog_drain"; export type FastLaneDenialCode = "TURN_STATE_REQUIRED" | "ROLE_FORBIDDEN" | "WORKER_LIMIT" | "WORKER_RESUME_INVALID" | "SCOUT_GAP_REQUIRED" | "REVIEW_EVIDENCE_REQUIRED" | "REVIEW_PHASE_INVALID" | "REVIEW_LIMIT" | "ADVISOR_TRIGGER_REQUIRED" | "ADVISOR_LIMIT" | "CONSULTATION_RETRY_INVALID" | "CONSULTATION_RETRY_UNAUTHORIZED" | "CONSULTATION_RETRY_MISMATCH" | "BACKLOG_DRAIN_INVALID" | "BACKLOG_DRAIN_TOO_LATE" | "MANUAL_COMPACTION_FORBIDDEN"; export declare class FastLaneDeniedError extends Error { readonly code: FastLaneDenialCode; constructor(code: FastLaneDenialCode); } export interface WorkerAccounting { readonly totalWorkerDispatches: number; readonly workerDispatches: number; readonly workerInFlight: boolean; readonly workerResumeUsed: boolean; readonly workerResumeSessionID?: string; readonly workerResumeTaskID?: string; readonly workerTaskID?: string; } export interface FastLaneToolOptions { readonly readonlyDiagnosisAuthorized?: boolean; readonly consultationFallbackAuthorized?: boolean; readonly parallelWorkerAlreadyBound?: boolean; readonly parallelWorkerAuthorized?: boolean; } export declare class FastLaneController { private readonly sessions; hasReviewLineage(sessionID: string, prompt: string): boolean; restoreReviewLineage(sessionID: string, requestedPrompt: string, completedHostPrompts: readonly string[]): void; private setSession; beginTurn(sessionID: string, synthetic: boolean, authorizedSynthetic?: boolean): void; forget(sessionID: string): void; manualCompactionForbidden(sessionID: string): boolean; terminalInstructionRequired(sessionID: string): boolean; backlogDrainEnabled(sessionID: string): boolean; backlogContinuationAllowed(sessionID: string): boolean; enableBacklogDrain(sessionID: string, maxUnits: number): void; /** A fresh root-approved operator grant adds capacity without erasing earlier spend. */ grantSerialUnits(sessionID: string, remainingUnits: number): void; enableParallelDispatch(sessionID: string, maxWorkers: number, dispatched: number, running?: number, totalTasks?: number): void; advanceParallelWave(sessionID: string, maxWorkers: number, dispatched: number, running: number, totalTasks: number): void; continuationQueued(sessionID: string): void; authorizeRecoverableWorkerResume(sessionID: string, taskID: string, childSessionID: string): boolean; /** * A turn that never dispatched a worker holds no live accounting to validate against. Durable * operator state, not process-local dispatch memory, authorizes continuations in such a turn. */ workerAccountingCold(sessionID: string): boolean; /** Rehydrate one host-validation-only continuation from durable operator state. */ authorizeRepairValidationRetry(sessionID: string, taskID: string, childSessionID: string): boolean; workerCompleted(sessionID: string): void; /** Snapshot worker accounting so a later denial in the same dispatch cannot leak the slot. */ snapshotWorkerAccounting(sessionID: string): WorkerAccounting | undefined; restoreWorkerAccounting(sessionID: string, snapshot: WorkerAccounting | undefined): void; beforeTool(sessionID: string, tool: string, args: unknown, options?: FastLaneToolOptions): string | undefined; }