Skip to main content

Module talk_loop

Module talk_loop 

Source
Expand description

Talk-Mode tick service — the orchestration heart of the ECC graph-walk voice conversation (ADR-062 §Architecture, Phase 2.1).

A conversation turn is a walk that mutates a causal graph; this loop is the driver. It is modeled on the dormant DemocritusLoop (SENSE → … → COMMIT on a compute budget) but specialised to turn-taking:

SENSE  = ImpulseQueue.drain_ready()                  (HLC-ordered turn signals)
FLOOR  = evaluate_floor / compute_urgency over       (a scored read, ADR-062 D4)
         SessionView.live_seqs(), dampened by         (coherence soft-dampener D6)
MUTATE = per impulse:
           EndOfUtterance → commit  (Frontier→Committed via mirror_state)
           TurnShift      → handoff (floor Open; clear the in-flight turn)
           Backchannel    → a Continuer cross-ref to the current speaker node,
                            and **never a turn node** (the load-bearing invariant)
           TurnClaim      → prune the in-flight node (Frontier→Pruned) +
                            draw a Contradicts edge from the claiming turn
                            (WEFT-615: acoustic claims with `erl_confidence`
                            below the ERL barge floor are denied — self-cancel)

It registers as a [SystemService] alongside the coherence CognitiveTick — it does not touch that loop (which stays the slow integrity monitor). It owns its own CognitiveTick instance so it shares the ADR-047 self-calibrating budget/adaptive primitives (tick_budget_ratio, record_tick, current_interval_ms) without coupling to the coherence cadence.

The loop creates no turn nodes itself — turn nodes are produced by the dual-write path (session_forest::dual_write_turn, Phase 1) and handed to the loop via register_turn. The loop only advances their lifecycle and links reply/claim relationships. No audio, no LLM, no embedder live here: this is pure graph orchestration.

Structs§

TalkModeConfig
Configuration for the Talk-Mode loop.
TalkModeLoop
The Talk-Mode tick service (ADR-062 Phase 2.1; multiplexed per M2 D1/D4).
TalkTickResult
Summary of one Talk-Mode tick (SENSE → FLOOR → MUTATE).

Functions§

run_talk_loop
Drive the Talk-Mode loop on the ADR-047 self-calibrating cadence until cancel fires or the tick is stopped. Modeled on run_democritus_loop but for turn-taking. Spawned by the daemon (Phase 6). Native only (tokio/tokio-util).