"""Replay records emitted into the vm output stream."""from__future__importannotationsfromuuidimportUUIDfrompydanticimportFieldfromtangl.coreimportGraph,Recordfromtangl.type_hintsimportUnstructuredData
[docs]classStepRecord(Record):"""One replay step on the active traversal timeline."""step:intedge_id:UUID|None=Nonecursor_id:UUIDentry_phase:str|None=Nonewas_choice:bool=Falsedelta_id:UUID|None=Nonestate_hash:bytes=b""call_stack_ids:list[UUID]=Field(default_factory=list)algorithm_id:str=""
[docs]classCheckpointRecord(Record):"""Checkpoint record for fast rollback reconstruction."""step:intalgorithm_id:strgraph_payload:UnstructuredDatastate_hash:bytescursor_id:UUIDcall_stack_ids:list[UUID]=Field(default_factory=list)defrestore_graph(self)->Graph:returnGraph.structure(self.graph_payload)
[docs]classRollbackRecord(Record):"""Monument record emitted after destructive rollback."""resumed_step:intprior_step:inttruncated_record_count:inttruncated_step_count:intreason:str|None=None
classCausalityTransitionRecord(Record):"""Monotonic causality mode transitions for debug/preview auditing."""step:intfrom_mode:strto_mode:strreason:strstep_id:str|None=Nonecursor_id:UUID|None=None