uwarp-space 2026-04-02
Full behavioral identity with TWGS Gold, worker session hardening, race condition tests
133 files · 7,674+ · 1,232-

Full behavioral identity with TWGS Gold

4 files changed
  • stardock.py Shipyards menu rewritten to match TWGS Gold format; Hardware Emporium, port menu, and Tavern parity fixes; TWGS-style greeting on shipyard Buy flow entry
  • display.py Prompt text and display consistency: weapons, equipment, planet, stardock commands
  • comms.py Show comms log after broadcast — matches TWGS Gold backtick behavior; exclude Entry login events from comms log display
  • engine.py Recover 1 turn when viewing who's playing (#); genesis no-torpedo message matches TWGS Gold text; jettison prompt text matches TWGS Gold
  • Full behavioral identity with TWGS Gold achieved. Shipyards menu rewritten from scratch to match TWGS Gold format including Hardware Emporium, port menu layout, Tavern, and Buy flow greeting. Prompt text and display consistency fixed across weapons, equipment, planet, and stardock commands. Comms log shown after broadcast (backtick). Entry login events excluded from comms log. 1 turn recovered when viewing who’s playing. Genesis and jettison text matched exactly. remediate behavioral
    2 files
    • stardock.py
    • engine.py

Worker session persistence hardening and end-state keying

2 files changed
  • session_runtime.py Session persistence hardened: scope terminal state by WS id, scope resume tokens by player session contract, reject boolean player IDs, stop unsafe legacy session migration, migrate legacy state key
  • cache.py Cache management hardened; narrow module import fallbacks
  • Worker session persistence hardened: terminal state scoped by WebSocket connection ID to prevent cross-session bleed. Resume tokens scoped by player session contract. Boolean player IDs rejected (was accepting True/False as valid IDs). Legacy session migration stopped — unsafe migration removed, legacy state key migrated cleanly. Auth validation preserved without bound settings. Explicit runtime settings replace os.environ bridge. harden behavioral
    1 file
    • session_runtime.py

Shared runtime setup and command loop policies

2 files changed
  • runtime.py Session runtime setup shared between server and worker
  • policies.py Command loop session policies and TWGS prompt formatting shared
  • Session runtime setup, command loop session policies, and TWGS prompt formatting extracted into shared modules used by both the server and worker. Eliminates duplicated policy logic. decouple internal
    2 files
    • runtime.py
    • policies.py

Race condition tests and aggressive PvP test suite

2 files changed
  • test_pvp_race_conditions.py Multi-player race condition tests: simultaneous actions, turn order conflicts, state consistency under concurrency
  • test_pvp_aggressive.py Aggressive mutual PvP and corporate logic tests
  • Multi-player race condition tests added to catch state corruption under concurrent player actions (simultaneous warp, simultaneous trade, turn order conflicts). Aggressive mutual PvP tests cover full combat, mutual attack, and corporate logic edge cases. qualify internal
    2 files
    • test_pvp_race_conditions.py
    • test_pvp_aggressive.py

Bot test script preservation and explorer ruff cleanup

2 files changed
  • stress_20_bots.py 20-bot stress test script preserved from prior cleanup
  • parity_recorder.py Parity recorder script for capturing TWGS Gold behavior
  • Bot test scripts preserved: 20-bot stress test, multiplayer scenario, corp test, and parity recorder. Parity recorder captures TWGS Gold behavior for new test authoring. Explorer ruff violations cleared. specify internal
    2 files
    • stress_20_bots.py
    • parity_recorder.py