Skip to content

[Team] Execute declarative read-only task DAGs #382

Description

@ranveersequeira

Parent

#377

What to build

Add the first workflow-first agentify team vertical slice: execute a declarative dependency graph of read-only research, planning, and review tasks through the durable broker from #378.

Workers exchange only declared artifacts. The workflow must remain resumable and auditable without depending on opaque provider continuation state.

User story

As a lead developer or agent, I can describe a small dependency-aware team workflow, run ready tasks in parallel, inspect status, answer a blocking question, retry a failed node, and receive a standalone HTML/JSON report.

Proposed CLI

agentify team plan "review the payment retry architecture" --out team.yaml
agentify team run team.yaml
agentify team status <run-id> --watch
agentify team answer <run-id>/<node-id> "Preserve the legacy error schema"
agentify team retry <run-id>/<node-id>
agentify team status <run-id> --open

team plan may initially emit a template or validate a caller-authored graph. Starting a paid planner agent is optional and must require explicit routing/budget inputs.

Minimal graph contract

Each graph records:

  • schema version, goal, immutable base SHA, and dirty-tree policy;
  • nodes with ID, task, dependencies, read-only mode, route/provider/profile request;
  • declared input and output artifacts;
  • optional verification rules and bounded retry policy;
  • maximum parallelism and failure policy.

Each node receives only:

  • its task and attempt number;
  • declared upstream artifacts;
  • repository guidance and relevant bounded context;
  • immutable base SHA;
  • required output schema and limits.

Required behavior

  • Validate schema, node IDs, dependency references, and acyclicity before execution.
  • Resolve the base ref to an immutable SHA.
  • Schedule dependency-ready nodes up to maxParallel.
  • Use broker task IDs and events rather than launching providers directly.
  • Persist graph, node attempts, messages/questions, artifacts, usage, verification, and terminal status.
  • Make downstream artifacts available only after the producing node succeeds and passes configured validation.
  • Represent a blocking worker question as a structured artifact and waiting_input state.
  • Record retries as new immutable attempts; never overwrite prior evidence.
  • Produce a self-contained HTML report plus versioned JSON receipt.
  • Resume a run after the CLI exits without replaying completed nodes.
  • Reject write-mode nodes in this slice.

Suggested implementation seams

  • Add a deep src/core/team/ scheduler/artifact/report module above the broker.
  • Reuse route/profile policy from src/core/models.js.
  • Reuse repository identity and local runtime paths from src/core/project-store.js.
  • Use affected-test/risk operations only as optional read-only verification inputs; do not mutate repository state.
  • Keep src/core/workflows.js focused on installing platform skills.

Acceptance criteria

  • A three-node graph (research → plan → review) executes with correct dependency ordering.
  • Independent ready nodes run in parallel up to the declared cap.
  • Invalid, cyclic, missing-dependency, and duplicate-node graphs fail before provider work starts.
  • Every node uses a durable broker task and records resolved provider/model/capability/policy.
  • Structured artifacts pass between nodes; undeclared files or raw hidden transcripts do not.
  • A blocking question pauses only the affected dependency chain and can be answered as a new immutable input.
  • Retry creates a new attempt while preserving prior output, usage, and failure evidence.
  • A client can reconnect and resume status without rerunning completed nodes.
  • The HTML report shows the DAG, node state, provider, duration, usage provenance, artifacts, questions, retries, and errors.
  • --json returns a stable versioned run receipt.
  • Write-mode nodes and automatic integration are rejected.
  • Deterministic scheduler tests cover concurrency, dependency failure, retry, resume, cancellation, and corrupt artifact metadata.

Out of scope

  • Write-capable nodes.
  • Worktree creation or integration branches.
  • Dynamic graph mutation by workers.
  • Automatic conflict resolution.
  • Remote workers.
  • Free-form shared chat rooms.
  • Making paid model planning the default.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentify-readyReady for Agentify automationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions