Repository navigation
Conversation
added 3 commits
November 17, 2026 03:05
facts::hello_parts: a Hello's pieces per protocol, to be put together at runtime from what an end provides and calls. The core pin stays at 69039e7.
The specification's seven comline@2 cases for a Hello that lists a subset of the package's protocols (3254e0e), and the core that proves them: SPEC_REV and CORE_REV move together. scripts/vendor-core.sh --check rebuilds the same bytes.
Services and ClientServices take a field per protocol, each optional; connect's
services default to none. Under comline@2 the Hello is built when a connection
opens, from the protocols given plus the ones this side calls (every protocol
the other side provides), by the runtime's buildHello, from the header and the
per-protocol entries the generator emits from facts::hello_parts. With every
protocol provided the Hello is the bytes the package embedded before: the
wire-invariance record doesn't move.
The runtime's Connection.provide refuses, with RuntimeError("unavailable"), a
protocol the comline@2 handshake didn't accept (one this end's Hello didn't
list, or the peer refused); a connection with no Hello takes any protocol, as
in the Rust runtime (runtime#126).
Blesses connections_subset, and the connection.ts of every fixture that has a
package connection: the Hello constants, the optional fields and the provide
lines are the only changes to them.
Closes #173
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #173
The TypeScript counterpart of comline-rust#133, the smaller step accepted in Named connections: a side provides a subset of its protocols, and the Hello is built from what it gives plus the protocols it calls.
API
ServicesandClientServicestake an optional field per protocol.serve(transport, { chat })andconnect(transport, { events })are written as before; leaving a field out stops providing that protocol.connect'sservicesdefault to{}.comline@2the Hello is built when a connection opens: the protocols given, plus the ones this side calls (every protocol the other side provides, so the peer refuses what it doesn't have). A protocol both provided and called is listed once.@comline/runtimegainsbuildHello(header, provided, called)(mirrorsHello::build: union, each protocol once, ascending by wire number),ProtocolEntry,providedEntries,Negotiated.accepts/checkProvide, and an optionalHandshake.agreed()thatConnection.connect/acceptkeep.Connection.providerefuses, withRuntimeError("unavailable")naming the protocol by wire number (#2), a protocol thecomline@2handshake didn't accept: one this end's Hello didn't list (unknown_protocol), or one the peer refused. A connection with no Hello (comline@1,none,Connection.unverified) takes any protocol. Direction isn't checked in the runtime; the generated code only provides whatServicesholds.connection.tsemitsHELLO_HEADERand aSERVICES_HELLO/CLIENT_SERVICES_HELLOtable of entries (fromfacts::hello_parts) instead of the oneHELLO. JSON-RPC andnonepackages get optional fields and fewer dispatchers, nothing else.Pins and vendored files
rev =lines only); core stays at 69039e7.vendor-core.sh --checkrebuilds the same bytes). The TypeScript conformance harness markshandshake-comline2unsupported (the cases run on the core), so nothing there runs them;test/hello-build.test.tschecksbuildHelloagainst the vendoredhelloandhello-subsetcases instead.Goldens
connections_subset(4 files),FEATURES.md/features.jsonlist it as proof of protocols, connections,datagram@3,comline@2and others.connection.tsof the 14 fixtures with a package connection (and the same for the runtime's generated test fixtures): the Hello constants, optional fields and provide lines. No other golden moves.test/wire-invariance.jsononly gains the newsubset/fixture: every existing fixture's whole-connection Hello, rebuilt from the header and entries, is the same bytes as before.Not in this PR
Narrowing what a side calls (the decision lets a side list the protocols it calls; this builds the default, all of them). A failed
provideinaccept/connectrejects, and leaves the connection to be closed by its transport since the runtime has noclose().