ADR 2: Hexagonal Ring Layering and Dependency Isolation

Summary

Strict layered architecture: adapters > application > ports > domain.

Context

In complex event sourcing frameworks, business logic frequently becomes coupled to database models, broker drivers, or telemetry frameworks. Prior refactoring waves established ring layering contracts to keep pure domain invariants isolated from infrastructure.

Decision

  1. Ring dependency order is strictly enforced: adapters over application over ports over domain.
  2. domain and ports must never import observability or infrastructure technologies.
  3. Inner rings must never import the testing toolkit.
  4. Enforced automatically in CI via import-linter contracts.

Consequences