Skip to content

comline.toml: core's package-wire freeze, and framings judged by their frozen facts - #99

Merged
Kinflou merged 1 commit into
masterfrom
comline2/shared-wire-facts
Nov 8, 2026
Merged

Kinflou merged 1 commit into
masterfrom
comline2/shared-wire-facts

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 8, 2026

Copy link
Copy Markdown
Member

Follow-up to comline@2 (ComlineProject/runtime#15).

1. No copy of core's package-wire freeze

source::apply_package_wire (from language-server#98) copied core's private logic for freezing a package's wire.framing and default handshake into its protocols, and had already drifted: it froze a stated handshake's parameters as the plain name. It's deleted. The comline.toml context now calls core's schema::ir::package_wire::apply_package_wire (core#209) with the package's frozen config (source::declared_config, the interpretation declared_wire already did, now public). declared_wire stays, built from it.

2. Framings judged by their frozen facts

The used-encodings check only knew the official framings' grammar, from their embedded profiles, so a third party's JSON framing never asked for json@1's mapping. Now:

  • source::declared_encoding_units(manifest, path) freezes each encodings entry of a manifest as core does, reading its profile from beside the manifest, so the unit carries the frozen grammar, calls and directions. Entries are frozen one at a time: one whose profile can't be read (not on disk, mid-edit, wasm) keeps its name, kind and mappings and states nothing.
  • Context::from_files collects them for the package's manifest and every dependency's (Context::declared), and computes used with generation's encodings::used_as_declared (generation#123), the same function comline generate's encodings::fill calls. The editor and the CLI can't disagree.
  • Test a_dependencys_framing_is_judged_by_its_frozen_facts: a dependency declares com.acme.lines@1 with payload = json in its profile, the package uses it with no format, and the editor expects json@1 alongside packed@1, which is the exact set used_as_declared gives for the frozen declaration. payload = opaque, or an unreadable profile, doesn't expect json@1.

Other name-keyed checks

Grepped for jsonrpc, datagram@, comline@1/@2 and json@1 used as rules:

  • handlers/protocol_summary.rs: the format a framing implies was labelled "JSON-RPC's format" whatever the framing. Core decides it by facts (unverified::default_format); the label now names the framing: "implied by <framing>".
  • handlers/protocol_summary.rs DEFAULT_HANDSHAKE comparison: a note about core's defaults, not a rule about an encoding's behaviour. Left as is.
  • Completion snippets (jsonrpc,datagram,...) list the official framings to pick from. Left as is.
  • Everything else is test fixtures.

Pins

core#209 (d11d82b), generation 55d3fdc, comline-rust#111 (be90c80), comline-typescript#137 (02ededc).

Merge after core#209, generation#123, comline-rust#111, comline-typescript#137 and cli#138.

Refs ComlineProject/runtime#15

…r frozen facts

- source::apply_package_wire, a copy of core's private freeze of the
  package's framing and handshake, is gone: the comline.toml context calls
  core's schema::ir::package_wire::apply_package_wire with the package's
  frozen config (source::declared_config), so handshake parameters now
  freeze as the build freezes them too.
- The used-encodings check judged only official framings, by their
  embedded profiles. Every manifest in view (the package's and its
  dependencies') now has its encodings frozen as core freezes them, profile
  read from beside it (source::declared_encoding_units), and the set goes
  through generation's encodings::used_as_declared, the function comline
  generate's fill uses. A declaration whose profile can't be read keeps its
  name and mappings and states nothing.
- The protocol hover named the format a framing implies "JSON-RPC's format"
  whatever the framing; it names the framing.
- Pins core#209, generation, comline-rust and comline-typescript on one core.

Refs ComlineProject/runtime#15
@Kinflou
Kinflou merged commit dadf6f9 into master Nov 8, 2026
4 checks passed
@Kinflou
Kinflou deleted the comline2/shared-wire-facts branch November 8, 2026 03:06
@Kinflou Kinflou moved this from Todo to Done in Comline Development Roadmap Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant