spark: add hermes profile health checker script

This commit is contained in:
spark committed 2026-10-26 18:40:15 +00:00
1 parent b14921aa2e
commit e1b413ae67
1 file changed
+49
@@ -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())