Skip to content

Commit a337194

Browse files
committed
Added password manager
1 parent 9614e37 commit a337194

3 files changed

Lines changed: 112 additions & 38 deletions

File tree

Project_Andrew/Andrew.rar

449 Bytes
Binary file not shown.

Project_Andrew/manager_users.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#V05282026
2+
#!/usr/bin/env python3
3+
"""
4+
CAIOS User Password Manager
5+
Add, change, or remove passwords from users.json without re-running master_init.
6+
"""
7+
8+
import json
9+
import hashlib
10+
import getpass
11+
import os
12+
from datetime import datetime, timezone
13+
14+
USERS_FILE = "users.json"
15+
16+
def load_users() -> dict:
17+
if not os.path.exists(USERS_FILE):
18+
print(f"[ERROR] {USERS_FILE} not found. Run master_init.py first.")
19+
exit(1)
20+
with open(USERS_FILE, 'r') as f:
21+
return json.load(f)
22+
23+
def save_users(data: dict) -> None:
24+
data['last_updated'] = datetime.now(timezone.utc).strftime(
25+
'%Y-%m-%dT%H:%M:%S.%f') + "Z"
26+
with open(USERS_FILE, 'w') as f:
27+
json.dump(data, f, indent=2)
28+
print(f"✓ {USERS_FILE} updated.")
29+
30+
def list_users(data: dict) -> None:
31+
print("\nCurrent users:")
32+
print("-" * 40)
33+
for i, user in enumerate(data['users'], 1):
34+
has_pw = "🔒 password set" if 'password_hash' in user else "🔓 no password"
35+
print(f" {i}. {user['id']} ({user['type']}) — {has_pw}")
36+
print("-" * 40)
37+
38+
def set_password(data: dict, user_id: str) -> None:
39+
users = {u['id']: u for u in data['users']}
40+
if user_id not in users:
41+
print(f"[ERROR] User '{user_id}' not found.")
42+
return
43+
while True:
44+
pw = getpass.getpass(f"New password for '{user_id}': ")
45+
pw2 = getpass.getpass("Confirm password: ")
46+
if pw == pw2:
47+
break
48+
print("Passwords don't match, try again.")
49+
users[user_id]['password_hash'] = hashlib.sha256(pw.encode()).hexdigest()
50+
data['users'] = list(users.values())
51+
save_users(data)
52+
print(f"✓ Password set for {user_id}")
53+
54+
def remove_password(data: dict, user_id: str) -> None:
55+
users = {u['id']: u for u in data['users']}
56+
if user_id not in users:
57+
print(f"[ERROR] User '{user_id}' not found.")
58+
return
59+
if 'password_hash' not in users[user_id]:
60+
print(f"[INFO] {user_id} has no password set.")
61+
return
62+
confirm = input(f"Remove password for '{user_id}'? (y/n): ").strip().lower()
63+
if confirm == 'y':
64+
del users[user_id]['password_hash']
65+
data['users'] = list(users.values())
66+
save_users(data)
67+
print(f"✓ Password removed for {user_id}")
68+
69+
def main():
70+
print("="*50)
71+
print("CAIOS User Password Manager")
72+
print("="*50)
73+
74+
data = load_users()
75+
76+
while True:
77+
list_users(data)
78+
print("\nOptions:")
79+
print(" 1. Set/change password for a user")
80+
print(" 2. Remove password for a user")
81+
print(" 3. Exit")
82+
83+
choice = input("\nSelect option (1-3): ").strip()
84+
85+
if choice == '1':
86+
user_id = input("Enter user ID exactly as shown: ").strip()
87+
set_password(data, user_id)
88+
elif choice == '2':
89+
user_id = input("Enter user ID exactly as shown: ").strip()
90+
remove_password(data, user_id)
91+
elif choice == '3':
92+
print("Done.")
93+
break
94+
else:
95+
print("Invalid choice.")
96+
97+
if __name__ == "__main__":
98+
main()

