Skip to content

comline@2: conformance cases for a Hello that lists a subset of the package's protocols (specification#13) - #19

Merged
Kinflou merged 1 commit into
mainfrom
conformance/subset-hello
Nov 16, 2026
Merged

Kinflou merged 1 commit into
mainfrom
conformance/subset-hello

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Closes #13 (the cases the ops can state; see "What the format can't say"). Epic: ComlineProject/core#288. Runtime: ComlineProject/runtime#124. Decision: Named connections (docs#188 records the answers of 2026-11-15).

A connection carries exactly what its Hello lists, and the Hello is built from what a side provides plus what it calls. These cases hold a runtime's comline@2 handshake to that for an end whose Hello lists a subset of the package's protocols. Spec 0.12; no existing case changes and no bytes move.

New cases in handshake-comline2 (7)

Base package as in the other cases: protocol 0 and protocol 1.

  1. hello-subset (comline2_message): a Hello listing protocol 1 alone, bytes 434f02...0101000100b0...0020001. It is the hello case's bytes with protocol 0's entry gone and the count one, in canonical() order.
  2. offer-subset-offered (answer_offer, scope = protocol): the offer lists protocol 0 alone; the responder also has protocol 1. The answer names only what was offered. The responder's result has protocol 1 refused on its own (unknown_protocol), so calls to it fail locally; protocol 0 is accepted.
  3. offer-subset-local (answer_offer): the responder lists protocol 1 alone and the offer lists both. Protocol 0, which only the offerer has, is refused unknown_protocol in the answer; protocol 1 is accepted, and the responder's result has no protocol 0.
  4. conclude-subset (conclude_answer): the initiator offered protocol 0 alone and the answer takes it.
  5. conclude-answer-beyond-offer (conclude_answer): the initiator offered protocol 0 alone and the answer also names protocol 1, which the offer didn't list: malformed, so a connection can't gain a protocol its Hello didn't list.
  6. symmetric-subset-local (judge_hello): an end listing protocol 0 alone against a peer listing both. Its verdict refuses protocol 1 (unknown_protocol) and its result has no protocol 1.
  7. finish-refused-unlisted (finish): the peer's verdict refuses protocol 1, which this end never listed, and what this end agreed doesn't change.

The default is unchanged

hello (every protocol on the package's connection) is today's bytes and is not touched; the subset's bytes differ from it only by the dropped entry. Nothing duplicates it.

What the format can't say

These need an assertion no op makes, so no case states them. I did not add a field; this is the question for the format:

  • Calls outside the Hello fail locally (Unavailable), and nothing is sent. A negotiated result shows which protocols an end can call (a protocol absent from it, or refused in it, is one check_call refuses; cases 2, 3 and 6 above show such results), but the ops have no way to ask a runtime to make a call and observe that nothing was written.
  • Providing outside the Hello, or what the handshake refused, is refused (provide_on). The same: the corpus has no op about providing.
  • A narrowed called set. What it shows on the wire is a Hello that lists fewer protocols, which cases 1 to 3 and 6 cover. That its calls to the others fail locally is the first point.
  • No Hello, no check (comline@1, or opened by hand): there is no negotiated result to hold, so there is nothing to state.

runtime#124 holds these in the runtime's own tests. Whether the corpus should state them, as an op over a negotiated result (for example a comline2_check op: a negotiated result, a protocol and function, and whether the call is allowed, and likewise for providing), is a format decision I haven't made here.

How the bytes were produced

By the Rust reference, as for the other handshake-comline2 cases: the cases were added to runtime/conformance/src/comline2.rs and written with CONFORMANCE_BLESS=1. Every existing case of the feature came out identical. The runtime change that adds them is not proposed yet; vectors_are_current there fails until it re-vendors this revision, as for every spec-led change.

specs/check.sh --check is clean; VERSION is 0.12, with its entry in the changes list (and rust/src/catalog.rs's SPEC_VERSION, regenerated).

…ackage's protocols (specification#13) (0.12)

New handshake-comline2 cases: hello-subset (the exact bytes), offer-subset-offered, offer-subset-local, conclude-subset, conclude-answer-beyond-offer, symmetric-subset-local and finish-refused-unlisted. No existing case changes; hello stays the default Hello that lists every protocol.

Calls outside the Hello, providing outside it and the no-Hello case are runtime behaviour the ops can't ask about; the changes entry says so.
@Kinflou
Kinflou marked this pull request as ready for review November 16, 2026 17:08
@Kinflou
Kinflou merged commit 3254e0e into main Nov 16, 2026
7 checks passed
@Kinflou
Kinflou deleted the conformance/subset-hello branch November 16, 2026 17:08
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.

Conformance: a Hello for a subset of the package's protocols

1 participant