Skip to content

Take nested-schema protocols' facts and dependency-aware clash checks from generation 922847b - #161

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

Kinflou merged 2 commits into
mainfrom
fix/nested-namespaces-and-clashes

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Follows generation#147 (dependency-aware clash checks) and generation#148 (chat/admin and chat::admin meet when looking up a protocol's facts).

The failing case: a package whose protocols are in nested schemas (src/chat/admin.ids) on the defaults (datagram@3 + comline@2). comline generation refused it with

protocol chat/admin::Admin uses datagram@3 with comline@2, which address it by the wire numbers its package's history assigns, and the package's facts have none for it ...

because the request spells the namespace chat/admin (sc.namespace.join("/")) and core's facts spell it chat::admin.

Changes

  • Pins comline-codegen, comline-doc-markdown, comline-doc-html to generation 922847b, comline-codegen-rust to comline-rust#128 (ac7fd8b) and comline-codegen-typescript to comline-typescript#169 (4db92c2). Core stays at 868e831. Manifest edit only; Cargo resolved the lockfile.
  • src/lang_targets.rs: the build's clash check is checks::method_name_clashes_among(&schemas, &dependencies, &framings), with the dependency names taken from the compiled context's dependency_configs, as commands/generation.rs does for GenerateRequest::dependencies.

Tests

  • generation::a_protocol_in_a_nested_schema_finds_its_facts and generation::a_built_versions_nested_protocol_finds_its_facts_too (package_versions = "all" after build and release): no dependencies, src/chat/admin.ids, comline generation for rust and typescript succeeds and writes the files.
  • build::a_dependencys_jsonrpc_method_name_is_no_clash_for_the_packages_own: a package depending on a local package whose jsonrpc Chat::send shares a name with the package's own jsonrpc Admin::send is not refused. The package has a client-provided protocol, which is what puts its jsonrpc protocols on a connection.

They fail on the old pin

The first commit on this branch is the tests alone, on the old pin (generation da81b68, generators 6db2757/bcec31d). Its CI run (https://github.com/ComlineProject/cli/actions/runs/43642136677) failed on every test job with both nested-schema tests, with exactly the error above. The clash test passed there only because its first version didn't put the package's protocols on a connection; I fixed it (checked locally: it fails with protocols admin::Admin and shared/chat::Chat both have a function send when only the generation pin is bumped and lang_targets.rs is left alone, and passes with the change).

Kinflou added 2 commits November 15, 2026 05:18
…tion#147, #148)

On the old generation pin: a package with a protocol in src/chat/admin.ids
is refused for want of facts, and a dependency's jsonrpc method name clashes
with the package's own.
…s among the package's own protocols

The build's method-name clash check takes the package's dependency names
from its compiled context, as comline generation does, so a dependency's
jsonrpc protocol is no clash for the package's own. The test now gives the
package a client-provided protocol, which is what puts its jsonrpc
protocols on a connection.
@Kinflou
Kinflou marked this pull request as ready for review November 14, 2026 21:44
@Kinflou
Kinflou merged commit 69cb3c9 into main Nov 14, 2026
23 checks passed
@Kinflou
Kinflou deleted the fix/nested-namespaces-and-clashes branch November 14, 2026 21:47
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