ADR-006: Mutation Side Effects
Tag
#adr_006
Status
Accepted
Date
2026-01-22
Scope
ModularityKit.Mutators.Abstractions.Effects
Context
Mutations may produce side effects that are not direct state changes. Side effects allow tracking, classification by type and severity, and integration with monitoring, auditing, or alerting systems. Introducing this layer enables observation of the full impact of mutations and facilitates reactions to undesired side effects.
Decision
SideEffect
Responsibilities:
- Represent a single side effect generated by a mutation.
- Store type, description, data, severity, timestamp, and a
RequiresActionflag. - Provide factories to create standard and critical side effects (
CreateandCritical).
SideEffectSeverity
Info,Warning,Error,Critical— define the severity of the side effect and the need for reaction or intervention.
Design Rationale
- Separating side effects from the main mutation allows independent logging, auditing, and monitoring.
- Enables defining critical actions that require intervention without modifying state.
- Simplifies integration with observability and security systems.