Files
Hermes_rocket.chat_Plugin/plugin/archivar/seed_data.py
Bernd (Hermes) 03d3bb44df BUGFIX: FAISS Phase-1 TypeError float+str in adapter_integration.py:292
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)
2026-06-16 20:31:57 +02:00

135 lines
12 KiB
Python

"""
Archivar v5 — FAISS Phase-1 Seed-Daten.
Agent-kuratierte Trainingsbasis: Stichwortlisten + repräsentative Nachrichten
pro Raum, nach SINN zugeordnet (nicht nach historischem Ort).
Jeder Eintrag: {"text": "...", "room": "room_id", "source": "agent_curated"}
"""
SEED_DATA = {
# ── #Rocketchat-Plugin ──────────────────────────────────────────────
"6a19b0ff02aeecd36b1aa16c": {
"stichworte": (
"RC-Plugin-Entwicklung, Adapter, DDP, WebSocket, Buttons, "
"Archivar, Routing, Gateway-Integration, Rocket.Chat-API, "
"CLARIFY, Message-Handling, Raum-Management, install.sh, "
"Deployment, Plugin, Hermes Gateway, Onboarding, "
"Button-Garantie, Move-Request, Embedding, FAISS, "
"Phase-1-Routing, Intent-Klassifikation, room-map.json"
),
"messages": [
# Architektur-Strategie (heutiges Gespräch)
{"text": "FAISS als Phase-1-Raum-Index für Archivar v5 — Drei-Schichten-Logik: FAISS + Keyword-Booster + LLM", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "Der Archivar und der Agent sind ein Team. Einer sagt wohin und der andere entscheidet, ob es eine Antwort braucht.", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "Vier Bausteine: _CURRENT_ORIGIN_ROOM, _THEMATIC_TARGET_ROOM, _question_counter, Priority-0-Routing", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "Kontext-Reset fehlt als fünfter Baustein — _THEMATIC_TARGET_ROOM wird nicht zurückgesetzt nach DM", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
# BUTTON_CLICK-Fix
{"text": "BUTTON_CLICK-False-Positive: adapter.py:583 matched CLARIFY-Antworten mit :: als Button-Click", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "Fix: not text.startswith('CLARIFY:') in Zeile 583 — ein Wort, chirurgisch deployt", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
# Button-Garantie
{"text": "Button-Garantie: Move-Request von Textoptionen auf native Action-Buttons umgestellt — ✅Ja/📍Hier/📌Generell", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "Onboarding-Buttons: blaue Nummern statt Text-Labels, 12 auf 6 reduziert, skip_all/later global", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
# Deployment
{"text": "Deployment-Pipeline mit 3 Guards gehärtet: Syntax-Check, Vollständigkeits-Check, Pycache-Löschung", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "install.sh State-Cleanup vor Gateway-Restart in allen 3 Pfaden — gateway_state.json + reset-failed", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "Deployment-Pfad-Mismatch: Gateway lädt aus ~/.hermes/, nicht /usr/local/lib/. __pycache__ macht Fix unsichtbar.", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
# Archivar
{"text": "Archivar v4: Embedding-Vorfilter (nomic-embed-text) → LLM_ROOM_PROMPT (qwen2.5:7b) → room_id → Move-Request → Route", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "LLM-Raum-Router: Median 2.4s, P95 2.6s, Cold-Start 7.9s. Timeout 10s, Fallback CATCH_ALL.", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "Timeout-Fallback braucht Raumliste — ohne Kontext ist der Agent blind, mit Raumliste kann er selbst entscheiden", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "room-map.json v2: 100%-Keywords, ein Treffer = sofortiger Match, kein min_score=2 mehr", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
# Gateway
{"text": "Gateway-Crash-Recovery: rm gateway_state.json + gateway.lock → reset-failed → restart", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "systemctl stop während aktiver Session = Crash. Drain timeoutet 60s, StartLimitBurst exhausted.", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
{"text": "gateway-preflight-briefing: Vor jedem Gateway-Start Briefing-Prompt mit Entwicklungsstand posten", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
# Own-Message-Filter
{"text": "Own-Message-Filter: StartObsidian und projekt sync via rocketchat_send werden verworfen — direkt ausführen", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
# SOUL.md
{"text": "SOUL.md: delegate_task vererbt Eltern-Modell an ALLE Subagenten — Team-Agenten NUR via terminal mit Profil", "room": "6a19b0ff02aeecd36b1aa16c", "source": "agent_curated"},
],
},
# ── #BAT-Team ───────────────────────────────────────────────────────
"6a049d493a62ef8f1ead2320": {
"stichworte": (
"BAT Trading Platform, Docker, Next.js, Prisma, API, Web-UI, "
"Krypto-Analyse, Wyckoff-Methodik, Boot-Window, install.sh, "
"Container, Pre-Prod, .45, Build-VM, .101, docker-compose, "
"pnpm, postgresql, pg_dump, API_KEY, Narrensicher-Test, "
"Snapshot, Abweichungen, DATABASE_URL, Gateway, Tor, DB"
),
"messages": [
# Narrensicher-Test
{"text": "BAT Narrensicher-Test auf .45: 13 Abweichungen dokumentiert, install.sh --url http://192.168.180.45:3003", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
{"text": "patch_compose() auf generisches Pattern umgestellt: bat_user:[^@]*@db matched JEDEN Platzhalter", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
# Docker
{"text": "docker compose down -v ist der Nuklear-Fix für P1000 — Docker cached Compose-Konfigurationen, --force-recreate reicht nicht", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
{"text": "Docker-DNS fehlt auf frischem Debian: /etc/docker/daemon.json mit dns: [192.168.180.1, 8.8.8.8] nötig", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
{"text": "Web-Container: prisma generate fehlte → Build scheiterte an Cannot find module .prisma/client/default", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
{"text": "Gateway: Doppelter Protokoll-Fehler wss://https://... → getaddrinfo ENOTFOUND https", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
# API_KEY
{"text": "API_KEY wurde nie generiert — install.sh muss ALLE Secrets generieren, nicht nur DB-Passwort", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
{"text": "Next.js NEXT_PUBLIC_* ist eine Falle: Server-seitige API_KEY-Env-Vars sind für Client unsichtbar", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
# pg_dump
{"text": "pg_dump: drei Teilprobleme — pg_dump not found, Unix-Socket statt TCP, Version-Mismatch v15↔v16", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
{"text": "postgresql-client-16 via pgdg-Repo ins Dockerfile — Debian-Repos haben nur v15", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
# SSH
{"text": "SSH-Key-Mapping: bat_preprod_key für Build-VM→.45, gitea_hermes_key für .45→Gitea:222", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
# Features
{"text": "4 Features auf .45 deployt: KI-Provider, DB-Backup, Deutsche UI-Übersetzung, Freie Agenten-Konfiguration", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
{"text": "AUTH_PUBLIC-Entscheidungsmatrix: Key-Test ja (keine Secrets), DB-Info nein (Passwort), Backup NIEMALS", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
# Stash
{"text": "2-Wochen-alter Stash im BAT-Repo: node:22-bookworm-libssl Dockerfile + Boot-Window-Registrierung", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
{"text": "Stash-Duplikat-Pattern: Vor git stash pop prüfen ob Feature bereits committed ist", "room": "6a049d493a62ef8f1ead2320", "source": "agent_curated"},
],
},
# ── #LAN-Dokumentation ──────────────────────────────────────────────
"6a1c56d4b73efec2bebec2db": {
"stichworte": (
"LAN Dokumentation, Homelab, Netzwerk, Proxmox, Subnetze, "
"IP-Adressen, Router, Switch, Heimnetz, RZBLN, VLAN, "
"Firewall, pfSense, Build-VM, .101, .45, .47, Server, "
"Infrastruktur, Verkabelung, DHCP, DNS"
),
"messages": [
{"text": "Build-VM .101: 23G/14C i9-13900H/244G, Pre-Prod .45 bat, Gitea/Doku .47", "room": "6a1c56d4b73efec2bebec2db", "source": "agent_curated"},
{"text": "Susi: 62.238.14.195/Hetzner, SSH bernd, DGX-Spark qwen3-next-80b-fp8, vLLM :7999", "room": "6a1c56d4b73efec2bebec2db", "source": "agent_curated"},
{"text": "Gitea-Repos USER Andreas, git@192.168.180.47:222, SSH-Key gitea_hermes_key", "room": "6a1c56d4b73efec2bebec2db", "source": "agent_curated"},
{"text": "Docker-DNS: /etc/docker/daemon.json mit dns: [192.168.180.1, 8.8.8.8] für Container-Netzwerk", "room": "6a1c56d4b73efec2bebec2db", "source": "agent_curated"},
{"text": "Samba-Vault-Zugriff: benutzerbasierte Authentifizierung valid users = bernd, kein nobody:nogroup", "room": "6a1c56d4b73efec2bebec2db", "source": "agent_curated"},
{"text": "Host-Neustart: Gateway überlebt, Docker-Stack 5/5 UP, beide Plattformen connected", "room": "6a1c56d4b73efec2bebec2db", "source": "agent_curated"},
],
},
# ── #Protonbridge-Plugin ────────────────────────────────────────────
"69f8beaef06dba03be82f9fc": {
"stichworte": (
"Proton Mail Bridge, Hermes Mailschnittstelle, Email-Integration, "
"IMAP, SMTP, ProtonMail, Himalaya, Mail-Gateway, Bridge, "
"PR #39288, Th0rgal, Proton-API, Passwort-Management"
),
"messages": [
{"text": "Proton Mail Bridge: lokaler IMAP/SMTP-Proxy localhost:1143/localhost:1025 — funktioniert heute", "room": "69f8beaef06dba03be82f9fc", "source": "agent_curated"},
{"text": "PR #39288 (Th0rgal): Native Proton-Integration, 1.200 Zeilen, 5 Dateien, noch nicht gemerged", "room": "69f8beaef06dba03be82f9fc", "source": "agent_curated"},
{"text": "Gateway + Himalaya-Strategie: Gateway für IMAP-IDLE-Push, Himalaya CLI für SMTP-Antworten", "room": "69f8beaef06dba03be82f9fc", "source": "agent_curated"},
{"text": "Himalaya: Rust-CLI-Email-Client, TOML-Konfiguration, pipe cat << EOF | himalaya template send", "room": "69f8beaef06dba03be82f9fc", "source": "agent_curated"},
{"text": "Proton Mail REST-API existiert nicht — Bridge-Weg ist der einzig funktionierende Pfad heute", "room": "69f8beaef06dba03be82f9fc", "source": "agent_curated"},
],
},
}