import type { SynthEvent, CanonicalState } from "../types/index.js"; import type { HistoricalAliasRegistry } from "./historical-aliases.js"; export declare function createEmptyState(): CanonicalState; export declare function applyEvent(state: CanonicalState, event: SynthEvent): CanonicalState; export declare function rebuildState(events: SynthEvent[]): CanonicalState; export declare function rebuildStateFromOffset(events: SynthEvent[], startOffset?: number): CanonicalState; export declare function computeStateHash(state: CanonicalState): string; export declare function statesEqual(a: CanonicalState, b: CanonicalState): boolean; /** A single graph-integrity violation found in an event log or replayed state. */ export type AggregateGraphViolation = { kind: "malformed-creation" | "duplicate-creation" | "missing-parent-reference" | "broken-parent-reference" | "cycle" | "orphan-aggregate" | "broken-navigation"; message: string; aggregateKind: "mission" | "expedition" | "objective"; aggregateId: string; parentId?: string; }; export type AggregateGraphNode = { id: string; kind: "mission" | "expedition" | "objective"; parentId?: string; /** Event id of the canonical creation event, when known. */ eventId?: string; }; export declare function creationPayload(event: SynthEvent, key: string): { id?: unknown; missionId?: unknown; expeditionId?: unknown; } | undefined; export declare const CREATION_EVENTS: Array<{ eventType: string; payloadKey: string; kind: AggregateGraphNode["kind"]; parentKey?: "missionId" | "expeditionId"; parentKind?: AggregateGraphNode["kind"]; }>; export declare function validateAggregateGraph(events: SynthEvent[], state?: CanonicalState, aliasRegistry?: HistoricalAliasRegistry): AggregateGraphViolation[];