Files
cleveragents-core/features
HAL9000 715a5d9d78 fix(resources): resolve AmbiguousStep, wire registry context into _validate_model, add depth limit
- 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.
2026-06-05 23:20:31 -04:00
..