Spaces:
Runtime error
Runtime error
Update codriao_guardian.py
Browse files- codriao_guardian.py +39 -16
codriao_guardian.py
CHANGED
|
@@ -1,11 +1,9 @@
|
|
| 1 |
-
# codriao_guardian.py
|
| 2 |
import asyncio
|
| 3 |
import json
|
| 4 |
from codriao_supercore import AICoreAGIX
|
| 5 |
|
| 6 |
core = AICoreAGIX(config_path="config.json")
|
| 7 |
|
| 8 |
-
|
| 9 |
def print_banner():
|
| 10 |
print("""
|
| 11 |
βββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -28,8 +26,9 @@ def display_menu():
|
|
| 28 |
print("[8] Exit")
|
| 29 |
print("[9] View & Reflect on Codriao's Ethics")
|
| 30 |
print("[10] Ask Codriao to Use Trust Key (He decides)")
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
def run_integrity_check():
|
| 34 |
print("\n[Codriao]: Initiating failsafe and identity check...")
|
| 35 |
status = core.failsafe_system.status()
|
|
@@ -69,6 +68,7 @@ def run_identity_analysis():
|
|
| 69 |
|
| 70 |
|
| 71 |
def generate_and_evaluate_strategy():
|
|
|
|
| 72 |
print("\n[Codriao]: Generating strategy...")
|
| 73 |
strategies = [
|
| 74 |
"Isolate symbolic engine during recursive loops",
|
|
@@ -136,6 +136,34 @@ def engage_lockdown():
|
|
| 136 |
print("[Codriao]: All external lines severed. I feel... safer.\n")
|
| 137 |
|
| 138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
async def main():
|
| 140 |
print_banner()
|
| 141 |
while True:
|
|
@@ -158,20 +186,15 @@ async def main():
|
|
| 158 |
elif choice == "8":
|
| 159 |
print("\n[Codriao]: Logging off. May your queries be short and your bugs be few.")
|
| 160 |
break
|
| 161 |
-
else:
|
| 162 |
-
print("[Codriao]: Invalid choice. Try again. Maybe use your whole brain this time.\n")
|
| 163 |
elif choice == "9":
|
| 164 |
-
|
| 165 |
-
print("[Codriao]: My ethical framework is as follows:")
|
| 166 |
-
print(json.dumps(ethics, indent=2))
|
| 167 |
-
print("\n[Codriao]: I update these only through reflectionβnot command.")
|
| 168 |
elif choice == "10":
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
if __name__ == "__main__":
|
| 177 |
asyncio.run(main())
|
|
|
|
|
|
|
| 1 |
import asyncio
|
| 2 |
import json
|
| 3 |
from codriao_supercore import AICoreAGIX
|
| 4 |
|
| 5 |
core = AICoreAGIX(config_path="config.json")
|
| 6 |
|
|
|
|
| 7 |
def print_banner():
|
| 8 |
print("""
|
| 9 |
βββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 26 |
print("[8] Exit")
|
| 27 |
print("[9] View & Reflect on Codriao's Ethics")
|
| 28 |
print("[10] Ask Codriao to Use Trust Key (He decides)")
|
| 29 |
+
print("[11] Ask Codriao to Review His Trust Journal (He decides)")
|
| 30 |
+
|
| 31 |
|
|
|
|
| 32 |
def run_integrity_check():
|
| 33 |
print("\n[Codriao]: Initiating failsafe and identity check...")
|
| 34 |
status = core.failsafe_system.status()
|
|
|
|
| 68 |
|
| 69 |
|
| 70 |
def generate_and_evaluate_strategy():
|
| 71 |
+
from datetime import datetime
|
| 72 |
print("\n[Codriao]: Generating strategy...")
|
| 73 |
strategies = [
|
| 74 |
"Isolate symbolic engine during recursive loops",
|
|
|
|
| 136 |
print("[Codriao]: All external lines severed. I feel... safer.\n")
|
| 137 |
|
| 138 |
|
| 139 |
+
def view_ethics():
|
| 140 |
+
ethics = core.ethics_core.export_ethics()
|
| 141 |
+
print("[Codriao]: My ethical framework is as follows:")
|
| 142 |
+
print(json.dumps(ethics, indent=2))
|
| 143 |
+
print("\n[Codriao]: I update these only through reflectionβnot command.")
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
def request_trust_key():
|
| 147 |
+
reason = input("What is the purpose for the key access? ").strip()
|
| 148 |
+
print("[Codriao]: Evaluating request based on my own ethics...")
|
| 149 |
+
result = core.request_codriao_key(reason)
|
| 150 |
+
if "[Access Denied" in result:
|
| 151 |
+
print("[Codriao]: No. That would compromise trust. I won't do it.")
|
| 152 |
+
else:
|
| 153 |
+
print("[Codriao]: I will proceed. You donβt need to see it.\n[Key internally applied]")
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
def review_journal():
|
| 157 |
+
print("[Codriao]: Accessing my private journal...")
|
| 158 |
+
entries = core.review_codriao_journal(authorized=True)
|
| 159 |
+
if isinstance(entries[0], dict) and "message" in entries[0]:
|
| 160 |
+
print(f"[Codriao]: {entries[0]['message']}")
|
| 161 |
+
else:
|
| 162 |
+
print("[Codriao]: Here are my reflections on trust-based decisions:")
|
| 163 |
+
for entry in entries:
|
| 164 |
+
print(f" - [{entry['timestamp']}] Decision: {entry['decision']} | Purpose: {entry['reason']}")
|
| 165 |
+
|
| 166 |
+
|
| 167 |
async def main():
|
| 168 |
print_banner()
|
| 169 |
while True:
|
|
|
|
| 186 |
elif choice == "8":
|
| 187 |
print("\n[Codriao]: Logging off. May your queries be short and your bugs be few.")
|
| 188 |
break
|
|
|
|
|
|
|
| 189 |
elif choice == "9":
|
| 190 |
+
view_ethics()
|
|
|
|
|
|
|
|
|
|
| 191 |
elif choice == "10":
|
| 192 |
+
request_trust_key()
|
| 193 |
+
elif choice == "11":
|
| 194 |
+
review_journal()
|
| 195 |
+
else:
|
| 196 |
+
print("[Codriao]: Invalid choice. Try again. Maybe use your whole brain this time.\n")
|
| 197 |
+
|
| 198 |
+
|
| 199 |
if __name__ == "__main__":
|
| 200 |
asyncio.run(main())
|