objectstate.snapshot_model
Snapshot and Timeline dataclasses for git-like time-travel history.
This module provides typed data structures for the ObjectStateRegistry’s time-travel system, replacing the tuple-based implementation.
Design Philosophy: Correct by Construction - No Optional fields for required data - Immutable snapshots (frozen dataclass) - UUID-based identity for snapshots - Direct attribute access (no getattr fallbacks)
Classes
|
Immutable snapshot of ALL ObjectStates at a point in time. |
|
Immutable snapshot of a single ObjectState's data. |
|
Named branch of history - analogous to a git branch. |
- class objectstate.snapshot_model.StateSnapshot(saved_resolved: Dict, live_resolved: Dict, parameters: Dict, saved_parameters: Dict, provenance: Dict, meta: Dict = <factory>)[source]
Immutable snapshot of a single ObjectState’s data.
Captures the resolved values, parameters, and provenance at a point in time. No object references - data only for serializability.
- class objectstate.snapshot_model.Snapshot(id: str, timestamp: float, label: str, triggering_scope: str | None, parent_id: str | None, all_states: Dict[str, StateSnapshot])[source]
Immutable snapshot of ALL ObjectStates at a point in time.
Analogous to a git commit - captures the entire system state.
- all_states: Dict[str, StateSnapshot]