-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement semantic conflict detection in workspace merge #611
Copy link
Copy link
Closed
Labels
scope:medium1-3 days of work1-3 days of workspec:agent-systemDESIGN_SPEC Section 3 - Agent SystemDESIGN_SPEC Section 3 - Agent Systemtype:featureNew feature implementationNew feature implementationv0.5Minor version v0.5Minor version v0.5v0.5.3Patch release v0.5.3Patch release v0.5.3
Description
Summary
Workspace merge only detects textual git conflicts (merge markers). Semantic conflicts (broken imports, type mismatches, logic errors from independently correct changes) are not detected.
Finding (from codebase audit)
src/synthorg/engine/workspace/git_worktree.py:549-550:# Git diff --diff-filter=U only detects textual conflicts; # semantic conflict detection is not yet implemented
- Only
ConflictType.TEXTUALconflicts are created - The design spec (engine.md, section 9.3) requires: "Semantic conflicts: review agent evaluates merged result"
Impact
When two agents work on parallel workspace branches and their changes are merged:
- Textual conflicts (merge markers) are caught correctly
- But merged code can have correct syntax yet broken semantics (e.g., Agent A renames a function, Agent B adds a call to the old name - merge succeeds but code is broken)
Approach Options
- LLM-based review: After merge, pass the diff to an LLM agent asking "does this merged result have semantic conflicts?"
- AST-based analysis: Parse merged code, check for undefined references, type mismatches
- Test-based validation: Run the test suite on the merged result to detect regressions
- Hybrid: Quick AST check + targeted LLM review for suspicious patterns
Design Spec Reference
- Engine design page, section 9.3 (Workspace Isolation, Strategy 1)
Files to Modify
src/synthorg/engine/workspace/git_worktree.py(add semantic analysis after merge)- Possibly new module
src/synthorg/engine/workspace/semantic_analyzer.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
scope:medium1-3 days of work1-3 days of workspec:agent-systemDESIGN_SPEC Section 3 - Agent SystemDESIGN_SPEC Section 3 - Agent Systemtype:featureNew feature implementationNew feature implementationv0.5Minor version v0.5Minor version v0.5v0.5.3Patch release v0.5.3Patch release v0.5.3