From 23b72ddc6de7b649540c848558f6e139d263dec3 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Wed, 23 Sep 2026 13:42:02 -0400 Subject: [PATCH] The ledger gate replays with the table's options, and takes the site from SITE for a machine whose DNS lags Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG --- template/deploy/replay-ledgers.ts | 4 +++- template/deploy/verify-ledgers.sh | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/template/deploy/replay-ledgers.ts b/template/deploy/replay-ledgers.ts index 1d25467..0b56fdf 100644 --- a/template/deploy/replay-ledgers.ts +++ b/template/deploy/replay-ledgers.ts @@ -34,11 +34,13 @@ async function main(): Promise { const seats: Seat[] = []; let state: ReturnType | null = null; let turns = 0; + // The host's table options ride the room line; a game created without them is a different game. + const options = (lines[0]?.t === 'room' ? lines[0].options : undefined) as Record | undefined; try { for (const line of lines) { if (line.t === 'seat') seats.push(line); else if (line.t === 'unseat') seats.splice(seats.findIndex((s) => s.id === line.id), 1); - else if (line.t === 'start') state = game.create(Object.fromEntries(seats.map((s) => [s.id, s.name])), line.seed, line.rules ?? 1); + else if (line.t === 'start') state = game.create(Object.fromEntries(seats.map((s) => [s.id, s.name])), line.seed, line.rules ?? 1, options); else if (line.t === 'turn' && state) { state = game.resolve(state, line.inputs); turns += 1; diff --git a/template/deploy/verify-ledgers.sh b/template/deploy/verify-ledgers.sh index 9de1ddc..3e86dad 100755 --- a/template/deploy/verify-ledgers.sh +++ b/template/deploy/verify-ledgers.sh @@ -6,7 +6,8 @@ # deploy/verify-ledgers.sh [https://site] set -euo pipefail HOST="${1:?usage: verify-ledgers.sh [https://site]}" -SITE="${2:-https://__DOMAIN__}" +# SITE in the environment overrides the name, for a machine whose DNS has not caught up with a new record. +SITE="${2:-${SITE:-https://__DOMAIN__}}" DIR="$(mktemp -d)" trap 'rm -rf "$DIR"' EXIT rsync -az "root@$HOST:/var/lib/__SLUG__/rooms/" "$DIR/"