feat(doctor): add check for stale .beads/mq/ files (bd-dx2dc)

Add bd doctor check that detects legacy gastown merge queue JSON files
in .beads/mq/. These files are local-only remnants from the old mrqueue
implementation and can safely be deleted since gt done already creates
merge-request wisps in beads.

- CheckStaleMQFiles() detects .beads/mq/*.json files
- FixStaleMQFiles() removes the entire mq directory
- Comprehensive tests for check and fix

This is the first step toward removing the mrqueue side-channel from
gastown. The follow-up convoy will update Refinery/Witness to use
beads exclusively.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/emma
2026-01-12 19:42:41 -08:00
committed by Steve Yegge
parent e8a4474788
commit 66c5c4d805
4 changed files with 181 additions and 0 deletions

View File

@@ -572,6 +572,11 @@ func runDiagnostics(path string) doctorResult {
result.Checks = append(result.Checks, persistentMolCheck)
// Don't fail overall check for persistent mol issues, just warn
// Check 26c: Legacy merge queue files (gastown mrqueue remnants)
staleMQFilesCheck := convertDoctorCheck(doctor.CheckStaleMQFiles(path))
result.Checks = append(result.Checks, staleMQFilesCheck)
// Don't fail overall check for legacy MQ files, just warn
// Check 27: Expired tombstones (maintenance)
tombstonesExpiredCheck := convertDoctorCheck(doctor.CheckExpiredTombstones(path))
result.Checks = append(result.Checks, tombstonesExpiredCheck)