BaseStateRepositorystores state by caller-supplied ID.BaseSnapshotStorerecords chronological state copies attributed to a mutator ID.
LangState orchestrator.
In-memory repository
get_or_create(state_id, factory) is supplied by the base repository. clear() is a synchronous convenience on the in-memory implementation.
Bounded snapshots
record_snapshot() calls state.copy() before storing an immutable Snapshot dataclass. The default capacity is 100; when capacity is exceeded, the oldest stored snapshot is discarded. Snapshot indexes count total recordings and are not renumbered after eviction.