171 Commits

Author SHA1 Message Date
fddf14fd67 test(e2e): purge FakeSAENormal and instantiate real Cognitive Stack
PRODUCTION FIX 2026-04-30 12:45:
The entire E2E suite was systematically lying by testing a shell of the bot:
1. FakeSAENormal was masking the actual SituationalAwarenessEngine, meaning structural perception failures (like the 'stuck on Other Profile' bug) were completely invisible to tests.
2. The e2e_cognitive_stack was hardcoded to return None for 80% of engines (NavGraph, ZeroEngine, Telepathic, Darwin, ActiveInference), causing plugins to silently bypass their core logic during tests.
3. get_screenshot_b64 and screenshot() returned None, preventing the VLM stack from even running structural fallback code.

Fix:
- Systematically stripped FakeSAENormal from all 29 E2E workflow tests.
- Built e2e_cognitive_stack_factory to instantiate the REAL Cognitive Stack (GrowthBrain, QNavGraph, ZeroLatencyEngine, etc.) just like in bot_flow.py.
- Patched ONLY the external LLM network requests in conftest.py via mock_llm_network_calls so that structural execution stays 100% real but avoids non-deterministic LLM timeouts.
- Injected a valid 1x1 black image for screenshots.

All 29 E2E tests now execute the true production logic path and pass in 49 seconds.
2026-04-30 12:46:01 +02:00
392abff313 fix(intent_resolver): add Nav Conflict Guard — Back button never valid for tab intents
PRODUCTION BUG 2026-04-30 11:50:
VLM returned action_bar_button_back (desc='Back') for 'tap profile tab'
intent on OTHER_PROFILE screen. This caused account_switcher to navigate
AWAY from the profile instead of opening the account selector bottom
sheet, halting the session.

Root cause: _visual_discovery pre-filter did not exclude navigation
buttons (Back, Close) when the intent was for a tab element.

Fix:
- Added filter_navigation_conflicts() method to IntentResolver
- Guards tab intents by excluding nodes with 'back' in resource_id
  or content_desc == 'Back'
- Does NOT apply for 'tap back button' or 'press back' intents

TDD:
- RED: test_intent_resolver_back_guard.py — 2 tests that call
  filter_navigation_conflicts on real OTHER_PROFILE XML
- GREEN: filter_navigation_conflicts method + wired into _visual_discovery
- E2E: test_workflow_account_switch.py, test_workflow_vlm_tab_confusion.py

31/31 tests passing.
2026-04-30 12:10:44 +02:00
556bd181fa test(e2e): complete workflow coverage — all feeds, obstacles, and production regressions
NEW WORKFLOW TESTS (all using shared conftest fixtures):

Feed workflows:
- test_workflow_reels_feed.py — Reels feed processing
- test_workflow_explore_feed.py — Explore grid processing
- test_workflow_stories_feed.py — Stories feed + story view
- test_workflow_search_feed.py — Search feed processing
- test_workflow_dm_inbox.py — DM inbox + thread
- test_workflow_post_detail.py — Post detail + carousel
- test_workflow_profiles.py — User profile, scraping, followers, unfollow

Obstacle workflows:
- test_workflow_instagram_modal.py — Survey/rating modals
- test_workflow_locked_screen.py — Locked screen detection

Production regressions from 2026-04-30 session:
- test_workflow_stuck_other_profile.py — Bot stuck cycling through
  plugins on OTHER_PROFILE, all returning 'Cannot X on other_profile'
  (7x same profile, 35x snapping attempts)
- test_workflow_same_post_loop.py — Infinite snapping loop when
  device returns identical XML after each swipe

Total workflow coverage: 24 tests across 13 files, <100 LoC each.
2026-04-30 11:39:36 +02:00
2c44331f03 refactor(e2e): extract workflow infrastructure into conftest, one test file per workflow
BEFORE: Giant monolith test files with duplicated device stubs, config
factories, and cognitive stack builders. The infrastructure was copy-pasted
into each file.

AFTER: Clean separation:
- conftest.py: E2EDeviceStub, e2e_device, e2e_cognitive_stack,
  e2e_session, e2e_workflow_ctx fixtures
