Fix bd-346: Auto-flush after renumber/rename-prefix now does full export

Problem: Incremental flush merged dirty issues with existing JSONL, leaving
old IDs when issues were renamed (e.g., test-3 remained after renumbering to test-2).

Solution:
- Add needsFullExport flag to force complete JSONL rebuild from DB
- Skip loading existing JSONL when fullExport=true (start with empty map)
- Use markDirtyAndScheduleFullExport() in renumber and rename-prefix commands
- PersistentPostRun flushes immediately before process exits (respects fullExport)

Test: Verified renumber with gaps correctly exports only current IDs to JSONL
This commit is contained in:
Steve Yegge
2025-10-16 21:29:20 -07:00
parent 55cd9e062b
commit 8298cbd375
4 changed files with 195 additions and 151 deletions

View File

@@ -128,8 +128,8 @@ Risks:
os.Exit(1)
}
// Schedule auto-flush to export changes
markDirtyAndScheduleFlush()
// Schedule full export (IDs changed, incremental won't work)
markDirtyAndScheduleFullExport()
fmt.Printf("%s Successfully renumbered %d issues\n", green("✓"), len(issues))