Skip to content

JSON-RPC on a connection: the package rule, method names, clashes - #81

Merged
Kinflou merged 2 commits into
masterfrom
feat/jsonrpc-connection
Oct 24, 2026
Merged

Kinflou merged 2 commits into
masterfrom
feat/jsonrpc-connection

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 24, 2026

Copy link
Copy Markdown
Member

The kernel part of JSON-RPC on a connection, plus its conformance fixture. Part of the cascade with core#138 (the @framing dictionary), runtime#25, comline-rust#74 and comline-typescript#69.

codegen (9b10108), which the generators pin:

  • connections::framing reads a protocol's @framing in either form, through core's FramingValue, falling back to the package's default_framing. features::used reads it the same way.
  • The package rule. Once any JSON-RPC protocol in a package runs on a connection (client- or both-provided), every JSON-RPC protocol does, so the server's API shares the connection its calls to the client use. on_connection takes the package's schemas to decide this. A datagram@2 connection doesn't take JSON-RPC protocols with it.
  • method_name gives the method JSON-RPC calls a function by: the bare name, or namespace.Protocol/function under method_names = qualified. Nested namespaces join with dots, e.g. chat.admin.Admin/kick.
  • check and bare_name_clashes refuse bare names one side of a connection couldn't tell apart: two protocols the same side provides, each with a function of the same name. The fix in the message is method_names = qualified. Lockstep protocols never clash, since a server serves one protocol.

conformance (second commit):

  • A connections_jsonrpc fixture: Chat on plain "jsonrpc" and Events on the qualified dictionary.
  • Both generators now claim connections ✅ supported (it was 🟡 partial), and FEATURES.md and features.json say so.
  • The connections_async golden changes only in its header comment, which names the runtime revision.
  • Pins comline-rust#74 and comline-typescript#69.

Tested: kernel unit tests for the reader, the package rule, method names and the clash check. Conformance passes for both generators.

Kinflou added 2 commits October 25, 2026 01:49
…lashes

`connections::framing` reads a protocol's `@framing` in either form
(core's `FramingValue`), falling back to the package's default. Once any
JSON-RPC protocol in a package runs on a connection, every JSON-RPC
protocol does, so `on_connection` takes the package's schemas.

`method_name` gives the method JSON-RPC calls a function by: the
function's name, or `namespace.Protocol/function` when the schema says
`method_names = qualified`. `check` refuses bare names one side of a
connection couldn't tell apart.
A `connections_jsonrpc` fixture: `connections` with `Chat` on plain
`"jsonrpc"` (on the connection by the package rule) and `Events` on
`{ name = "jsonrpc", method_names = qualified }`. Both generators now
claim `connections` supported, and this proves it. Pins comline-rust#74
and comline-typescript#69.
@Kinflou
Kinflou merged commit 54cd954 into master Oct 24, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/jsonrpc-connection branch October 24, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant