Replay is actually not the central issue. scm for a CpsScmFlowDefinition is not guaranteed to match the commit of Jenkinsfile. This is because it is using hudson.model.SCM, i.e., the old core APIs, which do not support checking out a specific version. In order to fix this we would have to actually deprecate CpsScmFlowDefinition and provide a replacement using scm-api so it would behave more like multibranch, except of course for a predefined branch.
Is this why, when I a given build of a given multi-branch pipeline job, the Jenkinsfile is checked out at the commit build I'm ing was at, however a checkout in the pipeline job does not get the same commit? Is it because the scm.branches doesn't point at the commit of the but rather points at the branch?
If so, this is pretty horrible. Shouldn't one be able to depend on the global scm variable containing an accurate representation of what is being checked out (implicitly)? Why does the implicit checkout get the right commit and yet an explicit checkout doesn't?