2026-11-01 18:39:19 +00:00
|
|
|
# Runa — Rune Actors
|
|
|
|
|
|
|
|
|
|
Runa (short for **Rune Actors**) is an experimental project to build a
|
|
|
|
|
persistent, live programming world around isolated actors written in Rune.
|
|
|
|
|
The long-term vision combines an inspectable graphical environment with a
|
|
|
|
|
programmatic API and a VS Code extension, all connected to the same running
|
|
|
|
|
image.
|
|
|
|
|
|
|
|
|
|
## Status
|
|
|
|
|
|
2026-11-02 08:19:04 +00:00
|
|
|
Runa is at an early prototype stage. The executable runs a Phase 0 feasibility
|
|
|
|
|
experiment using Rune 0.14.2: script execution, native calls, async suspension,
|
|
|
|
|
instruction budgets, stepping, and compiled-code sharing. It also runs a minimal
|
|
|
|
|
single-worker actor demonstration with bounded mailboxes and explicit message
|
2026-11-02 09:08:49 +00:00
|
|
|
effects. Source and compiled implementation identities are BLAKE3 content
|
2026-11-02 12:20:45 +00:00
|
|
|
addresses with an in-memory compile cache. Persistence, canonicalization, the
|
|
|
|
|
network development API, graphical world, and VS Code extension are not
|
2026-11-02 09:18:07 +00:00
|
|
|
implemented yet. The code library now supports an in-memory versioned behavior
|
2026-11-02 12:11:11 +00:00
|
|
|
registry, and the CLI exposes publishing, history, rollback, safe-boundary
|
2026-11-02 12:20:45 +00:00
|
|
|
installation, pause/resume, and cancellation through a trusted in-process image
|
2026-11-02 12:36:32 +00:00
|
|
|
API. A versioned transport-neutral protocol contract is now defined, but no
|
2026-11-02 13:18:45 +00:00
|
|
|
network listener or authentication is implemented. The dispatcher is available
|
2026-11-02 13:30:22 +00:00
|
|
|
through a local JSON-lines stdio process, with a bounded request size. The
|
|
|
|
|
interactive CLI now uses the versioned protocol and dispatcher rather than
|
|
|
|
|
calling the image API directly.
|
2026-11-01 18:39:19 +00:00
|
|
|
|
2026-11-02 08:19:04 +00:00
|
|
|
The prototype uses worker-local invocation stacks and cooperative instruction
|
2026-11-02 12:11:11 +00:00
|
|
|
slices, and actor snapshots report basic active-execution progress. Native
|
|
|
|
|
callbacks are not preemptible; source-level debugging and persistent storage
|
|
|
|
|
are not implemented.
|
2026-11-01 18:39:19 +00:00
|
|
|
|
|
|
|
|
## Design goals
|
|
|
|
|
|
|
|
|
|
- Keep actor identity, mailbox, private state, behavior, and incarnation
|
|
|
|
|
separate.
|
|
|
|
|
- Use message passing rather than shared mutable state for actor interaction.
|
|
|
|
|
- Keep behavior implementations immutable and support safe, versioned updates.
|
|
|
|
|
- Expose the same runtime capabilities to in-world tools and external clients.
|
|
|
|
|
- Be explicit about execution, delivery, and persistence guarantees.
|
|
|
|
|
|
2026-11-01 19:15:00 +00:00
|
|
|
See [the architecture spec](docs/architecture.md) for the full vision,
|
2026-11-01 18:39:19 +00:00
|
|
|
architecture, roadmap, and open questions.
|
|
|
|
|
|
|
|
|
|
## Getting started
|
|
|
|
|
|
|
|
|
|
You need a Rust toolchain that supports the workspace's Rust 2024 edition.
|
|
|
|
|
|
|
|
|
|
Run the current executable from the repository root:
|
|
|
|
|
|
|
|
|
|
```sh
|
2026-11-02 09:24:43 +00:00
|
|
|
mise run run
|
2026-11-01 18:39:19 +00:00
|
|
|
```
|
|
|
|
|
|
2026-11-02 13:18:45 +00:00
|
|
|
For a local child-process protocol endpoint, run `mise run serve` and exchange
|
|
|
|
|
one JSON request per line on stdin; responses are written to stdout. Request
|
|
|
|
|
lines are limited to 1 MiB. This is not a network server and is intended for a
|
|
|
|
|
trusted parent process.
|
|
|
|
|
|
2026-11-02 13:40:56 +00:00
|
|
|
The `runa-client` crate can launch that process and exchange typed protocol
|
|
|
|
|
requests with request/response correlation. The VS Code extension is intended
|
|
|
|
|
to use an authenticated network connection to this same live image; actors
|
|
|
|
|
remain in the image regardless of how clients connect.
|
|
|
|
|
|
2026-11-02 13:18:45 +00:00
|
|
|
The CLI opens an interactive runtime session using the default counter behavior:
|
2026-11-02 08:31:25 +00:00
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
runa> spawn 0
|
|
|
|
|
spawned ActorId(1)
|
|
|
|
|
runa> spawn 10
|
|
|
|
|
spawned ActorId(2)
|
|
|
|
|
runa> send 1 1 2
|
|
|
|
|
message queued
|
|
|
|
|
runa> tick 100
|
|
|
|
|
runa> inspect 1
|
|
|
|
|
runa> inspect 2
|
|
|
|
|
runa> events
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The sender commits state `1` and sends a message to actor 2, which commits
|
2026-11-02 09:24:43 +00:00
|
|
|
state `15`. The CLI also supports publishing Rune source files as named,
|
2026-11-02 11:35:29 +00:00
|
|
|
versioned behaviors, viewing history, rolling back a behavior reference,
|
|
|
|
|
installing the current version on an idle actor, and cooperatively pausing and
|
2026-11-02 12:04:47 +00:00
|
|
|
resuming or cancelling actor invocations between scheduler ticks. Runtime
|
|
|
|
|
users can also supply an explicit state migration closure during installation;
|
|
|
|
|
the CLI's install command preserves state as-is. Use `help` in the session for
|
|
|
|
|
the complete command list.
|
2026-11-02 08:31:25 +00:00
|
|
|
See [the feasibility report](docs/rune-feasibility.md) for verified Rune
|
|
|
|
|
capabilities and limitations, and [the runtime guide](docs/runtime.md) for
|
|
|
|
|
the runtime contract.
|
2026-11-01 18:39:19 +00:00
|
|
|
|
2026-11-01 19:28:32 +00:00
|
|
|
## Development
|
|
|
|
|
|
|
|
|
|
Install [mise](https://mise.jdx.dev/) and run `mise install` to install Tombi.
|
|
|
|
|
Rust, rustfmt, and Clippy must also be available on your PATH.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
mise run format
|
|
|
|
|
mise run lint
|
|
|
|
|
mise run test
|
|
|
|
|
mise run pre-commit
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The pre-commit task runs formatting, linting, and tests in that order, stopping
|
|
|
|
|
on the first failure. Run it successfully before committing and review any
|
|
|
|
|
formatter changes. This is a task, not an automatically installed Git hook.
|
|
|
|
|
|
|
|
|
|
Tombi formats TOML files offline; rustfmt formats all workspace Rust code.
|
|
|
|
|
Clippy checks all workspace targets with warnings treated as errors, and the
|
|
|
|
|
test task runs `cargo test --workspace`.
|
|
|
|
|
|
2026-11-01 18:39:19 +00:00
|
|
|
## Project structure
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
.
|
|
|
|
|
├── Cargo.toml
|
|
|
|
|
├── crates/
|
2026-11-01 19:15:00 +00:00
|
|
|
│ ├── runa/ # Main binary
|
2026-11-02 09:08:49 +00:00
|
|
|
│ ├── runa-core/ # Shared stable identity types
|
2026-11-02 08:19:04 +00:00
|
|
|
│ ├── runa-actor/ # Actor value contracts
|
2026-11-02 09:08:49 +00:00
|
|
|
│ ├── runa-code/ # Source identities and compile cache
|
2026-11-02 08:19:04 +00:00
|
|
|
│ ├── runa-rune/ # Phase 0 Rune experiments
|
2026-11-02 12:20:45 +00:00
|
|
|
│ ├── runa-runtime/ # Single-worker actor prototype
|
2026-11-02 12:36:32 +00:00
|
|
|
│ ├── runa-image-api/ # Trusted in-process image operations
|
2026-11-02 12:44:33 +00:00
|
|
|
│ ├── runa-protocol/ # Versioned transport-neutral wire DTOs
|
2026-11-02 13:40:56 +00:00
|
|
|
│ ├── runa-server/ # Protocol dispatcher and local JSON-lines transport
|
|
|
|
|
│ └── runa-client/ # Local child-process protocol client
|
2026-11-01 19:15:00 +00:00
|
|
|
├── docs/
|
|
|
|
|
│ ├── architecture.md
|
2026-11-02 12:36:32 +00:00
|
|
|
│ ├── protocol.md
|
2026-11-01 19:15:00 +00:00
|
|
|
│ └── decisions/
|
|
|
|
|
├── runa-std/
|
|
|
|
|
│ ├── core/
|
|
|
|
|
│ ├── actors/
|
|
|
|
|
│ ├── ui/
|
|
|
|
|
│ └── tools/
|
|
|
|
|
├── scripts/
|
|
|
|
|
├── vscode/
|
|
|
|
|
├── examples/
|
|
|
|
|
└── tests/
|
2026-11-01 18:39:19 +00:00
|
|
|
```
|
2026-11-01 19:15:00 +00:00
|
|
|
|
|
|
|
|
`runa-std/` is reserved for the default Rune scripts loaded into an image.
|
|
|
|
|
`scripts/` is for general-purpose development automation. Root-level `tests/`
|
|
|
|
|
is reserved for system and end-to-end tests; it is not automatically discovered
|
|
|
|
|
by Cargo. Add an explicit runner when those tests are introduced, keeping Rust
|
|
|
|
|
crate integration tests within each crate.
|
|
|
|
|
|
2026-11-02 08:19:04 +00:00
|
|
|
Only the Phase 0 and minimal Phase 1 crates are present. Remaining crates will
|
2026-11-01 19:15:00 +00:00
|
|
|
be added as their functionality is implemented.
|