Bug 1: _META_PATTERNS Pattern 3 matchte JEDES Vorkommen von 'Archivar',
auch in Sachfragen wie 'Was hat der Archivar empfohlen?' → is_meta=True
→ 100%-Keyword-Match wurde nie geprüft.
Fix: Pattern 3 aufgeteilt in zwei bidirektionale Patterns:
- 'archivar' + System-Operationsverb (klassifiziert, routet, leitet weiter,
arbeitet, funktioniert, macht) — in beiden Richtungen
- System-Begriffe ohne 'archivar' (klassifikation, routing, weiterleitung)
bleiben eigenständige Meta-Signale
Bug 2: Bei stay_in_room=True wurde target_room=catch_all_id (DM) gesetzt
statt target_room=origin_room_id. Das leakt in _THEMATIC_TARGET_ROOM →
Agent-Prompt bekommt falschen Raum → Agent denkt er sei im DM.
Fix:
- router.py: Meta-Frage target_room=origin_room_id statt catch_all_id
- adapter.py: _THEMATIC_TARGET_ROOM nur setzen wenn NICHT stay_in_room
Tests: 16 neue Tests (TestMetaPatternsP0 + TestTargetRoomStayInRoomP0)
- 26/26 test_router.py PASS
- 32/32 test_v7_4_recursive.py PASS
- 192/193 full suite PASS (1 pre-existing env-var failure)
RC-1: archivar_state.py:264-287 + router.py:307-323
should_stay_in_room() gab 'origin_first'/'sticky' zurück, aber beide
wurden identisch behandelt (stay_in_room=True). never_route sollte
bedeuten: NIE wieder routen, KEIN Move-Request. always: immer hier
bleiben. Jetzt klare Unterscheidung: 'always' vs 'never_route'.
RC-2: room_map.py:356-393
add_or_update_room() erhöhte self._version NICHT nach Änderungen.
is_stale() im FAISS-Index vergleicht Versionen → dachte Index aktuell
→ lud veralteten Index von Disk. Fix: self._version += 1 nach jeder
Änderung.
RC-3: adapter.py:1241
stay_here Action-Token aus MOVE_REQUEST_TEMPLATE (v4 Button 'Hier')
war nicht im Handler-Mapping. Fiel in else-Zweig (one-time stay)
statt never_route (permanent). Fix: 'stay_here' zu Option-2-Mapping
hinzugefügt.
P0-1: install.sh schreibt ARCHIVAR_ENABLE_LLM=true in rocketchat.env bei MULTIROOM=true
P0-2: Dead-Code adapter.py:1359-1435 entfernt (Silent-Copy-Pfad im v6-Flow unerreichbar)
P0-3: should_stay_in_room() gibt jetzt 'origin_first'/'sticky'/None statt True/False/None
P1-1: Reconnect-Onboarding prüft jetzt auf neue Räume statt immer zu skippen
P1-2: _set_catch_all() baut FAISS-Index nach Catch-All-Wechsel neu
P1-3: stay_tracker in ArchivarState persistiert (archivar_state.json)
P1-4: onboarding_state in ArchivarState persistiert (archivar_state.json)
D1 (RELEASE-BLOCKIEREND): Guard 2.5 — LLM schlägt excluded room vor
router.py: Nach Guard 2 (Catch-All) prüft Guard 2.5 ob LLM-Raum
excluded ist → stay_in_room. Verhindert Move-Request in excluded room.
D2 (RELEASE-BLOCKIEREND): DMs können in Projekträume geroutet werden
router.py: Schritt 0 DM-Guard VOR allem anderen. origin_room_id leer
(DM) → sofort stay_in_room. DMs nie vom Routing betroffen.
D3 (DRINGEND): Self-Match-Schutz in Schritt 3, 3.5, 4.5
router.py: Keyword-Match (Schritt 3), FAISS auto-route (Schritt 3.5),
Keyword-Match vor LLM (Schritt 4.5) prüfen alle auf
matched_room.room_id == origin_room_id → stay_in_room.
D4 (DRINGEND): install.sh base_url-Löschung zu aggressiv
install.sh: base_url mit openrouter nur löschen wenn
_RC_PROVIDER == ollama-cloud. Bei explizitem openrouter bleibt sie.
Booster-Strategie: IMMER aktiv (nicht nur bei Konflikten)
- router.py: Konfliktbedingung entfernt, Booster auf alle FAISS-Treffer
- booster.py: Boost +0.05→+0.10, zusätzlich +0.05 pro weiterem unique Keyword
- config.py: FAISS_AUTO_ROUTE 0.85→0.70
Kombiniert semantische Breite (FAISS) mit präziser Keyword-Diskriminierung.
Ziel: granulare Raum-Entscheidungen bei überlappenden Themen.
OllamaLLMClient.generate() is async def — run_in_executor cannot
correctly execute async functions. The coroutine was never awaited.
Also fix Move-Request parser: native button '1️⃣ Rüber' was not
matched against '1️⃣' — fell through to 'stay' instead of 'move'.
- classifier.py: _llm_raw_sync → async _llm_raw, await generate()
- router.py: remove run_in_executor, direct await _llm_raw()
- adapter.py: normalize MOVE_REQ choice (extract leading digit/emoji)
Drei Routing-Bug-Fixes basierend auf Analyse des Timeout-Falls vom 15.06.2026:
FIX 1 (KRITISCH): Timeout-Fallback auf Ursprungsraum statt Catch-All
- _llm_room_lookup() gibt jetzt (RoomEntry|None, bool) zurück
- bool=True signalisiert LLM-Aufruf-Fehler (Exception/Timeout)
- Bei LLM-Fehler: stay_in_room=True, is_catch_all=False
- Nur bei explizitem CATCH_ALL vom LLM: catch_all-Raum als Ziel
FIX 2: Keyword-Matching vor LLM-Aufruf (Embedding+Keyword-Fallback)
- Nach Embedding-Vorfilter: wenn work_order mit conf < 0.9
- find_room_by_keywords() aufrufen, bei Match direkt zurückgeben
- Verhindert unnötige LLM-Calls für klare Keyword-Matches
FIX 3: find_room_by_keywords() verbessert
- keywords_100-Matches: nicht erster Treffer, sondern Raum mit
den MEISTEN 100%-Matches gewinnt (best_100_score)
- keywords_context bleibt Fallback wenn kein 100%-Match existiert
Tests: 57/58 passed (1 pre-existing env-var failure)
Vier harte Änderungen:
1. config.py: ARCHIVAR_FAKT_ROOM existiert nicht mehr. FAKT wird
niemals in ROOM_MAPPING aufgenommen — Env-Variable obsolet.
2. router.py: FAKT-Entscheidungen werden VOR der Subscription-
Validierung als is_unrouteable markiert. Kein if/else, kein
Ermessensspielraum.
3. adapter_integration.py: classify_and_route() legt FAKT automatisch
im DocumentationStore ab (existiert bereits).
4. Env-Variable ARCHIVAR_FAKT_ROOM aus systemd env.conf entfernt.
Resultat: Nur FRAGE und ALARM werden jemals in Chat-Räume geroutet.
FAKT-Nachrichten wie 'CPU-Last bei 92%' sind reine Dokumentation —
sie landen als Markdown unter data/archivar_docs/fakt/
Harte Durchsetzung: Der Archivar darf NUR in Räume routen, die der Bot
tatsächlich abonniert hat. Alles andere ist ein Architekturfehler.
Neu:
- doc_store.py: DocumentationStore — speichert unrouteable Nachrichten
als Markdown mit YAML-Frontmatter unter data/archivar_docs/{category}/
- router.py: RoutingDecision.is_unrouteable + unrouteable_reason,
MessageRouter.set_subscribed_room_ids(), Zielraum-Validierung
- adapter_integration.py: ArchivarMessageHandler.set_subscribed_room_ids(),
classify_and_route() leitet bei is_unrouteable in doc_store um
- adapter.py: set_subscribed_room_ids() wird nach connect() mit den
realen subscribed rooms gefüttert
Verhalten: Wenn jemand 'ALARM: Server down' in einem Raum schreibt,
den der Bot nicht abonniert hat, wird die Nachricht KLASSIFIZIERT,
aber NICHT geroutet — sie landet im doc_store mit Begründung.
- adapter.py: recopied from production (write_file corrupted the em-dash on line 8)
- All archivar/*.py: from archivar.X → from .X for plugin-context compatibility