Files
wizwar6e/deploy/verify-ledgers.sh
Eric WagonerandClaude Fable 5 1cf5d0a68d The determinism harness moves into deploy/ for real
deploy/verify-ledgers.sh fetches every production ledger and strictly
replays it against the local engine (any refusal or crash fails; a
lobby that never dealt is trivially clean). Run from the repo root
before deploying engine changes — the check both of tonight's replay
breaks would have caught.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0138A8CjeQRpvzKxuMfz1Bqc
2026-08-19 22:06:56 -04:00

20 lines
653 B
Bash
Executable File

#!/bin/bash
# Pre-deploy determinism check: fetch every production ledger and strictly
# replay it against the LOCAL engine. Any refused command is a hard failure.
# Run from the repo root before deploying any engine change.
set -euo pipefail
HOST="${1:-104.236.96.198}"
TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT
scp -q "root@$HOST:/var/lib/wizwar/rooms/*.jsonl" "$TMP/"
fails=0
for f in "$TMP"/*.jsonl; do
out=$(npx tsx deploy/replay-verify.mjs "$f" 2>&1 | tail -1)
case "$out" in
FAIL*) echo "$out"; fails=$((fails+1));;
esac
done
count=$(ls "$TMP" | wc -l | tr -d ' ')
echo "--- $count ledgers checked, $fails failures"
[ "$fails" -eq 0 ]