bbsbot 2026-03-21
Extract DetectionEngine to undef-terminal, rewrite LearningEngine as wrapper, and fix 160 ruff lint errors
231 files · 20,394+ · 14,196-

Extract DetectionEngine to undef.terminal.detection

7 files changed
  • engine.py LearningEngine rewritten as thin wrapper around DetectionEngine
  • detector.py Removed — moved to undef.terminal.detection
  • extractor.py Removed — moved to undef.terminal.detection
  • pattern_loader.py Updated for new DetectionEngine API
  • rules.py Updated for new detection package
  • 2026-03-21-detection-engine-extraction-design.md Design spec for the extraction
  • 2026-03-21-detection-engine-extraction.md Implementation plan for the extraction
  • The detection/learning engine that matched game prompts has been extracted from bbsbot into the undef.terminal.detection package in undef-terminal decouple architectural
    2 files
    • engine.py
    • detector.py
  • Added design spec and implementation plan documents for the extraction specify internal
    2 files
    • 2026-03-21-detection-engine-extraction-design.md
    • 2026-03-21-detection-engine-extraction.md
  • Removed learning source files that were moved to undef.terminal.detection decouple internal
    2 files
    • detector.py
    • extractor.py

Rewrite LearningEngine as DetectionEngine wrapper

5 files changed
  • engine.py Thin backward-compatibility wrapper around DetectionEngine
  • session.py Renamed enable_learning to enable_detection
  • session_manager.py Updated for enable_detection rename
  • bot.py Updated for enable_detection rename
  • bot_core.py Updated for enable_detection rename
  • LearningEngine is now a thin backward-compatibility wrapper around DetectionEngine from undef-terminal decouple internal
    1 file
    • engine.py
  • Renamed enable_learning to enable_detection in all callers and session initialization decouple internal
    2 files
    • session.py
    • bot.py
  • Removed stale enable_learning/disable_learning aliases decouple internal
    1 file
    • engine.py
  • Removed dead BotStatusBase backward-compat alias decouple internal
    1 file
    • models.py
  • Removed unused trade_interaction_seen parameter deprecate internal
    1 file
    • game_loop.py

MCP and debug tools updated for new detection API

4 files changed
  • bbs_debug.py Updated to use detection_engine.detector and undef.terminal.detection imports
  • bbs_tools.py Updated for detection API
  • server.py MCP server updates for detection
  • pyproject.toml Updated undef-terminal dependency to include detection package
  • Updated MCP debug/tools to use detection_engine.detector and undef.terminal.detection imports interface internal
    2 files
    • bbs_debug.py
    • bbs_tools.py
  • Updated undef-terminal dependency to include the new detection package baseline internal
    1 file
    • pyproject.toml

Tests and code quality

6 files changed
  • test_term_hijack_api.py Fixed for inline control stream protocol
  • test_term_routes.py Fixed for inline control stream protocol
  • check_spdx_headers.py SPDX header check script
  • check_max_loc.py Max LOC check script
  • tradewars.py Guarded module-level setup_telemetry calls
  • defaults.py Updated defaults
  • Fixed hijack/term tests for the inline control stream protocol qualify internal
    2 files
    • test_term_hijack_api.py
    • test_term_routes.py
  • Fixed all 160 ruff lint errors (160 to 0) remediate errata
    2 files
    • bot.py
    • connection.py
  • Fixed SPDX headers, max-LOC file splits, and bandit suppression annotations specify internal
    2 files
    • check_spdx_headers.py
    • check_max_loc.py
  • Guarded module-level setup_telemetry calls to prevent double-init crashes harden internal
    1 file
    • tradewars.py
  • Removed unused pexpect dependency deprecate internal
    1 file
    • pyproject.toml