cursus.validation.alignment.config.validation_ruleset

Unified Alignment Tester - Validation Ruleset Configuration

This module defines validation rules for different SageMaker step types, controlling which validation levels are applied and how they behave.

class ValidationLevel(*values)[source]

Bases: Enum

The 3 validation BOUNDARIES — what construction can’t self-check (FZ 31e1d3h / Phase D5).

The unified .step.yaml made Contract<->Spec alignment a construction-time Pydantic invariant (StepInterface._sync_and_align), so the former Level-2 (CONTRACT_SPEC=2) validated a tautology and has been removed. The three surviving levels are renamed in SEMANTICS to the 3 boundaries — SCRIPT_CONTRACT is the Script<->Interface fidelity boundary (B1), SPEC_DEPENDENCY is the cross-step DAG-resolvability boundary (B2, which now also owns the SageMaker property-path check folded in from the old L2), and BUILDER_CONFIG is the registry<->handler<->config binding boundary (B3). The member NAMES + integer VALUES are kept (1/3/4, non-contiguous) so ValidationLevel(1/3/4) coercion and every existing reference keep working; only CONTRACT_SPEC (value 2) is gone.

SCRIPT_CONTRACT = 1
SPEC_DEPENDENCY = 3
BUILDER_CONFIG = 4
class StepTypeCategory(*values)[source]

Bases: Enum

Categories of step types based on validation requirements.

SCRIPT_BASED = 'script_based'
CONTRACT_BASED = 'contract_based'
NON_SCRIPT = 'non_script'
CONFIG_ONLY = 'config_only'
EXCLUDED = 'excluded'
class ValidationRuleset(step_type, category, enabled_levels, level_4_validator_class=None, skip_reason=None, examples=None)[source]

Bases: object

Validation ruleset for a specific step type.

step_type: str
category: StepTypeCategory
enabled_levels: Set[ValidationLevel]
level_4_validator_class: str | None = None
skip_reason: str | None = None
examples: List[str] = None
get_validation_ruleset(sagemaker_step_type)[source]

Get validation ruleset for a SageMaker step type.

is_validation_level_enabled(sagemaker_step_type, level)[source]

Check if a validation level is enabled for a step type.

get_enabled_validation_levels(sagemaker_step_type)[source]

Get all enabled validation levels for a step type.

get_level_4_validator_class(sagemaker_step_type)[source]

Get the Level 4 validator class for a step type.

is_step_type_excluded(sagemaker_step_type)[source]

Check if a step type is excluded from validation.

get_step_types_by_category(category)[source]

Get all step types in a specific category.

get_all_step_types()[source]

Get all configured step types.

validate_step_type_configuration()[source]

Validate the configuration for consistency issues.

get_validation_ruleset_for_step_name(step_name, workspace_id=None)[source]

Get validation ruleset for a step name using registry integration.

is_validation_level_enabled_for_step_name(step_name, level, workspace_id=None)[source]

Check if a validation level is enabled for a step name using registry integration.

get_enabled_validation_levels_for_step_name(step_name, workspace_id=None)[source]

Get all enabled validation levels for a step name using registry integration.

is_step_name_excluded(step_name, workspace_id=None)[source]

Check if a step name is excluded from validation using registry integration.