Skip to content

[v2] Task source with dependencies + draft/live #34

Description

@devzeebo

Part of the Orchestrator v2 rebuild — a tear-down/rebuild in a new self-contained orchestrator-v2/ folder (Vite+ / vp, vp test + vitest-gwt, no hooks, single RPC/WebSocket runner interface, engine adapters copied wholesale). See #29 (runner split), #30 (Task Agent), #31 (Workflow Agent).

Problem

Workflows (#31) need a task source that can hold tasks in draft/live states and resolve dependencies, so that only ready tasks stream out. Crucially, dependency resolution is the task source's job, not the orchestrator's — the orchestrator must stay dumb about dependencies.

Proposed solution

New task-source package with an extended interface (superset of v1's streaming contract, ADR-002):

  • Carried from v1: watchTasks, completeTask, failTask, pauseTask, setState.
  • New — dependency graph: setDependency, getDependencies, (resolution is internal).
  • New — draft vs live: createDraftTask (status draft, withheld from the stream), promoteDraftToLive (draftlive), transitionStatus.
  • watchTasks yields only tasks that are status=live AND whose dependencies are satisfied. The source owns this gating.
  • First implementation: in-memory (mirrors v1 task-source-memory).

Alternatives considered

  • Orchestrator resolves dependencies — rejected; the source owns resolution, the orchestrator never inspects deps.

Area

Orchestrator v2 / task-source

Acceptance criteria

  • A draft task is withheld until promoteDraftToLive.
  • A task with an unsatisfied dependency is withheld until the dependency completes, then streams.
  • Dependency edges are queryable via getDependencies.

Dependencies

  • [v2] Script task execution primitive (Task shape).

Verification

vp test + vitest-gwt: draft→live gating; dependency gating; edge queries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions