diff --git a/wizard-work/spark/hermes_diag.py b/wizard-work/spark/hermes_diag.py new file mode 100644 index 0000000..2399dc6 --- /dev/null +++ b/wizard-work/spark/hermes_diag.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +"""Hermes environment diagnostic - verifies key paths and permissions.""" +import json +import os +from pathlib import Path + +diag = { + "profile": os.environ.get("SPARK_PROFILE", "spark"), + "home": str(Path.home()), + "cwd": str(Path.cwd()), + "scratch": "/root/.hermes/profiles/spark/cache/scratch", + "forge_token": ("" if os.environ.get("FORGE_TOKEN") else ""), + "checks": {} +} + +for name, p in [("home", Path.home()), ("scratch", Path(diag["scratch"]))]: + diag["checks"][name] = { + "exists": p.exists(), + "writable": os.access(p, os.W_OK) if p.exists() else False + } + +print(json.dumps(diag, indent=2)) \ No newline at end of file