pub struct ContextPacket {
pub stage: Option<Record>,
pub critical_gotchas: Vec<Record>,
pub file_records: Vec<FileRecord>,
pub related_decisions: Vec<Record>,
pub recent_session: Option<String>,
pub token_estimate: u32,
pub stale_warnings: Vec<String>,
pub unconfirmed_candidates: Vec<String>,
pub knowledge_gaps: Vec<KnowledgeGap>,
pub compliance_rate: Option<f32>,
pub injection_string: String,
}Expand description
What mem_bootstrap() returns to Claude. Token-budgeted to 2,000 tokens.
Assembly order (ARCHITECTURE.md §6):
- Resolve
context_filesto graph nodes - Traverse
HasGotchaedges — direct gotchas for each file - Traverse
Importsone hop — gotchas for imported files - Traverse
AffectedByedges — relevant architectural decisions - Token-budget the result to 2,000 tokens
- Sort gotchas by
confidence × severity
The MCP tool returns injection_string as the top-level tool result text.
The full struct is used internally for structured rendering and debugging.
Does not derive PartialEq — transitively contains f32 score fields.
Fields§
§stage: Option<Record>Current stage:current record, if set.
critical_gotchas: Vec<Record>Gotchas sorted by confidence × severity. Only confirmed: true records.
Type is Record (not GotchaRecord) — the base record is the storage
unit. mem_bootstrap callers must look up the typed detail via
mati_core::store::GotchaRecord when the rule/reason fields are needed.
file_records: Vec<FileRecord>File records for the requested context files.
Decision records reached via AffectedBy graph traversal.
recent_session: Option<String>Plain-text summary of the last session (from session-harvest).
token_estimate: u32Estimated token count of this packet.
stale_warnings: Vec<String>Human-readable staleness warnings for records approaching Liability tier.
unconfirmed_candidates: Vec<String>Keys of confirmed: false Layer 0 stubs surfaced for developer review.
knowledge_gaps: Vec<KnowledgeGap>Top knowledge gaps ranked by risk score.
compliance_rate: Option<f32>Compliance rate for the last 7 days. Present only when < 0.85.
injection_string: StringPre-formatted markdown string returned as the MCP tool result text.
Trait Implementations§
Source§impl Clone for ContextPacket
impl Clone for ContextPacket
Source§fn clone(&self) -> ContextPacket
fn clone(&self) -> ContextPacket
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 ContextPacket
impl Debug for ContextPacket
Source§impl<'de> Deserialize<'de> for ContextPacket
impl<'de> Deserialize<'de> for ContextPacket
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>,
Auto Trait Implementations§
impl Freeze for ContextPacket
impl RefUnwindSafe for ContextPacket
impl Send for ContextPacket
impl Sync for ContextPacket
impl Unpin for ContextPacket
impl UnsafeUnpin for ContextPacket
impl UnwindSafe for ContextPacket
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit 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> 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 more