# Replay needs stable inputs

Principle `replay-needs-stable-inputs`. Historical processing must not silently depend on today’s clock or external decisions.

Also searched as: deterministic replay, event-time ordering, late events.

Deterministic processing should agree between live consumption and catch-up. Event ordering and late-arrival rules belong to the domain.

> The overarching goal of deterministic processing is that a microservice should produce the same output whether it is processing in real time or catching up to the present time.

Source: [Q11](/bibliography#q11); [B5](/bibliography#b5-building-event-driven-microservices).

## Failure it prevents

Reprocessing the same history changes decisions because time, ordering, or an external answer changed.

## Our Effect 4.0.5 reading

Activity can record an effect result under an engine. Stream does not choose event-time ordering, lateness policy, or protect a rebuild from live writes.

Source: `packages/effect/src/workflow/Activity.ts`, `packages/effect/src/Stream.ts`.

## How to check

Replay captured input into a clean target with controlled decisions. Compare output and apply the declared late-event policy. This is our proposed verification, not a quoted procedure.

Continue with [Old events must still decode](/principles/old-events-must-still-decode), [Pure cores reduce timeline coupling](/principles/pure-cores-reduce-timelines).

Connect this to [the existing rat-stack guidance](https://ratstack.sh/lore/schemas-define-the-boundary).

Use [the durability skill](/skills/durability) for the full review. Return to [the durability index](/principles/durability).

## Skills
- [Durability starts with a recovery record](/principles/durability)

## Sources
- Bellemare, Adam. *Building Event-Driven Microservices: Leveraging Organizational Data at Scale*. O’Reilly, 2020. [Link](https://www.oreilly.com/library/view/building-event-driven-microservices/9781492057888/). ([b5-building-event-driven-microservices](/bibliography#b5-building-event-driven-microservices))

## References
- [Effect contributors. Effect 4.0.5. workflow/Activity.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/workflow/Activity.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. Stream.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/Stream.ts). Pinned source for our Effect mapping, not a claim from the book.
