Skip to content

Pin generation 922847b, check clashes among reached protocols, spell nested protocol paths with :: - #169

Merged
Kinflou merged 1 commit into
mainfrom
fix/nested-namespaces-and-clashes
Nov 14, 2026
Merged

Kinflou merged 1 commit into
mainfrom
fix/nested-namespaces-and-clashes

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 14, 2026

Copy link
Copy Markdown
Member

Follows generation#147 and generation#148.

What changes

  1. Pin generation to 922847b (codegen comline-codegen and comline-conformance, xtask). Core stays at 868e8310. The generators already use addressing_in, so jsonrpc@1: check result as JSON and pass it on as written, not parsed #148's addressing(&GenerateRequest) needed nothing here.
  2. Clash check. connections::check(&req.schemas, &req.encodings) becomes connections::check_in(req): only the protocols the package reaches take part, so a dependency's jsonrpc protocol sharing a function name with the package's own no longer refuses generation.
  3. Display path. The generator spelled a protocol's path {namespace}::{name} from the request's /-joined namespace, giving chat/admin::Admin. It now reads chat::admin::Admin in the Hello comment, PROTOCOLS, and the checkCall text (what Unavailable and warnings show). One helper, display_path, built on facts::namespace_segments (the segments canonical_namespace joins with /).

Display text only. CONNECTION_IR_HASH is connection_ir_hash(&req.schemas) and IR_HASH is schema_ir_hash(units); neither reads this string, and the Hello bytes come from the facts. Wire numbers and ordering are unchanged.

Tests (codegen/tests/nested_namespaces.rs)

  • nested_protocol() fixture: the Hello comment, PROTOCOLS and checkCall read chat::admin::Admin; no chat/admin:: anywhere in the output.
  • The connection hash and the wire number in checkCall are unchanged for it.
  • dependency_and_own_protocols() switched to jsonrpc, plus a client-provided Events so the protocols share a connection: the old check refuses it, check_in doesn't, generation succeeds and the dependency's protocol is off Services. Two of the package's own with the same function name still clash.

Goldens

No existing golden changes (they all have one-segment namespaces). Two new ones, runtime/test/generated/nested/ and runtime/test/generated/clash/, so npm run typecheck:generated covers the new output.

…ell nested protocol paths with ::

- generation rev bumped to 922847b (#148) in codegen and xtask.
- connections::check_in(req) replaces check, so a dependency's jsonrpc
  protocol sharing a method name with the package's own no longer refuses
  generation (generation#147).
- A protocol's path in the Hello comment, PROTOCOLS and checkCall reads
  chat::admin::Admin, not chat/admin::Admin. Display text only; no number,
  order or hash is made from it.
@Kinflou
Kinflou marked this pull request as ready for review November 14, 2026 21:43
@Kinflou
Kinflou merged commit 22af9ed into main Nov 14, 2026
41 checks passed
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