Releases any resources held by this instance.
Read the current session value.
Returns null when the stored when is greater than the requested when
(look-ahead bias protection).
Logical timestamp at which the read is happening
Current session value, or null if not set / look-ahead
Write a new session value.
New value or null to clear
Logical timestamp this value belongs to.
A write with a smaller when overwrites an existing record —
that lets a restarted backtest reset live-written state.
Initialize the session instance.
Whether this is the first initialization
Interface for session instance implementations. Defines the contract for local, persist, and dummy backends.
Intended use: per-(symbol, strategy, exchange, frame) mutable session data shared across strategy callbacks within a single run — e.g. caching LLM inference results, intermediate indicator state, or cross-candle accumulators.
Example shape: