/** * Asserts a condition is truthy; throws with the given message otherwise. * Use to enforce invariants at runtime boundaries. */ export function assert(condition: unknown, message: string): asserts condition { if (!condition) { throw new Error(`Assertion failed: ${message}`) } }