Events & audit
Domain events
Modules communicate via append-only domain events published through a transactional outbox. Never make HTTP calls between apps for state changes.
- Publisher:
@constellation-platform/events - Event naming:
<entity>.<past-tense-verb>(e.g.organisation.created,task.completed) - Payloads use
as constto lock the shape at the type level.
Audit log
For any mutation that must be forensically replayable (permissions, financial state, identity changes), use auditCritical() from @constellation-platform/audit. It writes into the audit schema in the same transaction as the mutation itself.
See the Universal Audit Log Specification for the full design.