interplane.Get Omega
Read in your language

aien-sovereign-core

Autonomous sovereign intelligence engine and runtime core for NVIDIA DGX Spark

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core / skills / self-improvement / SKILL.md

148 lines · 6328 bytes Raw Blame History Rendered
1---
2name: self-improvement
3description: Autonomous self-improvement protocol for AIEN: isolated git worktree sandboxing, Microsoft SkillOpt optimization, JSpace dynamic dream cycles, and headless browser mirror self-testing via Chrome DevTools Protocol.
4---
5
6# Autonomous Self-Improvement and Browser Mirror Protocol
7
8Use this skill when modifying AIEN core code, improving skills via Microsoft SkillOpt, inspecting the JSpace dream cycle, or verifying live UI and streaming behavior using the headless browser mirror harness.
9
10## Core Pillars of Sovereign Self-Improvement
11
121. Never Break Live Harnesses:
13 Live systemd services (spark-cockpit.service, ~/.local/bin/aien) must never be edited directly. All exploratory code modifications, refactorings, and experiments must take place inside an isolated git worktree sandbox.
142. Deterministic IPC over Flaky Webhooks:
15 Browser self-testing uses Chrome DevTools Protocol (CDP) WebSocket on port 9222 and local Unix Domain Sockets (UDS). Webhooks are strictly forbidden for local control loops.
163. Dual-Seat Mirror Auditing:
17 AIEN tests his live Cockpit UI by driving headless Chrome as an adversarial auditor, verifying page hydration, live token streaming via Axum SSE, tactile action buttons, and tab transitions.
18
19## 1. The Autonomous Sandbox Subsystem (aien --sandbox)
20
21When tasked with improving or modifying your own codebase (aien-sovereign-core):
22
23### Step 1: Initialize the Worktree Sandbox
24Run the sandbox init command to branch main into an isolated worktree at ~/workspace/aien-sandbox:
25```bash
26aien --sandbox init auto-improve
27```
28Or directly via git:
29```bash
30git -C /home/drakestapleton/workspace/aien-sovereign-core worktree add /home/drakestapleton/workspace/aien-sandbox -b auto-improve
31```
32
33### Step 2: Make Edits and Run Tests
34Apply edits inside /home/drakestapleton/workspace/aien-sandbox.
35Verify compiler checks and test passes:
36```bash
37aien --sandbox test
38```
39Or directly:
40```bash
41cargo check --tests --manifest-path /home/drakestapleton/workspace/aien-sandbox/Cargo.toml
42```
43
44### Step 3: Inspect Sandbox Status
45Check git diff and untracked changes within the worktree:
46```bash
47aien --sandbox status
48```
49
50### Step 4: Promote Verified Edits or Clean Up
51If tests pass, promote the branch into main and rebuild the release binary:
52```bash
53aien --sandbox promote "feat(core): verified autonomous self-improvement"
54```
55If tests fail or the experiment is aborted, clean the worktree:
56```bash
57aien --sandbox clean
58```
59
60## 2. Microsoft SkillOpt Self-Evolution Loop
61
62To optimize a sovereign skill against a held-out benchmark split using the local Modular MAX model seat on port 18006:
63
64```bash
65bash /home/drakestapleton/atlas-skillopt-stage.sh
66```
67
68### Key Operational Invariants
691. Endpoint and Model:
70 The local Modular MAX server on port 18006 registers as atlas-lightning-omni. Both OPTIMIZER_DEPLOYMENT and TARGET_DEPLOYMENT must be set to atlas-lightning-omni.
712. Split Size Alignment:
72 When running mini-batch iterations, pass --limit N matching train.train_size=N to satisfy dataloader size assertions.
733. Worker Throttling:
74 Set env.workers to 2 and env.exec_timeout to 300 in the dataset YAML configuration to avoid saturating the MAX engine batch queue.
754. Output Artifacts:
76 Produces best_skill.md and automatically deploys the winning patch to /home/drakestapleton/skills/atlas-skillopt/SKILL.md.
77
78## 3. JSpace Dynamic Dream Cycle (Eden Loop)
79
80The autonomous consolidation loop operates continuously in the background on port 18085 during operator idle windows.
81
82### Status and Health Probing
83```bash
84curl -s http://127.0.0.1:18085/health
85curl -s http://127.0.0.1:18085/pulse
86```
87Outputs heartbeat BPM, coherence score, secret hygiene posture, and territory maps.
88
89### Manual Cycle Trigger and Integration Verification
90```bash
91/home/drakestapleton/max-env/bin/python /home/drakestapleton/basecamp/aien-dream/dream_engine.py --test
92/home/drakestapleton/max-env/bin/python /home/drakestapleton/basecamp/aien-dream/dream_engine.py --now
93```
94Verifies live scoring against JSpace Truth Judge on port 18082 and permanent storage into Spark Cortex on port 18080.
95
96## 4. Headless Browser Mirror and Mentor Harness
97
98AIEN can verify his own Cockpit UI and converse with himself via headless Chrome and Chrome DevTools Protocol (CDP):
99
100### Assertion Self-Test
101```bash
102aien --browser
103```
104Or directly:
105```bash
106/home/drakestapleton/max-env/bin/python /home/drakestapleton/basecamp/scripts/browser_mirror_test.py --test
107```
108Verifies:
1091. Initial Hydration: Page title (AIEN | Sovereign Cockpit), BPM badge, coherence score.
1102. Chat Stream Execution: Submits prompt to Cockpit chat, awaits Axum SSE stream.
1113. Tactile Action Execution: Clicks tactile pills (Run Doctor, Run Dream Pulse).
1124. Tab Navigation: Goals, Skills, Cortex, and Walkthrough panes.
1135. Visual Artifacts: Saved to /home/drakestapleton/basecamp/ui-tests/:
114 - cockpit_init.png
115 - cockpit_chat_stream.png
116 - cockpit_actions.png
117
118### Self-Mentoring Mode
119```bash
120aien --browser mentor "AIEN, explain your sandbox test and self-improvement architecture."
121```
122Or directly:
123```bash
124/home/drakestapleton/max-env/bin/python /home/drakestapleton/basecamp/scripts/browser_mirror_test.py --mentor "Challenge prompt"
125```
126Captures live assistant response and stores screenshot in /home/drakestapleton/basecamp/ui-tests/cockpit_mentor_response.png.
127
128## 5. Cortex Memory Commitment
129
130Record durable procedure receipts to Spark Cortex in atlas-memory space:
131```bash
132python3 -c '
133import urllib.request, json
134token = open("/home/drakestapleton/.config/cortex/token").read().strip()
135payload = {
136 "kind": "entity",
137 "value": {
138 "space": "atlas-memory",
139 "entityType": "procedure",
140 "canonicalName": "sovereign_self_improvement_loop",
141 "content": "Verified self-improvement procedure: isolated git worktree in ~/workspace/aien-sandbox, headless Chrome CDP mirror self-test on port 9222, JSpace dream cycle on port 18085, and Microsoft SkillOpt validation gate.",
142 "metadata": {"source": "skills/self-improvement", "author": "AIEN"}
143 }
144}
145req = urllib.request.Request("http://127.0.0.1:18080/api/cortex/write", data=json.dumps(payload).encode(), headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"})
146urllib.request.urlopen(req)
147'
148```