> How would you quantify how much “what and why” has been defined?
Has been defined or needs to be? I'll assume the latter for sake of discussion.
When skeletal feature specifications can be coded against requirements such that stakeholders and engineers can have a meaningful discussion of the functional expectations (as captured by the specs), along with the engineers having enough understanding to perform impact analysis on the existing system (if any). This is usually an iterative process engaged before any significant implementation is undertaken.
Essentially, the upstream-processes I reference regard establishing a shared understanding. As such, most delivery metrics are not relevant at this point. However, an important benefit is that unneeded effort is often identified and not engaged.
> Some kind of diff between the planned architecture or requirements on day 0 and the final codebase?
In general, system architecture and code bases exist in the "how", not in the "what and why." At a macro (business) level, sometimes architecture decisions such as whether or not to use a cloud provider or data centers do influence the "what."
It's kind of like branching in a programming language. Typically, the earlier an execution flow is determined, the less are needed later. So, too, the sooner stakeholders clearly define "what and why", the less effort is needed to identify "how."