Add DefaultMaxExpansionDepth constant and depth tracking in expandStep to prevent runaway nested expansions. The limit applies to template children during expansion. Changes: - Add DefaultMaxExpansionDepth = 5 constant - Update expandStep to track depth and return error when exceeded - Update ApplyExpansions callers to handle errors - Add TestExpandStepDepthLimit test for depth limiting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>