Skip to main content

ContextBundle

Struct ContextBundle 

Source
pub struct ContextBundle {
    pub stage: String,
    pub budget_tokens: u32,
    pub used_tokens: u32,
    pub capsules: Vec<ContextCapsule>,
    pub excluded: Vec<ContextCapsule>,
    pub skipped: bool,
    pub top_score: f32,
    pub top_abs_evidence: f32,
    pub evidence_coverage: f32,
    pub uncovered_terms: Vec<String>,
    pub chronological: bool,
    pub known_fact_conflicts: Vec<String>,
}

Fields§

§stage: String§budget_tokens: u32§used_tokens: u32§capsules: Vec<ContextCapsule>§excluded: Vec<ContextCapsule>§skipped: bool

v0.6: true when the top capsule score was below min_score. All capsules are empty; no tokens were injected.

§top_score: f32

v0.6: best composite score observed before the skip check. Useful for diagnostics (“why was the brain silent?”).

§top_abs_evidence: f32

v2.7: best ABSOLUTE cosine evidence any memory candidate achieved. Unlike top_score this is not normalized, so “0.42” means the same thing on a 3-memory brain and a 3000-memory brain. -1.0 means no comparable cosine was available (lean builds or cross-model rows), so the cosine-calibrated gate has no verdict. Exposed for diagnostics and threshold sweeps.

§evidence_coverage: f32

v2.6: what fraction of the query’s discriminating power the returned capsules cover, collectively, in [0, 1].

Kimetsu already abstains at the bundle level — nothing above min_score means an empty bundle and zero tokens. What it never did is say anything about a bundle it does return, so a reader handed three capsules that touch half the question has no way to tell that from three that answer it, and confabulates the rest. That is what BEAM’s abstention track measures, and where Kimetsu scores worst (45% / 30%).

IDF-weighted against the corpus, so a query term present in every memory contributes nothing and a rare one dominates — the same weighting the per-memory lexical floor uses, applied to the bundle as a whole. 1.0 when there is no discriminating term to measure against.

§uncovered_terms: Vec<String>

v2.6: the discriminating query terms no returned capsule mentions.

The actionable half of evidence_coverage: a reader can be told precisely what memory does not know about, rather than being handed a number. Empty when coverage is complete or unmeasurable.

§chronological: bool

v2.6: true when the query asked about order and the capsules were re-rendered chronologically, oldest first, each carrying its date.

The reader needs to be told, or a time-ordered bundle looks like a relevance-ranked one whose ranking has gone wrong. See crate::ordering for why ordering is rendered rather than retrieved.

§known_fact_conflicts: Vec<String>

Conflicts observed in eligible evidence before delivery trimming.

Trait Implementations§

Source§

impl Clone for ContextBundle

Source§

fn clone(&self) -> ContextBundle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ContextBundle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more