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

@@ -412,6 +412,16 @@ func applyFixList(path string, fixes []doctorCheck) {
// No auto-fix: git conflicts require manual resolution
fmt.Printf(" ⚠ Resolve conflicts manually: git checkout --ours or --theirs .beads/issues.jsonl\n")
continue
case "Stale Closed Issues":
// bd-bqcc: consolidate cleanup into doctor --fix
err = fix.StaleClosedIssues(path)
case "Expired Tombstones":
// bd-bqcc: consolidate cleanup into doctor --fix
err = fix.ExpiredTombstones(path)
case "Compaction Candidates":
// No auto-fix: compaction requires agent review
fmt.Printf(" ⚠ Run 'bd compact --analyze' to review candidates\n")
continue
default:
fmt.Printf(" ⚠ No automatic fix available for %s\n", check.Name)
fmt.Printf(" Manual fix: %s\n", check.Fix)
@@ -792,6 +802,21 @@ func runDiagnostics(path string) doctorResult {
result.OverallOK = false
}
// Check 26: Stale closed issues (maintenance, bd-bqcc)
staleClosedCheck := convertDoctorCheck(doctor.CheckStaleClosedIssues(path))
result.Checks = append(result.Checks, staleClosedCheck)
// Don't fail overall check for stale issues, just warn
// Check 27: Expired tombstones (maintenance, bd-bqcc)
tombstonesExpiredCheck := convertDoctorCheck(doctor.CheckExpiredTombstones(path))
result.Checks = append(result.Checks, tombstonesExpiredCheck)
// Don't fail overall check for expired tombstones, just warn
// Check 28: Compaction candidates (maintenance, bd-bqcc)
compactionCheck := convertDoctorCheck(doctor.CheckCompactionCandidates(path))
result.Checks = append(result.Checks, compactionCheck)
// Info only, not a warning - compaction requires human review
return result
}