Files
correx/docs/modules/testing/test-kernel.adoc
T
kami 9734eec63c docs: add module documentation in AsciiDoc with PlantUML diagrams
Generated by per-group subagents covering all 52 modules across:
core (18), infrastructure (10), apps (5), interfaces (3),
plugins (7), testing (9)

Documentation format:
- AsciiDoc (.adoc) files in docs/modules/<group>/
- PlantUML (.puml) files in docs/diagrams/
- .adoc files reference diagrams via include:: directives

Each doc covers: purpose, responsibilities, non-responsibilities,
key types, event flow, integration points, invariants, PlantUML
diagram, known issues, and open questions.
2026-05-26 16:59:21 +04:00

73 lines
2.7 KiB
Plaintext

= 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<OrchestrationState>`. Returns pre-configured states by session ID; defaults to `RUNNING` with `stage-1`.
=== MockSessionEventReplayer
* **kind**: class
* **purpose**: Test double implementing `EventReplayer<SessionState>`. 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?