Extending the Data Layer & Protocols
Relevant source files
The following files were used as context for generating this wiki page:
The RDM Digital platform utilizes a federated data architecture designed to support a "Sovereign Urban Operating System." This system integrates digital identity, territorial mapping, and governance protocols through a multi-layered schema. The data layer is structured around seven core federations that govern modules ranging from economy and technology to health and culture.
Sources: README.md, scripts/001_rdm_schema.sql:1-10
Federated Architecture and Domain Structure
The core of the system is the federations table, which serves as the organizational root for all modules and services. Each federation manages its own domain (e.g., tech.tamv.online) and a specific set of active modules stored as JSONB.
Federation Definitions
The system identifies seven primary federations, each with specific strategic objectives and technological assignments.
| Federation ID | Motto | Primary Modules |
|---|---|---|
tecnologica | Infraestructura cognitiva | Isabella AI, Kernel, Nexus, Quantum |
economica | Comercio soberano | Mercado, MSR, BookPI, Stripe |
gubernamental | Soberanía digital | Protocolos, EOCT, CITEMESH, Nodos |
educativa | Saber sin fronteras | UTAMV, Masterclass, Biblioteca |
cultural | Memoria viva del territorio | Manuscrito, Museos, Rituales |
salud | Bienestar federado | Telesalud, Clínicas |
comunicacion | Voz del territorio | Radio, Prensa, Blog |
Sources: supabase/migrations/20260512080845_110fe96e-4027-403f-98c8-f6d495c1bf4c.sql:11-30, src/lib/types.ts:1-11
Domain Relationships
The following diagram illustrates how federations link disparate system entities like Points of Interest (POIs) and Repositories to a unified governance structure.
The diagram shows the central role of the federation_id in categorizing territorial and technical assets.
Sources: src/integrations/supabase/types.ts:285-350, scripts/001_rdm_schema.sql:41-60
Protocol Execution and Auditability
The platform implements specialized protocols for operational governance, notably EOCT, MSR, and BookPI. These protocols are executed via Supabase Edge Functions and recorded in immutable audit tables.
Protocol Data Structures
Operational transparency is maintained through several key tables that capture the state and execution history of system protocols:
protocol_executions: Tracks individual actions, decisions, and their associated SHA-256 hashes.audit_signatures: Provides a forensically verifiable chain of custody for resources using SHA-256 hashes signed by authorized entities.bookpi_entries: Acts as a multi-state record (MSR) ledger for narratives and system events.
Sources: supabase/migrations/202605080001_lovable_federated_kernel.sql:63-95, src/integrations/supabase/types.ts:50-75
Edge Function Execution Flow
The protocols-execute function orchestrates system state queries and audit logging. It enforces authentication for non-public operations and serializes analytics payloads.
This flow ensures that all critical executions are logged in the analytics table for future auditing.
Sources: supabase/functions/protocols-execute/index.ts:1-60
Extended Data Models
Sovereign Identity and Profiles
Identity is managed via the profiles table, which extends standard authentication with roles such as arquitecto, ia, and ciudadano. It includes support for ORCID identifiers and CITEMESH consent flags.
| Field | Type | Description |
|---|---|---|
role | text | Restricted to ciudadano, comercio, institucion, ia, gobierno, arquitecto. |
citizenship_id | text | Unique sovereign identity string. |
consent_citemesh | boolean | Flag for anti-extractive citation protocol participation. |
Sources: scripts/001_rdm_schema.sql:14-30, src/lib/types.ts:47-55
Territorial POIs and Geography
The system models Real del Monte as a "Digital Twin" through versioned structural entities. The pois table (and its territorial variant territory_pois) includes fields for altitude and historical significance, mapping physical locations to digital federations.
export type TerritoryPOI = {
id: string
name: string
category: string
lat: number
lng: number
altitude_m: number | null
description: string | null
significance: string | null
federation_id: string | null
}
Sources: src/lib/types.ts:13-24, src/components/rdm/territory.tsx:30-100
Economic Layer: Merchants and Tariffs
The economic federation utilizes a tiered tariff system for local businesses. The businesses and merchants tables integrate with Stripe for payment status tracking and monthly fee management.
| Commerce Type | Registration Fee (Cents) | Monthly Fee (Cents) |
|---|---|---|
gondola | 24,900 | 20,000 |
tiendita | 29,900 | 25,000 |
hotel | 69,900 | 50,000 |
premium | 269,900 | 69,900 |
Sources: supabase/migrations/202605080001_lovable_federated_kernel.sql:105-120, src/integrations/supabase/types.ts:77-130
Summary
Extending the data layer within RDM Digital involves adhering to the heptafederated structure where every repository, point of interest, and transaction is mapped to a specific governance domain. This architecture ensures that technical implementation never violates the underlying ontological and constitutional frameworks defined in the project's canonical volumes.
Sources: src/components/rdm/tomos.tsx:50-100, README.md