Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DOM-005Domain Model QualityCross-aggregate modification risk
Flags workflows that modify multiple aggregates without clear coordination.
warningviolationNo auto-fix
How to fix
- Move coordination into an application service.
- Use events/outbox for eventual consistency when appropriate.
- Keep each aggregate responsible for its own state changes.
What it means
A workflow writes across aggregate boundaries in a way that may bypass each aggregate's invariants.
Why it matters
Cross-aggregate writes need explicit orchestration, transaction, or event strategy.
Common causes
- A service updates several model roots directly.
- A migration path temporarily combines unrelated writes.
- No event or application workflow owns the coordination.
Example bad pattern
One method directly updates organization, billing subscription, and invitation records with no coordination model.Example good pattern
An onboarding workflow coordinates aggregate-owned operations and documents consistency expectations.Related files/config
apps/api/src/modulespackages
Related CLI commands
archpilot validatearchpilot validate --ci