Thank you for reporting a bug to Unity.
To quickly summarise, you are observing the correct behaviour:
* When the scrip is added you then see a new hash of the prefab with the script and default values
* The project browser inspector view of the prefab shows the 'in-memory' changes to the script's fields that were made during the post process callback (21, valid material), but these are not yet saved to disk
* The file on disk shows the default values in the YAML, and the prefab stage view reflects this
* Saving the dirty script (it's actively set dirty in the post process callback) saves the data to disk, and all views of the prefab show the updated values (21 etc)
The prefab stage always shows the on-disk version of the prefab, so in this case we are observing the correct behaviour. We understand it could be confusing to the user that the two inspector views don't show the same data.
We hope this helps explain why today we will be closing this case. Thank you again for taking the time to report this issue, and please let us know if there is anything else that changes the impact or severity of this issue.