Investigation domain flows
This page describes how the Investigation write and publication path behaves over time. It references the commands and events defined in the domain model, and reflects that the current implementation is a journal rather than a reconstructed aggregate.
Write and publication path
- A producer signs the exact CloudEvent body and sends it through Service Bus.
- The command handler parses the discriminated command type and verifies the signature against a source-specific public key from Key Vault.
- The handler writes the original command to the commands container.
- A pure mapper translates the command directly into one event; no aggregate history is loaded and no state transition is evaluated.
- The handler writes the event to the events container.
- The outbox reads the events container Change Feed and publishes events sequentially.
- Published messages use
ion_investigation_idas their Service Bus session ID, providing per-investigation delivery ordering.
The code that realizes each step is listed in Implementation.
Consistency and authority boundary
The practical stream boundary is the investigation ID:
- all commands carry
ion_investigation_id; - all events carry the investigation ID and a reference to the source command;
- the event container is partitioned by the investigation ID;
- outbound events are sessioned by the investigation ID.
InvestigationCreated links the investigation to a workspace and security
incident. InvestigationConcluded records a verdict and reason. The implemented
verdicts are benign positive, false positive, true positive, and undetermined.
There is no InvestigationAggregate implementation, state reducer, aggregate
version, or optimistic-concurrency check. Authentication and payload validation
make a command acceptable to the handler; they do not prove that the command is a
valid transition from prior investigation state.