Number of distinct execution steps that have at least one entry.
Number of entries in the sequence.
Reduce entries, optionally filtered by a set of runtimeStageIds.
For time-travel progressive view: pass the runtimeStageIds visible
at the current slider position. Entries without runtimeStageId
(structural markers) are excluded when keys are provided. Without
keys, reduces all entries (same as aggregate).
Clear all stored data. Recorders typically call this from their own
clear() method, which the executor invokes before each run.
Zero-copy iteration. Avoids the getAll() spread when the caller just needs
to walk the entries (e.g., aggregating, rendering).
All entries in insertion order. Returns a shallow copy — entry objects are shared.
O(1) lookup: all entries for a specific execution step. Returns a copy.
Progressive reveal: entries whose runtimeStageId is in the visible
set. Preserves insertion order. Entries without runtimeStageId
(structural markers) are buffered and included only when surrounded
by visible steps on both sides — trailing markers after the last
visible step are discarded.
Pre-built range index: runtimeStageId → half-open [firstIdx, endIdx)
range in the entries array. Maintained during push() — no rebuild
needed. Use for O(1) per-step lookups during time-travel scrubbing.
endIdx includes trailing keyless entries (structural markers
following a step).
Append an entry to both the ordered sequence, keyed index, and range index. All three reference the SAME entry object — no duplication.
SequenceStore — concrete, composable storage for ordered sequence data.
Pattern: COMPOSITION primitive. Concrete class — instantiate with
new SequenceStore<T>()and own it as a field on your recorder. Replaces the abstractSequenceRecorder<T>base class for the v5 "one purpose per recorder" rule: stores ARE storage; recorders ARE event handlers; consumers COMPOSE. Role: Dual-indexed append-only sequence: a flat array preserving insertion order plus aMap<runtimeStageId, T[]>for O(1) per-step lookup. Plus a precomputed range index for time- travel scrubbing.Example
Contrast with
KeyedStore<T>: SequenceStore stores 1:N entries per runtimeStageId in insertion order. Use KeyedStore for 1:1 (one record per step — token counts, metric snapshots).