feat(mol): filter ephemeral issues from JSONL export (bd-687g)

Ephemeral issues should never be exported to issues.jsonl. They exist only
in SQLite and are shared via .beads/redirect pointers. This prevents
"zombie" issues from resurrecting after mol squash deletes them.

Changes:
- Filter ephemeral issues in autoflush, export, and multirepo_export
- Add --summary flag to bd mol squash for agent-provided summaries
- Fix DeleteIssue to also remove comments (missing cascade)
- Add tests for ephemeral filtering and comment deletion

🤖 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-21 14:37:22 -08:00
parent b7c7e7cbcd
commit 39f8461914
8 changed files with 245 additions and 9 deletions

View File

@@ -704,10 +704,21 @@ func flushToJSONLWithState(state flushState) {
}
// Convert map to slice (will be sorted by writeJSONLAtomic)
// Filter out ephemeral issues - they should never be exported to JSONL (bd-687g)
// Ephemeral issues exist only in SQLite and are shared via .beads/redirect, not JSONL.
// This prevents "zombie" issues that resurrect after mol squash deletes them.
issues := make([]*types.Issue, 0, len(issueMap))
ephemeralSkipped := 0
for _, issue := range issueMap {
if issue.Ephemeral {
ephemeralSkipped++
continue
}
issues = append(issues, issue)
}
if ephemeralSkipped > 0 {
debug.Logf("auto-flush: filtered %d ephemeral issues from export", ephemeralSkipped)
}
// Filter issues by prefix in multi-repo mode for non-primary repos (fixes GH #437)
// In multi-repo mode, non-primary repos should only export issues that match