Fix bd-8kde: disable auto-import during delete operations

- Skip auto-import in PersistentPreRun for delete command
- Prevents resurrection of deleted issues from stale git JSONL
- Add TestBulkDeleteNoResurrection to prevent regression
- Verified with full test suite

Amp-Thread-ID: https://ampcode.com/threads/T-635e5cf4-fa2f-4ce3-9f05-43b48010baae
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-08 03:10:12 -08:00
parent 288d62a32c
commit ba2aef429c
2 changed files with 174 additions and 1 deletions

View File

@@ -415,8 +415,9 @@ var rootCmd = &cobra.Command{
// Auto-import if JSONL is newer than DB (e.g., after git pull)
// Skip for import command itself to avoid recursion
// Skip for delete command to prevent resurrection of deleted issues (bd-8kde)
// Skip if sync --dry-run to avoid modifying DB in dry-run mode (bd-191)
if cmd.Name() != "import" && autoImportEnabled {
if cmd.Name() != "import" && cmd.Name() != "delete" && autoImportEnabled {
// Check if this is sync command with --dry-run flag
if cmd.Name() == "sync" {
if dryRun, _ := cmd.Flags().GetBool("dry-run"); dryRun {