pub struct DecisionRecorder { /* private fields */ }Expand description
Records agent decisions with rationale for learning
Implementations§
Source§impl DecisionRecorder
impl DecisionRecorder
Sourcepub fn new(handle: Arc<SurrealHandle>, config: DecisionRecorderConfig) -> Self
pub fn new(handle: Arc<SurrealHandle>, config: DecisionRecorderConfig) -> Self
Create a new decision recorder
Sourcepub fn with_default_config(handle: Arc<SurrealHandle>) -> Self
pub fn with_default_config(handle: Arc<SurrealHandle>) -> Self
Create with default configuration
Sourcepub async fn record_decision(
&self,
commit_id: String,
task: String,
action: String,
rationale: String,
confidence: f32,
) -> Result<String>
pub async fn record_decision( &self, commit_id: String, task: String, action: String, rationale: String, confidence: f32, ) -> Result<String>
Record a decision from a run
This captures decisions made during execution with context and rationale.
Sourcepub async fn record_decision_with_source(
&self,
commit_id: String,
task: String,
action: String,
rationale: String,
confidence: f32,
source: DecisionCaptureSource,
) -> Result<String>
pub async fn record_decision_with_source( &self, commit_id: String, task: String, action: String, rationale: String, confidence: f32, source: DecisionCaptureSource, ) -> Result<String>
Record a decision and apply source-specific capture policy.
Sourcepub async fn record_decision_outcome(
&self,
decision_id: &str,
outcome_json: String,
) -> Result<()>
pub async fn record_decision_outcome( &self, decision_id: &str, outcome_json: String, ) -> Result<()>
Record decision outcome
Sourcepub async fn record_provenance(
&self,
provenance: MemoryProvenanceRecord,
) -> Result<String>
pub async fn record_provenance( &self, provenance: MemoryProvenanceRecord, ) -> Result<String>
Record memory provenance for a memory
Sourcepub async fn get_decision_history(
&self,
task: &str,
limit: usize,
) -> Result<Vec<DecisionRecord>>
pub async fn get_decision_history( &self, task: &str, limit: usize, ) -> Result<Vec<DecisionRecord>>
Get decision history for a task
Sourcepub async fn get_decision_success_rate(&self, action: &str) -> Result<f32>
pub async fn get_decision_success_rate(&self, action: &str) -> Result<f32>
Calculate decision success rate for an action
Sourcepub async fn invalidate_provenance_on_failure(
&self,
commit_id: &str,
) -> Result<()>
pub async fn invalidate_provenance_on_failure( &self, commit_id: &str, ) -> Result<()>
Invalidate decision provenance when a run fails
Auto Trait Implementations§
impl Freeze for DecisionRecorder
impl !RefUnwindSafe for DecisionRecorder
impl Send for DecisionRecorder
impl Sync for DecisionRecorder
impl Unpin for DecisionRecorder
impl UnsafeUnpin for DecisionRecorder
impl !UnwindSafe for DecisionRecorder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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