Skip to content

Task DAG Orchestration

Complex goals are decomposed into a dependency-aware task graph (DAG). The Leader handles task decomposition, dependency establishment, and execution scheduling, making complex engineering work schedulable, recoverable, and auditable.

Each node is a task; arrows represent dependencies. Tasks without dependencies execute automatically in parallel; tasks with dependencies are unlocked in order.

  • Parallel tasks run in parallel: Tasks without dependencies execute automatically, maximizing throughput
  • Dependent tasks unlock in order: Completion of prerequisites automatically triggers downstream tasks
  • Each task has: owner, status, blocking relationships, results, evidence, and recovery info
  • WebUI visualization: Task graph, Agent panel, Review evidence, and runtime status
  • Leader global scheduling: Scheduling, supervision, recovery, and wrap-up based on DAG
StateDescription
pendingTask created, waiting for dependencies to complete
dispatchedDispatched to Worker, waiting to start
in_progressWorker executing
completedExecution complete, result verified
failedExecution failed
blockedBlocked, waiting for external conditions

Each task carries complete engineering metadata:

interface Task {
id: string; // Task ID, e.g., T-1
title: string; // Task title
description: string; // Detailed description
owner: string; // Responsible Agent
status: TaskStatus; // Current status
dependencies: string[]; // Prerequisite task IDs
writeScope: string[]; // Allowed write files/directories
result?: string; // Execution result
evidence?: string[]; // Verification evidence
recoverable?: boolean; // Whether recoverable
}

The Leader’s scheduler automatically analyzes DAG topology:

  1. Ready queue: Tasks with all prerequisites completed enter the ready queue
  2. Parallel dispatch: Ready tasks are dispatched to available Workers by owner role
  3. Dependency unlocking: Task completion automatically unlocks downstream tasks
  4. Block propagation: Failed or blocked tasks propagate status to the dependency chain

All LingXiao runtime state is persisted to SQLite and fully recoverable after crashes:

Terminal window
# Resume a specific session
lingxiao --session <session_id>
# List all sessions
lingxiao list

On recovery:

  • DAG structure and task states are rebuilt from the database
  • Incomplete tasks can resume execution
  • Completed results and evidence are preserved
  • Agent context can be reconstructed

Integration with Orchestration Verification

Section titled “Integration with Orchestration Verification”

Task completion automatically triggers the verification pipeline:

  • Speculative execution: Multiple parallel branches can run for the same task, best one wins
  • Adversarial verification: Command-level breaker strategies verify results
  • Contract loop: contract → implement → evaluate → repair → reset five-phase loop