[ORCH-112] Conflict detection #247

Closed
opened 2026-02-02 21:25:53 +00:00 by jason.woltje · 0 comments
Owner

Detect merge conflicts before pushing.

Acceptance Criteria

  • src/git/conflict-detection.service.ts implemented
  • Fetch latest from remote before push
  • Detect merge conflicts
  • Return conflict details to agent
  • Agent retries with rebase/merge

Dependencies

  • Blocked by: ORCH-110 (Git operations)

Technical Notes

  • Uses simple-git library for git operations
  • Supports both merge and rebase strategies
  • Comprehensive test coverage (95.77%)
  • 18 unit tests covering all scenarios
  • Proper error handling with ConflictDetectionError
  • Clean up after detection (abort merge/rebase)

Implementation Details

Key Methods:

  • checkForConflicts() - Main method to check for conflicts
  • fetchRemote() - Fetch latest from remote
  • detectConflicts() - Detect conflicts in current state
  • getCurrentBranch() - Get current branch name
  • attemptMerge() - Private method to test merge/rebase
  • cleanupMerge() - Private method to cleanup after test

Types:

  • ConflictCheckResult - Result of conflict check
  • ConflictInfo - Information about a single conflict
  • ConflictCheckOptions - Options for checking conflicts
  • ConflictDetectionError - Custom error class

Files Created/Modified

  • apps/orchestrator/src/git/conflict-detection.service.ts
  • apps/orchestrator/src/git/conflict-detection.service.spec.ts
  • apps/orchestrator/src/git/types/conflict-detection.types.ts
  • apps/orchestrator/src/git/types/index.ts (updated)
  • apps/orchestrator/src/git/git.module.ts (updated)
  • apps/orchestrator/src/git/index.ts (updated)
Detect merge conflicts before pushing. ## Acceptance Criteria - [x] src/git/conflict-detection.service.ts implemented - [x] Fetch latest from remote before push - [x] Detect merge conflicts - [x] Return conflict details to agent - [x] Agent retries with rebase/merge ## Dependencies - Blocked by: ORCH-110 (Git operations) ## Technical Notes - Uses simple-git library for git operations - Supports both merge and rebase strategies - Comprehensive test coverage (95.77%) - 18 unit tests covering all scenarios - Proper error handling with ConflictDetectionError - Clean up after detection (abort merge/rebase) ## Implementation Details Key Methods: - checkForConflicts() - Main method to check for conflicts - fetchRemote() - Fetch latest from remote - detectConflicts() - Detect conflicts in current state - getCurrentBranch() - Get current branch name - attemptMerge() - Private method to test merge/rebase - cleanupMerge() - Private method to cleanup after test Types: - ConflictCheckResult - Result of conflict check - ConflictInfo - Information about a single conflict - ConflictCheckOptions - Options for checking conflicts - ConflictDetectionError - Custom error class ## Files Created/Modified - apps/orchestrator/src/git/conflict-detection.service.ts - apps/orchestrator/src/git/conflict-detection.service.spec.ts - apps/orchestrator/src/git/types/conflict-detection.types.ts - apps/orchestrator/src/git/types/index.ts (updated) - apps/orchestrator/src/git/git.module.ts (updated) - apps/orchestrator/src/git/index.ts (updated)
jason.woltje added this to the M6-AgentOrchestration (0.0.6) milestone 2026-02-02 21:25:53 +00:00
jason.woltje added the orchestrator label 2026-02-02 21:25:53 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#247