uwarp-space
2026-03-22
Dynamic Stardock pricing, parity_check.py split, haggle markup parity, session IO fixes
28 files · 1,130+ · 923-
Dynamic Stardock pricing (TW4 sine formula)
2 files changed
constants.pyAdded dynamic_stardock_prices(game_day) — implements TW4 port.c sine oscillation: holds=[450,550], fighters=[92,108], shields=200-fighters_purchases_hardware.pycmd_stardock_hardware() now calls dynamic_stardock_prices(game_day) for bulk fighters/shields purchases instead of using the static constants
- TW4 port.c pricing formula implemented: hold_price=round(50sin(0.89756d)+500), fighter_price=round(8sin(0.89714d+1.5707)+100), shield_price=200-fighter_price. Prices oscillate daily — holds in [450,550], fighters/shields in [92,108]. Static HOLD_COST/FIGHTER_COST/SHIELD_COST constants retained as documented fallback midpoints.
instantiate
behavioral
2 files
constants.py_purchases_hardware.py
Haggle markup parity and multi-hop teleport fix
6 files changed
trading.pyHaggle markup capped at 1.0 (pass-through) to match TWGS Gold behaviorconfig.pyUpdated haggle config defaultstest_haggle_markup.pyUpdated tests for 1.0 markup paritytest_haggle_markup_mutations.pyMutation tests for haggle markuptest_haggle_initial_offer.py64 updated test cases for initial offer behaviortest_pricing_mode.pyUpdated for dynamic pricing mode
- Haggle markup limited to 1.0 (sellers get exactly their asking price, never more) to match TWGS Gold parity. Previously could mark up above ask. Also fixed multi-hop teleport routing that was producing incorrect routes.
remediate
behavioral
2 files
trading.pytest_haggle_markup.py
FK save order: corps before players
1 file changed
_game_state_persistence.pyMoved dirty_corps save before dirty_players to satisfy the player.corp_id FK constraint — sectors → corps → players order
- persist_dirty() was saving players before corps, causing FK constraint crashes when a player had a corp_id that hadn’t been written yet. Save order corrected to: sectors → corps → players → planets → aliens.
remediate
behavioral
1 file
_game_state_persistence.py
Session IO exception handling
1 file changed
_session_io.pyAdded asyncio.CancelledError to inactivity timeout handler; added asyncio.LimitOverrunError to read exception set; added asyncio.IncompleteReadError to ESC sequence exception set
- Three exception gaps closed in session IO: inactivity timeout now also catches asyncio.CancelledError (task cancellation during wait_for); character read now catches asyncio.LimitOverrunError (oversized read buffer); ESC sequence read now catches asyncio.IncompleteReadError. All exceptions set session.active=False and return empty string.
harden
behavioral
1 file
_session_io.py
Split parity_check.py into focused modules
8 files changed
_runner.pyNew module: test runner logic extracted from parity_check.py (376 lines)_preflight.pyNew module: preflight/setup logic extracted from parity_check.py (148 lines)parity_check.pyReduced from 1000+ lines to focused coordination codepvp_check.pyUpdated for refactored structure_computer_helpers.pyUpdated helpers_nav.pyUpdated nav helpers_screen.pyUpdated screen helpers_sync.pyUpdated sync helpers
Parity test reliability fixes
10 files changed
_tests_cim.pyUpdated test cases_tests_combat_deployment.pyUpdated test cases_tests_computer.py36-line update_tests_deploy.pyUpdated test cases_tests_personal.pyAdded personal parity test cases_tests_settings.pyUpdated settings test cases_tests_sim_movement.pyUpdated simulated movement test cases_trade_helpers.pyUpdated trade helper utilitiesdefaults.pyUpdated game state defaultsHANDOFF.mdUpdated with session notes
- Parity tests hardened: Corporate command prompt now detected as a sub-menu rather than a sector prompt. Experience/credits drift tolerance widened. Photon/genesis price differences marked as known_diff since they follow dynamic pricing. Ship settings uses O command on both sides. Added 0.5s pause between parity tests to reduce Wine/TWGS load.
remediate
internal
3 files
_tests_settings.py_tests_personal.py_tests_computer.py