Hi @julian @aSeppoToTry @canary,
hm, interesting. I doubt there is a correct answer. Because #Webfinger doesn't care about #ActivityPub and ActivityPub doesn't care about Webfinger neither specifies how to construct the handle from a profile document. It would have to be explicitly mentioned which it isn't. All other is idiosyncratic, proprietary oracles.
According to https://www.w3.org/TR/activitypub/ the actor id is the canonical identifier.
With best faith #Seppo combines the preferredUserName and the profile document's domain. What else could you do?