Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Status: π§ In progress (FM-14 Phase 4 task; first verified row landed via 2026-04-18 audit)
Last Updated: 2026-04-18
Owner: FM
Source: FM-14: Integration Contract Alignment Phase 4
Canonical-source statement (added 2026-04-18 by FM Audit & Optimization):
This document is the canonical audit log for FM event consumers. The high-level matrix in FM_INTEGRATION_CONTRACTS.md Β§ Consumer Verification Matrix is a derived summary for spec authors. When the two disagree, this document wins, and a docs PR should reconcile FM_INTEGRATION_CONTRACTS.md. The deep review on 2026-04-17 surfaced one such drift (vendor_certification_expiring β PF-10 was β
in the summary but missing from this audit log); it is now reflected below in Β§ βWave 0 β Already-implemented FM eventsβ.
Platform Pattern Note: This document is the FM prototype of a platform-wide Consumer Verification Matrix pattern proposed for generalization as a PF-level spec (PF-Integration-Contract-Governance). Other cores should adopt the same structure once the PF spec is authored. See FM-14 Phase 4 for the governance rationale.
Purpose
This document tracks which event consumers have been verified to handle each FM-published event. Before a spec wave is considered βintegration-readyβ, all consumer rows for that waveβs events must have a verification status of β
Verified.
How to mark a consumer β
Verified
A consumer row may be set to β
Verified only when all of the following hold:
- The consumer handler exists in
supabase/functions/{handler-name}/index.ts (or equivalent in-app subscriber) and is deployed to all environments where the publisher is enabled.
- The handler is registered against the publisher event in
EVENT_CONTRACTS.md and routes through the platform notification / event bus (no ad-hoc HTTP webhooks for cross-core).
- At least one integration test in
tests/integration/ exercises the publisher β consumer path end-to-end (or a dedicated tests/edge/ Deno test for edge handlers).
- The handler honours tenant isolation (
organization_id filter on every query, RLS-friendly client) and uses _shared/auth.ts (verifyOrgAccess() / verifyOrgRole()) instead of inline pf_user_role_assignments queries.
- The handler emits an audit log entry (or otherwise produces a verifiable trace) on success and failure.
- The row in this matrix is updated and the corresponding row in
FM_INTEGRATION_CONTRACTS.md Β§ Consumer Verification Matrix is updated in the same PR.
If any of the above is missing, the row remains π Planned with the FM-CONSUMER-XXX tracking ID.
Wave 0 β Already-implemented FM events
These rows reflect consumers that are wired today (not part of any forward-looking wave). They were missing from this document until the 2026-04-18 audit.
| Event | Publisher | Consumer | Consumer Handler | Status | Notes |
|---|
vendor_certification_expiring | FM-03 | PF-10 (Notifications) | check-vendor-certifications cron + PF-10 notification dispatch | β
Verified | Edge function supabase/functions/check-vendor-certifications/index.ts. Surfaced in FM_INTEGRATION_CONTRACTS.md Β§ Consumer Verification Matrix as β
; reconciled here on 2026-04-18. |
Integration Readiness Gate Checklist
Before marking any FM spec as integration-complete, verify:
Wave A Events (FM-06: Compliance & Inspections)
| Event | Publisher | Consumer | Consumer Handler | Status | Notes |
|---|
inspection_due | FM-06 | PF-10 (Notifications) | handleFmInspectionDue | π FM-CONSUMER-001 | Handler stub: supabase/functions/pf-handle-fm-inspection-due |
inspection_due | FM-06 | GR-03 (Compliance Tracking) | handleFmInspectionDue | π FM-CONSUMER-002 | Handler stub: supabase/functions/gr-handle-fm-inspection-due |
inspection_failed | FM-06 | PF-10 (Notifications) | handleFmInspectionFailed | π FM-CONSUMER-003 | Handler stub: supabase/functions/pf-handle-fm-inspection-failed |
inspection_failed | FM-06 | GR-03 (Compliance Tracking) | handleFmInspectionFailed | π FM-CONSUMER-004 | Handler stub: supabase/functions/gr-handle-fm-inspection-failed |
inspection_compliant | FM-06 | GR-03 (Compliance Tracking) | handleFmInspectionCompliant | π FM-CONSUMER-005 | Handler stub: supabase/functions/gr-handle-fm-inspection-compliant |
Wave B Events (FM-07: Analytics, FM-09: Budgeting)
| Event | Publisher | Consumer | Consumer Handler | Status | Notes |
|---|
facilities_report_generated | FM-07 | PF-10 (Notifications) | handleFacilitiesReportGenerated | π FM-CONSUMER-006 | Handler stub: supabase/functions/pf-handle-facilities-report-generated |
budget_variance_alert | FM-09 | FA (Finance) | handleBudgetVarianceAlert | π FM-CONSUMER-007 | Handler stub: supabase/functions/fa-handle-budget-variance-alert (requires FA-08) |
budget_variance_alert | FM-09 | PF-10 (Notifications) | handleBudgetVarianceAlert | π FM-CONSUMER-008 | Handler stub: supabase/functions/pf-handle-budget-variance-alert |
Wave C Events (FM-12: Capital Planning)
| Event | Publisher | Consumer | Consumer Handler | Status | Notes |
|---|
capital_project_approved | FM-12 | FA (Finance) | handleCapitalProjectApproved | π FM-CONSUMER-009 | Handler stub: supabase/functions/fa-handle-capital-project-approved (requires FA-09) |
capital_project_approved | FM-12 | PF-10 (Notifications) | handleCapitalProjectApproved | π FM-CONSUMER-010 | Handler stub: supabase/functions/pf-handle-capital-project-approved |
References