fix: daemon delete creates tombstones, export includes tombstones (bd-rp4o)
Three changes to fix deleted issues resurrecting during bd sync: 1. daemon handleDelete now uses CreateTombstone instead of DeleteIssue - internal/rpc/server_issues_epics.go 2. sync.go exportToJSONL now includes IncludeTombstones:true - cmd/bd/sync.go 3. server_export_import_auto.go handleExport and auto-export now include tombstones in SearchIssues filter - internal/rpc/server_export_import_auto.go Also adds README.md documentation for sync.branch mode (bd-dsdh): - Explains "always dirty" working tree behavior - Shell alias tip: gs='git status -- ":!.beads/"' - When to use bd sync --merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,8 +49,9 @@ func (s *Server) handleExport(req *Request) Response {
|
||||
manifest = export.NewManifest(cfg.Policy)
|
||||
}
|
||||
|
||||
// Get all issues (core operation, always fail-fast)
|
||||
issues, err := store.SearchIssues(ctx, "", types.IssueFilter{})
|
||||
// Get all issues including tombstones for sync propagation (bd-rp4o fix)
|
||||
// Tombstones must be exported so they propagate to other clones and prevent resurrection
|
||||
issues, err := store.SearchIssues(ctx, "", types.IssueFilter{IncludeTombstones: true})
|
||||
if err != nil {
|
||||
return Response{
|
||||
Success: false,
|
||||
@@ -464,8 +465,8 @@ func (s *Server) triggerExport(ctx context.Context, store storage.Storage, dbPat
|
||||
}
|
||||
}
|
||||
|
||||
// Export to JSONL (this will update the file with remapped IDs)
|
||||
allIssues, err := sqliteStore.SearchIssues(ctx, "", types.IssueFilter{})
|
||||
// Export to JSONL including tombstones for sync propagation (bd-rp4o fix)
|
||||
allIssues, err := sqliteStore.SearchIssues(ctx, "", types.IssueFilter{IncludeTombstones: true})
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to fetch issues for export: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user