feat: wave-based parallel task execution with dependency tracking #191

Closed
opened 2026-03-06 09:38:53 -08:00 by hikari · 0 comments
Owner

Overview

Inspired by get-shit-done (GSD)'s wave execution model, this enhances the Task Loop (#183) with dependency-aware parallel execution — grouping tasks into waves where independent tasks run simultaneously and dependent tasks wait for their prerequisites.

Relationship to Task Loop

This is an enhancement to the sequential Task Loop (#183). The base Task Loop should be implemented first; this adds dependency tracking and parallelism on top.

The Problem: Sequential Bottlenecks

In the base Task Loop, tasks run one at a time regardless of whether they depend on each other. This is inefficient: writing the User model and the Product model have no dependency on each other and could run simultaneously, saving significant time on large task lists.

Feature Details

Dependency Tracking in hikari-tasks.json

Extend the task format to support dependency declarations:

{
  "tasks": [
    {
      "id": "task-user-model",
      "title": "Create User model",
      "prompt": "Create the User database model with email and password fields",
      "dependsOn": [],
      "status": "pending"
    },
    {
      "id": "task-product-model",
      "title": "Create Product model",
      "prompt": "Create the Product database model with name and price fields",
      "dependsOn": [],
      "status": "pending"
    },
    {
      "id": "task-orders-api",
      "title": "Create Orders API",
      "prompt": "Create the Orders REST API endpoint, which depends on the User model",
      "dependsOn": ["task-user-model", "task-product-model"],
      "status": "pending"
    }
  ]
}

Wave Computation

Before execution starts, compute waves:

  1. Wave 1: All tasks with no pending dependencies (task-user-model, task-product-model → run in parallel)
  2. Wave 2: Tasks whose dependencies are all complete (task-orders-api → runs after Wave 1)
  3. Wave N: Continue until all tasks are done

Execution Model

  • Each wave's tasks start simultaneously in separate conversation tabs
  • The orchestrator monitors all active tasks and advances when a wave completes
  • If a task in a wave fails, dependent tasks in later waves are marked as "blocked" rather than failed
  • Independent tasks in later waves that don't depend on the failed task still proceed

UI Changes

  • Wave visualisation in the Task Loop panel — tasks grouped into wave bands
  • Parallel progress indicator — shows multiple tasks running simultaneously
  • Dependency graph view (optional) — visual DAG showing task relationships
  • Blocked tasks displayed distinctly from failed tasks
  • Concurrency limit setting — max parallel tasks (default: 3, to avoid rate limits)

PRD Creator Integration

When generating tasks in the PRD Creator (#184), Claude should also output dependency relationships, enabling automatic wave computation.

Acceptance Criteria

  • hikari-tasks.json format supports dependsOn field
  • Wave computation correctly identifies independent and dependent task groups
  • Independent tasks within a wave run in parallel (up to concurrency limit)
  • Dependent tasks wait for all prerequisites to complete
  • Failed tasks mark dependent tasks as "blocked" rather than failing them
  • UI shows wave groupings and parallel progress
  • Concurrency limit is configurable
  • Tests written for wave computation algorithm

This issue was created with help from Hikari~ 🌸

## Overview Inspired by [get-shit-done (GSD)](https://github.com/gsd-build/get-shit-done)'s wave execution model, this enhances the Task Loop (#183) with **dependency-aware parallel execution** — grouping tasks into waves where independent tasks run simultaneously and dependent tasks wait for their prerequisites. ## Relationship to Task Loop This is an **enhancement** to the sequential Task Loop (#183). The base Task Loop should be implemented first; this adds dependency tracking and parallelism on top. ## The Problem: Sequential Bottlenecks In the base Task Loop, tasks run one at a time regardless of whether they depend on each other. This is inefficient: writing the User model and the Product model have no dependency on each other and could run simultaneously, saving significant time on large task lists. ## Feature Details ### Dependency Tracking in `hikari-tasks.json` Extend the task format to support dependency declarations: ```json { "tasks": [ { "id": "task-user-model", "title": "Create User model", "prompt": "Create the User database model with email and password fields", "dependsOn": [], "status": "pending" }, { "id": "task-product-model", "title": "Create Product model", "prompt": "Create the Product database model with name and price fields", "dependsOn": [], "status": "pending" }, { "id": "task-orders-api", "title": "Create Orders API", "prompt": "Create the Orders REST API endpoint, which depends on the User model", "dependsOn": ["task-user-model", "task-product-model"], "status": "pending" } ] } ``` ### Wave Computation Before execution starts, compute waves: 1. **Wave 1**: All tasks with no pending dependencies (task-user-model, task-product-model → run in parallel) 2. **Wave 2**: Tasks whose dependencies are all complete (task-orders-api → runs after Wave 1) 3. **Wave N**: Continue until all tasks are done ### Execution Model - Each wave's tasks start simultaneously in separate conversation tabs - The orchestrator monitors all active tasks and advances when a wave completes - If a task in a wave fails, dependent tasks in later waves are marked as "blocked" rather than failed - Independent tasks in later waves that don't depend on the failed task still proceed ### UI Changes - **Wave visualisation** in the Task Loop panel — tasks grouped into wave bands - **Parallel progress indicator** — shows multiple tasks running simultaneously - **Dependency graph view** (optional) — visual DAG showing task relationships - **Blocked tasks** displayed distinctly from failed tasks - **Concurrency limit setting** — max parallel tasks (default: 3, to avoid rate limits) ### PRD Creator Integration When generating tasks in the PRD Creator (#184), Claude should also output dependency relationships, enabling automatic wave computation. ## Acceptance Criteria - [ ] `hikari-tasks.json` format supports `dependsOn` field - [ ] Wave computation correctly identifies independent and dependent task groups - [ ] Independent tasks within a wave run in parallel (up to concurrency limit) - [ ] Dependent tasks wait for all prerequisites to complete - [ ] Failed tasks mark dependent tasks as "blocked" rather than failing them - [ ] UI shows wave groupings and parallel progress - [ ] Concurrency limit is configurable - [ ] Tests written for wave computation algorithm ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-03-07 03:08:33 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#191