# ADR-0003: Clean architecture, manual composition root

# Context

The domain rules of BDI — the member state machine, chain-context invariants, BVAD contents — need to be testable and understandable without dragging in a database, an HTTP framework, or a crypto library. A typical Node service mixes all four, and the result is flaky tests and refactors that take a week.

We didn't want that.

# Decision

Adopt the classic four-layer split: domainapplicationinfrastructureinterface. Ports live in application/ports.ts; adapters implement them in infrastructure/. Composition happens in a single composition-root.ts per service. No DI framework — the wiring is plain TypeScript.

# Consequences

What we like about this:

What we accept:

# What else we considered