_finish_onboarding: DM-Raum aus _room_info wird immer in die
Catch-All-Auswahlliste aufgenommen (auch wenn nicht in room_map).
DM bekommt '(aktuell)'-Marker statt '(Catch-All)'.
_get_onboarding_room_list: Gleiche Logik — DM immer inkludiert,
mit echtem Namen statt 'Catch-All (legacy)'.
catch_all_change-Phase: DM-Auswahl ist no-op (bleibt Catch-All),
andere Raum-Auswahl setzt _set_catch_all() wie bisher.
Bug 3 — Onboarding-Buttons als Text statt interactive:
- adapter.py: Neue Methode _get_build_custom_buttons() mit lokalem Fallback
der korrekte Rocket.Chat Button-Dicts baut, wenn das rocketchat-Modul
nicht in sys.modules ist (Race-Condition beim Import)
- _start_onboarding() nutzt jetzt _get_build_custom_buttons() statt
des Modul-Level-Fallbacks _build_custom_buttons (der [] liefern kann)
- _onboarding_next_room() ebenfalls auf _get_build_custom_buttons() umgestellt
- Operator-DM-Erkennung nicht mehr hardcoded auf 'andreas' — nimmt ersten DM
- Selbsterklärende Onboarding-Nachricht mit Emoji und Kontext
Bug 4 — Move-Request-Schleife, Sticky greift nicht:
- Option 2 (Generell hier): Persistiert jetzt in ArchivarState
(set_room_state(room_id, 'never_route', username)) — überlebt Neustarts
- Option 3 (Hier bleiben): Stay-Counter — nach 3x Stay in 10 Min
wird der Raum automatisch auf never_route promoted
- _sticky_rooms (in-memory) bleibt als schneller Cache erhalten
Bug 5 — Falsche room-map.json wird geladen:
- install.sh: Alle 3 room-map.json-Deploy-Stellen prüfen jetzt, ob die
existierende Datei 0 Räume enthält (leeres Template) → dann neu deployen
- Verhindert dass das leere Template nach Erstinstallation für immer bleibt
B9 — Auto-Onboarding ohne Vorkenntnisse:
- connect(): Trigger prüft jetzt: MULTIROOM_AGENT=true + Räume ohne Map-Eintrag
+ Ausnahme: Nur DM → kein Onboarding
- Zusätzlich: Wenn room-map.json 0 Räume hat → Onboarding für ALLE non-DM-Räume
- _finish_onboarding(): FAISS-Index wird nach Onboarding neu gebaut + gespeichert
- _is_user_operator(): Nicht mehr hardcoded — erster DM-User wird Operator
Syntax-Check: Alle .py (20 Dateien) + install.sh → OK
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.
FIX 1: numpy/faiss-cpu pip install in venv nach Plugin-Deployment
in allen drei Pfaden (perform_update, perform_update_only,
main interactive). Archivar braucht diese Packages für
FAISS Phase-1 RoomIndex — ohne sie crasht der Import.
FIX 2: Zirkelimport adapter.py ↔ archivar/adapter_integration.py
gebrochen. _room_context/_room_context_lock werden jetzt
lazy innerhalb handle_feedback_response() importiert.
FIX 3: Minimale room-map.json (version=1, rooms={}) wird als
Template bereitgestellt und bei Clean-Install ins
Datenverzeichnis kopiert. RC-Skill-Onboarding erstellt
die vollständige, maschinen-spezifische Version.
FIX 4: Archivar-Symlink liegt bereits korrekt im HERMES_DIR
(Commit 5c8026c). Keine Änderung nötig.
P45-Fix: Nach load() wird is_stale() geprüft. Wenn die RoomMap-Version
neuer ist als der gespeicherte Index, wird automatisch rebuild + save
ausgeführt. Verhindert, dass Keyword-Änderungen in room-map.json erst
nach manuellem Löschen der .faiss/.meta-Dateien wirken.
Zirkulärer Import: adapter.py → adapter_integration.py → adapter.py.
_room_context und _room_context_lock fehlten komplett in adapter.py,
adapter_integration.py versuchte sie zu importieren → ImportError.
Fix: _room_context (Dict) + _room_context_lock (threading.Lock) VOR
dem ArchivarMessageHandler-Import definieren. Behebt P17-Altlast
(ContextVar→global dict war nie ins Repo zurückportiert).
Deployment-Pfad braucht zusätzlich relative Imports (.archivar.),
weil Gateway Plugins als flache Module lädt (Pattern D4).
Gateway startete nach Reboot nicht automatisch, weil install.sh nur
stop+start ausführte, aber den Service nie enabled hat.
Fix: systemctl --user enable hermes-gateway in perform_update(),
perform_update_only() und main script — jeweils nach reset-failed,
vor stop. enable ist idempotent, daher bei jedem Durchlauf sicher.
Root Cause: hermes gateway install installiert die Unit, aber ob es
sie enabled ist unklar. Explizites enable stellt Autostart sicher.
Review: Rainer (Session 20260620_155910_6559a0)
Patch: Don (Session 20260620_155930_3dce08)
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.
Strategie B: _room_to_text() webt kuratierte seed_data-Messages
in den Embedding-Text ein, um FAISS-Similarity zu schärfen.
Änderungen:
- room_index.py: import SEED_DATA, _room_to_text() erweitert
um Seed-Message-Einwebung (nur für Räume mit SEED_DATA-Eintrag)
- test_room_index.py: MockEmbeddingClient auf Keyword-Zählung
umgestellt (statt binär any()) — verhindert Cross-Contamination
durch längere Embedding-Texte mit Seed-Messages
Tests: 35/35 passed (22 booster + 13 room_index)
NEUES MODUL: plugin/archivar/feedback_detector.py
- RoutingWiderspruchDetector mit 4 Regex-Gruppen (Hauptmuster, Umrouting,
Verneinung, Befehle)
- ContradictionResult dataclass: has_contradiction, contradiction_type,
confidence, target_room, rejected_room, matched_pattern
- Edge Cases: 'nicht in X, sondern in Y' → X negativ, Y als Ziel
- Kein LLM-Fallback (nur Regex in v1)
EINHAENGUNG adapter_integration.py:
- ArchivarMessageHandler.__init__(): self._feedback_detector
- detect_routing_contradiction(text, origin_room_id) → ContradictionResult|None
- Bei Treffer: update_keyword_weight(feedback_type='never')
- _resolve_room_name_to_id() für Raum-Name → room_id Auflösung
EINHAENGUNG adapter.py:
- _process_incoming(): VOR classify_and_route() → contradiction-Check
- Bei Treffer: Decision überschreiben (stay_in_room=True)
- [WIDERSPRUCH]-Präfix — Nachricht NICHT schlucken, normal an Agent
- NUR wenn KEIN Button-Feedback aktiv (kein pending move-request)
Tests: 57/58 passed (1 pre-existing env-var failure unverändert)
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)
Bei Auto-Route Silent Copy (Typ 1, kein Move-Request) wurde die
Notiz im Ursprungsraum gesendet, aber _CURRENT_ORIGIN_ROOM blieb auf
dem Ursprungsraum — der Agent antwortete dann fälschlich dort.
Fix: Nach der Silent Copy _CURRENT_ORIGIN_ROOM auf decision.target_room
setzen und forwarded=True, damit der Fallback in Zeile 927-928
übersprungen wird. Der Agent antwortet jetzt im Zielraum.
- initialize() now tries load() from disk first
- If load succeeds: log 'Index von Disk geladen' + wire router
- If load fails: build_index() + save() + log 'Index gebaut + gespeichert' + wire router
- Eliminates unnecessary index rebuild on every gateway restart
- All 58 tests pass
setLevel(INFO) alone was not enough — without a handler and with
propagate=True (default), logs were accepted by the root logger
(level WARNING) but silently discarded since root has no handlers.
Now matches adapter.py pattern: StreamHandler + propagate=False,
so all submodule logs (classifier, router, room_index, booster)
are visible via the shared parent logger.
Root logger defaults to WARNING (level 30) when no basicConfig is set.
adapter_integration.py only called getLogger(__name__) without setLevel,
so all INFO logs were silently filtered. adapter.py already had its own
setLevel(INFO) + handler, which is why its logs appeared.
Fix: add logger.setLevel(logging.INFO) after getLogger(__name__) at line 94.
This restores all suppressed INFO logs:
- Initializing ArchivarMessageHandler...
- FAISS Phase-1: RoomIndexManager + KeywordBooster ready
- FAISS Phase-1: Index built
- FAISS Phase-1: Router wired
- ArchivarMessageHandler ready
Root cause: RoomIndexManager.stats() returns a dict with mixed types
(bool, int, float, str). sum() iterated over all values and crashed
when hitting built_at_iso (str) after built_at (float).
Fix: Replace stats() call with direct .size and .room_ids properties.
Also commit FAISS Phase-1 files (booster.py, room_index.py, seed_data.py)
that were deployed to Gateway but not yet in repo.
Tests: 58 passed (0 failures)