Reconstructing the predictive architecture of the mind and brain