feat(grounding): vérification titre OCR post-action (non-bloquante)
TitleVerifier (core/grounding/title_verifier.py) : - Crop 45px barre de titre → OCR → compare avant/après (~280ms) - Titres < 3 chars ignorés (bruit OCR sur VM) - Non-bloquant : échec = warning, pas stop Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1313,6 +1313,26 @@ Règles:
|
||||
# Stocker le pHash post-action pour le réflexe check du step suivant
|
||||
self._last_post_phash = post.phash
|
||||
|
||||
# --- 4b. Vérification titre OCR (non-bloquante, ~120ms) ---
|
||||
_action_type = step.get('action_type', '')
|
||||
if _action_type in ('double_click_anchor', 'click_anchor') and pre.screenshot and post.screenshot:
|
||||
try:
|
||||
from core.grounding.title_verifier import TitleVerifier
|
||||
_tv = TitleVerifier()
|
||||
_tv_result = _tv.verify_action(pre.screenshot, post.screenshot, _action_type)
|
||||
if not _tv_result['success']:
|
||||
print(f"⚠️ [ORA/titre] {_tv_result['reason']} → retry")
|
||||
# Retry : recliquer
|
||||
time.sleep(0.5)
|
||||
self.act(decision, step)
|
||||
time.sleep(0.3)
|
||||
post = self.observe()
|
||||
self._last_post_phash = post.phash
|
||||
elif _tv_result['changed']:
|
||||
print(f"✅ [ORA/titre] '{_tv_result['title_after'][:40]}'")
|
||||
except Exception as _tv_err:
|
||||
print(f"⚠️ [ORA/titre] Erreur: {_tv_err}")
|
||||
|
||||
# --- 5. Vérifier ---
|
||||
verification = self.verify(pre, post, decision)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user