Skip to content
1 min read · 99 words

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 ​

ParameterTypeDescription
eventsRunEvent[]The ordered run events to fold.

Returns ​

RunProjection

The projected state of the run.

Throws ​

If the first event is not run_started (a malformed event list).