Task

Struct Task 

Source
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

Source

pub const ID_SEPARATOR: char = ':'

ID separator for namespaced IDs (epic:local_id)

Source

pub fn new(id: String, title: String, description: String) -> Self

Source

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)

Source

pub fn make_id(epic_tag: &str, local_id: &str) -> String

Create a namespaced task ID

Source

pub fn local_id(&self) -> &str

Get the local ID part (without epic prefix)

Source

pub fn epic_tag(&self) -> Option<&str>

Get the epic tag from a namespaced ID

Source

pub fn is_subtask(&self) -> bool

Check if this is a subtask (has parent)

Source

pub fn is_expanded(&self) -> bool

Check if this task has been expanded into subtasks

Source

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)

Source

pub fn validate_title(title: &str) -> Result<(), String>

Validate title - must not be empty and within length limit

Source

pub fn validate_description(description: &str) -> Result<(), String>

Validate description - within length limit

Source

pub fn validate_complexity(complexity: u32) -> Result<(), String>

Validate complexity - must be a Fibonacci number

Source

pub fn sanitize_text(text: &str) -> String

Sanitize text by removing potentially dangerous HTML/script tags

Source

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

Comprehensive validation of all task fields

Source

pub fn set_status(&mut self, status: TaskStatus)

Source

pub fn update(&mut self)

Source

pub fn has_dependencies_met(&self, all_tasks: &[Task]) -> bool

Source

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)

Source

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

Source

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

Source

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

Source

pub fn recommended_subtasks_for_complexity(complexity: u32) -> usize

Static version for use when we only have complexity value

Source

pub fn assign(&mut self, assignee: &str)

Source

pub fn is_assigned_to(&self, assignee: &str) -> bool

Source

pub fn would_create_cycle( &self, new_dep_id: &str, all_tasks: &[Task], ) -> Result<(), String>

Check if adding a dependency would create a circular reference Returns Err with the cycle path if circular dependency detected

Trait Implementations§

Source§

impl Clone for Task

Source§

fn clone(&self) -> Task

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 Task

Source§

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

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

impl<'de> Deserialize<'de> for Task

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 Serialize for Task

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

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> 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> 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<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>,