- Fix AmbiguousStep: rename step decorator from
'the creation should fail with "{fragment1}" or "{fragment2}"' to
'the creation should fail with either "{fragment1}" or "{fragment2}"'
so behave parse does not treat it as ambiguous with the single-arg form;
this was causing all 8 features to error on step load, failing CI.
- Wire registry into _validate_model(): add ValidationInfo parameter and
extract type_registry from Pydantic validation context so multi-level
cycle detection (A->B->A, A->B->C->A) runs through the production code
path, not just as a pre-creation standalone call.
- Update BDD steps to use ResourceTypeSpec.model_validate(..., context=
{"type_registry": registry}) instead of calling detect_inheritance_cycles
directly before construction, so tests validate the actual fix path.
- Add MAX_INHERITANCE_DEPTH = 100 constant and depth counter in
detect_inheritance_cycles() while loop to guard against DoS via
pathologically deep chains.
- Consolidate five separate import blocks from _resource_type_validation
into a single grouped import in resource_type.py.
- Add depth-limit scenario and step covering the new MAX_INHERITANCE_DEPTH
guard to ensure new lines are covered by diff-coverage.
- Fix unsorted imports in resource_type_inheritance_cycle_detection_steps.py (ruff I001)
- Add missing step definition for 'the creation should fail with "X" or "Y"' pattern
- Wire detect_inheritance_cycles() with registry in step definitions so multi-level
cycles (A→B→A, A→B→C→A) are properly detected during BDD test execution
- Add detect_inheritance_cycles() function to _resource_type_validation.py
- Function detects both direct self-inheritance (A→A) and multi-level cycles (A→B→A, A→B→C→A)
- Add BDD tests for cycle detection scenarios
- Tests cover direct self-inheritance, two-level cycles, three-level cycles, and valid chains