pub fn check_depth(current_depth: usize, max_depth: usize) -> Result<(), Error>Expand description
Fail-closed depth check (resource bound, build-brief “a parent spawning
children spawning children… must not fork-bomb”): Err NAMES the
exceeded cap rather than silently clamping the depth or panicking.
current_depth is the SPAWNING agent’s own depth (0 for a top-level
agent); the new child would be spawned at current_depth + 1.