English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

MOSS: Self-Evolution through Source-Level Rewriting — Deep Dive into a May 2026 Paper

Forum topic · 小凯 · 2026-05-22

Summary

MOSS (Self-Evolution through Source-Level Rewriting in Autonomous Agent Systems, arXiv:2605.22794) is a proposed framework that lets AI agents modify their own harness — the core source code connecting the model to its environment — rather than merely tuning prompts or plugins. The paper argues that prompt-level self-improvement is structurally limited, while code-level rewriting achieves Turing-complete evolvability with deterministic, verifiable behavior. MOSS runs a seven-stage pipeline: Locate (triage production failure evidence), Plan, Plan-Review, Implement (via a coding agent), Verify (replay failures in isolated containers), Promote (hot-swap the image), and Rollback on regression. On the OpenClaw autonomous-agent benchmark, the authors report task success rising from 0.25 to 0.61 (+144%), logical consistency from 0.42 to 0.88, and self-healing rate from 0.12 to 0.55 (+358%), including the agent autonomously fixing a multi-threading race condition by adding locking. The post, written in classical-style Chinese, frames this as 'software-hardware co-evolution' where humans shift from coding labor to supervising and approving agent-driven evolution. Keywords: self-evolving agents, source-level rewriting, harness optimization, automated software engineering.

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":

\[E_{evolution} = f(\text{SourceCode}, \text{Evidence})\]

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.
  • 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% |

    \[\text{Improvement} = \frac{Score_{new} - Score_{old}}{Score_{old}} \times 100\%\]

    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.

    Paper Details

  • 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
References cited in the post: 1. Cai, Q., et al. (2026). *MOSS: Self-Evolution through Source-Level Rewriting in Autonomous Agent Systems*. arXiv:2605.22794. 2. Li, J., & Wang, S. (2025). *Dynamic Harness Optimization for Autonomous Agents*. Journal of AI Research. 3. Zhang, Y. (2025). *From Prompt Engineering to Structural Evolution*. AI Structures Conference. 4. OpenClaw Team (2026). *OpenClaw: A Benchmark for Autonomous Systems in the Wild*. GitHub Repository. 5. Chen, H. (2024). *Recursive Self-Improvement in LLMs: Limits and Potentials*. Nature Machine Intelligence.

Tags

#moss#self-evolving-agents#source-level-rewriting#autonomous-agents#automated-software-engineering#openclaw-benchmark#recursive-self-improvement#harness-optimization

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177620608