Evolutionary GitHub Repository Integration
Relevant source files
The following files were used as context for generating this wiki page:
The Evolutionary GitHub Repository Integration is a core architectural component of RDM Digital designed to ingest, classify, and normalize external codebases into a federated territorial database. It serves as the project's "evolutionary repository," acting as a live knowledge base that tracks the development of the TAMV/RDM ecosystem by syncing data directly from GitHub.
This system moves beyond simple API consumption by implementing a classification layer that maps repositories to specific "Federations" (e.g., Technological, Cultural, Economic) and operational typologies. It ensures that the digital twin of the territory remains synchronized with the actual technical progress of the software modules that govern it.
Sources: README.md:10-14, src/pages/Repositorio.tsx:43-46
Architecture and Data Flow
The integration operates through a multi-layered approach involving the React frontend, a Supabase Edge Function for server-side synchronization, and a persistent PostgreSQL database.
Synchronization Logic
The system distinguishes between "Core" repositories—those essential to the RDM/TAMV infrastructure—and general repositories. Synchronization is triggered by a specialized Edge Function (github-sync) which fetches metadata from the GitHub API, applies classification logic, and performs an upsert operation into the repositories table.
The flow ensures that only authenticated administrators can trigger a full database synchronization, while the frontend provides a filtered, real-time view of the results.
Sources: supabase/functions/github-sync/index.ts:21-65, src/lib/github.ts:75-90
Repository Classification and Normalization
A critical feature of the integration is the deterministic classification of repositories based on their naming conventions, descriptions, and topics. This logic categorizes codebases into one of the seven TAMV federations.
Classification Rules
Repositories are matched against specific keywords to determine their federation_id and classification.
| Federation | Classification | Keywords / RegEx |
|---|---|---|
| Tecnológica | infra-cognitiva | kernel, isabella, ai, llm, quantum, orchestrator, nexus |
| Cultural | manuscrito | tomo, genesis, libro, compendio, documentacion |
| Gubernamental | protocolo | protocol, legal, charter, civilization, federacion, nodo-cero |
| Económica | comercio | mercado, wallet, stripe, payment, trueque |
| Educativa | pedagógico | educa, university, utamv, academia, masterclass |
| Salud | salud | salud, clinica, medic, telesalud |
| Comunicación | medios | radio, prensa, blog, media |
Sources: src/lib/github.ts:93-104, supabase/functions/_shared/github.ts:21-32
Core Repository Whitelist
Only repositories explicitly listed in the CORE_REPO_WHITELIST are treated as part of the "Evolutionary Nucleus." Examples include rdm-digital-nodo-cero, tamv-orchestrator, and real-del-monte-twin.
Sources: src/lib/github.ts:51-61
Technical Implementation
The system utilizes specialized data structures and functions to manage repository state and analysis.
Data Structures
The repository metadata is stored in a structured format within the Supabase schema to support advanced filtering and reporting.
Key Functions
fetchGitHubRepos: Orchestrates paginated requests to the GitHub API, scanning up to 10 pages to ensure complete data ingestion. Sources: supabase/functions/_shared/github.ts:34-60analyzeRepositories: A reducer function that generates real-time statistics, including language distribution and federation-specific counts. Sources: src/lib/github.ts:106-119github-syncEdge Function: Acts as the secure bridge, requiring "admin" roles to perform write operations to the database. Sources: supabase/functions/github-sync/index.ts:7-19
Configuration and Constraints
The integration is governed by specific operational limits defined in the shared library:
GITHUB_REPOS_PER_PAGE: Set to 100 for maximum throughput per request.GITHUB_SYNC_MIN_PAGES: 3 pages are requested by default to cover core activity.GITHUB_SYNC_MAX_PAGES: Capped at 10 pages to prevent API rate limiting.Excluded Policy: The system explicitly excludes forks, userbots, malware, and non-consensual scraping as per EOCT (Evolutionary Operation of Core Technology) protocols.
Sources: supabase/functions/_shared/github.ts:3-6, supabase/functions/github-sync/index.ts:71
Conclusion
The Evolutionary GitHub Repository Integration transforms a standard Git hosting service into a structured, federated database for the RDM Digital ecosystem. By automating the classification and synchronization of modules like Isabella AI and the TAMV Kernel, the system provides a transparent, auditable view of the project's technical evolution, ensuring that the "Digital Twin" remains aligned with its underlying code foundation.