Back to Overview

Task Queue

Inspired by Steve Yegge's Beads

The Task Queue is a hierarchical task system stored in the DataLayer, inspired by Steve Yegge's Beads. Only leaf tasks (no children) are claimable. TaskGraph provides critical path, fan-out, and depth analysis for smart prioritization.

[TASK QUEUE]

Persistent Task Queue

_

tasks.list()
3/11 complete
bd-a3f8Auth System
in-progress
bd-a3f8.1JWT Setup
completed
bd-a3f8.1.1Token Generation
completed
bd-a3f8.1.2Validation Logic
completed
bd-a3f8.2OAuth Flow
in-progress
bd-a3f8.2.1Google Auth
claimed
bd-a3f8.2.1.1Callback Handler
ready
bd-a3f8.2.1.2Profile Sync
pending
bd-a3f8.3Session Management
pending
bd-a3f8.3.1Redis Store
pending
bd-a3f8.3.2Expiry Logic
pending
$ready
HIERARCHICAL ID STRUCTURE
bd-a3f8Epic
bd-a3f8.1Task
bd-a3f8.1.1Sub-task
bd-a3f8.1.1.1Leaf
01 / STRUCTURE

Hierarchical task trees with parent-child relationships and dependency tracking.

02 / ATOMIC

Race-free task claiming ensures no duplicate work across parallel agents.

03 / PERSISTENT

Tasks survive restarts—agents resume exactly where they left off.

How It Works

The Task Queue uses the DataLayer (Turso/SQLite) to store tasks with full dependency tracking. Each task gets a hierarchical ID like bd-a3f8.1.1 that encodes its position in the task tree.

Tasks flow through states: pending readyclaimed in_progresscompleted or failed. Agents claim tasks atomically to prevent race conditions.

TaskGraph builds a dependency DAG and computes critical path, fan-out (dependent count), and depth for the graph-prioritized claim strategy.

Task Structure

{
  "id": "bd-a3f8.1.1",
  "parent_id": "bd-a3f8.1",
  "title": "Implement auth flow",
  "description": "Add OAuth2 login",
  "status": "pending",
  "priority": 1,
  "dependencies": ["bd-a3f8.1.0"],
  "claimed_by": null,
  "created_at": "2024-01-15T10:00:00Z"
}

Key Operations

  • claim_task()Atomically claim an available task
  • complete_task()Mark task done with results
  • add_subtask()Create child tasks with dependencies
  • get_ready_tasks()Query tasks with satisfied deps

Storage

The Task Queue stores all data in the DataLayer for persistence across sessions:

DataLayer → .jetpack/jetpack.db (local) or Turso cloud