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 (draft → live), 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.
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/livestates 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-sourcepackage with an extended interface (superset of v1's streaming contract, ADR-002):watchTasks,completeTask,failTask,pauseTask,setState.setDependency,getDependencies, (resolution is internal).createDraftTask(statusdraft, withheld from the stream),promoteDraftToLive(draft→live),transitionStatus.watchTasksyields only tasks that arestatus=liveAND whose dependencies are satisfied. The source owns this gating.task-source-memory).Alternatives considered
Area
Orchestrator v2 /
task-sourceAcceptance criteria
drafttask is withheld untilpromoteDraftToLive.getDependencies.Dependencies
[v2] Script task execution primitive(Task shape).Verification
vp test+ vitest-gwt: draft→live gating; dependency gating; edge queries.