From Framework to Paradigm: Formal Foundations and Engineering Practice for Self-Evolving Agent Runtimes

    This article explores why current agent frameworks—built on static runtimes and dynamic models—are becoming a bottleneck for truly self-evolving AI systems. It introduces a formal approach that treats framework modifications as verifiable, transactional operations, emphasizing two key properties: no-restart and task preservation. By decomposing the runtime into a minimal kernel and replaceable components, and by modeling all changes as events, agents can safely modify their own execution environment. The discussion covers the paradigm's value over implementation details, its three major impacts on agent development, and practical advice for developers, including kernel/component separation, snapshot-based rollback, and invariant-driven design.

    Why Agents Need a New “Foundation”

    Over the past two years, the agent ecosystem has evolved rapidly—from prompt orchestration to tool-call orchestration, and then to multi-step autonomous planning. But no matter how sophisticated the upper layers become, nearly all agents are built on a shared assumption: the runtime framework is static, while the model is dynamic. Models can be upgraded and prompts fine-tuned, but the host harness, once deployed, is rarely modified during execution.

    This assumption is becoming a bottleneck. A truly self-evolving agent, in its ideal form, should be able to autonomously extend its own tools, adjust its control flow, and even rewrite its scheduling logic based on task requirements—without human restarts or interruption of ongoing work. This sounds like science fiction, but recent industry discussions on the “formal foundations of dynamic compositional program paradigms” are moving this from engineering intuition to provable theory.

    Core Idea: Turning “Framework Modification” into Formally Verifiable Operations

    Traditional plugin-based or hot-update approaches are essentially “modify and hope”: run a test suite after the change, and if nothing crashes, it’s considered successful. The new theoretical perspective imposes stricter requirements—any modification to the framework must satisfy two formal properties:

    1. No-Restart: After the modification, running session state, task context, and established connections must continue seamlessly without loss.
    2. Task Preservation: The modification must be transparent to the currently executing task, or at least backward compatible.

    To satisfy both simultaneously, the key is to decompose the framework into a set of composable minimal kernels. The kernel handles only the most fundamental responsibilities: message routing, lifecycle management, and state snapshots. Everything else—tool registration, permission control, prompt templates, sub-agent scheduling—is treated as hot-swappable “peripheral components.”

    A pseudocode representation of this structure:

    1. class Kernel:
    2. """Minimal kernel: carries no business logic, only maintains invariants"""
    3. def dispatch(self, event: Event) -> None:
    4. # 1. Snapshot current task state (precondition for rollback)
    5. snapshot = self.state_store.checkpoint()
    6. try:
    7. handler = self.registry.resolve(event.type)
    8. handler(event)
    9. except IncompatiblePatchError:
    10. # Rollback to snapshot on failure; task remains intact
    11. self.state_store.restore(snapshot)

    The core insight is not the code itself, but modeling “modification” as an event. Code that modifies the framework and code that executes tasks go through the same message channel and the same transactional semantics. This turns “changing the framework” from a privileged operation into a natural capability of the agent.

    The Paradigm Matters More Than Implementation Details

    One point worth emphasizing: the specific implementation—which language, CLI vs. GUI, how plugins are named—is not important. What truly has lasting value is the paradigm itself:

    • Frameworks become renewable resources: A released runtime is just one instance of the paradigm; the community can evolve its own versions based on the same formal foundation.
    • Model and framework evolve decoupled: Models improve through pre-training and post-training iterations; frameworks improve through component replacement and self-modification. Neither blocks the other.
    • Theory precedes engineering: First provide provable criteria for “what kinds of modifications are safe,” then discuss engineering implementation. This is more reliable than the traditional path of “build first, document later.”

    This explains why many deep design ideas are often first shaped through long-cycle engineering practice and only later distilled into theory—theory is an abstraction of years of practice, not an invention from scratch.

    Three Far-Reaching Impacts on Agent Development

    1. Self-evolving agents gain theoretical guardrails. With formal safety criteria for modifications, a model can autonomously modify the runtime without relying on human review of every change. Instead, it operates under transactional semantics—rollback on failure, commit on success. This dramatically reduces the trial-and-error cost of self-evolving systems.

    2. Agent infrastructure shifts from “application” to “kernel + ecosystem”. Analogous to the history of operating systems: once the kernel is stable and its interfaces are formalized, true innovation moves to the peripheral ecosystem. In the future, the competitive focus in the agent domain may partially shift from “whose model is stronger” to “whose kernel paradigm is more robust and whose component ecosystem is richer.”

    3. Long-duration tasks become viable. Task preservation means an agent can upgrade itself mid-task—e.g., integrating a new retrieval tool or swapping in a better planning strategy—during a complex multi-day task without losing any intermediate state. This is a qualitative change for research assistance, long-running automation, and similar scenarios.

    Practical Advice for Developers

    Even if you don’t directly build such a paradigm, the following principles are worth incorporating into everyday agent development:

    • Separate kernel from components: Keep the responsibilities of scheduling, state management, and tool registration cleanly bounded, leaving room for future hot-swapping.
    • Treat all modifications as transactions: Take a state snapshot before any configuration or code change, and allow rollback on failure.
    • Model modifications as events: Unify the channels for “execution” and “evolution” to avoid creating a privileged backdoor for self-modification.
    • Define the kernel by invariants: Write down the properties the kernel must always satisfy, and ensure no extension violates them.

    Conclusion

    The agent field is moving from a “capability race” to a “paradigm race.” Once “AI autonomously and safely modifies its own host framework” has formal foundations and engineering validation, self-evolving agents cease to be a vision and become a matter of implementation timeline. Understanding this idea of “dynamic composition + transactional modification” is perhaps the most valuable key for developers today to observe the future direction of agents.