Skip to content

feat: Wave Planner - file-aware parallel agent orchestration #131

@mmorris35

Description

@mmorris35

Problem

When DevPlan generates tasks executed by parallel agents within a wave, agents may modify the same files simultaneously, causing merge conflicts. Currently wave planning is ad-hoc with no file dependency analysis.

Observed in: g-hive Wave 3.4.2 - parallel agents created merge conflicts on shared files.

Proposed Solution

Add a plan_waves MCP tool that:

  1. Analyzes task-to-file dependencies - infer which files each task will touch
  2. Assigns file ownership - prevent parallel contention
  3. Generates orchestrated wave plans - explicit constraints for agent spawners

New Tool: plan_waves

Input:

  • Task list with descriptions
  • Project file tree
  • Max parallel agents
  • Conflict strategy (sequence/partition/delegate)

Output:

  • Wave assignments with file ownership per agent
  • Dependency ordering for shared files
  • Conflict risk assessment

Conflict Strategies

  • sequence: Tasks touching shared files run sequentially (safe, slower)
  • partition: Split shared files if semantically possible
  • delegate: Flag conflicts for human/integration agent resolution

Implementation Phases

  1. Static Analysis - Pattern matching, AST analysis for file dependencies
  2. Opus-Assisted - LLM inference for ambiguous tasks
  3. Orchestration Output - Structured JSON for agent spawners

Success Criteria

  • Zero merge conflicts when following wave plan
  • Maximum parallelization where file deps allow
  • Clear audit trail of file ownership

Spec

Full specification: docs/wave-planner-spec.md


Lesson learned from g-hive development - parallel agents within same wave need file-aware orchestration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions