Architecture: Should platform notifications (System A) and business commun...
Documentation for Sessions
🏗️ Architecture: Should platform notifications (System A) and business commun...
Date: 2026-03-19
Time: 17:51:04 UTC
Session: gspace1-241.4
Agent: architecture
Confidence: 94%
Status: ✅ Documented
📋 Decision Context
Question:
Should platform notifications (System A) and business communications (System B) share the same dispatch pipeline?
Task: Design notification system architecture — shared vs separate pipelines
🎯 Decision Made
Chosen:
No — two separate systems with shared delivery primitives. System A uses ProactiveDispatcherService (quiet hours, frequency cap, dedup, per-user dossier). System B uses a new DeliveryService with consent-based gating (GDPR/TCPA opt-in). Both use @libs-api/messaging-core (TwilioService, EmailService, VittoIdentityService) for actual delivery.
Options Considered:
- Unified pipeline with config flags to switch behavior
- Two separate systems with shared messaging-core primitives (chosen)
- Unified pipeline with separate safety guard modules
💭 Reasoning
The safety guard models are fundamentally incompatible. System A caps at 5 alerts/day per user with quiet hours — appropriate for developer alerts. System B must allow a business to send 50+ messages/day during a sale — applying System A's cap would break the feature. System A reads UserDossier and UserNotificationPrefs (L1 GoGrab users). System B reads CustomerConsent (L2 platform users) — different collections, different schemas, different compliance requirements. The shared layer is messaging-core which both already import. Rate limiting for System B uses Redis sliding window (because broadcast volumes justify it), while System A uses in-memory Maps (low volume, acceptable for single instance). Forcing them through one pipeline would require branching logic throughout the dispatcher that defeats the purpose of unification.
📁 Files Involved
APIs/backend-vitto-api/src/app/proactive/proactive-dispatcher.service.tsAPIs/backend-vitto-api/src/app/mind/schemas/user-notification-prefs.schema.tsdocs/superpowers/specs/2026-03-19-platform-notification-system-design.mddocs/superpowers/specs/2026-03-19-business-communications-system-design.md
🔗 Related
- Decision ID:
dev_1773942664018_fekuczf - Session: 241
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation