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

@@ -685,7 +685,14 @@ func getDeletionsPath() string {
// recordDeletion appends a deletion record to the deletions manifest.
// This MUST be called BEFORE deleting from the database to ensure
// deletion records are never lost.
// After tombstone migration (bd-ffr9), this is a no-op since inline tombstones
// are used instead of deletions.jsonl.
func recordDeletion(id, deleteActor, reason string) error {
// bd-ffr9: Skip writing to deletions.jsonl if tombstone migration is complete
beadsDir := filepath.Dir(dbPath)
if deletions.IsTombstoneMigrationComplete(beadsDir) {
return nil
}
record := deletions.DeletionRecord{
ID: id,
Timestamp: time.Now().UTC(),
@@ -698,7 +705,14 @@ func recordDeletion(id, deleteActor, reason string) error {
// recordDeletions appends multiple deletion records to the deletions manifest.
// This MUST be called BEFORE deleting from the database to ensure
// deletion records are never lost.
// After tombstone migration (bd-ffr9), this is a no-op since inline tombstones
// are used instead of deletions.jsonl.
func recordDeletions(ids []string, deleteActor, reason string) error {
// bd-ffr9: Skip writing to deletions.jsonl if tombstone migration is complete
beadsDir := filepath.Dir(dbPath)
if deletions.IsTombstoneMigrationComplete(beadsDir) {
return nil
}
path := getDeletionsPath()
for _, id := range ids {
record := deletions.DeletionRecord{