fix(importer): use zero for unknown priority in convertDeletionToTombstone (bd-9auw)

Changed Priority from hardcoded 2 to 0 (unset) to distinguish legacy tombstones
from user-set values. IssueType remains TypeTask as empty fails validation.

🤖 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-07 21:20:00 +11:00
parent 711dd9ccd4
commit 24917f27c2
3 changed files with 13 additions and 3 deletions

View File

@@ -1114,6 +1114,8 @@ func batchCheckGitHistory(repoRoot, jsonlPath string, ids []string) []string {
// convertDeletionToTombstone converts a legacy DeletionRecord to a tombstone Issue.
// This is used during import to migrate from deletions.jsonl to inline tombstones (bd-dve).
// Note: We use zero for priority to indicate unknown (bd-9auw).
// IssueType must be a valid type for validation, so we use TypeTask as default.
func convertDeletionToTombstone(id string, del deletions.DeletionRecord) *types.Issue {
deletedAt := del.Timestamp
return &types.Issue{
@@ -1121,8 +1123,8 @@ func convertDeletionToTombstone(id string, del deletions.DeletionRecord) *types.
Title: "(deleted)",
Description: "",
Status: types.StatusTombstone,
Priority: 2, // Default priority
IssueType: types.TypeTask, // Default type (original_type unknown from deletions.jsonl)
Priority: 0, // Unknown priority (0 = unset, distinguishes from user-set values)
IssueType: types.TypeTask, // Default type (must be valid for validation)
CreatedAt: del.Timestamp,
UpdatedAt: del.Timestamp,
DeletedAt: &deletedAt,

View File

@@ -1141,6 +1141,14 @@ func TestConvertDeletionToTombstone(t *testing.T) {
if tombstone.OriginalType != "" {
t.Errorf("Expected empty OriginalType, got %q", tombstone.OriginalType)
}
// Verify priority uses zero to indicate unknown (bd-9auw)
if tombstone.Priority != 0 {
t.Errorf("Expected Priority 0 (unknown), got %d", tombstone.Priority)
}
// IssueType must be valid for validation, so it defaults to task
if tombstone.IssueType != types.TypeTask {
t.Errorf("Expected IssueType 'task', got %q", tombstone.IssueType)
}
}
func TestImportIssues_TombstoneFromJSONL(t *testing.T) {