test: add hallucination benchmark and enforce strict guard for structural targets

This commit is contained in:
2026-04-27 22:13:52 +02:00
parent e37d92cdfd
commit 93175b7caf
2 changed files with 55 additions and 0 deletions

View File

@@ -72,6 +72,16 @@ class IntentResolver:
if intent_lower in abstract_goals:
return None
# --- Strict VLM Hallucination Guard ---
# For known structural targets that the VLM frequently hallucinates when they are missing,
# we enforce a strict failure if they weren't caught by the structural fast paths.
if "following list" in intent_lower or "followers list" in intent_lower or "tap message button" in intent_lower:
logger.warning(
f"🛡️ [Hallucination Guard] Intent '{intent_description}' is a strict structural target. "
"Since it wasn't resolved by fast-paths, it is missing. Rejecting VLM fallback."
)
return None
# ── PRIMARY PATH: Visual Discovery ──
# If we have a device, the VLM SEES the screen and decides.
if device: