feat: RELAY spec v0.2 conformance — relay:: namespace, Channel<T>, Adapt()#7
Merged
Conversation
Implements RELAY spec §18.2 C++ bindings for cpp-RCP (closes issue #5): - include/relay/relay.hpp: relay:: namespace with Protocol enum, Message envelope, Errc error category with ErrClosed/ErrNotConnected/ErrTimeout/ ErrPayloadTooLarge sentinels, Context, BackPressurePolicy, SubscriberOptions, Channel<T> generic typed channel, Node and Caller abstract classes, and kRelaySpecVersion = "0.2" constant. - include/rcp/rcp.hpp: rcp::Context aliased to relay::Context; rcp::StatusChannel aliased to relay::Channel<Status>; rcp_category() gains equivalent() mapping rcp::Errc codes to relay::Errc conditions (§5.2, §5.3). - include/rcp/adapt.hpp: rcp::Adapt() wrapping Controller as relay::Caller; zone_to_relay_id/zone_from_relay_id helpers; status_to_message/ response_to_message/message_to_command conversions (§15.7.5). - tests/test_relay.cpp: 23 conformance tests covering spec version, Protocol enum values, all four mandatory error sentinels (§5.1), error_condition equivalence mappings (§5.2), Channel<T> push/recv semantics, SubscriberOptions defaults (§14), Context alias, StatusChannel alias, and Adapt() call/send/ subscribe/close behaviour (§10.3). All 27/27 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
This was referenced Jun 17, 2026
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.
Summary
Implements RELAY spec §18.2 C++ bindings in cpp-RCP, closing issue #5.
include/relay/relay.hpp: Newrelay::namespace header with:relay::Protocolenum (§3) — CAN=1…SOMEIP=6relay::Messageuniversal envelope (§4)relay::Errcerror category named"relay"with four mandatory sentinels:ErrClosed,ErrNotConnected,ErrTimeout,ErrPayloadTooLarge(§5.1)relay::Context— lightweight deadline context (§18.2), now the canonical definitionrelay::BackPressurePolicy+relay::SubscriberOptionswith default depth 64 (§14, §18.2)relay::Channel<T>— generic typed bounded channel;bool push()returns false when full or closed (§18.2)relay::Nodeandrelay::Callerabstract classes (§18.2)relay::kRelaySpecVersion = "0.2"(§19.4)include/rcp/rcp.hpp: Updated:rcp::Context→ alias forrelay::Context(§18.2)rcp::StatusChannel→ alias forrelay::Channel<Status>(§18.2)rcp_category()::equivalent()mapsrcp::Errc→relay::Errcviastd::error_conditionequivalence (§5.2, §5.3)include/rcp/adapt.hpp: New file:rcp::Adapt(shared_ptr<Controller>)→unique_ptr<relay::Caller>(§10.3)zone_to_relay_id/zone_from_relay_idfor PascalCase zone names (§4.2)status_to_message/response_to_message/message_to_command(§15.7.5)RcpCallerAdapterimplementing all three relay::Node/Caller virtual methodstests/test_relay.cpp: 23 new conformance tests — all 27/27 tests pass locally.Spec gaps raised on RELAY repo (issue #6)
8 issues filed on SoundMatt/RELAY covering: SpecVersion inconsistency (§17.12 vs §19.4),
Channel<T>by-value insubscribe()signature, missing C++Adapt()signature, missingstd::error_conditionequivalence example,rcp.healthymeta key absent from §4.3, missing C++ToMessage()/FromMessage()signatures,ErrAlreadyExistswrappingErrClosedsemantically wrong, and CLI conformance undefined for header-only C++ libraries.Test plan
rcp_relayconformance test — 51 assertions in 23 test cases