pub struct ContextKernel { /* private fields */ }Expand description
The Context Control Kernel — orchestrates candidate gathering, Phi scoring, budget-optimal selection, and plan/receipt generation.
Implementations§
Source§impl ContextKernel
impl ContextKernel
Sourcepub fn new(providers: Vec<Box<dyn CandidateProvider>>) -> Self
pub fn new(providers: Vec<Box<dyn CandidateProvider>>) -> Self
Create a new kernel with the given providers.
Sourcepub fn for_project(project_root: &str) -> Self
pub fn for_project(project_root: &str) -> Self
Create a kernel with default providers for a project.
Sourcepub fn register(&mut self, provider: Box<dyn CandidateProvider>)
pub fn register(&mut self, provider: Box<dyn CandidateProvider>)
Register an additional provider.
Sourcepub fn gather(&self, ctx: &RetrievalContext) -> Vec<ContextObjectV1>
pub fn gather(&self, ctx: &RetrievalContext) -> Vec<ContextObjectV1>
Gather and content-deduplicate candidates from all registered providers.
Sourcepub fn plan(&self, ctx: &RetrievalContext) -> ContextPlanV1
pub fn plan(&self, ctx: &RetrievalContext) -> ContextPlanV1
Score candidates, compile the best package under budget, and return its plan.
Sourcepub fn record_receipt(
&self,
plan: &ContextPlanV1,
delivered_tokens: usize,
outcome: ReceiptOutcome,
) -> ContextReceiptV1
pub fn record_receipt( &self, plan: &ContextPlanV1, delivered_tokens: usize, outcome: ReceiptOutcome, ) -> ContextReceiptV1
Record delivery outcome and provider-level feedback for a completed plan.
Auto Trait Implementations§
impl !RefUnwindSafe for ContextKernel
impl !UnwindSafe for ContextKernel
impl Freeze for ContextKernel
impl Send for ContextKernel
impl Sync for ContextKernel
impl Unpin for ContextKernel
impl UnsafeUnpin for ContextKernel
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
Converts
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>
Converts
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 more