pub struct AdaptiveConfig {
pub schema_version: u32,
pub dedup: DedupConfig,
pub templates: TemplatesConfig,
pub mckp: MckpConfig,
pub telemetry: TelemetryConfig,
pub endpoint_overrides: BTreeMap<String, EndpointOverride>,
pub profiles: ProfilesConfig,
pub hints: HintsConfig,
pub tools: BTreeMap<String, ToolValueModel>,
pub enrichment: EnrichmentConfig,
}Expand description
Root configuration for the layered pipeline.
Fields§
§schema_version: u32§dedup: DedupConfig§templates: TemplatesConfig§mckp: MckpConfig§telemetry: TelemetryConfig§endpoint_overrides: BTreeMap<String, EndpointOverride>Per-endpoint overrides. Keyed by endpoint_class (see telemetry schema).
profiles: ProfilesConfigSchema-v2: profile axes (tokenizer / llm / agent / data).
hints: HintsConfigSchema-v2: horizontal hint policy.
tools: BTreeMap<String, ToolValueModel>Schema-v3: per-tool value models for the Paper 3 enrichment
planner. Keyed by anonymized tool name (e.g. "Read",
"mcp__pXXXXXX__get_branch_pipeline"). User overrides land
here from [tools.<name>] blocks; provider-shipped defaults
are merged in at startup time.
enrichment: EnrichmentConfigSchema-v4: speculative-execution settings for the Paper 3 enrichment planner. Off by default — opt-in.
Implementations§
Source§impl AdaptiveConfig
impl AdaptiveConfig
Sourcepub fn load_or_default(path: impl AsRef<Path>) -> Result<Self>
pub fn load_or_default(path: impl AsRef<Path>) -> Result<Self>
Load a config from disk. Missing files resolve to Default::default(),
so callers can unconditionally load without a separate existence check.
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self>
pub fn load(path: impl AsRef<Path>) -> Result<Self>
Strict load — fails if the file is missing.
Sourcepub fn save(&self, path: impl AsRef<Path>) -> Result<()>
pub fn save(&self, path: impl AsRef<Path>) -> Result<()>
Serialize to TOML and write atomically.
Sourcepub fn effective_dedup_enabled(&self, endpoint: &str) -> bool
pub fn effective_dedup_enabled(&self, endpoint: &str) -> bool
Effective L0-dedup enabled flag for endpoint. Reads
endpoint_overrides[endpoint].dedup_enabled first, then falls back to
dedup.enabled_per_endpoint, then to the permissive default (true).
Sourcepub fn effective_min_body_chars(&self, endpoint: &str) -> usize
pub fn effective_min_body_chars(&self, endpoint: &str) -> usize
Effective min_body_chars threshold for endpoint. Per-endpoint
override wins; otherwise the global dedup.min_body_chars applies.
Sourcepub fn effective_lru_size(&self, endpoint: &str) -> usize
pub fn effective_lru_size(&self, endpoint: &str) -> usize
Effective LRU capacity for endpoint. The base cache uses the global
dedup.lru_size; if an endpoint requests a larger capacity the
caller should widen the shared cache accordingly. The hint is read
once at construction time.
Sourcepub fn max_lru_size(&self) -> usize
pub fn max_lru_size(&self) -> usize
Maximum LRU capacity requested across all endpoint overrides and the
global dedup.lru_size. Used at LayeredPipeline::new time to size
the shared cache.
Sourcepub fn effective_tokenizer_profile(&self) -> &TokenizerProfile
pub fn effective_tokenizer_profile(&self) -> &TokenizerProfile
Effective tokenizer profile resolved from profiles.tokenizer.active
(or auto → anthropic_class). Always returns some profile —
falls back to the default anthropic_class if the active id is
missing from variants.
Sourcepub fn effective_token_count(&self, text: &str) -> usize
pub fn effective_token_count(&self, text: &str) -> usize
Token count for text under the active tokenizer profile. Hot path:
when the profile selects Tokenizer::Heuristic, this is a single
integer division on text.len(). When BPE is selected, it pays one
tiktoken-rs encode call (typically 1–10 µs).
Sourcepub fn effective_template(&self, endpoint: &str) -> Option<&str>
pub fn effective_template(&self, endpoint: &str) -> Option<&str>
Effective L1 template id for endpoint. Per-endpoint override wins;
falls back to templates.endpoint_overrides.
Sourcepub fn effective_tool_value_model(
&self,
tool_name: &str,
) -> Option<&ToolValueModel>
pub fn effective_tool_value_model( &self, tool_name: &str, ) -> Option<&ToolValueModel>
Effective ToolValueModel for tool_name for the Paper 3
enrichment planner. Resolution order:
- exact match in
[tools.<name>](user override or merged provider default); - wildcard
*block (catch-all overrides — useful for blanketvalue_class = "supporting"policies); None— caller substitutes the global default.
Sourcepub fn merge_right_wins(&mut self, other: AdaptiveConfig)
pub fn merge_right_wins(&mut self, other: AdaptiveConfig)
Merge another config into self. Fields present in other override self.
Endpoint overrides are unioned (right-wins on collisions).
Trait Implementations§
Source§impl Clone for AdaptiveConfig
impl Clone for AdaptiveConfig
Source§fn clone(&self) -> AdaptiveConfig
fn clone(&self) -> AdaptiveConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more