Repository navigation
framing fact protocol: whether a frame names the protocol (0.11) - #9
Merged
Merged
Conversation
A framing states whether a request's frame names the protocol it calls into: datagram@2 and datagram@3 do (named), datagram@1 and jsonrpc@1 don't (unnamed). specs/protocol.jq holds each profile to the cases it names. One new case, framing-datagram3/request-two-byte-protocol; no frame's bytes change.
This was referenced Nov 13, 2026
Merged
Kinflou
marked this pull request as ready for review
November 13, 2026 01:57
Kinflou
added a commit
to ComlineProject/core
that referenced
this pull request
Nov 13, 2026
* Pin the specification at 0.11: the framing fact `protocol` Pin comline-catalog and the vendored tests/spec/REV at the head of ComlineProject/specification#9 (69882e9), and take its four framing profiles into the embedded official package: each now states `protocol` (`named` for datagram@2 and datagram@3, `unnamed` for datagram@1 and jsonrpc@1). The profile hashes in official_units.json follow. Profile gains `names_protocol()` and `both_directions()`, typed readers of the two facts for generation and the CLI. The hand-written profiles in tests state `protocol` too, as a framing must. * dependency_pin: the golden pin follows its fixture's framing gaining `protocol` The fixture declares its own framing, and spec 0.11 has every framing profile state `protocol`. That changes the frozen `Encoding` unit the pin covers, so the pin moves with its input. CONTENT_HASH_SCHEME is unchanged: official encodings are looked up, never frozen into a package's config, so pins of packages without a framing of their own don't move.
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.
Adds the framing fact
protocol(spec 0.11): whether a request's frame names the protocol it calls into.Serves ComlineProject/generation#137 step 2: codegen will put a protocol on a connection by default when the framing's
directionsisbothandprotocolisnamed, and otherwise only when it's client-provided.jsonrpc@1anddatagram@2are bothdirections: both, and no existing fact told them apart. Core, runtime, generation and cli follow.The fact
named: it does, by number or wire id, so several protocols can share one transportunnamed: it doesn't: a call names only its functiondatagram@1unnamedframing-datagram/request,request-large-iddatagram@2namedframing-datagram2/request-two-byte-protocoldatagram@3namedframing-datagram3/request-two-byte-protocol(new)jsonrpc@1unnamedframing-jsonrpc/request,request-large-idJSON-RPC's
qualifiedmethod names are a parameter of the framing, not of its profile, sojsonrpc@1staysunnamed(noted in the changes entry).Proof
Reused cases except one. New:
framing-datagram3/request-two-byte-protocol, a request withprotocol300,call_id1, methodping,params[],request_id5, bytes00ac020105000000000000005b5d. The existingdatagram@3cases give the protocol and the call the same number (or 0), so their bytes can't show which is which. Its bytes aredatagram@2's case of the same name (00ac02010005000000000000005b5d) with the call id written asdatagram@3writes it, a varint01, instead of two bytes0100; the layout matchesframing-datagram3/request-two-byte-numbers. The Rust reference must produce it forvectors_are_current. No existing frame's bytes change.I couldn't use a pair differing only in
protocolforunnamed: decoding gives the input back, so anunnamedframe's case can't carry aprotocolinput.The check
The existing
calls/directionsrules are enforced by the runtime'sfact_shown(described in the README), not byspecs/check.sh, so this addsspecs/protocol.jq, run byspecs/check.shon each framing profile. Each cited case must exist, be an exactrequestof that framing, and:named: have aprotocolof 128 or more that isn't itscall_id, and its bytes hold that number's LEB128 varint from a byte boundary;unnamed: have noprotocolin its input (decoding its bytes gives that input back, so the frame carries none).The README's description of how facts are shown gains the same rule, for the runtime's
fact_shownto follow.Regenerated
catalog/gen/catalog.json,rust/src/catalog.rs(spec version 0.11, the fact,FRAMING_FACTS) andspecs/gen/profile.schema.json.features.jsonis unchanged.VERSION0.11,rust/Cargo.toml0.11.0.specs/check.shand--checkpass locally,cargo testinrust/passes (14 tests).Downstream
A framing profile without
protocolis refused, so core'sProfile::parseand the runtime's vendored conformance break on this spec until they update: the runtime must vendor 0.11, add the newdatagram@3case to its reference's vectors, and judgeprotocolinfact_shownby the rule above. Core must read the new fact.