Content Sync Engine
Relevant source files
The following files were used as context for generating this wiki page:
The Content Sync Engine is the core system responsible for classifying, indexing, and synchronizing technical documentation and technical content across the TAMV ecosystem. It serves as a bridge between repository data, external blog content, and the internal documentation memory, making this information accessible to developers, the community, and AI agents such as DigyTAMV.
The system operates primarily as a Supabase Edge Function (tamv-content-sync) that aggregates data from GitHub repositories and the official TAMV blog. It ensures that the ecosystem's "technical memory" remains updated by scanning authorized paths, extracting metadata (frontmatter), and generating structured indices for search and AI navigation.
Sources: 02_MODULOS/M06_CONTENT/INTERNO/CONTENT-SYNC-SPEC.md:7-12, supabase/functions/tamv-content-sync/index.ts:1-15
1. System Architecture and Data Flow
The Content Sync Engine functions as a centralized orchestrator that pulls data from multiple external sources and processes it into a unified format for the TAMV ecosystem.
Data Acquisition Flow
The engine targets specific GitHub repositories associated with the TAMV founder and ecosystem, as well as the TAMV Online Network blog.
The synchronization cycle runs periodically (every 6 hours) or can be triggered via webhooks. It classifies findings into structured ecosystem data including repository metadata (languages, stars, topics) and recent blog posts.
Sources: supabase/functions/tamv-content-sync/index.ts:71-125, 02_MODULOS/M06_CONTENT/INTERNO/CONTENT-SYNC-SPEC.md:78-83
Integration with Fusion Core
The tamv-fusion-core acts as a high-level orchestrator that invokes the tamv-content-sync function during its health check cycles.
2. Content Classification Logic
Every document processed by the engine is assigned metadata based on its type, module target, and maturity status. This classification is critical for the DevHub inventory and AI navigation.
Document Metadata Categories
| Category | Values | Description |
|---|---|---|
| Type | doc_tech, marketing, blueprint, legal, governance | Defines the nature of the document. |
| Module Target | core, ia, security, economy, xr, infra | Maps the document to a specific TAMV domain (DM-X4-XX). |
| Maturity | draft, validated, canon, deprecated | Indicates the current state of document reliability. |
Sources: 02_MODULOS/M06_CONTENT/INTERNO/CONTENT-SYNC-SPEC.md:15-50
Indexing Process
The indexing workflow extracts specific attributes from files to populate the content_index table in Supabase:
- Scan: Locates
.mdfiles in authorized paths (e.g.,02_MODULOS/,docs/devhub/). - Extraction: Reads frontmatter to determine
statusandmodule_target. - Storage: Updates the index to reflect path changes or new content.
- Semantic Future: Planned integration for generating embeddings for semantic search.
Sources: 02_MODULOS/M06_CONTENT/INTERNO/CONTENT-SYNC-SPEC.md:78-83
3. Edge Function Specification: tamv-content-sync
The engine is exposed as a service-level API. It handles actions ranging from full synchronization to filtered searches.
API Contract (Input)
{
"action": "sync | classify | index | search",
"filters": {
"type": "doc_tech | blueprint",
"module_target": "ia | economy",
"status": "draft | canon"
},
"query": "string (for search)",
"userId": "uuid"
}
Sources: 02_MODULOS/M06_CONTENT/INTERNO/CONTENT-SYNC-SPEC.md:54-63
Implementation Details
The TypeScript implementation utilizes the Deno environment and the standard HTTP server to fetch and parse data.
// Example of GitHub data filtering in tamv-content-sync
const tamvRepos = repos.filter((r: any) =>
r.name?.toLowerCase().includes('tamv') ||
r.name?.toLowerCase().includes('unify') ||
r.name?.toLowerCase().includes('web-4')
);
Sources: supabase/functions/tamv-content-sync/index.ts:90-95
4. DigyTAMV and DevHub Integration
The Content Sync Engine serves as the backend for DigyTAMV, the "AI Memory" used by agents like Isabella and THE SOF. It organizes content into a "Civilizatory Client" inventory.
DevHub Categories
Documentation is organized into five primary categories within the DevHub:
- APIs: References for TAMV OS, AI, and XR.
- SDKs: Examples and development kits (planned).
- Modules: Documentation for specific civilizatory domains.
- Norms: Constitutional rules like
QC-TAMV. - Blueprints: Architecture Decision Records (ADRs) and design plans.
Sources: 02_MODULOS/M06_CONTENT/INTERNO/CONTENT-SYNC-SPEC.md:85-95, PLAN-TAMV-MODULAR.md:113-119
5. Consistency and Verification
To maintain the integrity of the synchronized content, the system includes a verification script (npm run check:docs-sync). This script performs the following validations:
- Ensures all code-exposed endpoints have a corresponding DevHub entry.
- Identifies "orphan" documents that lack associated code logic.
- Enforces that all
doc_techtypes have a definedmodule_target. - Flags documents with an empty or invalid maturity status.
Sources: 02_MODULOS/M06_CONTENT/INTERNO/CONTENT-SYNC-SPEC.md:120-130
Status of Implementation
| Task | Status | Source |
|---|---|---|
| GitHub/Blog Sync Logic | ✅ Implemented | supabase/functions/tamv-content-sync/index.ts |
| Document Classification | ⚠️ In Progress | PLAN-TAMV-MODULAR.md:144 |
| Module Target Fields | ❌ Pending | TASKS-TAMV-MODULAR.md:79 |
| DevHub Inventory | ⚠️ Partial | 02_MODULOS/M06_CONTENT/INTERNO/CONTENT-SYNC-SPEC.md:85 |
Conclusion
The Content Sync Engine is the foundational infrastructure for knowledge management within the TAMV MD-X4 ecosystem. By automating the aggregation of external data and enforcing strict classification for internal documentation, it enables a consistent "technical memory" that supports both human developers and autonomous AI agents.