a682e3c4e7
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40 lines
2.0 KiB
Bash
40 lines
2.0 KiB
Bash
#!/usr/bin/env bash
|
|
# Feed für den Selbstkritik-Cron (Faden 11b — Zwilling des Evolution-Radars, Blick nach INNEN).
|
|
# Liegt in ~/.hermes/scripts/ (deploy.sh kopiert ihn); stdout wird dem Cron-Agenten als
|
|
# Prompt eingespeist: versionierter Auftrag (deploy/selbstkritik-prompt.md) + Live-Betriebsdaten.
|
|
set -uo pipefail
|
|
|
|
cat "$HOME/mission-control-v2/deploy/selbstkritik-prompt.md"
|
|
|
|
echo
|
|
echo "## LIVE-DATEN (automatisch erhoben am $(date '+%d.%m.%Y %H:%M'))"
|
|
echo
|
|
echo "### Voice-Pipeline-Latenzen (rollend, ms — :9001/api/voice/metrics):"
|
|
curl -sf --max-time 15 http://127.0.0.1:9001/api/voice/metrics | jq -c . 2>/dev/null \
|
|
|| echo "(nicht erreichbar)"
|
|
echo
|
|
echo "### Token-Verbrauch / Cloud-Ersparnis:"
|
|
curl -sf --max-time 15 http://127.0.0.1:9001/api/system/token-stats | jq -c . 2>/dev/null \
|
|
|| echo "(nicht erreichbar)"
|
|
echo
|
|
echo "### Prompt-Budget (Hinweis: prompt-size ist Allowlist-blind — die Voice-Lane hat real"
|
|
echo "### deutlich weniger Tools; als Trend-Wächter für den GESAMT-Bestand trotzdem nützlich):"
|
|
bash -lc "hermes prompt-size" 2>/dev/null | grep -E "total|skills index|Tool schemas" || echo " (Messung fehlgeschlagen)"
|
|
echo
|
|
echo "### Gateway-Journal: häufigste Warnungen/Fehler der letzten 30 Tage (Anzahl · Muster):"
|
|
journalctl --user -u hermes-gateway -p warning --since "30 days ago" --no-pager 2>/dev/null \
|
|
| grep -oE "(WARNING|ERROR)[^:]*: .{0,90}" | sed "s/[0-9]\{3,\}/N/g" | sort | uniq -c | sort -rn | head -12 \
|
|
|| echo "(keine oder Journal nicht lesbar)"
|
|
echo
|
|
echo "### Tool-Loop-Guardrail-Treffer (letzte 30 Tage):"
|
|
n=$(journalctl --user -u hermes-gateway --since "30 days ago" --no-pager 2>/dev/null \
|
|
| grep -ci "loop guard\|hard_stop\|tool loop" || true)
|
|
echo "${n:-0}"
|
|
echo
|
|
echo "### Skill-Bestand & Curator:"
|
|
bash -lc "hermes curator status" 2>/dev/null | head -14 || echo "(Curator-Status fehlgeschlagen)"
|
|
echo
|
|
echo "### Meldeweg-Ausfälle (notify.sh-Fallbacks, letzte 30 Tage):"
|
|
n=$(grep -c "FALLBACK" "$HOME/mc2-notify.log" 2>/dev/null || true)
|
|
echo "${n:-0}"
|