This is my understanding, and your described algorithm is similar to what I do today in my Bazel rule set, rules_pycross.
I pre-define Python targets (os + machine + python impl/version), similarly to this proposal, and apply those to an imported Poetry or PDM lock file to construct an environment-specific lock file. The benefit to this approach is that you don’t necessarily have to go back to the index to add a new platform. The drawback, I suppose, is doing extra work at lock time (if I’m never going to target Windows, there’s no need to follow Windows-specific dependency paths).
For example, with this pdm.lock and a set of pre-defined environments, each of which looks something like this, I generate a lock file with entries like this (note: this is Bazel’s config language, Starlark, which is a subset of Python syntax).
I don’t generate a lock file per platform, but rather a single lock file with conditional dependencies per-platform when needed (which can be seen with the select
statement in the last link above).