Shepherdly: Predict Code Risk, Boost Resilience