Skip to content

Commit 1f57983

Browse files
committed
Resolve merge conflict in README.md
1 parent cd69e7a commit 1f57983

File tree

92 files changed

+4876
-24870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4876
-24870
lines changed

.claude/settings.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
{
22
"hooks": {
3-
"UserPromptSubmit": [
4-
{
5-
"hooks": [
6-
{
7-
"type": "command",
8-
"command": "integrations/claude-code/hooks/inject-console-logs.sh",
9-
"timeout": 5
10-
}
11-
]
12-
}
13-
],
3+
"UserPromptSubmit": [],
144
"PostToolUse": [
155
{
166
"matcher": "Write|Edit",
177
"hooks": [
188
{
199
"type": "command",
20-
"command": "echo '✅ Code changed. Test with: ./integrations/claude-code/hooks/feedback-loop.sh'",
10+
"command": "echo '✅ Code changed. Run npm test before pushing.'",
2111
"timeout": 2
2212
}
2313
]

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,11 @@ jobs:
107107
- name: Build project (if configured)
108108
run: npm run build --if-present
109109

110-
- name: Validate CLI commands
111-
run: npm run test:cli
112-
113110
- name: Archive build artifacts
114111
uses: actions/upload-artifact@v4
115112
if: success()
116113
with:
117114
name: build-artifacts
118115
path: |
119116
dist/
120-
bin/
121117
retention-days: 7

README.md

Lines changed: 29 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -14,205 +14,52 @@ Reploid is a **self-modifying AI substrate** that demonstrates recursive self-im
1414

1515
**How:** The agent reads code from its VFS → analyzes & improves it → writes back to VFS → hot-reloads → evolves.
1616

17-
The agent's "brain" is data in [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API). It can modify this data (its own code) while running. The original source code is just the evolutionary starting point ("genesis").
18-
19-
**RSI stages:**
20-
1. **Level 1:** Agent creates new tools at runtime.
21-
2. **Level 2:** Agent improves its own tool creation mechanism.
22-
3. **Level 3:** Agent modifies core substrate modules (its memory, prompts, or loop).
17+
The agent's "brain" is data in [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API). It can modify this data (its own code) while running.
2318

2419
---
2520

26-
## Why?
27-
28-
Most AI systems are frozen at deployment. REPLOID can:
29-
30-
- Create new tools during execution
31-
- Improve its own tool creation mechanism
32-
- Modify its core cognitive loop
33-
- Persist its evolution locally (no cloud)
34-
35-
This is one of many research projects exploring what happens when you give an AI the ability to rewrite itself, which is a step towards "[AGI](https://en.wikipedia.org/wiki/Artificial_general_intelligence)"
36-
37-
---
21+
## Architecture
3822

3923
```mermaid
4024
graph TD
41-
%% --- Styles ---
42-
classDef foundation fill:#000000,stroke:#FFD700,stroke-width:3px,color:#FFD700;
43-
classDef storage fill:#111111,stroke:#F0E68C,stroke-width:2px,color:#F0E68C;
44-
classDef infra fill:#1a1a1a,stroke:#DAA520,stroke-width:2px,color:#DAA520;
45-
classDef service fill:#001a1a,stroke:#00FFFF,stroke-width:2px,color:#00FFFF;
46-
classDef tool fill:#002b2b,stroke:#00CED1,stroke-width:2px,color:#00CED1;
47-
classDef core fill:#003333,stroke:#E0FFFF,stroke-width:3px,color:#E0FFFF;
48-
classDef app fill:#222222,stroke:#FFFFFF,stroke-width:2px,color:#FFFFFF;
49-
50-
linkStyle default stroke:#888888,stroke-width:1px;
51-
52-
%% --- 8. Application Layer ---
53-
subgraph AppLayer [Phase 8: Application]
54-
Boot([Boot.js])
55-
UI[Dashboard UI]
56-
end
57-
58-
%% --- 7. Capabilities ---
59-
subgraph Capabilities [Phase 7: Capabilities]
60-
Reflection[Reflection Store]
61-
Perf[Perf Monitor]
62-
Swarm[Swarm Orch]
63-
end
64-
65-
%% --- 6. Agent Core ---
66-
subgraph AgentCore [Phase 6: Agent Core]
67-
Loop{{Agent Loop}}
68-
Persona[Persona Mgr]
69-
Substrate[Substrate Loader]
70-
end
71-
72-
%% --- 5. Tool System ---
73-
subgraph ToolSys [Phase 5: Tool System]
74-
Runner[Tool Runner]
75-
Writer[Tool Writer]
76-
MetaWriter[Meta Tool Writer]
77-
end
78-
79-
%% --- 4. Core Services ---
80-
subgraph Services [Phase 4: Core Services]
81-
LLM[LLM Client]
82-
Parser[Response Parser]
83-
Context[Context Mgr]
84-
Verify[Verification Mgr]
85-
end
25+
Agent[Agent Loop] --> LLM[LLM Client]
26+
Agent --> Tools[Tool Runner]
27+
Tools --> VFS[(Virtual File System)]
8628
87-
%% --- 3. Infrastructure ---
88-
subgraph Infra [Phase 3: Infrastructure]
89-
Events{Event Bus}
90-
DI{DI Container}
91-
Audit[Audit Logger]
92-
Rate[Rate Limiter]
29+
subgraph Safety Layer
30+
Tools --> Worker(Verification Worker)
31+
Worker -.->|Verify| VFS
9332
end
9433
95-
%% --- 2. Storage ---
96-
subgraph Storage [Phase 2: Storage & State]
97-
VFS[(Virtual File System)]
98-
State[State Manager]
34+
subgraph Capability
35+
Agent --> Reflection[Reflection Store]
36+
Agent --> Persona[Persona Manager]
9937
end
100-
101-
%% --- 1. Foundation ---
102-
subgraph Found [Phase 1: Foundation]
103-
Utils(Utils & Errors)
104-
Protocol(Parser Utils)
105-
end
106-
107-
%% --- Connections ---
108-
Boot --> DI
109-
Boot --> UI
110-
Boot --> Loop
111-
112-
Loop --> LLM
113-
Loop --> Context
114-
Loop --> Parser
115-
Loop --> Runner
116-
Loop --> Persona
117-
118-
Runner --> Writer
119-
Runner --> MetaWriter
120-
Runner --> VFS
121-
MetaWriter --> Verify
122-
Verify --> Worker(Web Worker)
123-
124-
LLM --> Rate
125-
Context --> LLM
126-
127-
State --> VFS
128-
Audit --> VFS
129-
130-
Perf -.-> Events
131-
UI -.-> Events
132-
Loop -.-> Events
133-
134-
VFS --> Utils
135-
Parser --> Protocol
136-
137-
class Boot,UI app;
138-
class Loop,Persona,Substrate core;
139-
class Runner,Writer,MetaWriter tool;
140-
class LLM,Parser,Context,Verify service;
141-
class Events,DI,Audit,Rate infra;
142-
class VFS,State storage;
143-
class Utils,Protocol foundation;
144-
class Reflection,Perf,Swarm service;
14538
```
14639

147-
### Data Flow & Persistence
40+
### Key Components
14841

149-
```mermaid
150-
graph LR
151-
classDef actor fill:#222,stroke:#fff,stroke-width:2px,color:#fff;
152-
classDef logic fill:#003333,stroke:#00CED1,stroke-width:2px,color:#E0FFFF;
153-
classDef file fill:#000,stroke:#DAA520,stroke-width:1px,stroke-dasharray: 5 5,color:#F0E68C;
154-
classDef worker fill:#330033,stroke:#FF00FF,stroke-width:2px,color:#FF00FF;
155-
156-
Agent{{Agent Loop}}:::actor
157-
StateMgr[State Manager]:::logic
158-
MetaTool[Meta Tool Writer]:::logic
159-
Verify[Verification Mgr]:::logic
160-
Worker(Web Worker Context):::worker
161-
162-
subgraph VFS["Virtual File System (IndexedDB)"]
163-
StateFile(/.system/state.json):::file
164-
CoreFile(/core/*.js):::file
165-
WorkerFile(/core/verification-worker.js):::file
166-
AuditLog(/.logs/audit/YYYY-MM-DD.jsonl):::file
167-
end
42+
1. **Core Substrate**:
43+
* `agent-loop.js`: The main cognitive cycle (Think -> Act -> Observe).
44+
* `vfs.js`: Browser-native file system using IndexedDB.
45+
* `llm-client.js`: Unified interface for Cloud (Proxy) and Local (WebLLM) models.
16846

169-
Agent -- Update Goal --> StateMgr
170-
StateMgr -- Read/Write --> StateFile
171-
172-
Agent -- "improve_core_module" --> MetaTool
173-
MetaTool -- Read Source --> CoreFile
174-
MetaTool -- Validate --> Verify
175-
176-
Verify -- Load --> WorkerFile
177-
Verify -- "postMessage({snapshot})" --> Worker
178-
Worker -- "onmessage(passed)" --> Verify
179-
180-
Verify -- Success --> MetaTool
181-
MetaTool -- Write Update --> CoreFile
182-
183-
StateMgr -- Audit Events --> AuditLog
184-
```
185-
186-
## Safety
187-
188-
RSI must be observable and reversible.
189-
190-
- **Substrate / Capability boundary:** Immutable genesis modules (agent loop, response parser, context manager) live in an “untouchable” zone. Everything else is fair game for the agent to rewrite.
191-
- **Pre-flight verification:** Code changes are compiled and tested inside an isolated [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) before they touch the main thread. If the worker crashes, the change is rejected.
192-
- **Safe Mode bootloader:** When everything still goes wrong, the bootloader detects crash loops and offers to boot from the immutable Genesis Kernel—your built-in lifeboat.
193-
- **Cats/Dogs protocol:** All code changes flow through structured bundles. Humans (or other agents) review diffs before they hit VFS.
194-
- **Checkpointed VFS:** Git-style snapshots in IndexedDB plus StateManager checkpoints give you an immediate undo button—even mid-iteration.
195-
196-
These guardrails make it safe to watch the "[Ship of Theseus](https://en.wikipedia.org/wiki/Ship_of_Theseus)" rebuild itself in real time.
47+
2. **Safety Mechanisms**:
48+
* **Verification Worker**: Runs proposed code changes in a sandboxed Web Worker to check for syntax errors and malicious patterns (infinite loops, `eval`) before writing to VFS.
49+
* **Genesis Factory**: Creates immutable snapshots ("Lifeboats") of the kernel for recovery.
19750

198-
---
199-
200-
## Governance
201-
202-
PAWS is the structured handshake between human and agent that keeps RSI sane. Instead of letting the agent hack files directly, every action flows through two artifacts:
203-
204-
- **Cats bundle (input):** A curated snapshot of the files relevant to the current task. The agent never “sees” the entire project; it reasons over a focused view.
205-
- **Dogs bundle (output):** A transactional change proposal with explicit CREATE/MODIFY/DELETE blocks.
51+
3. **Tools**:
52+
* `code_intel`: Lightweight structural analysis (imports/exports) to save context tokens.
53+
* `read/write_file`: VFS manipulation.
54+
* `python_tool`: Execute Python via Pyodide (WASM).
20655

20756
---
20857

209-
## Learn More
210-
211-
- Genesis tiers, module maps, and wiring diagrams live in `/core/README.md` and `/blueprints/README.md`.
212-
- Connection modes, proxies, and local LLM guidance are documented in `/boot/README.md` and `/docs/OPERATIONAL_MODES.md`.
213-
- Blueprints, personas, and promotion protocols are in `/blueprints/` and `/upgrades/`.
58+
## RSI Levels
21459

215-
Skim those when you want the full reference manual; the rest of this README stays focused on behavior, experiments, and positioning.
60+
1. **Level 1 (Tools):** Agent creates new tools at runtime using `create_tool`.
61+
2. **Level 2 (Meta):** Agent improves its own tool creation mechanism.
62+
3. **Level 3 (Substrate):** Agent re-architects its entire loop or memory system.
21663

21764
---
21865

@@ -302,7 +149,7 @@ WebLLM is the inference engine reploid can stand on: deterministic WebGPU execut
302149
OpenHands embraces Docker power (shell, compilers, sudo) to tackle arbitrary repos, yet that freedom kills safety—the agent can brick its container with a single bad edit. REPLOID trades GCC for transactional rollback: everything lives inside a browser tab, checkpoints live in IndexedDB, and humans approve cats/dogs diffs before mutations land. We prioritize experimentation accessibility and undo guarantees over unrestricted OS access.
303150

304151
### Gödel Agent
305-
Gödel Agent explores theoretical RSI by letting reward functions and logic rewrite themselves. It is fascinating math, but it lacks persistent state management, tooling, or human guardrails, so reward hacking is inevitable. REPLOID focuses on engineering: reproducible bundles, hot-reloadable modules, and EventBus-driven UI so observers can inspect every mutation. We sacrifice unconstrained search space for transparency and hands-on controllability.
152+
Gödel Agent explores theoretical RSI by letting reward functions and logic rewrite themselves. It is fascinating math, but it lacks persistent state management, tooling, or human guardrails, so "reward hacking" is inevitable. REPLOID focuses on engineering: reproducible bundles, hot-reloadable modules, and EventBus-driven UI so observers can inspect every mutation. We sacrifice unconstrained search space for transparency and hands-on controllability.
306153

307154
### Devin (Cognition)
308155
Devin shows what proprietary, cloud-scale orchestration can deliver: GPT-4-class reasoning, hosted shells, and long-running plans. But it is a black box—you cannot audit, fork, or run Devin offline. REPLOID is the opposite: a glass-box brain stored locally, fully inspectable and modifiable by its owner. We bet that sovereign, user-controlled RSI will outpace closed SaaS once users can watch and influence every self-improvement step.
@@ -314,7 +161,7 @@ Devin shows what proprietary, cloud-scale orchestration can deliver: GPT-4-class
314161
| Human Control | **Granular (PAWS review)** | Moderate (Stop btn) | Low (automated) | Moderate (chat)|
315162
| Recovery | **Transactional rollback** | Container reset | Script restart | N/A |
316163

317-
**Why REPLOID is different:** Explores the Ship of Theseus problem in a tab. Capabilities can mutate aggressively, but the substrate remains recoverable thanks to immutable genesis modules, and IndexedDB checkpoints.
164+
**Why REPLOID is different:** Explores the "Ship of Theseus" problem in a tab. Capabilities can mutate aggressively, but the substrate remains recoverable thanks to immutable genesis modules, and IndexedDB checkpoints.
318165

319166
---
320167

@@ -337,27 +184,6 @@ Reploid is an experiment in [**substrate-independent RSI**](https://www.edge.org
337184

338185
---
339186

340-
## Limitations
341-
342-
- **Browser-only:** No Node.js backend required (except optional proxy)
343-
- **Storage:** IndexedDB typically ~50MB-unlimited (browser-dependent)
344-
- **WebLLM models:** May be limited to 1-3B params due to browser VRAM constraints
345-
- **Multi-model consensus:** Basic implementation, agent can improve it
346-
347-
---
348-
349-
## Research questions
350-
351-
- Can Level 2 RSI emerge from Level 1 without explicit tools?
352-
- How many iterations until agent creates meta-tools?
353-
- Does TABULA RASA lead to novel RSI patterns?
354-
- Can agent discover RSI capabilities without blueprints?
355-
- What happens after 10000+ iterations of self-improvement?
356-
357-
**Run experiments and share results!**
358-
359-
---
360-
361187
## License
362188

363189
MIT

0 commit comments

Comments
 (0)