85baabe4ba
- internal/robot: durable kind='robot' account pool (migration 00004); every per-game and per-turn choice derived deterministically from the game seed (restart-stable FNV mix); a background move driver; margin targeting (band 1-30, closest-to-band); right-skewed [2,90]min delays (median ~10m); opponent-anchored sleep with +/-3h drift; daytime nudge reply + proactive 12h nudge; friend/chat blocked via profile toggles. - engine.Candidates (decoded ranked plays); game.Candidates + RobotTurns; social.LastNudgeAt. - matchmaker: 10s wait then robot substitution (reaper) + Poll delivery seam. - config (BACKEND_ROBOT_DRIVE_INTERVAL, BACKEND_LOBBY_ROBOT_WAIT, BACKEND_LOBBY_REAPER_INTERVAL); main wiring + boot-time pool provisioning. - metrics: robot account_stats (authoritative balance) + robot_games_finished_total OTel counter + per-finish log. - docs: PLAN, ARCHITECTURE, FUNCTIONAL(+ru), TESTING, README; account.go comment. - tests: robot strategy units, matchmaker reaper/Poll, engine.Candidates; inttest robot full-game / substitution / proactive-nudge.
16 lines
704 B
SQL
16 lines
704 B
SQL
-- +goose Up
|
|
-- Stage 5 robot opponent: admit a 'robot' identity kind so the robot pool can be
|
|
-- provisioned as durable accounts (one identity row per named robot). This widens
|
|
-- the identities kind CHECK only; no table or column changes, so the generated
|
|
-- jet code is unaffected.
|
|
SET search_path = backend, pg_catalog;
|
|
|
|
ALTER TABLE identities DROP CONSTRAINT identities_kind_chk;
|
|
ALTER TABLE identities ADD CONSTRAINT identities_kind_chk CHECK (kind IN ('telegram', 'email', 'robot'));
|
|
|
|
-- +goose Down
|
|
SET search_path = backend, pg_catalog;
|
|
|
|
ALTER TABLE identities DROP CONSTRAINT identities_kind_chk;
|
|
ALTER TABLE identities ADD CONSTRAINT identities_kind_chk CHECK (kind IN ('telegram', 'email'));
|