3 Commits

Author SHA1 Message Date
Bernd (Hermes) f382c8c674 fix(archivar): keywords_100 match_keyword → match_keyword_exact in room_map.py (P-108b) 2026-08-26 05:00:02 +02:00
Bernd (Hermes) 463e29d594 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
2026-07-16 10:37:42 +02:00
Bernd (Hermes) da5586e776 fix: V8.4.5 — room-map.json Router-Instanz + Telemetrie-Logging + Kontext-Keyword Butler
Root Cause Analysis:
- BEFUND 1: room-map.json was missing from disk (deleted after M13 GC).
  Restored from version 2 backup with all 5 rooms, updated to version 5.
  Added 'sony' to DM keywords_context for Kontext-Keyword matching.
- BEFUND 2: routing_telemetry.py logger had no StreamHandler and relied
  on root logger propagation. Root logger at WARNING (gateway default)
  filtered all logger.info() calls. Fixed by adding StreamHandler at
  DEBUG level with propagate=False (same pattern as adapter.py and
  adapter_integration.py).

Changes:
- routing_telemetry.py: Add StreamHandler + setLevel(INFO) + propagate=False
- test_v8_4_5.py: 13 new tests (RoomMap loading, telemetry logging,
  Kontext-Keyword Butler, regression)
- test_v8_3_3.py: Fix 4 existing telemetry tests to temporarily enable
  propagation for caplog capture
- test_room_map.py: Fix test_no_env_vars to clear ARCHIVAR_* env vars
  before assertion

Verification:
- 612 passed, 2 skipped, 0 failures
- python3 -m py_compile: all files OK
2026-07-16 09:10:30 +02:00