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.pyMonolithic app decomposed into separate concernssession.pyCore session abstraction extracted from app.pysession_manager.pySession lifecycle manager extracted from app.pyconstants.pyShared configuration constants module added
- Decomposed monolithic
app.pyinto separate concerns: core session, session manager, transport, terminal emulation decouple architectural3 files
app.pysession.pysession_manager.py
- Replaced old
telnet/client.pyandtelnet/protocol.pywith newtransport/telnet.pyabstraction decouple internal1 file
app.py
- Moved discovery module from
mcp_bbs/discover.pytomcp_bbs/learning/discovery.pydecouple internal1 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.pyLearning buffer for screen capture and analysisdetector.pyRule-based prompt detector with JSON configurationengine.pyLearning engine coordinating all learning componentsextractor.pyKnowledge extractor from screen contentknowledge.pyKnowledge store for accumulated game statescreen_saver.pyScreen saver for session recording
- Added learning buffer, detector, engine, extractor, knowledge, and screen saver modules
instantiate
behavioral
5 files
buffer.pydetector.pyengine.pyextractor.pyknowledge.py
- Implemented rule-based prompt detection with JSON configuration
instantiate
behavioral
2 files
detector.pyrules.json
- Added session logging infrastructure
instantiate
behavioral
1 file
__init__.py
Terminal and transport
3 files changed
base.pyTransport base class with telnet and SSH implementationstedit.pyTEDIT addon for in-game settings modificationtw2002.pyTW2002 addon for game-specific command handling
- New terminal emulator with ANSI escape handling
instantiate
internal
1 file
base.py
- Transport base class with telnet and SSH implementations
instantiate
internal
1 file
base.py
- Screen buffer for terminal state management
instantiate
internal
1 file
base.py
Session management
3 files changed
session.pyCore session abstraction for managing BBS connectionssession_manager.pySession manager for lifecycle management of multiple sessionsconstants.pyConstants 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.pyTW2002 addon with game-specific command handlingtedit.pyTEDIT integration for game settings modificationrules.jsonExpanded rules.json for TW2002 prompt patternsprompts.jsonTW2002 prompt definitions
- Added TW2002 addon with game-specific command handling
instantiate
behavioral
1 file
tw2002.py
- TEDIT integration for game settings modification
instantiate
internal
1 file
tedit.py
- Added prompts.json and expanded rules.json for TW2002 prompt patterns
instantiate
behavioral
2 files
prompts.jsonrules.json
Playthrough scripts
4 files changed
play_tw2002.pyBasic TW2002 playthrough scriptplay_tw2002_1000turns.py1000-turn TW2002 playthrough scriptplay_tw2002_full.pyFull TW2002 playthrough scriptplay_tw2002_intelligent.pyIntelligent 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.pyplay_tw2002_1000turns.pyplay_tw2002_full.pyplay_tw2002_intelligent.py
- Various test and debug scripts for login diagnostics and pattern matching
qualify
internal
2 files
debug_initial_screen.pydebug_login_diagnostic.py
- Session flow documentation and diagrams
specify
internal
1 file
generate_diagrams.py
Infrastructure
2 files changed
pyproject.tomlUpdated project configuration for new package structureDIAGNOSIS.mdArchitecture 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