refactor: split api.py monolith into 19 route modules (Phase B)

Split 3,598-line api.py into thin orchestrator (128 lines) + 19 route
modules in bot/routes/:

  core.py (7 routes), mood.py (10), language.py (3), evil_mode.py (6),
  bipolar_mode.py (9), gpu.py (2), bot_actions.py (4), autonomous.py (13),
  profile_picture.py (26), manual_send.py (3), servers.py (6),
  figurines.py (5), dms.py (18), image_generation.py (4), chat.py (1),
  config.py (7), logging_config.py (9), voice.py (3), memory.py (10)

All 146 routes verified present via test_route_split.py (149 tests).
21/21 regression tests (test_config_state.py) pass.
Monolith backup: bot/api_monolith_backup.py (revert: cp it to api.py).
This commit is contained in:
2026-04-15 11:38:14 +03:00
parent 8b14160028
commit 979217e7cc
26 changed files with 7624 additions and 3541 deletions

2
bot/routes/__init__.py Normal file
View File

@@ -0,0 +1,2 @@
# routes/ — Split from the original api.py monolith.
# Each module exposes a FastAPI APIRouter named `router`.