mirror of
https://github.com/block/buzz.git
synced 2026-10-29 21:41:33 +00:00
IMPORTANT: refresh_for_persona_at read only personas.json, which is retired (renamed .bak) by the Phase 1A.2 fold migration. On a post-fold install this resolved zero definitions, causing resolve_team_members to fail and resolve_and_refresh_or_retract_at to retract (purge+tombstone) every affected shared 30178 head. A successful persona retry/share-toggle would silently destroy the team catalog and report success. Fix: replace the single-store load in refresh_for_persona_at with the same dual-store rule as boot reconciliation: try personas.json first; if empty, read keyless definition records from managed-agents.json. Reuses crate::event_sync::read_persona_definitions (promoted to pub(crate)). Test: split the regression into pre-fold and post-fold variants. Post-fold variant: teams.json + keyless managed-agents.json record, personas.json explicitly absent. Verified mutations: - Mutation A (single-store revert): pre-fold GREEN, post-fold RED 0/1. - Mutation B (delete refresh call): both RED 0/2; restored: both GREEN 2/2. MINOR 1: remove stale coordinator comment claiming the flush loop retries and reopen/save forces retry — both proven false by Thufir's trace. MINOR 2: add per-team eprintln logging in refresh_for_persona_at for RemovalQueued and Err outcomes, matching the logging in the AppHandle path (refresh_shared_team_catalog_heads_for_persona). Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>