How to structure the codebase for data shape discoverability

Can you elaborate? Type annotations on dataclasses are not enforced at runtime, they’re basically documentation. Spec on the other hand has type restrictions and can be enforced at runtime if you want.

Or did you mean that Mypy solved the problem?