I like your analogy about the cake and definitely respect your thought process there. The way I have gotten around this is that I (or another team member) always played the role of gate keeper / "integrator" to make sure the merging of branches went as smoothly as possible. Now we also had the benefit of full test suites to run, user stories to compare against, etc. but it seemed to work. The drawback is that as the "integrator" my actual development time would be cut in order to keep timelines met. However the plus was that I could question the dev's intentions maybe make some extra adjustment / cleaner code and ultimately produce a more maintainable code base. I also was never caught off guard about garbage coming in - ha.
Does anyone else use this sort of "integrator" role and seen these challenges / benefits?