Agent-OS · cc_kernel/ · v1.0

A Single-Node Agent Operating System

The substrate that turns the legacy REPL/bridge into a long-running, multi-agent kernel: process table, capability model, quota ledger, scheduler, mailbox / registry, virtual filesystem, observability, and a frozen JSON-RPC contract — backed by a single SQLite WAL database.

Why this exists

Before cc_kernel/, CheetahClaws was an agent runtime / middleware: single-user REPL → tool dispatch → LLM. There was no place to:

The kernel layer adds all of that as opt-in surface, while keeping the legacy single-process REPL path byte-for-byte intact.

Layout

cc_kernel/
  api.py             # `Kernel` facade — open(...), make_supervisor(), …
  store.py           # SQLite WAL store, single shared connection
  schema.py          # Forward-only migrations v1 → v7
  capability.py      # tool_grants / fs_grants / net_grants / model_grants
  ledger.py          # Per-agent ResourceLedger + first_breach signal
  scheduler.py       # Priority queue + admission filter
  mailbox.py         # Direct + topic pub-sub (RFC 0009)
  registry.py        # name → pid (RFC 0010)
  agent_fs.py        # VFS unifying memory/checkpoint/skill/task
  sandbox.py         # RLIMIT + bubblewrap + wall-clock killer
  contract.py        # Frozen v1.0 method registry, drift CI guard
  cli.py             # `cheetahclaws kernel <action>` subcommand
  tools/             # Built-in tools (Echo, Read, Write, Glob, List,
                     # Diff, AST) and opt-in (Exec, Fetch, Git)
  runner/
    supervisor.py    # Subprocess agents w/ IPC + chunk streaming
    ipc.py           # Line-delimited JSON channel
    llm/             # LLM runner (Anthropic + scripted mock providers)
    bridge_mirror/   # bridges ↔ kernel.mbox without touching bridges/

Activation

Operators turn the kernel on via:

cheetahclaws serve --enable-kernel

Without --enable-kernel, the daemon serves the same surface as before and cc_kernel/ code stays dormant.

Kernel CLI

cheetahclaws kernel summary             # uptime, agents, queue rollup
cheetahclaws kernel info                # version, schema, API surface
cheetahclaws kernel agents [--state S]
cheetahclaws kernel proc <pid>          # combined per-agent view
cheetahclaws kernel events [--pid P]
cheetahclaws kernel queue [--state S]
cheetahclaws kernel registry [--prefix P] [--tag T]
cheetahclaws kernel methods [--tier T]  # documented kernel.* RPCs
cheetahclaws kernel prometheus          # Prometheus exposition text

RFC roadmap — 27 shipped, 2 parked

RFCTheme
0001Daemon design note (IPC, auth, originator)
0002Foundation roadmap (F-1..F-9)
0003AgentProcess + EventLog
0005Capability model
0006Per-agent quota ledger
0007Priority scheduler + admission filter
0008RLIMIT + bubblewrap sandbox
0009Mailbox + pub-sub IPC
0010Agent registry / service discovery
0011AgentFS — unified VFS
0012Observability + chaos suite
0013API stability + deprecation policy
0016Subprocess agent runner
0017WorkerLoop (scheduler ↔ supervisor glue)
0018Bridge ↔ kernel.mbox glue
0019LLM runner MVP
0020Multi-turn dialogue orchestrator
0021Tool dispatch + permission routing
0022LLM tool calling integration
0023Exec tool (argv-only, RLIMITed)
0024Glob + List built-in tools
0025Fetch tool (SSRF / DNS-rebind defended)
0026IPC streaming chunks
0027LLM streaming (provider opt-in)
0028Exec stdout / stderr line streaming
0029Fetch terminal-hop body streaming
0030Diff tool (path + text mode)
0031AST tool (Python source inspector)
0032Git tool (read-only, op+flag allowlist)
0014Multi-tenant — parked
0015Cluster — parked

Phasing: Phase 1 fault domain (0003 + 0008) → Phase 2 quota + capability (0005 + 0006) → Phase 3 scheduler + IPC (0007 + 0009 + 0010) → Phase 4 AgentFS (0011) → Phase 5 ops (0012 + 0013) → tools + streaming (0019-0032).

Tool inventory

Auto-registered

ToolPurposeFS grant
EchoSmoke-test the dispatch path
ReadRead a file, 4 MB capr
WriteWrite a file, 4 MB caprw
GlobPattern match (≤ 10k results)r
ListDirectory listingr
DiffUnified diff (path or text mode)r
ASTPython AST inspectorr

Opt-in (operator must call register_<tool>(registry))

ToolPurposeSandbox
Execargv-only subprocess, no shellRLIMIT + wall-clock + scrubbed env
FetchBounded HTTP, SSRF / DNS-rebind defendedper-hop cap check + IP block
GitRead-only git inspectorRLIMIT + op+flag allowlist + gitconfig disabled

The opt-in tools are not in register_builtin_tools because their threat surface is materially larger. Operators must explicitly opt in.

Streaming

Three layers stream incrementally to a single on_chunk(payload) sink:

Plumbed end-to-end through:

sup.wait(pid, on_chunk=lambda c: my_ui.append(c))

…where each chunk is a dict {op:"chunk", kind, content, metadata:{...}}. RunnerExitInfo.chunks accumulates the full sequence post-exit.

Backwards compatibility

Where to next

The kernel is at v1.0 production-grade for single-node use. Two RFCs remain explicitly parked:

Higher-ROI follow-ups: tag a v1.x release + CHANGELOG, integration performance tests under real LLM workload, operator documentation for --enable-kernel deployment.

Try the Kernel

One flag turns it on. Browse the RFCs for full design notes.