pub struct Task {
pub id: String,
pub title: String,
pub description: Option<String>,
pub key: Option<String>,
pub status: TaskStatus,
pub priority: u8,
pub blocked_by: Vec<String>,
pub loop_id: Option<String>,
pub created: String,
pub started: Option<String>,
pub closed: Option<String>,
}Expand description
A task in the task tracking system.
Fields§
§id: StringUnique ID: task-{unix_timestamp}-{4_hex_chars}
title: StringShort description
description: Option<String>Optional detailed description
key: Option<String>Stable key for idempotent orchestrator-managed tasks.
status: TaskStatusCurrent state
priority: u8Priority 1-5 (1 = highest)
blocked_by: Vec<String>Tasks that must complete before this one
loop_id: Option<String>Loop ID that created this task (from RALPH_LOOP_ID env var). Used to filter tasks by ownership when multiple loops share a task list.
created: StringCreation timestamp (ISO 8601)
started: Option<String>Start timestamp (ISO 8601), if the task entered in_progress.
closed: Option<String>Completion timestamp (ISO 8601), if closed
Implementations§
Source§impl Task
impl Task
Sourcepub fn new(title: String, priority: u8) -> Self
pub fn new(title: String, priority: u8) -> Self
Creates a new task with the given title and priority.
Sourcepub fn with_loop_id(self, loop_id: Option<String>) -> Self
pub fn with_loop_id(self, loop_id: Option<String>) -> Self
Sets the loop ID for this task.
Sourcepub fn generate_id() -> String
pub fn generate_id() -> String
Generates a unique task ID: task-{timestamp}-{hex_suffix}
Sourcepub fn is_ready(&self, all_tasks: &[Task]) -> bool
pub fn is_ready(&self, all_tasks: &[Task]) -> bool
Returns true if this task is ready to work on (open + no blockers pending).
Sourcepub fn with_description(self, description: Option<String>) -> Self
pub fn with_description(self, description: Option<String>) -> Self
Sets the description of the task.
Sourcepub fn with_key(self, key: Option<String>) -> Self
pub fn with_key(self, key: Option<String>) -> Self
Sets the stable orchestration key for the task.
Sourcepub fn with_blocker(self, task_id: String) -> Self
pub fn with_blocker(self, task_id: String) -> Self
Adds a blocker task ID.