Function: foldRun()
ts
function foldRun(events: RunEvent[]): RunProjection;Defined in: src/batteries/orchestration/runs.ts:33
Fold a sequence of run events into a single RunProjection.
The projection is derived entirely from the events themselves — no graph, no store, and no side channel. It is deterministic and total: the same event list always folds to the same projection.
Parameters
| Parameter | Type | Description |
|---|---|---|
events | RunEvent[] | The ordered run events to fold. |
Returns
The projected state of the run.
Throws
If the first event is not run_started (a malformed event list).