add runtime type-checking
we have added types in most of our code and check it with mypy, but these checks are not enforced at runtime. But since they are there, we don't usually code defensively to make sure that what we get actually matches the expected type.
We should add pydantic and check types at runtime as well, to make the code more robust. We should also check if this has a performance impact and, if so, if we can live with it.
Timeboxed. Check if this really works with runtime typechecking
If I am not mistaken we would add this decorator to all our functions/methods.
But the pydantic documentation says that is still in beta. So perhaps we want to wait for it to mature more?
There's also https://github.com/agronholm/typeguard and https://strongtyping.readthedocs.io/en/latest/
We probably don't want to add this to every method, but at least to all the commands (the interface to the outside world)