#!/bin/bash # refractor-preflight.sh — run from workstation after dev deploy # Verifies the Refractor system endpoints and bot health echo "=== Dev API ===" # Refractor endpoint exists (expect 401 = auth required) STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pddev.manticorum.com/api/v2/refractor/cards/1") [ "$STATUS" = "401" ] && echo "PASS: refractor/cards responds (401)" || echo "FAIL: refractor/cards ($STATUS, expected 401)" # Old evolution endpoint removed (expect 404) STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pddev.manticorum.com/api/v2/evolution/cards/1") [ "$STATUS" = "404" ] && echo "PASS: evolution/cards removed (404)" || echo "FAIL: evolution/cards ($STATUS, expected 404)" echo "" echo "=== Discord Bot ===" # Health check curl -sf http://sba-bots:8080/health >/dev/null 2>&1 && echo "PASS: bot health OK" || echo "FAIL: bot health endpoint" # Recent refractor activity in logs echo "" echo "=== Recent Bot Logs (refractor) ===" ssh sba-bots "docker logs --since 10m paper-dynasty_discord-app_1 2>&1 | grep -i refract" || echo "(no recent refractor activity)"