Well, this sounds simple and obvious if both data model and applications are from the same developer.
But in a situation, where multiple applications may work on the same shared data, mistakes may destroy data.
Following the rule “every service has to protect itself” one could think of implementing s.th. like “schema validation” either in the applications themselves or in a thin layer around actual data - but Yjs providers are not prepared for that.
According to my current knowledge, the only solution would be to convert updates to (intermediate) docs, check them for validity and (if so) pass the updates to the actual data model - or ignore them otherwise.
This not only covers top-level entries but any part of shared data.