From 6cd0b2742aafa2c89c699236316d0364f6e1b51b Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Sat, 3 Oct 2026 15:38:20 +0800 Subject: [PATCH] Stop battle macros on map headers with unreadable floor digits --- docs/feedback/2026-10-03/jev-runtime.md | 5 +++++ scripts/lc_scene_aliases.py | 4 ++++ tests/test_lc_scene_aliases.py | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/docs/feedback/2026-10-03/jev-runtime.md b/docs/feedback/2026-10-03/jev-runtime.md index 37aa62b..7bf99ae 100644 --- a/docs/feedback/2026-10-03/jev-runtime.md +++ b/docs/feedback/2026-10-03/jev-runtime.md @@ -49,6 +49,11 @@ The timer includes English UI compatibility work and all interruptions. as its mouse fallback. The original fallback list omitted judgement. 11. A changing event video clock reset repeat detection. Ignore both colon and decimal clock formats when detecting unsuccessful confirmations. +12. After combat, OCR read the map heading as `Exploring Floor` or + `Exploring FloorT` without a valid digit. The old normalizer failed to mark + this as a map, so P/Enter batches continued on the map for several minutes. + Recognize the map heading independently of its floor number and retain + the previously known floor. Added a regression against continuing battle. ## Progress verified so far diff --git a/scripts/lc_scene_aliases.py b/scripts/lc_scene_aliases.py index 5fe930a..bdc276e 100644 --- a/scripts/lc_scene_aliases.py +++ b/scripts/lc_scene_aliases.py @@ -52,6 +52,10 @@ def normalize(state): text = '选择遭遇战奖励卡' elif re.search(r'exploring(?:floor)?\d+', compact): text = '正在探索第%s层' % re.search(r'\d+', compact)[0] + elif compact.startswith('exploringfloor'): + # A missing/misread floor number still identifies the map. + # Leave the stored floor unchanged rather than invent a digit. + text = '正在探索 ' + raw elif compact.startswith('select') and re.search(r'\d+/\d+', compact): text = '选择' + re.search(r'\d+/\d+', compact)[0] elif compact.startswith('refresh'): diff --git a/tests/test_lc_scene_aliases.py b/tests/test_lc_scene_aliases.py index 7e6b17d..c416974 100644 --- a/tests/test_lc_scene_aliases.py +++ b/tests/test_lc_scene_aliases.py @@ -10,6 +10,15 @@ from decision_router import DecisionRouter class EnglishMirrorBoundaryTest(unittest.TestCase): + def test_map_header_without_recognized_floor_number_stops_battle(self): + for label in ('Exploring Floor', 'Exploring FloorT'): + with self.subTest(label=label): + state = normalize({'items': [{'text': label, 'x': 60, 'y': 131, + 'w': 302, 'h': 51, 'score': .975}]}) + self.assertTrue(agent.battle_is_terminal(state)) + with mock.patch.object(agent, 'map_candidates', return_value={}): + self.assertNotIn('battle', agent.candidates(state, previous_battle=True)) + def test_enabled_commence_precedes_reselecting_sinners(self): options = {'button_20': {'description': '当前可见且非灰色按钮:进行判定', 'action': {'tool': 'keypress', 'args': {'key': 'enter'}}},