- test_workflow_permission_dialog.py: Permission dialog recovery
- test_workflow_foreign_app.py: Foreign app (Chrome) recovery
- test_workflow_normal_feed.py: Normal post processing
- test_workflow_plugin_integrity.py: Import + interface sanity

Each workflow file is <100 lines. Zero duplication. Every test uses
the shared e2e_workflow_ctx fixture which runs the EXACT code path
from bot_flow.py:942-971.

DELETED: test_full_workflow_hostile_env.py, test_plugin_chain_hostile_env.py
(monolith files replaced by the above)
2026-04-30 11:20:35 +02:00
b83b55e02b test(e2e): add TRUE E2E workflow tests — only device mocked, everything else real
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.
2026-04-29 23:32:01 +02:00
db226ed7c2 test(e2e): add plugin chain integration tests for hostile environments
THE ROOT CAUSE OF LYING TESTS:
81 E2E tests existed but ZERO tested the full plugin chain (execute_all)
against non-Instagram environments. Each plugin was tested in isolation,
but the integration between perception (SAE) and action (obstacle_guard)
was a complete blind spot.

NEW TESTS:
- test_chain_terminates_on_permission_dialog: Proves the full plugin chain
  terminates at obstacle_guard when a system permission dialog is detected.
  No downstream interaction plugins (resonance, like, follow) may fire.
- test_chain_terminates_on_foreign_app: Same for Chrome/browser takeover.
- test_chain_passes_through_on_normal_instagram: Sanity check that the
  chain runs normally on valid Instagram feeds.

These tests would have caught the 23:01 stuck-loop bug BEFORE it shipped.
2026-04-29 23:13:54 +02:00
47f94b699c fix(guard): handle OBSTACLE_SYSTEM + OBSTACLE_FOREIGN_APP in obstacle_guard, fix broken humanized_scroll import
🔴 RED: Tests proved obstacle_guard silently ignored system permission dialogs
   and foreign app overlays, causing the bot to get stuck on Android modals.
🟢 GREEN: obstacle_guard now dismisses OBSTACLE_SYSTEM and OBSTACLE_FOREIGN_APP
   with immediate back-press, preventing the interaction chain from running
   against non-Instagram UI elements.
🔵 REFACTOR: Fixed broken import in resonance_evaluator (was importing
   humanized_scroll from utils instead of physics.humanized_input).
2026-04-29 23:05:59 +02:00
96fdbd7db7 test(perception): add strict TDD suite for autonomous ad marker learning and verification 2026-04-29 21:29:05 +02:00
ca91ae4b33 feat(perception): autonomous FSD ad marker learning with zero-latency structural persistence 2026-04-29 21:25:03 +02:00
a560225dc9 feat(perception): integrate VLM visual ad detection into resonance vibe check to block obfuscated ads 2026-04-29 21:20:09 +02:00
849fb63426 fix(orchestrator): inject --goal into persona_interests for autonomous resonance evaluation and fix scope shadowing bugs 2026-04-29 19:30:21 +02:00
fc44633ebc fix(physics): prevent infinite alignment loops on Reels and refine intent to avoid follow buttons 2026-04-29 19:05:31 +02:00
0f5b71708d fix(perception): enforce visual Set of Mark by passing device context globally 2026-04-29 18:40:58 +02:00
0ef2840f79 fix(perception): complete bug 5,6,7,8,10 fixes
- Resolved Bug #5: Fixed list vs str parsing in ResonanceEvaluator
- Resolved Bug #6: Use 'should_like' key for vibe score
- Resolved Bug #7: Guard TelepathicEngine against 'Follow' nodes for post media
- Resolved Bug #8: Implemented failed_bounds exclusion loop breaker in PerfectSnapping
- Resolved Bug #10: Corrected available_actions string parsing
- Validated with E2E regression suite (100% green)
2026-04-29 18:26:29 +02:00
068a6a616a fix: purge 4 production bugs — resonance null-guard, POST_DETAIL misclassification, VLM JSON response handling
🔴 RED → 🟢 GREEN for 4 critical bugs found in production run 2026-04-29:

1. ResonanceEvaluator: Add null-guard for evaluate_post_vibe() return.
   When VLM returns truncated JSON, the function returns None. The caller
   now handles this gracefully instead of crashing with AttributeError.

