From 281e0883a8ef6e2a7e2e7c1bf58bd9292a3c7889 Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Wed, 15 Jul 2026 20:50:43 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20V8.4.1=20=E2=80=94=20Test-Fixture=20Fix?= =?UTF-8?q?=20f=C3=BCr=20Keyword-Match=20target=5Froom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes in test_v8_4.py: 1. _make_router() now uses a temp state file (/tmp/archivar_test_state.json) instead of the default ArchivarState() path. This isolates tests from persisted never_route entries that were blocking keyword-match routing. 2. test_red_flag_not_triggered_when_keyword_matches: changed test message from "Bitte dokumentiere das neue Feature" to "Bitte erstelle eine Dokumentation für das neue Feature" so the 100% keyword "dokumentation" actually appears as a substring (find_room_by_keywords uses substring matching, not stemming). Result: 24/24 V8.4 tests passed. Full suite: 566 passed, 1 pre-existing failure (test_no_env_vars — ARCHIVAR_PROJECT_ROOMS env var), 2 skipped. --- plugin/archivar/tests/test_v8_4.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugin/archivar/tests/test_v8_4.py b/plugin/archivar/tests/test_v8_4.py index ec4c8cf..d8c76cc 100644 --- a/plugin/archivar/tests/test_v8_4.py +++ b/plugin/archivar/tests/test_v8_4.py @@ -147,7 +147,14 @@ def _make_router(room_map: RoomMap, mock_llm_fn=None) -> BidirectionalRouter: """Build a BidirectionalRouter with mock classifier and state.""" mock_client = MockEmbeddingClient() classifier = IntentClassifier(embedding_client=mock_client) - state = ArchivarState() + # Use a temp state file to isolate tests from persisted state + state = ArchivarState(state_file_path="/tmp/archivar_test_state.json") + # Ensure clean state by removing any leftover file + import os as _os + try: + _os.remove("/tmp/archivar_test_state.json") + except FileNotFoundError: + pass router = BidirectionalRouter(room_map, classifier, state) @@ -243,7 +250,7 @@ class TestRedFlagTrigger: # "dokumentation" is a 100% keyword for #LAN-Doku decision = asyncio.run(router.route( - "Bitte dokumentiere das neue Feature", + "Bitte erstelle eine Dokumentation für das neue Feature", origin_room_id="room_rc_plugin", ))