From a560225dc9d6e784d3077c464ab2c751c1887493 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 29 Apr 2026 21:20:09 +0200 Subject: [PATCH] feat(perception): integrate VLM visual ad detection into resonance vibe check to block obfuscated ads --- GramAddict/core/behaviors/resonance_evaluator.py | 6 ++++++ GramAddict/core/perception/semantic_evaluator.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/GramAddict/core/behaviors/resonance_evaluator.py b/GramAddict/core/behaviors/resonance_evaluator.py index 9cd32f8..3890d23 100644 --- a/GramAddict/core/behaviors/resonance_evaluator.py +++ b/GramAddict/core/behaviors/resonance_evaluator.py @@ -66,6 +66,12 @@ class ResonanceEvaluatorPlugin(BehaviorPlugin): "✨ [Resonance] VLM vibe check returned None (truncated JSON?). Keeping neutral score." ) else: + if vibe.get("is_ad"): + logger.info("🛡️ [Resonance Oracle] Visually identified post as an Ad! Skipping...") + from GramAddict.core.utils import humanized_scroll + humanized_scroll(ctx.device) + return BehaviorResult(executed=True, should_skip=True) + # BUG 6 Fix: VLM returns {"should_like": true/false}, not "quality_score" should_like = vibe.get("should_like", False) vibe_score = 1.0 if should_like else 0.2 diff --git a/GramAddict/core/perception/semantic_evaluator.py b/GramAddict/core/perception/semantic_evaluator.py index e502e24..aaa1762 100644 --- a/GramAddict/core/perception/semantic_evaluator.py +++ b/GramAddict/core/perception/semantic_evaluator.py @@ -117,11 +117,13 @@ class SemanticEvaluator: You are a user with the following interests: {', '.join(persona_interests)}. You are looking at an Instagram post. Evaluate if this post is highly relevant to your interests and if you should like/comment on it. + CRITICAL: Check if this post is an advertisement or sponsored content (look for "Sponsored", "Ad", or promotional product placement). Reply ONLY in valid JSON format: {{ "should_like": true/false, "should_comment": true/false, + "is_ad": true/false, "reasoning": "brief explanation" }} """