Add conflict marker detection to bd import/validate

- bd import now detects git conflict markers and shows resolution steps
- bd validate --checks=conflicts improved with clearer instructions
- Updated AGENTS.md with better conflict resolution docs
- Closes bd-7e7ddffa epic (repair tools complete)

Amp-Thread-ID: https://ampcode.com/threads/T-4a11a65b-56c2-4d92-8f68-66f0a56ab5e3
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-02 16:45:51 -08:00
parent 439f09a255
commit 4ee5b2c2c1
3 changed files with 54 additions and 30 deletions

View File

@@ -400,17 +400,21 @@ func validateGitConflicts(_ context.Context, fix bool) checkResult {
if len(conflictLines) > 0 {
result.issueCount = 1 // One conflict situation
result.suggestions = append(result.suggestions,
fmt.Sprintf("Resolve git conflict in %s (markers at lines: %v)", jsonlPath, conflictLines))
if !fix {
result.suggestions = append(result.suggestions,
fmt.Sprintf("Then run 'bd import -i %s' to reload issues", jsonlPath))
}
fmt.Sprintf("Git conflict markers found in %s at lines: %v", jsonlPath, conflictLines))
result.suggestions = append(result.suggestions,
"To resolve, choose one version:")
result.suggestions = append(result.suggestions,
" git checkout --ours .beads/issues.jsonl && bd import -i .beads/issues.jsonl")
result.suggestions = append(result.suggestions,
" git checkout --theirs .beads/issues.jsonl && bd import -i .beads/issues.jsonl")
result.suggestions = append(result.suggestions,
"For advanced field-level merging: https://github.com/neongreen/mono/tree/main/beads-merge")
}
// Can't auto-fix git conflicts
if fix && result.issueCount > 0 {
result.suggestions = append(result.suggestions,
"Git conflicts cannot be auto-fixed. Resolve manually in your editor or run 'bd export' to regenerate JSONL")
"Note: Git conflicts cannot be auto-fixed with --fix-all")
}
return result