Skip to content

Comments

Add wave-based parallel subtask execution to /map-efficient#80

Merged
azalio merged 2 commits intomainfrom
feature/parallel-wave-execution
Feb 24, 2026
Merged

Add wave-based parallel subtask execution to /map-efficient#80
azalio merged 2 commits intomainfrom
feature/parallel-wave-execution

Conversation

@azalio
Copy link
Owner

@azalio azalio commented Feb 24, 2026

Summary

  • Introduce wave-based parallel execution for independent subtasks in /map-efficient workflow
  • Add compute_waves() (Kahn's algorithm) and split_wave_by_file_conflicts() (greedy coloring) to DependencyGraph
  • Add orchestrator commands: set_waves, get_wave_step, validate_wave_step, advance_wave with backward-compatible StepState fields
  • Add update_workflow_state_batch() for multi-subtask state updates in a single call
  • Update workflow-gate.py to support active_subtasks list for parallel wave mode
  • Update workflow-context-injector.py to display wave progress in status line
  • Document wave computation and parallel execution loop in map-efficient.md

How it works

The task-decomposer already outputs dependencies: [...] per subtask forming a DAG. This PR computes topological waves — groups of subtasks whose dependencies are all satisfied by prior waves. Within a wave, Actor and Monitor agents run in parallel via multiple Task() calls in a single message.

Example: ST-001 (no deps) → ST-002 (deps: ST-001) + ST-004 (deps: ST-001) → ST-003 (deps: ST-002, ST-004)
Produces waves: [["ST-001"], ["ST-002", "ST-004"], ["ST-003"]]

Linear DAGs degrade to single-subtask waves (identical to current sequential behavior).

Test plan

  • TestComputeWaves: linear chain, fan-out, diamond, cycle detection, empty graph, multiple roots, dangling deps (8 tests)
  • TestSplitWaveByFileConflicts: no overlap, partial overlap, all overlap, empty files, missing from map (7 tests)
  • TestSetWaves: correct waves from blueprint, state persistence, missing blueprint, file conflict splitting (4 tests)
  • TestGetWaveStep: parallel/sequential mode detection, completion, no-waves fallback (4 tests)
  • TestValidateWaveStep: phase advancement, evidence gating (3 tests)
  • TestAdvanceWave: index increment, completion, phase reset, error handling (4 tests)
  • TestBackwardCompat: sequential flow without waves, state serialization, old state file loading (3 tests)
  • Full test suite: 668 passed, 1 skipped, 0 failures
  • Template sync: 24/24 tests pass

Summary by CodeRabbit

Release Notes

  • New Features

    • Wave-based parallel execution for improved task throughput
    • New CLI commands for orchestrating parallel workflows
    • Cost optimization (40-60% savings)
  • Documentation

    • Simplified agent count from 12 to 11 specialized agents
    • Updated workflow documentation to reflect streamlined architecture
  • Removals

    • Removed knowledge base learning system
    • Removed memory-based pattern matching capabilities

Remove mem0 MCP integration entirely from the project:
- Delete Curator agent (curator.md) and all mem0 tool references
- Clean all 8 agent templates, 7 command files, docs, skills, tests
- Remove ACE learning system references from plugin metadata
- Delete obsolete files (tier3_integration_report.json, apply_tier3_deltas.py,
  playbook.json.backup, requirements-semantic.txt)
- Update __init__.py to remove curator generator and mem0 allowlist

Simplify map-review to always use thorough mode:
- Remove BIG/SMALL mode selection menu
- Always present top 4 issues per section

Fix hook errors causing noise during agent work:
- block-secrets.py: add SAFE_PATH_PREFIXES to stop blocking .claude/ framework files
- safety-guardrails.py: narrow "token"/"password" patterns to file extensions only,
  add .claude/ dirs to safe prefixes, fix missing execute permission
- settings.local.json: remove duplicate workflow-context-injector.py (matcher "*",
  timeout 1s) and duplicate end-of-turn.sh Stop hook

All templates synced via make sync-templates.
635 passed, 1 skipped, 0 failures.
…ution to /map-efficient

Introduce a "wave" concept for executing independent subtasks in parallel.
The task-decomposer already outputs dependency DAGs; this change computes
topological waves (Kahn's algorithm) and splits waves by file conflicts,
enabling Actor and Monitor agents to run concurrently for independent subtasks.

Changes:
- dependency_graph.py: Add compute_waves() and split_wave_by_file_conflicts()
- map_orchestrator.py: Add set_waves, get_wave_step, validate_wave_step,
  advance_wave commands with StepState wave fields (backward compatible)
- map_step_runner.py: Add update_workflow_state_batch() for multi-subtask updates
- workflow-gate.py: Support active_subtasks list for parallel wave mode
- workflow-context-injector.py: Show wave progress in status line
- map-efficient.md: Document wave computation and parallel execution loop
- Tests: 50 new tests covering waves, file conflicts, orchestrator commands,
  and backward compatibility (668 passed, 1 skipped total)

Linear DAGs degrade naturally to single-subtask waves (identical to current behavior).
@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 656dca5 and 32924b6.

📒 Files selected for processing (93)
  • .claude-plugin/PLUGIN.md
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • .claude/agents/actor.md
  • .claude/agents/documentation-reviewer.md
  • .claude/agents/evaluator.md
  • .claude/agents/monitor.md
  • .claude/agents/predictor.md
  • .claude/agents/reflector.md
  • .claude/agents/research-agent.md
  • .claude/agents/task-decomposer.md
  • .claude/commands/map-debate.md
  • .claude/commands/map-debug.md
  • .claude/commands/map-efficient.md
  • .claude/commands/map-fast.md
  • .claude/commands/map-learn.md
  • .claude/commands/map-release.md
  • .claude/commands/map-review.md
  • .claude/hooks/block-secrets.py
  • .claude/hooks/safety-guardrails.py
  • .claude/hooks/workflow-context-injector.py
  • .claude/hooks/workflow-gate.py
  • .claude/playbook.json.backup.20251028_160602
  • .claude/references/mcp-usage-examples.md
  • .claude/references/step-state-schema.md
  • .claude/references/workflow-state-schema.md
  • .claude/skills/map-cli-reference/SKILL.md
  • .claude/skills/map-cli-reference/scripts/check-command.sh
  • .claude/skills/map-workflows-guide/SKILL.md
  • .claude/skills/map-workflows-guide/resources/agent-architecture.md
  • .claude/skills/map-workflows-guide/resources/map-debug-deep-dive.md
  • .claude/skills/map-workflows-guide/resources/map-efficient-deep-dive.md
  • .claude/skills/map-workflows-guide/resources/map-fast-deep-dive.md
  • .claude/skills/map-workflows-guide/resources/map-feature-deep-dive.md
  • .claude/skills/map-workflows-guide/resources/map-refactor-deep-dive.md
  • .claude/skills/skill-rules.json
  • .gitignore
  • .map/scripts/map_orchestrator.py
  • .map/scripts/map_step_runner.py
  • CLAUDE.md
  • IMPLEMENTATION_SUMMARY.md
  • docs/ARCHITECTURE.md
  • docs/CLI_COMMAND_REFERENCE.md
  • docs/CLI_REFERENCE.json
  • docs/COMPLETE_WORKFLOW.md
  • docs/INSTALL.md
  • docs/USAGE.md
  • docs/WORKFLOW_FLOW.md
  • requirements-semantic.txt
  • src/mapify_cli/__init__.py
  • src/mapify_cli/dependency_graph.py
  • src/mapify_cli/templates/CLAUDE.md
  • src/mapify_cli/templates/agents/actor.md
  • src/mapify_cli/templates/agents/documentation-reviewer.md
  • src/mapify_cli/templates/agents/evaluator.md
  • src/mapify_cli/templates/agents/monitor.md
  • src/mapify_cli/templates/agents/predictor.md
  • src/mapify_cli/templates/agents/reflector.md
  • src/mapify_cli/templates/agents/research-agent.md
  • src/mapify_cli/templates/agents/task-decomposer.md
  • src/mapify_cli/templates/commands/map-debate.md
  • src/mapify_cli/templates/commands/map-debug.md
  • src/mapify_cli/templates/commands/map-efficient.md
  • src/mapify_cli/templates/commands/map-fast.md
  • src/mapify_cli/templates/commands/map-learn.md
  • src/mapify_cli/templates/commands/map-release.md
  • src/mapify_cli/templates/commands/map-review.md
  • src/mapify_cli/templates/hooks/block-secrets.py
  • src/mapify_cli/templates/hooks/safety-guardrails.py
  • src/mapify_cli/templates/hooks/workflow-context-injector.py
  • src/mapify_cli/templates/hooks/workflow-gate.py
  • src/mapify_cli/templates/map/scripts/map_orchestrator.py
  • src/mapify_cli/templates/map/scripts/map_step_runner.py
  • src/mapify_cli/templates/references/mcp-usage-examples.md
  • src/mapify_cli/templates/references/step-state-schema.md
  • src/mapify_cli/templates/references/workflow-state-schema.md
  • src/mapify_cli/templates/skills/map-cli-reference/SKILL.md
  • src/mapify_cli/templates/skills/map-cli-reference/scripts/check-command.sh
  • src/mapify_cli/templates/skills/map-workflows-guide/SKILL.md
  • src/mapify_cli/templates/skills/map-workflows-guide/resources/agent-architecture.md
  • src/mapify_cli/templates/skills/map-workflows-guide/resources/map-debug-deep-dive.md
  • src/mapify_cli/templates/skills/map-workflows-guide/resources/map-efficient-deep-dive.md
  • src/mapify_cli/templates/skills/map-workflows-guide/resources/map-fast-deep-dive.md
  • src/mapify_cli/templates/skills/map-workflows-guide/resources/map-feature-deep-dive.md
  • src/mapify_cli/templates/skills/map-workflows-guide/resources/map-refactor-deep-dive.md
  • src/mapify_cli/templates/skills/skill-rules.json
  • tests/test_agent_cli_correctness.py
  • tests/test_command_templates.py
  • tests/test_dependency_graph.py
  • tests/test_map_orchestrator.py
  • tests/test_mapify_cli.py
  • tests/test_template_sync.py
  • tests/test_workflow_gate.py

📝 Walkthrough

Walkthrough

This PR removes the Curator agent and eliminates the ACE Learning System with mem0 MCP (memory pattern storage), reducing the agent count from 12 to 11. All mem0-based pattern searches, storage operations, and Curator-mediated learning are removed across documentation, templates, and configs. Concurrently, wave-based parallel task execution and dependency graph analysis are introduced to the orchestration layer.

Changes

Cohort / File(s) Summary
Plugin & Marketplace Configuration
.claude-plugin/PLUGIN.md, .claude-plugin/marketplace.json, .claude-plugin/plugin.json
Removed ACE and Curator references; updated agent count from 12 to 11; removed ACE Learning System feature; added cost optimization feature; updated keywords and metadata.
Agent Templates - Simplified Tools
src/mapify_cli/templates/agents/actor.md, src/mapify_cli/templates/agents/documentation-reviewer.md, src/mapify_cli/templates/agents/research-agent.md, .claude/agents/...
Removed mem0 tiered search, pattern matching blocks, and ACE Learning patterns sections; simplified tool selection flows to rely on context7/deepwiki without mandatory mem0 pre-checks.
Agent Templates - Reordered Tools
src/mapify_cli/templates/agents/evaluator.md, src/mapify_cli/templates/agents/monitor.md, src/mapify_cli/templates/agents/predictor.md
Replaced mem0 references with context7/deepwiki and grep-based analysis; reordered tool sections; updated output schemas and tool enumerations; removed historical pattern lookups.
Reflector & Architecture
src/mapify_cli/templates/agents/reflector.md, .claude/agents/reflector.md, src/mapify_cli/templates/skills/map-workflows-guide/resources/agent-architecture.md
Removed ACE acronym; removed mem0 tiered search; simplified to quality-check approach; removed Curator from learning pipeline; reduced total agent count from 12 to 11.
Task Decomposition
src/mapify_cli/templates/agents/task-decomposer.md, .claude/agents/task-decomposer.md
Removed mandatory mem0 search from context gathering; replaced with library docs and sequential thinking; removed pattern ranking block; updated risk messaging.
Command Workflows - Debate/Debug/Release
src/mapify_cli/templates/commands/map-debate.md, src/mapify_cli/templates/commands/map-debug.md, src/mapify_cli/templates/commands/map-release.md, .claude/commands/...
Removed mem0 context blocks and pattern retrieval steps; reorganized workflow steps; simplified phase numbering for debate arbiter flow.
Command Workflows - Efficient/Fast/Learn
src/mapify_cli/templates/commands/map-efficient.md, src/mapify_cli/templates/commands/map-fast.md, src/mapify_cli/templates/commands/map-learn.md
Introduced wave-based parallel execution scaffolding in map-efficient; removed Curator from map-fast; replaced Curator storage flow in map-learn with simplified summary reporting.
Command Workflows - Review
src/mapify_cli/templates/commands/map-review.md, .claude/commands/map-review.md
Reduced from 7 mem0 queries + 3 agent tasks to 3 agent tasks; removed mode selection in non-CI flows; hardcoded comprehensive review behavior; removed mem0 context blocks.
Orchestration Core
src/mapify_cli/templates/map/scripts/map_orchestrator.py, .map/scripts/map_orchestrator.py
Added wave-based execution: execution_waves, current_wave_index, subtask_phases, subtask_retry_counts fields; added set_waves, get_wave_step, validate_wave_step, advance_wave functions; renamed MEM0_SEARCH phase to CONTEXT_SEARCH.
State Management & Dependency Graph
src/mapify_cli/templates/map/scripts/map_step_runner.py, src/mapify_cli/dependency_graph.py
Added update_workflow_state_batch for multi-subtask updates; added compute_waves and split_wave_by_file_conflicts methods to DependencyGraph for parallel execution planning.
Hooks & Context Injection
src/mapify_cli/templates/hooks/workflow-gate.py, src/mapify_cli/templates/hooks/workflow-context-injector.py, .claude/hooks/...
Enhanced workflow-gate to support parallel active_subtasks; updated workflow-context-injector with wave progress display and WAVE X/Y indicators; renamed mem0 search hints to context search.
Security Hooks
src/mapify_cli/templates/hooks/block-secrets.py, src/mapify_cli/templates/hooks/safety-guardrails.py, .claude/hooks/...
Added SAFE_PATH_PREFIXES for whitelisting safe directories; refined credential patterns to target password/token files by extension; expanded safe paths to include Claude-specific directories.
Reference & Documentation
src/mapify_cli/templates/references/mcp-usage-examples.md, src/mapify_cli/templates/references/step-state-schema.md, src/mapify_cli/templates/references/workflow-state-schema.md, .claude/references/...
Removed mem0 pattern search examples; renamed steps to remove MEM0_SEARCH; updated state progression schemas to exclude mem0_search step; simplified example narratives.
Capability & Usage Documentation
docs/ARCHITECTURE.md, docs/USAGE.md, docs/CLI_COMMAND_REFERENCE.md, docs/COMPLETE_WORKFLOW.md, IMPLEMENTATION_SUMMARY.md
Removed extensive mem0 MCP sections; removed Pattern Storage/Search subsections; updated terminology from mem0 search to context search; simplified learning descriptions from Reflector→Curator to Reflector-only.
CLI Reference & Skills
src/mapify_cli/templates/skills/map-cli-reference/SKILL.md, src/mapify_cli/templates/skills/map-cli-reference/scripts/check-command.sh, docs/CLI_REFERENCE.json
Removed Pattern Storage (mem0 MCP) sections; removed tiered search documentation; simplified error corrections; changed "playbook" removal message to omit mem0 references.
Workflow Guides & Deep Dives
src/mapify_cli/templates/skills/map-workflows-guide/SKILL.md, src/mapify_cli/templates/skills/map-workflows-guide/resources/map-...-deep-dive.md
Removed mem0 references from learning sections; changed Reflector/Curator to Reflector-only; removed tiered memory explanations; updated cost/efficiency calculations to exclude Curator.
Configuration & Rules
src/mapify_cli/templates/skills/skill-rules.json, src/mapify_cli/__init__.py, .gitignore
Removed mem0 MCP from keywords and intent patterns; removed curator agent generation; removed curator MCP mappings; removed curator-related temp files from ignore list.
Core Library
src/mapify_cli/templates/CLAUDE.md, CLAUDE.md
Removed guidance on preserving Curator-mediated mem0 MCP writes; removed ACE-specific safeguards.
Tests
tests/test_*.py (15+ files)
Removed curator.md from expected agents list (12→11); removed mem0 search assertions; removed Curator skip assertions; added comprehensive wave-based execution tests; updated workflow state test expectations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 Curator takes a bow, mem0 fades away,
Wave by wave we dance, a new execution day!
Twelve agents become eleven, patterns drift like streams—
Simpler flows, sharper tools, refactored dreams! 🌊

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/parallel-wave-execution

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@azalio azalio merged commit 769932f into main Feb 24, 2026
6 of 7 checks passed
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