/** * Replay one entity's declared lifecycle over a scope's outbox (#1744) — the process map's * data, with no new write path. * * A transition is a status write inside an operation body, and the kernel never recorded * "entity X moved from A to B". It did record everything a replay needs: every event names * its entity, and (#1243) the operation that emitted it — which is exactly what a declared * edge is keyed by. So one entity's events, in order, give its state sequence, and the gaps * between moves give time-in-state. * * ## Where a state comes from * * **The payload first.** A fat event usually carries the row's lifecycle field, and when it * does that value is what the row actually held — no inference about what the operation * meant. It is read only from events classed `pii_class = 'none'`: the field is an enum, but * #1762's rule is per event, and a read that extracts from a classified payload is the kind * of exception that later grows. * * **The declaration otherwise.** An erased, classified or field-less event still names its * operation, and the operation column survives a shred. From the state the replay has the * entity in, `on[operation]` is where the declaration says it went. Counted apart * (`inferred`), because this half is faithful only while the code agrees with the model. * * The previous state decides what an event means, which is why this is a walk in order and * not a GROUP BY: `ticket0/ingest-message` is merely *allowed* in `open` and an *edge* out of * `resolved`, so the same operation is a move or not depending on where the entity was. * * ## Bounded * * One entity type's events, walked in `(entity_id, id)` order — the `_substrat_outbox_entity` * index — in keyset pages, up to `LIFECYCLE_FLOW_EVENT_BUDGET`. Past it the answer says * `complete: false`, and every count is a lower bound; it never quietly becomes a smaller * answer. History BEFORE the window is replayed too, since the state an entity was in when * the window opened is only known from it; events after `until` are not read at all. * * Same permission posture as every read in `timeline.ts`: the caller checks, this does not. */ import { type LifecycleActorKind, type LifecycleFlowInput, type LifecycleFlowResult } from '@substrat-run/contracts'; import type { TimelineReader } from './timeline.js'; /** * The kind of actor a stored `actor` names — read off its JSON shape, never decoded in * full: a principal is a bare JSON string, every other kind an object keyed by its kind. */ export declare function actorKindOf(stored: string): LifecycleActorKind; export declare function readLifecycleFlow(ctx: TimelineReader, input: LifecycleFlowInput): LifecycleFlowResult; //# sourceMappingURL=lifecycle-flow.d.ts.map