feat(doctor): add database corruption recovery to --fix
Adds automatic database recovery when bd doctor --fix detects corruption: - Detects SQLite corruption (malformed database, SQLITE_CORRUPT errors) - Backs up corrupted database before recovery attempt - Rebuilds from JSONL if available (issues.jsonl, deletions.jsonl) - Falls back to fresh database if JSONL unavailable - Reports recovery results (issues imported, success/failure) Recovery is triggered automatically by --fix when corruption is detected. No manual intervention required.
This commit is contained in:
@@ -190,7 +190,7 @@ func CheckLegacyJSONLFilename(repoPath string) DoctorCheck {
|
||||
Detail: "Having multiple JSONL files can cause sync and merge conflicts.\n" +
|
||||
" Only one JSONL file should be used per repository.",
|
||||
Fix: "Determine which file is current and remove the others:\n" +
|
||||
" 1. Check 'bd stats' to see which file is being used\n" +
|
||||
" 1. Check .beads/metadata.json for 'jsonl_export' setting\n" +
|
||||
" 2. Verify with 'git log .beads/*.jsonl' to see commit history\n" +
|
||||
" 3. Remove the unused file(s): git rm .beads/<unused>.jsonl\n" +
|
||||
" 4. Commit the change",
|
||||
|
||||
Reference in New Issue
Block a user