Puppet parses /etc/debian_version (which e.g. contains "11.5" on an up-to-date Bullseye system). Through the lifetime in which a Debian release is "testing" it reads e.g. "bookworm/sid" (and that gets changed only late in the freeze process, e.g. for Bullseye it happened four months before the eventual release).
This makes using testing with systems like Puppet tricky, which was also reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008735
And since base-files 12.3 there is now a new attribute being maintained for this purpose:
Add VERSION_CODENAME to /etc/os-release. Closes: #1008735. This still respects the fact that Debian distributions do not have a version number until they are actually released as stable, but makes /etc/os-release a little bit more useful for those who use testing as a pre-release for the next stable. Those users are also the reason why in this case we are simply using the string "bookworm".
This is exactly what we need, but since the change is very fresh (12.3 was uploaded less than four weeks ago), Puppet should probably follow a mixed scheme: If no specific version is found in /etc/debian_release there should probably be a lookup in /etc/os-release and if that contains VERSION_CODENAME this should map known distro names as a fallback:
bookworm -> 12.0
trixie -> 13.0
We should best work towards getting that changed upstream.