Skip to content

rutis v0.11.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 01:22
· 2704 commits to main since this release
6f5ae44

rutis 0.11.0

中文 · 0.10.0 release notes

0.11.0 is released early and ships what is on main. Above all it brings leaf plugin events: Node, Bun, Python and Go plugins can send and receive events within their runtime process with ctx.on / ctx.emit, and receive the events the host sends (plugin API 2). Next come cross-language value types: dates and times, binary data, maps, sets, big integers, decimals and UUIDs now cross between Rust, Node, Bun, Python and Go, each language receiving its own native types. Third come remote runtimes: a runtime can connect to rutis by itself, one listener accepts many connections, and each connection is an instance; the Bun runtime can run remotely too. A few values now cross differently; see "Compatibility".

Packages

All of these are at 0.11.0:

Registry Packages
crates.io rutis (the core), rutis-bridge, rutis-loader, rutis-host; the dylib toolchain rutis-sdk, rutis-dylib, rutis-dylib-meta, rutis-dylib-launcher
npm @arcships/rutis, @arcships/rutis-runtime, @arcships/rutis-bun, @arcships/rutis-host, and the five platform host packages
PyPI rutis, rutis-host
Go github.com/arcships/rutis/go/rutis (tag go/rutis/v0.11.0)
GitHub rutis-host binaries for Linux / macOS (x64 / arm64) and Windows (x64), with SHA-256 files

rutis-cli is still released on its own.

