feat(orchestration): DAG wave scheduler#56
Merged
Conversation
scripts/dag-schedule.sh implements the deterministic core of the orchestration spec: parse a task DAG manifest (taskId + comma-separated deps), then compute execution waves via topological levelling so independent tasks share a wave. Detects dangling dependencies (exit 3) and cycles (exit 4); emits text or JSON. Ships orchestration/tasks.example.tsv, a `make dag` target, and extends docs/orchestration-dag-spec.md (rollout steps 1-2 done). Locking, budget guardrails, quality gate, and replay remain runtime concerns. 10 bats tests cover linear/parallel/fan-in scheduling, cycle + dangling detection, JSON output, comment handling, and usage errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the deterministic core of the Multi-agent orchestration roadmap item:
scripts/dag-schedule.shparses a task DAG and computes execution waves (topological levels) so an orchestrator can run independent tasks concurrently, then recompute.taskId<TAB>deps(comma-separated or-); shipsorchestration/tasks.example.tsv.--format json→{"waves": [[...], ...]}.docs/orchestration-dag-spec.md(rollout steps 1–2 done).Scope
Ships the parser + wave scheduler (the deterministic, testable core). Locking, budget/time guardrails, the quality-gate phase, and event replay remain runtime concerns for an orchestrator consuming these waves — tracked as Remaining on the roadmap.
Tests
10 bats tests (
tests/dag-schedule.bats): linear / parallel / fan-in scheduling, the example manifest, cycle (exit 4), dangling dep (exit 3), JSON validity, comment/blank handling, and usage errors. Suite total: 81.Verification
bats tests/→ 81 pass;make check/make dag/security-scan/ link check → greenshellcheck/markdownlint-cli2→ clean🤖 Generated with Claude Code