feat: add --hard flag to bd cleanup for bypassing tombstone TTL safety

Adds the ability to permanently remove tombstones before the default 30-day TTL:
- bd cleanup --hard --older-than N: prune tombstones older than N days
- bd cleanup --hard: prune all tombstones

This bypasses sync safety for scenarios like cleaning house after extended
absence where resurrection from old clones is not a concern.

Closes: bd-adoe

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-16 01:25:49 -08:00
parent 4df70641ad
commit 923a9da390
3 changed files with 67 additions and 17 deletions

View File

@@ -457,8 +457,8 @@ func TestPruneExpiredTombstones(t *testing.T) {
defer func() { dbPath = originalDBPath }()
dbPath = filepath.Join(beadsDir, "beads.db")
// Run pruning
result, err := pruneExpiredTombstones()
// Run pruning (0 = use default TTL)
result, err := pruneExpiredTombstones(0)
if err != nil {
t.Fatalf("pruneExpiredTombstones failed: %v", err)
}
@@ -551,8 +551,8 @@ func TestPruneExpiredTombstones_NoTombstones(t *testing.T) {
defer func() { dbPath = originalDBPath }()
dbPath = filepath.Join(beadsDir, "beads.db")
// Run pruning - should return zero pruned
result, err := pruneExpiredTombstones()
// Run pruning - should return zero pruned (0 = use default TTL)
result, err := pruneExpiredTombstones(0)
if err != nil {
t.Fatalf("pruneExpiredTombstones failed: %v", err)
}