pub struct TalkModeLoop { /* private fields */ }Expand description
The Talk-Mode tick service (ADR-062 Phase 2.1; multiplexed per M2 D1/D4).
A single daemon-hosted instance multiplexes all conversations. Turn
lineage is keyed by the globally-unique chain_seq; the per-conversation
view is resolved through the injected ViewResolver at commit/prune time,
so commit lands on the same SessionView the tier grafts from.
Implementations§
Source§impl TalkModeLoop
impl TalkModeLoop
Sourcepub fn new(
impulses: Arc<ImpulseQueue>,
causal: Arc<CausalGraph>,
crossrefs: Arc<CrossRefStore>,
views: Arc<dyn ViewResolver>,
tick: Arc<CognitiveTick>,
config: TalkModeConfig,
) -> Self
pub fn new( impulses: Arc<ImpulseQueue>, causal: Arc<CausalGraph>, crossrefs: Arc<CrossRefStore>, views: Arc<dyn ViewResolver>, tick: Arc<CognitiveTick>, config: TalkModeConfig, ) -> Self
Wire a Talk-Mode loop to the forest substrate, a per-conversation view resolver (M2 D4), and an ADR-047 tick.
Sourcepub fn impulses(&self) -> &Arc<ImpulseQueue> ⓘ
pub fn impulses(&self) -> &Arc<ImpulseQueue> ⓘ
The impulse queue this loop drains. The text impulse source
(SessionTier::index_turn) emits EndOfUtterance onto this exact queue,
so it derives the handle from the loop rather than holding a second copy.
Sourcepub fn register_turn(
&self,
chain_seq: u64,
node: NodeId,
uid: UniversalNodeId,
conv_id: impl Into<String>,
)
pub fn register_turn( &self, chain_seq: u64, node: NodeId, uid: UniversalNodeId, conv_id: impl Into<String>, )
Register a turn node produced by the dual-write path (Phase 1) and make
it conv_id’s in-flight turn. node/uid are the causal node id and
universal id from session_forest::dual_write_turn.
Sourcepub fn end_conversation(&self, conv_id: &str)
pub fn end_conversation(&self, conv_id: &str)
Evict all per-conversation loop state for conv_id (M2 D6). Called when
the idle reaper or an explicit agent.chat.end ends a conversation, so
lineage and current_turn do not grow unbounded across the daemon’s
lifetime. Committed causal nodes stay on the graph (they are witnessed).
Sourcepub fn observe_coherence(&self, signals: &CoherenceSignals) -> bool
pub fn observe_coherence(&self, signals: &CoherenceSignals) -> bool
Feed the latest coherence read so the dampener tracks drift (ADR-062 D6). P6 supplies the real RSTE signals; below threshold floor scores are softened ×0.8 until recovery (never a hard gate).
Sourcepub fn total_ticks(&self) -> u64
pub fn total_ticks(&self) -> u64
Total ticks executed.
Sourcepub fn current_turn(&self, conv_id: &str) -> Option<u64>
pub fn current_turn(&self, conv_id: &str) -> Option<u64>
The in-flight turn’s chain_seq for conv_id, if any.
Sourcepub fn tick(&self) -> TalkTickResult
pub fn tick(&self) -> TalkTickResult
Execute one tick: SENSE → FLOOR → MUTATE. Records its own compute time in the ADR-047 tick system. Pure graph work — no async, no I/O.
Trait Implementations§
Source§impl SystemService for TalkModeLoop
impl SystemService for TalkModeLoop
Source§fn service_type(&self) -> ServiceType
fn service_type(&self) -> ServiceType
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn health_detail(&self) -> Option<String>
fn health_detail(&self) -> Option<String>
Source§fn liveness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn liveness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn readiness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn readiness_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ProbeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for TalkModeLoop
impl !RefUnwindSafe for TalkModeLoop
impl !UnwindSafe for TalkModeLoop
impl Send for TalkModeLoop
impl Sync for TalkModeLoop
impl Unpin for TalkModeLoop
impl UnsafeUnpin for TalkModeLoop
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