= test-kernel == purpose Tests for the core kernel orchestration logic: retry coordination and inference replay. Verifies that the `DefaultRetryCoordinator` correctly manages retry attempts and that inference events replay to the correct provider state. == responsibilities * Test `DefaultRetryCoordinator` retry policy enforcement (max attempts, backoff, exhaustion) * Test `ReplayInferenceProvider` to ensure inference events replay correctly through the inference projector == non-responsibilities * Does not test the full session orchestrator lifecycle * Does not test infrastructure retry mechanisms (e.g., HTTP retry) * Does not test UI or application layers == key types === MockOrchestrationEventReplayer * **kind**: class * **purpose**: Test double implementing `EventReplayer`. Returns pre-configured states by session ID; defaults to `RUNNING` with `stage-1`. === MockSessionEventReplayer * **kind**: class * **purpose**: Test double implementing `EventReplayer`. Returns pre-configured states by session ID; defaults to `ACTIVE`. === DefaultRetryCoordinatorTest * **kind**: JUnit 5 test class * **purpose**: Tests retry coordination logic — max retries, exponential backoff duration, retry exhaustion behavior. === ReplayInferenceProviderTest * **kind**: JUnit 5 test class * **purpose**: Tests that inference events streamed through the replay mechanism produce correct `InferenceState`. == event flow *inbound:* Programmatically constructed events and state objects injected into mock replayers. *outbound:* Assertions on retry coordinator state (attempt count, delay values) and replayed inference state. == integration points * `:core:kernel` — `DefaultRetryCoordinator`, orchestration state and event types * `:core:inference` — `InferenceProjector`, `InferenceState`, `InferenceRepository` * `:core:sessions` — `SessionState`, `SessionStatus` * `:core:events` — event payload types, `EventReplayer` interface * `:testing:fixtures` — mock replayers and state builders == invariants * Retry coordinator respects max attempt limits — exceeding them marks the operation as exhausted * Event replay produces the same inference state regardless of the number of replay passes == PlantUML diagram [plantuml, test-kernel, "png"] ---- include::../../diagrams/test-kernel.puml[] ---- == known issues * Mock replayers provide pre-canned states rather than true event-sourced replay — tests do not verify the replay machinery itself, only the components that consume replay output == open questions * Should the tests also cover the `DefaultRetryCoordinator` integration with the event store? * Should there be a full `EventStore` + `RetryCoordinator` integration test here?