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.

Feature ID: FW-55
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 introduces fw_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)

DependencyTypePurpose
FW-01 / FW-06 / FW-03 / FW-16 / FW-15 / FW-41 / FW-54FW internalJSON/config sources for scanners
PF-30Platformfw.dependencies.view, fw.dependencies.maintain
PF-04 / auditPlatformfw_dependency_force_delete, fw_dependency_graph_full_rebuild
@xyflow/reactUI libraryGraph visualization

API / Contracts

  • Client: Supabase client reads/writes fw_dependency_graph under RLS; server-side rebuild and optional replaceEdgesForSource batching use SECURITY DEFINER RPC(s) or documented service path (see spec API Design).
  • Routes: /fw/settings/dependency-graph, /fw/settings/unused-entities (lazy in src/routes/fw.tsx; labels in route-labels.ts); Settings hub links from FWSettings.tsx when fw.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

LayerLocationUsage
Permissions@/platform/permissionsuseHasPermission('fw.dependencies.view' | 'fw.dependencies.maintain')
AuditPlatform audit helperLog 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).