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

@@ -57,7 +57,7 @@
{"id":"bd-8uk","title":"Missing test for PullResult.SafetyWarnings population","description":"","status":"closed","priority":4,"issue_type":"task","created_at":"2025-12-02T21:56:08.413387-08:00","updated_at":"2025-12-02T22:11:17.630494-08:00","closed_at":"2025-12-02T22:11:17.630494-08:00"}
{"id":"bd-91x","title":"Fix dependency naming inconsistencies (GH #440)","description":"Parent-child dependency documentation is backwards and UI labels are confusing.\\n\\nProblems:\\n1. DEPENDENCIES.md says 'bd dep add PARENT CHILD' but this is rejected\\n2. bd show displays epic children under 'Blocks' instead of 'Children'\\n3. bd dep tree EPIC shows nothing (need --direction=up)\\n4. Inconsistent with 'bd epic status' which uses 'children'\\n\\nSee: https://github.com/steveyegge/beads/issues/440","status":"closed","priority":2,"issue_type":"bug","created_at":"2025-12-01T21:01:41.63295-08:00","updated_at":"2025-12-01T21:06:17.866688-08:00","closed_at":"2025-12-01T21:06:17.866688-08:00"}
{"id":"bd-93d","title":"Jira export script (jsonl2jira.py)","description":"Create a Python script to push beads issues to Jira.\n\n**Requires**: Jira import script to be complete first (need external_ref matching logic working)\n\n**Features needed**:\n- Create new Jira issues from beads issues without external_ref\n- Update existing Jira issues matched by external_ref\n- Map beads fields back to Jira fields\n- Handle Jira workflow transitions (status changes may need transitions)\n- Support custom field mapping for design/acceptance_criteria/notes\n\n**Challenges**:\n- Jira status changes often require workflow transitions, not direct updates\n- Need to discover valid transitions via API\n- Custom fields vary by Jira instance\n\n**Usage**:\n```bash\nbd export | python jsonl2jira.py --create-only # Only create, don't update\nbd export | python jsonl2jira.py # Create and update\n```\n\n**After creation**: Sets external_ref on beads issue to link back","status":"closed","priority":2,"issue_type":"feature","created_at":"2025-11-30T12:56:14.266357-08:00","updated_at":"2025-11-30T15:19:40.264737-08:00","closed_at":"2025-11-30T15:19:40.264737-08:00","dependencies":[{"issue_id":"bd-93d","depends_on_id":"bd-qvj","type":"parent-child","created_at":"2025-11-30T12:56:44.652391-08:00","created_by":"stevey"},{"issue_id":"bd-93d","depends_on_id":"bd-tjn","type":"blocks","created_at":"2025-11-30T12:56:54.941116-08:00","created_by":"stevey"}]}
{"id":"bd-9auw","title":"convertDeletionToTombstone uses hardcoded default values","description":"The convertDeletionToTombstone helper (importer.go:1114-1130) uses hardcoded defaults:\n- Priority: 2\n- IssueType: types.TypeTask\n- Title: \"(deleted)\"\n\nThese defaults work but could be improved:\n1. Consider using Priority: 0 (unset) to distinguish from user-set priority\n2. OriginalType is empty string - consider setting IssueType to empty to be consistent\n3. Title could include the original ID for debugging: \"(deleted: bd-xyz)\"\n\nLow priority cleanup for consistency.","status":"open","priority":2,"issue_type":"task","created_at":"2025-12-07T01:41:02.390816-08:00","updated_at":"2025-12-07T01:41:02.390816-08:00","dependencies":[{"issue_id":"bd-9auw","depends_on_id":"bd-dve","type":"blocks","created_at":"2025-12-07T01:41:28.35551-08:00","created_by":"daemon"}]}
{"id":"bd-9auw","title":"convertDeletionToTombstone uses hardcoded default values","description":"The convertDeletionToTombstone helper (importer.go:1114-1130) uses hardcoded defaults:\n- Priority: 2\n- IssueType: types.TypeTask\n- Title: \"(deleted)\"\n\nThese defaults work but could be improved:\n1. Consider using Priority: 0 (unset) to distinguish from user-set priority\n2. OriginalType is empty string - consider setting IssueType to empty to be consistent\n3. Title could include the original ID for debugging: \"(deleted: bd-xyz)\"\n\nLow priority cleanup for consistency.","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-07T01:41:02.390816-08:00","updated_at":"2025-12-07T02:19:52.824918-08:00","closed_at":"2025-12-07T02:19:52.824918-08:00","dependencies":[{"issue_id":"bd-9auw","depends_on_id":"bd-dve","type":"blocks","created_at":"2025-12-07T01:41:28.35551-08:00","created_by":"daemon"}]}
{"id":"bd-9cc","title":"bd doctor: export diagnostics history for debugging","description":"Add ability to save doctor diagnostics to a file (e.g., diagnostics.json) for historical analysis and bug reporting. This would help track intermittent issues and provide context when filing bug reports. Could integrate with --perf output for comprehensive system snapshots.","status":"closed","priority":4,"issue_type":"feature","created_at":"2025-12-02T12:52:23.711572-08:00","updated_at":"2025-12-03T22:16:49.671517-08:00","closed_at":"2025-12-03T22:16:49.671517-08:00"}
{"id":"bd-9e23","title":"Optimize Memory backend GetIssueByExternalRef with index","description":"Currently GetIssueByExternalRef in Memory storage uses O(n) linear search through all issues.\n\nCurrent code (memory.go:282-308):\nfor _, issue := range m.issues {\n if issue.ExternalRef != nil \u0026\u0026 *issue.ExternalRef == externalRef {\n return \u0026issueCopy, nil\n }\n}\n\nProposed optimization:\n- Add externalRefToID map[string]string to MemoryStorage\n- Maintain it in CreateIssue, UpdateIssue, DeleteIssue\n- Achieve O(1) lookup like SQLite's index\n\nImpact: Low (--no-db mode typically has smaller datasets)\nRelated: bd-1022","status":"closed","priority":4,"issue_type":"chore","created_at":"2025-11-02T15:32:30.242357-08:00","updated_at":"2025-11-26T11:14:49.172418-08:00","closed_at":"2025-11-26T11:14:49.172418-08:00"}
{"id":"bd-9li4","title":"Create Docker image for Agent Mail","description":"Containerize Agent Mail server for easy deployment.\n\nAcceptance Criteria:\n- Dockerfile with Python 3.14\n- Health check endpoint\n- Volume mount for storage\n- Environment variable configuration\n- Multi-arch builds (amd64, arm64)\n\nFile: deployment/agent-mail/Dockerfile","status":"closed","priority":3,"issue_type":"task","created_at":"2025-11-07T22:43:43.231964-08:00","updated_at":"2025-11-25T17:47:30.777486-08:00","closed_at":"2025-11-25T17:47:30.777486-08:00"}

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) {