Fix bd-in7q: prevent migrate-tombstones from corrupting deletions manifest (#554)

Root cause: bd doctor hydrate was re-adding migrated tombstones to the
deletions manifest because getCurrentJSONLIDs() included all issues,
including tombstones. When compared against git history, tombstones
appeared as 'deleted' and were incorrectly added to the manifest as new
deletions, corrupting the database on next sync.

Fix: Skip tombstone-status issues in getCurrentJSONLIDs() so they don't
participate in deletion detection. Tombstones represent already-recorded
deletions/migrations and shouldn't be treated as active issues.

Changes:
- cmd/bd/doctor/fix/deletions.go: Skip tombstones in getCurrentJSONLIDs()
- cmd/bd/doctor/fix/deletions_test.go: New tests for tombstone skipping
- cmd/bd/migrate_tombstones_test.go: Test that tombstones are valid

This fixes the bug where 'bd migrate-tombstones' followed by 'bd sync'
would add thousands of deletion records with author 'bd-doctor-hydrate'
This commit is contained in:
matt wilkie
2025-12-14 15:11:27 -07:00
committed by GitHub
parent 3a9749279a
commit a22d949cbd
9 changed files with 10800 additions and 811 deletions

View File

@@ -2,4 +2,4 @@
"database": "beads.db",
"jsonl_export": "issues.jsonl",
"last_bd_version": "0.27.2"
}
}