@@ -163,8 +163,7 @@ pub trait ServiceRole: std::fmt::Debug + Send + Sync + 'static + Copy + Clone {
163163 /// SEP-2260 says clients receiving a server-to-client request with no
164164 /// associated outbound request should reject it with invalid params. An
165165 /// error return is sent back to the peer instead of dispatching to the
166- /// handler. The `association` argument is the transport-observed stream
167- /// association; see [`PeerRequestAssociation`].
166+ /// handler.
168167 #[ doc( hidden) ]
169168 fn enforce_peer_request_association (
170169 _peer_request : & Self :: PeerReq ,
@@ -176,23 +175,21 @@ pub trait ServiceRole: std::fmt::Debug + Send + Sync + 'static + Copy + Clone {
176175}
177176
178177/// How an inbound peer request relates to this side's in-flight outbound
179- /// requests, as observed by the transport (SEP-2260).
178+ /// requests (SEP-2260).
180179///
181- /// SEP-2260 defines no wire field for request association; only a
182- /// stream-separating transport (streamable HTTP) can distinguish the first
183- /// two variants. Transports without stream separation (stdio, in-process)
184- /// yield [`Self::Unknown`], preserving the coarse in-flight check.
180+ /// SEP-2260 defines no wire field for association, so only stream-separating
181+ /// transports (streamable HTTP) can observe it; other transports yield
182+ /// [`Self::Unknown`].
185183#[ derive( Debug , Clone , PartialEq , Eq ) ]
186184#[ expect( clippy:: exhaustive_enums, reason = "intentionally exhaustive" ) ]
187185pub enum PeerRequestAssociation {
188- /// Arrived on the response stream of an outbound request that is still
189- /// awaiting its response.
186+ /// Arrived on the response stream of an in-flight outbound request.
190187 Associated ,
191188 /// Arrived on a stream tied to no in-flight outbound request (e.g. the
192189 /// streamable HTTP standalone GET stream).
193190 Unassociated ,
194- /// The transport supplied no stream provenance ; only the coarse
195- /// "is anything in flight" signal exists .
191+ /// The transport cannot distinguish streams ; only the coarse in-flight
192+ /// signal is available .
196193 Unknown { has_pending_outbound_request : bool } ,
197194}
198195
@@ -204,9 +201,6 @@ pub(crate) fn uses_legacy_lifecycle(
204201 && protocol_version. is_none_or ( |version| version < & ProtocolVersion :: V_2026_07_28 )
205202}
206203
207- /// Translate the transport-attached [`InboundStreamOrigin`] marker (if any)
208- /// and the in-flight outbound request pool into the association passed to
209- /// [`ServiceRole::enforce_peer_request_association`].
210204pub ( crate ) fn peer_request_association < Req : crate :: model:: GetExtensions , V > (
211205 request : & Req ,
212206 local_responder_pool : & std:: collections:: HashMap < RequestId , V > ,
@@ -256,12 +250,9 @@ pub(crate) fn in_request_handler_scope() -> bool {
256250pub struct OriginatingRequestId ( pub RequestId ) ;
257251
258252/// Marker in an inbound request's non-serialized [`Extensions`] recording
259- /// which HTTP response stream it arrived on (SEP-2260): the receive-side
260- /// mirror of [`OriginatingRequestId`]. Attached by the streamable HTTP
261- /// client transport; read by the service layer to enforce the client
262- /// receive-side association check. Never on the wire (SEP-2260 defines no
263- /// wire field), so transports that serialize messages cannot convey it and
264- /// the service layer falls back to the coarse in-flight check.
253+ /// which HTTP response stream it arrived on: the receive-side mirror of
254+ /// [`OriginatingRequestId`]. Never on the wire (SEP-2260 defines no wire
255+ /// field); when absent, the coarse in-flight check applies.
265256#[ derive( Debug , Clone , PartialEq , Eq ) ]
266257#[ expect( clippy:: exhaustive_enums, reason = "intentionally exhaustive" ) ]
267258pub enum InboundStreamOrigin {
0 commit comments