bbsbot 2026-02-09
Login hardening with 10 fixes to the state machine, port haggling mechanics, chaos transport, and self-healing worker
140 files · 6,013+ · 1,716-

Login hardening

2 files changed
  • login.py Comprehensive login state machine fixes for character creation and password handling
  • connection.py Login phase detection and keepalive disabling during login
  • Fixed Password? prompt infinite loop in login remediate behavioral
    1 file
    • login.py
  • Fixed TWGS real-name prompt detection remediate behavioral
    1 file
    • login.py
  • Hardened password prompt disambiguation and avoid invalid_password hard-fail harden behavioral
    1 file
    • login.py
  • Fixed new-character password verify (send twice when prompt includes repeat) remediate behavioral
    1 file
    • login.py
  • Handle start-new-character prompt after server reset harden behavioral
    1 file
    • login.py
  • Prioritize is-what-you-want confirmation over ship/planet name prompts harden internal
    1 file
    • login.py
  • Fixed alias input prompt handling; don’t override name_or_bbs by prompt_id remediate behavioral
    1 file
    • login.py
  • Detect login/creation phases from screen; only treat command prompt as in-game harden behavioral
    1 file
    • connection.py
  • Login backoff on failed-to-start-game-session margin internal
    1 file
    • login.py
  • Disabled default keepalive during login to prevent interference harden behavioral
    1 file
    • generic_io.py

Port trading mechanics

3 files changed
  • operations.py Bounded policy-based port haggling system
  • knowledge.py Port market table persistence for optimal routing
  • profitable_pairs.py Price-aware pair selection and port liquidity caps
  • Implemented bounded, policy-based port haggling system instantiate behavioral
    1 file
    • operations.py
  • Added port market table persistence (status/percentage/price) for optimal routing instantiate internal
    1 file
    • knowledge.py
  • Track port price quotes; use price-aware pair selection instantiate internal
    1 file
    • profitable_pairs.py
  • Port liquidity caps in profit estimates harden internal
    1 file
    • profitable_pairs.py
  • Fix port market parsing: “Trading” is units (not price); persist liquidity remediate internal
    1 file
    • parsing.py
  • Abort low-credit port trades to prevent haggle loops harden internal
    1 file
    • operations.py
  • Added recovery budgets with blocked backoff margin internal
    1 file
    • profitable_pairs.py

Chaos transport

1 file changed
  • session.py Chaos transport with deterministic failure injection
  • Added deterministic chaos transport for resilience testing qualify internal
    1 file
    • session.py
  • Inject controlled failures (delays, disconnects, corruption) for hardening harden internal
    1 file
    • session.py

Self-healing worker

2 files changed
  • bot_core.py Watchdog-based reconnect on stalls and self-healing loop
  • session_manager.py Session manager with event-driven screen detection via reader pump
  • Added watchdog to force reconnect on no-progress stalls harden behavioral
    1 file
    • bot_core.py
  • Implemented self-healing worker loop with automatic recovery harden behavioral
    1 file
    • bot_core.py
  • Exit non-zero on worker error; manager preserves reported errors harden internal
    1 file
    • bot_core.py
  • Event-driven screen detection via reader pump instantiate behavioral
    1 file
    • session_manager.py

Screen audit and debug tools

2 files changed
  • debug_screens.py TW2002 screen analysis module
  • SCREEN_AUDIT.md Screen audit tooling documentation
  • Added step-through terminal UI for debugging specify behavioral
    1 file
    • debug_screens.py
  • Added screen audit tooling and SCREEN_AUDIT.md documentation specify internal
    1 file
    • SCREEN_AUDIT.md
  • Added debug_screens.py module for TW2002 screen analysis specify internal
    1 file
    • debug_screens.py
  • Fix screen loop detection and turns tracking remediate internal
    1 file
    • bot_core.py

Dashboard and status

1 file changed
  • swarm_routes.py Strategy column, cargo columns, and dashboard display improvements
  • Show strategy column in dashboard; improve login status details instantiate behavioral
    1 file
    • swarm_routes.py
  • Expose cargo columns and stardock activity mapping instantiate internal
    1 file
    • swarm_routes.py
  • Fix dashboard column widths and truncate long bot IDs remediate behavioral
    1 file
    • swarm_routes.py
  • Report PAUSED/phase in status_detail; preserve activity through pause instantiate internal
    1 file
    • swarm_routes.py
  • Continuously update semantic credits/sector from session watcher instantiate internal
    1 file
    • swarm_routes.py

Configuration

1 file changed
  • config.py swarm_play_to_win config and auto-generated username support
  • Added swarm_play_to_win config (infinite run, profitable_pairs + upgrades) baseline internal
    1 file
    • config.py
  • Worker auto-generate unique username when not configured harden internal
    1 file
    • config.py
  • Strategy/mode/intent shown in status and dashboard instantiate behavioral
    1 file
    • swarm_routes.py

Trading stability

2 files changed
  • profitable_pairs.py Low-credit haggle loop fixes and refresh after port trades
  • opportunistic.py Buy/sell intent handling and haggle mode guards
  • Fix low-credit port haggle loop remediate internal
    1 file
    • profitable_pairs.py
  • Make recovery and trading handle low-credit port haggles harden internal
    1 file
    • profitable_pairs.py
  • Refresh stats after port trades for accurate credits/cargo remediate internal
    1 file
    • profitable_pairs.py
  • Respect buy/sell intent in port trades harden internal
    1 file
    • opportunistic.py
  • Don’t pre-skip sells; only haggle in aggressive mode harden internal
    1 file
    • opportunistic.py

Prompt detection

2 files changed
  • detection.py Optimized prompt detection via prompt-region scan and stable fingerprint
  • models.py Pause prompt matching with proper anchoring
  • Optimized prompt detection via prompt-region scan and stable fingerprint streamline behavioral
    1 file
    • detection.py
  • Detect pause prompts reliably even with Trade Wars banners harden internal
    1 file
    • detection.py
  • Fix pause prompt matching with proper anchoring remediate behavioral
    1 file
    • models.py

Infrastructure

1 file changed
  • game_entry.py Game entry verification for swarm bots