33 lines
963 B
Python
33 lines
963 B
Python
#!/usr/bin/env python3
|
|
# spark_check.py - simple verification script for spark agent lane
|
|
# Returns 0 on success, nonzero on failure
|
|
import sys
|
|
import json
|
|
|
|
def main():
|
|
# Simple sanity check: verify we can load JSON and validate a path
|
|
test_data = {"status": "verified", "agent": "spark"}
|
|
|
|
# Verify we can write/read JSON
|
|
try:
|
|
json.dumps(test_data)
|
|
json.loads('{"test": "ok"}')
|
|
except Exception as e:
|
|
print(f"ERROR: JSON handling failed: {e}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
# Verify path is writable
|
|
import os
|
|
test_path = "/root/.hermes/wizard-outputs/spark/.spark_verified"
|
|
try:
|
|
with open(test_path, 'w') as f:
|
|
f.write("verified")
|
|
except Exception as e:
|
|
print(f"ERROR: Cannot write to working directory: {e}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
print("VERIFIED: spark agent lane working")
|
|
sys.exit(0)
|
|
|
|
if __name__ == "__main__":
|
|
main() |