/**
 * Observation Reducer Engine for Enhanced Reducer Engine (FU-056)
 *
 * Deterministic snapshot computation from observations with merge strategies.
 */
import { type ObservationSourceRankValue } from "../services/schema_registry.js";
export interface Observation {
    id: string;
    entity_id: string;
    entity_type: string;
    schema_version: string;
    source_id: string;
    observed_at: string;
    specificity_score: number | null;
    source_priority: number;
    /**
     * Kind of write (sensor / llm_summary / workflow_state / human /
     * import). Used as a tie-break after numeric `source_priority`.
     * Null / undefined for legacy rows written before the field existed;
     * those rank last within their `source_priority` bucket.
     */
    observation_source?: ObservationSourceRankValue | null;
    fields: Record<string, unknown>;
    created_at: string;
    user_id: string;
}
export interface EntitySnapshot {
    entity_id: string;
    entity_type: string;
    schema_version: string;
    snapshot: Record<string, unknown>;
    computed_at: string;
    observation_count: number;
    last_observation_at: string;
    provenance: Record<string, string>;
    user_id: string;
}
export declare class ObservationReducer {
    /**
     * Compute snapshot from observations
     *
     * Returns null if entity is deleted (has deletion observation with _deleted: true).
     */
    computeSnapshot(entityId: string, observations: Observation[]): Promise<EntitySnapshot | null>;
    /**
     * Sort observations deterministically
     */
    private sortObservations;
    /**
     * Apply merge strategy to field
     *
     * Applies converters from the active schema to ensure snapshot values
     * conform to the schema type, even if observations have old types.
     */
    private applyMergeStrategy;
    /**
     * Last Write Wins strategy
     */
    private lastWriteWins;
    /**
     * Highest Priority strategy
     */
    private highestPriority;
    /**
     * Most Specific strategy
     */
    private mostSpecific;
    /**
     * Merge Array strategy
     *
     * Note: For merge_array strategy, converters are applied to individual
     * array elements if fieldDef is provided. However, since merge_array
     * combines values from multiple observations, we apply converters to
     * each value before adding to the set.
     */
    private mergeArray;
    /**
     * Compute snapshot with default merge policies (when no schema exists)
     *
     * Returns null if entity is deleted.
     */
    private computeSnapshotWithDefaults;
}
export declare const observationReducer: ObservationReducer;
//# sourceMappingURL=observation_reducer.d.ts.map