feat(doctor): add patrol pollution detection and fix

Add CheckPatrolPollution to detect stale patrol beads:
- Patrol digests matching 'Digest: mol-*-patrol'
- Session ended beads matching 'Session ended: *'

Includes auto-fix via 'bd doctor --fix' to clean up pollution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
emma
2026-01-20 23:15:37 -08:00
committed by Steve Yegge
parent bf92fda886
commit 4a0f4abc70
4 changed files with 273 additions and 3 deletions

View File

@@ -312,6 +312,8 @@ func applyFixList(path string, fixes []doctorCheck) {
continue
case "Legacy MQ Files":
err = doctor.FixStaleMQFiles(path)
case "Patrol Pollution":
err = fix.PatrolPollution(path)
default:
fmt.Printf(" ⚠ No automatic fix available for %s\n", check.Name)
fmt.Printf(" Manual fix: %s\n", check.Fix)