Skip to content

Add concurrent step execution with dependency-aware scheduler - #7

Merged
ubcent merged 1 commit into
mainfrom
feat/implement-concurrent-step-execution
Mar 15, 2026
Merged

Add concurrent step execution with dependency-aware scheduler#7
ubcent merged 1 commit into
mainfrom
feat/implement-concurrent-step-execution

Conversation

@ubcent

@ubcent ubcent commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Improve task runtime by running independent steps in parallel instead of sequentially.
  • Ensure correct dependency semantics so dependents wait for successful completion and fail fast on dependency failures.
  • Provide clear, non-interleaved logging per service and make state updates safe under Promise-based concurrency.

Description

  • Add a worker-pool scheduler runStepsConcurrently in src/lib/runner.ts that dispatches steps respecting depends_on, propagates dependency_failed, preserves input order in results, and honors a maxConcurrent limit.
  • Replace the sequential loop in src/commands/start.ts with runStepsConcurrently(...), using a per-service scoped logger via logger.withPrefix('[service]') and updating step state with the new async updateStep(projectRoot, taskId, service, updates) API.
  • Implement disk-safe concurrent state updates in src/lib/state.ts via updateStep(...) that re-reads state and writes atomically to .vexdo/state.json.tmp then renames.
  • Add logger.withPrefix in src/lib/logger.ts, extend config/types with optional maxConcurrent and validation in src/lib/config.ts, and tighten task dependency validation (unknown deps, self-deps, cycles) in src/lib/tasks.ts.

Testing

  • Ran the full test suite with npm test which includes unit and integration tests and all tests passed.
  • Ran type checking with npm run typecheck and linting with npm run lint, both succeeded after fixes.
  • Added unit tests for the scheduler in test/runner.test.ts and updated state/config tests to validate updateStep behavior and maxConcurrent parsing, which were executed as part of the test run and passed.

Codex Task

@ubcent
ubcent merged commit b1b9dcc into main Mar 15, 2026
8 checks passed
@ubcent
ubcent deleted the feat/implement-concurrent-step-execution branch March 15, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant