mirror of
https://github.com/block/buzz.git
synced 2026-11-01 15:01:12 +00:00
BLOCKING 1: ensure_retention_row_for_payload was re-deriving the retention d_tag from the event's d-tag field, which is absent for kind-5 tombstones (they carry only an a-tag) and kind-9035 archives (p-tag only). Two distinct tombstones for different agents both derived d_tag="" and the second retention upsert silently clobbered the first. Fix: add retention_d_tag column to outbox_events (schema v4, ALTER TABLE migration). insert_outbox_event accepts the d_tag at enqueue time; prepare_publication passes it through. ensure_retention_row_for_payload uses the persisted column value directly — no per-kind tag parsing. BLOCKING 2 (test gaps): - test_boot_recovery_tombstone_redrives_at_correct_retention_coordinate: two distinct agent tombstones, verifies both survive re-drive without collision and that each row's d_tag equals the synthetic key used at enqueue time (not empty). - test_boot_recovery_archive_redrives_at_correct_retention_coordinate: kind-9035 archive, verifies d_tag = agent_pubkey after re-drive. - test_file_commit_recovery_is_serialized_by_advisory_lock: spawns two threads competing for JournalLockGuard, proves the second blocks until the first releases (advisory-lock serialization of recovery vs mutations). - test_prepare_publication_propagates_retention_write_failure: schemaless retention connection, verifies prepare_publication returns Err and that the outbox row was still written (journal-first ordering). Stated limit: command-path propagation requires AppHandle, covered by ?-propagation already in agents.rs:1315,1320 / personas/mod.rs:283-288 / teams.rs:324. - test_prepare_publication_propagates_journal_write_failure: schemaless journal connection, verifies Err propagation and that retention DB is untouched (journal-first ordering enforced). Gates at this commit: just desktop-tauri-clippy clean, just desktop-tauri-test 2254/0, just desktop-check ratchet clean, boundary diff empty. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>