# klbr

klbr is one continuous agent runtime. Rust owns durable state, scheduling, provider/effect
execution, limits, recovery, and Python worker supervision. Python owns normal skills and
behavior policy. The browser uses one versioned lane protocol.

## active path

- `klbr-daemon`: service composition, scheduling, HTTP/WebSocket server, operator CLI
- `klbr-runtime`: SQLite runtime store, kernels, effects, releases, remote execution
- `klbr-core`: provider adapter, request/context contracts, configuration
- `klbr-ipc`: v2 client/server wire values and cursor logic
- `klbr-discord`: Twilight transport adapter feeding the runtime ingress boundary
- `python/klbr-runtime`: persistent workbench, hooks, and the `klbr` Python SDK
- `klbr-web`: bundled Svelte lane client

There is no legacy runtime mode, legacy memory database, Rust model-tool registry, benchmark
crate, or v1 client protocol in the normal source tree.

## run from source

These argv commands work from Nushell:

```text
bun run --cwd klbr-web build
cargo run -p klbr-daemon --bin klbr-daemon -- doctor
cargo run -p klbr-daemon --bin klbr-daemon -- serve
```

Open `http://127.0.0.1:8765/`. Set `KLBR_CONFIG` for the primary model and
`KLBR_DATA_DIR` for durable state. See [DOGFOOD.md](DOGFOOD.md) for paths and operator
commands. Source dogfooding is the current path; Nix packaging is deferred.

## invariants

- runtime Store is the only normal history/work owner
- admitted input commits before acknowledgement or execution
- one Python tool is model-visible; host effects remain typed
- output is diagnostic unless an explicit delivery operation confirms speech
- operator stop/reset/drain/activation never depend on model cooperation
- model, kernel, context, behavior, and service generations are distinct
- failed or unknown effects remain durable facts; they are never rewritten as success
