cursus.validation.alignment.config

Validation Alignment Configuration Module

This module provides centralized configuration for the validation alignment system, controlling which validation levels are applied to different SageMaker step types.

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 UniversalMethodCategory(*values)[source]

Bases: Enum

Categories of universal methods that all builders must implement.

REQUIRED_ABSTRACT = 'required_abstract'
REQUIRED_OVERRIDE = 'required_override'
INHERITED_OPTIONAL = 'inherited_optional'
INHERITED_FINAL = 'inherited_final'
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.

examples: List[str] = None
level_4_validator_class: str | None = None
skip_reason: str | None = None
step_type: str
category: StepTypeCategory
enabled_levels: Set[ValidationLevel]
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.

get_universal_validation_rules()[source]

Get the universal builder validation rules.

Returns:

Dictionary containing all universal validation rules

Return type:

Dict[str, Any]

get_required_methods()[source]

Get only the required methods that all builders must implement.

Returns:

Dictionary of required methods with their specifications

Return type:

Dict[str, Any]

get_inherited_methods()[source]

Get the inherited methods from StepBuilderBase.

Returns:

Dictionary of inherited methods with their specifications

Return type:

Dict[str, Any]

get_validation_rules()[source]

Get the validation rules for universal builder compliance.

Returns:

Dictionary of validation rules and criteria

Return type:

Dict[str, Any]

validate_universal_compliance(builder_class)[source]

Validate that a builder class complies with universal rules.

Parameters:

builder_class (type) – The builder class to validate

Returns:

List of validation issues (empty if compliant)

Return type:

List[str]

get_step_type_validation_rules()[source]

Get all step-type-specific validation rules.

Returns:

Dictionary containing all step-type-specific validation rules

Return type:

Dict[str, Any]

get_validation_rules_for_step_type(step_type)[source]

Get validation rules for a specific step type.

Parameters:

step_type (str) – The SageMaker step type (e.g., “Training”, “Processing”)

Returns:

Dictionary of validation rules for the step type, or None if not found

Return type:

Dict[str, Any] | None

get_required_methods_for_step_type(step_type)[source]

Get required methods for a specific step type.

Parameters:

step_type (str) – The SageMaker step type

Returns:

Dictionary of required methods, empty if step type not found

Return type:

Dict[str, Any]

get_optional_methods_for_step_type(step_type)[source]

Get optional methods for a specific step type.

Parameters:

step_type (str) – The SageMaker step type

Returns:

Dictionary of optional methods, empty if step type not found

Return type:

Dict[str, Any]

get_all_methods_for_step_type(step_type)[source]

Get all methods (required + optional) for a specific step type.

Parameters:

step_type (str) – The SageMaker step type

Returns:

Dictionary combining required and optional methods

Return type:

Dict[str, Any]

get_step_types_by_category_specific(category)

Get all step types in a specific category.

Parameters:

category (StepTypeCategory) – The step type category

Returns:

List of step type names in the category

Return type:

List[str]

is_step_type_excluded_specific(step_type)

Check if a step type is excluded from validation.

Parameters:

step_type (str) – The SageMaker step type

Returns:

True if step type is excluded, False otherwise

Return type:

bool

get_step_type_category_specific(step_type)

Get the category for a step type.

Parameters:

step_type (str) – The SageMaker step type

Returns:

StepTypeCategory enum value, or None if step type not found

Return type:

StepTypeCategory | None

validate_step_type_compliance(builder_class, step_type)[source]

Validate that a builder class complies with step-type-specific rules.

Parameters:
  • builder_class (type) – The builder class to validate

  • step_type (str) – The SageMaker step type

Returns:

List of validation issues (empty if compliant)

Return type:

List[str]

get_validation_summary()[source]

Get a summary of all step types and their validation requirements.

Returns:

Dictionary with validation summary statistics

Return type:

Dict[str, Any]

Modules

step_type_specific_rules

Step-Type-Specific Builder Validation Rules

universal_builder_rules

Universal Builder Validation Rules

validation_ruleset

Unified Alignment Tester - Validation Ruleset Configuration