2. ScreenIdentity POST_DETAIL: Replace broken 'and not selected_tab'
   condition with structural differentiator using main_feed_action_bar.
   Posts opened from feed retain feed_tab selected, which was causing
   misclassification as HOME_FEED → LLM fallback → OWN_PROFILE hallucination
   → permanent Qdrant cache poisoning.

3. ActionMemory VLM verification: When VLM returns JSON instead of YES/NO,
   treat as inconclusive (fall through to structural delta) rather than
   hard failure. Only return False when response explicitly contains 'no'.

4 new E2E regression tests, 75/75 pass, zero regressions.
2026-04-29 18:05:32 +02:00
effb1f5ae1 test(e2e): Fix navigation graph instantiation and mock UI sequence exhaustion 2026-04-29 17:44:06 +02:00
0e43996ccd feat(orchestrator): wire GoalDecomposer into bot_flow.py
Replace the old dual-path orchestrator (abstract goals vs legacy desires)
with unified GoalDecomposer-driven task routing:

1. GoalDecomposer reads mission.strategy + plugins config
2. Generates weighted Task objects (verb, target_screen, budget)
3. GrowthBrain.select_task() picks one probabilistically
4. Selected Task's target_screen routes through existing nav_graph
5. Feed loops + PluginRegistry handle the actual interactions

The abstract goals path (goal_executor.achieve('Nurture community'))
that caused infinite scrolling is now eliminated entirely.

Legacy desire fallback preserved for configs without plugins.

22/22 tests passing.
2026-04-29 17:20:04 +02:00
b6846ab0fe feat(brain): add GrowthBrain.select_task() + kill abstract goals config
- GrowthBrain.select_task() uses weighted random from concrete Task objects
- Removed self.goals from Config (no longer reads goals: from config.yml)
- Mission + plugins are now the SSOT for bot behavior

The bot no longer receives abstract strings like 'Nurture my community' that
the LLM Brain can't operationalize. Instead, the GoalDecomposer generates
Task(browse_feed, HomeFeed, budget=7) which routes to concrete feed loops.

18/18 TDD tests passing.
2026-04-29 17:17:39 +02:00
6db579f45b feat(goals): add GoalDecomposer — pure-logic task planner from mission+plugins
Introduces the GoalDecomposer class that bridges mission.strategy + plugin
capabilities into concrete, weighted Task objects. Each Task has a target
screen, budget, weight, and human-readable intent.

Key design decisions:
- Pure logic, zero LLM/device dependencies
- Strategy weights (aggressive_growth, community_builder, etc.) drive selection
- Plugins declare which screens they operate on (multi-screen map)
- Screens need BOTH an action route AND active plugin to be viable
- Frozen dataclass ensures Task immutability

