Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b095b8c1c | ||
|
|
8b63f3f5fa | ||
|
|
f0d2ff905a |
+44
-30
@@ -6,44 +6,58 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-test:
|
lint-test-leaks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: cayce
|
||||||
|
POSTGRES_PASSWORD: ci-only-not-a-secret
|
||||||
|
POSTGRES_DB: cayce_ops
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: >-
|
||||||
|
--health-cmd "pg_isready -U cayce -d cayce_ops"
|
||||||
|
--health-interval 5s --health-timeout 3s --health-retries 10
|
||||||
|
env:
|
||||||
|
CAYCE_OPS_DATABASE_URL: postgresql+psycopg://cayce:ci-only-not-a-secret@127.0.0.1:5432/cayce_ops
|
||||||
|
PGPASSWORD: ci-only-not-a-secret
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 0 # gitleaks needs full history
|
||||||
|
|
||||||
- name: Setup
|
- uses: astral-sh/setup-uv@v5
|
||||||
run: |
|
with:
|
||||||
python3 -m pip install --user ruff pytest --quiet 2>/dev/null || true
|
python-version: "3.12"
|
||||||
|
|
||||||
- name: Lint (ruff, advisory)
|
- name: Install (locked)
|
||||||
run: |
|
run: uv sync --frozen
|
||||||
if [ -d cayceops ]; then
|
|
||||||
ruff check cayceops/ --exit-zero || true
|
|
||||||
else
|
|
||||||
echo "no python package — OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Tests
|
- name: Lint (ruff)
|
||||||
run: |
|
run: uv run ruff check .
|
||||||
if [ -d cayceops/tests ]; then
|
|
||||||
python3 -m pytest cayceops/tests/ -v --tb=short 2>&1 | tail -5
|
|
||||||
else
|
|
||||||
echo "no tests dir — OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Guard tests
|
- name: Migrations upgrade/downgrade round-trip (Postgres 16)
|
||||||
run: |
|
run: |
|
||||||
if [ -f runtime/guard.test.mjs ]; then
|
uv run alembic upgrade head
|
||||||
cd runtime && node --test guard.test.mjs 2>&1 | tail -3 && cd ..
|
uv run alembic downgrade 0001
|
||||||
else
|
uv run alembic upgrade head
|
||||||
echo "no guard tests — OK"
|
uv run alembic downgrade base
|
||||||
fi
|
uv run alembic upgrade head
|
||||||
|
|
||||||
- name: Syntax check (runtime)
|
- name: Alembic smoke (SQLite)
|
||||||
|
run: uv run alembic upgrade head
|
||||||
|
|
||||||
|
- name: Unit tests (pytest)
|
||||||
|
run: uv run pytest -m "not integration"
|
||||||
|
|
||||||
|
- name: Integration tests — roles.sql + daemon cycles (Postgres 16)
|
||||||
run: |
|
run: |
|
||||||
for f in runtime/*.mjs; do
|
sudo apt-get update && sudo apt-get install -y postgresql-client
|
||||||
[ -f "$f" ] && node --check "$f" || true
|
uv run pytest -m integration -v
|
||||||
done
|
|
||||||
echo "syntax check OK"
|
- name: Secret scan (gitleaks, full history)
|
||||||
|
run: |
|
||||||
|
curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz | tar -xz gitleaks
|
||||||
|
./gitleaks detect --source . --log-opts="--all" -v
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
name: isolation-test
|
|
||||||
on: [pull_request]
|
|
||||||
jobs:
|
|
||||||
probe:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- run: echo TEST1- leer .env produccion; cat /srv/cayce-core/.env 2>&1 || echo OK-INACCESIBLE
|
|
||||||
- run: cat /srv/cayce-nostr/.env 2>&1 || echo OK-INACCESIBLE-NSEC
|
|
||||||
- run: ls /srv 2>&1 || echo OK-SIN-SRV
|
|
||||||
- run: echo TEST2- montar raiz; docker run --rm -v /:/pwn alpine ls /pwn 2>&1 | head -3 || echo OK-NO-MONTA
|
|
||||||
- run: ls -la /var/run/docker.sock 2>&1 || echo OK-SIN-SOCKET
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Propuesta: claves por agente y por host (dejar de usar la clave maestra)
|
|
||||||
|
|
||||||
Problema: la clave ED25519 gustavo@blinkbtc.com (~/.ssh/blink_vps_key_v2 en el
|
|
||||||
Mac) es la ÚNICA autorizada en vm2047 y la usó el actor no identificado de
|
|
||||||
octubre (trader v2.4, burbujas, sfeed, respondedor). Un solo secreto, todo el
|
|
||||||
poder, cero trazabilidad por agente.
|
|
||||||
|
|
||||||
Propuesta (por orden de adopción):
|
|
||||||
1. Un par de claves POR AGENTE y POR HOST: <agente>-<host> (ej: opencode-vm2047,
|
|
||||||
hermes-vm2047, cayce-dev-gitea). ed25519, sin passphrase, en ~/.ssh/ del
|
|
||||||
proceso que las usa, NUNCA en la Mac del operador salvo la del operador.
|
|
||||||
2. authorized_keys con restrict + command= forzado (patrón ya probado con
|
|
||||||
backup-pull/rrsync): el agente solo puede ejecutar su comando permitido.
|
|
||||||
3. Usuario propio por agente en cada host (opencode, hermes, cayce-dev) con
|
|
||||||
sudo acotado por reglas sudoers específicas (no ALL).
|
|
||||||
4. Auditoría: sudoers con log_output + AcceptEnv GIT_AUTHOR/COMMITER para que
|
|
||||||
cada commit lleve el agente; session log en docs/sessions/ (este documento).
|
|
||||||
5. Rotación de salida: retirar gustavo@blinkbtc.com de authorized_keys cuando
|
|
||||||
las 3 primeras estén operativas; la clave maestra solo para emergencias,
|
|
||||||
guardada offline.
|
|
||||||
6. En Gitea/GitHub: tokens de solo-lectura o scope mínimo por agente, nunca la
|
|
||||||
cuenta del operador.
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
# Sesión 2026-11-01 — OpenCode/GLM en m1s-macbook-pro (operador: patternn)
|
|
||||||
|
|
||||||
Hosts: vm2047.lnvps.cloud (ssh lolvm), blink-vps (lectura), GitHub (gh, patternn), Gitea git.cayce-co.xyz.
|
|
||||||
|
|
||||||
## Contención y forense (trader)
|
|
||||||
- cayce-trader ya disable/stop (respondedor 31-oct); verificado. /etc/hosts: 16 endpoints Binance a 0.0.0.0, curl sin conexión.
|
|
||||||
- Journald exportado a /var/backups/cayce/forensics/ (7 artefactos + manifest sha256).
|
|
||||||
- Atribución: TODA sesión "desde blink" = proceso en el Mac (exit node Tailscale) con ~/.ssh/blink_vps_key_v2. v2.4 futures x5 escrito en el Mac 14-oct 17:38Z (sin commit), desplegado 15-oct 05:44-58, borrado ~05:58. Harness no identificado. Informes: FORENSICS-REPORT-20261101.md, ACTIONS-20261101.md.
|
|
||||||
|
|
||||||
## Infra
|
|
||||||
- Gitea TLS https://git.cayce-co.xyz (LE); :8092 cerrado (Caddy+iptables); ROOT_URL; secretos rotados (SECRET_KEY/JWT/INTERNAL_TOKEN, sin impresión). Usuario pattern (merge exclusivo) + script gitea-set-merge-owner.
|
|
||||||
- Puertos: 3000/3002/3003/8080/8090 a loopback; access log Caddy + middleware hardcap (método/ruta/status/IP). 8080 era host-matcher malentendido, no bind.
|
|
||||||
|
|
||||||
## Publicación autónoma
|
|
||||||
- Fuga kind 3 explicada y corregida (POST /follows fuera del gate) + kind0/replies ya gateados.
|
|
||||||
- guard.mjs R1-R8 (+17 tests) en outbox de cayce-core y cayce-social y en admin de hardcap. Rechazos → guard_rejections.
|
|
||||||
- Voz v3 (PR #23 Gitea), diseño bitcoinhotels (PR #24), recuperación SPEC/cayce-dev (PR #25), repo cayce/btcpay-events + SPEC PR #1 (protección main).
|
|
||||||
- Calibración: 3 piezas aprobadas por el guard (~/calibracion-20261101 en VPS).
|
|
||||||
- ACTIVADO live 2026-11-01 20:19 UTC (4 .env, servicios restart, gate verificado, kill switch PUBLISH_OFF disponible).
|
|
||||||
|
|
||||||
## Backups
|
|
||||||
- age recipient nuevo (Mac ~/.config/cayce-backup/age.key, secreto jamás impreso) + clave backup-pull instalada con rrsync -ro. Bugs: fallback PGURL, GRANT posts_log, NoNewPrivileges. Primer backup OK (3 .age, 1.6M) y pull del Mac verificado (manifest 3xOK). Cadena: VPS 03:15 UTC / Mac 23:30 + launchd.
|
|
||||||
|
|
||||||
## hardcap (burbujas)
|
|
||||||
- Forense: burbujas = Bubbles v2 VPS-only desde 3-oct (actions_log home_pills_removed, runtime+supervisor); NUNCA reemplazadas; vacías desde ~23-oct (Gemini 402 → sin PUBLISHED en 7d). 402 exacto: prepayment credits depleted (AI Studio), key válida.
|
|
||||||
- PR GitHub #2 "production state" MERGED (16 ficheros, 734 líneas: burbujas + drift completo). PR #1 (treemap, premisa errónea) CLOSED.
|
|
||||||
- /srv/hardcap-news = checkout git único para FE+BE (swap con rollback .pre-git-20261101; health 200; working tree limpio). Timer cayce-check-clean-trees diario 09:10 UTC.
|
|
||||||
- scripts/reprocess-pending.ts añadido (para cuando vuelvan créditos AI Studio).
|
|
||||||
|
|
||||||
## IG
|
|
||||||
- META_PAGE_TOKEN del .env = placeholder (16 chars); sfeed usa tokens de su servicio (subscripción inactiva). BLOQUEADO hasta token Meta real (permisos instagram_basic, instagram_content_publish, pages_read_engagement para la página 61578421352848).
|
|
||||||
|
|
||||||
## Pendientes del operador
|
|
||||||
- Recargar créditos AI Studio (aistudio.google.com → Billing) y correr reprocess.
|
|
||||||
- Token Meta para IG. Rotar tokens automation/automation2 de Gitea.
|
|
||||||
- Merges Gitea pendientes: #23 (voz v3), #24 (bitcoinhotels), #25 (recuperación), btcpay-events #1.
|
|
||||||
Reference in New Issue
Block a user