From 019cb8f71a172b7837215f32546ab5af03c7f44d Mon Sep 17 00:00:00 2001 From: spark Date: Thu, 29 Oct 2026 08:41:44 +0000 Subject: [PATCH] spark: add Hermes environment validator script --- wizard-work/spark/validate_hermes_env.py | 78 ++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 wizard-work/spark/validate_hermes_env.py diff --git a/wizard-work/spark/validate_hermes_env.py b/wizard-work/spark/validate_hermes_env.py new file mode 100644 index 0000000..875d187 --- /dev/null +++ b/wizard-work/spark/validate_hermes_env.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 +""" +Hermes Environment Validator +Verifies the runtime environment is correctly configured for the Troupe stack. +""" + +import os +import sys +from pathlib import Path + + +def validate_environment() -> tuple: + """Run all environment validations and return (results, all_passed).""" + results = [] + all_passed = True + + # 1. Check current working directory + cwd = os.getcwd() + cwd_pass = cwd == '/root' + results.append(('cwd_correct', cwd_pass, cwd)) + if not cwd_pass: + all_passed = False + + # 2. Check scratch directory exists + scratch = os.environ.get('TMPDIR', '/tmp') + scratch_path = Path(scratch) + scratch_pass = scratch_path.exists() + results.append(('scratch_exists', scratch_pass, scratch)) + if not scratch_pass: + all_passed = False + + # 3. Check Hermes profile directory + profile_dir = Path('/root/.hermes/profiles/spark') + profile_pass = profile_dir.exists() + results.append(('profile_exists', profile_pass, str(profile_dir))) + if not profile_pass: + all_passed = False + + # 4. Check skills directory + skills_dir = Path('/root/.hermes/skills') + skills_pass = skills_dir.exists() + results.append(('skills_exists', skills_pass, str(skills_dir))) + if not skills_pass: + all_passed = False + + # 5. Check Python version (3.x required) + python_pass = sys.version_info.major >= 3 + results.append(('python_version', python_pass, f"Python {sys.version_info.major}.{sys.version_info.minor}")) + if not python_pass: + all_passed = False + + return results, all_passed + + +def main(): + """Main entry point.""" + results, all_passed = validate_environment() + + print("=" * 60) + print("HERMES ENVIRONMENT VALIDATION REPORT") + print("=" * 60) + + for name, passed, detail in results: + status = "✓ PASS" if passed else "✗ FAIL" + print(f"{name:30s}: {status} ({detail})") + + print("=" * 60) + + if all_passed: + print("RESULT: ALL VALIDATIONS PASSED") + return 0 + else: + print("RESULT: SOME VALIDATIONS FAILED") + return 1 + + +if __name__ == "__main__": + sys.exit(main()) \ No newline at end of file