pub struct Provenance {
pub timestamp: SystemTime,
pub kind: ProvenanceKind,
pub entity: Option<String>,
pub actor: Actor,
pub client: Option<ClientId>,
pub note: Option<String>,
pub logical_operation_id: Option<String>,
}Expand description
One mutation event in a mem’s provenance log.
Constructed at the engine boundary (one per MCP mutating tool, one
per CLI mutation, one per drift-flush) and handed to the backend
via crate::backend::MemBackend::append_provenance. Read back
out via crate::backend::MemBackend::read_provenance for
memstead_changes_since.
The folder backend persists this as a JSONL line under
.memstead/changes.jsonl; the git-branch backend persists it as part
of the commit-message trailer block (timestamp / kind / entity ride
the commit metadata). The persistence form differs per backend, the
in-memory record does not.
Fields§
§timestamp: SystemTime§kind: ProvenanceKind§entity: Option<String>Mem-relative entity id (mem:slug), or None for batch
mutations that touch multiple entities.
actor: Actor§client: Option<ClientId>§note: Option<String>Agent-authored one-sentence provenance note. Whitespace-only
values are normalised to None at construction; callers that
want an empty note pass None.
logical_operation_id: Option<String>Correlation id that ties every commit produced by a single
logical operation (notably a multi-mem memstead_rename) to one
another. Some(id) on every commit a single logical call
produced; None on legacy or single-call mutations that don’t
participate in correlation. Consumers that don’t know the
field continue working — it’s purely additive. Single-mem
mutations may carry an id too (a logical-op with one commit),
or None — both are valid wire shapes.
Implementations§
Source§impl Provenance
impl Provenance
Sourcepub fn new(
timestamp: SystemTime,
kind: ProvenanceKind,
entity: Option<String>,
actor: Actor,
client: Option<ClientId>,
note: Option<String>,
) -> Self
pub fn new( timestamp: SystemTime, kind: ProvenanceKind, entity: Option<String>, actor: Actor, client: Option<ClientId>, note: Option<String>, ) -> Self
Build a record, normalising a whitespace-only note to None.
Callers that already have a normalised Option<String> may set
the field directly. logical_operation_id defaults to None;
callers that need to tag a multi-commit logical operation use
Self::with_logical_operation_id.
Sourcepub fn with_logical_operation_id(self, id: String) -> Self
pub fn with_logical_operation_id(self, id: String) -> Self
Builder: attach a correlation id so multiple commits produced by a single logical operation can be linked at read time.
Trait Implementations§
Source§impl Clone for Provenance
impl Clone for Provenance
Source§fn clone(&self) -> Provenance
fn clone(&self) -> Provenance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Provenance
impl RefUnwindSafe for Provenance
impl Send for Provenance
impl Sync for Provenance
impl Unpin for Provenance
impl UnsafeUnpin for Provenance
impl UnwindSafe for Provenance
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
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