Skip to main content

Module floor

Module floor 

Source
Expand description

Conversational floor as a scored read, not an engine (ADR-062 D4).

Each tick the Talk-Mode loop (Phase 2) reads who should hold the floor by scoring the contending candidates with compute_urgency and folding the result into a FloorState. Nothing here owns state-machine orchestration: it is a pure function of the ImpulseQueue entries (the turn signals) crossed with the live frontier (SessionView::live_seqs).

The weights are constants in v0.1 (hand-tuned, ADR-062 §D4); the Weaver learns them later (deferred backlog). A hard interrupt short-circuits the score to f32::MAX so it preempts everything and cancels generation.

Structs§

ErlBargeConfig
Tunable ERL barge knobs (ADR-068 D1 / WEFT-615): floor + hysteresis.
ErlBargeGate
Stateful ERL barge gate with hysteresis (WEFT-615).
FloorCandidate
A candidate contending for the floor: an identity (actor/speaker) plus its scored signals and the HLC time it began contending.
FloorDecision
The outcome of a floor read: the resulting FloorState, the scored winner (if any), and the winning urgency score.
UrgencySignals
The scored inputs (plus the hard-interrupt flag) feeding compute_urgency. Each f32 is expected in [0, 1]; values are clamped.

Enums§

ContentReadiness
How far along a candidate’s response content is (ADR-062 D4). This is the term that ties floor-winning to speculative-generation progress.
FloorState
The status of the conversational floor (ADR-062 D4 §8.3).

Constants§

ERL_BARGE_FLOOR
Default ERL confidence floor for admitting a barge (ADR-068 D1 / WEFT-628).
ERL_BARGE_HYSTERESIS
Default hysteresis band below ERL_BARGE_FLOOR (WEFT-615).
MAX_CROWD
Crowd-density saturation point: at/above this many contenders the crowd signal reads 1.0.
W_AROUSAL
Weight on the speaker’s emotional arousal (VAD arousal).
W_CROWD
Weight on crowd density (number of contending actors).
W_READINESS
Weight on content readiness (generated > partial > not-started).
W_SEMANTIC
Weight on semantic relevance to the frontier head.
W_WAIT
Weight on fairness pressure (how long this candidate has waited).

Functions§

compute_urgency
Score a candidate’s urgency for the floor (ADR-062 D4 + ADR-068 ERL term).
contending_count
Count the floor-claiming impulses in a drained set — every ImpulseType::TurnClaim is a contender for the floor (ADR-062 D5). Feeds crowd_density.
crowd_density
Normalized crowd-density signal in [0, 1] from the number of contending actors, saturating at MAX_CROWD. Derived from the ImpulseQueue (see contending_count).
erl_admits_barge
Whether a measured ERL confidence clears the default barge floor (WEFT-628 / WEFT-615). Stateless one-shot — prefer ErlBargeGate when sampling repeatedly during playback.
erl_admits_barge_opt
Whether an optional ERL sample admits a barge under config (WEFT-615).
evaluate_floor
Read the floor from the current set of contending candidates (ADR-062 D4).
floor_verdict_from_erl
Map a duplex TurnClaim ERL into a floor verdict scaffold (WEFT-628/615).
floor_verdict_from_erl_config
Like floor_verdict_from_erl with explicit knobs (WEFT-615).