VGSF CONSTITUTIONAL TECHNICAL ARCHITECTURE — BOOK II — APPENDIX B
Appendix B — Certified DDL Catalog
All DDL files are located under
02_DOMAIN/<DOMAIN>/03_engineering/ddl/.
DDL files are constitutional artifacts — they are immutable once certified.
Protected by CLAUDE.md modification rules.
Introduction
The DDL catalog is the operational database of the constitutional domain model. Each certified domain has a set of SQL files that implement its constitutional invariants, triggers, Row-Level Security policies, seed data, and verification suites. These files are the executable expression of the domain's constitutional specification: they transform abstract invariants (DI-xxx, EI-xxx, OI-xxx, AI-xxx, etc.) into database-enforced reality. Every file listed here has passed Phase 5 verification and Phase 6 independent certification; the catalog therefore represents the sum of constitutionally trustworthy database structure that the application stack rests upon. Files are ordered within each domain by their numeric prefix, which encodes the intended deployment sequence — constraints and schemas first, triggers next, RLS and seeds thereafter, verification suites last.
BASE DOMAINS
REF-001 — Party (Identity)
Schema: public (ref001 tables in shared public schema)
Certification Status: CERTIFIED_WITH_OBSERVATIONS (89%); DOMAIN_PERFECTION_V2_CERTIFIED; INSTITUTIONALLY_SELF_SUFFICIENT (CAP036A 2026-06-16)
DDL Files:
| File | Purpose |
|---|---|
001_ref001_constitutional_ddl.sql | Core Party schema: party_type_registry, name_type_registry, location_role_registry, identity_records, and all constitutional tables with invariants; includes btree_gist and postgis extensions; implements AI_SYSTEM party type per CAP-023B |
002_ref001_registry_seed.sql | Registry seed data: party types (PERSON, ORGANIZATION, TEMPLE, TRUST, SYSTEM_ACTOR, AI_SYSTEM), name types (LEGAL, TRADE, ALIAS, SPIRITUAL), location roles (PRIMARY_RESIDENCE, HEADQUARTERS, MAILING, etc.) |
003_ref001_verification_suite.sql | Adversarially-hardened verification suite (CR-007); 20 constitutional assertions covering 11 mutation classes; fixture-isolated; role-context correct; zero silent-pass pathways (CAP-023E/F, CR-004–007) |
REF-002 — Relationship Graph
Schema: public (relationship tables in shared public schema)
Certification Status: CERTIFIED_WITH_OBSERVATIONS (92.5%); DOMAIN_PERFECTION_V2_CERTIFIED; INSTITUTIONALLY_SELF_SUFFICIENT (CAP033A 2026-06-15)
DDL Files:
| File | Purpose |
|---|---|
001_relationship_type_registry.sql | Relationship type registry table with constitutional metadata columns: reciprocal_type_code, is_universal, context_matches_object, exclusivity_group_id, subject/object_identity_type; deferred self-referential FK |
002_relationship_edges.sql | Core relationship edge ledger with G2B denormalization strategy fields and G3E concurrency denormalization columns (canonical subject/object/type) |
003_relationship_constraints.sql | Foreign key constraints linking edges to type registry and REF-001 identity_records; GiST temporal exclusion index via btree_gist extension |
003_ref002_verification_suite.sql | Verification suite: tests reality creation, duplicate prevention, temporal overlap enforcement, and constraint integrity using fixed test UUIDs |
004_relationship_triggers.sql | Validation trigger: enforces history append-only (CAP026J RC-C), canonical direction derivation (G3E), immutable historical records, and retired type blocking |
005_relationship_views.sql | Bidirectional graph view (vw_relationship_graph_bidirectional): unifies forward physical storage and derived reciprocal truth via UNION ALL |
006_relationship_indexes.sql | Performance indexes: subject/object traversal indexes, context/tenant scoping index, bitemporal audit reconstruction index |
007_relationship_non_deletion.sql | Non-deletion enforcement: BEFORE DELETE and BEFORE TRUNCATE triggers on relationship_types and relationship_edges raise constitutional violation exceptions |
008_relationship_bitemporal.sql | Bitemporal audit trigger (trg_relationship_bitemporal_audit): sets recorded_at on INSERT; manages superseded_at on UPDATE per bitemporality contract |
009_relationship_federation.sql | Federation governance trigger: validates universal vs. contextual relationship rules, context identity type enforcement (ORGANIZATION), and context-spoofing prevention |
010_relationship_seed_data.sql | Canonical seed data: 10 core relationship types (PARENT_OF, CHILD_OF, SPOUSE_OF, FORMER_SPOUSE_OF, MEMBER_OF_FAMILY, HAS_FAMILY_MEMBER, STAFF_OF, EMPLOYS, DONOR_TO, BENEFICIARY_OF) |
011_governance_type_registry.sql | CAP026G governance relationship types for Lineage B: 13 governance types including PILLAR_LEADERSHIP, DEPARTMENT_LEADERSHIP, DIVISION_LEADERSHIP (all self-reciprocal) |
012_event_outbox.sql | Event outbox table (ref002_event_outbox) for EAP-001 transactional event publishing; non-deletion guard; index on unpublished events |
013_governance_satellite_tables.sql | CAP026J governance satellite persistence: chief_finance_officer and delegated_finance_officer tables linked to relationship_edges by UUID (GR-001..GR-006 corrections) |
REF-003 — Location and Territory
Schema: public (location tables in shared public schema)
Certification Status: CERTIFIED_WITH_OBSERVATIONS (39/40 97.5%; CAP032G; 2026-06-15; V2.1 Phase 6 complete)
DDL Files:
| File | Purpose |
|---|---|
001_ref003_constitutional_ddl.sql | Location and Territory schema: address_type_registry, place (eternal anchor — place never closes), address with bitemporal validity, geometry table with PostGIS geometry type; includes postgis and btree_gist extensions |
002_ref003_registry_seed.sql | Address type registry seed: POSTAL_UNIVERSAL, INFORMAL_LANDMARK, HISTORIC_NAME, PLUS_CODE, WHAT3WORDS; idempotent via ON CONFLICT DO UPDATE |
003_ref003_verification_suite.sql | Verification suite: tests place seeding, address temporal validity (historic vs. current name), PostGIS geometry insertion, and constitutional invariants (C, D, E test categories) |
REF-004 — Event
Schema: ref004
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP040G 2026-06-18; FIRST domain certified under FS-001; full lifecycle Phase -1 to Phase 6; SC 10/10; completeness gate DS-010 10/10)
DDL Files:
| File | Purpose |
|---|---|
001_ref004_constitutional_ddl.sql | Event Domain schema (schema-qualified ref004): event_type_registry, events table, status_log; enforces EI-001 (no physical deletion), EI-002 (core field immutability), EI-003 (container FK nullable), EI-005 (status log immutability), EI-006 (status state machine), EI-007 (occurred_at discipline); SECURITY INVOKER triggers |
002_ref004_domain_seed.sql | Domain seed: 7 official event types + 2 verification types + 9 seed events; idempotent (DELETE + re-INSERT pattern); all UUIDs are fixed constants per R-REPLAY-001; pre-conditions REF001 party rows documented |
REF-005 — Resource
Schema: ref005
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP050G R-CERT 2026-06-18; SECOND domain certified under FS-001; FIRST with zero implementation defects; 68 PASS/0 FAIL; completeness gate 10/10)
DDL Files:
| File | Purpose |
|---|---|
001_ref005_constitutional_ddl.sql | Resource Domain schema: ref005_resource (root), ref005_resource_transition (append-only balance ledger), ref005_allocation, ref005_transfer_instrument; subtype detail tables for S1 Financial, S2 Material, S3 Capacity, S4 Intangible; enforces EI-001..EI-010 including conservation (EI-002), non-over-allocation (EI-003), bitemporal (EI-008), attribution completeness (EI-009) |
002_ref005_rls.sql | Entity-scope RLS: PERMISSIVE policies on all entity-scoped tables (REF005 DEFECT-5 lesson: RESTRICTIVE-only yields deny-all); enforces PROHIB-001/003 (non-superuser service code, RLS-only entity filtering) |
REF-006 — Document
Schema: ref006
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP050G R-CERT 2026-06-18; SECOND domain certified under FS-001; FIRST with zero implementation defects / no corrective cycle; 68 PASS/0 FAIL)
DDL Files:
| File | Purpose |
|---|---|
001_ref006_constitutional_ddl.sql | Document Domain schema: ref006_document (aggregate root with lifecycle_state Draft/Active/Withdrawn/Archived), ref006_document_version (append-only lineage); SECURITY INVOKER throughout; realizes DI-001..DI-008 fail-closed; open document_type discriminator enables extension without base mutation; extension_ref CHECK IS NULL preserved |
002_ref006_rls.sql | Entity-scope RLS + least-privilege roles (ref006_app NOLOGIN, ref006_verifier NOLOGIN): PERMISSIVE policies on ref006_document and ref006_document_version; entity isolation via session GUC ref006.current_entity_id; ROLES FIRST pattern |
REF-007 — Obligation
Schema: ref007
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP060G R-CERT 2026-06-19; FOURTH domain certified under FS-001; FIRST since REF005 to exercise corrective cycle — DEFECT-1 cleanly resolved; 120 PASS/0 FAIL; completeness gate 11/11)
DDL Files:
| File | Purpose |
|---|---|
001_ref007_constitutional_ddl.sql | Obligation Domain schema: ref007_obligation (aggregate root, mutable ONLY while Proposed), ref007_obligation_transition (append-only ledger); lifecycle Proposed→Committed→Active→Fulfilled→Closed, Cancelled, Breached→Closed, Proposed→Discarded (T9 soft discard); OI-001..OI-009; SECURITY INVOKER; open obligation_kind discriminator |
002_ref007_rls.sql | Entity-scope RLS + least-privilege roles (ref007_app, ref007_verifier): PERMISSIVE policies on ref007_obligation and ref007_obligation_transition; ROLES FIRST; PROHIB-001/002 (non-superuser application role) |
REF-008 — Authority
Schema: ref008
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP070G R-CERT 2026-06-19; FIFTH domain certified under FS-001; FIRST recursive/graph constitutional model; SECOND consecutive defect-free first-pass; 122 PASS/0 FAIL; completeness gate 12/12)
DDL Files:
| File | Purpose |
|---|---|
001_ref008_constitutional_ddl.sql | Authority Domain schema: ref008_authority (aggregate root with self-referential provenance chain conferred_by_authority_id, is_root marker), ref008_authority_event (append-only ledger); lifecycle Proposed→Conferred→Active, Active↔Suspended, Revoked/Expired/Superseded terminal; AI-001..AI-009; SECURITY INVOKER; non-escalation + acyclicity (AI-004) enforced |
002_ref008_rls.sql | Entity-scope RLS + least-privilege roles (ref008_app, ref008_verifier): PERMISSIVE policies on ref008_authority and ref008_authority_event; ROLES FIRST; NO DELETE grant (discard is soft Proposed→Discarded transition only) |
REF-009 — Interaction
Schema: ref009
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP106A 2026-06-23); Phase -1 COMPLETE (CAP095A)
DDL Files:
| File | Purpose |
|---|---|
001_ref009_schema_roles.sql | Schema creation (ref009), roles (ref009_app NOLOGIN; ref009_verifier NOLOGIN BYPASSRLS), SECURITY DEFINER infrastructure, schema grants; CAP100A Stage 1 |
002_ref009_types.sql | interaction_types and interaction_participant_role_registry reference tables; entity-scoped; governance gate on deactivation; open extensible type registry (not ENUM) |
003_ref009_interactions.sql | Core interactions table: primary ledger with three-level privacy (STANDARD/CONFIDENTIAL/RESTRICTED), lifecycle status machine, lifecycle dates, location, notes, recorded_by |
004_ref009_privacy.sql | Three PERMISSIVE SELECT policies on interactions; STANDARD (entity users), CONFIDENTIAL (fn_is_participant), RESTRICTED (fn_has_access_grant); SECURITY DEFINER helpers for CONFIDENTIAL/RESTRICTED to avoid circular RLS |
005_ref009_participants.sql | interaction_participants table: multi-party join, cite-only party_id, no DELETE (DI-003); DI-001 trigger for participant constraint |
006_ref009_outcomes_followups.sql | interaction_outcomes (append-only; outcome_type IN OBSERVATION/DECISION/RECOMMENDATION/ACTION_ITEM/COMMITMENT/FOLLOW_UP_REQUIRED) and interaction_followups tables |
007_ref009_context_transitions.sql | interaction_context_links (polymorphic context: EVENT/INITIATIVE), interaction_transitions (lifecycle state machine ledger), and lifecycle guard trigger |
008_ref009_outbox.sql | ref009_event_outbox table: atomic event queue per UP-004; payload privacy per C-P3-004 (no notes/descriptions/party details); index on unpublished events |
009_ref009_seed.sql | Deterministic seed data with valid hex UUID prefixes (deed=types, cafe=roles, beef=interactions, face=outbox); IMPL-NOTE-002 correction from D5 prefixes |
010_ref009_verification.sql | SELECT-only verification queries (EAG Clause A post-install checks): V1 10 tables exist, V2 RLS enabled/forced, V3 policies on interactions; run as superuser after stages 001–009 |
011_ref009_privacy_escalation.sql | CORR-001: fn_escalate_privacy_level stored procedure — two-step atomic privacy escalation; for RESTRICTED pre-inserts access_grant BEFORE UPDATE so WITH CHECK evaluates correctly |
012_ref009_participant_seam_trigger.sql | CORR-002: BEFORE INSERT trigger on interaction_participants calling fn_validate_party_exists (cross-schema ref001.party enforcement; SECURITY DEFINER for least-privilege cross-schema lookup) |
013_ref009_defense_in_depth_record.sql | CORR-004: Institutional record of privilege-protected mutations (MA-001/002/005/006) — ref009_app holds NO DELETE/UPDATE on these tables so trigger removal has zero effect; design fact documented |
REF-010 — Case / Service Journey
Schema: ref010
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP138A R-CERT 2026-06-24; full lifecycle Phase -1..6 all COMPLETE)
DDL Files:
| File | Purpose |
|---|---|
001_ref010_schema_roles.sql | Schema (ref010), roles (ref010_app NOLOGIN; ref010_verifier NOLOGIN BYPASSRLS), two-GUC convention, GRANT USAGE; CAP122A Stage 1 |
002_ref010_case_types.sql | case_types reference table: primary_subject_type CHECK (PERSON/FAMILY/HOUSEHOLD/COMMUNITY_UNIT/ORGANIZATION/ANY); code is immutable once set |
003_ref010_cases.sql | cases root entity + lifecycle trigger: lifecycle PROPOSED→OPEN→ASSESSMENT→PLANNING→IMPLEMENTATION→REVIEW→CLOSED→ARCHIVED; opened_at/closed_at/archived_at temporal discipline; optional initiative_id FK to ref014 |
004_ref010_case_subjects.sql | case_subjects membership surface: subject_role (PRIMARY/CO_SUBJECT/SECONDARY); BL-1 multi-subject ruling; unique constraint (case_id, subject_party_id) |
005_ref010_case_events.sql | case_events append-only ledger: event_type CHECK (OPENED/ASSESSED/PLANNED/IMPLEMENTATION_STARTED/REVIEWED/CLOSED/REOPENED/ARCHIVED/HOLDER_TRANSFERRED/SUBJECT_ADMITTED/SUBJECT_DISCHARGED/NOTE_ADDED); II-016 immutability |
006_ref010_case_interactions.sql | case_interactions cross-domain membership surface: FK to ref009.interactions (AR-2); shared_session trigger (BL-5 ruling); privacy delegation (F-004 resolution) |
007_ref010_case_composites.sql | Six composite membership tables: case_assessments, case_goals, case_service_plans, case_reviews, case_milestones, case_referrals, case_risks; admission gate trigger applies to all |
008_ref010_admission_gate.sql | fn_admission_gate trigger function: rejects INSERT into any case membership surface when parent case status is not ACTIVE (OPEN/ASSESSMENT/PLANNING/IMPLEMENTATION/REVIEW); II-012 AR-5 lifecycle dominance |
009_ref010_rls.sql | RLS policies: documents cross-cutting RLS notes and case_interactions SELECT policy (F-004/PF-001 resolution — delegates to ref010.fn_interaction_visible which calls ref009 certified privacy semantics) |
REF-011 — Schedule
Schema: ref011
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP146A R-CERT 2026-06-24; 87.0% composite; full lifecycle Phase -1..6)
DDL Files:
| File | Purpose |
|---|---|
001_ref011_schema_roles.sql | Schema (ref011), roles (ref011_app NOLOGIN; ref011_verifier NOLOGIN BYPASSRLS), two-GUC convention; CAP141A DDL 001 |
002_ref011_tables.sql | ref011.schedules (root entity) and ref011.schedule_events (append-only ledger); classification columns (schedule_purpose, calendar_system GREGORIAN/VEDIC/HYBRID, subject_type); rrule_spec for iCal RFC 5545 and vedic_tithi_spec for Vedic tithi grammar |
003_ref011_triggers_functions.sql | Lifecycle trigger: append-only enforcement on schedule_events (SI-004); lifecycle transition guard on schedules (ARCHIVED fully terminal SI-007; immutable fields enforcement); SI-001..SI-007 |
004_ref011_rls.sql | Entity-scope RLS (PERMISSIVE, FORCE ROW LEVEL SECURITY): ref011_schedules and ref011_schedule_events isolated by session GUC app.entity_id |
005_ref011_seeds.sql | Verification seed dataset: one seed schedule per major scenario (purpose × calendar_system × lifecycle path); GREGORIAN RRULE, VEDIC tithi, HYBRID; FIXED UUIDs for reproducibility; pre-conditions REF001 and REF003 seed parties/places |
006_ref011_generation_gate.sql | fn_assert_generation_permitted: S3-OBL-1 Generation Gate function; application service layer MUST call before creating REF004 Event records carrying schedule_id; raises exception if Schedule not ACTIVE (CAP143A D3) |
007_ref011_validators.sql | validate_vedic_tithi_spec function (IMMUTABLE): enforces §S4.GRAMMAR including MASA-YEARLY rule (CAP142A R2-SPEC-003); CHECK constraints added via ALTER TABLE; validate_rrule_spec for iCal RRULE (CAP142A R2-SPEC-002); all seeds pass on deployment |
REF-013 — Knowledge
Schema: ref013
Certification Status: CERTIFIED (CAP136A R-CERT 2026-06-24; full lifecycle Phase -1..6 all COMPLETE)
DDL Files:
| File | Purpose |
|---|---|
001_ref013_schema_roles.sql | Schema (ref013), roles (ref013_app NOLOGIN; ref013_verifier NOLOGIN BYPASSRLS), single-GUC convention; CAP134A Stage 1 |
002_ref013_knowledge_types.sql | knowledge_types classification reference: code immutable once set (KI-009); ND-001 no-delete trigger; FK to ref001.party on created_by |
003_ref013_knowledge_items.sql | knowledge_items root entity: lifecycle DRAFT→UNDER_REVIEW→PUBLISHED→DEPRECATED→ARCHIVED; prior_version_id lineage chain; version_number trigger-computed (VL-004); KI-001..KI-007, VL-001, VL-004, SM-001..SM-016, ND-001 |
004_ref013_knowledge_events.sql | knowledge_events append-only ledger: event_type CHECK (CREATED/SUBMITTED/RETURNED/PUBLISHED/DEPRECATED/ARCHIVED); KI-008 ledger immutability; ND-002 no DELETE at any role level |
005_ref013_rls.sql | Status-based RLS (not subject-based — no personal data in content): PUBLISHED/DEPRECATED → KNOWLEDGE_READER; ARCHIVED → KNOWLEDGE_CURATOR; DRAFT → creator/CURATOR/PUBLISHER; fn_publish_item (OP-05 atomic publish with recursive lineage deprecation — CAP132A F-002 corrected full lineage check) |
REF-014 — Initiative
Schema: ref014
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP080G R-CERT 2026-06-19; SIXTH domain certified under FS-001; FIRST AGGREGATE-ROOT; THIRD consecutive defect-free first-pass; 70 PASS/0 FAIL)
DDL Files:
| File | Purpose |
|---|---|
001_ref014_constitutional_ddl.sql | Initiative Domain schema: ref014_initiative (aggregate ROOT, mutable ONLY while Proposed), ref014_initiative_event (append-only ledger), ref014_membership (root-OWNED edge), ref014_membership_event (append-only); acyclic membership DAG (RULE-IN4); HIGHEST-PRIORITY PROPERTY: edge-cascade ≠ member-cascade (MB-6/TC-BI-3/PO-3) — closing root cascade-closes OWNED EDGES only, never member lifecycle_state; II-001..II-012, MB-1..8, RA-1..6 |
002_ref014_rls.sql | Entity-scope RLS on all four entities (initiative, initiative_event, membership, membership_event): PERMISSIVE policies; ROLES FIRST (ref014_app, ref014_verifier); NO DELETE grant (no physical-deletion path — discard soft; ledgers append-only/governed) |
EXTENSION AND SPECIALIZATION DOMAINS
REF006.X1 — Policy (Governance Instrument)
Schema: ref006x1
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP050X-G R-CERT 2026-06-22; THE FIRST CERTIFIED VGSF GOVERNANCE INSTRUMENT and SECOND certified .Xn; zero parent mutation; SC 5/5; no corrective cycle)
DDL Files:
| File | Purpose |
|---|---|
001_ref006x1_ddl.sql | Policy extension data model: ref006x1_policy (S3 extension-owned governance qualification, governance_kind, subject_class, scope) + ref006x1_authority_citation table; reverse FK policy_id PK → ref006.ref006_document; POL-INV-1..12 |
002_ref006x1_rls.sql | PERMISSIVE RLS with FORCE ROW LEVEL SECURITY on both extension tables; entity isolation via ref006x1.current_entity_id GUC; SECURITY INVOKER discipline throughout |
003_ref006x1_seam_and_functions.sql | Seam contracts (SECURITY DEFINER owned by ref006_app / ref008_app) composing certified parent APIs without mutation; Policy lifecycle functions (fn_*_policy, SECURITY INVOKER); entity GUC thread-through to parents |
004_ref006x1_legitimacy.sql | Force predicate (SD-2 exact realization): fn_force_in_effect — DERIVED, never stored; force_in_effect ≡ root=Active ∧ version_status=Issued ∧ effective_time≤now ∧ cited Authority valid; suspension of backing Authority flips predicate with zero Policy writes (IP-7/DOR-1) |
REF006.X2 — Directive (Governance Instrument)
Schema: ref006x2
Certification Status: CERTIFIED_WITH_OBSERVATIONS 100% (CAP174A R-CERT 2026-06-25; ERA_043; DS-001 PERFECTED)
DDL Files:
| File | Purpose |
|---|---|
001_ref006x2_ddl.sql | Directive extension data model: directive_properties table with commanding triple (target_party_scope, compliance_deadline, required_action_spec — all NOT NULL); governance_kind pinned to 'command.specific.bounded.parties'; compliance lifecycle status machine; directive_id PK = FK → ref006.ref006_document |
002_ref006x2_rls.sql | PERMISSIVE RLS with FORCE ROW LEVEL SECURITY on directive_properties; entity isolation via ref006x2.current_entity_id GUC; OBL-15 |
003_ref006x2_seam_and_functions.sql | A-seams (SECURITY DEFINER, ref006_app-owned) composing REF006 lifecycle API; B-seam (SECURITY DEFINER, ref008_app-owned) for read-only authority validity; Directive lifecycle C-functions (SECURITY INVOKER); zero parent mutation (OBL-14) |
004_ref006x2_view.sql | vw_directives derived force view (S4 Emergent Surface): projects directive with REF006 document head state, extension compliance status, and effective_status (OVERDUE when ISSUED + deadline passed); recomputed on every SELECT |
REF006.X3 — License (Governance Instrument)
Schema: ref006x3
Certification Status: CERTIFIED_WITH_OBSERVATIONS 100% (CAP182A R-CERT 2026-06-25; ERA_044; FIRST REF007 cross-reference; DS-001 PERFECTED)
DDL Files:
| File | Purpose |
|---|---|
001_ref006x3_ddl.sql | License extension data model: licence_properties (permission grant attributes, status state machine DRAFT→ACTIVE→SUSPENDED→REVOKED/EXPIRED, revocation conditions, licensee_party_id cite-only) + licence_obligations cross-reference table (FK to ref007.ref007_obligation; optional 0-or-1 per licence; obligation_kind='LICENCE_BILATERAL') |
002_ref006x3_rls.sql | PERMISSIVE RLS on licence_properties and licence_obligations; entity isolation via ref006x3.current_entity_id GUC; verifier role read-only access for verification suite |
003_ref006x3_functions.sql | Service functions: fn_issue_licence, fn_suspend_licence, fn_reinstate_licence, fn_revoke_licence, fn_check_licence_validity; SECURITY INVOKER; cite-only party validation at service layer |
004_ref006x3_grants.sql | Least-privilege grants: ref006x3_app (SELECT/INSERT/UPDATE on tables, SELECT on view, EXECUTE on functions); ref006x3_verifier (SELECT only); schema USAGE grants |
REF006.X4 — Mandate (Governance Instrument)
Schema: ref006x4
Certification Status: CERTIFIED_WITH_OBSERVATIONS 96% (CAP190A R-CERT 2026-06-25; ERA_045; cleanest Phase 0 admission in extension batch; DS-001 PERFECTED)
DDL Files:
| File | Purpose |
|---|---|
001_ref006x4_ddl.sql | Mandate extension data model: ref006x4_mandate qualification table; mandate_id PK = FK → ref006.ref006_document; mandating_authority_id cite-only (no cross-schema FK per EX-N-2); dual lifecycle (REF006 document spine + mandate status); MI-002 no-delete trigger |
002_ref006x4_rls.sql | PERMISSIVE RLS with FORCE ROW LEVEL SECURITY on ref006x4_mandate; entity isolation via ref006x4.current_entity_id GUC; schema USAGE grants; NO DELETE grant for ref006x4_app |
003_ref006x4_functions.sql | Part A (REF006 seam contracts, SECURITY DEFINER ref006_app-owned); Part B (REF008 read-only seam); Part C (Mandate lifecycle functions: fn_issue_mandate, fn_revoke_mandate, fn_suspend_mandate, fn_reinstate_mandate, fn_expire_mandate, fn_check_mandate_active — SECURITY INVOKER); Part D (vw_mandates view); Part E (EXECUTE grants) |
REF007.X1 — Financial Obligation
Schema: ref007x1
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP061G R-CERT 2026-06-20; THE FIRST CERTIFIED VGSF EXTENSION (.Xn); zero parent mutation; SC 6/6; no corrective cycle)
DDL Files:
| File | Purpose |
|---|---|
001_ref007x1_ddl.sql | Financial Obligation extension: ref007x1_financial_obligation (obligation_id PK = FK → ref007.ref007_obligation; amount CHECK > 0; currency_code NOT NULL; reservation_status state machine; fund_resource_id logical cite to REF005) + ref007x1_encumbrance_ledger (append-only linkage; FO-INV-1..7); zero parent mutation |
002_ref007x1_rls.sql | PERMISSIVE entity-isolation policies on both extension tables; ref007x1_app NON-SUPERUSER (PROHIB-001); BYPASSRLS verifier for test/seed only; Federation boundary: ref007x1_app holds NOTHING on ref005 schema — reaches REF005 only via EXECUTE on seam functions |
003_ref007x1_seam_and_functions.sql | SECURITY DEFINER seam contracts (owned by ref005_app / ref007_app): place-hold (INSERT ALLOCATION to REF005), release-hold (INSERT RELEASE), liquidate (INSERT CONSUMPTION); three-phase reservation protocol (CBM-1..3); CONS-1 inherited from REF005 EI-003 |
004_ref007x1_conservation.sql | Three-tier conservation: T-SEAM (inherited from REF005 EI-003 gate); T-LOCAL (append-only encumbrance guard FO-INV-6, immutable financial terms, governed reservation_status, no-delete); T-RECON (fn_reconcile_assert backstop — zero-tolerance drift check, RAISES on any drift FC-3) |
REF008.X1 — Financial Authority
Schema: ref008x1
Certification Status: CERTIFIED_WITH_OBSERVATIONS (CAP197A R-CERT 2026-06-25; ERA_041; AX-1..AX-8; 16 VOs PASS; DS-001 PERFECTED)
DDL Files:
| File | Purpose |
|---|---|
001_financial_authority_tables.sql | Financial Authority Mandate table: mandate_id PK = FK → ref008.ref008_authority; threshold_amount CHECK > 0; currency_code CHAR(3); co_authority_id (Four-Eyes mandate FK to ref008; no self-co-signing CHECK); resolution_reference NOT NULL; mandate_status CHECK IN (...); FA-1..FA-16 enforced (FA-12 no-delete trigger; FA-13 immutability trigger; FA-14 temporal validity CHECK) |
002_financial_authority_seed.sql | Verification-only seed data: synthetic REF008 authority records for test purposes; direct insertion (bypassing service layer); follows standard seed pattern (DO block with conflict handling) |
003_financial_authority_functions.sql | Service functions: fn_grant_financial_authority (sole write entry; FA-9); fn_suspend_financial_authority, fn_reinstate_financial_authority, fn_revoke_financial_authority, fn_check_authorization; SECURITY INVOKER; GUC ref008x1.current_entity_id required before DML |
004_financial_authority_view.sql | vw_financial_mandates: operational view of ACTIVE mandates joining REF008 authority holder and co-authority context |
005_financial_authority_grants.sql | Least-privilege grants: ref008x1_app (INSERT/SELECT/UPDATE on mandate table; SELECT on view; EXECUTE on all functions); ref008x1_verifier (SELECT only); schema USAGE grants |
REF008.X2 — Governance (Authority × Initiative)
Schema: ref008x2
Certification Status: CERTIFIED_WITH_OBSERVATIONS 100% (CAP166A R-CERT 2026-06-25; ERA_042; GI-1..GI-7 invariants; DS-001 PERFECTED)
DDL Files:
| File | Purpose |
|---|---|
001_ref008x2_constitutional_ddl.sql | Governance scope junction table (governance_authority_scope): records WHO holds WHAT authority WITHIN a specific initiative; initiative_scope_id FK → ref014.ref014_initiative (constitutional discriminator per CAP159A D4); scope_type CHECK (closed set); uniqueness partial index for ACTIVE grants (GI-4); temporal consistency CHECK (GI-5); no-delete trigger (GI-7); zero parent mutation |
002_ref008x2_functions.sql | Service functions: fn_grant_governance_authority (creates ACTIVE scope record; enforces GI-1 authority state, GI-2 initiative state, GI-6 entity coherence; SECURITY INVOKER); fn_revoke_governance_authority (sets REVOKED; GI-7 no delete) |
REF009.C1 — Communication (Interaction Specialization)
Schema: ref009 (sub-tables extend parent ref009 schema)
Certification Status: CERTIFIED_WITH_OBSERVATIONS 96% (CAP157A R-CERT 2026-06-25; ERA_040; 23/23 VOs PASS; DS-001 PERFECTED; CERT-OBS-001: S3-OBL-2 sent_at at IN_PROGRESS not verified [LOW severity])
DDL Files:
| File | Purpose |
|---|---|
001_communication_tables.sql | Communication sub-tables: communication_properties (1:1 extension of ref009.interactions; direction, channel_type, sender_party_id, sent_at, received_at, delivery_status, delivery_notes) + communication_recipients (1:many); ZERO PARENT MUTATION CONTRACT: no ALTER on any existing ref009.* object (PS-CAP150A-001/S6-OBL-1) |
002_communication_types.sql | Interaction type seed rows for Communication family: 6 type codes using 'c0de' hex prefix (c0de0001..c0de0006): OUTBOUND_ANNOUNCEMENT, OUTBOUND_MESSAGE, INBOUND_INQUIRY, INBOUND_FEEDBACK, NEWSLETTER, NOTIFICATION; INSERT INTO existing ref009.interaction_types (additive data operation only) |
003_communication_functions.sql | Trigger functions and service functions: fn_validate_communication_type (SECURITY DEFINER CI-4 type gate), fn_trig_comm_type_gate, fn_trig_direction_immutable, fn_trig_channel_type_immutable, fn_trig_outbound_recipient_gate (CI-3), fn_trig_delivery_status_guard (S4-OBL-1 forward-only), fn_create_communication (S6-OBL-2 sole authorized entry point), fn_record_delivery, fn_mark_received |
004_communication_view.sql | vw_communications convenience view: joins interaction + communication_properties + interaction_types into a single row per Communication; RLS inherited from ref009.interactions (FORCE ROW LEVEL SECURITY propagates through JOIN); read-only; no INSTEAD OF triggers |
005_communication_grants.sql | Grants on all new objects: ref009_app (INSERT/SELECT/UPDATE on new tables, SELECT on view, EXECUTE on all new functions; NO DELETE — UI-007); ref009_verifier (SELECT only; BYPASSRLS) |
006_communication_immutability.sql | CAP154A corrective DDL: fn_trig_channel_type_immutable (R2-DDL-002 gap closure) and fn_trig_direction_immutable (CREATE OR REPLACE for idempotency); channel_type always-immutable post-INSERT (IMP-DECISION-001: stricter than post-COMPLETED); ZERO PARENT MUTATION CONTRACT preserved |
Summary Table
| Domain | Schema | File Count | Has RLS | Has Seeds | Has VF Suite |
|---|---|---|---|---|---|
| REF-001 Party | public | 3 | No (public schema) | Yes | Yes |
| REF-002 Relationship Graph | public | 13 | No (public schema) | Yes (files 010, 011) | Yes |
| REF-003 Location and Territory | public | 3 | No (public schema) | Yes | Yes |
| REF-004 Event | ref004 | 2 | In migration (separate) | Yes | Inline |
| REF-005 Resource | ref005 | 2 | Yes | No (separate) | Inline |
| REF-006 Document | ref006 | 2 | Yes | No (separate) | Inline |
| REF-007 Obligation | ref007 | 2 | Yes | No (separate) | Inline |
| REF-008 Authority | ref008 | 2 | Yes | No (separate) | Inline |
| REF-009 Interaction | ref009 | 13 | Yes | Yes | Yes |
| REF-010 Case / Service Journey | ref010 | 9 | Yes | No (separate) | Inline |
| REF-011 Schedule | ref011 | 7 | Yes | Yes | Inline |
| REF-013 Knowledge | ref013 | 5 | Yes | No (separate) | Inline |
| REF-014 Initiative | ref014 | 2 | Yes | No (separate) | Inline |
| REF006.X1 Policy | ref006x1 | 4 | Yes | No (separate) | No (parent VF) |
| REF006.X2 Directive | ref006x2 | 4 | Yes | No (separate) | No (parent VF) |
| REF006.X3 License | ref006x3 | 4 | Yes | No (separate) | No (parent VF) |
| REF006.X4 Mandate | ref006x4 | 3 | Yes | No (separate) | No (parent VF) |
| REF007.X1 Financial Obligation | ref007x1 | 4 | Yes | No (separate) | No (parent VF) |
| REF008.X1 Financial Authority | ref008x1 | 5 | Yes | Yes | Yes |
| REF008.X2 Governance | ref008x2 | 2 | Yes | No (separate) | Inline |
| REF009.C1 Communication | ref009 | 6 | Yes (inherited) | Yes | Inline |
Catalog reflects DDL state as of 2026-06-26. Total files across all certified domains: 101 SQL files.
All DDL files are constitutional artifacts protected by CLAUDE.md modification rules.
DDL files are immutable post-certification except under explicit Primary Steward authorization (new programs required for any amendment).
APPENDIX_B_DDL_CATALOG.md | Book II Appendix B | Phase 1 Compilation | 2026-06-26