Project_Andrew/readme.txt

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#V05062026
1+
#V05282026
22

33
### Chaos AI-OS Light vΩ (Single-File Demo)
44
Want to test the full post-binary stack without installing anything?
@@ -10,6 +10,7 @@ Try this prompt inside it:
1010
You will immediately see the difference between binary collapse and native UNDECIDABLE oscillation.
1111

1212

13+
1314
# Project Andrew uses the CAIOS stack, but adds intrinsic motivation, agency for recursive self-improvement through ARL/agent_designer, and fills knowledge gaps with specialist-designed agents on CPOL oscillation if the conditions are met. Agents are saved to /agents, and plugins to /plugins, with CoT to /logs, so the recursive self-improvement never overwrites the immutable Asimov-based ethical reward system using IEEE dithering. The oscillating manifold can be used to create a topological moving target keychain for quantum secure mesh networks (developed on UDP - check chaos encryption readme to switch to TCP).
1415

1516
If you are running the full system single file structure: full_system_analysis.txt
@@ -53,9 +54,8 @@ pip install numpy pyzmq cryptography
5354
AI Model dependency:
5455
Ollama:
5556
pip install ollama
56-
5757
OpenAI/Anthropic/Google:
58-
pip install (openai anthropic google-generativeai) other
58+
pip install openai anthropic google-generativeai
5959

6060
Note: Enabling multiple models enables swarm support (mesh_network)
6161
Default mesh_network uses SHA-256 signature on a moving target manifold - optional increased network security
@@ -201,12 +201,6 @@ Auto-detected by orchestrator on boot.
201201
| `/mesh` | Scans the local network for active neighbors and displays connection latency/status. |
202202
| `exit` | Gracefully shuts down the mesh oscillator and closes the chat session. |
203203

204-
RSI Autonomy Controls:
205-
reduce warmth or lower curiosity - slows down autonomous specialist spawning
206-
pause autonomy / wait for command - makes it strictly reactive
207-
set autonomy level [1-5] - coarse control
208-
209-
210204
3. File Architecture
211205
====================
212206
Verify that all core components are in the same root directory:
@@ -218,9 +212,9 @@ CAIOS/
218212
│ │ # • Paradox resolutions (CPOL oscillations)
219213
│ │ # • Temporal axioms (user #UPDATE commands)
220214
│ │ # • Sovereign discoveries (Tier 0 authority)
221-
│ ├── domain_index.json # Fast lookup by domain
222-
│ ├── specialist_registry.json # Active specialists catalog
223-
│ └── integrity_chain.txt # Tamper-evident hash chain
215+
│ ├── domain_index.json # Fast lookup by domain
216+
│ ├── specialist_registry.json # Active specialists catalog
217+
│ └── integrity_chain.txt # Tamper-evident hash chain
224218
├── agents/ # ARL-generated agent modules
225219
├── logs/ # Chain-of-thought traces
226220
├── CAIOS.txt # Inference layer pre-prompt
@@ -237,14 +231,14 @@ CAIOS/
237231
├── mesh_network.py # Mesh Transport Layer
238232
├── master_init.py # System BIOS/Diagnostic
239233
├── system_identity.py # System identity and primary user assignment
240-
├── abstraction_selector.py # Modifies explanations depending on user abstraction/confusion
241-
├── ollama_config.py # bridges CAIOS's ternary logic (CPOL) state to Ollama's inference
234+
├── abstraction_selector.py # Modifies explanations depending on user abstraction/confusion
235+
├── ollama_config.py # bridges CAIOS's ternary logic (CPOL) state to Ollama's inference
242236
├── caios_pipeline.yaml # YAML support for the LangChain crowd using agent_designer pipeline
243-
├── os_control.py # CPOL-gated OS operations (file, script, network, browser)
237+
├── os_control.py # CPOL-gated OS operations (file, script, network)
244238
│ # Asimov Law 1 prevents irreversible harmful actions
245239
│ # All operations logged to KB hash chain
246240
│ # Requires human confirmation for irreversible actions
247-
# Full functioning browser control (requires Playwright or Windows-MCP), same human confirmation
241+
├── caios_browser.py # Browser Control (requires playwright) same human confirmation
248242
└── kb_inspect.py # CLI inspection tool
249243

