bbsbot 2026-02-27
Code quality infrastructure with strict lint rules, nine-round bug-fix session, 92–103 regression tests added
171 files · 7,219+ · 1,681-

Code quality infrastructure

2 files changed
  • .pre-commit-config.yaml Stricter lint rules: S/T20 ruff rules, mypy strict, ty, codespell added
  • pyproject.toml Quality tooling configuration updates
  • build: enable S/T20 ruff rules, add codespell, add throttle regression test — stricter lint rules enabled qualify errata
    1 file
    • .pre-commit-config.yaml
  • build: add mypy to pre-commit and enable strict ruff rules specify behavioral
    1 file
    • .pre-commit-config.yaml
  • build: add ty type-check to pre-commit hooks instantiate internal
    1 file
    • .pre-commit-config.yaml

Orchestration refactor

3 files changed
  • game_loop.py Orchestration FSM formalized with explicit state enum; DecisionPlan Pydantic model extracted
  • guard_logic.py FailureBudget unified from scattered failure trackers
  • guard_decision.py Guard decision updates for DecisionPlan model
  • refactor: formalize orchestration FSM with explicit state enum — bot lifecycle states made explicit decouple internal
    1 file
    • game_loop.py
  • refactor: unify FailureBudget from scattered failure trackers — failure tracking consolidated decouple internal
    1 file
    • guard_logic.py
  • refactor: extract DecisionPlan Pydantic model from _with_meta() dict decouple internal
    1 file
    • guard_decision.py
  • Added 4 orchestration contract tests qualify internal
    1 file
    • test_orchestration_contracts.py

Bug fixes (9 review rounds)

15 files changed
  • cargo_ledger.py Cargo accounting bugs fixed; stale cargo fields zeroed when hold accounting proves empty
  • executor_trade.py Trade executor concurrency and error handling fixes
  • loop_guards.py Loop guard concurrency and task safety fixes
  • session_manager.py Session manager concurrency fixes
  • bot_worker.py Worker blocking I/O offloaded; task leak fixes
  • advisor.py Intervention advisor wiring fixes
  • sequence.py Credential lookup and login retry fixes
  • phases.py Login phase fixes
  • guard_core.py Guard core fixes
  • loop_context.py Loop context fixes
  • loop_state.py Loop state fixes; stuck-repeat cooldown and LLM thrash fixes
  • bot_process.py Bust respawn orphan bot fix; timeseries thread-safety fix
  • swarm_manager.py ship_level type mismatch fix (was causing 422 on all status reports)
  • dashboard.html Tooltip descriptions added to all column headers
  • dashboard.js Dashboard JS updates
  • fix: ninth-pass coverage — status telemetry, credential lookup, loop recovery error handling qualify behavioral
    2 files
    • sequence.py
    • loop_state.py
  • fix: harden concurrency, credentials, and error recovery; add 103 tests qualify internal
    2 files
    • executor_trade.py
    • loop_guards.py
  • fix: data bug, concurrency races, error handling; extract constants; add 92 tests qualify internal
    2 files
    • cargo_ledger.py
    • session_manager.py
  • fix: address code review findings — bugs, types, and deduplication remediate internal
    1 file
    • guard_core.py
  • Round 4 review — bugs, concurrency, code quality, and new tests qualify internal
    2 files
    • loop_guards.py
    • loop_state.py
  • fix: round 5 review — blocking I/O, task leak, super() anti-pattern remediate internal
    1 file
    • bot_worker.py
  • fix: hardening, async offload, dashboard improvements, and regex pre-compile remediate behavioral
    2 files
    • dashboard.html
    • dashboard.js
  • fix: ship_level type mismatch causing 422 on all status reports remediate internal
    1 file
    • swarm_manager.py
  • fix: eliminate thread-safety races in state save and timeseries counter remediate internal
    1 file
    • bot_process.py
  • fix: bust_respawn fails to kill orphan bots after manager restart remediate internal
    1 file
    • bot_process.py

Cargo accounting

1 file changed
  • cargo_ledger.py _reconcile_stale_cargo helper extracted; stale cargo fields zeroed when hold accounting proves empty
  • fix: extract _reconcile_stale_cargo helper and add 17 regression tests qualify internal
    1 file
    • cargo_ledger.py
  • fix: zero stale cargo fields when hold accounting proves they are empty remediate internal
    1 file
    • cargo_ledger.py

Dashboard and UX

1 file changed
  • dashboard.html Tooltip descriptions added to all column headers

Stuck-loop and recovery

2 files changed
  • loop_state.py Warning throttle reset on recovery; stuck-repeat cooldown and LLM thrash loop fixed
  • loop_guards.py Round 6 critical bug fixes
  • fix: reset warning throttle on status report recovery remediate internal
    1 file
    • loop_state.py
  • fix: stuck-repeat now forces immediate cooldown on first hit remediate internal
    1 file
    • loop_state.py
  • fix: stuck-repeat LLM thrash loop and guard metadata loss remediate internal
    2 files
    • loop_state.py
    • loop_guards.py
  • fix: round 6 critical bug fixes remediate internal
    1 file
    • loop_guards.py