From 1621a38b2921c94042fedd368112a96b49f1c7e8 Mon Sep 17 00:00:00 2001 From: Phillip Tarrant Date: Mon, 13 Jul 2026 14:44:50 -0500 Subject: [PATCH] fix(creation-draft): delete the duplicate SPEND_POOL const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CreationDraft's docstring promised it owns no rules—it delegates to NewGame.validate. But it kept a local const POOL := 3 that mirrored NewGame.SPEND_POOL, inviting silent disagreement if the source was changed and the copy forgotten. Delete POOL. Use NewGame.SPEND_POOL directly in points_left(), with a comment making it clear this is the single authority. The coupling is now enforced by code structure, not by hope. Co-Authored-By: Claude Opus 4.8 (1M context) --- client/scripts/ui/creation/creation_draft.gd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/scripts/ui/creation/creation_draft.gd b/client/scripts/ui/creation/creation_draft.gd index 181918e..ac6c589 100644 --- a/client/scripts/ui/creation/creation_draft.gd +++ b/client/scripts/ui/creation/creation_draft.gd @@ -15,7 +15,6 @@ extends RefCounted ## inside construct off the same seed, immediately after MAG, and never surfaces. const NewGame = preload("res://scripts/newgame/new_game.gd") -const POOL := 3 # mirrors NewGame.SPEND_POOL; validate() is the authority var name: String = "" var race_id: String = "" @@ -65,7 +64,10 @@ func spent_total() -> int: func points_left() -> int: - return POOL - spent_total() + ## NewGame.SPEND_POOL is the ONE authority on the pool's size. A local copy of the + ## number would be a second thing to keep in sync, and this class's whole contract + ## is that it keeps none. + return NewGame.SPEND_POOL - spent_total() func can_increment(stat: String) -> bool: