pub struct ContextRequest {
pub stage: String,
pub query: String,
pub budget_tokens: u32,
pub tags: Vec<String>,
pub min_score: f32,
pub max_capsules: usize,
pub prefer_roles: Vec<String>,
pub kinds: Vec<String>,
pub min_semantic_score: f32,
pub min_lexical_coverage: f32,
pub task_kind: TaskKind,
}Fields§
§stage: String§query: String§budget_tokens: u32v0.6: domain-hint tags. Capsules whose text or kind contains any
of these strings receive a 1.4× score boost, pushing on-domain
capsules above the min_score threshold when they would otherwise
be filtered out.
min_score: f32v0.6: minimum composite score for inclusion. When > 0.0 and the
top-scoring capsule falls below this threshold, ContextBundle
is returned with skipped: true and an empty capsule list —
zero tokens injected. 0.0 (default) disables the check.
max_capsules: usizev0.6: hard cap on returned capsules regardless of token budget. 0 = no cap (budget-only limit, prior behaviour).
prefer_roles: Vec<String>v0.6: role-preference boost. Capsules whose kind matches one
of these strings receive an additional 1.3× multiplier after the
tag boost (e.g. ["semantic_operator", "anti_pattern"] for bench).
kinds: Vec<String>v0.8: hard kind filter applied BEFORE scoring + capping. When
non-empty, only candidates whose capsule kind is in this list
survive — so a higher-ranked repo file or off-kind memory can’t
consume a (often single) slot. Used by the proactive engine to
restrict recall to actionable kinds (failure_pattern, command,
convention). Empty (default) keeps all kinds, prior behaviour.
min_semantic_score: f32D1e: absolute cosine-similarity floor. On embeddings builds,
memory candidates whose cosine to the query is below this
threshold are dropped before budgeting. 0.0 (default) disables
the floor — matches pre-D1e behaviour. Repo-file and manifest
candidates are unaffected (they have no cosine score). Populated
from BrokerSection.min_semantic_score by the pipeline; callers
that don’t set it get the prior behaviour automatically.
min_lexical_coverage: f32v1.0.0: absolute lexical relevance floor for memory candidates,
as the fraction of the query’s IDF-weighted discriminating power a
memory must cover. Unlike min_semantic_score this needs no query
embedding, so it protects the FTS-only hook path. When > 0.0, memory
candidates below the floor are dropped BEFORE scoring (so they don’t
even set the per-kind normalization max). Repo-file/manifest
candidates are unaffected. 0.0 (default) disables it — every existing
..Default::default() construction is unchanged. Populated from
BrokerSection.min_lexical_coverage by the pipeline.
task_kind: TaskKindE3: inferred kind of the current task. Defaults to Feature
(the neutral kind) so every existing ..Default::default()
construction is unchanged — Feature does NOT alter weights or
prefer_roles. Set by the pipeline via classify_task at intake.
Trait Implementations§
Source§impl Clone for ContextRequest
impl Clone for ContextRequest
Source§fn clone(&self) -> ContextRequest
fn clone(&self) -> ContextRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more