+**Key architectural principle:** The relay is the single source of truth. `buzz-relay` orchestrates all subsystems by calling them directly — it imports `buzz-db`, `buzz-auth`, `buzz-pubsub`, `buzz-search`, `buzz-audit`, and `buzz-workflow`. However, those subsystems are isolated from each other: `buzz-workflow` never calls `buzz-pubsub`, etc. The one sanctioned exception is `buzz-audit`, which stores its chain through `buzz_db::AuditLog`. `buzz-audit` computes and checks the hashes; `AuditLog` owns the audit pool and the chain's appends and reads. Every crate reaches Postgres only through `buzz-db`, except `buzz-push-gateway`, a separate service that builds its own pool. Cross-subsystem coordination happens only through the relay. In multi-community mode, the relay also owns propagation of `TenantContext`; service crates should receive community-scoped inputs rather than independently deriving tenancy from client-controlled event tags.
0 commit comments