Document repaired Hermes fleet scopes and verified settings audit
This commit is contained in:
1 parent
c0bc5d3a1b
commit
b93f75a42e
9 files changed
+816
No files matched your search
@@ -1,5 +1,11 @@
|
||||
# Hermes fleet acceptance — 26 October 2026
|
||||
|
||||
3 November follow-up: use the [current targeted repair and dynamic-roster
|
||||
audit](../hermes-fleet-repair-2026-11-03/README.md) for today's 21-profile fleet.
|
||||
It records 428/428 settings checks, preserved intentional role differences and
|
||||
the still-open, separately authorized security update. The dated roster,
|
||||
hook/screen assumptions and acceptance totals below remain historical.
|
||||
|
||||
27 October follow-up: the audit roster also classifies the existing Mac SSH
|
||||
profile and new `athena-deck` development/operations specialist. The latter has
|
||||
the same eleven coding toolsets and no MCPs. The later 15-profile result is
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
# Hermes-Flotte: gezielte Reparatur und aktuelle Nachprüfung
|
||||
|
||||
## Auftrag und Ergebnisgrenze
|
||||
|
||||
Michael beauftragte nach der lesenden Gesamtprüfung die Korrektur der Befunde.
|
||||
Die ursprünglichen zwanzig Profile wurden korrigiert und nachgeprüft. Während
|
||||
der Arbeit kam ein weiteres Profil hinzu, zunächst `netopsbot`, anschließend
|
||||
von anderer Seite in `dns-netbot` umbenannt. Die Nachprüfung berücksichtigt die
|
||||
aktuell lebenden Profilidentitäten; das gelöschte/umbenannte Verzeichnis wird
|
||||
nicht als zusätzlicher Bot gezählt und wurde nicht wieder angelegt.
|
||||
|
||||
**Die Konfigurationsreparaturen sind ausgeführt. Ein Hermes-/Gateway-Update ist
|
||||
nicht ausgeführt und benötigt Michaels separates Go.** Die npm-Befunde bleiben
|
||||
bis zur tatsächlich geprüften Aktualisierung offen. Eine grüne Einstellungen-
|
||||
prüfung ist weder eine Sicherheitsattestation noch die Ende-zu-Ende-Abnahme
|
||||
aller externen Werkzeuge. **Abschluss: 21/21 Profile, 428/428
|
||||
Konfigurationsprüfungen bestanden, kein Fehler.** Die abschließenden Zähler
|
||||
stehen in [`acceptance.json`](acceptance.json).
|
||||
|
||||
## Ausgeführte Korrekturen
|
||||
|
||||
1. **API-Rechte rollenbezogen gespeichert.** i-doit, MIDAS, Jonathan, NETVS und
|
||||
William besitzen nun ausdrücklich konfigurierte `api_server`-Listen aus
|
||||
ihrem bestehenden CLI-Rollenumfang plus Vision. Die zuvor implizit
|
||||
freigegebenen zusätzlichen Terminal-/Datei-/Code-/Browser-/Delegations-
|
||||
werkzeuge wurden nicht pauschal übernommen. Das neue DNS-Profil wurde
|
||||
ebenfalls auf seine vorhandenen vier MCPs sowie Clarify, Memory und Vision
|
||||
begrenzt. Die tatsächlichen Resolver, nicht nur die YAML-Felder, wurden
|
||||
nachgeprüft. Die fünf ursprünglichen Profile und DNS behalten ihre
|
||||
unterschiedlichen fachlichen Rechte.
|
||||
2. **Vision in allen gespeicherten Oberflächen freigegeben.** Die fünf
|
||||
ursprünglichen Lücken im Bot-/CLI-Pfad sind geschlossen. Bei acht
|
||||
KIT-DeepSeek-Profilen ist zusätzlich die bereits vorhandene Athena-Verbindung
|
||||
als Vision-Auxiliary mit `flash-next-basalt` ausdrücklich ausgewählt, statt
|
||||
auf eine nicht vorhandene OpenRouter-Konfiguration zurückzufallen. Ihre
|
||||
Chat-Modelle bleiben unverändert. Der separate Probe bestätigt für alle
|
||||
aktuell lebenden Profile einen auflösbaren Vision-Client; es wurde kein
|
||||
echtes Bild zur Inferenz geschickt. `input_mode=text` bei einem Text-Chat
|
||||
schaltet das separate Bildanalysewerkzeug nicht aus.
|
||||
3. **Dateirechte gehärtet.** Die beiden abweichenden `config.yaml` in default
|
||||
und i-doit sind jetzt 0600. Alle aktuellen Profilkonfigurationen sowie die
|
||||
vorhandenen `.env`/`auth.json` bestehen die Metadatenprüfung der privaten
|
||||
Rechte. Zugangsdaten wurden weder ausgegeben noch kopiert oder rotiert.
|
||||
Gemeinsame UID 99/GID 100 bedeutet weiterhin keine OS-Sandbox zwischen Bots.
|
||||
4. **Veraltete Plattformzuordnung korrigiert.** MIDAS' nichtkanonischer
|
||||
`platform_toolsets.gateway`-Schlüssel wurde entfernt. In betroffenen
|
||||
deaktivierten Google-Chat-/Teams-Plattformen wurden alte `hermes-*`-
|
||||
Kompositnamen durch die tatsächlichen Rollenwerkzeuge ersetzt. Diese
|
||||
installierten Plugin-Plattformen sind gültig; kein Adapter wurde aktiviert.
|
||||
5. **Rollenbeschreibungen abgeglichen.** NETVS' veraltete Trockenlauf-Beschreibung
|
||||
entspricht jetzt seiner bestehenden SOUL: reale, konkret beauftragte
|
||||
NETDB-Änderungen sind zulässig. Es wurde keine NETDB-Operation ausgeführt.
|
||||
GG3653-01 besitzt jetzt eine konkrete deutschsprachige SSH-Rolle für seinen
|
||||
vorhandenen Zielrechner, ohne neue Werkzeuge oder pauschales Betriebs-Go.
|
||||
6. **Williams automatische Plugin-Erweiterung abgefangen.** Ein frischer
|
||||
API-Resolver hatte trotz gespeicherter Liste zusätzlich `athena_audio`
|
||||
ergänzt. Das vorhandene, für diese Rolle nicht ausgewählte Toolset wurde
|
||||
mit dem offiziellen Plattformschreiber ausdrücklich deaktiviert. Die
|
||||
abschließende CLI/API-Prüfung stimmt überein; Sprachdienste, Sprachausgabe-
|
||||
vorlieben und Modellbelegung wurden dadurch nicht umgestellt.
|
||||
7. **Cron Bulletin korrekt paketiert.** Dem bereits installierten, UI-only
|
||||
Plugin in Williams Profil fehlte der Python-Verzeichniseinstieg. Der
|
||||
minimale [`register(ctx)`-Adapter](cron-bulletin-entrypoint.py) erfüllt den
|
||||
bestehenden Hermes-Vertrag; die eigentliche Dashboard-API und Desktop-
|
||||
Implementierung bleiben unverändert. Plugin Doctor bestätigt Import und
|
||||
Registrierung mit null Modellwerkzeugen und null Hooks. Keine neuen
|
||||
Scheduler, Hintergrundprozesse oder Dienste werden registriert.
|
||||
8. **Nur ungenutzten uv-Paketcache bereinigt.** Das offizielle `uv cache prune`
|
||||
wurde als Datenbesitzer UID 99, mit begrenztem Lock-Warten und ohne `--force`
|
||||
auf `/opt/data/cache/uv` ausgeführt. uv meldete 65.628 entfernte Dateien und
|
||||
geschätzte 2,2 GiB. Der getrennte logische Größenvergleich ergab
|
||||
2.007.823.021 Bytes weniger; diese Werte sind nicht dieselbe Messgröße.
|
||||
Keine Modellgewichte, laufenden Python-Umgebungen oder Profilnutzdaten
|
||||
wurden als Cacheziel ausgewählt. Keine Handlöschung im uv-Cache.
|
||||
|
||||
Die Werkzeugkonfiguration wurde mit `hermes config set/unset` und `hermes tools
|
||||
enable/disable` geschrieben; `config.yaml` wurde nicht hand-editiert. Die
|
||||
jeweiligen Vorher-/Nachher-Vergleiche bestätigten erhaltene Modell- und
|
||||
MCP-Konfigurationen. Gespeicherte
|
||||
kanonische Chat-Modelloverrides, OAuth-Pools, Managed-Anbieter, TTS/STT,
|
||||
SSH-Ziele, Arbeitsordner, Zeitpläne und Benachrichtigungsabsichten wurden nicht
|
||||
zur Vereinheitlichung zurückgesetzt. Änderungen eines parallel bearbeiteten
|
||||
neuen Profils wurden nicht rückgängig gemacht.
|
||||
|
||||
## Bewusst nicht als erledigt ausgegeben
|
||||
|
||||
### npm-Sicherheitsbefunde: separates Update erforderlich
|
||||
|
||||
Die echten Audit-Ergebnisse zeigen `undici`- und `minimatch`-Befunde mit
|
||||
transitiven Folgemeldungen in Web- und TUI-Workspace. Bei der erneuten Abfrage
|
||||
meldete Web 1 hohen/6 moderate und TUI 1 hohen/1 moderaten Paketbefund. Die
|
||||
Workspace-Zahlen sind keine Summe unabhängiger Sicherheitslücken.
|
||||
|
||||
Der versionsgebunden geprüfte öffentliche Hermes-Stand
|
||||
`8112254f8a934626032579cae967b25b7795836d` enthält bereits `undici` 7.30.1 und
|
||||
für die TUI 6.29.1. Der hohe Web-Befund liegt in der Entwicklungsabhängigkeit
|
||||
von jsdom; die TUI besitzt zusätzlich eine direkte Runtime-Abhängigkeit. Eine
|
||||
konkrete Ausnutzbarkeit wurde nicht getestet. Der vorhandene `minimatch`
|
||||
10.2.6 im aktuellen Upstream-Lockfile liegt weiterhin unter der im Advisory
|
||||
geforderten 11.0.1; ein aktueller main-Checkout ist deshalb kein Beleg für null
|
||||
npm-Meldungen. Kein blindes `npm audit fix`, kein globaler Versionsoverride,
|
||||
keine Änderung von `/opt/hermes` und keine Mac-App-Patches.
|
||||
|
||||
Ein unterstütztes Gateway-/Image-Update muss separat freigegeben, gegen die
|
||||
aktuelle offizielle Installationsroute vorbereitet und nachweislich ohne
|
||||
Unterbrechung aktiver oder wartender Arbeiten durchgeführt werden. Fehlende
|
||||
Queue-Zähler oder ein gesunder HTTP-Endpunkt reichen nicht als Leerlaufbeleg.
|
||||
Erst danach erneuter npm-Audit und getrennte Gateway-/Client-Funktionsabnahme.
|
||||
|
||||
### Williams letzter Mail-Job-Abbruch
|
||||
|
||||
Der Morgencheck hat weiterhin seinen echten letzten Status `error` und
|
||||
Failure-Streak 1. Der gespeicherte Fehler kennzeichnet einen Gateway-Shutdown,
|
||||
nicht einen gemeldeten Authentifizierungsfehler. Der reguläre nächste Termin
|
||||
ist unverändert 4. November 2026, 05:30 CET. Weder Status noch Fehlerzähler
|
||||
wurden beschönigend gelöscht; keine Mailabfrage, manuelle Wiederholung oder
|
||||
Testzustellung wurde ausgelöst. Der nächste reguläre Erfolg ist noch nicht
|
||||
belegt. Insgesamt sieben bestehende William-Jobs bleiben erhalten.
|
||||
|
||||
### Nicht durch Konfigurationschecks bewiesen
|
||||
|
||||
Keine Modell-, Bild-, Sprach-, Telefonie- oder MCP-Inferenz-/Funktionstests;
|
||||
keine Benachrichtigungen; keine Kontakte zu den SSH-Zielen der Bots oder native
|
||||
Mac-Abnahme.
|
||||
Kein Gateway-, Container-, Host- oder Modellneustart. Keine Modellumschaltung,
|
||||
keine Übernahme historischer Anna/TTS-Arbeit. Das absolute VPN-Verbot blieb
|
||||
unverändert, einschließlich der ausgeschlossenen Dateien, Pfade und Container.
|
||||
Laufende Agenten wurden nicht zurückgesetzt. Frische Resolver belegen die
|
||||
gespeicherten Freigaben, nicht eine erzwungene Erneuerung jedes bereits
|
||||
laufenden Werkzeugkatalogs mitten in einem Agentenlauf.
|
||||
|
||||
## Reproduzierbare Prüfung und tatsächliche Umgebung
|
||||
|
||||
[`audit.py`](audit.py) benutzt die installierte Live-Identitätsprüfung statt
|
||||
einer alten festen Profilanzahl. Jedes Profil wird in einem frischen Prozess
|
||||
über [`profile_probe.py`](profile_probe.py) aufgelöst. Der Ablauf schreibt
|
||||
mittlere Batches dauerhaft als JSONL, liest die gesicherten Ergebnisse zurück,
|
||||
prüft exakte Abdeckung und bemerkt Änderungen des Rosters während des Laufs.
|
||||
Eine neue unbekannte Rolle bleibt ein Fehler bis zur bewussten Klassifizierung.
|
||||
Historische Screen-/Browser-/Hook-Annahmen werden nicht auf absichtlich enge
|
||||
Rollen zurückgesetzt. Die vollständige UI-Registry wird nicht importiert.
|
||||
|
||||
Ausführung auf dem NAS, installierter Hermes-Code `/opt/hermes`, Python 3.14.9,
|
||||
Datenbesitzer 99:100, Managed-Verzeichnis `/opt/data/managed`:
|
||||
|
||||
```sh
|
||||
PYTHONPATH=/opt/hermes PYTHONDONTWRITEBYTECODE=1 python3 -B \
|
||||
docs/maintenance/hermes-fleet-repair-2026-11-03/audit.py \
|
||||
--data-root /opt/data --output /ABSOLUTER/EIGENER/NEUER/REPORTPFAD --workers 2
|
||||
|
||||
python3 -B docs/maintenance/hermes-fleet-repair-2026-11-03/test_audit.py
|
||||
|
||||
PYTHONPATH=/opt/hermes PYTHONDONTWRITEBYTECODE=1 python3 -B \
|
||||
docs/maintenance/hermes-fleet-repair-2026-11-03/vision_probe.py idoit-bot
|
||||
```
|
||||
|
||||
Pro Lauf einen neuen eigenen Ausgabepfad benutzen und genügend Laufzeit
|
||||
vorsehen; einzelne Profile haben 45 Sekunden Timeout. Ein abgebrochener Lauf
|
||||
mit Teil-JSONL ist **kein** vollständiges grünes Ergebnis. In dieser Arbeit
|
||||
wurde ein Wiederholungslauf nach 180 Sekunden mit 18 erfolgreichen
|
||||
Profilresultaten abgebrochen; er ist nicht die abschließende Abnahme.
|
||||
Ein vorheriger vollständiger Lauf erkannte die neue DNS-Identität korrekt als
|
||||
noch nicht klassifiziert, statt einen unbekannten Bot stillschweigend zu zählen.
|
||||
|
||||
Die eingesetzten Herstellerleser dürfen ihre normalen begrenzten
|
||||
Known-good-Konfigurationscaches aktualisieren. Der Audit verändert keine
|
||||
Profileinstellungen. Private Metadaten-Ausgaben bleiben im eigenen Reportpfad,
|
||||
nicht in Git; der veröffentlichte Abnahmenachweis enthält nur sichere Zähler.
|
||||
Credentialwerte und Credential-Hashes gehören nicht in Ergebnisdateien.
|
||||
|
||||
Die Veröffentlichung wurde zusätzlich mit der unveränderten synthetischen
|
||||
Deck-Rootsuite geprüft: **784 Tests bestanden** in der eigenen Projektumgebung
|
||||
(NumPy 2.5.4, cryptography 50.0.2). Die zehn Regressionstests des neuen
|
||||
Auditauswerters bestanden ebenfalls. Geänderte Python-/JSON-Dateien und lokale
|
||||
Markdown-Links wurden geprüft; die Prüfung der expliziten Veröffentlichungs-
|
||||
dateien auf typische Geheimnisformate hatte keine Treffer. Das ist keine
|
||||
vollständige mathematische Garantie der Geheimnisfreiheit.
|
||||
|
||||
Die API-Tests des vorhandenen Cron-Bulletin-Plugins liefen mit pytest 9.2.0 und
|
||||
FastAPI 0.133.1 in der eigenen Projekt-Testumgebung, nicht durch Installation
|
||||
in Hermes' Python: 16 Python-Tests bestanden; zusätzlich 6 vorhandene Node-Tests.
|
||||
Der Plugin-Doctor wurde mit `hermes -p william-t-time plugins doctor
|
||||
cron-bulletin --ci` tatsächlich ausgeführt. Das beweist Paket/Backend und
|
||||
synthetische UI-Logik, nicht die Darstellung im nativen Mac-Client.
|
||||
|
||||
## Installation, Update und Wiederherstellung
|
||||
|
||||
Dies sind NAS-Hermes-Wartungswerkzeuge, keine neue Laufzeitabhängigkeit des
|
||||
nativen Athena Decks. Auf einem nativen Hermes die zu dessen Installation
|
||||
gehörende Python-Umgebung und den passenden Modul-/Datenpfad angeben; Docker
|
||||
ist keine Voraussetzung des Auditprogramms. Der kleine Vision-Probe ist
|
||||
bewusst an den hier dokumentierten NAS-Datenpfad gebunden und nicht als
|
||||
plattformunabhängiger Installer ausgegeben.
|
||||
|
||||
Bei Hermes-Wiederherstellung müssen der persistente Managed Scope, alle
|
||||
aktuellen Profilverzeichnisse samt privatem Zustand, Rollen, Pluginpaketen und
|
||||
Berechtigungen sowie die bestehende zentrale Authentifizierung aus der
|
||||
verschlüsselten Sicherung zurückkehren. Die Cron-Bulletin-Ergänzung liegt im
|
||||
Plugin-Verzeichnis und ist damit Teil dieses privaten persistenten Zustands;
|
||||
[`cron-bulletin-entrypoint.py`](cron-bulletin-entrypoint.py) erhält den nicht
|
||||
geheimen Adapter zusätzlich reproduzierbar in Git. Nur für das bereits
|
||||
vorhandene UI-Paket mit passendem Manifest verwenden, nicht als neues Plugin
|
||||
oder Dienst installieren. Nach Restore Plugin Doctor und vollständigen Audit
|
||||
wiederholen. Ein frischer Host mit vollständigem verschlüsseltem Restore wurde
|
||||
hier nicht aufgebaut oder Ende-zu-Ende geprüft.
|
||||
|
||||
Es wurden keine zusätzlichen Credential-Backups angelegt. Für einen Rückfall
|
||||
nur die konkret geänderten Werkzeug-/Vision-Auswahlen über offizielle
|
||||
Schreiber nach dem gesicherten Soll zurücknehmen; enge Rollen nicht auf den
|
||||
breiten API-Default zurücksetzen und Dateirechte nicht wieder lockern.
|
||||
Ein späteres Code-/Image-Update braucht einen eigenen Versions-/Rückfallplan.
|
||||
|
||||
## Quellen
|
||||
|
||||
- [Bot Mode](https://hermes-agent.nousresearch.com/docs/user-guide/bot-mode)
|
||||
- [Profile](https://hermes-agent.nousresearch.com/docs/user-guide/profiles)
|
||||
- [Multiplex-Gateway](https://hermes-agent.nousresearch.com/docs/user-guide/multi-profile-gateways)
|
||||
- [Managed Scope](https://hermes-agent.nousresearch.com/docs/user-guide/managed-scope)
|
||||
- [Sicherheit](https://hermes-agent.nousresearch.com/docs/user-guide/security)
|
||||
- [Versionsgebundenes Upstream-Lockfile](https://raw.githubusercontent.com/NousResearch/hermes-agent/8112254f8a934626032579cae967b25b7795836d/package-lock.json)
|
||||
- [minimatch-Advisory](https://github.com/advisories/GHSA-g3hv-75wg-m249)
|
||||
- [undici-Advisory](https://github.com/advisories/GHSA-4qv8-2p9j-2685)
|
||||
- [Offizielle uv-Cache-Sicherheit und Prune](https://raw.githubusercontent.com/astral-sh/uv/main/docs/concepts/cache.md)
|
||||
|
||||
Die Originalprüfung und detaillierten privaten Nachweise liegen im eigenen
|
||||
NAS-Workspace unter `workspace/reports/hermes-fleet-2026-11-03/` und
|
||||
`workspace/reports/hermes-fleet-fix-2026-11-03/`. Historische Prüfberichte bleiben
|
||||
historisch; diese Korrektur ist kein rückwirkendes Umschreiben ihrer Ergebnisse.
|
||||
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"generated_at": "2026-11-03T23:15:07.597892+01:00",
|
||||
"scope": "settings, role and resolver metadata; not inference, delivery or native-client acceptance",
|
||||
"profiles_expected": 21,
|
||||
"profiles_checked": 21,
|
||||
"checks": 428,
|
||||
"passed": 428,
|
||||
"failed": [],
|
||||
"vision_clients_resolved": 21,
|
||||
"image_inference_performed": false,
|
||||
"audit_regression_tests_passed": 10,
|
||||
"root_synthetic_tests_passed": 784,
|
||||
"cron_bulletin_python_tests_passed": 16,
|
||||
"cron_bulletin_node_tests_passed": 6,
|
||||
"plugin_doctor": "passed; 0 tools, 0 hooks",
|
||||
"profile_results": [
|
||||
{
|
||||
"profile": "athena-deck",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "belanna-storres",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "default",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "dns-netbot",
|
||||
"checks_passed": 21,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "horizon-dev",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "idoit-bot",
|
||||
"checks_passed": 21,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "jean-luc-picode",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "jonathan-arrcher",
|
||||
"checks_passed": 21,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "midas-phalanx",
|
||||
"checks_passed": 21,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "netvs-bot",
|
||||
"checks_passed": 21,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "pruefungs-vdi-dev",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "retro-la-forge",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "seven-of-heim",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "solid-crafter",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "ssh-horizon-ecc7d706",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "ssh-infvhost-1-5b1589d3",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "ssh-infvhost-2-731791df",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "ssh-mikesmacbookprom4-1cdce964",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "ssh-pool-vdi-ff978f02",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "ssh-scc-gg3653-01-76dcf38d",
|
||||
"checks_passed": 20,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
},
|
||||
{
|
||||
"profile": "william-t-time",
|
||||
"checks_passed": 21,
|
||||
"config_private": true,
|
||||
"vision_all_configured_platforms": true,
|
||||
"api_extra_toolsets": []
|
||||
}
|
||||
],
|
||||
"fleet_checks_passed": 2,
|
||||
"separate_security_update_required": true,
|
||||
"restart_performed": false,
|
||||
"native_client_acceptance_performed": false
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
"""NAS Hermes settings audit; fresh profile processes, no inference or tool execution.
|
||||
|
||||
Run with the installed Hermes Python and PYTHONPATH. Output contains selected
|
||||
configuration/role metadata only. The official config reader may update its
|
||||
bounded last-known-good cache. This is not an end-to-end feature/security audit.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from datetime import datetime
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
REVIEWED_ROLES = {
|
||||
"default": "General assistant",
|
||||
"athena-deck": "Athena Deck development and operations",
|
||||
"belanna-storres": "Unraid and storage",
|
||||
"horizon-dev": "HORIZON development; no production installation",
|
||||
"idoit-bot": "Read-only CMDB via its selected MCP",
|
||||
"jean-luc-picode": "General coding",
|
||||
"jonathan-arrcher": "Media services and conversion",
|
||||
"midas-phalanx": "SIP communications",
|
||||
"dns-netbot": "DNS, domains, proxies and certificates via four selected MCPs",
|
||||
"netvs-bot": "NETDB; concretely assigned writes permitted",
|
||||
"pruefungs-vdi-dev": "VDI development; no production installation",
|
||||
"retro-la-forge": "Retro computing",
|
||||
"seven-of-heim": "Home Assistant; preserve positive MCP filters",
|
||||
"solid-crafter": "CAD; preserve current selected MCPs",
|
||||
"ssh-horizon-ecc7d706": "Assigned HORIZON server",
|
||||
"ssh-infvhost-1-5b1589d3": "Assigned INFvHost 1",
|
||||
"ssh-infvhost-2-731791df": "Assigned INFvHost 2",
|
||||
"ssh-mikesmacbookprom4-1cdce964": "Assigned Mac client",
|
||||
"ssh-pool-vdi-ff978f02": "Assigned VDI infrastructure server",
|
||||
"ssh-scc-gg3653-01-76dcf38d": "Assigned SCC-GG3653-01",
|
||||
"william-t-time": "User-authorized schedules and routines",
|
||||
}
|
||||
RESTRICTED = {
|
||||
"idoit-bot", "jonathan-arrcher", "midas-phalanx", "dns-netbot",
|
||||
"netvs-bot", "william-t-time",
|
||||
}
|
||||
|
||||
|
||||
def evaluate_profiles(rows: list[dict]) -> list[dict]:
|
||||
"""Evaluate actual resolver results, not just saved settings' presence."""
|
||||
checks = []
|
||||
default = next((row for row in rows if row["profile"] == "default"), None)
|
||||
for row in rows:
|
||||
name = row["profile"]
|
||||
|
||||
def add(check: str, passed: bool) -> None:
|
||||
checks.append({"profile": name, "check": check, "passed": bool(passed)})
|
||||
|
||||
if row.get("probe_error"):
|
||||
add("profile_probe", False)
|
||||
continue
|
||||
files = row["files"]
|
||||
tools = row["tools"]
|
||||
cli = set(tools.get("cli", []))
|
||||
api = set(tools.get("api_server", []))
|
||||
add("reviewed_role", name in REVIEWED_ROLES)
|
||||
add("role_instructions_present", bool(row.get("role_intro", "").strip()))
|
||||
add("manufacturer_structure_validation", not row["config_validation"])
|
||||
add("bot_metadata_present", row["has_bot_metadata"])
|
||||
add("bot_mode_protocol", row["bot_mode_protocol"] is True)
|
||||
# Titles are not the canonical-chat resolver. A retained ancestor is not
|
||||
# permission to delete history merely to force a fixed title count.
|
||||
add("bot_chat_record_exists", row["session_metadata"].get("bot_chat_count", 0) >= 1)
|
||||
add("config_private", files["config.yaml"]["mode"] == "0o600")
|
||||
for filename in (".env", "auth.json"):
|
||||
add(filename + "_private_if_present", filename not in files or files[filename]["mode"] == "0o600")
|
||||
add("smart_approvals", (row.get("approvals") or {}).get("mode") == "smart")
|
||||
add("secret_redaction", row["redact_secrets"] is True)
|
||||
add("configured_hooks_approved", row["all_hooks_approved"])
|
||||
add("canonical_platform_keys", not row["noncanonical_platform_keys"])
|
||||
add("vision_cli", "vision" in cli)
|
||||
add("vision_api", "vision" in api)
|
||||
add("vision_all_configured_platforms", bool(tools) and all("vision" in values for values in tools.values()))
|
||||
add("api_no_extra_toolsets", api <= cli)
|
||||
if name in RESTRICTED:
|
||||
add("restricted_api_matches_cli", api == cli)
|
||||
terminal = row["terminal"]
|
||||
if terminal.get("backend", "local") == "local":
|
||||
add("local_workspace_exists", row["workspace_exists"] is True)
|
||||
else:
|
||||
add("assigned_ssh_target_present", terminal.get("backend") == "ssh" and bool(terminal.get("ssh_host")))
|
||||
add("server_side_voice_relay", row["voice"].get("client_direct") is False)
|
||||
if default is not None:
|
||||
add("shared_speech_routes", row["speech"] == default["speech"])
|
||||
return checks
|
||||
|
||||
|
||||
def live_profiles(root: Path) -> list[str]:
|
||||
from hermes_constants import named_profile_is_live
|
||||
|
||||
names = ["default"] if (root / "config.yaml").is_file() else []
|
||||
profiles = root / "profiles"
|
||||
if profiles.is_dir():
|
||||
names.extend(path.name for path in profiles.iterdir()
|
||||
if not path.name.startswith(".") and named_profile_is_live(path))
|
||||
return sorted(names)
|
||||
|
||||
|
||||
def probe_profile(name: str, root: Path) -> dict:
|
||||
home = root if name == "default" else root / "profiles" / name
|
||||
env = dict(os.environ, HERMES_HOME=str(home), HERMES_PROFILE=name,
|
||||
PYTHONDONTWRITEBYTECODE="1")
|
||||
try:
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-B", str(Path(__file__).with_name("profile_probe.py")), name, str(root)],
|
||||
capture_output=True, text=True, timeout=45, env=env,
|
||||
)
|
||||
if result.returncode:
|
||||
return {"profile": name, "probe_error": "exit_" + str(result.returncode)}
|
||||
lines = [line for line in result.stdout.splitlines() if line.startswith("{")]
|
||||
row = json.loads(lines[-1])
|
||||
if row.get("profile") != name:
|
||||
raise ValueError("Wrong profile result")
|
||||
return row
|
||||
except (OSError, ValueError, IndexError, subprocess.TimeoutExpired) as exc:
|
||||
# Never echo arbitrary subprocess diagnostics or credential-related data.
|
||||
return {"profile": name, "probe_error": type(exc).__name__}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--data-root", type=Path, default=Path("/opt/data"))
|
||||
parser.add_argument("--output", type=Path, required=True)
|
||||
parser.add_argument("--workers", type=int, choices=range(1, 4), default=3)
|
||||
args = parser.parse_args()
|
||||
root = args.data_root.resolve()
|
||||
output = args.output.resolve()
|
||||
excluded = (Path("/vpn"), Path("/mnt/nvme-storage/appdata/OpenVPN-KIT"))
|
||||
if any(path == banned or path.is_relative_to(banned)
|
||||
for path in (root, output) for banned in excluded):
|
||||
parser.error("Excluded input/output root")
|
||||
# Match the actual data owner before any config reader can maintain caches.
|
||||
owner = root.stat()
|
||||
if os.geteuid() == 0 and owner.st_uid:
|
||||
os.setgroups([])
|
||||
os.setgid(owner.st_gid)
|
||||
os.setuid(owner.st_uid)
|
||||
os.umask(0o077)
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
roster = live_profiles(root)
|
||||
rows = []
|
||||
with (output / "profiles.jsonl").open("w") as stream:
|
||||
with ThreadPoolExecutor(max_workers=args.workers) as pool:
|
||||
futures = [pool.submit(probe_profile, name, root) for name in roster]
|
||||
for future in as_completed(futures):
|
||||
row = future.result()
|
||||
rows.append(row)
|
||||
stream.write(json.dumps(row, ensure_ascii=False) + "\n")
|
||||
stream.flush()
|
||||
# Aggregate from saved evidence; do not count parallel completion messages.
|
||||
rows = [json.loads(line) for line in (output / "profiles.jsonl").read_text().splitlines()]
|
||||
by_name = {row["profile"]: row for row in rows}
|
||||
rows = [by_name[name] for name in sorted(by_name)]
|
||||
current = live_profiles(root)
|
||||
checks = evaluate_profiles(rows)
|
||||
checks.extend([
|
||||
{"profile": "fleet", "check": "exact_initial_roster_coverage", "passed": len(rows) == len(roster) and set(by_name) == set(roster)},
|
||||
{"profile": "fleet", "check": "roster_stable_during_audit", "passed": roster == current},
|
||||
])
|
||||
failed = [check for check in checks if not check["passed"]]
|
||||
summary = {
|
||||
"generated_at": datetime.now().astimezone().isoformat(),
|
||||
"scope": "settings, role and resolver metadata; not inference, delivery or native-client acceptance",
|
||||
"profiles_expected": len(roster), "profiles_checked": len(rows),
|
||||
"profiles": sorted(by_name), "checks": len(checks),
|
||||
"passed": len(checks) - len(failed), "failed": failed,
|
||||
}
|
||||
(output / "checks.json").write_text(json.dumps(checks, indent=2) + "\n")
|
||||
(output / "summary.json").write_text(json.dumps(summary, indent=2) + "\n")
|
||||
print(json.dumps(summary, ensure_ascii=False))
|
||||
return 1 if failed else 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,11 @@
|
||||
"""Hermes entry point for the existing UI-only Cron Bulletin package.
|
||||
|
||||
Hermes mounts dashboard/plugin_api.py and the unchanged desktop contribution
|
||||
through its extension loaders. This package intentionally contributes no model
|
||||
tools, event hooks, schedulers, background workers or services.
|
||||
"""
|
||||
|
||||
|
||||
def register(ctx):
|
||||
"""Complete directory-plugin discovery; API/UI mounting is host-owned."""
|
||||
return None
|
||||
@@ -0,0 +1,88 @@
|
||||
"""Read-only, metadata-only per-profile settings/role probe; no model or MCP calls."""
|
||||
import json, os, re, sqlite3, stat, sys
|
||||
from pathlib import Path
|
||||
ROOT=Path(sys.argv[2] if len(sys.argv)>2 else '/opt/data').resolve()
|
||||
if any(ROOT==p or ROOT.is_relative_to(p) for p in (Path('/vpn'),Path('/mnt/nvme-storage/appdata/OpenVPN-KIT'))):
|
||||
raise SystemExit('Excluded data root')
|
||||
if not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*',sys.argv[1]):
|
||||
raise SystemExit('Invalid profile identifier')
|
||||
home=ROOT if sys.argv[1]=='default' else ROOT/'profiles'/sys.argv[1]
|
||||
owner=home.stat()
|
||||
if os.geteuid()==0 and owner.st_uid:
|
||||
os.setgroups([]);os.setgid(owner.st_gid);os.setuid(owner.st_uid)
|
||||
os.environ['HERMES_HOME']=str(home)
|
||||
os.environ['HERMES_PROFILE']=sys.argv[1]
|
||||
os.environ['PYTHONDONTWRITEBYTECODE']='1'
|
||||
import hermes_yaml as yaml
|
||||
from hermes_constants import set_hermes_home_override
|
||||
set_hermes_home_override(home)
|
||||
from agent.secret_scope import build_profile_secret_scope,set_secret_scope
|
||||
scope=build_profile_secret_scope(home);set_secret_scope(scope,profile_home=str(home))
|
||||
from hermes_cli.config import load_config_readonly,validate_config_structure
|
||||
from hermes_cli.tools_config import _get_platform_tools,PLATFORMS
|
||||
# Installed but currently disabled plugin platforms retain role-scoped settings.
|
||||
VALID_PLATFORMS=set(PLATFORMS)|{'google_chat','teams'}
|
||||
from agent.shell_hooks import allowlisted_pairs
|
||||
from hermes_cli.profile_channels import shared_channel_credentials
|
||||
raw=yaml.safe_load((home/'config.yaml').read_text()) or {}
|
||||
cfg=load_config_readonly();agent=cfg.get('agent') or {};term=cfg.get('terminal') or {}
|
||||
meta=yaml.safe_load((home/'profile.yaml').read_text()) if (home/'profile.yaml').is_file() else {}
|
||||
meta=meta or {};ui=(meta.get('ui_meta') or {}).get('hermes-bots') or {}
|
||||
text=(home/'SOUL.md').read_text() if (home/'SOUL.md').is_file() else ''
|
||||
# Only standing-role instructions, not private memories or conversation content.
|
||||
role_lines=[s for s in text.splitlines() if s.strip() and not s.lstrip().startswith('#')]
|
||||
policy_lines=[s[:350] for s in role_lines if re.search(r'only|ausschlie|niemals|never|restart|neustart|freigabe|approval|read.only|lesend|vpn|bot.mode|gateway|profil|project|projekt|aufgabe',s,re.I)]
|
||||
files={}
|
||||
for n in ('config.yaml','.env','auth.json','SOUL.md','profile.yaml','state.db','shell-hooks-allowlist.json'):
|
||||
p=home/n
|
||||
if p.is_file():
|
||||
s=p.stat();files[n]={'mode':oct(stat.S_IMODE(s.st_mode)),'uid':s.st_uid,'gid':s.st_gid,'bytes':s.st_size}
|
||||
platforms=sorted({'cli','api_server'}|set((raw.get('platform_toolsets') or {})))
|
||||
resolved={p:sorted(_get_platform_tools(cfg,p)) for p in platforms if p in VALID_PLATFORMS}
|
||||
invalid_platforms=[p for p in platforms if p not in VALID_PLATFORMS]
|
||||
mcp={}
|
||||
for k,v in (cfg.get('mcp_servers') or {}).items():
|
||||
if not isinstance(v,dict):continue
|
||||
filters=v.get('tools') or {};mcp[k]={'enabled':v.get('enabled',True),'include':filters.get('include'),'exclude':filters.get('exclude'),'transport':'url' if v.get('url') else 'stdio' if v.get('command') else 'unknown'}
|
||||
hooks=cfg.get('hooks') or {};pairs={(ev,x.get('command')) for ev,items in hooks.items() if isinstance(items,list) for x in items if isinstance(x,dict)}
|
||||
allowed=allowlisted_pairs()
|
||||
sessions={}
|
||||
p=home/'state.db'
|
||||
if p.is_file():
|
||||
with sqlite3.connect('file:'+str(p)+'?mode=ro',uri=True) as db:
|
||||
tables={r[0] for r in db.execute("SELECT name FROM sqlite_master WHERE type='table'")}
|
||||
if 'sessions' in tables:
|
||||
cols={r[1] for r in db.execute('PRAGMA table_info(sessions)')}
|
||||
sessions['schema_columns']=sorted(cols)
|
||||
if 'title' in cols:
|
||||
sessions['bot_chat_count']=db.execute("SELECT count(*) FROM sessions WHERE title='Bot Chat'").fetchone()[0]
|
||||
if 'source' in cols:sessions['source_counts']=dict(db.execute('SELECT source,count(*) FROM sessions GROUP BY source'))
|
||||
# Select only safety flags if explicit session columns exist; never transcripts.
|
||||
if 'yolo_mode' in cols:sessions['yolo_session_count']=db.execute('SELECT count(*) FROM sessions WHERE yolo_mode=1').fetchone()[0]
|
||||
cron=home/'cron/jobs.json';cron_info=[]
|
||||
if cron.is_file():
|
||||
jobs=json.loads(cron.read_text()).get('jobs',[])
|
||||
cron_info=[{'id':j.get('id'),'name':j.get('name'),'enabled':j.get('enabled'),'state':j.get('state'),'deliver':j.get('deliver'),'failure_deliver':j.get('failure_deliver'),'last_status':j.get('last_status'),'failure_streak':j.get('failure_streak',0)} for j in jobs]
|
||||
r={
|
||||
'profile':sys.argv[1], 'config_validation':validate_config_structure(cfg),
|
||||
'display_name':meta.get('display_name'),'description':meta.get('description'),'bot_metadata':{k:ui.get(k) for k in ('name','title','description','hidden')},'has_bot_metadata':bool(ui),
|
||||
'role_intro':'\n'.join(role_lines[:10])[:1700], 'role_policies':policy_lines[:18], 'soul_chars':len(text),
|
||||
'files':files,'model':{k:(cfg.get('model') or {}).get(k) for k in ('default','provider','context_length','supports_vision')},
|
||||
'terminal':{k:term.get(k) for k in ('backend','cwd','home_mode','ssh_host','ssh_user')},
|
||||
'workspace_exists':Path(term.get('cwd') or str(home/'workspace')).is_dir() if term.get('backend','local')=='local' else None,
|
||||
'tools':resolved,'noncanonical_platform_keys':invalid_platforms,
|
||||
'disabled_toolsets':agent.get('disabled_toolsets'), 'bot_mode_protocol':agent.get('bot_mode_protocol',True),'image_input_mode':agent.get('image_input_mode','auto'),
|
||||
'auxiliary':{k:{x:v.get(x) for x in ('provider','model','enabled')} for k,v in (cfg.get('auxiliary') or {}).items() if isinstance(v,dict)},
|
||||
'approvals':cfg.get('approvals'),'redact_secrets':(cfg.get('security') or {}).get('redact_secrets',True),'redact_pii':(cfg.get('privacy') or {}).get('redact_pii',False),
|
||||
'command_allowlist_count':len(cfg.get('command_allowlist') or []),'hook_count':len(pairs),'all_hooks_approved':pairs<=allowed,
|
||||
'mcp':mcp,'shared_channel_credentials_with_default':shared_channel_credentials(home,ROOT) if home!=ROOT else [],
|
||||
'gateway_keys':sorted((cfg.get('gateway') or {}).keys()),'platforms_enabled':{k:v.get('enabled') for k,v in (cfg.get('platforms') or {}).items() if isinstance(v,dict)},
|
||||
'browser':{'headed':(cfg.get('browser') or {}).get('headed'),'engine':(cfg.get('browser') or {}).get('engine'),'auto_start':(cfg.get('bot_desktop') or {}).get('auto_start')},
|
||||
'voice':{k:(cfg.get('voice') or {}).get(k) for k in ('auto_tts','client_direct')},
|
||||
'speech':{t:{'provider':(cfg.get(t) or {}).get('provider'),'model':((cfg.get(t) or {}).get('openai') or {}).get('model')} for t in ('stt','tts')},
|
||||
'local_managed_copies':[k for k in ('stt','tts','providers') if k in raw],
|
||||
'memory_settings':{k:(cfg.get('memory') or {}).get(k) for k in ('memory_enabled','user_profile_enabled','provider','write_approval')},
|
||||
'session_metadata':sessions,'cron':cron_info,
|
||||
'plugins':{'enabled':(cfg.get('plugins') or {}).get('enabled'),'disabled':(cfg.get('plugins') or {}).get('disabled')},
|
||||
}
|
||||
with os.fdopen(os.dup(1),'wb') as out:out.write((json.dumps(r,ensure_ascii=False)+'\n').encode())
|
||||
@@ -0,0 +1,85 @@
|
||||
"""Synthetic regression fixtures for settings-audit decisions, never live services."""
|
||||
import copy
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
SPEC = importlib.util.spec_from_file_location("fleet_settings_audit", Path(__file__).with_name("audit.py"))
|
||||
assert SPEC is not None and SPEC.loader is not None
|
||||
AUDIT = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(AUDIT)
|
||||
|
||||
|
||||
def profile(name="idoit-bot"):
|
||||
return {
|
||||
"profile": name, "role_intro": "Explicit reviewed role.",
|
||||
"config_validation": [], "has_bot_metadata": True,
|
||||
"bot_mode_protocol": True, "session_metadata": {"bot_chat_count": 1},
|
||||
"files": {"config.yaml": {"mode": "0o600"}, "auth.json": {"mode": "0o600"}},
|
||||
"approvals": {"mode": "smart"}, "redact_secrets": True,
|
||||
"all_hooks_approved": True, "noncanonical_platform_keys": [],
|
||||
"tools": {"cli": ["memory", "vision"], "api_server": ["memory", "vision"]},
|
||||
"terminal": {"backend": "local"}, "workspace_exists": True,
|
||||
"voice": {"client_direct": False},
|
||||
"speech": {"stt": {"provider": "fixture"}, "tts": {"provider": "fixture"}},
|
||||
}
|
||||
|
||||
|
||||
def failures(*rows):
|
||||
return {entry["check"] for entry in AUDIT.evaluate_profiles(list(rows)) if not entry["passed"]}
|
||||
|
||||
|
||||
class SettingsAuditTests(unittest.TestCase):
|
||||
def test_scoped_configuration_passes(self):
|
||||
self.assertEqual(failures(profile()), set())
|
||||
|
||||
def test_detects_api_privilege_even_when_vision_is_enabled(self):
|
||||
row = profile()
|
||||
row["tools"]["api_server"].append("terminal")
|
||||
self.assertIn("api_no_extra_toolsets", failures(row))
|
||||
self.assertIn("restricted_api_matches_cli", failures(row))
|
||||
|
||||
def test_checks_all_configured_platforms(self):
|
||||
row = profile()
|
||||
row["tools"]["teams"] = ["memory"]
|
||||
self.assertIn("vision_all_configured_platforms", failures(row))
|
||||
|
||||
def test_detects_missing_cli_vision(self):
|
||||
row = profile()
|
||||
row["tools"]["cli"].remove("vision")
|
||||
self.assertIn("vision_cli", failures(row))
|
||||
|
||||
def test_detects_nonprivate_config_and_auth_modes(self):
|
||||
row = profile()
|
||||
row["files"]["config.yaml"]["mode"] = "0o644"
|
||||
row["files"]["auth.json"]["mode"] = "0o640"
|
||||
self.assertIn("config_private", failures(row))
|
||||
self.assertIn("auth.json_private_if_present", failures(row))
|
||||
|
||||
def test_new_profile_requires_role_review(self):
|
||||
self.assertIn("reviewed_role", failures(profile("unreviewed-profile")))
|
||||
|
||||
def test_retained_bot_chat_ancestor_is_not_history_failure(self):
|
||||
row = profile()
|
||||
row["session_metadata"]["bot_chat_count"] = 2
|
||||
self.assertNotIn("bot_chat_record_exists", failures(row))
|
||||
|
||||
def test_unapproved_hook_and_disabled_redaction_fail(self):
|
||||
row = profile()
|
||||
row["all_hooks_approved"] = False
|
||||
row["redact_secrets"] = False
|
||||
self.assertIn("configured_hooks_approved", failures(row))
|
||||
self.assertIn("secret_redaction", failures(row))
|
||||
|
||||
def test_profile_probe_failure_is_not_silently_skipped(self):
|
||||
self.assertEqual(failures({"profile": "idoit-bot", "probe_error": "TimeoutExpired"}), {"profile_probe"})
|
||||
|
||||
def test_detects_speech_route_drift(self):
|
||||
default = profile("default")
|
||||
row = copy.deepcopy(profile())
|
||||
row["speech"]["tts"]["provider"] = "different-fixture"
|
||||
self.assertIn("shared_speech_routes", failures(default, row))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,24 @@
|
||||
"""Resolve an image backend without making any inference request."""
|
||||
import json,os,sys
|
||||
from pathlib import Path
|
||||
home=Path('/opt/data') if sys.argv[1]=='default' else Path('/opt/data/profiles')/sys.argv[1]
|
||||
s=(home/'config.yaml').stat()
|
||||
if os.geteuid()==0:os.setgroups([]);os.setgid(s.st_gid);os.setuid(s.st_uid)
|
||||
os.environ['HERMES_HOME']=str(home)
|
||||
from hermes_constants import set_hermes_home_override
|
||||
from agent.secret_scope import build_profile_secret_scope,set_secret_scope
|
||||
set_hermes_home_override(home);set_secret_scope(build_profile_secret_scope(home),profile_home=str(home))
|
||||
from hermes_cli.config import load_config_readonly
|
||||
from hermes_cli.runtime_provider import resolve_runtime_provider
|
||||
from agent.auxiliary_client import aux_probe_mode,resolve_vision_provider_client
|
||||
from agent.image_routing import decide_image_input_mode
|
||||
cfg=load_config_readonly();m=cfg.get('model') or {}
|
||||
model=m.get('default')
|
||||
if not isinstance(model,str) or not model:
|
||||
raise SystemExit('Missing configured model identifier')
|
||||
route=resolve_runtime_provider(requested=m.get('provider'),target_model=model)
|
||||
route['model']=model
|
||||
with aux_probe_mode():
|
||||
p,c,vision_model=resolve_vision_provider_client(main_runtime=route)
|
||||
mode=decide_image_input_mode(route.get('provider',''),model,cfg,requested_provider=m.get('provider',''))
|
||||
print(json.dumps({'profile':sys.argv[1],'available':c is not None,'vision_provider':p,'vision_model':vision_model,'input_mode':mode}))
|
||||
Reference in new issue
Block a user