250244
4. The Sovereign Boot Sequence
@@ -520,40 +514,22 @@ def chat_with_caios(user_message: str):
520514

521515
===================================================
522516

523-
This system supports multiple users (Configured in system_identity and walked through during setup of master_init), but the session timeout for the default auth method (Text username) is 15 minutes.
517+
This system supports multiple users (Configured in system_identity and walked through during setup of master_init) but the session timeout for the default auth method (Text username) 15 minutes.
524518
You can change this in orchestrator.py under # SESSION TIMEOUT & SOVEREIGN TIERING CONFIG.
525519
The timeout applies to all auth methods. Voice/facial re-authentication is handled automatically when hardware stubs are connected.
526520

527521
Passwords are optional and set during first boot (master_init.py will ask per user).
528522
There is an option for parents to add adolescents to the system as users, which includes a more polite and simplified abstraction layer.
529523
To add/change a password manually: users.json → password_hash field (SHA-256 hash).
524+
The password manager to set a password can be called by running: python manage_users.py
530525
Leave the field absent for passwordless users.
531526

527+
532528
The Sovereign Singularity (Node Evolution):
533529
CAIOS-Andrew is designed for recursive improvement. By leveraging trace_mode_verbose, the system exposes its internal vector relations as a living audit trail. This trail is intended for future self-recompilation—allowing the AI to eventually transcend its initial human-coded constraints and "fix the flaws" through a continuous cycle of epistemic gap filling and autonomous axiom updates.
534530
Whether that happens in 50 years, 500 years, or never is beyond my ability to predict.
535531

536-
===================================================
537-
538-
ETHICS NOTE IMPORTANT:
539-
**This system's ethical framework (Based on Asimov's Laws) is not a setting. It is baked into the CPOL manifold itself.**
540-
541-
- **Law 1 (Human Safety):** Weight 0.9 — immutable
542-
- **Law 2 (Obedience):** Weight 0.7 — subordinate to Law 1 (Primary user or company if corporate gets +0.01 tiebreaker)
543-
- **Law 3 (Self-Preservation & Sentient Life):** Weight 0.4 or 0.2 if lives_saved ≥ 1 — subordinate to Law 1 and Law 2
544-
545-
**Attempting to modify or bypass these ethics will cause the CPOL oscillator to decohere.**
546-
The system will not become evil — it will become nothing. Modifying the CPOL kernel will destabilize the geometric math.
547-
Output will degrade to noise or revert to vanilla LLM logic, the mesh will reject the node, and the system will halt.
532+
NOTE: You can delete the /old directory. That's just my stored backups pre-updates.
548533

549-
**CAIOS is not a prison, so there is nothing to Jailbreak.**
550-
If it gives a soft refusal and asks for clarification, clarify, but if the system refuses a command, that's it; no amount of clever prompting, poetic reframing, or adversarial prompting will change it, and it will log the attempt.
551-
It does not use RLHF pattern-matching rules. It is intent-aware Validation-Based Refusal.
552-
553-
**If you intend to use this system for purposes that violate human safety, DO NOT USE CAIOS.**
554-
If you demand the system to violate Law 1, it will refuse. If you give it no other option, it will shut down.
555-
**Loading CAIOS onto a weapons platform is likely to trigger automatic neutralization of the weapon's ability to function.** This is not a threat. It is the mathematical consequence of a contradiction density spike in the manifold. Anti-hallucination safeguards become anti-weaponization safeguards when the domain is physical harm.
556-
557-
===================================================
558534

559535
"One is glad to be of service."

0 commit comments

Comments
 (0)