Version: 1.0Documentation 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: ✅ Implemented
Last Updated: 2026-02-27
Overview
PF-18 provides real-time organizational data synchronization and data lineage tracking across all cores. When org entities (departments, sites) change, affected modules are notified via sync events and lineage is automatically captured.Integration Pattern
Type: Event-Based + Platform LayerPublisher: PF (via
pg_notify on pf_org_data_sync_events INSERT)Consumer:
org-data-sync-consumer Edge FunctionChannel:
org_data_changes
Tables
| Table | Purpose |
|---|---|
pf_org_data_sync_events | Tracks org data change propagation events |
pf_data_lineage | Records data flow relationships between entities |
pf_data_lineage_archive | Archived lineage records (3+ years old) |
pf_retention_log | Logs retention job executions |
pf_org_hierarchies | Placeholder for Phase 4 hierarchy features |
Event Contract
Event:org_data_changedChannel:
org_data_changes (pg_notify)
Platform API
Import Path
Hooks
| Hook | Purpose |
|---|---|
useChangeImpact(orgId, entityType, entityId) | Preview affected modules before committing changes |
useSyncEventsList(orgId, limit?) | List recent sync events with status |
useRetrySyncEvent() | Reset failed event to pending |
useLineageBySource(orgId, entityType, entityId) | Get downstream lineage graph |
useLineageByDestination(orgId, entityType, entityId) | Get upstream lineage graph |
Components
| Component | Purpose |
|---|---|
ChangeImpactPreview | Sheet showing affected modules before org changes |
PropagationStatus | Table of sync events with retry capability |
LineageVisualization | React Flow graph of data lineage |
Permissions
| Key | Description | Roles |
|---|---|---|
pf.org_data_sync.view | View sync events | org_admin, staff |
pf.org_data_sync.retry | Retry failed events | org_admin |
pf.data_lineage.view | View data lineage | org_admin (CR-341: restrict to org_admin only; staff access removed — lineage data reveals organizational data flow topology) |
Edge Functions
| Function | Purpose |
|---|---|
org-data-sync-consumer | Polls pending events, dispatches to module handlers |
org-data-sync-retry | Resets failed event to pending (permission-gated) |
Module Handler Interface
Cores implement handlers in the consumer edge function:hr, fa, rh. Cores implement real handlers as needed.
Routes
| Path | Component | Permission |
|---|---|---|
/settings/sync-status | SyncStatusPage | pf.org_data_sync.view |
Deferred
- Phase 4: Advanced hierarchy features (
pf_org_hierarchiestable created but not consumed) - Partitioning on
pf_data_lineage(deferred until volume warrants) hr_employeeslineage trigger (deferred to avoid conflicts)