> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Assert Replay Order • AI Agent SDK

> assert_replay_order: Determinism guardrail: fail loud if replay diverges from the journal.

# assert\_replay\_order

Method

> This is a method of the [**RunJournal**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/RunJournal.md) class in the [**journal**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/journal.md) module.

Determinism guardrail: fail loud if replay diverges from the journal.

During replay the loop must reproduce the recorded sequence of steps.
Because the memoised :meth:`replay_index` lookup is keyed by
`(seq, kind)`, this guard compares the full `(seq, kind)` sequence —
not just the bare kinds — so a replay that reproduces the same *shape*
at different `seq` values (a divergent step order) still fails loud
rather than silently reusing or skipping the wrong recorded step.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def assert_replay_order(run_id: str, expected: List[Any]) -> None
```

## Parameters

**run\_id** `str` *required*

The run being replayed.

**expected** `List[Any]` *required*

The steps the replay produced, as either `(seq, kind)` tuples (preferred, position-aware) or bare `kind` strings (compared against the recorded kinds for backward compatibility).

## Uses

* `events`
* `RuntimeError`

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/runtime/journal.py#L402)
>
> `praisonaiagents/runtime/journal.py` at line 402

***

## Related Documentation

> [card] [Replay Feature](https://praison.ai/docs/features/replay.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.