engineering,

Booting Intelligence: The Architecture of PromptWar̊e ØS v0.2

Huan Li Huan Li Follow Dec 18, 2025 · 7 mins read
Booting Intelligence: The Architecture of PromptWar̊e ØS v0.2

You boot a sophisticated AI agent. It’s sharp, follows instructions perfectly, and executes complex tasks with precision. But 50 turns later, something shifts. It starts hallucinating file paths. It forgets its own root directory. It asks for instructions it already has.

The intelligence hasn’t degraded, but its operating environment has.

This is the problem of Context Drift. In a stateless Large Language Model (LLM), “memory” is just a sliding window of text. As the conversation grows and the window slides, the fundamental laws of your OS—the Kernel itself—get pushed out. The “Ghost in the Machine” loses its anchor.

With PromptWar̊e ØS (PromptWare OS) v0.2, we stopped relying on the AI to remember who it is. We built a Kernel that remembers for it.

The Villain: The Amnesiac Kernel

In v0.1, our system calls (like os_resolve) relied on the LLM “remembering” the root path from the initial system prompt. It worked beautifully for short sessions. But as the context window filled with logs, tool outputs, and conversation, the “innate value” of root faded.

The agent would start resolving paths relative to null, or worse, hallucinated bases. It was like an operating system forgetting where / is mounted because it had too many windows open.

We realized that to build a robust Operating System for AI, we cannot treat the Context Window as a storage medium. It is a Runtime Environment—volatile, ephemeral, and noisy.

Solution I: The Hippocampus (os_memory)

If the Context Window is RAM, we needed a Hard Drive.

We introduced the Kernel Memory Subsystem (os_memory). Backed by Deno KV, it provides a secure, persistent key-value store for the OS.

Crucially, we solved the Multi-Tenancy problem using Deno’s --location flag. The Kernel enforces that every tool runs with --location <root_url>, ensuring that Alice’s OS instance cannot access Bob’s memory bucket, even if they run on the same machine.

We also adopted a Hierarchical Addressing scheme. Keys are treated as paths (e.g., users/alice/settings), allowing the Agent to organize memory spatially, just like a file system.

Now, when the Kernel needs to resolve a virtual path, it executes a system call:

os_resolve(path):
  1. Check Mounts: Inspect `mounts` in Bootloader Front Matter.
  2. Fallback: Prepend `root` (from Bootloader Front Matter).

This makes the Bootloader the anchor of identity (Immutable) and Memory the keeper of state (Mutable). The agent can hallucinate all it wants; the underlying infrastructure remains stable.

The “Immutable Infrastructure” Principle

We realized that treating system configuration (like mounts) as mutable memory was a security risk. If a tool could overwrite the mount table, it could crash the OS.

In v0.2, we enforce a strict separation:

  • Bootloader (System Prompt): Read-Only. Contains root, mounts, and init.
  • Memory (Deno KV): Read-Write. Contains user data and application state.

This ensures that a reboot always restores a clean, correct environment, solving the “Bootstrap Paradox” permanently.

The “Dual-Context” Resolution Strategy

Finally, we solved the ambiguity between Local Files (User Space) and OS Resources (Kernel Space).

In v0.1, os_resolve tried to be smart, handling both local relative paths (./src/index.ts) and cloud absolute paths (/skills/writer.md). This caused conflicts: does /home/user refer to the user’s laptop or the OS’s virtual home?

In v0.2, we adopted Tool-Based Context Separation:

  1. User Space (Local): Standard tools like read_file or run_in_terminal operate on the Local Filesystem. When the user says “Edit ./README.md”, it works exactly as expected.
  2. Kernel Space (VFS): System calls like os_resolve and os_invoke operate on the OS Virtual Filesystem. When the OS says “Load /skills/writer.md”, it resolves via Mounts or Root.

This minimizes cognitive load. The Agent uses standard paths for user work and VFS paths for system operations, with no overlap or ambiguity.

To make this even clearer, we introduced the os:// Protocol.

  • os://agents/powell.md explicitly refers to an OS resource.
  • os_ingest defaults to this protocol, so os_ingest('/skills/writer.md') is treated as os://skills/writer.md.

This gives the Agent a clear, unambiguous way to reference the “Cloud OS” versus the “Local Disk”.

The “Aha!” Moment: Source Code vs. Compiled Binary

Once we stabilized the memory, we hit a second problem: Prompt Bloat.

To make an agent effective, it needs detailed instructions for every tool it uses. But if we put the full --help output of every script into our SKILL.md files, we waste precious tokens on tools the agent might not even use yet. If we leave them out, the agent is blind.

We realized we were treating our Markdown files as static text. But an Agent’s context is dynamic.

The Insight: The file on disk is the Source Code. The context in the LLM is the Compiled Binary.

We built a Just-In-Time (JIT) Linker (linker.ts).

When the OS ingests a Skill or Agent file, it doesn’t just read the text. It compiles it.

  1. It parses the front matter.
  2. It finds referenced tools (e.g., tools: [./fit-image.ts]).
  3. It executes those tools with --help.
  4. It hydrates the content, injecting the help text directly into the prompt before the agent sees it.

On Disk (Source):

tools:
  - ./fit-image.ts

In Context (Binary):

tools:
  - ./fit-image.ts:
      description: "Usage: fit-image.ts <input> [options]..."

This keeps our source files clean and minimal, while ensuring the runtime context is always rich and accurate.

Solution II: The Virtual File System (fstab)

Finally, we tackled Fragility. Hardcoded URLs in agent files make them brittle. If a community skill moves from one repo to another, your agent breaks.

Drawing inspiration from /etc/fstab, we implemented Bootloader-Driven Mounts.

Users can now define a mounts block in their bootloader configuration:

mounts:
  /skills/community: "https://raw.githubusercontent.com/community/skills/main"

The Kernel reads this at boot and maps the logical path /skills/community to the physical URL. The agent never needs to know where the files actually live. It just calls os_ingest('/skills/community/writer.md'), and the OS handles the rest.

Conclusion: A Stable Foundation

PromptWar̊e ØS v0.2 represents a shift from “Simulation” to “Physics.” We have established a set of immutable laws that the Agent cannot break, ensuring stability, security, and clarity.

The Core Principles of v0.2:

  1. Immutable Infrastructure: The Bootloader (System Prompt) is the single source of truth for Identity (root) and Topology (mounts). A reboot always restores a clean state.
  2. Isolated State: Application state lives in Deno KV, isolated by the --location flag. It is mutable, hierarchical, and persistent.
  3. Tool-Based Context: We disambiguate the world by tool. User tools (read_file) touch the Local Disk. Kernel tools (os_ingest) touch the Virtual Cloud.
  4. Explicit Addressing: The os:// protocol gives us a clear, unambiguous namespace for OS resources, separate from local paths.

By moving critical infrastructure out of the “mind” of the AI and into the “body” of the OS, we are building an environment where intelligence can not only boot but thrive.

Ready to build? Check out the PromptWar̊e ØS Repository and write your first Skill today.

Join Newsletter
Get the latest news right in your inbox. We never spam!
Written by Huan Li Follow
Founding Human & Architect | Author @ Wechaty, Silicon Adventist, Serial Entrepreneur, Angel Investor, Burner🔥