pub struct Goal {Show 25 fields
pub id: String,
pub description: String,
pub domain: String,
pub goal_type: String,
pub status: String,
pub priority: String,
pub conditions: Option<String>,
pub context: Option<String>,
pub resources: Option<String>,
pub budget_per_check: Option<i64>,
pub budget_daily: Option<i64>,
pub tokens_used_today: i64,
pub tokens_used_day: String,
pub last_useful_action: Option<String>,
pub created_at: String,
pub updated_at: String,
pub completed_at: Option<String>,
pub parent_goal_id: Option<String>,
pub session_id: String,
pub notified_at: Option<String>,
pub notification_attempts: i32,
pub dispatch_failures: i32,
pub progress_notes: Option<Vec<String>>,
pub source_episode_id: Option<i64>,
pub legacy_int_id: Option<i64>,
}Expand description
A goal — a tracked, potentially long-running objective.
Goals are stored in a single goals table with a domain that gates behavior:
orchestration: can be scheduled/continuous, can have tasks, can be dispatchedpersonal: tracked/injected/listed, never dispatched, usually no tasks
Fields§
§id: String§description: String§domain: String“orchestration” (default) or “personal”
goal_type: String“finite” (one-shot) or “continuous” (monitoring/recurring)
status: String“pending”, “pending_confirmation”, “active”, “paused”, “completed”, “failed”, “cancelled”, “abandoned”
priority: String“low”, “medium”, “high”, “critical”
conditions: Option<String>Success/completion conditions (human-readable)
context: Option<String>JSON context blob (original request, constraints, etc.)
resources: Option<String>JSON array of resource references (files, URLs, etc.)
budget_per_check: Option<i64>Max tokens per check (for continuous goals)
budget_daily: Option<i64>Max tokens per day for this goal
tokens_used_today: i64Tokens used for the UTC day in tokens_used_day (reset daily).
tokens_used_day: StringUTC day anchor for tokens_used_today (YYYY-MM-DD).
last_useful_action: Option<String>Timestamp of last meaningful action
created_at: String§updated_at: String§completed_at: Option<String>§parent_goal_id: Option<String>Parent goal ID for hierarchical decomposition
session_id: StringSession where this goal was created
notified_at: Option<String>Timestamp when user was notified of completion/failure (None = not yet notified)
notification_attempts: i32Number of notification delivery attempts (gives up after 3)
dispatch_failures: i32Consecutive dispatch cycles with no progress (circuit breaker: stalls at 3)
progress_notes: Option<Vec<String>>Personal-goal progress notes (append-only) stored as JSON array.
source_episode_id: Option<i64>Optional episodic-memory provenance (personal goals).
legacy_int_id: Option<i64>Optional legacy integer ID (for migrated pre-unification personal goals).
Implementations§
Source§impl Goal
impl Goal
Sourcepub fn new_finite(description: &str, session_id: &str) -> Self
pub fn new_finite(description: &str, session_id: &str) -> Self
Create a new finite (one-shot) goal from a user request.
Sourcepub fn new_personal(description: &str, session_id: &str) -> Self
pub fn new_personal(description: &str, session_id: &str) -> Self
Create a new personal goal.
Personal goals are tracked and injected (DM-only) but never dispatched as background work. Budgets are unset because they do not execute.
Sourcepub fn new_deferred_finite(description: &str, session_id: &str) -> Self
pub fn new_deferred_finite(description: &str, session_id: &str) -> Self
Create a deferred one-shot finite goal pending user confirmation.
Scheduling is managed via GoalSchedule rows, not a goal column.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Goal
impl<'de> Deserialize<'de> for Goal
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 Forget for Goal
impl Freeze for Goal
impl Move for Goal
impl RefUnwindSafe for Goal
impl Send for Goalwhere
RawVecInner: Send,
impl Sync for Goalwhere
RawVecInner: Sync,
impl Unpin for Goal
impl UnsafeUnpin for Goalwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Goalwhere
RawVecInner: UnwindSafe,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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