spark: add JSON validation checker script
This commit is contained in:
1 parent
8a6759133f
commit
95be810b85
1 file changed
+33
@@ -0,0 +1,33 @@
|
||||
#!/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()
|
||||
Reference in new issue
Block a user