Problem:
wait_for_condition returns inconsistent results between the first run and replay when a custom SerDes is configured. On the first run, execute() returns the raw new_state produced by the check function. On replay, the value is reconstructed via deserialize(serialize(new_state)) from the checkpoint. If the SerDes is not a perfect round-trip (e.g. it normalizes, drops, or transforms fields), callers observe one value on the first execution and a different value after any replay.
Fix:
On the success path in operation/wait_for_condition.py, return the round-tripped value (deserialize of the serialized state) instead of the raw new_state, so the first run yields the same result the replay path would produce. Preserve None handling to match the replay behavior. Add a test using a non-identity SerDes
that asserts the first-run result equals the replayed result.
Problem:
wait_for_condition returns inconsistent results between the first run and replay when a custom SerDes is configured. On the first run, execute() returns the raw new_state produced by the check function. On replay, the value is reconstructed via deserialize(serialize(new_state)) from the checkpoint. If the SerDes is not a perfect round-trip (e.g. it normalizes, drops, or transforms fields), callers observe one value on the first execution and a different value after any replay.
Fix:
On the success path in operation/wait_for_condition.py, return the round-tripped value (deserialize of the serialized state) instead of the raw new_state, so the first run yields the same result the replay path would produce. Preserve None handling to match the replay behavior. Add a test using a non-identity SerDes
that asserts the first-run result equals the replayed result.