pub struct FiveSignalRuntime {
pub weights: FiveSignalWeights,
pub access_cache: AccessFrequencyCache,
pub causal_computer: Mutex<CausalDistanceComputer>,
pub novelty_computer: NoveltyComputer,
pub metrics: Arc<FiveSignalMetrics>,
pub pool: DbPool,
pub qdrant: Option<Arc<EmbeddingStore>>,
pub session_start: i64,
pub session_id: SessionId,
pub config: FiveSignalConfig,
}Expand description
Runtime state for the five-signal retrieval subsystem.
Created once at bootstrap when five_signal.enabled = true and attached to
crate::semantic::SemanticMemory via an Option<Arc<FiveSignalRuntime>>.
None when disabled — guarantees zero overhead per NFR-005.
Fields§
§weights: FiveSignalWeightsNormalized signal weights (computed once at startup).
access_cache: AccessFrequencyCacheAccess frequency aggregator.
causal_computer: Mutex<CausalDistanceComputer>Causal distance computer (contains BFS cache per goal entity).
novelty_computer: NoveltyComputerNovelty computer (pure arithmetic, no I/O).
metrics: Arc<FiveSignalMetrics>Prometheus-compatible counters.
pool: DbPoolSQLite pool (shared with the rest of SemanticMemory).
qdrant: Option<Arc<EmbeddingStore>>Qdrant store (optional; used by the consolidation daemon).
session_start: i64Unix timestamp of session start, used by NoveltyComputer.
session_id: SessionIdSession identifier used to scope fact_access_log inserts and queries.
Set at bootstrap from a per-process UUID so access counts are isolated per session and do not bleed across process restarts.
config: FiveSignalConfigConfig snapshot (used by the consolidation daemon).
Implementations§
Source§impl FiveSignalRuntime
impl FiveSignalRuntime
Sourcepub fn new(
config: FiveSignalConfig,
pool: DbPool,
graph_store: Arc<GraphStore>,
qdrant: Option<Arc<EmbeddingStore>>,
session_start: i64,
session_id: impl Into<SessionId>,
) -> Self
pub fn new( config: FiveSignalConfig, pool: DbPool, graph_store: Arc<GraphStore>, qdrant: Option<Arc<EmbeddingStore>>, session_start: i64, session_id: impl Into<SessionId>, ) -> Self
Create a new runtime from config, pool, and optional graph + Qdrant stores.
Normalizes signal weights (logging WARN if they do not sum to 1.0).
Logs a WARN if consolidation_daemon.top_k_per_run < batch_size (MINOR-03).
§Examples
use std::sync::Arc;
use zeph_config::memory::FiveSignalConfig;
use zeph_memory::five_signal::FiveSignalRuntime;
let cfg = FiveSignalConfig::default();
let session_start = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.map_or(0, |d| d.as_secs() as i64);
let session_id = uuid::Uuid::new_v4().to_string();
let runtime = FiveSignalRuntime::new(cfg, pool, graph, None, session_start, session_id);Auto Trait Implementations§
impl !Freeze for FiveSignalRuntime
impl !RefUnwindSafe for FiveSignalRuntime
impl Send for FiveSignalRuntime
impl Sync for FiveSignalRuntime
impl Unpin for FiveSignalRuntime
impl UnsafeUnpin for FiveSignalRuntime
impl !UnwindSafe for FiveSignalRuntime
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request