import type { SynthEvent } from "../types/index.js"; /** Report schema version carried by every attribution report. */ export declare const REPLAY_ATTRIBUTION_VERSION = 1; /** A reference to one event in the log. */ export type AttributedEventRef = { /** Zero-based position in the log. */ index: number; id: string; type: string; timestamp: number; }; /** Per-aggregate attribution: which events wrote this state-field entry. */ export type AggregateAttribution = { /** Canonical state field, e.g. "missions". */ projection: string; aggregateId: string; /** First creation event; null when the aggregate only received writes. */ createdBy: AttributedEventRef | null; /** Last event that wrote the aggregate; null only for empty traces. */ lastWrittenBy: AttributedEventRef | null; /** Total contributing events (creation counts as the first write). */ writeCount: number; }; /** Rollup of attribution over one state field. */ export type ProjectionAttribution = { projection: string; aggregates: number; writes: number; }; /** Structured result of an attribution trace. */ export type ReplayAttributionReport = { kind: "replay-attribution-report"; version: 1; eventCount: number; /** Events that wrote at least one state-field aggregate. */ attributedEvents: number; /** Events with no state-field effect (genesis, policy, unknown types). */ unattributedEvents: number; projections: ProjectionAttribution[]; attribution: AggregateAttribution[]; }; /** * Trace an event log and attribute every state-field aggregate to the * events that wrote it. Deterministic for a given log: aggregates are * ordered by first contributing event, projections in canonical order. */ export declare function attributeReplay(events: SynthEvent[]): ReplayAttributionReport;