Coverage for src / lexigram / contracts / workflow / types.py: 100%
11 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-19 05:41 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-19 05:41 +0800
1"""Value types for workflow orchestration contracts."""
3from __future__ import annotations
5from dataclasses import dataclass
7__all__ = ["StateTransitionRecord"]
10@dataclass(frozen=True)
11class StateTransitionRecord:
12 """Immutable record of a persisted state transition.
14 Attributes:
15 machine_id: Stable identifier for the state machine instance.
16 version: Monotonic transition version for optimistic locking.
17 from_state: Source state name before the transition.
18 event: Event name that triggered the transition.
19 to_state: Destination state name after the transition.
20 transitioned_at: UNIX timestamp (seconds) when transition was stored.
21 """
23 machine_id: str
24 version: int
25 from_state: str
26 event: str
27 to_state: str
28 transitioned_at: float