12/12 TDD tests passing.
2026-04-29 17:15:17 +02:00
0ed12303ac Hardened E2E integrity, purged synthetic mocks, and implemented proactive device discovery. 2026-04-29 15:42:03 +02:00
6abb519e3b refactor(perception): Purge legacy coordinate hacks from feed and telepathic engines 2026-04-29 09:54:02 +02:00
4e91db01c9 test(e2e): Fix LLM prompt and intents for 100% deterministic VLM success without structural masks 2026-04-29 01:39:10 +02:00
e55abc5a8a fix(navigation): purge structural guards and enforce pure VLM discovery for bottom tabs
Removed the hardcoded structural fallback bypasses for bottom navigation tabs to ensure 100% autonomous visual inference. Expanded the VLM intent resolution prompt with explicit spatial heuristics for bottom navigation (e.g., 'profile tab is the avatar icon at the bottom right') to prevent LLaVA hallucinations without resorting to XML resource-id hacks. Added E2E visual test proof.
2026-04-29 01:23:20 +02:00
03105437b8 Revert "fix(navigation): eliminate VLM hallucination on bottom navigation tabs via structural guard"
This reverts commit b9c29a5a2d.
2026-04-29 01:19:18 +02:00
b9c29a5a2d fix(navigation): eliminate VLM hallucination on bottom navigation tabs via structural guard
Added a 'Structural Navigation Guard' in IntentResolver to map critical bottom navigation intents (e.g., 'tap profile tab') directly to their stable resource-ids. This bypasses the VLM entirely, guaranteeing 100% deterministic clicks and resolving the issue where the VLM failed to locate the profile tab, causing the edge to become masked and trapping the bot on the home feed.
Included TDD proof.
2026-04-29 01:16:06 +02:00
71310b8e84 fix(perception): resolve UNKNOWN screen classification on explore grid and fix LLM fallback API
1. Added a robust structural heuristic for EXPLORE_GRID that looks for 'action_bar_search_edit_text' alongside 'search_tab', eliminating the reliance on the flaky 'selected' attribute.
2. Fixed a critical bug in the LLM semantic fallback where it was incorrectly querying the '/api/chat' endpoint using an '/api/generate' payload format, causing silent 400 Bad Request failures.
3. Corrected the fallback model assignment to use 'ai_model' (e.g. qwen3.5) instead of 'ai_embedding_model' (which incorrectly attempted to use nomic-embed-text or llama3 for chat completion).
2026-04-29 01:08:29 +02:00
073a90c38c test(e2e): purge remaining lying asserts in home and reels tests
Replaced weak 'y_center < 2000' and 'not action_bar' assertions with hard structural and semantic validations for author username clicks.
We now explicitly verify that the VLM selected the correct resource-id or matching text/content-desc.
2026-04-29 01:00:57 +02:00
44fae37cc7 fix(perception): enforce strict candidate filtering for grid items
In addition to prompt tuning, we now apply a pre-flight structural guard for 'tap first post' / 'tap first grid item' intents.
If the intent targets a grid item, we pre-filter the candidates to only include those matching 'row X, column Y', 'photos by', or 'reel by'.
This drastically narrows the Set-of-Mark candidates down to ONLY valid grid items, making it literally impossible for the VLM to hallucinate and click navigation elements like 'Search' or 'Home' when asked to tap a post.

Also updated E2E test to enforce strict post-click assertion, preventing lying tests.
2026-04-29 00:55:59 +02:00
48071cc9b8 fix(perception): resolve grid hallucination by using 'tap first post' and prompt tuning
The bot previously hallucinated when given the intent 'tap first grid item' because the visual layout and description ('photos by...') didn't semantically map to the abstract 'grid item' concept in the VLM's eyes, causing it to click the 'Search' input instead.

Fixed by:
1. Updating  to generate 'tap first post' instead of 'tap first grid item', matching natural language expectations.
2. Hardening the Visual Discovery Set-of-Mark prompt in  to explicitly guide the VLM on how to visually identify posts/grid items (looking for 'photos by' or 'Reel by' instead of navigation elements).
2026-04-29 00:52:17 +02:00
10a85a91f1 feat(memory): enhance memory learning and application observability
- Added distinct, colorized INFO logging for Qdrant memory retrieval (EXACT and VECTOR matches).
- Upgraded logging for new memory storage and confidence adjustments (Positive/Negative Reinforcement) to be highly visible.
- Synchronized ActionMemory confirmation/penalty logs with Qdrant color formatting to ensure a unified observability trail for the learning engine.
2026-04-29 00:49:04 +02:00
5bf0053884 refactor(perception): remove all hardcoded structural fast paths
Per user directive, the TelepathicEngine must rely entirely on autonomous learning,
Visual Discovery (VLM), and the ActionMemory (Qdrant) to identify UI elements.
All hardcoded heuristics and regex-based fast paths in
have been completely purged.
2026-04-29 00:44:14 +02:00
a846462d02 fix(navigation): resolve VLM hallucination on EXPLORE_GRID and optimize GOAP logging
1. Fixed a bug where 'tap first grid item' was not matching the telepathic fast-path string
   ('first image in explore grid'). This caused the intent to fall through to the VLM
   for visual discovery. Since 'tap first grid item' is highly ambiguous for a VLM,
   it hallucinated and selected the search bar (Box 10), causing the keyboard to open
   and the bot to transition to an UNKNOWN state.
2. Optimized GOAP Step and Brain logging to always explicitly include the user's
   ultimate goal string, ensuring a transparent 'goal-oriented' debugging trail.
