feat(KB-023): add smart automatic merge conflict resolution
- Add conflict classification API: classifyConflict(), getConflictedFiles(), resolveWithOurs(), resolveWithTheirs(), resolveTrivialWhitespace() - Auto-resolve lock files (ours), generated files (theirs), and trivial whitespace conflicts - Add smartConflictResolution setting (alias for autoResolveConflicts) - Track resolution path via resolutionMethod and autoResolvedCount in MergeResult - Implement 3-attempt retry logic with escalating strategies in aiMergeTask - Export pattern constants LOCKFILE_PATTERNS and GENERATED_PATTERNS
This commit is contained in:
17
.changeset/smart-conflict-resolution.md
Normal file
17
.changeset/smart-conflict-resolution.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
"@dustinbyrne/kb": minor
|
||||
---
|
||||
|
||||
Add smart automatic merge conflict resolution. Lock files, generated files, and trivial whitespace conflicts are now resolved automatically without AI intervention, reducing merge latency and API costs.
|
||||
|
||||
New API in `@kb/engine`:
|
||||
- `classifyConflict(filePath, cwd)` - returns 'lockfile-ours' | 'generated-theirs' | 'trivial-whitespace' | 'complex'
|
||||
- `getConflictedFiles(cwd)` - list conflicted files via git
|
||||
- `resolveWithOurs(filePath, cwd)` - resolve using current branch
|
||||
- `resolveWithTheirs(filePath, cwd)` - resolve using incoming branch
|
||||
- `resolveTrivialWhitespace(filePath, cwd)` - resolve whitespace conflicts
|
||||
- `isTrivialWhitespaceConflict(filePath, cwd)` - detect using git diff-tree -w
|
||||
- Exported pattern constants: `LOCKFILE_PATTERNS`, `GENERATED_PATTERNS`
|
||||
|
||||
New setting: `smartConflictResolution` (alias for `autoResolveConflicts`)
|
||||
New MergeResult fields: `resolutionMethod`, `autoResolvedCount` for tracking resolution paths
|
||||
Reference in New Issue
Block a user