Complete bd-175, bd-176, bd-177: Memory tests, corruption docs, prefix validation
- bd-175: Added comprehensive test coverage for internal/storage/memory backend - All CRUD operations, dependencies, labels, comments - Thread safety with race detection - LoadFromIssues and counter sync - Fixed batch duplicate detection - bd-176: Documented corruption vs collision distinction - Added FAQ entry explaining logical vs physical corruption - Updated TROUBLESHOOTING with clear guidance - Clarified when to use collision resolution vs reimport - bd-177: Added prefix validation in SQLite mode - Validates explicit IDs match configured prefix - Works in both CreateIssue and CreateIssues - Comprehensive tests for single and batch operations
This commit is contained in:
@@ -92,18 +92,29 @@ bd import -i .beads/issues.jsonl
|
||||
|
||||
### Database corruption
|
||||
|
||||
If you suspect database corruption:
|
||||
**Important**: Distinguish between **logical consistency issues** (ID collisions, wrong prefixes) and **physical SQLite corruption**.
|
||||
|
||||
For **physical database corruption** (disk failures, power loss, filesystem errors):
|
||||
|
||||
```bash
|
||||
# Check database integrity
|
||||
sqlite3 .beads/*.db "PRAGMA integrity_check;"
|
||||
|
||||
# If corrupted, reimport from JSONL
|
||||
# If corrupted, reimport from JSONL (source of truth in git)
|
||||
mv .beads/*.db .beads/*.db.backup
|
||||
bd init
|
||||
bd import -i .beads/issues.jsonl
|
||||
```
|
||||
|
||||
For **logical consistency issues** (ID collisions from branch merges, parallel workers):
|
||||
|
||||
```bash
|
||||
# This is NOT corruption - use collision resolution instead
|
||||
bd import -i .beads/issues.jsonl --resolve-collisions
|
||||
```
|
||||
|
||||
See [FAQ](FAQ.md#whats-the-difference-between-sqlite-corruption-and-id-collisions) for the distinction.
|
||||
|
||||
### Multiple databases detected warning
|
||||
|
||||
If you see a warning about multiple `.beads` databases in the directory hierarchy:
|
||||
|
||||
Reference in New Issue
Block a user