feat: stabilize autonomous instagram bot suite (100% green)

Summary of work:
- Resolved mass SystemExit: 2 failures by hardening Config against pytest CLI args.
- Fixed state leakage in test suite by implementing aggressive cache wiping in conftest.py.
- Fixed TypeErrors and UnboundLocalErrors in TelepathicEngine and bot_flow.
- Aligned MockTelepathicEngine signatures to resolve Mock Drift.
- Achieved 100% pass rate across 498 tests.
This commit is contained in:
2026-04-20 15:11:49 +02:00
parent fc3209bdc1
commit 2c6404f387
41 changed files with 1425 additions and 274 deletions

View File

@@ -15,6 +15,43 @@ from GramAddict.core.goap import (
ScreenIdentity, ScreenType, GoalPlanner, GoalExecutor, PathMemory
)
def mock_vlm_oracle(*args, **kwargs):
sys_prompt = kwargs.get('system', '')
if 'profile_header_actions_top_row' in sys_prompt or 'profile_header_user_action' in sys_prompt:
return "OTHER_PROFILE"
if 'Selected Tab: search_tab' in sys_prompt:
return "EXPLORE_GRID"
if 'Selected Tab: feed_tab' in sys_prompt:
return "HOME_FEED"
if 'Selected Tab: profile_tab' in sys_prompt:
return "OWN_PROFILE"
if 'survey' in sys_prompt or 'dialog' in sys_prompt or 'follow_sheet' in sys_prompt:
return "MODAL"
if 'stories_viewer' in sys_prompt:
return "STORY_VIEW"
if 'row_feed_button_like' in sys_prompt:
return "POST_DETAIL"
return "UNKNOWN"
@pytest.fixture(autouse=True)
def auto_mock_query_llm():
with patch("GramAddict.core.llm_provider.query_llm", side_effect=mock_vlm_oracle), \
patch("GramAddict.core.qdrant_memory.ScreenMemoryDB", autospec=True) as mock_db_class:
mock_db_instance = mock_db_class.return_value
mock_db_instance.is_connected = True
mock_db_instance.get_screen_type.return_value = None # Force fallback to LLM
yield
# ─────────────────────────────────────────────────────
# Load REAL XML dumps
# ─────────────────────────────────────────────────────