[TIMOB-13987] Reworked the order in which the alloy hook is validated