cursus.core.compiler.validation

Validation and preview classes for the Pipeline API.

This module provides classes for validating DAG-config compatibility and previewing resolution results before pipeline generation.

class ValidationResult(*, is_valid, missing_configs=<factory>, unresolvable_builders=<factory>, config_errors=<factory>, dependency_issues=<factory>, warnings=<factory>)[source]

Bases: BaseModel

Result of DAG-config compatibility validation.

is_valid: bool
missing_configs: List[str]
unresolvable_builders: List[str]
config_errors: Dict[str, List[str]]
dependency_issues: List[str]
warnings: List[str]
summary()[source]

Human-readable validation summary.

detailed_report()[source]

Detailed validation report with recommendations.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ResolutionPreview(*, node_config_map, config_builder_map, resolution_confidence, ambiguous_resolutions=<factory>, recommendations=<factory>)[source]

Bases: BaseModel

Preview of how DAG nodes will be resolved.

node_config_map: Dict[str, str]
config_builder_map: Dict[str, str]
resolution_confidence: Dict[str, float]
ambiguous_resolutions: List[str]
recommendations: List[str]
display()[source]

Display-friendly resolution preview.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ConversionReport(*, pipeline_name, steps, resolution_details, avg_confidence, warnings=<factory>, metadata=<factory>)[source]

Bases: BaseModel

Report generated after successful pipeline conversion.

pipeline_name: str
steps: List[str]
resolution_details: Dict[str, Dict[str, Any]]
avg_confidence: float
warnings: List[str]
metadata: Dict[str, Any]
summary()[source]

Summary of conversion results.

detailed_report()[source]

Detailed conversion report.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ValidationEngine[source]

Bases: object

Engine for validating DAG-config compatibility.

validate_dag_compatibility(dag_nodes, available_configs, config_map, builder_registry, metadata=None)[source]

Validate DAG-config compatibility.

Parameters:
  • dag_nodes (List[str]) – List of DAG node names

  • available_configs (Dict[str, Any]) – Available configuration instances

  • config_map (Dict[str, Any]) – Resolved node-to-config mapping

  • builder_registry (Dict[str, Any]) – Available step builders

  • metadata (Dict[str, Any] | None) – Optional pipeline metadata; its config_types map (node -> config class) records USER-AUTHORED node→config bindings. The node-vs-config cross-check honors it, so a deliberately off-convention node name explicitly mapped there is not flagged as a misresolution.

Returns:

ValidationResult with detailed validation information

Return type:

ValidationResult