pub struct Task {Show 15 fields
pub id: String,
pub title: String,
pub description: String,
pub status: TaskStatus,
pub complexity: u32,
pub priority: Priority,
pub dependencies: Vec<String>,
pub parent_id: Option<String>,
pub subtasks: Vec<String>,
pub details: Option<String>,
pub test_strategy: Option<String>,
pub created_at: Option<String>,
pub updated_at: Option<String>,
pub assigned_to: Option<String>,
pub agent_type: Option<String>,
}Fields§
§id: String§title: String§description: String§status: TaskStatus§complexity: u32§priority: Priority§dependencies: Vec<String>§parent_id: Option<String>§subtasks: Vec<String>§details: Option<String>§test_strategy: Option<String>§created_at: Option<String>§updated_at: Option<String>§assigned_to: Option<String>§agent_type: Option<String>Agent type for model routing (e.g., “builder”, “reviewer”, “planner”)
Implementations§
Source§impl Task
impl Task
Sourcepub const ID_SEPARATOR: char = ':'
pub const ID_SEPARATOR: char = ':'
ID separator for namespaced IDs (epic:local_id)
pub fn new(id: String, title: String, description: String) -> Self
Sourcepub fn parse_id(id: &str) -> Option<(&str, &str)>
pub fn parse_id(id: &str) -> Option<(&str, &str)>
Parse a task ID into (epic_tag, local_id) parts e.g., “phase1:10.1” -> Some((“phase1”, “10.1”)) e.g., “10.1” -> None (legacy format)
Sourcepub fn is_subtask(&self) -> bool
pub fn is_subtask(&self) -> bool
Check if this is a subtask (has parent)
Sourcepub fn is_expanded(&self) -> bool
pub fn is_expanded(&self) -> bool
Check if this task has been expanded into subtasks
Sourcepub fn validate_id(id: &str) -> Result<(), String>
pub fn validate_id(id: &str) -> Result<(), String>
Validate task ID - must contain only alphanumeric characters, hyphens, underscores, colons (for namespacing), and dots (for subtask IDs)
Sourcepub fn validate_title(title: &str) -> Result<(), String>
pub fn validate_title(title: &str) -> Result<(), String>
Validate title - must not be empty and within length limit
Sourcepub fn validate_description(description: &str) -> Result<(), String>
pub fn validate_description(description: &str) -> Result<(), String>
Validate description - within length limit
Sourcepub fn validate_complexity(complexity: u32) -> Result<(), String>
pub fn validate_complexity(complexity: u32) -> Result<(), String>
Validate complexity - must be a Fibonacci number
Sourcepub fn sanitize_text(text: &str) -> String
pub fn sanitize_text(text: &str) -> String
Sanitize text by removing potentially dangerous HTML/script tags
pub fn set_status(&mut self, status: TaskStatus)
pub fn update(&mut self)
pub fn has_dependencies_met(&self, all_tasks: &[Task]) -> bool
Sourcepub fn get_effective_dependencies(&self, all_tasks: &[&Task]) -> Vec<String>
pub fn get_effective_dependencies(&self, all_tasks: &[&Task]) -> Vec<String>
Get effective dependencies including inherited parent dependencies Subtasks inherit their parent’s dependencies (including cross-tag deps)
Sourcepub fn has_dependencies_met_refs(&self, all_tasks: &[&Task]) -> bool
pub fn has_dependencies_met_refs(&self, all_tasks: &[&Task]) -> bool
Check if all dependencies are met, searching across provided task references Supports cross-tag dependencies when passed tasks from all phases Subtasks inherit parent dependencies via get_effective_dependencies
Sourcepub fn needs_expansion(&self) -> bool
pub fn needs_expansion(&self) -> bool
Returns whether this task should be expanded into subtasks Only tasks with complexity >= 5 benefit from expansion Subtasks and already-expanded tasks don’t need expansion
Sourcepub fn recommended_subtasks(&self) -> usize
pub fn recommended_subtasks(&self) -> usize
Returns the recommended number of subtasks based on complexity Complexity 0-3: 0 subtasks (trivial/simple, no expansion needed) Complexity 5-8: 2 broad, multi-step subtasks Complexity 13+: 3 broad, multi-step subtasks
Sourcepub fn recommended_subtasks_for_complexity(complexity: u32) -> usize
pub fn recommended_subtasks_for_complexity(complexity: u32) -> usize
Static version for use when we only have complexity value
pub fn assign(&mut self, assignee: &str)
pub fn is_assigned_to(&self, assignee: &str) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Task
impl<'de> Deserialize<'de> for Task
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 Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
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