mirror of
https://github.com/block/buzz.git
synced 2026-10-31 22:41:12 +00:00
kind:30176 events serialized agent_pubkeys with skip_serializing_if = Vec::is_empty, making 'old client omitted the field' and 'new client explicitly emptied the team' byte-identical. apply_inbound_team blindly overwrote, so an old client merely renaming a team wiped its agent membership on every newer device. - TeamEventContent.agent_pubkeys is now Option<Vec<String>>. The Option is PERMANENT wire semantics, not a transitional shim (doc comment says so): None = publisher predates the field, Some(vec![]) = explicitly emptied. New clients always publish Some, even when empty. - apply_inbound_team overwrites local membership only on Some; None preserves local. Fresh inserts unwrap_or_default. - persona_ids deliberately left unwrapped, with a doc comment explaining why: it predates agent_pubkeys, every shipped client emits it, so omitted genuinely means empty — wrapping it would freeze stale members when an old client legitimately empties a team. - Tests: parse test flips to assert None (not empty); new tests cover always-publish-Some, None-preserves-local reconcile, and Some(vec![])-clears reconcile. Fixes the pre-merge blocker from the tho/agents-first-remove-personas review (Chuckie/Angelica/Tommy consensus). Zero events with the ambiguous shape existed in the wild before this fix. Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>