pub enum TaskEvent {
GoalSet {
at: DateTime<Utc>,
objective: String,
success_criteria: Vec<String>,
forbidden: Vec<String>,
source_session_id: String,
source_turn_id: String,
source_text_hash: String,
source_kind: GoalSourceKind,
confidence: f32,
},
GoalReaffirmed {
at: DateTime<Utc>,
progress_note: String,
},
GoalCleared {
at: DateTime<Utc>,
reason: String,
},
TaskAdded {
at: DateTime<Utc>,
id: String,
content: String,
parent_id: Option<String>,
},
TaskStatus {
at: DateTime<Utc>,
id: String,
status: SessionTaskStatus,
note: Option<String>,
},
DriftDetected {
at: DateTime<Utc>,
tool_calls_since_reaffirm: u32,
errors_since_reaffirm: u32,
},
}Expand description
A single durable event in the session task log.
TaskEvent is the append-only record format for session goal governance and
task lifecycle tracking. Each variant captures one fact that happened at a
specific UTC timestamp. The current materialized task state is reconstructed
by replaying these events in order, rather than by editing earlier records.
Events are serialized with an internally tagged Serde representation. The
kind field stores the variant name in snake_case, which keeps persisted
JSONL task logs readable and stable across releases.
Variants§
GoalSet
Declares or replaces the active session goal.
A goal contains the objective the agent should pursue, optional completion criteria, explicit forbidden behaviors, and provenance fields describing where the objective came from. When this event is folded into task state, it supersedes any previously active goal.
Fields
success_criteria: Vec<String>Criteria that indicate the objective has been satisfied.
Defaults to an empty list when omitted by older log entries or simple goal-setting paths.
forbidden: Vec<String>Actions or behaviors that are explicitly out of scope.
Defaults to an empty list when no additional forbidden behaviors were recorded.
source_session_id: StringIdentifier of the session containing the source evidence for this goal.
Empty when the producer did not capture a source session.
source_turn_id: StringTurn identifier or turn index within the source session.
Empty when the goal is not anchored to a specific raw transcript turn.
source_text_hash: StringHash of the source text used to derive the goal.
This allows provenance comparisons without duplicating the full source text in every event.
source_kind: GoalSourceKindCategory describing how the goal was derived.
Consumers can use this to distinguish strong provenance, such as raw transcript turns or direct user input, from weaker provenance, such as summarized recall, durable memory, or inference.
GoalReaffirmed
Records that the agent reaffirmed alignment with the active goal.
Reaffirmation does not change the objective. It stores a progress note so governance logic can reset drift counters and later explain why work continued.
Fields
GoalCleared
Clears the active session goal.
Folding the log after this event leaves the session without an active
goal until a later TaskEvent::GoalSet appears.
TaskAdded
Adds a task to the session task list.
Added tasks start as pending in folded state. Later
TaskEvent::TaskStatus events update tasks by matching the id field.
Fields
TaskStatus
Updates the lifecycle status of an existing task.
Folding logic applies this transition to the task with the matching id
when that task exists in the materialized task map. The event remains in
the append-only log even if the task is missing.
Fields
status: SessionTaskStatusNew lifecycle status for the task.
DriftDetected
Records that governance detected possible drift from the active goal.
Drift events preserve the counters that triggered an alignment warning, allowing later inspection to understand why the agent was asked to reaffirm the goal or stop before continuing.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskEvent
impl<'de> Deserialize<'de> for TaskEvent
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 TaskEvent
impl RefUnwindSafe for TaskEvent
impl Send for TaskEvent
impl Sync for TaskEvent
impl Unpin for TaskEvent
impl UnsafeUnpin for TaskEvent
impl UnwindSafe for TaskEvent
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request