diff --git a/install.sh b/install.sh index c331545..f5166fc 100755 --- a/install.sh +++ b/install.sh @@ -377,6 +377,15 @@ perform_update() { # by the installer. It is created by the RC-Skill onboarding # flow after gateway start. See RC-Skill: "Room Topic Discipline" fi + + # ── FIX: numpy/faiss im venv installieren ────────────────────── + # Archivar braucht numpy + faiss für FAISS Phase-1 RoomIndex. + # Ohne diese Packages crasht der Import beim Gateway-Start. + if [ -f "$hermes_dir/venv/bin/pip" ]; then + "$hermes_dir/venv/bin/pip" install numpy faiss-cpu 2>&1 | tail -1 + elif [ -f "$hermes_dir/.venv/bin/pip" ]; then + "$hermes_dir/.venv/bin/pip" install numpy faiss-cpu 2>&1 | tail -1 + fi # Execute backend checks directly (Ollama check from lines 429-446) msg ollama_check @@ -543,6 +552,15 @@ perform_update_only() { find "$PLUGIN_DST" -name '*.pyc' -delete 2>/dev/null || true msg cache_cleared + # ── FIX: numpy/faiss im venv installieren ────────────────────── + # Archivar braucht numpy + faiss für FAISS Phase-1 RoomIndex. + # Ohne diese Packages crasht der Import beim Gateway-Start. + if [ -f "$hermes_dir/venv/bin/pip" ]; then + "$hermes_dir/venv/bin/pip" install numpy faiss-cpu 2>&1 | tail -1 + elif [ -f "$hermes_dir/.venv/bin/pip" ]; then + "$hermes_dir/.venv/bin/pip" install numpy faiss-cpu 2>&1 | tail -1 + fi + # NOTE: room-map.json is MACHINE-SPECIFIC — never deployed # by --update-only. It is created by the RC-Skill onboarding # flow after gateway start. See RC-Skill: "Room Topic Discipline" @@ -842,6 +860,26 @@ find "$PLUGIN_DST" -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || find "$PLUGIN_DST" -name '*.pyc' -delete 2>/dev/null || true msg cache_cleared +# ── FIX: numpy/faiss im venv installieren ────────────────────── +# Archivar braucht numpy + faiss für FAISS Phase-1 RoomIndex. +# Ohne diese Packages crasht der Import beim Gateway-Start. +if [ -f "$HERMES_DIR/venv/bin/pip" ]; then + "$HERMES_DIR/venv/bin/pip" install numpy faiss-cpu 2>&1 | tail -1 +elif [ -f "$HERMES_DIR/.venv/bin/pip" ]; then + "$HERMES_DIR/.venv/bin/pip" install numpy faiss-cpu 2>&1 | tail -1 +fi + +# ─── FIX: room-map.json bereitstellen ──────────────────────── +# Der Installer stellt eine minimale room-map.json ins Datenverzeichnis. +# Die vollständige, maschinen-spezifische Version wird vom RC-Skill- +# Onboarding-Flow nach dem Gateway-Start erstellt. +ROOM_MAP_DATA_DIR="$HOME/.hermes/hermes-agent/data" +mkdir -p "$ROOM_MAP_DATA_DIR" +if [ ! -f "$ROOM_MAP_DATA_DIR/room-map.json" ] && [ -f "$SCRIPT_DIR/templates/room-map.json" ]; then + cp "$SCRIPT_DIR/templates/room-map.json" "$ROOM_MAP_DATA_DIR/room-map.json" + msg room_map_deployed "$ROOM_MAP_DATA_DIR/room-map.json" +fi + # ─── Fix #9: Provision minimal config.yaml + .env ────────── # Only when hermes has NO config yet (fresh install, no setup run) HERMES_HOME="$HOME/.hermes" diff --git a/plugin/archivar/adapter_integration.py b/plugin/archivar/adapter_integration.py index 67fb6d0..90be73f 100644 --- a/plugin/archivar/adapter_integration.py +++ b/plugin/archivar/adapter_integration.py @@ -93,13 +93,6 @@ except ImportError: from .seed_data import SEED_DATA from .feedback_detector import RoutingWiderspruchDetector, ContradictionResult -# ── _room_context import from adapter.py ───────────────────────────── -# Needed by handle_feedback_response to clear thematic_target on 'stay'. -try: - from adapter import _room_context, _room_context_lock -except ImportError: - from ..adapter import _room_context, _room_context_lock - logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) # Ensure adapter_integration logs are visible by adding a stderr handler @@ -898,6 +891,12 @@ class ArchivarMessageHandler: # geleert werden, damit der nächste Send nicht auf den falschen # (Archivar-vorgeschlagenen) Zielraum fällt. if feedback_type == "stay" and username: + # Lazy import to break circular dependency with adapter.py + try: + from adapter import _room_context, _room_context_lock + except ImportError: + from ..adapter import _room_context, _room_context_lock + virtual_chat_id = f"user:{username}" with _room_context_lock: ctx = _room_context.setdefault(virtual_chat_id, {}) diff --git a/templates/room-map.json b/templates/room-map.json new file mode 100644 index 0000000..bf3d991 --- /dev/null +++ b/templates/room-map.json @@ -0,0 +1,6 @@ +{ + "version": 1, + "rooms": {}, + "excluded_rooms": [], + "fact_store_path": "/data/Wissensdatenbank/0100 Inbox" +}