import type { SynthEvent, CanonicalState } from "../types/index.js"; import { type NormalizationNotice } from "./historical-normalizer.js"; import { type IdentityRegistry } from "./identity-resolver.js"; import { type ReferenceResolutionNotice } from "./reference-resolver.js"; import type { HistoricalAliasRegistry } from "./historical-aliases.js"; export type CanonicalStateBuildReport = { /** Events after normalization and reference resolution */ normalizedEvents: SynthEvent[]; /** Identity registry used for reference resolution */ identityRegistry: IdentityRegistry; /** All normalization notices */ normalizationNotices: NormalizationNotice[]; /** All reference-resolution notices */ referenceNotices: ReferenceResolutionNotice[]; /** Unresolved reference errors that prevent canonical state derivation */ unresolvedReferences: ReferenceResolutionNotice[]; }; export type CanonicalStateBuildResult = { success: true; state: CanonicalState; report: CanonicalStateBuildReport; } | { success: false; state: CanonicalState; report: CanonicalStateBuildReport; diagnostic: string; }; /** * Build canonical state from a raw event stream. * * The pipeline is deterministic and side-effect free: * 1. Normalize historical duplicates. * 2. Resolve canonical identities. * 3. Resolve parent references (with recovery heuristics). * 4. Replay the derived stream into canonical state. * * An optional historical alias registry lets the pipeline interpret known * legacy duplicate identities and parent-reference aliases without mutating * the event log. */ export declare function buildCanonicalState(events: SynthEvent[], aliasRegistry?: HistoricalAliasRegistry): CanonicalStateBuildResult;