Skip to main content

Episode

Struct Episode 

Source
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: Uuid

Unique episode identifier

§task_type: TaskType

Type of task

§task_description: String

Description of the task

§context: TaskContext

Task 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: Vec<String>

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

Source

pub fn new( task_description: String, context: TaskContext, task_type: TaskType, ) -> Self

Create a new episode for a task.

Source

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

Source

pub fn is_complete(&self) -> bool

Check if the episode has been completed.

Source

pub fn duration(&self) -> Option<Duration>

Get the total duration of the episode.

Source

pub fn add_step(&mut self, step: ExecutionStep)

Add a new execution step to this episode.

Source

pub fn complete(&mut self, outcome: TaskOutcome)

Mark the episode as complete with a final outcome.

Source

pub fn successful_steps_count(&self) -> usize

Count the number of successful execution steps.

Source

pub fn failed_steps_count(&self) -> usize

Count the number of failed execution steps.

Source

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

Source

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

Source

pub fn has_tag(&self, tag: &str) -> bool

Check if episode has a specific tag

Source

pub fn clear_tags(&mut self)

Clear all tags from this episode

Source

pub fn get_tags(&self) -> &[String]

Get all tags for this episode

Source§

impl Episode

Source

pub fn validate(&self) -> Result<(), String>

Validate that the episode has required fields.

Source

pub fn validate_for_completion(&self) -> Result<(), String>

Validate that the episode is ready for completion.

Source

pub fn summary(&self) -> String

Get a summary of the episode for logging purposes.

Trait Implementations§

Source§

impl Clone for Episode

Source§

fn clone(&self) -> Episode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Episode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Episode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Episode

Source§

fn eq(&self, other: &Episode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Episode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Episode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DeserializeOwnedAlias for T

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> SendAlias for T

Source§

impl<T> SendAlias for T

Source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,

Source§

impl<T> SerializeAlias for T
where T: Serialize,

Source§

impl<T> SyncAlias for T

Source§

impl<T> SyncAlias for T