fix: V8.4.6 — FAISS schließt Ursprungsraum aus + Kontext-Keyword bei Catch-Butler (P0-Bundle)

Problem 1 (P0): Kontext-Keywords bei Catch-All-Räumen
- 'dji' ist ein Kontext-Keyword für DM (catch_all=True), aber Catch-All-Räume
  wurden von der Keyword-Match-Logik komplett ausgeschlossen.
- Fix: room_map.py find_room_by_keywords() erlaubt Catch-All-Räume in Stufe 2+3
  (Kontext-Keywords) als Butler-Ziele. Stufe 1 (100%-Keywords) schließt
  Catch-All weiterhin aus — 100%-Match auf Catch-All ist für Auto-Route,
  nicht für Keyword-Match.
- min_score von 2 auf 1 gesenkt: ein einzelnes Kontext-Keyword reicht für
  einen Butler-Vorschlag.

Problem 2 (P0): FAISS schließt Ursprungsraum nicht aus
- FAISS fand den Ursprungsraum als ähnlichsten Raum (score=0.62,
  target=#RC-Plugin, origin=#RC-Plugin). Sinnlos — Butler kann keinen
  Wechsel von #RC-Plugin → #RC-Plugin vorschlagen.
- Fix: router.py filtert origin_room_id aus FAISS-Ergebnissen heraus.
  Wenn alle Treffer der Ursprungsraum waren → fall-through zu LLM.
  Wenn top-1 excluded wird → top-2 wird verwendet.

Tests: 14 neue Tests in test_v8_4_6.py
- test_faiss_excludes_origin (2 Tests)
- test_faiss_butler_self_match (2 Tests)
- test_context_keyword_min_score_1 (3 Tests)
- test_context_keyword_catch_all (3 Tests)
- Regression (4 Tests)

Aktualisierte Tests:
- test_room_map.py: test_context_keywords_min_score → min_score=1
- test_v8_4_5.py: test_sony_context_keyword_triggers_butler → erwartet Butler

Full suite: 626 passed, 2 skipped, 0 failures
This commit is contained in:
Bernd (Hermes)
2026-07-16 10:37:42 +02:00
parent da5586e776
commit 463e29d594
5 changed files with 592 additions and 110 deletions
+7 -4
View File
@@ -222,12 +222,15 @@ class TestTwoStageKeywordEvidence:
assert result.name == "#Plugin"
def test_context_keywords_min_score(self, room_map_v2):
"""Context keywords should require min_score=2."""
# Only one context keyword match should not be enough
"""Context keywords should require min_score=1 (V8.4.6)."""
# A single context keyword match should be enough (min_score=1)
result = room_map_v2.find_room_by_keywords("plugin")
assert result is None
assert result is not None, (
"V8.4.6: min_score=1 — single context keyword should match"
)
assert result.name == "#Plugin"
# Two context keyword matches should be enough
# Two context keyword matches should also be enough
result = room_map_v2.find_room_by_keywords("plugin gateway")
assert result is not None
assert result.name == "#Plugin"