import { type SeatCheckpoint } from "@cotal-ai/workspace"; export interface SeatAdmission { readonly name: string; /** The directory this checkpoint was read from, so a consumer of the captured bytes does not * rebuild the path the gates already resolved. */ readonly directory: string; readonly checkpoint: SeatCheckpoint; /** The generation this destination claimed. Always the recorded one plus one. */ readonly generation: number; /** Set when gate 3 admitted a checkpoint past its horizon under explicit operator consent. */ readonly staleOverrideAgeMs?: number; } export interface AdmitSeatsOptions { /** The destination workspace root, where the claimed generation is persisted. */ readonly root: string; /** The directory the cut wrote, holding one subdirectory per seat. */ readonly checkpointDir: string; readonly space: string; /** Principals the destination believes are live, so gate 2 can refuse adopting one. */ readonly liveLifecycleUids: ReadonlySet; /** This destination's current profile revision for a seat, by name. Returning undefined means * the destination has no revision to compare, which gate 2 treats as nothing to refuse rather * than as a match. */ readonly currentProfileConfigSha256?: (name: string) => string | undefined; /** `--accept-stale-checkpoint`. Consent for gate 3 only; gate 2 has no override. */ readonly acceptStale?: boolean; /** The caller's own admissibility condition, run over the seat names the cut actually wrote, * before any gate and before any generation is claimed. It throws to refuse the whole set. */ readonly requireCovered?: (checkpointedNames: readonly string[]) => void; /** Run once, after every gate has passed over every checkpoint and before a single generation is * claimed. This is where the destination consumes the captured bytes: a refusal here must cost * nothing, and it does, because no claim has been made and no process has started. It throws to * refuse the whole set. */ readonly beforeCustody?: (admitted: readonly SeatAdmission[]) => void; readonly now?: number; } /** * Admit every checkpoint the cut wrote and take custody of each seat. * * Three phases, and the order is the point. Coverage is settled first, from the directory listing * alone, so a caller's own condition (a retained seat with no checkpoint) refuses before a single * byte is digested. Then all three gates run over every checkpoint, collecting admissions and * claiming nothing. Only when the whole set has passed does custody advance. * * Claiming inside the gate loop made a refusal expensive: a later seat's refusal left an earlier * seat's generation already taken by exclusive create, so the retry that was supposed to cost * nothing lost that claim and could never make it again. A failure anywhere now leaves every * generation unclaimed. */ export declare function admitSeatCheckpoints(options: AdmitSeatsOptions): SeatAdmission[]; //# sourceMappingURL=seat-admission.d.ts.map