filter "home-assistant-{config-entries,device-registry,entity-registry}": also shorten v4 upnp uuids
Home Assistant's "ssdp" integration stores the UPnP UDN (`uuid:<UUID>`) of discovered devices in the discovery keys of config entries, and the "dlna_dmr" integration uses it as identifier in its config entries (`unique_id`, `data.device_id`), the device registry's `upnp` connections and its entities' `unique_id`. No filter covered these fields, so the full UUID would have been committed. Devices broadcast their UDN via SSDP on the local network, so anyone who sees those announcements could match the device to a full UUID in the repository.
Only UUIDs of version 4 are truncated, recognized by the version digit `4` and a variant digit of 8, 9, a or b. Other versions are not random: v1, v2 and v6 contain a timestamp and usually the MAC address, v7 starts with a timestamp, and v3 and v5 are hashes of a name that is often guessable (e.g. a MAC or serial number), so even a few kept bits can confirm a guessed name. The version digit only denotes a version under the standard variant, hence the check on the variant digit. UUIDs that do not match are left unchanged and need their own rule.
In a v4 UUID all bits except the version and variant are random, so unlike a MAC address there is no part shared between devices (such as the OUI) that could be kept without identifying the device. The rule keeps only the third group (`uuid:…-4xxx-…`): the version digit documents in the committed data why truncating is safe, and its 12 random bits (one random device in 4096 matches) are enough to tell devices apart in diffs without reliably identifying one. The group is kept together with its surrounding hyphens, so `git grep -- -4xxx-` matches both the shortened value in the repository and the full UUID in unfiltered files. The variant digit is dropped because it would reveal 2 more random bits and the regex already verifies it.
AVM FRITZ! devices advertise UUIDs like `uuid:75802409-bccb-40e7-8e6c-<MAC>`: a fixed prefix per UPnP service followed by the device's MAC address. They look like valid v4 UUIDs (`40e7` with variant `8e6c`/`9f6c`) but are not random. The rule skips them using the same pattern as the "truncate-mac-address-to-24-bits" filter, which already truncates the embedded MAC address to its OUI. Truncating them to the version group instead would hide the vendor prefix and rewrite already committed values.
The existing "samsungtv" rules still keep the first 2 hex digits, so the same TV's UUIDs are shown in two formats. Changing them would rewrite already committed values.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>