pub struct Plan {Show 16 fields
pub id: String,
pub short_id: Option<String>,
pub project_id: String,
pub project_path: String,
pub title: String,
pub content: Option<String>,
pub status: PlanStatus,
pub success_criteria: Option<String>,
pub session_id: Option<String>,
pub created_in_session: Option<String>,
pub completed_in_session: Option<String>,
pub source_path: Option<String>,
pub source_hash: Option<String>,
pub created_at: i64,
pub updated_at: i64,
pub completed_at: Option<i64>,
}Expand description
A plan in SaveContext.
Plans provide:
- PRD/specification storage
- Linkage to epics and issues
- Success criteria tracking
- Status progression (draft -> active -> completed)
Fields§
§id: StringUnique identifier (UUID format)
short_id: Option<String>Short ID for easy reference (e.g., “PLAN-1”)
project_id: StringProject ID this plan belongs to
project_path: StringProject path for queries
title: StringPlan title
content: Option<String>Plan content (markdown PRD/spec)
status: PlanStatusCurrent status
success_criteria: Option<String>Success criteria for completion
session_id: Option<String>Session this plan is bound to (TTY-resolved)
created_in_session: Option<String>Session where this plan was created (legacy metadata)
completed_in_session: Option<String>Session where this plan was completed
source_path: Option<String>Source file path (for multi-agent capture dedup)
source_hash: Option<String>SHA-256 hash of source file content (for dedup)
created_at: i64Creation timestamp (Unix milliseconds)
updated_at: i64Last update timestamp (Unix milliseconds)
completed_at: Option<i64>Completion timestamp (Unix milliseconds)
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn new(project_id: String, project_path: String, title: String) -> Self
pub fn new(project_id: String, project_path: String, title: String) -> Self
Create a new plan with default values.
Sourcepub fn with_content(self, content: &str) -> Self
pub fn with_content(self, content: &str) -> Self
Set the plan content.
Sourcepub fn with_status(self, status: PlanStatus) -> Self
pub fn with_status(self, status: PlanStatus) -> Self
Set the plan status.
Sourcepub fn with_success_criteria(self, criteria: &str) -> Self
pub fn with_success_criteria(self, criteria: &str) -> Self
Set the success criteria.
Sourcepub fn with_session(self, session_id: &str) -> Self
pub fn with_session(self, session_id: &str) -> Self
Bind to a session.
Sourcepub fn with_source(self, path: &str, hash: &str) -> Self
pub fn with_source(self, path: &str, hash: &str) -> Self
Set the source file path and content hash (for capture dedup).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Plan
impl<'de> Deserialize<'de> for Plan
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 Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin for Plan
impl UnwindSafe for Plan
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 more