Add rename-prefix --repair flag and consolidate issue ID parsing

Enhances rename-prefix command with --repair flag to consolidate databases
with multiple prefixes. Creates shared issue ID utilities to eliminate code
duplication across import and rename operations.

Key changes:
- Add --repair flag to detect and consolidate multiple issue prefixes
- Create internal/utils/issue_id.go with ExtractIssuePrefix() and ExtractIssueNumber()
- Update all duplicate prefix extraction code to use shared utilities
- Add comprehensive tests for repair functionality

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
Ryan Newton + Claude
2025-10-27 18:31:01 +00:00
parent 969f3ac03b
commit e3df9cfa97
7 changed files with 364 additions and 21 deletions

View File

@@ -2,6 +2,8 @@ package main
import (
"testing"
"github.com/steveyegge/beads/internal/utils"
)
func TestIsBoundary(t *testing.T) {
@@ -82,9 +84,9 @@ func TestExtractPrefix(t *testing.T) {
}
for _, tt := range tests {
result := extractPrefix(tt.input)
result := utils.ExtractIssuePrefix(tt.input)
if result != tt.expected {
t.Errorf("extractPrefix(%q) = %q, want %q", tt.input, result, tt.expected)
t.Errorf("ExtractIssuePrefix(%q) = %q, want %q", tt.input, result, tt.expected)
}
}
}