2026-04-29 00:38:58 +02:00
0dbafd0a82 feat(navigation): implement Anti-Loop Guard to prevent Grand Tour deception
Fixes an issue where E2E tests reported 100% success on isolated navigation
actions, but the bot would get stuck in deterministic loops (HOME -> EXPLORE -> PROFILE -> HOME)
during live autonomous execution.

1. Added `visited_screens` tracking to the primary GOAP step execution loop.
2. Updated GoalPlanner to preemptively strip available UI actions if the ScreenTopology
   dictates that taking the action would lead to a screen we have already visited in the
   current goal execution.
3. Explicitly permits 'press back' to preserve valid dead-end backtracking.
2026-04-29 00:31:40 +02:00
83e5b94ddf test(unit): fix stochastic flake in autonomous goal weighting
The assertion choices["goal_A"] > choices["goal_C"] fails sporadically because goal_A has a very low weight (2 vs 100) and can easily be chosen 0 times just like goal_C (0 vs 100). Changed to >= to handle valid 0 == 0 scenarios.

Also fixes "Failed to forget path" warning where _get_id was used instead of generate_uuid.
2026-04-29 00:26:50 +02:00
dd8285e1ce test(benchmarks): rewrite benchmark runner and add brain scenarios
Fixes:
1. Rewrote run_competitive_benchmark.py to test BOTH capabilities:
   - Telepathic (JSON element extraction)
   - Brain (Free-text action extraction with format_json=False)
2. Normalizes scores by averaging per-scenario (fixes score inflation
   where models with more scenarios tested scored higher but were marked unsuitable).
3. Added 4 new brain_action scenarios to ensure the 'think=false' code path
   is actively benchmarked going forward.
4. Added test_benchmark_integrity.py to lock in scenario format rules.
5. Cleared stale llm_benchmarks.json data to force clean re-evaluations.
2026-04-29 00:14:29 +02:00
ac5d5351a6 fix: eliminate thinking-block poisoning + no-op navigation trap
ROOT CAUSE: qwen3.5 (reasoning model) returns response='' with thinking
block containing all reasoning. llm_provider.py line 352 silently
substituted the thinking block as the response via:
  content = raw_response or raw_thinking or ''
The Brain then extracted random actions from the reasoning text.

FIXES:
1. llm_provider.py: Conditional thinking isolation
   - format_json=True (SAE/perception): thinking fallback preserved
   - format_json=False (Brain): thinking NEVER substituted
   - Added think=false for Ollama free-text calls to force direct response

2. planner.py: No-Op Guard strips tab actions that navigate to
   the current screen (e.g. 'tap profile tab' on OWN_PROFILE)

3. test_brain_live.py: Stochastic testing (5 runs, 60% min valid)
   to handle non-deterministic LLM behavior reliably

4. tests/integration/test_llm_provider_pipeline.py: NEW test layer
   mocking at HTTP level (requests.post) to exercise the FULL
   llm_provider → Brain pipeline. This would have caught the
   thinking substitution bug from day one.

Suite: 168 passed, 0 failed
2026-04-29 00:06:23 +02:00
ad012b4cd4 feat: structural test integrity enforcement — mock ban, brain contract tests, UI change noise threshold
- Add permanent mock ban guard in root conftest.py that fails any test
  importing unittest.mock at COLLECTION TIME (before execution)
- Add 8 brain output contract tests reproducing the exact production bug:
  LLM thinks 'press back' but parser extracts 'tap messages tab' from
  the <think> block
- Add UI change noise threshold (MIN_UI_CHANGE_BYTES=50) to prevent
  false-positive 'ui_changed' from 1-byte XML diffs (timestamps/whitespace)
- Verify planner correctly strips masked actions from Brain prompt
2026-04-28 23:45:22 +02:00
5fcf1f180b fix: smart extraction of action from verbose LLM thinking output 2026-04-28 23:35:51 +02:00
9a74d89477 test: harmonize intent strings in verify_success for reels and explore grid 2026-04-28 23:29:17 +02:00
dc4b576bc1 test(e2e): decompose monolithic test suite and fortify semantic guards 2026-04-28 23:09:15 +02:00
e94dfe8c5c test(e2e): purge deceptive pytest.skip masks hiding VLM failures 2026-04-28 21:49:31 +02:00
7aa6bfccf6 feat: add E2E coverage for GoalExecutor.achieve() — close structural gap #1
The central autonomous brain (GoalExecutor.achieve()) had ZERO E2E coverage.
The deleted lying test_e2e_autonomous_session.py never called it at all,
allowing the AttributeError and dead code bugs to survive undetected.

