Skip to main content

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:
  1. 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.
  2. 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).
  3. 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).
  4. 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.
  5. The handler emits an audit log entry (or otherwise produces a verifiable trace) on success and failure.
  6. 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.
EventPublisherConsumerConsumer HandlerStatusNotes
vendor_certification_expiringFM-03PF-10 (Notifications)check-vendor-certifications cron + PF-10 notification dispatchβœ… VerifiedEdge 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:
  • All FM events for the spec are defined in FM_INTEGRATION_CONTRACTS.md
  • All FM events for the spec are listed in EVENT_CONTRACTS.md
  • All consumer rows in this document for those events are βœ… Verified
  • RLS test stubs exist for all new tables in the spec
  • Consumer handlers in FA / GR / PF-10 are implemented or stubbed with tracked issues
  • npm run verify:fm-integration-gates passes

Wave A Events (FM-06: Compliance & Inspections)

EventPublisherConsumerConsumer HandlerStatusNotes
inspection_dueFM-06PF-10 (Notifications)handleFmInspectionDueπŸ“ FM-CONSUMER-001Handler stub: supabase/functions/pf-handle-fm-inspection-due
inspection_dueFM-06GR-03 (Compliance Tracking)handleFmInspectionDueπŸ“ FM-CONSUMER-002Handler stub: supabase/functions/gr-handle-fm-inspection-due
inspection_failedFM-06PF-10 (Notifications)handleFmInspectionFailedπŸ“ FM-CONSUMER-003Handler stub: supabase/functions/pf-handle-fm-inspection-failed
inspection_failedFM-06GR-03 (Compliance Tracking)handleFmInspectionFailedπŸ“ FM-CONSUMER-004Handler stub: supabase/functions/gr-handle-fm-inspection-failed
inspection_compliantFM-06GR-03 (Compliance Tracking)handleFmInspectionCompliantπŸ“ FM-CONSUMER-005Handler stub: supabase/functions/gr-handle-fm-inspection-compliant

Wave B Events (FM-07: Analytics, FM-09: Budgeting)

EventPublisherConsumerConsumer HandlerStatusNotes
facilities_report_generatedFM-07PF-10 (Notifications)handleFacilitiesReportGeneratedπŸ“ FM-CONSUMER-006Handler stub: supabase/functions/pf-handle-facilities-report-generated
budget_variance_alertFM-09FA (Finance)handleBudgetVarianceAlertπŸ“ FM-CONSUMER-007Handler stub: supabase/functions/fa-handle-budget-variance-alert (requires FA-08)
budget_variance_alertFM-09PF-10 (Notifications)handleBudgetVarianceAlertπŸ“ FM-CONSUMER-008Handler stub: supabase/functions/pf-handle-budget-variance-alert

Wave C Events (FM-12: Capital Planning)

EventPublisherConsumerConsumer HandlerStatusNotes
capital_project_approvedFM-12FA (Finance)handleCapitalProjectApprovedπŸ“ FM-CONSUMER-009Handler stub: supabase/functions/fa-handle-capital-project-approved (requires FA-09)
capital_project_approvedFM-12PF-10 (Notifications)handleCapitalProjectApprovedπŸ“ FM-CONSUMER-010Handler stub: supabase/functions/pf-handle-capital-project-approved

References