The auto-adapt predicate's view of engine state.

Aliased from EngineTelemetry so the predicate can be invoked with the same snapshot object Graph.stats returns — no adapter layer, no field-renaming. The fields the predicate actually reads are a strict subset of EngineTelemetry:

  • inputs + deriveds — the user-registered node count, used by the per-node-cost axis (see nodeCount on AdaptThresholds). The predicate computes the sum at call time rather than threading a separate nodeCount field through the telemetry surface.
  • subscribersTotal — the fan-out axis, gated against totalSubscribers on AdaptThresholds.
  • lastCommitTime — used as a monotonic commit-count proxy, gated against commitCount.

Two fields are accepted on this surface but NOT on EngineTelemetry:

  • maxChainDepth — chain-depth axis. The current TS engine does not surface a max-chain-depth counter (it would require an O(graph) walk on every snapshot); the predicate treats undefined as 0 so a backend that does not measure it skips the chain-depth axis.
  • medianCommitMs — per-commit median cost over the last rollingCommitWindow commits. The current TS engine does not surface this either; same undefined-as-0 treatment applies.

The full WASM backend (#687) is expected to populate both. Until it does, the predicate degrades to a node-count + subscriber-count + commit-count gate, which is the issue-body design before the comment-4416013410 widening.

interface GraphStats {
    deriveds: number;
    inputs: number;
    lastCommitTime: number;
    maxChainDepth?: number;
    medianCommitMs?: number;
    subscribersTotal: number;
}

Properties

deriveds: number

User-registered derived nodes; mirrors EngineTelemetry.deriveds.

inputs: number

User-registered input nodes; mirrors EngineTelemetry.inputs.

lastCommitTime: number

GraphTime of the most recent commit; mirrors EngineTelemetry.lastCommitTime.

maxChainDepth?: number

Longest derivation chain depth in the registered graph, when the backend can surface it. undefined on the canonical TS engine (see module-level @remarks); a backend that does not measure chain depth skips the chain-depth axis of the predicate.

medianCommitMs?: number

Median commit cost (ms) over the last rollingCommitWindow commits, when the backend can surface it. undefined on the canonical TS engine; a backend that does not measure per-commit cost skips the commit-shape axis of the predicate UNLESS the caller supplies a non-empty commitTimings array to shouldMigrate (the wrapper-side measurement path landed in #1048 / Option B — when supplied, its median takes precedence over this field).

subscribersTotal: number

Total live subscribers; mirrors EngineTelemetry.subscribersTotal.