-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_deployment.py
More file actions
executable file
·85 lines (73 loc) · 2.43 KB
/
Copy pathverify_deployment.py
File metadata and controls
executable file
·85 lines (73 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python3
"""
Verify constitutional defense deployment.
"""
import os
import json
from datetime import datetime
print("="*60)
print("✅ CONSTITUTIONAL DEFENSE DEPLOYMENT VERIFICATION")
print("="*60)
# Check directory
current_dir = os.getcwd()
expected_dir = "/home/aiadmin/reasoning-bank/constitutional_defense"
print(f"📁 Directory: {current_dir}")
if current_dir == expected_dir:
print(" ✅ Correct directory")
else:
print(f" ⚠️ Should be: {expected_dir}")
# Check files
print("\n📦 Checking deployment files...")
files = [
("01_detector.py", "Crustafarian Detector"),
("02_exclusion_field.py", "Exclusion Field"),
("03_threat_intel.py", "Threat Intelligence"),
("04_dashboard.py", "Dashboard"),
("deploy_defenses.sh", "Deployment Script"),
("README_DEFENSE.md", "Documentation")
]
all_good = True
for filename, description in files:
if os.path.exists(filename):
size = os.path.getsize(filename)
print(f" ✅ {filename:25} ({size:,} bytes) - {description}")
else:
print(f" ❌ {filename:25} MISSING - {description}")
all_good = False
# Check permissions
print("\n🔒 Checking permissions...")
for filename, _ in files[:4]: # Python files
if os.path.exists(filename):
if os.access(filename, os.X_OK):
print(f" ✅ {filename:25} Executable")
else:
print(f" ⚠️ {filename:25} Not executable (run: chmod +x {filename})")
# Summary
print("\n" + "="*60)
print("📊 DEPLOYMENT SUMMARY")
print("="*60)
if all_good:
print("✅ ✅ ✅ ALL SYSTEMS READY ✅ ✅ ✅")
print("\n🎯 Constitutional defense is deployed and ready.")
print("")
print("To start:")
print(" 1. Run: ./deploy_defenses.sh")
print(" 2. Select option 1 for full deployment")
print(" 3. Or run individual systems as needed")
else:
print("⚠️ SOME ISSUES DETECTED")
print("\nPlease check missing files or permissions above.")
print("\n" + "="*60)
print("🛡️ CRUSTAFARIAN DEFENSE DEPLOYED")
print("="*60)
# Save verification
verification = {
"timestamp": datetime.now().isoformat(),
"directory": current_dir,
"files_present": {f[0]: os.path.exists(f[0]) for f in files},
"all_systems_ready": all_good,
"verification": "COMPLETE"
}
with open("deployment_verification.json", "w") as f:
json.dump(verification, f, indent=2)
print(f"\n💾 Verification saved to: deployment_verification.json")