Architecture & Design¶
How Invariant is built and why.
Design goals¶
- Correctness over convenience — Never produce silently wrong results
- Explicit over implicit — All constraints are declared, not inferred
- In-memory determinism — The kernel runs without infrastructure dependencies
- Ports isolate I/O — All external communication goes through defined interfaces
Non-goals¶
Invariant deliberately does not:
- Execute queries (you do that)
- Store data (you provide repositories)
- Optimize performance (that's downstream)
- Render visualizations (that's your UI)
Where complexity lives¶
| Layer | Responsibility |
|---|---|
| Domain | Entities, value objects, invariants |
| Application | Use cases, orchestration |
| Ports | Interfaces to external systems |
The domain layer has zero dependencies. Everything else depends inward.
Architecture topics¶
| Topic | What it covers |
|---|---|
| Query, Rules, Gate | The core validation model |
| Progressive Rigor | Deployment profiles from minimal to strict |
| Scope Boundaries | What's in and out of scope |
Next steps¶
After understanding the architecture, see Integration Guide for practical implementation.