feat(F551): install.sh Venv-Discovery tools/python-* + Stufe-9 Paket-Repair @implements: [F-551]
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Projekt-STATUS — Hermes Rocket.Chat Plugin
|
||||
> **Stand:** 26. September 2026 — F556 IMPLEMENTIERUNG Variante C (Multi-Profil-Adapter-Reduktion, ROCKETCHAT_SKIP_ADAPTER). @implements [F-556]. **F556 (Implementierung, Bit 6):** Plugin-Layer-Lösung gegen Mehrfach-Antworten — Hermes-Multiplex startete für jedes Profil (don/finn/miguel/rainer/viola) einen eigenen RC-Adapter, alle subscribe dieselben Räume. Variante A (Credentials aus Profil-.env) und B (`enabled: false`) scheiterten (Credentials-Vererbung bzw. Multiplex ignoriert den Key für Profil-Adapter). Variante C: `plugin/__init__.py` prüft in `validate_config()` das Flag `ROCKETCHAT_SKIP_ADAPTER` — kanonische scoped-secret-Lesung `gateway.platforms._shared.get_scoped_secret` (fail-closed, kein os.environ-Ausleihen) → gesetzt → `validate_config()` False → `create_adapter()` None → Adapter wird nicht instanziiert. Nur das Default-Profil (kein Flag) startet einen Adapter. CLI-Delegation (`hermes chat --profile`) startet keinen Gateway-Adapter → unbeeinträchtigt. KEINE Core-Änderungen. Test `tests/test_f556_skip_adapter.py` (29 Tests), Doku `INSTALL.md` + `templates/.env`.
|
||||
> **Stand:** 26. September 2026 — F551 IMPLEMENTIERUNG (Infrastruktur-Typ): install.sh Venv-Discovery für ~/.hermes/tools/python-* (Python 3.14) + Stufe-9-Repair der Tools-Python-Pakete. @implements [F-551]. **F551:** Nach Hermes-Update auf Python 3.14 läuft der Gateway auf dem Standalone-Tools-Python `~/.hermes/tools/python-3.14.7+.../bin/python3` (kein venv/pipx). `find_pipx_venv()` priorisiert jetzt diesen Pfad (höchste Python-Version via `find_tools_python()`), Fallback pipx → hermes-agent/venv → system. Neuer `--repair`-Check "Stufe 9" prüft im Tools-Python: ruamel.yaml, snowballstemmer, websocket-client, PyYAML (Core) + faiss-cpu/numpy (nur Multiroom & Provider≠custom) und installiert Fehlendes via `pip install` im aktiven Python. KEINE Core-Änderungen.
|
||||
> **Letzter fachlicher Commit:** `feat(F553): main_agent Counter-Leak Fix — Lifecycle-Tracker (Variante B) @implements: [F-553]` (`fcf0851`, 23.09.2026)
|
||||
> **Gitea-Remote:** ✅ Synchron — `fcf0851` + `07be8ba` + `b533320` + `786fa04` + `b175765` + `9b8ad40` + `97d5d88` + `a1af777` + `60103ed` + `c509876` + `dafd72f` + `3dcd024` + `eec8904` + `e02d34e` + `a24dc9d` + `8a00c39` + `f81a510` + `221500e` + `32b560d` + `31ca0f2` + `df8be1c` + `500c28a` + `f165f11` + `4ea711c` + `5027738` + `117b839` + `b8373d3` + `25678c6` + `bb91468` + `a1f4ed0` + `f0f3537` + `ebd057e` + `0d9275d` + `6e8854d` + `b61e19d` + `05531f1` gepusht auf origin/main.
|
||||
> **Deployment:** ✅ .101 deployed bei `b533320` (Plugin v10.4 — F551+F552). 112 Features GRÜN, 2 verworfen (grau). F553 NOCH NICHT deployed (Bit 7/8 QG ausstehend).
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
| Commit | Beschreibung | Datum |
|
||||
|---|---|---|
|
||||
| `e8d4523` | feat(F551): install.sh Venv-Discovery tools/python-* + Stufe-9 Paket-Repair @implements: [F-551] — install.sh (find_tools_python + find_pipx_venv priorisiert Tools-Python, _tools_pkg_pipname, check_components Stufe 9, repair_components Stufe 9), STATUS.md, 2 Dateien | 26.09. |
|
||||
| `fcf0851` | feat(F553): main_agent Counter-Leak Fix — Lifecycle-Tracker (Variante B) @implements: [F-553] — presence_engine.py (adaptive Cap `_compute_adaptive_h_cap` Welford/Quantil+Bufferklemme [120s..1800s], `refresh_main_agent_heartbeat` + lock-freie Variante, `_main_agent_gc_locked` Heartbeat-Alter-GC ohne pgrep, `TaskState.fresh_adoption`, `_record_h_turn_duration_locked`, `_drift_correction` ruft Lifecycle-GC), adapter.py (`_refresh_main_agent_heartbeat`-Helper + Turn-Start-Aufruf), test_f553_main_agent_lifecycle.py (12 Tests), STATUS.md, analysen/F553_Architektur_Rainer.md, 4 Dateien | 23.09. |
|
||||
| `07be8ba` | docs: F552 QG-Code Rainer (476 Zeilen) @implements: [F-552] — analysen/F552_QG-Code_Rainer.md (404 Zeilen, Rainer QG-Code-Review für F552), 1 Datei +404 | 22.09. |
|
||||
| `b533320` | feat(F552): Tracker-zur-Anker + Hook-Verdrahtung (Variante B) @implements: [F-552] — presence_engine.py (register_engine/get_engine/unregister_engine Singleton, notify_subagent() idempotent + PID-Alive-Check, _drift_correction +1-Erweiterung P-063-safe, Unix-Socket-Server), plugin/notify_subagent.py (146 Z.), adapter.py (register_engine-Verdrahtung), scripts/delegation_tracker.py (flock + PID-Alive + notify-Helper), test_f552_subagent_tracking.py (10 Tests), 5 Dateien | 22.09. |
|
||||
|
||||
+128
@@ -558,7 +558,57 @@ bootstrap_repo() {
|
||||
# ──────────────────────────────────────────────────────────────────────────
|
||||
# pipx-Standardpfad: ~/.local/share/pipx/venvs/hermes-agent/
|
||||
# Plugin-Ziel: $PIPX_VENV/lib/pythonX.Y/site-packages/plugins/platforms/rocketchat/
|
||||
|
||||
# F551: Findet den aktivsten Tools-Python der neuen Hermes-Tools-Struktur.
|
||||
# Nach dem Hermes-Update auf Python 3.14 liegt der Laufzeit-Interpreter als
|
||||
# Standalone-Tools-Python unter ~/.hermes/tools/python-* (KEIN venv, kein
|
||||
# pipx). Der Gateway startet auf diesem Interpreter. Liefert das Installations-
|
||||
# Verzeichnis (eine Ebene über bin/) des höchsten Python-Version, oder leer.
|
||||
# @implements: [F-551]
|
||||
find_tools_python() {
|
||||
local tools_dir="$HOME/.hermes/tools"
|
||||
[ -d "$tools_dir" ] || return 1
|
||||
local best="" best_key=0 py key
|
||||
for py in "$tools_dir"/python-*/bin/python3; do
|
||||
[ -x "$py" ] || continue
|
||||
# Versions-Key numerisch vergleichbar machen (major*1e6+minor*1e3+micro):
|
||||
# 3.14.7 → 3014007, 3.11.15 → 3011015. Höchste Version gewinnt.
|
||||
key="$("$py" -c 'import sys; v=sys.version_info; print(v.major*1000000+v.minor*1000+v.micro)' 2>/dev/null || echo 0)"
|
||||
if [ "$key" -gt "$best_key" ] 2>/dev/null; then
|
||||
best_key="$key"
|
||||
best="$py"
|
||||
fi
|
||||
done
|
||||
[ -n "$best" ] || return 1
|
||||
# Verzeichnis der Tools-Python-Installation (eine Ebene über bin/).
|
||||
dirname "$(dirname "$best")"
|
||||
}
|
||||
|
||||
# F551: Modulname (Import) → pip-Paketname für die Tools-Python-Reparatur.
|
||||
# ruamel.yaml→ruamel.yaml, snowballstemmer→snowballstemmer, websocket→websocket-client,
|
||||
# yaml→PyYAML, faiss→faiss-cpu, numpy→numpy.
|
||||
_tools_pkg_pipname() {
|
||||
case "$1" in
|
||||
ruamel.yaml) echo "ruamel.yaml" ;;
|
||||
snowballstemmer) echo "snowballstemmer" ;;
|
||||
websocket) echo "websocket-client" ;;
|
||||
yaml) echo "PyYAML" ;;
|
||||
faiss) echo "faiss-cpu" ;;
|
||||
numpy) echo "numpy" ;;
|
||||
*) echo "$1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
find_pipx_venv() {
|
||||
# F551: Neue Hermes-Tools-Struktur priorisieren (höchste Python-Version).
|
||||
# Nach dem 3.14-Update läuft der Gateway auf dem Tools-Python, nicht mehr
|
||||
# im pipx/hermes-agent-venv. Alle Folge-Pfade (VENV_PY etc.) müssen deshalb
|
||||
# auf diesen Interpreter zeigen.
|
||||
local tools_python
|
||||
if tools_python="$(find_tools_python 2>/dev/null)" && [ -n "$tools_python" ]; then
|
||||
echo "$tools_python"
|
||||
return 0
|
||||
fi
|
||||
local venv="$HOME/.local/share/pipx/venvs/hermes-agent"
|
||||
if [ -d "$venv" ] && [ -x "$venv/bin/python" ]; then
|
||||
echo "$venv"
|
||||
@@ -2455,6 +2505,7 @@ check_components() {
|
||||
REPAIR_ENV_MISSING=false
|
||||
REPAIR_SYMLINK_MISSING=false
|
||||
REPAIR_UNIT_MISSING=false
|
||||
REPAIR_TOOLS_PKGS_MISSING=false
|
||||
|
||||
# ── Stufe 1: venv finden ──
|
||||
if ! PIPX_VENV="$(find_pipx_venv 2>/dev/null)" || [ -z "$PIPX_VENV" ]; then
|
||||
@@ -2638,6 +2689,46 @@ except Exception:
|
||||
REPAIR_UNIT_MISSING=true
|
||||
REPAIR_NEEDED=true
|
||||
fi
|
||||
|
||||
# ── Stufe 9: Python 3.14 Tools-Paket-Check (F551) ──
|
||||
# Nach dem Hermes-Update auf Python 3.14 liegt der Laufzeit-Interpreter als
|
||||
# Standalone-Tools-Python unter ~/.hermes/tools/python-* (KEIN venv, kein
|
||||
# pipx). Fehlen dort Core-Pakete (ruamel.yaml, snowballstemmer,
|
||||
# websocket-client, PyYAML), schlägt der Adapter-Import fehl bzw. die
|
||||
# DDP-Verbindung zu Rocket.Chat kommt nicht zustande. Diese Stufe prüft und
|
||||
# repariert NUR den Tools-Python (nicht den pipx/hermes-agent-venv — der
|
||||
# wird vom offiziellen Installer verwaltet und ist bei 3.14 nicht aktiv).
|
||||
# faiss-cpu + numpy sind nur bei Multiroom Pflicht; bei Provider=custom
|
||||
# (wie .45, DGX Spark) bleiben sie optional und werden nie installiert.
|
||||
# @implements: [F-551]
|
||||
local tools_python
|
||||
if tools_python="$(find_tools_python 2>/dev/null)" && [ -n "$tools_python" ]; then
|
||||
local tools_py="$tools_python/bin/python3"
|
||||
local tp_missing="" tp_mod tp_pkg
|
||||
for tp_mod in ruamel.yaml snowballstemmer websocket yaml; do
|
||||
if ! "$tools_py" -c "import $tp_mod" 2>/dev/null; then
|
||||
tp_missing="$tp_missing $tp_mod"
|
||||
fi
|
||||
done
|
||||
# faiss + numpy nur bei Multiroom (F98 P-178, analog Stufe 2).
|
||||
if $FAISS_REQUIRED && [ "$PROVIDER" != "custom" ]; then
|
||||
for tp_mod in faiss numpy; do
|
||||
if ! "$tools_py" -c "import $tp_mod" 2>/dev/null; then
|
||||
tp_missing="$tp_missing $tp_mod"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ -n "$tp_missing" ]; then
|
||||
warn "Stufe 9: Tools-Python-Pakete fehlen:$tp_missing (Interpreter: $tools_py)"
|
||||
REPAIR_TOOLS_PKGS_MISSING=true
|
||||
REPAIR_NEEDED=true
|
||||
else
|
||||
ok "Stufe 9: Tools-Python-Pakete importierbar ($tools_py)"
|
||||
fi
|
||||
else
|
||||
# Kein Tools-Python vorhanden → nichts zu prüfen (noch alte Struktur).
|
||||
ok "Stufe 9: kein Tools-Python ($HOME/.hermes/tools/python-*) — übersprungen"
|
||||
fi
|
||||
}
|
||||
|
||||
# ──────────────────────────────────────────────────────────────────────────
|
||||
@@ -2868,6 +2959,43 @@ repair_components() {
|
||||
repaired=true
|
||||
fi
|
||||
|
||||
# Stufe 9: Python 3.14 Tools-Paket-Check (F551)
|
||||
# Installiert die fehlenden Pakete im Tools-Python (nicht im hermes-agent-venv).
|
||||
# Nur die im Check (Stufe 9) als fehlend gemeldeten Module werden installiert.
|
||||
# @implements: [F-551]
|
||||
if $REPAIR_TOOLS_PKGS_MISSING; then
|
||||
banner "Reparatur Stufe 9: Python 3.14 Tools-Pakete"
|
||||
local tools_python tools_py tp_mod tp_pkg
|
||||
tools_python="$(find_tools_python 2>/dev/null)" || tools_python=""
|
||||
if [ -n "$tools_python" ]; then
|
||||
tools_py="$tools_python/bin/python3"
|
||||
for tp_mod in ruamel.yaml snowballstemmer websocket yaml faiss numpy; do
|
||||
if "$tools_py" -c "import $tp_mod" 2>/dev/null; then
|
||||
log "Stufe 9: $tp_mod bereits vorhanden — überspringe"
|
||||
continue
|
||||
fi
|
||||
# faiss + numpy nur bei Multiroom UND Provider != custom installieren.
|
||||
if { [ "$tp_mod" = "faiss" ] || [ "$tp_mod" = "numpy" ]; }; then
|
||||
if ! $FAISS_REQUIRED || [ "$PROVIDER" = "custom" ]; then
|
||||
log "Stufe 9: $tp_mod optional (Multiroom=$FAISS_REQUIRED, Provider=$PROVIDER) — überspringe"
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
tp_pkg="$(_tools_pkg_pipname "$tp_mod")"
|
||||
if $DRY_RUN; then
|
||||
printf '%s[dry]%s %s -m pip install %s\n' "$C_YELLOW" "$C_RESET" "$tools_py" "$tp_pkg"
|
||||
elif "$tools_py" -m pip install --quiet "$tp_pkg" 2>/dev/null; then
|
||||
ok "Stufe 9: $tp_mod installiert ($tp_pkg)"
|
||||
else
|
||||
warn "Stufe 9: $tp_mod Build-/Install-Fehler ($tp_pkg) — später nachholbar"
|
||||
fi
|
||||
done
|
||||
else
|
||||
warn "Stufe 9: kein Tools-Python gefunden — Paket-Reparatur übersprungen"
|
||||
fi
|
||||
repaired=true
|
||||
fi
|
||||
|
||||
if $repaired; then
|
||||
return 0
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user