The requirement that both the matter and the geometry of a spacetime canonically evolve together, starting and ending on shared Cauchy surfaces and independently of the intermediate foliation, leaves one with little choice for diffeomorphism-invariant gravitational dynamics that can provide consistent evolution equations to the coefficients of a given system of matter field equations. Concretely, we show how starting from any linear local matter field equations whose principal polynomial satisfies three physicality conditions, one may calculate coefficient functions which then enter an otherwise immutable set of countably many linear homogeneous partial differential equations.Any solution of these so-called gravitational closure equations then provides a Lagrangian density for any type of tensorial geometry that features ultralocally in the initially specified matter Lagrangian density. Thus the given system of matter field equations is indeed closed by the so obtained gravitational equations. In contrast to previous work, we build the theory on a suitable associated bundle encoding the canonical configuration degrees of freedom, which allows to include necessary constraints on the geometry in practically tractable fashion. By virtue of the presented mechanism, one thus can practically calculate, rather than having to postulate, the gravitational theory that is required by specific matter field dynamics. For the special case of standard model matter one obtains general relativity. a Corresponding author. Electronic address fps@aei.mpg.de 1 arXiv:1611.08878v3 [gr-qc]