From 5ed1810ef3c05ccbb09961bc030b8837d12510a8 Mon Sep 17 00:00:00 2001 From: Dom Date: Sun, 24 May 2026 19:01:18 +0200 Subject: [PATCH] fix(memory): rejeter coords (0,0) et hors [0,1] dans memory_record_success MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- agent_v0/server_v1/replay_memory.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/agent_v0/server_v1/replay_memory.py b/agent_v0/server_v1/replay_memory.py index 62f709a47..65df58e54 100644 --- a/agent_v0/server_v1/replay_memory.py +++ b/agent_v0/server_v1/replay_memory.py @@ -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