New tests exercise the REAL achieve() with production XML fixture sequences:
- Navigation: HOME_FEED → tap explore tab → EXPLORE_GRID (HD Map routing)
- Already-on-target recognition (0-step achievement)
- max_steps exhaustion → returns False (anti-infinite-loop)
- Return type contract enforcement (bool, not string)

All 4 tests use make_real_device_with_xml with real fixture sequences.
No mocks. No patches. No lies.

E2E: 60 passed, 5 skipped, 0 failures.
2026-04-28 21:36:16 +02:00
5fef014cb4 fix: purge 5 remaining E2E lies — dead code, theater tests, ghost skips
CRITICAL LIES FIXED:
- bot_flow.py:474 compared achieve() (returns bool) to 'GOAL_ACHIEVED'
  (string). Success path was dead code — True never == string.
- TestBotFlowDMGating built its own local target_map dict and asserted
  against it. bot_flow.py no longer has target_map (uses GoalExecutor).
  Tests verified their own imagination, not production code.
- test_perception_mock_theater_purged was a skip+pass ghost creating
  false 'skipped' coverage in reports.
- test_perceive_notification_shade silently passed on FileNotFoundError
  instead of reporting the missing fixture.
- test_resolve_uses_visual_discovery_when_device_available only checked
  hasattr — verifying method existence, not behavior.

PRODUCTION BUGS FIXED:
- GoalExecutor constructor called with wrong args (memory, telepathic,
  config, session_state) — it only accepts (device, bot_username).
- achieve() result comparison was dead code: always hit warning branch.

E2E: 57 passed, 4 skipped (live_llm waivers), 0 failures.
2026-04-28 21:28:42 +02:00
0bdfd999d2 feat(navigation): complete autonomous integration tests and goal weighting 2026-04-28 19:06:16 +02:00
4ad559e107 feat(autonomy): refactor navigation engine to autonomous goals with TDD
- Added strict TDD coverage for all autonomous changes.
- Implemented GrowthBrain.get_current_goal to select high-level objectives.
- Replaced procedural orchestrator with GoalExecutor in bot_flow.
- Purged hardcoded resource-ids in dm_engine in favor of ScreenIdentity.
- Removed regex parsing in unfollow_engine in favor of telepathic semantic extraction.
2026-04-28 18:27:45 +02:00
f220e09193 🧪 PURGE: All residual mocks and spies from E2E suite. 100% production-parity enforcement. 2026-04-28 17:53:47 +02:00
de2a1c104f fix(navigation): enforce HD Map pre-checks and resolve test inconsistencies 2026-04-28 13:47:10 +02:00
52c553827f fix(core): add structural sanity guards to prevent post-related VLM hallucinations on search and profile screens 2026-04-28 10:34:44 +02:00
cd64794f55 test(core): enforce 100% TDD parity, eliminate mocks, and harden VLM hallucination guards 2026-04-28 10:26:11 +02:00
bd9148e6e9 fix(tests): purge theater/broken tests, fix Config argparse pollution, fix is_ad() false positive
PHASE 1 — STOP THE BLEEDING:
- Delete 6 theater/dead test files (empty stubs, skipped placeholders)
- Create root conftest.py to isolate Config/argparse from pytest sys.argv
- Rewrite test_feed_loop_continuation.py: replace inspect.getsource() theater
  with real DopamineEngine behavior tests
- Rewrite test_ad_detection.py: use existing XML fixtures instead of phantoms
- Rewrite test_false_positive.py: use verified fixtures, caught REAL bug

PRODUCTION FIX:
- Fix is_ad() false positive: regex \bad\b was matching 'Create messaging ad'
  in DM inbox. Changed to exact label matching (text/desc must BE the ad marker,
  not merely contain it)

Result: 34 FAILED + 4 ERRORS -> 0 FAILED, 178 PASSED, 3 SKIPPED
2026-04-28 09:36:22 +02:00