pub enum MemoryEvent {
Show 30 variants
EpisodeCreated {
id: MemoryId,
content_preview: String,
},
SemanticCreated {
id: MemoryId,
concept_name: String,
},
ProceduralCreated {
id: MemoryId,
procedure_name: String,
},
MemoryCorrected {
logical_memory_id: LogicalMemoryId,
old_revision_id: RevisionId,
new_revision_id: RevisionId,
reason: Option<String>,
},
MemorySuperseded {
logical_memory_id: LogicalMemoryId,
prior_revision_id: RevisionId,
new_revision_id: RevisionId,
reason: Option<String>,
},
MemoryOverridden {
logical_memory_id: LogicalMemoryId,
prior_revision_id: RevisionId,
override_revision_id: RevisionId,
reason: Option<String>,
},
MemoryMerged {
target_logical_memory_id: LogicalMemoryId,
prior_target_revision_id: RevisionId,
new_target_revision_id: RevisionId,
source_logical_memory_ids: Vec<LogicalMemoryId>,
source_revision_ids: Vec<RevisionId>,
reason: Option<String>,
},
MemoryRetracted {
logical_memory_id: LogicalMemoryId,
prior_revision_id: RevisionId,
tombstone_revision_id: RevisionId,
reason: Option<String>,
},
WorkingPushed {
id: MemoryId,
},
ImportanceUpdated {
id: MemoryId,
old_value: f32,
new_value: f32,
},
Reconsolidated {
id: MemoryId,
reason: String,
},
EdgeCreated {
source: MemoryId,
target: MemoryId,
relation: EdgeRelation,
weight: f32,
},
EdgeWeightUpdated {
source: MemoryId,
target: MemoryId,
relation: EdgeRelation,
old_weight: f32,
new_weight: f32,
},
Archived {
id: MemoryId,
},
Forgotten {
id: MemoryId,
},
Consolidated {
records_processed: usize,
},
SnapshotTaken {
seq: u64,
tag: String,
},
CompactionCompleted {
before_seq: u64,
events_removed: u64,
},
AdmissionEvaluated {
candidate_id: MemoryId,
decision: String,
controllers_consulted: Vec<String>,
},
HypothesisGenerated {
id: MemoryId,
source_a: MemoryId,
source_b: MemoryId,
batch_id: String,
},
HypothesisValidated {
id: MemoryId,
new_confidence: f32,
evidence_count: u32,
batch_id: String,
},
HypothesisDiscarded {
id: MemoryId,
reason: String,
batch_id: String,
},
AccessGranted {
action: String,
realm: String,
namespace: String,
policy_ids: Vec<String>,
},
AccessDenied {
action: String,
realm: String,
namespace: String,
reasons: Vec<String>,
policy_ids: Vec<String>,
},
PolicyChanged {
policy_name: String,
change_type: String,
policy_content: String,
},
MemoryRecalled {
query_preview: String,
results_count: usize,
},
ContradictionDetected {
memory_a: MemoryId,
memory_b: MemoryId,
confidence: f32,
},
CausalEdgeDiscovered {
cause: MemoryId,
effect: MemoryId,
strength: f32,
},
Error {
operation: String,
message: String,
},
Unknown,
}Expand description
An event emitted when the database state changes.
Covers all mutation types for event sourcing.
New variants can be added without breaking old readers thanks to
#[serde(other)] on the Unknown fallback.
Externally tagged (default) for bincode compatibility. JSON uses
{"EpisodeCreated": {...}} style.
Variants§
EpisodeCreated
A new episodic memory was created.
SemanticCreated
A new semantic record was created.
ProceduralCreated
A new procedural record was created.
MemoryCorrected
A semantic memory was corrected with a new head revision.
MemorySuperseded
A semantic memory was explicitly superseded by a new head revision.
MemoryOverridden
A semantic memory head was explicitly overridden by a human/admin revision.
Fields
logical_memory_id: LogicalMemoryIdprior_revision_id: RevisionIdoverride_revision_id: RevisionIdMemoryMerged
One or more semantic logical memories were merged into an active target chain.
Fields
target_logical_memory_id: LogicalMemoryIdprior_target_revision_id: RevisionIdnew_target_revision_id: RevisionIdsource_logical_memory_ids: Vec<LogicalMemoryId>source_revision_ids: Vec<RevisionId>MemoryRetracted
A semantic memory was retracted via a tombstone revision.
Fields
logical_memory_id: LogicalMemoryIdprior_revision_id: RevisionIdtombstone_revision_id: RevisionIdWorkingPushed
A working memory entry was pushed.
ImportanceUpdated
Importance score was updated.
Reconsolidated
A memory was reconsolidated (modified during labile window).
EdgeCreated
A graph edge was created.
EdgeWeightUpdated
A graph edge weight was updated.
Archived
A memory was archived (soft-deleted).
Forgotten
A memory was permanently forgotten (hard-deleted).
Consolidated
Consolidation completed.
SnapshotTaken
A snapshot was taken.
CompactionCompleted
Compaction completed.
AdmissionEvaluated
An admission control decision was made.
HypothesisGenerated
A dream hypothesis was generated.
HypothesisValidated
A dream hypothesis was validated and promoted.
HypothesisDiscarded
A dream hypothesis was discarded after validation.
AccessGranted
An authorization request was granted.
AccessDenied
An authorization request was denied.
PolicyChanged
A Cedar policy was added, removed, or modified.
MemoryRecalled
A memory was recalled (query executed).
ContradictionDetected
A contradiction was detected between two memories.
CausalEdgeDiscovered
A causal edge was discovered during consolidation.
Error
An error occurred during a database operation.
Unknown
Unknown event variant for forward compatibility.
Implementations§
Source§impl MemoryEvent
impl MemoryEvent
Sourcepub fn event_type(&self) -> &'static str
pub fn event_type(&self) -> &'static str
Event type as a short string.
Sourcepub fn should_persist(&self) -> bool
pub fn should_persist(&self) -> bool
Whether this event should be appended to the durable event log.
Trait Implementations§
Source§impl Clone for MemoryEvent
impl Clone for MemoryEvent
Source§fn clone(&self) -> MemoryEvent
fn clone(&self) -> MemoryEvent
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 MemoryEvent
impl Debug for MemoryEvent
Source§impl<'de> Deserialize<'de> for MemoryEvent
impl<'de> Deserialize<'de> for MemoryEvent
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 MemoryEvent
impl RefUnwindSafe for MemoryEvent
impl Send for MemoryEvent
impl Sync for MemoryEvent
impl Unpin for MemoryEvent
impl UnsafeUnpin for MemoryEvent
impl UnwindSafe for MemoryEvent
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,
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
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.