footprintjs - v11.2.0
    Preparing search index...

    Type Alias RuntimeSnapshot

    type RuntimeSnapshot = {
        capture?: NativeCaptureObservation;
        captureExtent?: NativeCaptureExtent;
        commitLog: CommitBundle[];
        commitValues: CommitValuesMode;
        correlation?: RunCorrelation;
        executionTree: StageSnapshot;
        initialState?: Record<string, unknown>;
        logAddress?: LogAddress;
        observerStats?: ObserverStats;
        readSources?: EngineReadSources;
        recorders?: RecorderSnapshot[];
        runId: string;
        sharedState: Record<string, unknown>;
        sink?: RecordSinkStats;
        subflowResults?: Record<string, unknown>;
        writeProvenance: WriteProvenanceMode;
    }
    Index

    Opt-in native observation; root log and current leg only, never durable storage.

    captureExtent?: NativeCaptureExtent

    Opt-in native work counts; terminal unverified observations never authorize complete capture.

    commitLog: CommitBundle[]

    The run's commit bundles, one per executed stage, in execution order — a DETACHED, frozen copy of the engine's live log (a snapshot is a fold result: it must not keep changing under the consumer that holds it). The bundles inside are the engine's own objects, immutable after record.

    commitValues: CommitValuesMode

    Encoding discriminant for commitLog (#13c-B): 'full' — every set bundle stores the full final value (historical); 'delta' — bundles may carry append/delete trace verbs with verb-qualified overwrite payloads (tails). Offline tooling keys on this field; a bundle stream without context remains self-describing via the verbs themselves.

    correlation?: RunCorrelation

    The run's correlation (10.1) — env.traceparent, or env.traceId + env.operationId, resolved once per leg; the same frozen object every event of the leg carries (TraversalContext.correlation, a scope event's correlation). Like runId, per leg: a resume carries ITS env's, never the paused leg's. Absent — no key — when none was given.

    executionTree: StageSnapshot
    initialState?: Record<string, unknown>

    The commit log's fold BASE — the run's state before its first commit (initialContext merged with defaultValuesForContext; on a resume, the checkpoint's state). Deeply frozen and fully detached from the engine.

    Commit bundles are DIFFS, so the log alone cannot rebuild a value that was seeded before the run and only ever merged afterwards. Shipping the base WITH the log is what makes an offline fold — stateAt(snapshot, i) from foottrace — reproduce the state a stage actually saw.

    OPTIONAL BY TYPE, and absent in exactly two cases. A plain getSnapshot() always carries it, so a live fold reports basis: 'initial+log'. Under getSnapshot({ redact: true }) it is OMITTED — the base is the raw pre-run seed and the redaction policy is not plumbed into the fold — so a fold of a redacted snapshot degrades honestly to basis: 'log-only'. And it is declared optional so that code written against 9.16.x — a test fixture or a UI mock that CONSTRUCTS a RuntimeSnapshot literal — still compiles. stateAt handles absence by saying so, never by folding a lie.

    logAddress?: LogAddress

    Identity of this log, stable across same-executor resume. Absent before binding or in older sources.

    observerStats?: ObserverStats

    Deferred-observer accounting (RFC-001 Block 9) — queue depth, drops, flush/budget counters, per-listener time attribution, and the terminal-flush stranding count. ABSENT unless a recorder was attached with { delivery: 'deferred' } on this executor (zero-cost discipline).

    readSources?: EngineReadSources

    Opt-in ordered native occurrences. Unknown ownership has no record; never infer observed-empty.

    recorders?: RecorderSnapshot[]

    Snapshot data from recorders that implement toSnapshot().

    runId: string

    The run this snapshot belongs to — the same runId stamped on every TraversalContext (and thus every recorder event) of the run, so a snapshot can be joined against an event stream or an external correlation table. Read-only by contract: generated by the executor (runner/runId.ts), never derived from snapshot contents.

    Lifecycle (matches the event model): fresh per run() AND per resume() — resume is logically a distinct run, so a post-resume snapshot carries a DIFFERENT runId than the paused run's snapshot.

    sharedState: Record<string, unknown>

    The crash-safe record's accounting (10.1, P6) — how many entries the run handed its sink and how many the sink did not take. ABSENT unless the executor was built with a sink and a run started.

    subflowResults?: Record<string, unknown>

    Per-subflow execution results, DUAL-KEYED (design: docs/design/subflow-commit-visibility.md):

    • by subflow PATH (subflowId, e.g. 'sf-pay') → the LAST iteration (back-compat); this is what getSubtreeSnapshot(path) and listSubflowPaths() resolve.
    • by per-execution mount runtimeStageId (e.g. 'sf-pay#5') → THAT iteration's result, so a LOOPING subflow retains EVERY iteration (not just the last). Look up a specific iteration as subflowResults[node.runtimeStageId] ?? subflowResults[node.subflowId]. Both keys point at the same object for a single mount; iterate with care (count via the path keys — those without '#'). The pause checkpoint carries only the path keys, lean.

    Under getSnapshot({ redact: true }) each entry's treeContext.globalContext is that subflow's OWN redacted mirror (9.20.0) — the fold of its scrubbed history — served as one substituted object per mount (both keys still agree) — the wrapper is fresh per getSnapshot call, the globalContext inside it is the stable mirror; plain, it is the subflow's live heap. Without a policy there is no mirror and the two views are the same objects.

    writeProvenance: WriteProvenanceMode

    Per-write read-provenance dial (#P1) the run executed under — the offline-tooling discriminant for TraceEntry.readKeys availability.