bbsbot 2026-02-03
Architectural refactor decomposes monolithic app.py into layered session, transport, terminal, and learning modules
115 files · 16,058+ · 1,832-

Clean layered architecture

4 files changed
  • app.py Monolithic app decomposed into separate concerns
  • session.py Core session abstraction extracted from app.py
  • session_manager.py Session lifecycle manager extracted from app.py
  • constants.py Shared configuration constants module added
  • Decomposed monolithic app.py into separate concerns: core session, session manager, transport, terminal emulation decouple architectural
    3 files
    • app.py
    • session.py
    • session_manager.py
  • Replaced old telnet/client.py and telnet/protocol.py with new transport/telnet.py abstraction decouple internal
    1 file
    • app.py
  • Moved discovery module from mcp_bbs/discover.py to mcp_bbs/learning/discovery.py decouple internal
    1 file
    • discovery.py
  • DRY refactoring to eliminate repetition in the MCP app layer decouple internal
    1 file
    • app.py

Learning system enhancements

6 files changed
  • buffer.py Learning buffer for screen capture and analysis
  • detector.py Rule-based prompt detector with JSON configuration
  • engine.py Learning engine coordinating all learning components
  • extractor.py Knowledge extractor from screen content
  • knowledge.py Knowledge store for accumulated game state
  • screen_saver.py Screen saver for session recording
  • Added learning buffer, detector, engine, extractor, knowledge, and screen saver modules instantiate behavioral
    5 files
    • buffer.py
    • detector.py
    • engine.py
    • extractor.py
    • knowledge.py
  • Implemented rule-based prompt detection with JSON configuration instantiate behavioral
    2 files
    • detector.py
    • rules.json
  • Added session logging infrastructure instantiate behavioral
    1 file
    • __init__.py

Terminal and transport

3 files changed
  • base.py Transport base class with telnet and SSH implementations
  • tedit.py TEDIT addon for in-game settings modification
  • tw2002.py TW2002 addon for game-specific command handling

Session management

3 files changed
  • session.py Core session abstraction for managing BBS connections
  • session_manager.py Session manager for lifecycle management of multiple sessions
  • constants.py Constants module for shared configuration values
  • Core session abstraction for managing BBS connections instantiate internal
    1 file
    • session.py
  • Session manager for lifecycle management of multiple sessions instantiate internal
    1 file
    • session_manager.py
  • Added constants module for shared configuration values instantiate internal
    1 file
    • constants.py

TW2002 game integration

4 files changed
  • tw2002.py TW2002 addon with game-specific command handling
  • tedit.py TEDIT integration for game settings modification
  • rules.json Expanded rules.json for TW2002 prompt patterns
  • prompts.json TW2002 prompt definitions

Playthrough scripts

4 files changed
  • play_tw2002.py Basic TW2002 playthrough script
  • play_tw2002_1000turns.py 1000-turn TW2002 playthrough script
  • play_tw2002_full.py Full TW2002 playthrough script
  • play_tw2002_intelligent.py Intelligent TW2002 playthrough with learning
  • Added multiple play scripts: play_tw2002.py, play_tw2002_1000turns.py, play_tw2002_full.py, play_tw2002_intelligent.py instantiate internal
    4 files
    • play_tw2002.py
    • play_tw2002_1000turns.py
    • play_tw2002_full.py
    • play_tw2002_intelligent.py
  • Various test and debug scripts for login diagnostics and pattern matching qualify internal
    2 files
    • debug_initial_screen.py
    • debug_login_diagnostic.py
  • Session flow documentation and diagrams specify internal
    1 file
    • generate_diagrams.py

Infrastructure

2 files changed
  • pyproject.toml Updated project configuration for new package structure
  • DIAGNOSIS.md Architecture overview and implementation checklist
  • Added handoff documents, architecture overview, and implementation checklist specify internal
    1 file
    • DIAGNOSIS.md
  • Comprehensive test suite for IAC escaping, localhost integration, path validation, session management qualify internal
    1 file
    • pyproject.toml
  • Removed old test files (test_telnet_client, test_telnet_protocol, test_jsonl_replay, test_learn) decouple internal
    1 file
    • pyproject.toml