New

  • Leaf plugin events (#366, plugin API): Node, Bun, Python and Go plugins gain ctx.on(name, listener) and ctx.emit(name, ...args) (in Go ctx.On and ctx.Emit). Events are dispatched within one runtime process: those a plugin emits itself, those other plugins in the process emit, and those the host sends in. Listeners are removed when their plugin unloads. ctx.emit calls listeners synchronously in the order they registered and does not wait for the Promises / coroutines they return. On the host side, the Rust API declares which events the host may send to a runtime (RuntimePlugin::emits, LocalRuntime::emits) and sends them with Process::emit: it waits for every listener to finish and gathers their errors in an AggregateError; undeclared names are refused. Node and Bun use Cordis's own event service and share one bus with Cordis plugins in the same process; Python and Go implement the same semantics. internal/* belongs to the runtime and cannot be listened to, emitted or declared. Events do not cross processes: the runtime → host direction is not available yet, and rutis.json has no way to declare emits yet. The test tools declare events at load and send them in with t.emit (Node, Python) or loaded.Emit (Go's rutistest).
  • Cross-language value types (#308, #355, #360, design, plugin API): the session protocol gains ten tagged values: points in time (instant), local dates and times (datetime), dates (date), times of day (time), binary data (bytes), maps (map), sets (set), big integers (bigint), decimals (decimal) and UUIDs (uuid). Wire formats and capabilities: protocol design §6.1. Each value has a capability value-<tag> and is sent only to a far end that declared it; to one that did not, only that call fails, the session goes on, and the protocol version does not change. Plugins write their language's native code and rutis does the conversion; in every language an integer beyond ±(2^53−1) crosses as a big integer automatically.
    • Rust (rutis-bridge): session::Value gains ten variants, with the types Instant, DateTime, Date, TimeOfDay, BigInt, Decimal and Uuid (small types of rutis-bridge's own, no chrono, num-bigint or uuid), and Bytes, ValueMap and ValueSet for generated code. An integer beyond ±(2^53−1) is sent as a bigint automatically (a JSON number in Value::Data, and i64, u64, i128, u128 fields through arg; design V6): it used to go as a JSON number (JS got the nearest double), and to a far end that did not declare value-bigint (0.10 and older) that call now fails; a received bigint decodes into an integer field that holds it. Value::json() fails on the new values (as on references), except a bigint that fits 64 bits (it gives the number). A host forwarding a call checks again against the downstream far end's capabilities; Process::emit checks its arguments against the runtime's; an event forwarded between nodes (NodeEvent) holding a new value is refused.
    • Cordis generator: Date → Instant, Uint8Array → Bytes, bigint → BigInt, Map<K, V> → ValueMap<K, V>, Set<T> → ValueSet<T> (keys limited to strings, numbers, booleans and bigints); ArrayBuffer, Buffer and DataView are still not bound.
    • Node, Bun (#410): a Date crosses as a point in time, a Uint8Array (Buffer included), ArrayBuffer or DataView as binary data, and a Map, Set or bigint as its own type. A point in time arrives as a Date (truncated to the millisecond), binary data as a Uint8Array, and maps, sets and big integers as Map, Set and bigint; local date-times, dates, times of day, decimals and UUIDs have no JS type and arrive as plain strings, their content complete. An integer from another language arrives as a number within range and as a bigint beyond ±(2^53−1). @arcships/rutis exports the constructors rutis.datetime(…), rutis.date(…), rutis.time(…), rutis.decimal(…) and rutis.uuid(…), for creating one of these five values from nothing or passing one on as its type; a plain string is still a string. Other typed arrays (such as Int16Array) cannot cross, since their element type would be lost.
    • Python (#412): a datetime with a time zone crosses as a point in time (arriving in UTC), a datetime without one as a local date and time, and date, time (without a time zone), bytes (bytearray and memoryview included), set (frozenset included), Decimal and UUID as their own types; a dict with a key that is not a string crosses as a map. They arrive as the same Python types. datetime, Decimal and UUID cross by value, no longer by object reference. An int beyond ±(2^53−1) crosses as a big integer automatically. A received big integer or map is a subclass of int or dict, used as an int or dict as usual; passed on as it is, it is still a big integer or map, so a 5n from JS passed back to JS through Python is still 5n. Times keep microseconds; finer digits are truncated.
    • Go (#413): a time.Time crosses as a point in time (UTC, to the nanosecond), a []byte as binary data, a map whose keys are not strings as a map, a map[K]struct{} as a set, and a *big.Int or an integer beyond ±(2^53−1) as a big integer; the new types rutis.DateTime, rutis.Date, rutis.TimeOfDay, rutis.Decimal and rutis.UUID stand for the other five values. Struct fields and the items of slices and maps are each encoded by these rules (field names still follow json tags), no longer through encoding/json. Received values decode into the declared Go types; decoded into any, a map is a map[any]any, a set a slice without duplicates, and a big integer a *big.Int.
    • The test tools (@arcships/rutis/testing, rutis.testing, Go's rutistest) pass values by the same rules and are checked against the same expectations file as the real runtimes; rutistest joins that check in this release.
  • Runtimes that connect in (#382, #383, #384, design, connecting nodes): a runtime on a remote machine can connect to rutis by itself, for machines behind NAT, whose address changes, or whose number changes (many devices, autoscaled workers).
    • The runtime side: the Python, Node and Bun runtimes and Go plugin binaries all take dial:wss://… --id <id> --peer <rutis id> <project>, with the token in RUTIS_TOKEN and, when rutis uses a self-signed certificate, its CA in RUTIS_CA. --id must be unique per process: two processes with one id keep taking over from each other. It reconnects by itself: the delay starts at 0.5 s and doubles up to 30 s; a refused token or id is retried every 30 s; an incompatible protocol exits with 1; SIGTERM / Ctrl-C unloads the rows and exits with 0. Every disconnect unloads the rows, and each reconnection is a new session. Status lines go to stderr: connected to …, connection lost (…); retrying in …, refused: auth-rejected (…), refused: incompatible (…); stopping. Python dialing out works on CPython 3.13.6 too (listening still does not).
    • The rutis side: runtimes.remote[] in rutis.json gains listen (a listener name from the top-level listen) and instances (an instanced group), written together, with no link row. One listener accepts many connections; all of them present the same token (RUTIS_TOKEN_<NAME>, or RUTIS_TOKEN) and each declares its own id. Every connection is one instance of the group: created when it connects, closed when it disconnects, and taken over by a new connection with the same id. The group's rows run in each instance on that connection, and the services they provide are seen only in that instance; when a connection lacks a plugin, that row fails in that instance alone. Only one of the two fields, a missing listener or group, or a missing token is a rutis-host start-up error.
    • Rust libraries: rutis-bridge gains AccessPointPlugin (one listener accepting many runtime connections) and the identity layer Admission, SharedToken; rutis-loader gains RuntimeInstances (one instance per connection).
  • The Bun runtime can run remotely (#384): the Bun runtime can listen (listen:wss://…, with the certificate in RUTIS_CERT and RUTIS_KEY) and dial out; language in runtimes.remote[] accepts "bun", with rows named <runtime name>:<module>.
  • The Go runtime joins wait-cycle detection (#385): the Go runtime declares sync-wait. When synchronous calls through a Go plugin would form a wait cycle, the caller receives SyncWaitCycle instead of possibly hanging. The Node, Python, Bun and Go runtimes are now all covered.
  • Documentation: the app integration design (#381); task guides for coding agents in .agents/skills/ (remote plugins, adding a runtime; #393).

Fixes

  • When a row was unloaded and its runtime closed right after, or all of a runtime's services were withdrawn, while another service was being published, the withdrawn service could stay in rutis for good (#372). The withdrawal now always completes. Every runtime was affected; a Bun test found it first.
  • The 0.10 known issue, three value inconsistencies between languages (#355), is handled with the value types: Python's datetime, Decimal and UUID cross by value; time.Time, []byte and big integers in Go struct fields are checked one by one; a key whose value is undefined in a Python dict becomes None, consistent with null in the other languages.

Tests and quality

  • A conformance test for dialing out in every language (dial_conformance): Python, Node, Bun and Go run the same cases against one access point.
  • The CI redesign (nightly runs, a release gate, self-hosted runners) and a few fixes to intermittent failures, with no user-visible change.

Compatibility

  • Plugin API 2: definePlugin / define_plugin / rutis.Define mark plugins with plugin API 2 (leaf events). 0.11 runtimes still accept API 1 plugins. Plugins written with the 0.11 SDK need a 0.11 runtime; an older runtime refuses to load them and says what to upgrade. Go plugin binaries also need a 0.11 host. Protocol versions are unchanged: local sessions are still protocol 2 and sessions with endpoint identities protocol 3; the Go manifest format is unchanged.
  • SDK dependencies: @arcships/rutis and @arcships/rutis-bun now depend on @deepseek-ai/cordis 4.0.4 (one package, with no dependencies of its own). @arcships/rutis used to have no dependencies; its test tool now runs the plugin on Cordis's event service. Plugins do not load the test tool at run time.
  • rutis.json: still format 1. runtimes.remote[] gains the optional fields listen and instances, and language gains "bun". Existing files need no change; a 0.10 rutis-host cannot read a file that uses them.
  • Some values cross differently (design §8), and plugin code may need changes:
    • Python: datetime, Decimal and UUID used to cross by object reference (the far end got a proxy); they now cross by value.
    • Go: time.Time, []byte and integers beyond ±(2^53−1) inside structs used to go through encoding/json (becoming strings, base64, or unchecked); they now cross as their value types.
    • Go: map[string]struct{} used to cross as an object; it now crosses as a set.
    • Python: a dict key whose value is undefined used to be dropped; it is now None, as in the other languages.
    • Integers beyond ±(2^53−1) used to be refused when Python or Go sent them, and arrived in JS as the nearest double when Rust sent them; they now cross as big integers automatically, with no change to your code. JS receives them as bigint (within range they are still number). A JS number beyond that range is still inexact; use bigint to be exact.
    • In JS, local date-times, dates, times of day, decimals and UUIDs arrive as strings; passed on from JS they lose their type; to send or pass them on as their type use rutis.datetime(…), rutis.date(…), rutis.time(…), rutis.decimal(…), rutis.uuid(…).
    • Values refused in 0.10 (JS Date, Map, Set, Uint8Array, bigint; Python set, bytes, and so on) can now cross, and the test tools no longer refuse them.
  • Mixing with older versions: new values are sent only to 0.11 far ends. With runtimes of 0.10 and earlier, calls carrying a new value (integers beyond ±(2^53−1) included) still fail; other calls are unaffected. Both ends must be on 0.11 to pass the new values.
  • Wire: the frame depth limit goes from 144 to 208 levels (one map level takes three JSON levels on the wire); values still nest at most 64 levels.
  • Rust API:
    • rutis-bridge's session::Value gains ten variants and is marked #[non_exhaustive]: code matching Value exhaustively needs a _ => arm. Later variants will not be breaking changes. Value now implements PartialEq.
    • rutis-bridge's ChannelError gains the variant Rejected (the far end refused this side's id after the channel opened, WebSocket close code 4003): code matching it exhaustively needs another arm.
    • The Rust side declares the value-* capabilities in its handshake (in both formats).
    • New: RuntimePlugin::emits, LocalRuntime::emits, Process::plugins, and the access point, RuntimeInstances and Unavailable above.
    • rutis is unchanged, and rutis-loader has no breaking changes.
  • dylib: dylib plugins must be recompiled with the 0.11.0 SDK.
  • Minimum versions are unchanged: Rust 1.88, Node 22, Python 3.10, Bun 1.4, Go 1.24.

Known issues

  • Bun cannot tell "the server certificate is not trusted" from other TLS handshake failures, so when Bun dials out every TLS handshake failure counts as an authentication failure and is retried every 30 s.
  • On Windows, a Node runtime dialing out is stopped by the console passing Ctrl-C on to its child process; this has not been tried on Windows.

Getting started

npx @arcships/rutis-host@0.11.0 new greeter --lang node
uvx --from rutis-host==0.11.0 rutis-host new greeter-py --lang python

Then read TypeScript plugins, Bun plugins, Python plugins, Go plugins, embedding in Rust or connecting nodes.