# Replay needs stable inputs

> For agents: start with the [agent guide](https://ratstack.sh/llms.txt). Every page is Markdown by default; add `Accept: text/html` for HTML.

Free workshop: [Build Agent Loops That Never Stop Shipping](/tokenmaxx#interested).

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](/lore/durability-bibliography#q11); [B5](/lore/durability-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.0 reading

`Activity` can record an [effect](/lore/effect-basics) 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 check is our proposal. The books do not prescribe it.

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

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

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

## Sources

1. [Bellemare, Adam. Building Event-Driven Microservices: Leveraging Organizational Data at Scale. O’Reilly, 2020.](https://www.oreilly.com/library/view/building-event-driven-microservices/9781492057888/)
   O’Reilly. Chapter 3 Communication and Data Contracts; Chapter 6 Deterministic Stream Processing; Chapter 7 Stateful Streaming; Chapter 9 Microservices Using Function-as-a-Service; Chapter 14 Supportive Tooling. Accessed 2026-10-23.

2. [Effect contributors. Effect 4.0.0. workflow/Activity.ts](https://github.com/Effect-TS/effect/blob/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src/workflow/Activity.ts)
   Effect-TS. Pinned source for our Effect mapping, not a claim from the book. Accessed 2026-10-23.

3. [Effect contributors. Effect 4.0.0. Stream.ts](https://github.com/Effect-TS/effect/blob/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src/Stream.ts)
   Effect-TS. Pinned source for our Effect mapping, not a claim from the book. Accessed 2026-10-23.

## Linked from

- Agent guide → An Effect stack so pure (aspirational) Kit Langton will blush. → [Read page](https://ratstack.sh/llms.txt)

- Change log → What changed in the files served here, newest first. → [Read page](https://ratstack.sh/log)

- Durability starts with a recovery record → A reading order for storage, replay, worker ownership, overload, and recovery tests. → [Read page](https://ratstack.sh/lore/durability)

- Full agent guide → An Effect stack so pure (aspirational) Kit Langton will blush. → [Read page](https://ratstack.sh/llms-full.txt)

- Old events must still decode → Retained data needs compatibility rules before recovery depends on it. → [Read page](https://ratstack.sh/lore/old-events-must-still-decode)

- Pure cores reduce timeline coupling → Move deterministic rules out of time-dependent actions and shared mutable state. → [Read page](https://ratstack.sh/lore/pure-cores-reduce-timelines)

- Rat Stack lore | rat-stack → Short, source-grounded notes on the ideas and decisions behind rat-stack. → [Read page](https://ratstack.sh/lore)

- Restart must reconstruct known state → Execution recovery and state recovery need separate contracts. → [Read page](https://ratstack.sh/lore/restart-from-known-state)

- Source change history (log.md) → The generated change log as Markdown. → [Read page](https://ratstack.sh/log.md)
