cursus.validation.script_testing.script_dependency_matcher¶
Two-Phase Script Dependency Resolution System
This module implements intelligent dependency resolution for script testing by directly reusing pipeline assembler patterns and dependency resolution algorithms from cursus/core.
The two-phase architecture: 1. Phase 1 (Prepare): Automatic dependency analysis using pipeline assembler patterns 2. Phase 2 (User Input): Interactive collection with auto-resolution and user override capability
Key Features: - Direct reuse of PipelineAssembler._propagate_messages() algorithm - Direct reuse of UnifiedDependencyResolver._calculate_compatibility() - Direct reuse of step catalog specification loading - Direct reuse of config-based extraction functions - User override capability for auto-resolved paths - 60-70% reduction in manual path specifications
- prepare_script_testing_inputs(dag, config_path, step_catalog)[source]¶
Phase 1: Automatic dependency analysis using pipeline assembler patterns.
DIRECT REUSE of PipelineAssembler._propagate_messages() algorithm.
- Parameters:
dag (PipelineDAG) – PipelineDAG defining script execution order and dependencies
config_path (str) – Path to configuration file for config-based extraction
step_catalog (StepCatalog) – For loading specifications and contracts
- Returns:
Prepared data structure containing dependency matches and config data
- Return type:
- collect_user_inputs_with_dependency_resolution(prepared_data)[source]¶
Phase 2: Interactive input collection with automatic dependency resolution.
Mirrors PipelineAssembler._propagate_messages() + StepBuilder._get_inputs() patterns.
- resolve_script_dependencies(dag, config_path, step_catalog, registry=None)[source]¶
SIMPLIFIED: Two-phase dependency resolution with optional registry integration.
When registry is provided, uses registry coordination for state management. When registry is None, uses legacy standalone mode for backward compatibility.
- Parameters:
dag (PipelineDAG) – PipelineDAG defining script execution order and dependencies
config_path (str) – Path to configuration file for config-based extraction
step_catalog (StepCatalog) – For loading specifications and contracts
registry – Optional ScriptExecutionRegistry for state coordination
- Returns:
Complete user inputs ready for script execution
- Return type:
- resolve_script_dependencies_with_registry(dag, config_path, step_catalog, registry)[source]¶
SIMPLIFIED: Registry-coordinated dependency resolution (delegates to main function).
This is now just a convenience wrapper that calls the main function with registry.
- Parameters:
dag (PipelineDAG) – PipelineDAG defining script execution order and dependencies
config_path (str) – Path to configuration file for config-based extraction
step_catalog (StepCatalog) – For loading specifications and contracts
registry – ScriptExecutionRegistry instance for state coordination
- Returns:
Complete user inputs ready for script execution
- Return type:
- validate_dependency_resolution_result(user_inputs)[source]¶
Validate the result of dependency resolution.
- get_dependency_resolution_summary(prepared_data, user_inputs)[source]¶
Generate a summary of the dependency resolution process.
- collect_user_inputs_with_registry_coordination(prepared_data, registry)[source]¶
SIMPLIFIED: Registry-coordinated Phase 2 input collection.
This function coordinates with the ScriptExecutionRegistry to enable message passing and state management during input collection.
- collect_manual_inputs_with_registry(dag, config_path, step_catalog, registry)[source]¶
REGISTRY-ONLY: Manual input collection through registry pattern.
This function provides the same functionality as ScriptTestingInputCollector but works entirely through the registry pattern, eliminating the need for dynamic imports.
- Parameters:
dag (PipelineDAG) – PipelineDAG defining script execution order and dependencies
config_path (str) – Path to configuration file for config-based extraction
step_catalog (StepCatalog) – For loading specifications and contracts
registry – ScriptExecutionRegistry instance for state coordination
- Returns:
Complete user inputs ready for script execution
- Return type: