fix: Handle .beads/redirect files and limit verbose output in bd doctor --fix

- Add resolveBeadsDir helper to fix/common.go to follow redirect files
- Update OrphanedDependencies, ChildParentDependencies, and MergeArtifacts
  to use resolveBeadsDir instead of hardcoded .beads path
- Add --verbose/-v flag to bd doctor command
- Only print individual items if verbose or count < 20, always show summary

(bd-dq74, bd-v55y)

🤖 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-29 12:58:58 -08:00
parent cd942f136d
commit 24966bd1ce
5 changed files with 74 additions and 15 deletions

View File

@@ -27,7 +27,8 @@ func TestFixFunctions_RequireBeadsDir(t *testing.T) {
{"SyncBranchHealth", func(dir string) error { return SyncBranchHealth(dir, "beads-sync") }},
{"UntrackedJSONL", UntrackedJSONL},
{"MigrateTombstones", MigrateTombstones},
{"ChildParentDependencies", ChildParentDependencies},
{"ChildParentDependencies", func(dir string) error { return ChildParentDependencies(dir, false) }},
{"OrphanedDependencies", func(dir string) error { return OrphanedDependencies(dir, false) }},
}
for _, tc := range funcs {
@@ -70,7 +71,7 @@ func TestChildParentDependencies_NoBadDeps(t *testing.T) {
db.Close()
// Run fix - should find no bad deps
err = ChildParentDependencies(dir)
err = ChildParentDependencies(dir, false)
if err != nil {
t.Errorf("ChildParentDependencies failed: %v", err)
}
@@ -116,7 +117,7 @@ func TestChildParentDependencies_FixesBadDeps(t *testing.T) {
db.Close()
// Run fix
err = ChildParentDependencies(dir)
err = ChildParentDependencies(dir, false)
if err != nil {
t.Errorf("ChildParentDependencies failed: %v", err)
}
@@ -173,7 +174,7 @@ func TestChildParentDependencies_PreservesParentChildType(t *testing.T) {
db.Close()
// Run fix
err = ChildParentDependencies(dir)
err = ChildParentDependencies(dir, false)
if err != nil {
t.Fatalf("ChildParentDependencies failed: %v", err)
}