Commit Graph

3 Commits

Author SHA1 Message Date
freemo 3224f2136e fix(resource-registry): use full inheritance chain in contextual binding type compatibility
Replace the flat `parent_types` membership check in
`BindingResolutionService._is_type_compatible` with a call to
`self._registry.is_subtype_of()`, which uses
`resolve_inheritance_chain()` from `cleveragents.resource.inheritance`
to walk the full ADR-042 inheritance chain.

Previously, a tool requiring type `container-instance` would fail to
bind a `devcontainer-instance` resource because the check only looked
at the immediate `parent_types` list rather than traversing the full
chain.  The fix ensures multi-level inheritance (e.g.
`local/special-dev-container` → `devcontainer-instance` →
`container-instance`) is correctly resolved for contextual, static,
and parameter bindings.

Changes:
- `binding_resolution_service.py`: `_is_type_compatible` now delegates
  to `registry.is_subtype_of()`; removed unused `ResourceTypeSpec`
  import.
- `consolidated_binding_resolution.feature`: 4 new scenarios covering
  2-level chain, 3-level chain, unrelated-type rejection, and static
  binding via inheritance chain.
- `binding_resolution_steps.py`: mock registry exposes
  `is_subtype_of()` backed by the real inheritance engine; new step
  definitions for inheritance chain setup.

ISSUES CLOSED: #2929
2026-04-05 17:55:54 +00:00
freemo 79f91c51b1 Tests: ensuring tests have coverage and work. 2026-02-17 20:55:49 -05:00
freemo a4db605e1c feat(tool): add resource binding resolution 2026-02-17 20:55:46 -05:00