pub struct Episode {Show 17 fields
pub episode_id: Uuid,
pub task_type: TaskType,
pub task_description: String,
pub context: TaskContext,
pub start_time: DateTime<Utc>,
pub end_time: Option<DateTime<Utc>>,
pub steps: Vec<ExecutionStep>,
pub outcome: Option<TaskOutcome>,
pub reward: Option<RewardScore>,
pub reflection: Option<Reflection>,
pub patterns: Vec<PatternId>,
pub heuristics: Vec<Uuid>,
pub applied_patterns: Vec<PatternApplication>,
pub salient_features: Option<SalientFeatures>,
pub metadata: HashMap<String, String>,
pub tags: Vec<String>,
pub checkpoints: Vec<CheckpointMeta>,
}Expand description
Complete record of a task execution from start to finish.
Fields§
§episode_id: UuidUnique episode identifier
task_type: TaskTypeType of task
task_description: StringDescription of the task
context: TaskContextTask context and metadata
start_time: DateTime<Utc>When episode started
end_time: Option<DateTime<Utc>>When episode completed (None if in progress)
steps: Vec<ExecutionStep>Execution steps
outcome: Option<TaskOutcome>Final outcome
reward: Option<RewardScore>Reward score
reflection: Option<Reflection>Reflection on execution
patterns: Vec<PatternId>Extracted pattern IDs
heuristics: Vec<Uuid>Extracted heuristic IDs
applied_patterns: Vec<PatternApplication>Record of patterns applied during execution
salient_features: Option<SalientFeatures>Salient features extracted during pre-storage reasoning (PREMem)
metadata: HashMap<String, String>Additional metadata
Tags for episode categorization (e.g., “bug-fix”, “feature”, “refactor”)
checkpoints: Vec<CheckpointMeta>Checkpoints created during episode execution (ADR-044 Feature 3)
Implementations§
Source§impl Episode
impl Episode
Sourcepub fn new(
task_description: String,
context: TaskContext,
task_type: TaskType,
) -> Self
pub fn new( task_description: String, context: TaskContext, task_type: TaskType, ) -> Self
Create a new episode for a task.
Sourcepub fn record_pattern_application(
&mut self,
pattern_id: PatternId,
applied_at_step: usize,
outcome: ApplicationOutcome,
notes: Option<String>,
)
pub fn record_pattern_application( &mut self, pattern_id: PatternId, applied_at_step: usize, outcome: ApplicationOutcome, notes: Option<String>, )
Record that a pattern was applied during this episode
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if the episode has been completed.
Sourcepub fn add_step(&mut self, step: ExecutionStep)
pub fn add_step(&mut self, step: ExecutionStep)
Add a new execution step to this episode.
Sourcepub fn complete(&mut self, outcome: TaskOutcome)
pub fn complete(&mut self, outcome: TaskOutcome)
Mark the episode as complete with a final outcome.
Sourcepub fn successful_steps_count(&self) -> usize
pub fn successful_steps_count(&self) -> usize
Count the number of successful execution steps.
Sourcepub fn failed_steps_count(&self) -> usize
pub fn failed_steps_count(&self) -> usize
Count the number of failed execution steps.
Sourcepub fn add_tag(&mut self, tag: String) -> Result<bool, String>
pub fn add_tag(&mut self, tag: String) -> Result<bool, String>
Add a tag to this episode (normalized, no duplicates)
Returns Ok(true) if tag was added, Ok(false) if already exists, Err if invalid
Sourcepub fn remove_tag(&mut self, tag: &str) -> bool
pub fn remove_tag(&mut self, tag: &str) -> bool
Remove a tag from this episode
Returns true if tag was removed, false if not found
Clear all tags from this episode
Get all tags for this episode
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Episode
impl<'de> Deserialize<'de> for Episode
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>,
impl StructuralPartialEq for Episode
Auto Trait Implementations§
impl Freeze for Episode
impl RefUnwindSafe for Episode
impl Send for Episode
impl Sync for Episode
impl Unpin for Episode
impl UnsafeUnpin for Episode
impl UnwindSafe for Episode
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> 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> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.