From 9f8b3478fd0335338b198f9614c1621a3224952c Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Wed, 24 Dec 2025 20:55:31 -0800 Subject: [PATCH] fix: filter wisps from sync_export.go (bd-687g) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sync command's exportToJSONL function was not filtering wisps, causing them to be re-added to JSONL during bd sync re-export step. autoflush.go had wisp filtering but sync_export.go did not. Added the same filtering logic to prevent wisps from being exported to JSONL. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- cmd/bd/sync_export.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmd/bd/sync_export.go b/cmd/bd/sync_export.go index 26a6ebb7..606ebe6d 100644 --- a/cmd/bd/sync_export.go +++ b/cmd/bd/sync_export.go @@ -60,6 +60,18 @@ func exportToJSONL(ctx context.Context, jsonlPath string) error { } } + // Filter out wisps - they should never be exported to JSONL (bd-687g) + // Wisps exist only in SQLite and are shared via .beads/redirect, not JSONL. + // This prevents "zombie" issues that resurrect after mol squash deletes them. + filteredIssues := make([]*types.Issue, 0, len(issues)) + for _, issue := range issues { + if issue.Wisp { + continue + } + filteredIssues = append(filteredIssues, issue) + } + issues = filteredIssues + // Sort by ID for consistent output slices.SortFunc(issues, func(a, b *types.Issue) int { return cmp.Compare(a.ID, b.ID)