sphereql_embed/logical_confidence.rs
1//! Skeleton for projection-aware logical-confidence scoring.
2//!
3//! `logical_confidence` is the future answer to "how much does this
4//! projection preserve the *reasoning* structure of the corpus?" — the
5//! degree to which logical relations between concepts (entailment,
6//! taxonomy, contradiction) survive the embedding → sphere mapping.
7//!
8//! This module is a deliberately empty placeholder so that downstream
9//! tests and pipeline code can consume the API today and the underlying
10//! metric can be filled in later without churning callers. The current
11//! implementation always returns `None`; the projection-comparison test
12//! prints `n/a` in the score column until a real metric ships.
13//!
14//! Replace [`UnimplementedLogicalConfidence`] with a concrete scorer
15//! when ready, or wire a different impl in via the [`LogicalConfidence`]
16//! trait.
17
18use sphereql_core::SphericalPoint;
19
20/// Returns a scalar confidence in `[0, 1]` describing how well the
21/// projected layout preserves the reasoning structure of the corpus, or
22/// `None` if the implementation cannot answer for the given inputs (or,
23/// in the case of [`UnimplementedLogicalConfidence`], at all).
24pub trait LogicalConfidence {
25 fn score(&self, projected: &[SphericalPoint], categories: &[String]) -> Option<f64>;
26}
27
28/// Default placeholder. Always returns `None`.
29///
30/// Lets callers reserve the score column / API surface today; swap in a
31/// real implementation later without changing call sites.
32#[derive(Debug, Default, Clone, Copy)]
33pub struct UnimplementedLogicalConfidence;
34
35impl LogicalConfidence for UnimplementedLogicalConfidence {
36 fn score(&self, _projected: &[SphericalPoint], _categories: &[String]) -> Option<f64> {
37 None
38 }
39}