Implements the RC-Skill's promised room-map completeness check after
Adapter.connect(). Previously the adapter subscribed to rooms but never
verified they were all present in room-map.json. New rooms were
subscribed but invisible to the Archivar router.
Scope (~450 lines, 4 files):
- adapter_integration.py: check_room_map_completeness() compares
subscribed rooms (filtered to c/p types) against RoomMap.
Single-Room-Regel: 1 relevant room → auto catch_all, no interview.
onboarding_active flag in _stats prevents re-triggering.
- room_map.py: add_or_update_room() for safe in-memory mutations,
reload() for disk-to-memory sync without gateway restart,
static save() for atomic file writes.
- adapter.py: connect() calls check after Archivar init, triggers
_start_onboarding() if rooms missing. _process_incoming() intercepts
'Raum: #Name = Thema' responses during active onboarding.
- test_auto_onboarding.py: 4 unit tests covering single-room
auto-assign, multi-room detection, DM filtering, and already-
complete map (no action).
Deployed to production: adapter.py + archivar/*.py copied to
Auslieferungspfad. Gateway restarted — no onboarding triggered
(map already complete).
ROOT CAUSE: install.sh --update-only blindly deployed room-map.json
from the repo (containing 'GENERAL' as catch_all) to the production
/home/bernd/.hermes/data/ directory, overwriting the machine-specific map.
FIXES (3 changes):
1. REMOVED room-map.json from repo + added to .gitignore
This file is machine-specific data, not source code.
2. REMOVED room-map.json deploy from install.sh (both paths):
- Normal install block (section 3.5)
- --update-only emergency deploy (section 3.5)
Replaced with comment: 'MACHINE-SPECIFIC — created by RC-Skill onboarding'
3. FIX adapter.py: is_unrouteable guard on ContextVar routing
Before: ContextVar set to target_room even when unrouteable
Result: 'Ich antworte im Zielraum.' note appeared, but Hermes
couldn't deliver to unsubscribed room — answer lost silently.
After: Forward block checks not getattr(decision, 'is_unrouteable', False)
If unrouteable → stays in origin room, answers there normally.
PRODUCTION: Correct room-map.json deployed with 4 project rooms
+ DM catch_all on .101. Excluded rooms: multi-agent DM, testbot DM.
Ersetzt classify_and_route() durch handle_and_forward().
Nachrichten werden jetzt klassifiziert UND automatisch in den
Zielraum kopiert, wenn target_room != origin_room.
send_callback ist bereits im ArchivarMessageHandler-Konstruktor
gesetzt (adapter.py:416).
Ohne diesen Parameter kann der Router:
- Multi-Agent-Raum nicht ausschließen (Schritt 0)
- Herkunft nicht in LLM-Room-Lookup einbeziehen
- Keine korrekte Catch-All-Validierung durchführen
Adapter hat room_id in _process_incoming() bereits verfügbar.
Platform._scan_bundled_plugin_platforms() erwartet plugin.yaml im
Plattform-Verzeichnis, sonst wird Rocket.Chat nicht discovered.
Ohne dieses Manifest überlebt RC keinen kalten Gateway-Neustart.
Root cause: gateway/config.py:176-194 scannt plugins/platforms/
und filtert Verzeichnisse ohne plugin.yaml aus. War vorher kein
Problem, weil die platform_registry in-process überlebte.
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.
A: config.py auf Env-Vars umgestellt (ARCHIVAR_FAKT_ROOM, _FRAGE_ROOM, _ALARM_ROOM, _CATCHALL_ROOM, _PROJECT_ROOMS)
B: adapter.py-Kommentare von BAT-Terminologie auf generisch umgeschrieben
C: archivar/SKILL.md — Hermes-Skill-Schema mit Triggern, Architektur, Konfiguration, Pitfalls
D: classify_and_route() + send_callback in _process_incoming() integriert, chat_name mit [KATEGORIE] angereichert
E: RocketChatREST.download_file() — authentifizierter Datei-Download via X-Auth-Token, kein Security-Scanner-Trigger mehr
_download_and_inline_files() inlined [FILE]-Inhalte direkt in den Prompt
- 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