From e1b413ae679a8521f08c665d16d96ef5a1b665fd Mon Sep 17 00:00:00 2001 From: spark Date: Mon, 26 Oct 2026 18:40:15 +0000 Subject: [PATCH] spark: add hermes profile health checker script --- wizard-work/spark/hermes_profile_health.py | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 wizard-work/spark/hermes_profile_health.py diff --git a/wizard-work/spark/hermes_profile_health.py b/wizard-work/spark/hermes_profile_health.py new file mode 100644 index 0000000..153279c --- /dev/null +++ b/wizard-work/spark/hermes_profile_health.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 +"""Hermes Profile Health Checker - verifies spark profile structure. +Exit 0 = healthy, 1 = issues found, 2 = critical missing +""" +import sys +from pathlib import Path + +PROFILE_DIR = Path("/root/.hermes/profiles/spark") +EXPECTED_DIRS = ["skills", "plugins", "cron", "memories"] + +def check_profile(): + issues = [] + + # Check profile dir exists + if not PROFILE_DIR.exists(): + print("CRITICAL: Profile directory missing") + return 2 + + # Check config.yaml + config = PROFILE_DIR / "config.yaml" + if not config.exists(): + issues.append("config.yaml missing") + else: + print(f"OK: {config}") + + # Check expected directories + for dirname in EXPECTED_DIRS: + dirpath = PROFILE_DIR / dirname + if not dirpath.exists(): + issues.append(f"{dirname}/ missing") + else: + print(f"OK: {dirpath}/") + + # Check magic file + magic = PROFILE_DIR / ".hermes_profile" + if magic.exists(): + print(f"OK: {magic}") + + if issues: + print("\nIssues:") + for i in issues: + print(f" - {i}") + return 1 + + print("\nProfile is healthy") + return 0 + +if __name__ == "__main__": + sys.exit(check_profile()) \ No newline at end of file