https://snapcraft.io/docs/snapd-api#heading–find:~:text=%60snap-id%60,snap%20app%20attribute demonstrates that Snapcraft exposes an immutable package identifier.
I ask whether Flathub does for the same reasons explained at https://forum.snapcraft.io/t/can-i-install-a-package-using-its-snap-id/39053?u=beedellrokejulianloc — because in the case a package is renamed (like https://github.com/vector-im/.github/blob/1d586281f08885acaa0284598d3a5dfc32402767/profile/README.md#:~:text=our%20vector-im%20github%20organisation%20has%20been%20renamed%20to%20element-hq. occurs) the package name occasionally changes.
However, my automation code doesn’t need to be readable to the extent that it relies upon transient identifiers.