Status: ✅ Implemented (All 3 Phases Complete)
Last Updated: 2026-04-09 Spec: PF-67-internal-real-time-messaging.md
Plan: PF-67-internal-real-time-messaging-PLAN.md
Purpose: Documents integration points for the Platform Messaging layer. All cores consume messaging via @/platform/messaging (Pattern 1: Platform Integration Layer).
Integration Type
Pattern 1: Platform Integration Layer- Location:
src/platform/messaging/(implemented) - Public API: Hooks and components exported from
@/platform/messaging - Consumers: All cores (RH, HR, FA, GR, FW, FM, LO, IT, CE) for record threads and internal chat
Platform Foundation Dependencies (Upstream)
Consumer Core Integration (Downstream)
Contract: Cores embed
<ChatPanel recordType="…" recordId="…" /> from @/platform/messaging; no direct table access.
API Contract (Implemented)
Hooks
Components
Edge Functions
Event Contracts
Database Tables
RPCs (SECURITY DEFINER)
Security Considerations
- Multi-tenant isolation: RLS with SECURITY DEFINER helpers on all tables
- Organization immutability: BEFORE UPDATE trigger prevents
organization_idchanges - PHI/PII: No PHI in Realtime broadcast/presence payloads; follow constitution §4 for AI and logging
- Broadcast/Presence payloads: Whitelisted fields only (no PHI/PII)
- Attachments: Store bucket-relative paths on
pf_messages.file_url; issue short-lived signed URLs in the client at read time
Integration Matrix
- CROSS_CORE_INTEGRATIONS.md: PF-67 is a Platform Integration Layer consumed by all cores via
@/platform/messaging.
Utilities
References
- Spec: PF-67-internal-real-time-messaging.md
- Plan: PF-67-internal-real-time-messaging-PLAN.md
- Tasks: PF-67-internal-real-time-messaging-TASKS.md
- Architecture: REAL_TIME_ARCHITECTURE.md §8
-
PLATFORM_INTEGRATION_LAYERS.md: PF-67 entry added —
@/platform/messagingexports 15 hooks, 14 components, and 7 utility functions