# Ohio Kernel Architecture

The **Ohio Kernel** is an AI-driven orchestration framework designed to manage, monitor, and optimize game servers. It is built as a modular "Template" that can be adapted to any server type.

## Core Components

### 1. The Bridge (`02_Bridge`)
- **Role**: Native Windows Sidecar (Rust).
- **Function**: Handles low-level system tasks, IPC communication, and provides a lightweight GUI (WinKi Widget).
- **Port**: `9060` (TCP) for Bridge-Brain communication.
- **Port**: `9898` (TCP) for Prometheus telemetry.

### 2. The Brain (`01_Brain`)
- **Role**: Intelligence Layer (Java).
- **Function**: Executes complex orchestration logic, processes logs, and interfaces with AI models.
- **Artifact**: `HiveMind_STANDALONE.jar`.

### 3. ZenkiLang
- **Role**: Configuration & Prompting (YAML).
- **Function**: Defines the "personality" of the assistant and (in future) the specific parameters for the server being managed.

## Server Integration (e.g., Hytale)

The Kernel integrates with a server via two primary methods:

1.  **IPC Handshake**: The Bridge attempts to sync with the server using a predefined protocol (e.g., `SYNC:HYTALE_SERVER:ACTIVE`).
2.  **Sidecar Monitoring**: External scripts (like `hytale_monitor.ps1`) pipe server output into the Kernel's processing pipeline.

## Data Flow Diagram

```mermaid
graph TD
    User([User]) <--> Widget[WinKi Widget]
    Widget <--> Bridge[Rust Bridge]
    Bridge <--> Brain[Java Brain]
    Bridge <--> Hytale[Hytale Server]
    Brain <--> ZenkiLang[ZenkiLang Config]
    Hytale <--> Assets[Assets/Mods]
```

## Modularizing for New Servers
To add a new server (e.g., Minecraft):
1.  Update `zenkilang.yml` with the new server's metadata (ports, log paths).
2.  Add a new `SYNC` handler in the Bridge.
3.  Create a `monitor.ps1` script for the new server.
