2.9 KiB
2.9 KiB
Boundary Rules
Hard constraints for every implementation phase. Violations block completion.
Canonical ownership: module-boundaries.md. Process mandate: ADR-018.
Service & Module Boundaries
- Never implement responsibilities owned by another service.
- Never duplicate business logic that already lives in an owning service — consume it.
- Never access another service’s database (no cross-DB queries, FKs, or shared schemas).
- Integrate only through versioned HTTP APIs, domain/integration Events, and Provider interfaces.
- Never import another service’s models, repositories, or private modules.
Phase Boundaries
- Never move functionality from future phases into the current phase.
- Never silently expand Scope into adjacent modules “while we’re here.”
- Out of Scope is binding — document exclusions and respect them.
- High-level roadmap text authorizes deriving production engineering for the current phase (definition-of-done.md, enterprise-phase-discovery.md), not pulling next-phase product features forward.
Data & Logic Boundaries
| Allowed | Forbidden |
|---|---|
External ID / ref fields (*_ref) |
Cross-service foreign keys |
| HTTP clients to published APIs | Reading foreign ORM models |
| Outbox → event bus → consumers | Dual-writing the same journal/aggregate in two services |
| Provider adapters in the owning service | Implementing SMS/payment/etc. inside a non-owning vertical |
| Shared-lib envelopes/exceptions/JWT helpers | Shared-lib business workflows |
Accounting & Platform Specials
- Journal entries only via Accounting Posting Engine (ADR-010).
- Messaging providers only inside Communication (ADR-012).
- Product AI remains optional and independent (ai-architecture.md).
- Public-surface cross-service attachments use
publish_idonly (ADR-022) — never Experience/vertical internal tables as the integration key.
Frontend / Backend
- UI only under
frontend/(ADR-002). - Backend never embeds UI rules as the source of truth.
- Frontend never imports backend packages.
Enforcement
- Architecture Validation stage (development-loop.md)
- Architecture / Integration gates (quality-gates.md)
- Architecture tests in the service suite (testing-template.md)