47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Simple verification script that checks required paths exist.
|
|
Produces a dated result file.
|
|
"""
|
|
import os
|
|
import sys
|
|
import json
|
|
from datetime import datetime, timezone
|
|
|
|
# Required paths
|
|
REQUIRED_PATHS = {
|
|
"hermes_profiles_spark": "/root/.hermes/profiles/spark",
|
|
"wizard_outputs": "/root/.hermes/wizard-outputs",
|
|
"troupe_standup": "/root/troupe-standup",
|
|
}
|
|
|
|
# Measure each path
|
|
results = {
|
|
"timestamp_utc": datetime.now(timezone.utc).isoformat(),
|
|
"python_version": sys.version.split()[0],
|
|
"check_type": "path_existence"
|
|
}
|
|
|
|
results["paths"] = {}
|
|
all_exist = True
|
|
|
|
for name, path in REQUIRED_PATHS.items():
|
|
exists = os.path.isdir(path)
|
|
results["paths"][name] = {"path": path, "exists": exists}
|
|
if not exists:
|
|
all_exist = False
|
|
|
|
results["overall_result"] = "PASS" if all_exist else "FAIL"
|
|
|
|
# Print result
|
|
print(json.dumps(results, indent=2))
|
|
|
|
# Write to file
|
|
output_dir = "/root/.hermes/wizard-outputs/spark"
|
|
output_file = os.path.join(output_dir, "verification_result.json")
|
|
with open(output_file, "w") as f:
|
|
json.dump(results, f, indent=2)
|
|
|
|
print(f"\nResult written to: {output_file}")
|
|
|
|
sys.exit(0 if all_exist else 1) |