bbsbot
2026-02-24
Massive dead code removal, game loop decomposition, manager split, and MCP tools extraction
184 files · 4,031+ · 10,983-
Dead code removal
13 files changed
play_tw2002.pyDeleted — legacy play scriptplay_tw2002_full.pyDeleted — legacy play scriptplay_tw2002_multibot.pyDeleted — legacy play scriptplay_tw2002_trading.pyDeleted — legacy play scripttest_all_patterns.pyDeleted — test scriptexecution.pyDeleted — trading package removednavigation.pyDeleted — trading package removedoperations.pyDeleted — trading package removedparsers.pyDeleted — trading package removedvalidation.pyDeleted — trading package removedsophisticated_trader.pyDeleted — 483 lines of dead codebot_twerk.pyDeleted — 158 lines of dead codetest_trading.pyDeleted — trading tests removed (278 lines)
- Deleted
commands/scripts/entirely —play_to_win/,play_tw2002_1000turns/,play_tw2002_intelligent/,play_tw2002.py,play_tw2002_full.py,play_tw2002_multibot.py,play_tw2002_trading.py,test_all_patterns.py,capture_screen.py,expect_runner.py, and more (~3000 lines) decouple internal3 files
play_tw2002.pyplay_tw2002_full.pyplay_tw2002_multibot.py
- Deleted
src/bbsbot/games/tw2002/trading/package —__init__.py,execution.py,navigation.py,operations.py,parsers.py,validation.py(~978 lines) baseline internal5 files
execution.pynavigation.pyoperations.pyparsers.pyvalidation.py
- Deleted src/bbsbot/games/tw2002/verification/ package — all verification scripts (~1332 lines)
baseline
internal
2 files
screen_audit.pytrading_integration.py
- Deleted
src/bbsbot/games/tw2002/sophisticated_trader.py(483 lines),bot_twerk.py(158 lines) decouple internal2 files
sophisticated_trader.pybot_twerk.py
- Deleted
tests/games/tw2002/test_trading.py(278 lines) qualify internal1 file
test_trading.py
Game loop decomposition
6 files changed
game_loop.pySlimmed down (347 lines removed) — logic extracted to named modulesloop_action_selection.pyAction selection extracted (147 lines, new file)loop_menu_recovery.pyMenu recovery extracted (109 lines, new file)loop_state.pyState management extracted (131 lines, new file)loop_context.pyLoop context updates (28 lines)loop_handlers.pyLoop handlers updates (48 lines)
src/bbsbot/games/tw2002/game_actions/game_loop.py(347 lines removed) — slimmed down decouple internal1 file
game_loop.py
- Added
game_actions/loop_action_selection.py(147 lines) — action selection extracted decouple internal1 file
loop_action_selection.py
- Added
game_actions/loop_menu_recovery.py(109 lines) — menu recovery extracted decouple internal1 file
loop_menu_recovery.py
- Added
game_actions/loop_state.py(131 lines) — state management extracted decouple internal1 file
loop_state.py
game_actions/loop_context.py(28 lines),loop_handlers.py(48 lines) updated decouple internal2 files
loop_context.pyloop_handlers.py
Manager split
3 files changed
__init__.pyGutted (408 lines removed) — logic moved to named modulesapp_setup.pyApp initialization extracted (92 lines, new file)swarm_manager.pySwarm management extracted (236 lines, new file)
src/bbsbot/manager/__init__.py(408 lines removed) — gutted decouple internal1 file
__init__.py
- Added
src/bbsbot/manager/app_setup.py(92 lines) — app initialization extracted decouple internal1 file
app_setup.py
- Added
src/bbsbot/manager/swarm_manager.py(236 lines) — swarm management extracted decouple internal1 file
swarm_manager.py
MCP tools extraction
2 files changed
__init__.pyGutted (406 lines removed) — logic moved to tools_coretools_core.pyCore tools extracted (396 lines, new file)
Documentation
4 files changed
bbs-mcp-tools.mdComprehensive BBS MCP tools reference (1183 lines, new file)INTELLIGENT_BOT.mdGuide condensedMULTI_CHARACTER.mdGuide condensedREADME.mdREADME updates (36 lines)
- Added
docs/reference/bbs-mcp-tools.md(1183 lines) — comprehensive BBS MCP tools reference specify internal1 file
bbs-mcp-tools.md
docs/guides/INTELLIGENT_BOT.md(460 → trimmed),docs/guides/MULTI_CHARACTER.md(343 → trimmed) — guides condensed specify internal2 files
INTELLIGENT_BOT.mdMULTI_CHARACTER.md
README.md(36 lines),docs/ARCHITECTURE_DIAGRAM.md(8 lines),docs/SYSTEM_ARCHITECTURE.md(20 lines),docs/RELEASE_CHECKLIST.md(5 lines),docs/README.md(10 lines) updated specify errata5 files
README.mdARCHITECTURE_DIAGRAM.mdSYSTEM_ARCHITECTURE.mdRELEASE_CHECKLIST.mdREADME.md
Other fixes
10 files changed
regex_utils.pyNew regex utilities module (59 lines)screen_utils.pyScreen utilities additions (12 lines)status_fields.pyWorker status fields (72 lines, new file)heuristics.pyDetection heuristics updates (48 lines)knowledge.pyOrientation knowledge updates (42 lines)parsing_logic.pyParsing logic updates (168 lines)admin_direct.pyAdmin direct rework (38 lines)cli.pyCLI updates (27 lines)rules.jsonRules updates (7 lines)test_login_prompts.pyLogin prompt tests added (12 lines)
src/bbsbot/games/tw2002/game_actions/game_loop.pyfix:menu_selectionnegative_matchfield name corrected; pause detection shadowed by tavern heuristics fixed;LoopContextPydanticmodel_rebuilderror at runtime resolved remediate internal1 file
game_loop.py
src/bbsbot/games/tw2002/admin/deleted;admin_direct.py(38 lines rework),admin_remote.pykept decouple internal1 file
admin_direct.py
src/bbsbot/games/tw2002/regex_utils.py(59 lines added),screen_utils.py(12 lines added) instantiate internal2 files
regex_utils.pyscreen_utils.py
src/bbsbot/games/tw2002/orientation/detection/heuristics.py(48 lines),knowledge.py(42 lines),parsing_logic.py(168 lines) decouple internal3 files
heuristics.pyknowledge.pyparsing_logic.py
src/bbsbot/games/tw2002/worker/status_fields.py(72 lines added) instantiate internal1 file
status_fields.py
src/bbsbot/addons/__init__.py,src/bbsbot/__init__.pyadded instantiate internal2 files
__init__.py__init__.py
src/bbsbot/cli.py(27 lines),games/tw2002/rules.json(7 lines) decouple behavioral2 files
cli.pyrules.json
.github/workflows/ci.yml(15 lines),Dockerfile(3 lines),.gitignore(8 lines) baseline internal3 files
ci.ymlDockerfile.gitignore
tests/test_login_prompts.py(12 lines added) qualify internal1 file
test_login_prompts.py