pub enum NoteKind {
Fact,
Preference,
Procedure,
}Expand description
The on-disk note format and the memory taxonomy now live in
car_memgine::note_store, so the MCP server can read and write the SAME
store this assistant does. Re-exported here because NoteKind is part of
this module’s published surface (car_server_core::assistant::NoteKind)
and callers should not have to care that it moved.
The model-facing memory taxonomy. Each variant routes to genuinely
different downstream behavior in memgine — this is the behavioral hint the
tool schema carries instead of prose in a system prompt telling the model
what is “worth keeping”.
Variants§
Fact
Retrieved when relevant to the query (the Facts layer).
Preference
A standing instruction. Saved as a memgine constraint, so it lands in the Active Constraints layer that context assembly includes in every session regardless of query.
Procedure
Procedural evidence — what was attempted and whether it worked.
Implementations§
Source§impl NoteKind
impl NoteKind
Sourcepub fn parse(raw: Option<&str>) -> Result<NoteKind, String>
pub fn parse(raw: Option<&str>) -> Result<NoteKind, String>
Strict parse for a value a model supplied. An unknown kind is an error the model can see and correct.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The wire spelling, matching the serde rename_all = "lowercase" and
the vocabulary Self::parse accepts.
Sourcepub fn from_wire(raw: Option<&str>) -> NoteKind
pub fn from_wire(raw: Option<&str>) -> NoteKind
Lenient read-side parse for a value that came off the sync wire.
Unlike Self::parse, an unrecognized kind is NOT an error: it means
a peer running a newer build used a variant this device does not know
about, and degrading that to a plain fact is strictly better than
dropping the fact or failing the recall.
Sourcepub fn from_constraint_dialect(raw: Option<&str>) -> NoteKind
pub fn from_constraint_dialect(raw: Option<&str>) -> NoteKind
Map the constraint/pattern vocabulary the MCP tool schema and the
memory.persist wire format use onto this one.
Those surfaces predate NoteKind and speak a different dialect: they
carry a free-form kind where only the exact string "constraint"
means anything, and everything else (including the documented default
"pattern") is a plain fact. Both dialects now write the SAME file, so
the translation has to live somewhere explicit rather than being
re-derived — a "constraint" that round-trips as a Fact silently
demotes a standing rule to something recall only sometimes surfaces.
Sourcepub fn is_constraint(self) -> bool
pub fn is_constraint(self) -> bool
Whether this note is a standing rule, and therefore a memgine constraint rather than a query-matched fact.
Trait Implementations§
impl Copy for NoteKind
Source§impl<'de> Deserialize<'de> for NoteKind
impl<'de> Deserialize<'de> for NoteKind
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NoteKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NoteKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for NoteKind
Source§impl Serialize for NoteKind
impl Serialize for NoteKind
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for NoteKind
Auto Trait Implementations§
impl Freeze for NoteKind
impl RefUnwindSafe for NoteKind
impl Send for NoteKind
impl Sync for NoteKind
impl Unpin for NoteKind
impl UnsafeUnpin for NoteKind
impl UnwindSafe for NoteKind
Blanket Implementations§
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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