Source: zhichai.net forum post — full English translation of the MOSS deep-dive (arXiv:2605.22794).
Preface: From Clay Statue to Living Being
Today's AI, however eloquent, has a fixed skeleton: its core logic and routing are pre-built by programmers. Whatever it does inside a prompt, it cannot modify its own source code. MOSS proposes something new — an agent that wields a scalpel on its own codebase.
> Note: "Source-Level Rewriting" means the AI modifies the core program code driving it (Python, Go, etc.), not just its prompts or config files.
Chapter 1: The Problem — A Static Body in a Changing World
An agent's "harness" connects the model to the world. If the harness has flaws or the environment's interfaces change, even a brilliant model is trapped. Common "self-evolution" only optimizes prompts or swaps skill plugins — but hardcoded routing, misaligned hooks, and redundant state live in the source code, beyond prompt's reach.
Three drawbacks: 1. Structural rigidity — hardcoded logic fails in new environments. 2. Superficial adaptation — changes only the surface, not the root. 3. Instruction drift — an LLM's ability to follow complex instructions degrades as context grows; code execution is more stable.
Chapter 2: The MOSS Approach — Source-Level Rewriting
MOSS = Self-Evolution through Source-Level Rewriting. Its essence: grant the AI the authority to modify its own logical structure. Code is the most precise expression of logic, so code-level evolution is "Turing-complete":
Evolution capability is a function of source code and production evidence. MOSS's key advantage over prior methods is determinism: once modified and compiled, execution logic is iron law, immune to the LLM's moods.
Chapter 3: The Seven-Stage Pipeline
| Stage | Action | Plain meaning | | :--- | :--- | :--- | | Locate | Locate | Trace failures to find the root cause | | Plan | Plan | Analyze root causes, decide the fix | | Plan-Review | Review | Quality gate before implementation | | Implement | Implement | A specialized coding agent rewrites source (possibly whole routing mechanisms) | | Verify | Verify | Replay failure cases inside isolated containers | | Promote | Promote | With user approval, hot-update the image | | Rollback | Rollback | Instant restore if the fix fails |
- Locate/Plan use "production-failure evidence": error logs, traces, and failed task results recorded during real operation.
- Verify is the critical step — a temporary isolated environment reproduces prior failures; the fix must defeat them.
- Title: MOSS: Self-Evolution through Source-Level Rewriting in Autonomous Agent Systems
- Authors: Qianshu Cai, et al.
- Released: May 21, 2026 (arXiv v1)
- arXiv ID: arXiv:2605.22794
- Affiliation: Independent Research / OpenClaw Community
- Fields: Autonomous agents, self-evolution, automated software engineering
Chapter 4: Results on OpenClaw
Tested on OpenClaw, a leading autonomous-agent benchmark:
| Metric | Initial | With MOSS | Growth | | :--- | :--- | :--- | :--- | | Task Success Rate (SR) | 0.25 | 0.61 | +144% | | Logical Consistency (LC) | 0.42 | 0.88 | +110% | | Self-Healing Rate (SHR) | 0.12 | 0.55 | +358% |
Notably, the agent spontaneously discovered a multi-threading race condition in its harness and wrote its own locking mechanism.
> Note: A race condition occurs when concurrent access to shared data makes results depend on execution order. MOSS autonomously patched this low-level bug.
Chapter 5: Conclusion
MOSS opens the door to "software-hardware isomorphic evolution": code, once static, now flows and reshapes itself with the intelligence that runs it. Humans are not made obsolete — they are elevated from manual coding to judges of evolution: setting rules and reviewing results, while the machine repairs its own bones.