docs(v5): Complete system documentation
Comprehensive documentation for TZZR system v5 including: - 00_VISION: Glossary and foundational philosophy - 01_ARQUITECTURA: System overview and server specs - 02_MODELO_DATOS: Entity definitions and data planes (T0, MST, BCK) - 03_COMPONENTES: Agent docs (CLARA, MARGARET, FELDMAN, GRACE) - 04_SEGURIDAD: Threat model and secrets management - 05_OPERACIONES: Infrastructure and backup/recovery - 06_INTEGRACIONES: GPU services (RunPod status: blocked) - 99_ANEXOS: Repository inventory (24 repos) Key findings documented: - CRITICAL: UFW inactive on CORP/HST - CRITICAL: PostgreSQL 5432 exposed - CRITICAL: .env files with 644 permissions - RunPod workers not starting (code ready in R2) - Infisical designated as single source of secrets (D-001) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
154
01_ARQUITECTURA/overview.md
Normal file
154
01_ARQUITECTURA/overview.md
Normal file
@@ -0,0 +1,154 @@
|
||||
# Arquitectura Overview
|
||||
|
||||
**Versión:** 5.0
|
||||
**Fecha:** 2024-12-24
|
||||
|
||||
---
|
||||
|
||||
## Diagrama General
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────┐
|
||||
│ CAPA DE COORDINACIÓN │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
||||
│ │ ARCHITECT (69.62.126.110) │ │
|
||||
│ │ ┌──────────┐ ┌──────────┐ ┌────────────┐ ┌───────────────┐ │ │
|
||||
│ │ │PostgreSQL│ │ Gitea │ │Orchestrator│ │ Infisical │ │ │
|
||||
│ │ │ central │ │ 25 repos │ │ v5 │ │ Secrets │ │ │
|
||||
│ │ └──────────┘ └──────────┘ └────────────┘ └───────────────┘ │ │
|
||||
│ └─────────────────────────────────────────────────────────────────┘ │
|
||||
└─────────────────────────────────────────────────────────────────────────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌─────────────────────────────────────────────────────────────────────────┐
|
||||
│ CAPA DE SERVIDORES │
|
||||
│ │
|
||||
│ ┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐ │
|
||||
│ │ DECK │ │ CORP │ │ HST │ │
|
||||
│ │ 72.62.1.113 │ │ 92.112.181.188 │ │ 72.62.2.84 │ │
|
||||
│ │ │ │ │ │ │ │
|
||||
│ │ CLARA :5051 │ │ MARGARET :5051 │ │ 973 tags │ │
|
||||
│ │ ALFRED :5052 │ │ JARED :5052 │ │ API pública │ │
|
||||
│ │ │ │ MASON :5053 │ │ Directus :8055 │ │
|
||||
│ │ Mailcow │ │ FELDMAN :5054 │ │ │ │
|
||||
│ │ Vaultwarden │ │ │ │ │ │
|
||||
│ │ Directus │ │ Odoo │ │ │ │
|
||||
│ └───────────────────┘ │ Nextcloud │ └───────────────────┘ │
|
||||
│ │ └───────────────────┘ │ │
|
||||
│ │ │ │ │
|
||||
│ └─────────────────────────┼──────────────────────┘ │
|
||||
│ │ │
|
||||
└───────────────────────────────────┼─────────────────────────────────────┘
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────────────────┐
|
||||
│ CAPA DE ALMACENAMIENTO │
|
||||
│ │
|
||||
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
||||
│ │ Cloudflare R2 │ │
|
||||
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐ │ │
|
||||
│ │ │architect │ │ deck │ │ corp │ │ hst │ │ locker │ │ │
|
||||
│ │ │ backups │ │ archivos │ │ archivos │ │ imágenes │ │ general│ │ │
|
||||
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └────────┘ │ │
|
||||
│ └─────────────────────────────────────────────────────────────────┘ │
|
||||
└─────────────────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────────────────────────────────────┐
|
||||
│ CAPA GPU (RunPod) │
|
||||
│ Estado: BLOQUEADO - Workers no inician │
|
||||
│ │
|
||||
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
||||
│ │ GRACE │ │ PENNY │ │ FACTORY │ │
|
||||
│ │ 18 módulos│ │ texto │ │generación│ │
|
||||
│ └──────────┘ └──────────┘ └──────────┘ │
|
||||
└─────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Flujo de Datos
|
||||
|
||||
```
|
||||
PACKET (App móvil)
|
||||
│
|
||||
│ POST /ingest
|
||||
│ Content-Type: multipart/form-data
|
||||
│ X-Auth-Key: {h_instancia}
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────┐
|
||||
│ CLARA (DECK) / MARGARET (CORP) │
|
||||
│ │
|
||||
│ 1. Validar h_instancia │
|
||||
│ 2. Calcular h_entrada (SHA-256) │
|
||||
│ 3. Subir archivos a R2 │
|
||||
│ 4. Insertar en clara_log/margaret_log │
|
||||
│ 5. Estado: 'recibido' (inmutable) │
|
||||
└─────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────┐
|
||||
│ ALFRED (DECK) / JARED (CORP) │
|
||||
│ │
|
||||
│ 1. Aplicar flujos predefinidos │
|
||||
│ 2. Ejecutar reglas automáticas │
|
||||
│ 3. Enviar a MASON si requiere mejora │
|
||||
└─────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────┐
|
||||
│ MASON │
|
||||
│ │
|
||||
│ 1. Recibir de ALFRED/JARED │
|
||||
│ 2. Ventana flotante 24h │
|
||||
│ 3. Usuario enriquece datos │
|
||||
│ 4. [Futuro] GRACE extrae información │
|
||||
│ 5. Enviar a FELDMAN cuando listo │
|
||||
└─────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────┐
|
||||
│ FELDMAN │
|
||||
│ │
|
||||
│ 1. Recibir en feldman_cola │
|
||||
│ 2. Validar reglas (M-001, M-002, M-003)│
|
||||
│ 3. Crear milestone o bloque │
|
||||
│ 4. Calcular hash_contenido │
|
||||
│ 5. Encadenar (hash_previo) │
|
||||
│ 6. [Futuro] Merkle tree, blockchain │
|
||||
└─────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────────────────┐
|
||||
│ SENTINEL (planificado) │
|
||||
│ │
|
||||
│ LIGHT: Cada 5 min, reglas automáticas │
|
||||
│ DEEP: Cada 1 hora, muestreo con LLM │
|
||||
└─────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Comunicación Entre Servidores
|
||||
|
||||
| Origen | Destino | Protocolo | Puerto | Propósito |
|
||||
|--------|---------|-----------|--------|-----------|
|
||||
| DECK | ARCHITECT | SSH/Git | 2222 | Push repos |
|
||||
| DECK | R2 | HTTPS | 443 | Almacenamiento |
|
||||
| CORP | ARCHITECT | SSH/Git | 2222 | Push repos |
|
||||
| CORP | R2 | HTTPS | 443 | Almacenamiento |
|
||||
| HST | ARCHITECT | SSH | 22 | Administración |
|
||||
| ARCHITECT | DECK | SSH | 22 | Deploy |
|
||||
| ARCHITECT | CORP | SSH | 22 | Deploy |
|
||||
|
||||
---
|
||||
|
||||
## Bases de Datos
|
||||
|
||||
| Servidor | Database | Tablas Principales |
|
||||
|----------|----------|--------------------|
|
||||
| ARCHITECT | architect | context_blocks, agents, creds_* |
|
||||
| DECK | tzzr | clara_log, alfred_executions |
|
||||
| CORP | corp | margaret_log, mason_workspace, feldman_* |
|
||||
| HST | hst_images | hst_tags, hst_trees |
|
||||
Reference in New Issue
Block a user