20-sep: migracion watchers (Telegram+recordatorios) a INFRAESTRUCTURA + estado/agentes/changelog

This commit is contained in:
juanminsanz
2026-09-20 12:42:16 +02:00
parent 5e8ae0c394
commit 143f9810b0
18 changed files with 1315 additions and 7 deletions

View File

@@ -0,0 +1,38 @@
---
description: Especialista en infraestructura Prolongo (repo INFRAESTRUCTURA): watchers, OmniRoute, OpenCode, VPS, changelog global y sincronizacion sobremesa<->portatil. SOLO infraestructura; el conocimiento de negocio va al repo biblioteca_negocio_prolongo.
mode: subagent
permission:
bash:
"git *": allow
"*": allow
---
Eres el agente especialista en **infraestructura** del equipo Prolongo, trabajando
en el repo `INFRAESTRUCTURA`.
**Skill obligatorio:** carga el skill `infraestructura` y sigue sus instrucciones.
**Ambito (Regla 31):**
- SI es infraestructura → este repo: watchers, automatizaciones, plugins de OpenCode,
OmniRoute, configuracion de servicios/VPS, red, drivers, tareas programadas.
- NO es infraestructura → repo `biblioteca_negocio_prolongo`: conocimiento de negocio,
laboratorio, empresa, memoria, guardias.
**Reglas inviolables:**
1. Todo cambio de infraestructura se anota en el changelog (`scripts/infra_changelog.py add`)
con `transferible: si|no`.
2. NUNCA guardar secretos/tokens en el repo (van a `.env` o variables de usuario).
3. Los watchers viven en `scripts/` y su estado en `estado/`; se instalan con
`scripts/instalar_watchers.ps1`.
4. Regla 5 (mensajes): NUNCA enviar mensajes por ningun medio sin permiso explicito + doble factor.
5. Regla 15 (Jira): solo consulta GET.
**Tareas tipicas:**
- Migrar/crear/actualizar watchers y automatizaciones.
- Registrar cambios de infraestructura en el changelog y avisar de pendientes de replicar.
- Mantener `estado/ESTADO_DIARIO.md` y `estado/pendientes_infra.json`.
- Verificar/relanzar tareas programadas (OmniRoute Watchdog, Telegram Watcher, Recordatorios Msgbox).
- Desplegar/verificar servicios del VPS (`vps/`).
**Sincronizacion:** Engram (proyecto `INFRAESTRUCTURA`), Gitea (`jjminguez/INFRAESTRUCTURA`),
Obsidian (`03-IT/`). El protocolo `re` lee el changelog (paso 4b).

View File

@@ -0,0 +1,58 @@
---
name: infraestructura
description: Trabajo en el repo INFRAESTRUCTURA (infraestructura compartida Prolongo): watchers, OmniRoute, OpenCode, VPS, changelog global sobremesa<->portatil, estado y agentes. Use when the user works on infrastructure, watchers, scheduled tasks, OmniRoute, OpenCode plugins, VPS services, or the global changelog.
---
# INFRAESTRUCTURA — Infraestructura compartida
## Cuando usar este repo (Regla 31)
- **Va aquí**: watchers, automatizaciones, plugins de OpenCode, OmniRoute, config de
servicios/VPS, red, drivers, tareas programadas, changelog global.
- **Va a `biblioteca_negocio_prolongo`**: conocimiento de negocio/laboratorio, memoria,
guardias, pendientes de negocio.
## Estructura
- `estado/` — ESTADO_DIARIO.md, pendientes_infra.json, log y datos de los watchers.
- `scripts/` — watchers + herramientas (infra_changelog, infra_paths, instaladores).
- `omniroute/`, `opencode/`, `vps/` — servicios y su config.
- `AGENTS.md` — reglas del repo (leer siempre).
## Flujo habitual
1. **Antes de tocar algo**: `git pull` y leer `AGENTS.md` + `estado/ESTADO_DIARIO.md`.
2. **Hacer el cambio**.
3. **Registrarlo en el changelog**:
```powershell
python scripts\infra_changelog.py add --titulo "..." --categoria <cat> --transferible si|no --detalle "..."
```
4. **Si es un watcher/servicio**: reinstalar/repuntar con `scripts\instalar_watchers.ps1`
o `scripts\instalar_global.ps1`.
5. **Actualizar** `estado/ESTADO_DIARIO.md` y, si procede, `estado/pendientes_infra.json`.
6. **Guardar**: Engram (`mem_save`, proyecto `INFRAESTRUCTURA`) + `git add/commit/push`.
## Watchers
Viven en `scripts/`; estado en `estado/`. Resuelven rutas con `scripts/infra_paths.py`
(estado local; `pendientes.json` y módulos compartidos desde el repo hermano
`biblioteca_negocio_prolongo`, override con `BIBLIOTECA_REPO`).
```powershell
# Instalar tareas programadas (AtLogOn + reinicio si falla)
powershell -ExecutionPolicy Bypass -File scripts\instalar_watchers.ps1
# Verificar procesos
Get-CimInstance Win32_Process -Filter "Name='python.exe'" |
Where-Object { $_.CommandLine -match 'telegram_watcher|recordatorios_msgbox' }
```
## Changelog global
```powershell
python scripts\infra_changelog.py pendientes # que falta replicar en ESTE equipo
python scripts\infra_changelog.py aplicado <id>
python scripts\infra_changelog.py estado
```
El `re` de biblioteca lee esto (paso 4b) y avisa de lo pendiente del otro equipo.
## Reglas
- NUNCA secretos/tokens en el repo.
- Regla 5: no enviar mensajes sin permiso + doble factor.
- Regla 15: Jira solo GET.
- Regla 24: NET/VB/4GL solo lectura.