In the course of a proof, I need some version of Castelnuovo and Artin's contractibility criteria for a family of surfaces. Say I have a family (flat is probably needed, in order to compare intersection products as varying fibers) of surfaces $(\mathcal{X},\mathcal{B}) \rightarrow T$, where $\mathcal{B}_t \subset \mathcal{X}_t$ cuts either a $(-1)$-curve or some configuration of curves admitted by Artin's criterion for every fiber $t$. Assume that the configuration is independent of $t$. Then, I think some version of the contractibility criteria should hold. In particular, there should be an open subset $U \subset T$ such that I can perform Castelnuovo or Artin's contractions in family.

Just looking at the proof of the criteria for one fixed surface, it seems one can mimic the proofs to get a contraction in family (up to shrinking the base). My question are then the following.

Is this proved somewhere? If so, what is a reference?

If it is not proved, does it seems plausible? Are there some assumptions on the setup I should require in order for it to work?

If everything works as I expect, what is the obstruction (if any) to extend the contraction over the whole base $T$?

**Edit**

HYL's nice answer shows that what I am looking for is true in the category of complex manifolds. How about the algebraic one? I would like to claim I can get a scheme projective over $T $ (or what is left of it after shrinking).

**Further edit**

Doing some computations, Castelnuovo's criterion seems to work. On the other hand, extending Artin's criterion seems more subtle. Indeed, in the proof of the usual criterion, he needs to lift sections from a non reduced curve. Now, this may give some headache working in families, since the standard results that compare fibers (e.g. Hartshoner Chapter III.12) work well with irreducible fibers.

Is there maybe a version of Artin's criterion for excellent two dimensional schemes (or something similar)? This should work for the generic fiber, and then one could spread the contraction on an open neighborhood.