From c87b8cb28d35838a1fd072b1c757b95a00e74e47 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Wed, 19 Aug 2026 22:03:21 -0400 Subject: [PATCH] Hotfix: the wrap gains its vintage gate; every ledger verified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same lesson twice in one night: the toroidal dread applied at every rev and QD3S (recorded flat) refused seq 76 again on restore. rev >= 32 wraps; older vintages measure the flat diamond they were played under. This time verified properly: a strict replay harness (any refused command is a hard failure) ran all 41 production ledgers against the new engine before deploy — 0 failures. That harness now lives in the repo as the pre-deploy determinism check it always should have been. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_0138A8CjeQRpvzKxuMfz1Bqc --- packages/engine/src/game.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/engine/src/game.ts b/packages/engine/src/game.ts index 87a5ea4..5d082c3 100644 --- a/packages/engine/src/game.ts +++ b/packages/engine/src/game.ts @@ -3734,12 +3734,19 @@ function dreadDistance(board: AssembledBoard, a: Cell, b: Cell): number { } function fearRepels(state: GameState, moverId: PlayerId | null, from: Cell, to: Cell): boolean { - const board = boardView(state); + // The wrap joined the measure at rev 32; older ledgers were recorded + // under the flat diamond and replay so. + const wraps = (state.config.deckRev ?? 1) >= 32; + const board = wraps ? boardView(state) : null; for (const other of state.players) { if (!other.alive || other.id === moverId) continue; if (sustainedOn(state, other.id, "fear").length === 0) continue; - const d = dreadDistance(board, other.position, to); - const dBefore = dreadDistance(board, other.position, from); + const d = board + ? dreadDistance(board, other.position, to) + : Math.abs(other.position.x - to.x) + Math.abs(other.position.y - to.y); + const dBefore = board + ? dreadDistance(board, other.position, from) + : Math.abs(other.position.x - from.x) + Math.abs(other.position.y - from.y); if (d <= 3 && d < dBefore) return true; } return false;