fix(doctor): improve diagnostic fix message output (#1187)

Problem:
- Diagnostic fix messages were restricted to single lines
- Inconsistent file path formatting in database sync issues
- Outdated cleanup command suggested in maintenance fixes

Solution:
- Implement multiline support for doctor fix messages
- Standardize issue file paths across database diagnostics
- Update maintenance fix instructions to use 'bd admin cleanup'

Impact:
- Clearer and more accurate recovery instructions for users
- Better readability of complex diagnostic output

Fixes: GH#1170, GH#1171, GH#1172
This commit is contained in:
Peter Chanthamynavong
2026-01-19 10:10:57 -08:00
committed by GitHub
parent 73d4d5ecb2
commit 460d2bf113
3 changed files with 14 additions and 5 deletions

View File

@@ -542,11 +542,11 @@ func CheckDatabaseJSONLSync(path string) DoctorCheck {
fixMsg = "Run 'bd doctor --fix' to fix automatically, or manually run 'bd sync --import-only' or 'bd export' depending on which has newer data"
}
if strings.Contains(strings.Join(issues, " "), "Prefix mismatch") {
fixMsg = "Run 'bd import -i " + filepath.Base(jsonlPath) + " --rename-on-import' to fix prefixes"
fixMsg = "Run 'bd import -i .beads/issues.jsonl --rename-on-import' to fix prefixes"
}
// GH#885: For status mismatches, provide specific guidance and include detail
if strings.Contains(strings.Join(issues, " "), "Status mismatch") {
fixMsg = "Run 'bd export -o " + filepath.Base(jsonlPath) + "' to update JSONL from DB (DB is usually source of truth)"
fixMsg = "Run 'bd export -o .beads/issues.jsonl' to update JSONL from DB (DB is usually source of truth)"
detail = statusMismatchDetail
}