From 5ebe26e5d5afbd20b8dd6a565ea0a24281c89022 Mon Sep 17 00:00:00 2001 From: Marius Mutu Date: Tue, 21 Apr 2026 22:35:22 +0300 Subject: [PATCH] test(calibration): 8 labels + 3 scenarii noi (inclusiv regresie 2026-04-21) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit calibration_labels.json: 16 → 24 entry-uri. Toate cele 8 frame-uri dumpate automat de live loop azi (gray×5, dark_green×1, yellow×1, dark_red×1) trec prin validate-calibration cu detector-ul curent (24/24 PASS). scenarios.json: 8 → 11 scenarii: 1. buy_catchup_opposite_rearm_to_sell — REGRESSION pentru bug-ul de azi. Trace real din log: 17:00 catchup dark_green → PRIMED_BUY (synth arm+prime), apoi 17:45 yellow → ARMED_SELL via opposite_rearm. Verifică că dispatch-ul nou emite kind=opposite_rearm și că scheduler-ul se oprește. 2. buy_armed_gray_persist — gray între arm și prime ține ARMED_BUY (reason=persist). Acoperă o ramură FSM neacoperită. 3. buy_primed_gray_cooldown — gray după prime ucide ciclul (reason=cooled, IDLE, scheduler stop). Confirmă semantica M2D că chart-ul tăcut post-prime înseamnă setup expirat. Total: 11/11 scenarii PASS, 238/238 teste (235 + 3 noi scenarii regresie). Co-Authored-By: Claude Opus 4.7 (1M context) --- calibration/calibration_labels.json | 40 +++++++++++++ calibration/scenarios.json | 90 +++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) diff --git a/calibration/calibration_labels.json b/calibration/calibration_labels.json index e95250b..f3f83a7 100644 --- a/calibration/calibration_labels.json +++ b/calibration/calibration_labels.json @@ -78,5 +78,45 @@ "path": "calibration/frames/20260420_185702_gray.png", "expected": "gray", "note": "idle gray dot in poll; rgb=(128,128,128)" + }, + { + "path": "calibration/frames/20260421_164210_gray.png", + "expected": "gray", + "note": "2026-04-21 16:42 poll — gray între sesiuni; rgb=(128,128,128)" + }, + { + "path": "calibration/frames/20260421_164452_gray.png", + "expected": "gray", + "note": "2026-04-21 16:44 poll — gray idle; rgb=(128,128,128)" + }, + { + "path": "calibration/frames/20260421_165209_gray.png", + "expected": "gray", + "note": "2026-04-21 16:52 poll — gray idle; rgb=(128,128,128)" + }, + { + "path": "calibration/frames/20260421_170045_dark_green.png", + "expected": "dark_green", + "note": "2026-04-21 17:00 BUY prime catchup (synth arm+prime); rgb=(0,128,0)" + }, + { + "path": "calibration/frames/20260421_174502_yellow.png", + "expected": "yellow", + "note": "2026-04-21 17:45 opposite_rearm PRIMED_BUY→ARMED_SELL — frame bug regresiv; rgb=(253,253,0)" + }, + { + "path": "calibration/frames/20260421_174804_gray.png", + "expected": "gray", + "note": "2026-04-21 17:48 gray persist în ARMED_SELL; rgb=(128,128,128)" + }, + { + "path": "calibration/frames/20260421_220346_dark_red.png", + "expected": "dark_red", + "note": "2026-04-21 22:03 SELL prime seara; rgb=(128,0,0)" + }, + { + "path": "calibration/frames/20260421_222108_gray.png", + "expected": "gray", + "note": "2026-04-21 22:21 gray idle; rgb=(128,128,128)" } ] diff --git a/calibration/scenarios.json b/calibration/scenarios.json index 5882d96..6970304 100644 --- a/calibration/scenarios.json +++ b/calibration/scenarios.json @@ -244,5 +244,95 @@ "expected_scheduler_running": false } ] + }, + { + "id": "buy_catchup_opposite_rearm_to_sell", + "description": "REGRESSION 2026-04-21: real trace — catchup pe dark_green la 17:00 → PRIMED_BUY (synth arm+prime), apoi yellow la 17:45 → ARMED_SELL via opposite_rearm. Înainte de fix, bug-ul era dispatch-ul tăcut pentru opposite_rearm (zero alert). Acum trebuie să emită kind=opposite_rearm și să oprească scheduler-ul.", + "steps": [ + { + "frame": "calibration/frames/20260421_170045_dark_green.png", + "expected_color": "dark_green", + "expected_reason": "prime", + "expected_state": "PRIMED_BUY", + "expected_trigger": null, + "expected_new_alerts": ["arm", "prime"], + "expected_scheduler_running": true + }, + { + "frame": "calibration/frames/20260421_174502_yellow.png", + "expected_color": "yellow", + "expected_reason": "opposite_rearm", + "expected_state": "ARMED_SELL", + "expected_trigger": null, + "expected_new_alerts": ["opposite_rearm"], + "expected_scheduler_running": false + } + ] + }, + { + "id": "buy_armed_gray_persist", + "description": "Gray între arm și prime nu pierde ARMED_BUY (reason=persist, scheduler inactiv).", + "steps": [ + { + "frame": "calibration/frames/20260420_200002_turquoise.png", + "expected_color": "turquoise", + "expected_reason": "arm", + "expected_state": "ARMED_BUY", + "expected_trigger": null, + "expected_new_alerts": ["arm"], + "expected_scheduler_running": false + }, + { + "frame": "calibration/frames/20260421_164210_gray.png", + "expected_color": "gray", + "expected_reason": "persist", + "expected_state": "ARMED_BUY", + "expected_trigger": null, + "expected_new_alerts": [], + "expected_scheduler_running": false + }, + { + "frame": "calibration/frames/20260420_185102_dark_green.png", + "expected_color": "dark_green", + "expected_reason": "prime", + "expected_state": "PRIMED_BUY", + "expected_trigger": null, + "expected_new_alerts": ["prime"], + "expected_scheduler_running": true + } + ] + }, + { + "id": "buy_primed_gray_cooldown", + "description": "Gray după prime ucide ciclul (reason=cooled, IDLE, scheduler oprit). Design M2D: setup expiră dacă chart-ul tace după priming.", + "steps": [ + { + "frame": "calibration/frames/20260420_200002_turquoise.png", + "expected_color": "turquoise", + "expected_reason": "arm", + "expected_state": "ARMED_BUY", + "expected_trigger": null, + "expected_new_alerts": ["arm"], + "expected_scheduler_running": false + }, + { + "frame": "calibration/frames/20260420_185102_dark_green.png", + "expected_color": "dark_green", + "expected_reason": "prime", + "expected_state": "PRIMED_BUY", + "expected_trigger": null, + "expected_new_alerts": ["prime"], + "expected_scheduler_running": true + }, + { + "frame": "calibration/frames/20260421_174804_gray.png", + "expected_color": "gray", + "expected_reason": "cooled", + "expected_state": "IDLE", + "expected_trigger": null, + "expected_new_alerts": [], + "expected_scheduler_running": false + } + ] } ]