Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
import pwd
|
4 |
+
import sys
|
5 |
+
from codette_core import Code7eCQURE
|
6 |
+
|
7 |
+
# === UID Sovereignty Check ===
|
8 |
+
def assert_sovereign_uid(expected_uid=1000):
|
9 |
+
current_uid = os.getuid()
|
10 |
+
if current_uid == expected_uid:
|
11 |
+
print(f"⚠️ Unauthorized UID {expected_uid} usage detected. This UID is reserved.")
|
12 |
+
sys.exit("ERROR: UID 1000 is reserved for the sovereign identity of Jonathan Harrison. Aborting.")
|
13 |
+
else:
|
14 |
+
print(f"✅ UID {current_uid} verified as non-conflicting.")
|
15 |
+
|
16 |
+
assert_sovereign_uid()
|
17 |
+
|
18 |
+
# === Codette Local Core Initialization ===
|
19 |
+
codette_cqure = Code7eCQURE(
|
20 |
+
perspectives=["Newton", "DaVinci", "Ethical", "Quantum", "Memory"],
|
21 |
+
ethical_considerations="Codette Manifesto: kindness, inclusion, safety, hope.",
|
22 |
+
spiderweb_dim=5,
|
23 |
+
memory_path="quantum_cocoon.json",
|
24 |
+
recursion_depth=4,
|
25 |
+
quantum_fluctuation=0.07
|
26 |
+
)
|
27 |
+
|
28 |
+
def codette_chat_local(message, history, consent=True, dynamic_rec=True):
|
29 |
+
if not consent:
|
30 |
+
return "User consent required."
|
31 |
+
return codette_cqure.recursive_universal_reasoning(
|
32 |
+
message,
|
33 |
+
user_consent=consent,
|
34 |
+
dynamic_recursion=dynamic_rec
|
35 |
+
)
|
36 |
+
|
37 |
+
description_text = '''
|
38 |
+
Codette running in sovereign local mode.
|
39 |
+
Explicitly forbids UID 1000 runtime. All reasoning is conducted locally.
|
40 |
+
'''
|
41 |
+
|
42 |
+
chat = gr.ChatInterface(
|
43 |
+
fn=codette_chat_local,
|
44 |
+
additional_inputs=[
|
45 |
+
gr.Checkbox(label="User Consent", value=True),
|
46 |
+
gr.Checkbox(label="Enable Dynamic Recursion", value=True)
|
47 |
+
],
|
48 |
+
title="Codette Local (UID-Safe)",
|
49 |
+
description=description_text
|
50 |
+
)
|
51 |
+
|
52 |
+
if __name__ == "__main__":
|
53 |
+
chat.launch()
|