/** Common host-side lifecycle contract. Never derive these controls from model state. */ export declare const DECISION_LIFECYCLE_VERSION: "decision-lifecycle/v1"; export declare const DECISION_LIFECYCLE_SURFACES: readonly ["state", "receipt", "trace", "debug-sidecar", "cache", "job", "review", "calibration", "evaluation", "export", "preprocessing-lineage"]; export type DecisionLifecycleSurface = typeof DECISION_LIFECYCLE_SURFACES[number]; export interface DecisionLifecycleRule { classification: 'public' | 'internal' | 'confidential' | 'restricted'; accessScopes: string[]; retentionMs: number; export: 'denied' | 'sanitized'; deletion: 'erase' | 'tombstone'; backup: 'not-persisted' | 'expire-with-primary'; } export interface DecisionLifecyclePolicy { version: typeof DECISION_LIFECYCLE_VERSION; surfaces: Record; } export interface DecisionLifecycleReference { surface: DecisionLifecycleSurface; opaqueId: string; } export interface DecisionLifecycleHold { subject: string; reason: string; scope: DecisionLifecycleSurface[]; expiresAt: number; authorizedBy: string; } export interface DecisionLifecycleTombstone { subject: string; reference: DecisionLifecycleReference; deletedAt: number; } export interface DecisionLifecycleStore { /** Erase body, keys and identifiers; retain only the opaque reference in a tombstone. */ erase(reference: DecisionLifecycleReference): Promise; /** Store a tombstone that backup restores cannot overwrite. */ tombstone(value: DecisionLifecycleTombstone): Promise; /** Reverse references are discovered by the host, never by model-visible state. */ links(subject: string): Promise; holds(subject: string): Promise; recordHold(hold: DecisionLifecycleHold): Promise; releaseHold(hold: DecisionLifecycleHold, actor: string, reason: string, at: number): Promise; } export declare function validateDecisionLifecyclePolicy(policy: DecisionLifecyclePolicy): void; /** Hold requires an independent authorization decision and finite expiry. */ export declare function placeDecisionLifecycleHold(hold: DecisionLifecycleHold, authorize: (hold: DecisionLifecycleHold) => Promise, store: DecisionLifecycleStore, now: number): Promise; export declare function releaseDecisionLifecycleHold(hold: DecisionLifecycleHold, actor: string, reason: string, authorize: (hold: DecisionLifecycleHold, actor: string) => Promise, store: DecisionLifecycleStore, now: number): Promise; /** Cascading erasure runs only after the host resolves linked records. No body is returned. */ export declare function eraseDecisionSubject(subject: string, policy: DecisionLifecyclePolicy, store: DecisionLifecycleStore, now: number): Promise; /** A restored backup cannot make erased content queryable. */ export declare function mayRestoreDecisionReference(reference: DecisionLifecycleReference, createdAt: number, now: number, policy: DecisionLifecyclePolicy, tombstones: ReadonlyArray): boolean; /** Host-resolved state of a cross-surface reference. A deleted target is an explicit tombstone, never a dangling link. */ export type DecisionLifecycleReferenceState = { state: 'linked'; reference: DecisionLifecycleReference; } | { state: 'tombstoned'; reference: DecisionLifecycleReference; deletedAt: number; } | { state: 'unknown'; reference: DecisionLifecycleReference; }; /** One backed-up surface record. The body stays in the host's surface backup; only the opaque reference is listed here. */ export interface DecisionLifecycleBackupEntry { subject: string; reference: DecisionLifecycleReference; createdAt: number; } export type DecisionLifecycleRestoreRefusal = 'invalid' | 'tombstoned' | 'expired' | 'not-persisted' | 'restore-unavailable'; export interface DecisionLifecycleRestoreReport { restored: DecisionLifecycleBackupEntry[]; refused: Array<{ entry: DecisionLifecycleBackupEntry; reason: DecisionLifecycleRestoreRefusal; }>; } /** * Subject-level restore across lifecycle surfaces. Each entry is checked against tombstones, * the surface backup rule and primary retention before its host restore handler runs, so a * backup taken before erasure cannot make erased or expired content queryable again. */ export declare function restoreDecisionSubjectBackup(backup: ReadonlyArray, policy: DecisionLifecyclePolicy, tombstones: ReadonlyArray, restore: Partial Promise>>, now: number): Promise; //# sourceMappingURL=lifecycle.d.ts.map