Skip to content

feat(run): devstack-native task-graph runner (spec 31) - #119

Merged
gustavobertoi merged 2 commits into
mainfrom
feat/task-runner
Jul 2, 2026
Merged

feat(run): devstack-native task-graph runner (spec 31)#119
gustavobertoi merged 2 commits into
mainfrom
feat/task-runner

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

Summary

Second half of spec 31 / D19: a non-container task graph — run project commands with dependency ordering and parallelism.

What's in

  • tasks: block on a project (command, run: host|exec, service, deps, workdir, env, watch) — validated via validator dive.
  • internal/task — a pure DAG planner: transitive closure + Kahn layering, with cycle and unknown-task/dep detection; deterministic sorted layers.
  • devstack run <task...> — resolves the active project, plans the graph, and runs layers in order with independent tasks in parallel (--parallel), streaming each task's output live and name-prefixed (mutex-serialized, race-free). run: host runs on the host toolchain; run: exec runs inside a service via compose exec. --dry-run prints the plan; --json supported. No flock — touches no shared/ledger state.

Verified

$ devstack run ci --dry-run
run plan for "app" (3 layer(s)):
  1: build, lint
  2: test
  3: ci
$ devstack run ci        # build+lint in parallel → test → ci, streamed + prefixed

Monorepo / Turborepo

The turborepo template (PR #118) runs turbo run in-container; or map package scripts into tasks: so devstack run owns the graph.

Tests / gates

Planner (linear / diamond / closure / cycle / unknown) + executor order + failure propagation, race-clean. make ci (fmt/vet/build/test-race) + make determinism green.

This completes spec 31. Remaining RFC work: spec 30 Phase 3 (the authoring TUIs).

🤖 Generated with Claude Code

The second half of spec 31: run project commands as a dependency graph.

- config: optional `tasks:` block on Project (command, run host|exec, service,
  deps, workdir, env, watch), validated via validator dive.
- internal/task: pure DAG planner — transitive closure + Kahn layering, cycle
  and unknown-task/dep detection, deterministic (sorted) layers.
- `devstack run <task...>`: resolves the active project, plans the graph, runs
  layers in order with independent tasks in parallel (--parallel), streaming
  each task's output live and name-prefixed (mutex-serialized, race-free).
  run: host executes on the host; run: exec via `compose exec`. --dry-run prints
  the plan; --json supported. No flock — touches no shared/ledger state.

Monorepo/Turborepo: the turborepo template runs `turbo run` in-container, or map
package scripts into tasks: so `devstack run` owns the graph.

Tests: planner (linear/diamond/closure/cycle/unknown) + executor order +
failure propagation (race-clean). make ci + determinism green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit 2ebe048 into main Jul 2, 2026
4 checks passed
@gustavobertoi
gustavobertoi deleted the feat/task-runner branch July 2, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant