pub struct SemanticPolicy {Show 18 fields
pub mode: SemanticMode,
pub download_policy: ModelDownloadPolicy,
pub fast_tier_embedder: String,
pub quality_tier_embedder: String,
pub reranker: String,
pub fast_dimension: usize,
pub quality_dimension: usize,
pub quality_weight: f32,
pub max_refinement_docs: usize,
pub semantic_budget_mb: u64,
pub min_free_disk_mb: u64,
pub max_model_size_mb: u64,
pub max_backfill_threads: usize,
pub max_backfill_rss_mb: u64,
pub idle_delay_seconds: u64,
pub chunk_timeout_seconds: u64,
pub semantic_schema_version: u32,
pub chunking_strategy_version: u32,
}Expand description
Resolved semantic policy after layering defaults → config → env → CLI.
Every field has a value — the resolution process fills in defaults for anything not specified by higher layers.
Fields§
§mode: SemanticModeActive semantic mode.
download_policy: ModelDownloadPolicyWhether model downloads may happen automatically.
fast_tier_embedder: StringFast-tier embedder name (e.g., “hash”).
quality_tier_embedder: StringQuality-tier embedder name (e.g., “minilm”).
reranker: StringReranker name (e.g., “ms-marco-minilm”).
fast_dimension: usizeFast-tier embedding dimension.
quality_dimension: usizeQuality-tier embedding dimension.
quality_weight: f32Quality weight for score blending (0.0–1.0).
max_refinement_docs: usizeMaximum documents refined per query.
semantic_budget_mb: u64Total disk budget for all semantic artifacts (MB).
min_free_disk_mb: u64Minimum free disk that must remain after writes (MB).
max_model_size_mb: u64Maximum single model size (MB).
max_backfill_threads: usizeMax threads for background backfill.
max_backfill_rss_mb: u64Max RSS target for backfill worker (MB).
idle_delay_seconds: u64Idle delay before background work starts (seconds).
chunk_timeout_seconds: u64Max seconds per background work chunk.
semantic_schema_version: u32Semantic schema version — mismatch forces rebuild.
chunking_strategy_version: u32Chunking strategy version — mismatch forces rebuild.
Implementations§
Source§impl SemanticPolicy
impl SemanticPolicy
Sourcepub fn compiled_defaults() -> Self
pub fn compiled_defaults() -> Self
Compiled defaults — lowest precedence.
Sourcepub fn with_env_overrides(self) -> Self
pub fn with_env_overrides(self) -> Self
Layer environment variables over the current policy.
Only overrides fields for which env vars are set and parseable.
Sourcepub fn with_cli_overrides(self, overrides: &CliSemanticOverrides) -> Self
pub fn with_cli_overrides(self, overrides: &CliSemanticOverrides) -> Self
Layer explicit CLI overrides.
Each Option is Some only when the user passed that flag.
Sourcepub fn resolve(cli: &CliSemanticOverrides) -> Self
pub fn resolve(cli: &CliSemanticOverrides) -> Self
Full resolution: compiled defaults → env → CLI.
Source§impl SemanticPolicy
impl SemanticPolicy
Sourcepub fn check_budget(
&self,
write_size_mb: u64,
current_semantic_usage_mb: u64,
free_disk_mb: u64,
) -> BudgetDecision
pub fn check_budget( &self, write_size_mb: u64, current_semantic_usage_mb: u64, free_disk_mb: u64, ) -> BudgetDecision
Check whether a proposed write of write_size_mb is within budget.
This is intended for model downloads — the first check compares
against max_model_size_mb. For vector index writes (which are much
smaller), prefer skipping the per-model cap or calling with a separate
budget method when one is needed.
current_semantic_usage_mb is the total disk used by semantic artifacts
right now. free_disk_mb is the free space on the volume.
Trait Implementations§
Source§impl Clone for SemanticPolicy
impl Clone for SemanticPolicy
Source§fn clone(&self) -> SemanticPolicy
fn clone(&self) -> SemanticPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SemanticPolicy
impl Debug for SemanticPolicy
Source§impl Default for SemanticPolicy
impl Default for SemanticPolicy
Source§impl<'de> Deserialize<'de> for SemanticPolicy
impl<'de> Deserialize<'de> for SemanticPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SemanticPolicy
impl PartialEq for SemanticPolicy
Source§fn eq(&self, other: &SemanticPolicy) -> bool
fn eq(&self, other: &SemanticPolicy) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SemanticPolicy
impl Serialize for SemanticPolicy
impl StructuralPartialEq for SemanticPolicy
Auto Trait Implementations§
impl Freeze for SemanticPolicy
impl RefUnwindSafe for SemanticPolicy
impl Send for SemanticPolicy
impl Sync for SemanticPolicy
impl Unpin for SemanticPolicy
impl UnsafeUnpin for SemanticPolicy
impl UnwindSafe for SemanticPolicy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> 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> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().