# testing/replay

## Purpose

Pins replay determinism end-to-end: feeds a recorded event log through the full replay stack and asserts the resulting state is identical to what was produced during original execution. Covers: session replay, approval replay, validation replay, decision journal replay, refinement iteration replay, execution-plan-locked replay, repo-map replay, repo-knowledge replay, transition replay integration, and empty-session edge cases. Also exercises `DeterministicHarness` directly.

## Ownership

Tests in this submodule. Production modules exercised: `core:events`, `core:journal`, `core:kernel`, `core:context`, `core:sessions`, `core:transitions`, `core:validation`, `core:approvals`, `core:artifacts`, `infrastructure:persistence`, `infrastructure:workflow`.

## Local Contracts

- Hard invariant #8: replay must complete without any external service calls, live LLM, or network.
- Hard invariant #9: environment observations (filesystem, clock, embedder) must be read from recorded events — replay tests must not re-query the environment.
- Every replay test must compare final state byte-for-byte (or field-for-field) against a known-good fixture.

## Work Guidance

- Suspend tests use `runBlocking { ... }`.
- Do not add `Thread.sleep()` or timing-sensitive assertions — replay is synchronous over a fixed event log.

## Verification

```
./gradlew :testing:replay:test --rerun-tasks
```

## Child DOX Index

No child AGENTS.md (leaf module).
