183e08ec80
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 48s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m10s
Decouple the displayed opponent name from the small pool of durable robot accounts: the disguised auto-match robot now gets a freshly composed name each game, stamped on a new game_players.display_name seat snapshot. The snapshot also captures humans' names, freezing what an opponent sees for the life of a game (a later rename no longer rewrites past games); readers fall back to the account's current name for pre-migration rows. Names come from a wide composed corpus (internal/robot/namevariety.go): Western locales (EN/DE/ES/IT/FR/PT), native Japanese/Chinese names, a gender-agreed Russian pool, and human-style handles. Routing keeps Pick's spirit -- a Russian game draws Cyrillic + <=20% Latin and never a CJK script; an English game the full corpus -- via robot.PickNamed. Loosen account.ValidateDisplayName (and the UI mirror) to admit a trailing run of up to five digits, so "Player2007"-style handles are valid for humans too and the disguised robot stays indistinguishable. Migration 00007 adds game_players.display_name (additive, NOT NULL DEFAULT ''); jet regenerated. Docs (ARCHITECTURE 7, FUNCTIONAL + _ru, PLAN, README) updated.
17 lines
870 B
SQL
17 lines
870 B
SQL
-- +goose Up
|
|
-- A per-seat snapshot of the player's display name, captured when the seat is taken:
|
|
-- the human's then-current display name, or a disguised robot's freshly composed
|
|
-- per-game name. Storing the name on the seat (rather than always reading the account)
|
|
-- freezes what the opponent sees for the life of the game — a later rename no longer
|
|
-- rewrites past games — and lets the small robot pool present an ever-changing crowd of
|
|
-- differently named opponents. An empty value means "no snapshot": the reader falls back
|
|
-- to the account's current display name (legacy rows / pre-migration games). See
|
|
-- docs/ARCHITECTURE.md §7.
|
|
SET search_path = backend, pg_catalog;
|
|
|
|
ALTER TABLE game_players ADD COLUMN display_name text NOT NULL DEFAULT '';
|
|
|
|
-- +goose Down
|
|
SET search_path = backend, pg_catalog;
|
|
ALTER TABLE game_players DROP COLUMN display_name;
|