Skip to main content

Module task

Module task 

Source
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

  1. Draft: Initial state. Task is being defined.
  2. Running: An agent (via a Run object) has started working on it.
  3. Done: Work is completed and verified.
  4. Failed: Work could not be completed.
  5. 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§

GoalType
Task goal category.
TaskStatus
Task lifecycle status.