Files
wizwar6e/deploy/verify-ledgers.sh
T
Eric WagonerandClaude Fable 5 6adcbe23b5 Credibility pass: the accretion sanded smooth
Blind reviews over d2b40ec..HEAD (engine / web / server+deploy). Orphaned
doc comments rejoined their functions; the swap-meet tradables collapsed
from four pasted deriveds to one (killing the "the's treasure" label);
FEAR's aura and banner now share the engine's own dreadDistance; the
long-press peek got one home; rulebook.ts stopped wearing JSON quotes;
process-named tests and war-story comments now state the constraints they
pin; the protocol doc caught up to its handlers; verify-ledgers.sh can
actually count failures; the runbook learned about the determinism gate
and the nightly backups. No behavior changes — 255 tests and all 48
production ledgers replay identically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 10:58:08 -04:00

22 lines
793 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
# `|| true`: a failing replay must feed the tally, not abort the loop.
out=$(npx tsx deploy/replay-verify.mjs "$f" 2>&1 | tail -1) || true
case "$out" in
OK*) ;;
*) echo "${out:-$(basename "$f"): replay crashed with no output}"; fails=$((fails+1));;
esac
done
count=$(ls "$TMP" | wc -l | tr -d ' ')
echo "--- $count ledgers checked, $fails failures"
[ "$fails" -eq 0 ]