Files
cayce-ops/runtime/deploy.sh
T
cayce 058126b80d
ci / lint-test-leaks (pull_request) Canceled after 0s
containment 2/2: kind 10050 (inbox relays) + drafts summary in supervisor DM + grants suspended, BTCPay priority-1
- publish-10050.mjs: publishes Cayce kind 10050 (NIP-65 message-relays/
  inbox) listing the 6 relays where the listener actually reads DMs.
  EXECUTED once with operator authorization: event id
  188ef397824e8f29b5e1bea661ae65b1f8532ee97617747b9fbde57c6e8dfce9,
  accepted 6/6 relays.
- initiative.mjs: the cycle DM to the supervisor now includes a summary
  of outbound_drafts from the last 24h (id, type, first 15 words) so the
  operator reviews what the agent WANTED to publish.
- initiative.mjs: supervisor directive (CAYCE_DIRECTIVE_BTCPAY=1,
  reversible) injected into the cycle prompt: grants/opportunity search
  SUSPENDED, single priority = consolidate the BTCPay Server proposal
  (opportunity #106 / draft #33) ready for HUMAN sending. MANDATE text
  untouched (only the supervisor can change it).
- initiative.mjs: add_opportunity now rejects duplicates (the agent had
  re-registered OpenSats ×10, HRF ×6).
- opportunity #106 status -> priority-1.
- check-relay-silence.mjs: queries the relays for Cayce-signed events
  since a timestamp; allows only kind 10050 and supervisor DMs; exits 1
  on any violation. Verified: 0 events, 0 violations since deployment.
- deploy.sh: sudo for the daemon restart, optional files tolerated.

Gate: make check green (96 tests).
2026-10-31 16:48:54 +00:00

30 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# deploy.sh — instala el runtime contenido en sus rutas live y reinicia el daemon.
# Fuente versionada: este directorio (cayce-ops/runtime). Reversible con
# CAYCE_PUBLISH_MODE=live en el .env de cada servicio.
set -euo pipefail
SRC="$(cd "$(dirname "$0")" && pwd)"
install -m 644 "$SRC/outbox.mjs" /srv/cayce-core/outbox.mjs
install -m 644 "$SRC/core.mjs" /srv/cayce-core/core.mjs
install -m 644 "$SRC/editorials.mjs" /srv/cayce-core/editorials.mjs
install -m 644 "$SRC/initiative.mjs" /srv/cayce-core/initiative.mjs
install -m 644 "$SRC/outbox.mjs" /srv/cayce-nostr/outbox.mjs
install -m 644 "$SRC/daemon.mjs" /srv/cayce-nostr/daemon.mjs
# opcionales (llegan con el PR de verificación/10050)
install -m 755 "$SRC/publish-10050.mjs" /srv/cayce-nostr/publish-10050.mjs 2>/dev/null || true
install -m 644 "$SRC/check-relay-silence.mjs" /srv/cayce-nostr/check-relay-silence.mjs 2>/dev/null || true
install -m 644 "$SRC/outbox.mjs" /home/ubuntu/cayce-social/outbox.mjs
install -m 644 "$SRC/promo.mjs" /home/ubuntu/cayce-social/promo.mjs
install -m 644 "$SRC/outbox.mjs" /home/ubuntu/cayce-mail/outbox.mjs
install -m 644 "$SRC/mail.mjs" /home/ubuntu/cayce-mail/mail.mjs
# config de contención (idempotente): draft por defecto + ruta de identidad
for ENVF in /srv/cayce-core/.env /srv/cayce-nostr/.env /home/ubuntu/cayce-social/.env /home/ubuntu/cayce-mail/.env; do
grep -q "^CAYCE_PUBLISH_MODE=" "$ENVF" 2>/dev/null || echo "CAYCE_PUBLISH_MODE=draft" >> "$ENVF"
grep -q "^IDENTITY_PATH=" "$ENVF" 2>/dev/null || echo "IDENTITY_PATH=/home/ubuntu/cayce-ops/prompts/cayce-identity.md" >> "$ENVF"
done
sudo systemctl restart cayce-nostr
echo "deploy OK — mode=$(grep -h "^CAYCE_PUBLISH_MODE=" /srv/cayce-core/.env | head -1)"