pub struct LocalhostDuplexSession {
pub edge: ThinEdge,
pub duplex: DuplexChannel,
pub erl_gate: ErlBargeGate,
pub media_up: Vec<MediaFrame>,
pub media_down: Vec<MediaFrame>,
}Expand description
In-process localhost thin-edge session (ADR-068 Phase 1 scaffold).
The edge half is a ThinEdge; the daemon half is a DuplexChannel.
There is no private TalkForest — floor cognition rides the shared
daemon machine only. Transport is a pair of Vecs simulating the two
lanes; a later UDS/WebSocket carrier swaps the vectors for sockets.
The session holds an ErlBargeGate (WEFT-615) so repeated ERL samples
during provisional Overlap use floor + hysteresis rather than a binary
barge switch.
Fields§
§edge: ThinEdgeEdge-side reflex + ERL relay.
duplex: DuplexChannelDaemon-side floor actuator.
erl_gate: ErlBargeGateStateful ERL barge gate (floor + hysteresis knobs).
media_up: Vec<MediaFrame>Media frames the edge has streamed up (for inspection / later STT).
media_down: Vec<MediaFrame>Media frames the daemon has streamed down (TTS / text).
Implementations§
Source§impl LocalhostDuplexSession
impl LocalhostDuplexSession
Sourcepub fn open(payload: PayloadKind) -> Self
pub fn open(payload: PayloadKind) -> Self
Open a localhost session for the given payload axis (default ERL knobs).
Sourcepub fn open_with_erl(payload: PayloadKind, erl: ErlBargeConfig) -> Self
pub fn open_with_erl(payload: PayloadKind, erl: ErlBargeConfig) -> Self
Open with explicit ERL barge floor + hysteresis (WEFT-615 knobs).
Sourcepub fn edge_push_media(&mut self, frame: MediaFrame)
pub fn edge_push_media(&mut self, frame: MediaFrame)
Edge pushes a media frame up (thin client of the daemon stream).
Sourcepub fn edge_report_state(&mut self) -> ObserveOutcome
pub fn edge_report_state(&mut self) -> ObserveOutcome
Edge reports its control state (ERL + heartbeat) into the daemon.
Folds erl_confidence into the duplex machine as
StreamObservation::Erl so subsequent TurnClaims carry it.
Sourcepub fn daemon_observe(&mut self, obs: StreamObservation) -> ObserveOutcome
pub fn daemon_observe(&mut self, obs: StreamObservation) -> ObserveOutcome
Daemon-local stream observation (VAD/EOU/drain/heartbeat), delivering any resulting commands to the edge.
Sourcepub fn apply_verdict(&mut self, verdict: FloorVerdict) -> Vec<EdgeCommand>
pub fn apply_verdict(&mut self, verdict: FloorVerdict) -> Vec<EdgeCommand>
Apply an ECC floor verdict and deliver edge commands.
Sourcepub fn score_barge_claim(impulse: &DuplexImpulse) -> f32
pub fn score_barge_claim(impulse: &DuplexImpulse) -> f32
Score a barge claim for the floor using the claim’s ERL (WEFT-628).
Builds a contender urgency signal with the ERL scale applied so a low-ERL self-echo claim cannot outscore an agent holding the floor.
Sourcepub fn duplex_turn_claim_payload(impulse: &DuplexImpulse) -> Value
pub fn duplex_turn_claim_payload(impulse: &DuplexImpulse) -> Value
JSON payload for lifting a duplex TurnClaim onto the ECC
ImpulseQueue (WEFT-615).
Always carries erl_confidence as a number so the Talk-Mode loop’s
acoustic gate fires: missing measurement becomes 0.0 (deny / safe).
Sourcepub fn resolve_overlap_from_erl(
&mut self,
erl: Option<f32>,
) -> (FloorVerdict, Vec<EdgeCommand>)
pub fn resolve_overlap_from_erl( &mut self, erl: Option<f32>, ) -> (FloorVerdict, Vec<EdgeCommand>)
Decide a provisional Overlap using ERL only (scaffold for TalkModeLoop wiring). High ERL → grant user + mute; low ERL → deny barge.
Uses default knobs (stateless one-shot). Prefer
resolve_overlap_with_gate when
sampling ERL repeatedly during Overlap (hysteresis).
Sourcepub fn resolve_overlap_with_gate(
&mut self,
erl: Option<f32>,
) -> (FloorVerdict, Vec<EdgeCommand>)
pub fn resolve_overlap_with_gate( &mut self, erl: Option<f32>, ) -> (FloorVerdict, Vec<EdgeCommand>)
Resolve Overlap through the session’s stateful ErlBargeGate
(WEFT-615 floor + hysteresis). Feed successive ERL samples during
provisional Overlap; boundary flutter will not thrash Mute/Resume.
Sourcepub fn resolve_overlap_with_config(
&mut self,
erl: Option<f32>,
config: &ErlBargeConfig,
) -> (FloorVerdict, Vec<EdgeCommand>)
pub fn resolve_overlap_with_config( &mut self, erl: Option<f32>, config: &ErlBargeConfig, ) -> (FloorVerdict, Vec<EdgeCommand>)
Stateless resolve with explicit knobs (no session gate state).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LocalhostDuplexSession
impl RefUnwindSafe for LocalhostDuplexSession
impl Send for LocalhostDuplexSession
impl Sync for LocalhostDuplexSession
impl Unpin for LocalhostDuplexSession
impl UnsafeUnpin for LocalhostDuplexSession
impl UnwindSafe for LocalhostDuplexSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more