process_ring_stream

Function process_ring_stream 

Source
pub async fn process_ring_stream(
    backend: Arc<dyn RingBackend>,
    observer: Arc<dyn OrchestratorObserver>,
    config: AppConfig,
)
Expand description

Process a stream of gestures from the ring backend and route each one through the agentic pipeline.

Each gesture is normalised into a unified gestura_core_intent::Intent and then submitted to an AgentPipeline via AgentPipeline::process_blocking.

§Confidence gating

Gestures with combined confidence below [MIN_GESTURE_CONFIDENCE] or with primary_action == "unknown_gesture" are discarded before reaching the pipeline, preventing accidental inputs from triggering LLM or tool activity.

§Ordered, bounded processing

A single background task drains a bounded [tokio::sync::mpsc] channel (capacity [GESTURE_QUEUE_CAPACITY]) so that:

  • Pipeline executions are sequential — haptic feedback is emitted in gesture arrival order.
  • At most one process_blocking call is in flight at any time.
  • The receiver loop is never blocked by a slow pipeline run; excess gestures are dropped with a warning instead of building an unbounded queue.

§Haptic feedback