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) 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
Bernd (Hermes) 641b066db0 feat: V8.3.3 — Routing-Telemetrie (Konfidenz-Logging) + Echte Integration-Tests
FEATURE 1: Routing-Telemetrie (Konfidenz-Logging)
- Neue Datei: archivar/routing_telemetry.py — RoutingTelemetry Klasse
- Feature-Flag: ARCHIVAR_ROUTING_TELEMETRY env var (Default true)
- Pro Routing-Entscheidung: stage, score, decision, target, origin, duration_ms
- Format: [TELEMETRY] stage=keyword_100 score=1.00 decision=route ...
- NIEMALS Nachrichteninhalte im Log (Datenschutz)
- Telemetrie-Punkte in router.py an allen 5 Stufen:
  keyword_100, context_keyword, faiss, llm, default
- Flush in adapter.py nach classify_and_route()

FEATURE 2: Echte Integration-Tests
- Neue Datei: archivar/tests/test_v8_3_3.py (18 Tests)
- Echte RoutingDecision-Objekte statt Dict-Simulationen
- 7 Integration-Test-Klassen:
  1. 100%-Keyword im falschen Raum → route
  2. 100%-Keyword im richtigen Raum → stay (self-match)
  3. Kontext-Keyword → butler
  4. FAISS hohe Ähnlichkeit → route
  5. FAISS mittlere Ähnlichkeit → butler
  6. LLM → STAY
  7. LLM → ROUTE
- Telemetrie-Tests: Logging, Datenschutz, Feature-Flag
- Erweiterte conftest.py: multi_room_map, Mock-LLM Fixtures

Verifikation: 527 passed, 1 pre-existing fail, 2 skipped (FAISS)
2026-07-15 17:35:28 +02:00