Fix validatePostImport false positive for legitimate deletions (bd-pg1)

The sync validation was incorrectly triggering 'data loss detected' when
issue count decreased after import, even for legitimate deletions recorded
in deletions.jsonl.

Changes:
- Modified validatePostImport to accept jsonlPath and check deletions manifest
- When issue count decreases, check if decrease is within recorded deletions
- Updated all call sites in sync.go and daemon_sync.go
- Added comprehensive tests for deletion-aware validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-28 17:43:21 -08:00
parent b33259a94e
commit fe4f851d33
4 changed files with 103 additions and 11 deletions

View File

@@ -550,7 +550,7 @@ func createAutoImportFunc(ctx context.Context, store storage.Storage, log daemon
return
}
if err := validatePostImport(beforeCount, afterCount); err != nil {
if err := validatePostImport(beforeCount, afterCount, jsonlPath); err != nil {
log.log("Post-import validation failed: %v", err)
return
}
@@ -743,7 +743,7 @@ func createSyncFunc(ctx context.Context, store storage.Storage, autoCommit, auto
return
}
if err := validatePostImport(beforeCount, afterCount); err != nil {
if err := validatePostImport(beforeCount, afterCount, jsonlPath); err != nil {
log.log("Post-import validation failed: %v", err)
return
}