import type { CardMessage, ChannelRemovalAttempt, ChannelRemovalStep, ObservedCardStep, RegistryIdentity } from "./team-channel-removal.js"; import type { AgentRemovalStep, AgentRetirementObservation } from "./team-agent-removal.js"; /** Reconciliation of an unsettled removal intent: pure classification of each original member from * its journal and one native observation. A settlement records only what the native state proves. * It never authorizes a delete or a stop. A member whose submission has no confirmed outcome stays * unknown unless the observation rules out every outcome but one. A member that was never * submitted is reported unattempted and is not continued in this phase. */ export type CardSettlement = { ordinal: number; name: string; createdRevision: number; state: "settled"; step: Extract; } | { ordinal: number; name: string; createdRevision: number; state: "record"; record: ObservedCardStep; } | { ordinal: number; name: string; createdRevision: number; state: "unknown"; reason: "created-revision-still-current" | "intent-has-no-registry-binding"; } | { ordinal: number; name: string; createdRevision: number; state: "unattempted"; } | { ordinal: number; name: string; createdRevision: number; state: "contradiction"; reason: string; }; /** The registry the observation came from must be the stream the intent's deletes were issued to. */ export declare function sameRegistry(intent: ChannelRemovalAttempt, observed: RegistryIdentity): boolean; /** Classify one original card. `message` is the card key's last message, read between two reads of * `registry` that named the same stream incarnation; `registry` is the later of the two. */ export declare function classifyCard(intent: ChannelRemovalAttempt, steps: readonly ChannelRemovalStep[], ordinal: number, message: CardMessage | undefined, registry: RegistryIdentity | undefined): CardSettlement; /** The receipt row for a settled card, or null when the card does not count as removed. */ export declare function removedCard(settlement: CardSettlement): { name: string; createdRevision: number; outcome: "deleted" | "absent" | "observed-removed"; markerRevision: number | null; } | null; /** One original incarnation's row from the pinned manager's exact-name `slots` read. */ export interface SlotRow { name: string; owner: string; actor: string; slotLifecycleUid: string; slotPhase: string; cleanupComplete?: boolean; slotRevision: number; headState?: string; headLifecycleUid?: string; headRevision?: number; live: boolean; managerInstanceId: string; } export interface OriginalAgent { name: string; id: string; lifecycleUid: string; } export type AgentSettlement = { ordinal: number; agent: OriginalAgent; state: "settled"; } | { ordinal: number; agent: OriginalAgent; state: "record"; requestId: string; observation: AgentRetirementObservation; } | { ordinal: number; agent: OriginalAgent; state: "in-progress"; slotPhase: string; headState: string | null; } | { ordinal: number; agent: OriginalAgent; state: "unknown"; reason: "original-incarnation-still-live" | "original-slot-active-without-live-process" | "retired-without-cleanup-proof" | "alias-names-a-successor"; } | { ordinal: number; agent: OriginalAgent; state: "unattempted"; } | { ordinal: number; agent: OriginalAgent; state: "contradiction"; reason: string; }; /** Classify one original incarnation from its journal and the pinned manager's slot row. * `slot` is the exact-name row (`includeRetired`), or undefined when the bounded read returned no * row for that name. Process presence never settles anything; only the durable retired slot and * head of the original lifecycle UID, with cleanup complete, do. */ export declare function classifyAgent(input: { ordinal: number; agent: OriginalAgent; owner: string; manager: string; managerEpoch: number; steps: readonly AgentRemovalStep[]; deploymentId: string; slot: SlotRow | undefined; observedAt: string; }): AgentSettlement; //# sourceMappingURL=team-removal-reconcile.d.ts.map