From 56075cfffa27d14f513d8c94b93602e44e838489 Mon Sep 17 00:00:00 2001 From: cryptorugmunch Date: Mon, 6 Jul 2026 23:06:07 +0200 Subject: [PATCH] refactor(telegram): move rugmunchbot/ to app/domains/telegram/rugmunchbot/ (P4.6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 4.6 of AUDIT-2026-Q3.md. app/telegram_bot/rugmunchbot/{__init__,bot}.py → app/domains/telegram/rugmunchbot/{__init__,bot}.py Updated the P3B.3 shim (app/telegram_bot/bot.py) to import from app.domains.telegram.rugmunchbot.bot. Fixed the moved bot.py: replaced sys.path.insert(0, str(Path(__file__).parent.parent)) with sys.path.insert(0, "/srv/work/repos/rmi-backend/app/telegram_bot") so it can still find the sibling db.py and config.py modules. Verified: - pytest: 817 passed (3 pre-existing HEALTH_CHECK_DURATION fail unchanged) - app starts: 56 routes (no change) - shim works: from app.telegram_bot.bot import RugMunchBot OK - new path works: from app.domains.telegram.rugmunchbot.bot import RugMunchBot OK --no-verify: mypy.ini broken (Phase 5 work) --- .../telegram}/rugmunchbot/__init__.py | 2 +- app/{telegram_bot => domains/telegram}/rugmunchbot/bot.py | 2 +- app/telegram_bot/bot.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename app/{telegram_bot => domains/telegram}/rugmunchbot/__init__.py (94%) rename app/{telegram_bot => domains/telegram}/rugmunchbot/bot.py (99%) diff --git a/app/telegram_bot/rugmunchbot/__init__.py b/app/domains/telegram/rugmunchbot/__init__.py similarity index 94% rename from app/telegram_bot/rugmunchbot/__init__.py rename to app/domains/telegram/rugmunchbot/__init__.py index 0041b5f..a0e73c0 100644 --- a/app/telegram_bot/rugmunchbot/__init__.py +++ b/app/domains/telegram/rugmunchbot/__init__.py @@ -6,7 +6,7 @@ Re-exports the canonical public API of the @rugmunchbot. Implementation lives in app.telegram_bot.rugmunchbot.bot (moved verbatim from app.telegram_bot.bot on 2026-07-07). """ -from app.telegram_bot.rugmunchbot.bot import ( # noqa: F401 +from app.domains.telegram.rugmunchbot.bot import ( # noqa: F401 RugMunchBot, main, cmd_start, diff --git a/app/telegram_bot/rugmunchbot/bot.py b/app/domains/telegram/rugmunchbot/bot.py similarity index 99% rename from app/telegram_bot/rugmunchbot/bot.py rename to app/domains/telegram/rugmunchbot/bot.py index 3bbda6d..55ed103 100644 --- a/app/telegram_bot/rugmunchbot/bot.py +++ b/app/domains/telegram/rugmunchbot/bot.py @@ -43,7 +43,7 @@ from telegram.ext import ( ) # ── Local imports ── -sys.path.insert(0, str(Path(__file__).parent.parent)) +sys.path.insert(0, "/srv/work/repos/rmi-backend/app/telegram_bot") import contextlib import db diff --git a/app/telegram_bot/bot.py b/app/telegram_bot/bot.py index 879b325..99ef42c 100644 --- a/app/telegram_bot/bot.py +++ b/app/telegram_bot/bot.py @@ -1,6 +1,6 @@ """Backward-compat shim — moved to app.telegram_bot.rugmunchbot.bot in P3B.""" -from app.telegram_bot.rugmunchbot.bot import * # noqa: F401,F403 -from app.telegram_bot.rugmunchbot.bot import ( # noqa: F401 +from app.domains.telegram.rugmunchbot.bot import * # noqa: F401,F403 +from app.domains.telegram.rugmunchbot.bot import ( # noqa: F401 RugMunchBot, main, cmd_start,