Hermitian K-theory for stable $$\infty $$-categories I: Foundations