Skip to content

rutis v0.19.1

Choose a tag to compare

@github-actions github-actions released this 30 Oct 07:28
· 1055 commits to main since this release
4243702

rutis 0.19.1

中文 · 0.19.0 release notes

0.19.1 fixes the places where the 0.19.0 developer-experience evaluation (#663) found that what the documentation says does not work, and adds the three Rust APIs Dim needs to upgrade to 0.19. Plugin code and rutis.json stay as they are; the "Behaviour changes" section lists every difference you can see.

Hosts

  • A reconcile after ready() always loads the runtimes' rows (#934, #945). A host following Build a host open to plugins, waiting for RuntimeHandle::ready() and then calling reconcile, sometimes found a Node runtime's row still at waiting for runtime <name> after reconcile returned, and could not find its services then. Now, when reconcile returns, every row is running or listed in failures; the same holds for hosts that do not call follow_row. After a runtime restarts (restart(), once the new process's ready() returns), its rows load again by themselves at once, without Loader::reload; while the loader is doing another operation (for example a reconcile that has not returned), they wait for it to end. 0.19.0 already did this; section 3 of the guide now says so.
  • A runtime plugin is starting from when it is made (#964). A host following the guide mounts its runtime with root.plugin(runtime) (not awaited) and then awaits RuntimeHandle::ready(): on a busy machine, before SpawnPlugin's apply began, its state was Idle, ready() returned None at once, and the host took the runtime for one that failed to start. Now it is Starting from SpawnPlugin::new, and ready() waits for the start to end; Idle means stopped only. The start count (RuntimeHandle::starts) counts once on coming into Starting, not again when apply begins.
  • The synchronous waterfall is back, as ctx.waterfall(event).sync(terminal) (#946, #947). 0.19.0 removed waterfall_sync, and the replacements the migration guide gave (the asynchronous waterfall, the synchronous bail) cannot chain synchronous middleware. Now the same waterfall ends with .sync(terminal) and runs to the end synchronously: listeners registered with on_sync call next as before; asynchronous listeners registered with on, and listeners in another process, fail with AsyncListener (listener of t/draft in row chat, in another process, is asynchronous and cannot run in a synchronous waterfall). The terminal must be Send. The waterfall_sync(event, terminal) of 0.17 / 0.18 becomes waterfall(event).sync(terminal); the table in migrating to 0.19 is updated.
  • Loader::instance_rows(instance) (#941, #960): the rows running in an instance now, as (row id, FiberView), nested instances included, the instance's own group not; in configuration and creation order; empty when the instance was removed or does not exist. It reads the current state each time and does not build configuration and Schema for every row (before, the only way was to take everything from entries() and filter).
  • Copies of plugin definitions from other languages mount in the host's own instances (#948, #961). Definition::at works out the instance a copy is in from the plugin's place in the tree, and no longer requires a loader instance. A host mounts an ordinary plugin with ctx.plugin, calls ctx.mark_scope("session") in it, and declares as before with ServiceCatalog::register_shared_instance which group a name belongs to; the copy then resolves to the services in that instance. mark_scope moves from rutis::internal to a public method of Ctx, with the same name and behaviour. Copies in loader instances do not change.

rutis-host

(#935, #944)

  • run / dev check a row's configuration against the plugin's Schema at start, as check and reloading while running do. Before, a configuration check refused started all the same with run, and the plugin got the wrong value; now the row fails at start: greeter: config: greeting should be a string, got 3.
  • Python plugins add installs in a uv project are no longer removed by uv sync. When the Python runtime's project directory (runtimes.py.project, by default the directory of rutis.json) has pyproject.toml and uv.lock, the host uses the .venv there, and uv is installed, add / upgrade / remove use uv add --dev / uv remove --dev, and the plugin is recorded in pyproject.toml. Otherwise uv pip is used as before.

Testing tools

  • TypeScript: the process exits after a test whose call never returns fails on its timeout (one item of #933, #943). Under node --test (npm test, the template, CI), once the timeout of node:test fails the test, npm test prints the summary and exits with 1; before, the process never exited and CI hung. Running the file directly with node is unchanged.

Documentation

  • The TypeScript test example in section 5 of Build a host open to plugins passes as written: the fake service in the test returns its result directly, and the guide says why (#932, #942).
  • The first step of the Swift plugin guide installs rutis-host (swift test needs it) (#931).

Behaviour changes

Where Before Now
A SpawnPlugin's state after it is made, before its apply Idle; ready() answers None at once Starting; ready() waits for the start to end
When reconcile returns after ready() a runtime's row may still be waiting for runtime <name> running, or in failures
rutis-host run / dev start with a configuration that does not match the Schema runs as usual the row fails: <row>: config: …
rutis-host add / upgrade / remove of a Python plugin in a uv project uv pip install / uninstall uv add --dev / uv remove --dev, recorded in pyproject.toml
TypeScript test: a call never returns, node:test times out the process does not exit prints the summary, exits with 1
Definition::at in an instance the host marked itself "tools" is a service inside "session" instances: put the row in the "session" group mounts; the copy uses the services of its instance

Compatibility

  • The protocol is unchanged and 0.19.1 connects with 0.19.0 as usual. The formats of rutis.json and rutis.dev.json are unchanged.
  • New public API: in rutis, Waterfall::sync and Ctx::mark_scope (moved from rutis::internal::CtxInternal; code that uses that trait still compiles); in rutis-loader, Loader::instance_rows.
  • In a uv project, a plugin installed by 0.19.0's add that has not been through uv sync makes 0.19.1's remove fail, because pyproject.toml does not have it: run uv pip uninstall --python .venv/bin/python <package>, then rutis-host remove <row> again; it says the package is no longer there and removes the record in installed and the row as usual. If uv sync has run, the plugin is already gone: add it again.

Packages

All of these are version 0.19.1: on crates.io rutis, rutis-macros, rutis-bridge, rutis-loader, rutis-types, rutis-host, rutis-sdk, rutis-dylib, rutis-dylib-meta, rutis-dylib-launcher; on npm @arcships/rutis, @arcships/rutis-runtime, @arcships/rutis-bun, @arcships/rutis-host and the five platform packages; on PyPI rutis, rutis-host; the Go module github.com/arcships/rutis/go/rutis (tag go/rutis/v0.19.1); the Swift package (v0.19.1); the rutis-host binaries on the GitHub release page. The Kotlin SDK, as in 0.19.0, is used from source at the tag v0.19.1.