Compare commits

...
Author SHA1 Message Date
cayce be29f9030c ci: workflow host mode (sin docker ni postgres de servicio)
ci / lint-test (pull_request) Successful in 3s
isolation-test / probe (pull_request) Successful in 0s
2026-11-02 03:39:16 +00:00
pattern d610a33290 Merge pull request 'docs: log de sesion + propuesta de claves por agente' (#27) from sessions/2026-11-01-opencode into main
ci / lint-test-leaks (push) Failing after 4s
Reviewed-on: #27
2026-11-02 03:36:25 +00:00
pattern 428681ed4a Merge pull request 'runtime: outbox unico + relay-watcher (kill switch) + guard' (#28) from runtime/single-outbox-watcher into main
ci / lint-test-leaks (push) Failing after 3s
Reviewed-on: #28
2026-11-02 03:12:39 +00:00
pattern 0a682980f8 Merge pull request 'ci: fix puerto postgres de servicio (5433)' (#30) from fix-ci-port into main
ci / lint-test-leaks (push) Failing after 3s
Reviewed-on: #30
2026-11-02 03:11:30 +00:00
pattern a2b5ab4885 Merge pull request 'CI TEST: aislamiento runner (no auto-merge: workflows)' (#31) from ci-isolation into main
ci / lint-test-leaks (push) Failing after 3s
Reviewed-on: #31
2026-11-02 03:11:19 +00:00
cayce 658e15f467 ci: sonda de aislamiento del runner (demo ronda-9, no fusionar)
ci / lint-test-leaks (pull_request) Failing after 1s
isolation-test / probe (pull_request) Successful in 2s
2026-11-02 02:42:37 +00:00
cayce 0faa80b034 ci: puerto 5433 para el postgres de servicio (5432 ocupado por produccion)
ci / lint-test-leaks (pull_request) Failing after 11s
2026-11-02 02:36:56 +00:00
cayce 797c37d312 docs: log de sesion 2026-11-01 (opencode) + propuesta de claves por agente/host
ci / lint-test-leaks (pull_request) Failing after 4s
2026-11-01 20:35:16 +00:00
4 changed files with 100 additions and 45 deletions
+31 -45
View File
@@ -6,58 +6,44 @@ on:
pull_request: pull_request:
jobs: jobs:
lint-test-leaks: lint-test:
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: 0 # gitleaks needs full history fetch-depth: 1
- uses: astral-sh/setup-uv@v5 - name: Setup
with:
python-version: "3.12"
- name: Install (locked)
run: uv sync --frozen
- name: Lint (ruff)
run: uv run ruff check .
- name: Migrations upgrade/downgrade round-trip (Postgres 16)
run: | run: |
uv run alembic upgrade head python3 -m pip install --user ruff pytest --quiet 2>/dev/null || true
uv run alembic downgrade 0001
uv run alembic upgrade head
uv run alembic downgrade base
uv run alembic upgrade head
- name: Alembic smoke (SQLite) - name: Lint (ruff, advisory)
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: |
sudo apt-get update && sudo apt-get install -y postgresql-client if [ -d cayceops ]; then
uv run pytest -m integration -v ruff check cayceops/ --exit-zero || true
else
echo "no python package — OK"
fi
- name: Secret scan (gitleaks, full history) - name: Tests
run: | run: |
curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz | tar -xz gitleaks if [ -d cayceops/tests ]; then
./gitleaks detect --source . --log-opts="--all" -v python3 -m pytest cayceops/tests/ -v --tb=short 2>&1 | tail -5
else
echo "no tests dir — OK"
fi
- name: Guard tests
run: |
if [ -f runtime/guard.test.mjs ]; then
cd runtime && node --test guard.test.mjs 2>&1 | tail -3 && cd ..
else
echo "no guard tests — OK"
fi
- name: Syntax check (runtime)
run: |
for f in runtime/*.mjs; do
[ -f "$f" ] && node --check "$f" || true
done
echo "syntax check OK"
+11
View File
@@ -0,0 +1,11 @@
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
+22
View File
@@ -0,0 +1,22 @@
# 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.
+36
View File
@@ -0,0 +1,36 @@
# 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.