fix: resolve P2 sync noise and cleanup issues

- bd-6pni: Auto-filter tombstoned issues with mismatched prefixes during
  import instead of failing. Tombstones from contributor PRs with different
  test prefixes are pollution and safe to ignore.

- bd-ffr9: Stop recreating deletions.jsonl after tombstone migration.
  Added IsTombstoneMigrationComplete() check to all code paths that write
  to the legacy deletions manifest.

- bd-admx: Fix perpetual "JSONL file hash mismatch" warning. Now clears
  both export_hashes AND jsonl_file_hash when mismatch detected, so the
  warning doesn't repeat.

🤖 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-16 00:55:43 -08:00
parent 88ccce884c
commit 2c86404d65
9 changed files with 341 additions and 30 deletions

View File

@@ -401,11 +401,15 @@ func validateJSONLIntegrity(ctx context.Context, jsonlPath string) (bool, error)
jsonlData, err := os.ReadFile(jsonlPath)
if err != nil {
if os.IsNotExist(err) {
// JSONL doesn't exist but we have a stored hash - clear export_hashes
// JSONL doesn't exist but we have a stored hash - clear export_hashes and jsonl_file_hash
fmt.Fprintf(os.Stderr, "⚠️ WARNING: JSONL file missing but export_hashes exist. Clearing export_hashes.\n")
if err := store.ClearAllExportHashes(ctx); err != nil {
return false, fmt.Errorf("failed to clear export_hashes: %w", err)
}
// Also clear jsonl_file_hash to prevent perpetual mismatch warnings (bd-admx)
if err := store.SetJSONLFileHash(ctx, ""); err != nil {
return false, fmt.Errorf("failed to clear jsonl_file_hash: %w", err)
}
return true, nil // Signal full export needed
}
return false, fmt.Errorf("failed to read JSONL file: %w", err)
@@ -421,11 +425,15 @@ func validateJSONLIntegrity(ctx context.Context, jsonlPath string) (bool, error)
fmt.Fprintf(os.Stderr, "⚠️ WARNING: JSONL file hash mismatch detected (bd-160)\n")
fmt.Fprintf(os.Stderr, " This indicates JSONL and export_hashes are out of sync.\n")
fmt.Fprintf(os.Stderr, " Clearing export_hashes to force full re-export.\n")
// Clear export_hashes to force full re-export
if err := store.ClearAllExportHashes(ctx); err != nil {
return false, fmt.Errorf("failed to clear export_hashes: %w", err)
}
// Also clear jsonl_file_hash to prevent perpetual mismatch warnings (bd-admx)
if err := store.SetJSONLFileHash(ctx, ""); err != nil {
return false, fmt.Errorf("failed to clear jsonl_file_hash: %w", err)
}
return true, nil // Signal full export needed
}