This work establishes a connection between gravitational quantum cohomology
and enumerative geometry of rational curves (in a projective homogeneous v
ariety) subject to conditions of infinitesimal nature like, for example, ta
ngency. The key concept is that of modified psi classes, which are well sui
ted for enumerative purposes and substitute the tautological psi classes of
2D gravity. The main results are two systems of differential equations for
the generating function of certain top products of such classes. One is to
pological recursion while the other is Witten-Dijkgraaf-Verlinde-Verlinde.
In both cases, however, the background metric is not the usual Poincare met
ric but a certain deformation of it, which surprisingly encodes all the com
binatorics of the peculiar way modified psi classes restrict to the boundar
y. This machinery is applied to various enumerative problems, among which c
haracteristic numbers in any projective homogeneous variety, characteristic
numbers for curves with cusp, prescribed triple contact, or double points.