pub(crate) fn build_block_to_agent_map(
discovery: &Value,
) -> HashMap<String, String>Expand description
FleetBroadcast’s block_id -> agent-name resolution
(REPORT_CROSS_INSTANCE_CONTROL_ROBUSTNESS_AUDIT_2026_08_22.md): a /agentmux/discovery
response’s host.addressable AND host.cross_channel sections both
carry a block_id — addressable under agent_id/block_id,
cross_channel (a different channel on this same host) under
name/block_id. A block_id is unique across channels on one host, so
both are folded into one map, not kept separate. lan/wan entries
carry no block_id at all (they’re not local blocks) — a target for
those tiers is never in this map, and the caller falls back to treating
it as a literal agent name instead (see the FleetBroadcast handler).
Pure (no I/O) — extracted so it’s unit-testable without a live discovery endpoint.