PROBLEM:
All 81 existing E2E tests were disguised unit tests. They tested individual
components (IntentResolver, SpatialParser, SAE perception, single plugins)
in isolation. NONE ran the actual production workflow.
This meant:
- A broken import in resonance_evaluator? No test caught it.
- obstacle_guard ignoring OBSTACLE_SYSTEM? No test caught it.
- The full plugin chain running against a permission dialog? Never tested.
THE FIX — test_full_workflow_hostile_env.py:
These tests mock ONLY the Android device (XML dumps). Everything else is real:
- Real DopamineEngine
- Real SessionState
- Real Config
- Real PluginRegistry with ALL 18+ production plugins
- Real BehaviorContext built exactly like bot_flow.py:942-954
Tests:
1. test_feed_loop_iteration_recovers_from_permission_dialog
→ Runs the EXACT code path from bot_flow.py against a permission dialog
→ Asserts should_skip=True, zero interactions, BACK pressed
2. test_normal_feed_post_is_processable
→ Sanity check that the full pipeline processes normal posts
3. test_all_plugins_importable_and_instantiable
→ Catches broken imports (humanized_scroll bug) at registration time
4. test_plugin_chain_does_not_swallow_import_errors
→ Explicit import of every plugin module — any ImportError = test failure
RULE CODIFIED: E2E = mock ONLY Instagram. Everything else is REAL.