cursus.core.deps.dependency_resolver

Unified dependency resolver for intelligent pipeline dependency management.

This module provides the core dependency resolution logic that automatically matches step dependencies with compatible outputs from other steps.

class UnifiedDependencyResolver(registry, semantic_matcher)[source]

Bases: object

Intelligent dependency resolver using declarative specifications.

register_specification(step_name, spec)[source]

Register a step specification with the resolver.

resolve_all_dependencies(available_steps)[source]

Resolve dependencies for all registered steps.

Parameters:

available_steps (List[str]) – List of step names that are available in the pipeline

Returns:

Dictionary mapping step names to their resolved dependencies

Return type:

Dict[str, Dict[str, PropertyReference]]

resolve_step_dependencies(consumer_step, available_steps)[source]

Resolve dependencies for a single step.

Parameters:
  • consumer_step (str) – Name of the step whose dependencies to resolve

  • available_steps (List[str]) – List of available step names

Returns:

Dictionary mapping dependency names to property references

Return type:

Dict[str, PropertyReference]

resolve_with_scoring(consumer_step, available_steps)[source]

Resolve dependencies with detailed compatibility scoring.

Parameters:
  • consumer_step (str) – Name of the step whose dependencies to resolve

  • available_steps (List[str]) – List of available step names

Returns:

Dictionary with resolved dependencies and detailed scoring information

Return type:

Dict[str, Any]

get_resolution_report(available_steps)[source]

Generate a detailed resolution report for debugging.

Parameters:

available_steps (List[str]) – List of available step names

Returns:

Detailed report of resolution process

Return type:

Dict[str, Any]

clear_cache()[source]

Clear the resolution cache.

exception DependencyResolutionError[source]

Bases: Exception

Raised when dependencies cannot be resolved.

create_dependency_resolver(registry=None, semantic_matcher=None)[source]

Create a properly configured dependency resolver.

Parameters:
  • registry (SpecificationRegistry | None) – Optional specification registry. If None, creates a new one.

  • semantic_matcher (SemanticMatcher | None) – Optional semantic matcher. If None, creates a new one.

Returns:

Configured UnifiedDependencyResolver instance

Return type:

UnifiedDependencyResolver