fix(memory): rejeter coords (0,0) et hors [0,1] dans memory_record_success
Bug observé sur replay_sess_63a1313b 2026-05-24 18:31-18:32 : _capture_human_correction() côté Léa retourne des human_actions sans clic humain réel (cause racine côté agent à investiguer = P0.6). En cascade, memory_record_success était appelé avec coords (0.0, 0.0) et stockait des entrées poison dans target_memory.db. Le sanity check existant rejetait < 0 ou > 1 mais laissait passer (0,0) qui est mathématiquement valide. Au prochain replay, memory_lookup trouvait l'entrée poison et faisait cliquer Léa au coin haut-gauche. Patch : rejet explicite de (0,0) + warning au lieu de debug pour les coords hors [0,1] (besoin de tracabilité runtime). Filet en aval — la vraie cause côté Léa reste à corriger (P0.6). Tag rollback : rollback/pre-P0.7-2026-05-24_1850
This commit is contained in:
@@ -332,9 +332,21 @@ def memory_record_success(
|
||||
logger.debug("memory_record_success: coords non numériques, skip")
|
||||
return False
|
||||
if not (0.0 <= x_pct <= 1.0 and 0.0 <= y_pct <= 1.0):
|
||||
logger.debug(
|
||||
"memory_record_success: coords hors [0,1] (%.3f, %.3f), skip",
|
||||
logger.warning(
|
||||
"memory_record_success: coords hors [0,1] (%.3f, %.3f), skip — "
|
||||
"probable input parasite (target='%s' method=%s)",
|
||||
x_pct, y_pct,
|
||||
(target_spec.get("by_text") or "")[:60], method,
|
||||
)
|
||||
return False
|
||||
# Rejeter (0.0, 0.0) exact : coin haut-gauche = signature de bruit
|
||||
# (curseur NoMachine, événement OS parasite, listener pynput sans clic
|
||||
# humain réel). Cf. bug observé replay_sess_63a1313b 2026-05-24 18:31-18:32.
|
||||
if x_pct == 0.0 and y_pct == 0.0:
|
||||
logger.warning(
|
||||
"memory_record_success: coords (0.0, 0.0) rejetées — "
|
||||
"signature de bruit (target='%s' method=%s)",
|
||||
(target_spec.get("by_text") or "")[:60], method,
|
||||
)
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user