feat: consolidate maintenance commands into bd doctor --fix (bd-bqcc)

Add new Maintenance category to bd doctor with checks for:
- Stale closed issues (older than 30 days)
- Expired tombstones (older than TTL)
- Compaction candidates (info only)

Add fix handlers for cleanup and tombstone pruning via bd doctor --fix.
Add deprecation hints to cleanup, compact, and detect-pollution commands
suggesting users try bd doctor instead.

This consolidation reduces cognitive load - users just need to remember
'bd doctor' for health checks and 'bd doctor --fix' for maintenance.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-23 00:25:09 -08:00
parent cfe823da61
commit aa1ce63156
9 changed files with 624 additions and 3 deletions

View File

@@ -12,7 +12,11 @@ import (
"github.com/steveyegge/beads/internal/ui"
)
// TODO: Consider consolidating into 'bd doctor --fix' for simpler maintenance UX
// showDetectPollutionDeprecationHint shows a hint about bd doctor consolidation (bd-bqcc)
func showDetectPollutionDeprecationHint() {
fmt.Fprintln(os.Stderr, ui.RenderMuted("💡 Tip: 'bd doctor' now detects test pollution in the Metadata section"))
}
var detectPollutionCmd = &cobra.Command{
Use: "detect-pollution",
GroupID: "maint",
@@ -134,6 +138,8 @@ NOTE: Review detected issues carefully before using --clean. False positives are
if !clean {
fmt.Printf("Run 'bd detect-pollution --clean' to delete these issues (with confirmation).\n")
// bd-bqcc: Show hint about doctor consolidation
showDetectPollutionDeprecationHint()
return
}