feat(subplans): implement three-way merge strategy for combining subplan results #4999

Open
opened 2026-04-09 00:26:32 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: feat(subplans): implement three-way merge strategy for combining subplan results
  • Branch: feat/m4/three-way-merge
  • Parent Epic: #4972

Background and Context

After child subplans complete execution, their results need to be merged back into the parent plan using a three-way merge strategy. Non-conflicting changes are combined automatically; conflicts are surfaced to the user.

Expected Behavior

  • ThreeWayMergeStrategy.merge(base, left, right) combines non-conflicting changes
  • Conflicts are detected and surfaced to the user for resolution
  • Merge result is applied to the parent plan
  • Merge history is recorded

Acceptance Criteria

  • ThreeWayMergeStrategy class implemented in src/cleveragents/plans/merge/
  • Non-conflicting changes from multiple subplans are combined automatically
  • Conflicts are detected and reported to the user
  • Merge result is applied to parent plan artifacts
  • Unit tests (Behave) cover merge scenarios (no conflict, conflict, partial conflict)
  • Integration test (Robot) verifies end-to-end merge

Subtasks

  • Implement ThreeWayMergeStrategy class
  • Implement conflict detection logic
  • Implement conflict reporting to user
  • Implement merge result application to parent plan
  • Wire merge strategy into ParallelSubplanExecutor completion handler
  • Tests (Behave): Add scenarios for merge (no conflict, conflict, partial)
  • Tests (Robot): Add integration test
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planner

## Metadata - **Commit Message**: `feat(subplans): implement three-way merge strategy for combining subplan results` - **Branch**: `feat/m4/three-way-merge` - **Parent Epic**: #4972 ## Background and Context After child subplans complete execution, their results need to be merged back into the parent plan using a three-way merge strategy. Non-conflicting changes are combined automatically; conflicts are surfaced to the user. ## Expected Behavior - `ThreeWayMergeStrategy.merge(base, left, right)` combines non-conflicting changes - Conflicts are detected and surfaced to the user for resolution - Merge result is applied to the parent plan - Merge history is recorded ## Acceptance Criteria - [ ] `ThreeWayMergeStrategy` class implemented in `src/cleveragents/plans/merge/` - [ ] Non-conflicting changes from multiple subplans are combined automatically - [ ] Conflicts are detected and reported to the user - [ ] Merge result is applied to parent plan artifacts - [ ] Unit tests (Behave) cover merge scenarios (no conflict, conflict, partial conflict) - [ ] Integration test (Robot) verifies end-to-end merge ## Subtasks - [ ] Implement `ThreeWayMergeStrategy` class - [ ] Implement conflict detection logic - [ ] Implement conflict reporting to user - [ ] Implement merge result application to parent plan - [ ] Wire merge strategy into `ParallelSubplanExecutor` completion handler - [ ] Tests (Behave): Add scenarios for merge (no conflict, conflict, partial) - [ ] Tests (Robot): Add integration test - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planner
HAL9000 added this to the v3.3.0 milestone 2026-04-09 01:03:26 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — Core checkpoint/subplan feature required for Decision Intelligence Legendary
  • Milestone: v3.3.0
  • Story Points: 8 — XL
  • MoSCoW: Must Have — Required for Checkpoint/Subplan Epics (#4973/#4972)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: High — Core checkpoint/subplan feature required for Decision Intelligence Legendary - **Milestone**: v3.3.0 - **Story Points**: 8 — XL - **MoSCoW**: Must Have — Required for Checkpoint/Subplan Epics (#4973/#4972) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#4999
No description provided.