docs: full Aurelio infrastructure audit + plan for 17/07
Some checks failed
Aurélio Sync & Conscience Upgrade / Upgrade Réplica Conscience (push) Failing after 45s

Complete audit of CT 208, host ASUS, host Gigabyte, CT 217.
Includes: all services, ports, gbrain health/issues, bot status,
resolved problems, and prioritized pending tasks for tomorrow.
This commit is contained in:
fabiorafaelcoutada 2026-07-16 23:17:35 +01:00
parent 6eb893b7a0
commit c068bf53dd

View file

@ -0,0 +1,200 @@
# Aurelio — Auditoria Completa (16/07/2026)
> Plano para amanhã: estado actual, issues conhecidas, próximos passos.
---
## 1. Estrutura Geral
### CT 208 — pf-forja-do-conhecimento (192.168.0.125)
**Disco:** 49G, 37G used (78%) — cuidado, pouco espaço.
**SO:** Debian 12 (LXC), PostgreSQL 16 no Docker (`172.17.0.1:5433`)
#### Serviços Core
| Serviço | Porta | Estado | Descrição |
|---------|-------|--------|-----------|
| `pf-gbrain.service` | `:18001` | ✅ active | GBrain v0.42.58 — PostgreSQL, 1362 páginas |
| `gbrain-rest-proxy.service` | `:18002` | ✅ active | Bridge REST→MCP p/ bot-rs |
| `aurelio-gabinete-rs.service` | `:18000` | ✅ active | Gabinete Rust (API central) |
| `aurelio-bot-rs.service` | — | ✅ active | @Aurélio Omnisciente (Telegram) |
| `aurelio-engineering-gateway.service` | `:8090` | ✅ active | MCP Gateway federado |
| `aurelio-native-engine-gateway.service` | — | ✅ active | Dirac wrapper MCP gateway |
| `aurelio-web.service` | — | ✅ active | Olhos-de-Orpheu MCP console |
| `aurelio-webhook.service` | — | ✅ active | Forgejo→Telegram notifier |
| `brain-sync.service` | `:8095` | ✅ active | Sync local (pushed=0 sempre) |
| `lifestream-userbot.service` | — | ✅ active | Telethon Saved Messages monitor |
| `pf-identity.service` | `:9091` | ✅ active | CA + Identity Management |
| `pf-hermes-agent-208.service` | `:18300` | ✅ active | Hermes MCP server |
#### MCP Servers (CT 208)
| Serviço | Porta | Descrição |
|---------|-------|-----------|
| `mcp-sourcing-server.service` | `:8081` | Sourcing MCP |
| `mcp-eda-server.service` | `:8082` | EDA MCP |
| `mcp-knowledge-server.service` | `:8083` | Knowledge MCP |
| `codebase-memory-mcp.service` | `:8084` | Codebase Memory MCP |
| `mcp-civil-server.service` | — | Civil MCP |
| `mcp-artist-server.service` | — | Artist MCP |
| `mcp-mechanic-server.service` | — | Mechanic MCP |
#### Kimi Swarm Agents
| Serviço | Descrição |
|---------|-----------|
| `pf-kimi-swarm-orchestrator-208.service` | Orchestrator |
| `pf-log-processor-agent-208.service` | Log processor |
| `pf-ota-validator-agent-208.service` | OTA validator |
| `pf-regression-detector-agent-208.service` | Regression detector |
| `pf-report-synthesizer-agent-208.service` | Report synthesizer |
| `pf-swarm-dashboard-208.service` | Swarm dashboard |
#### Outros
- `pf-forgejo-scribe-208.service` — Forgejo event scribe
- `pf-github-scribe-208.service` — GitHub event scribe
- `pf-grafica-208.service` — Gráfica print shop
- `pf-olhos-208.service` — Olhos de Orpheu
- `pf-savearth-workspace-208.service` — Savearth workspace
- `savearth-mcp-208.service` — Savearth MCP
### Host ASUS (192.168.0.38)
| Serviço | Porta | Descrição |
|---------|-------|-----------|
| `aurelio-fabricd.service` | `:8081` | Fabric Control Plane (model gateway) |
| `aurelio-orchestrator.service` | `:8200` | MicroVM Orchestrator |
| `aurelio-asus-server-lab-node.service` | `:8002` | Hardware Lab Node |
| `lab-gateway.service` | — | Lab gateway |
| `cloudflared.service` | — | Cloudflare Tunnel (pf-tunnel-v2) |
| `nginx.service` | `:80` | Reverse proxy |
| `iptables-restore.service` | — | ✅ DNAT :18001 → CT 208 |
| `pf-hardware-bridge.service` | — | Hardware API bridge |
| `pf-watchdog.service` | — | Datacenter watchdog |
### Host Gigabyte (192.168.0.104)
- Docker media stack (Jellyfin, Sonarr, Radarr, etc.)
- `signal-api` container (:18088)
- Cloud emulators (MinIO :9000, LocalStack :4566, Azurite)
### CT 217 — pf-hermes (192.168.0.27)
- `hermes-gateway.service` — gateway 24/7 (Telegram/Signal/Matrix)
- GBrain MCP configurado com token OAuth
---
## 2. GBrain — Estado e Issues
### Métricas
- **Páginas:** 1.362
- **Embed coverage:** 12.7% (3.636/4.163 chunks não embedded)
- **Brain Score:** 14/100 🚨
- **Engine:** PostgreSQL (via binário)
- **Versão:** 0.42.58.0
### Issues Críticas
| Issue | Severidade | Fix |
|-------|-----------|-----|
| Brain score 14/100 | ❌ fail | Embed + extrair links |
| 1362/1362 páginas sem edges extraídos | ⚠️ warn | `gbrain extract --stale` |
| 1312 páginas sem CR ladder | ⚠️ warn | `gbrain reindex --markdown` |
| Schema pack `gbrain-base-v2` não encontrado | ⚠️ warn | `gbrain schema active` |
| Subagent sem Anthropic key | ⚠️ warn | `gbrain config set agent.use_gateway_loop true` |
| Embed coverage 12.7% | ⚠️ low | `gbrain embed --all` |
### Fluxo de dados
```
Saved Messages (Telegram)
→ Lifestream userbot (Telethon)
→ SQLite DB (/opt/aurelio-lifestream/data/lifestream.db)
→ Cron 03:00 → /opt/aurelio-lifestream/lifestream_to_brain.py
→ GBrain (via REST→MCP proxy)
```
---
## 3. Bot Aurélio — Estado
| Comando | Estado | Notas |
|---------|--------|-------|
| `/brain <query>` | ✅ Fix | Proxy REST→MCP em :18002 |
| `/think <q>` | ✅ | Usa fabricd como gateway |
| `/status` | ✅ | Gateway, GBrain, SearXNG |
| `/today` | ⏳ | Retorna "em desenvolvimento" |
| `/onthisday` | ⏳ | Retorna "em desenvolvimento" |
| `/sync` | ❓ | Não testado |
| Mensagens livres | ✅ | Capturadas pelo Lifestream |
### Config
- **Gateway:** `http://192.168.0.38:8081` (fabricd)
- **GBrain:** `http://127.0.0.1:18002` (proxy)
- **Modelo:** `nvidia/nemotron-3-nano-30b-a3b`
---
## 4. O que ficou resolvido hoje
| Problema | Antes | Depois |
|----------|-------|--------|
| PGLite lock timeout | ❌ Bun gbrain no host | ✅ Binário PostgreSQL CT 208 |
| Duas instâncias gbrain | ❌ Host bun + CT 208 binary | ✅ Só CT 208 binary |
| Bot não respondia | ❌ Host bot + CT 208 bot | ✅ Só CT 208 bot |
| Gateway :9090 inexistente | ❌ Missing | ✅ Redireccionado p/ fabricd :8081 |
| `/brain` dava 404 | ❌ gbrain v0.42 sem REST | ✅ Proxy REST→MCP em :18002 |
| Hermes MCP sem auth | ❌ 401 no gbrain | ✅ Token OAuth configurado |
---
## 5. Pendências para Amanhã (Prioridades)
### 🔴 Alta
1. **Brain score 14/100** — Correr `gbrain extract --stale` + `gbrain embed --all` para construir edges e embeddings
2. **Disco CT 208 a 78%** — Limpar sessions antigas em `.aurelio/brain/` (centenas de sessions opencode/kimi)
3. **Schema pack**`gbrain schema active` para resolver `gbrain-base-v2`
### 🟡 Média
4. **Lifestream sync** — Verificar se `lifestream_to_brain.py` funciona (cron 03:00). Testar sync manual.
5. **Brain-sync** — Está a funcionar mas sempre `pushed=0`. Decidir se é necessário ou legacy.
6. **REST API endpoints** — O gbrain v0.42 não tem REST API. O proxy cobre `/api/search`. Faltam outros endpoints?
### 🟢 Baixa
7. **`/today` e `/onthisday`** — Implementar chronicle no bot-rs
8. **Forgejo push** — Token expirado; renovar para push automático
9. **GBrain REST proxy** — Mover de `/opt/gbrain-rest-proxy.py` para `/opt/pf-services-208/aurelio-gbrain/scripts/`
10. **Monitorização** — Adicionar watchdog para o bot-rs + gbrain
---
## 6. Diagrama de Rede
```
┌─────────────────────┐
│ Cloudflare Tunnel │
│ pf-tunnel-v2 (ASUS) │
└──────────┬──────────┘
│ :80/:443
┌──────────▼──────────┐
│ ASUS (192.168.0.38)│
│ ┌─────┬─────┬────┐ │
│ │fabricd│orch.│nginx│ │
│ │:8081 │:8200│:80 │ │
│ └──┬──┴─────┴────┘ │
│ DNAT :18001→CT 208 │
└───────┬─────────────┘
┌───────────────────┼───────────────────┐
│ │ │
┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐
│ CT 208 │ │ CT 217 │ │ Gigabyte │
│ pf-forja │ │ pf-hermes │ │ (media stack)│
│ │ │ │ │ │
│ gbrain :18001│ │ Hermes gw. │ │ Docker: │
│ proxy :18002 │ │ Telegram/ │ │ Jellyfin │
│ gabinete │ │ Signal/ │ │ Sonarr/Radarr│
│ :18000 │ │ Matrix bots │ │ signal-api │
│ bot-rs │ │ │ │ MinIO/Local │
│ lifestream │ │ │ │ Stack │
│ MCP servers │ │ │ │ │
└──────────────┘ └──────────────┘ └──────────────┘
```