Feature ID: FW-55Documentation 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: π Specification
Spec Reference: FW-55-form-workflow-dependency-graph.md
Last Updated: 2026-03-22 (audit action names aligned with spec FR-5)
Overview
FW-55 introducesfw_dependency_graph, a tenant-scoped edge store between FW configuration entities (forms, workflows, automation rules, decision tables, events, lookup configs). Scanners run on entity save (application hooks) to keep edges current; optional scheduled full rebuild reduces drift.
Cross-core: None in MVPβedges are FW-internal only. Platform dependencies: PF-30 (permissions), PF-04 / pf_audit_logs (audit for maintain actions).
Integration Points (from Spec)
| Dependency | Type | Purpose |
|---|---|---|
| FW-01 / FW-06 / FW-03 / FW-16 / FW-15 / FW-41 / FW-54 | FW internal | JSON/config sources for scanners |
| PF-30 | Platform | fw.dependencies.view, fw.dependencies.maintain |
| PF-04 / audit | Platform | fw_dependency_force_delete, fw_dependency_graph_full_rebuild |
@xyflow/react | UI library | Graph visualization |
API / Contracts
- Client: Supabase client reads/writes
fw_dependency_graphunder RLS; server-side rebuild and optionalreplaceEdgesForSourcebatching use SECURITY DEFINER RPC(s) or documented service path (see spec API Design). - Routes:
/fw/settings/dependency-graph,/fw/settings/unused-entities(lazy insrc/routes/fw.tsx; labels inroute-labels.ts); Settings hub links fromFWSettings.tsxwhenfw.dependencies.view. - Hooks:
useDependencyImpact(targetType, targetId)for entity under delete review (dependents = rows where target matches);useDependencyGraph(filters),useOrphanReport(filters)(exact names in implementation). - Mutations:
refreshDependenciesForSource(orgId, sourceType, sourceId)(or RPC equivalent) invoked post-save from form/workflow/automation save flowsβmust run in same UX success path as entity persist (or compensating retry). Transitive impact count uses BFS with 500 unique(source_type, source_id)vertex cap (spec FR-3).
Platform Integration Layer Usage
| Layer | Location | Usage |
|---|---|---|
| Permissions | @/platform/permissions | useHasPermission('fw.dependencies.view' | 'fw.dependencies.maintain') |
| Audit | Platform audit helper | Log maintain/force actions; no PHI in payload |
Security and Tenant Isolation
- RLS:
fw_has_org_access(organization_id, auth.uid())on all operations; UPDATE policies include WITH CHECK. - Defense in depth: mutations that rewrite edges include
.eq('organization_id', orgId). - Scanners read only FW tables already governed by org RLS; do not copy free-text field values into
metadata.
Event Contracts
- No new cross-core domain events in MVP.
- Optional: internal audit events only (see spec FR-5).