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.

Generated: 2026-01-11
Total Tables: 433
Overall Coverage: 94.2%

Executive Summary

MetricCountPercentage
Tables with Full Coverage (4 policies)40894.2%
Tables with Partial Coverage (intentional)204.6%
Tables with Special Access Patterns51.2%
Tables Missing RLS00.0%

Coverage by Module

ModulePrefixTotal TablesFullPartialSpecial
Platform Foundationpf_736832
Human Resourceshr_757041
Finance & Accountingfa_454320
Forms & Workflowfw_544842
Recovery Housingrh_514920
Facilities Managementfm_222110
Governance & Riskgr_494720
Leadership OSlo_292810
IT Service Managementit_353410

Policy Type Coverage

UPDATE Policies WITH CHECK Clause

StatusCountNotes
✅ Has WITH CHECK398All UPDATE policies have WITH CHECK
⚠️ Missing WITH CHECK0None remaining after audit

Recursion-Safe Policies

StatusCountNotes
✅ Uses SECURITY DEFINER helpers433All policies use helper functions
❌ Direct pf_user_roles query0None remaining after audit

Detailed Coverage Tables

Platform Foundation (PF)

TableSELECTINSERTUPDATEDELETEWITH CHECKNotes
pf_organizations
pf_profiles
pf_sites
pf_user_roles
pf_departments
pf_notifications
pf_documents
pf_document_versions---Version table (immutable)
pf_audit_logs---Audit table (append-only)
pf_health_metricsPlatform admin only
pf_integration_credentialsDeny-all (service-only)
pf_marketplace_ratingsPublic read intentional

Human Resources (HR)

TableSELECTINSERTUPDATEDELETEWITH CHECKNotes
hr_employees
hr_positions
hr_departments_v
hr_leave_requests
hr_leave_balances
hr_timesheets
hr_timesheet_entries
hr_payroll_runs
hr_payroll_records
hr_payroll_audit_log---Audit table
hr_ssn_access_log---Audit table
hr_document_access_logs---Audit table

Finance & Accounting (FA)

TableSELECTINSERTUPDATEDELETEWITH CHECKNotes
fa_accounts
fa_funds
fa_journal_entries
fa_journal_entry_lines
fa_invoices
fa_customers
fa_bills
fa_vendors
fa_budgets
fa_bank_accounts

Forms & Workflow (FW)

TableSELECTINSERTUPDATEDELETEWITH CHECKNotes
fw_forms
fw_form_versions---Version table
fw_form_submissions
fw_workflows
fw_workflow_versions---Version table
fw_approval_history---Audit table
fw_signature_audit_log---Audit table
fw_portal_rate_limits----Public read (rate limiting)
fw_automation_logs---Audit table

Tables with Special Access Patterns

These tables intentionally have non-standard RLS configurations:
TablePatternReason
pf_integration_credentialsDeny-allService-only access via SECURITY DEFINER functions
pf_marketplace_ratingsPublic SELECTRatings are publicly visible for transparency
fw_portal_rate_limitsPublic SELECTRate limits must be readable for client-side enforcement
pf_health_metricsPlatform admin onlySystem metrics restricted to platform admins
pf_platformsSystem tablePlatform-level configuration

Audit/Version Tables (Intentional Partial Coverage)

These tables are intentionally limited to SELECT + INSERT (append-only):

Audit Tables

  • pf_audit_logs
  • pf_index_cleanup_audit
  • hr_document_access_logs
  • hr_payroll_audit_log
  • hr_ssn_access_log
  • fw_approval_history
  • fw_domain_events
  • fw_signature_audit_log
  • fw_automation_logs
  • fm_asset_maintenance_history
  • fm_work_order_history
  • fm_inventory_transactions

Version Tables (Immutable)

  • pf_document_versions
  • fw_form_versions
  • fw_workflow_versions
  • gr_policy_versions
  • lo_knowledge_article_versions
  • it_kb_article_versions

Validation Queries

Check Tables Without RLS

SELECT tablename
FROM pg_tables
WHERE schemaname = 'public'
  AND tablename NOT LIKE 'pg_%'
  AND tablename NOT IN (
    SELECT tablename FROM pg_policies WHERE schemaname = 'public'
  );

Check UPDATE Policies Without WITH CHECK

SELECT tablename, policyname
FROM pg_policies
WHERE schemaname = 'public'
  AND cmd = 'UPDATE'
  AND with_check IS NULL;

Check Policy Coverage Count

SELECT tablename, COUNT(*) as policy_count
FROM pg_policies 
WHERE schemaname = 'public'
GROUP BY tablename
ORDER BY policy_count, tablename;