Expand description
AI Task Definition
A Task represents a unit of work to be performed by an AI agent.
It serves as the root of the AI workflow, defining intent, constraints, and success criteria.
§Lifecycle
- Draft: Initial state. Task is being defined.
- Running: An agent (via a
Runobject) has started working on it. - Done: Work is completed and verified.
- Failed: Work could not be completed.
- Cancelled: User aborted the task.
§Relationships
- Parent: None (Root object).
- Children:
Run(1-to-many). A task can have multiple runs (retries). - Dependencies: Can depend on other Tasks via
dependencies.
§Example
use git_internal::internal::object::task::{Task, GoalType};
use git_internal::internal::object::types::ActorRef;
use uuid::Uuid;
let repo_id = Uuid::new_v4();
let actor = ActorRef::human("user").unwrap();
let mut task = Task::new(repo_id, actor, "Refactor Login", Some(GoalType::Refactor)).unwrap();
task.add_constraint("Must use JWT");
task.add_acceptance_criterion("All tests pass");Structs§
- Task
- Task object describing intent and constraints. Typically created first, then referenced by Run objects.
Enums§
- Goal
Type - Task goal category.
- Task
Status - Task lifecycle status.