feat(bus): reserve identity.unmerged topic

Revocable merges (a contradiction-driven undo of identity.merged) ship
in the clusterer work; this reserves the topic up-front so identity.>
subscribers receive it day one without a re-subscribe.

The clusterer worker's ClusterResult fan-out now publishes on
identity.unmerged when populated. The skeleton clusterer never
populates it; the revocable-merge commit will.

Wiki update lives in wiki-checkout/Service-Bus.md (separate repo).
This commit is contained in:
2026-04-26 08:10:56 -04:00
parent e545f7d8d3
commit fb522af107
4 changed files with 25 additions and 6 deletions

View File

@@ -148,9 +148,13 @@ async def _publish_result(bus: Optional[BaseBus], result: ClusterResult) -> None
merged,
event_type=_topics.IDENTITY_MERGED,
)
# identities_unmerged ships once IDENTITY_UNMERGED is reserved
# (next commit). The field is already on ClusterResult so the
# revocable-merge work doesn't reshape the dataclass.
for unmerged in result.identities_unmerged:
await publish_safely(
bus,
_topics.identity(_topics.IDENTITY_UNMERGED),
unmerged,
event_type=_topics.IDENTITY_UNMERGED,
)
async def _wake_on(bus: BaseBus, wake: asyncio.Event, pattern: str) -> None: