import type { DiscoveryLifecycle, DiscoveryLifecycleStatus, RuntimeState } from './types.js'; /** * Lifecycle state for captured discoveries. * * Being backed by evidence and being currently authoritative are different * properties. A fact whose evidence still resolves can have been replaced by a * later observation, so the two are tracked separately: provenance answers * "what was this based on", lifecycle answers "does it still stand". * * Phase 1 only ever changes status. Nothing here deletes an item, guesses that * one fact replaces another, or asks a model to decide. */ export type DiscoveryLifecycleFailure = 'unknown-item' | 'not-a-discovery' | 'same-item' | 'already-retired' | 'already-superseded' | 'target-not-active'; export type DiscoveryLifecycleResult = { readonly ok: true; } | { readonly ok: false; readonly failure: DiscoveryLifecycleFailure; /** The id the failure is about, so a caller can name it accurately. */ readonly subject: string; }; export declare function createDiscoveryLifecycle(status?: DiscoveryLifecycleStatus): DiscoveryLifecycle; export declare function copyDiscoveryLifecycle(lifecycle: DiscoveryLifecycle): DiscoveryLifecycle; /** * The status of a discovery item. A discovery with no lifecycle record is * treated as active: that is how state persisted before schema v5 restores, * and an absent record must never silently withhold recovery. */ export declare function discoveryStatus(state: RuntimeState, itemId: string): DiscoveryLifecycleStatus; /** * Whether recovery may re-inject an item. Only discoveries can be held back, * and only once someone explicitly retired or superseded them; manual and * extracted items are never filtered here. */ export declare function isRecoverableItem(state: RuntimeState, itemId: string): boolean; /** Marks a discovery as no longer authoritative, without deleting anything. */ export declare function retireDiscovery(state: RuntimeState, itemId: string): DiscoveryLifecycleResult; /** * Records that one discovery replaced another. The replacement has to be an * active discovery itself, so a superseded chain cannot point at something * that no longer stands. */ export declare function supersedeDiscovery(state: RuntimeState, itemId: string, supersededBy: string): DiscoveryLifecycleResult; //# sourceMappingURL=discovery-lifecycle.d.ts.map