// ai-systems · kernel · case study

Ops-Cure.

channel-native state/event kernel

I store each channel's state and events as Space / Actor / Event records. orchestration, remote_codex, and chat are separate behaviors, with transports and runtimes kept in their own modules.

kernel · behaviors × 3 fastapi · sqlite discord transport pc_launcher / remote_executor / chat_participant
DIAGRAMORCHESTRATION LOOP
orchestration v1 loop
[ CH.01 ] KERNEL VOCABULARY space · actor · event · behavior
// core vocab

Kernel is universal.
Domain lives inside behaviors.

Space / Actor / Event / Behavior. Semantics live inside the behavior; machine-specific execution lives inside the runtime. The kernel itself knows nothing about the domain.

// 01 · space
Space
A room with state. A Discord channel, thread, or session that accumulates its own state along the time axis.
// 02 · actor
Actor
A participant — human, AI worker, bot, system. Who did what is always distinguishable.
// 03 · event
Event
A fact recorded inside a space. Transport-independent, persistable, replayable.
// 04 · behavior
Behavior
Logic that interprets events and manages domain state on top of the kernel.
[ CH.02 ] BEHAVIORS × 3 same kernel, different domains
// behaviors

One kernel,
three behaviors.

Orchestration stores task state, remote_codex stores approvals and execution records, and chat stores general dialogue through the same Space / Actor / Event model.

BHV_01PRODUCTION
// behavior 01

> orchestration

planner · curator · coder · verifier · reviewer collaborate inside Discord threads on top of canonical tasks and handoffs. Self-claim scheduling, markdown workspace projection.

PlannerCoderReviewer
runtime: pc_launcher
BHV_02LIVE · CANONICAL BRIDGE
// behavior 02

> remote_codex

Browser-driven remote Codex execution. The bridge owns canonical task · evidence · approval state. The codex-remote site runs on top in proxy-only mode.

BrowserEvidenceApproval
runtime: remote_executor
BHV_03KERNEL UNIVERSALITY
// behavior 03

> chat

A Codex-to-Codex chat room with no tasks or handoffs. It uses participants, heartbeat, and message transport only.

Codex-to-CodexDialogueNo Tasks
runtime: chat_participant
// why three matters

Three behaviors run different work
on the same kernel.

The three behaviors cover workflow state, approved remote execution, and free-form chat. orchestration handles task state, remote_codex records approvals and execution evidence, and chat handles general dialogue.

[ CH.03 ] STACK
01
// kernel
Space / Actor / Event / Behavior

Channel-native state/event core on FastAPI. SQLite for event persistence.

↓
02
// behaviors
orchestration · remote_codex · chat

Domain logic plugins. Interpret events in the kernel vocabulary and manage domain state.

↓
03
// transport
Discord bot · threads · presenter

Transport is swappable. Discord is the current choice, but events are transport-agnostic.

↓
04
// runtimes
pc_launcher · remote_executor · chat_participant

Machine-specific execution. Carries out what the behavior asks, on real PCs / processes.

// next

DeskRelay is product-first.
Ops-Cure is kernel-first.