CDX-201c · Module 2

Output Aggregation & Conflict Resolution

3 min read

When parallel agents complete their work, their outputs need to be aggregated into a single coherent result. If the decomposition was clean (non-overlapping files), aggregation is straightforward: merge each agent's branch. If agents touched shared files (even unintentionally — lock files, config files, generated code), you will face merge conflicts that require manual resolution.

The best aggregation strategy is prevention: design your decomposition so agents never modify the same files. When that is impossible (shared config files, package.json, lock files), designate one agent as the owner of shared files and have other agents produce change requests rather than direct modifications. The owning agent processes change requests in order, resolving conflicts as they arise.

# Aggregation strategies

1. CLEAN MERGE (ideal)
   - Agents modify non-overlapping files
   - Git merge produces no conflicts
   - Aggregate by merging branches in any order

2. OWNER PATTERN (for shared files)
   - Agent A owns package.json
   - Agents B, C produce change-request files
   - Agent A processes requests and updates package.json
   - No merge conflicts on shared files

3. SUPERVISOR PATTERN (complex orchestration)
   - Supervisor agent reviews all outputs
   - Resolves conflicts and inconsistencies
   - Produces the final merged result
   - Most expensive but handles any decomposition
  1. Test merge before deploying After parallel agents complete, attempt a git merge of all branches. If conflicts arise, refine your decomposition for next time.
  2. Designate shared-file owners For files that multiple agents might touch (package.json, tsconfig.json, shared types), assign explicit ownership to one agent.
  3. Use a supervisor for complex merges When conflicts are unavoidable, add a supervisor agent that reviews and reconciles all outputs as a final pipeline step.