cursus.registry.validation_utils¶
Simple validation utilities for step definition standardization.
This module provides lightweight validation for new step creation following the simplified approach from the redundancy analysis. It focuses on essential validation without over-engineering.
Based on: Hybrid Registry Standardization Enforcement Implementation Plan Redundancy Target: 15-20% (vs 30-35% in original design) Implementation Size: ~50-100 lines (vs 1,200+ in original design)
- validate_new_step_definition(step_data)[source]¶
Validate new step definition with essential checks only.
This function provides the core validation logic identified as essential in the redundancy analysis, focusing on preventing naming violations during new step creation. Optimized for <1ms performance.
- auto_correct_step_definition(step_data)[source]¶
Auto-correct step definition with simple regex-based fixes.
This function applies the simple auto-correction approach identified in the redundancy analysis, using regex patterns to fix common naming violations.
- to_pascal_case(text)[source]¶
Convert text to PascalCase using simple regex patterns.
This utility function provides the essential PascalCase conversion identified as necessary in the redundancy analysis. Optimized with LRU cache for performance.
- get_validation_errors_with_suggestions(step_data)[source]¶
Get validation errors with helpful suggestions and examples.
This function provides the clear error messages with examples identified as essential for developer experience in the redundancy analysis.
- register_step_with_validation(step_name, step_data, existing_steps, mode='warn')[source]¶
Register step with simple standardization validation.
This function provides the minimal registry integration identified as essential in the redundancy analysis.
- Parameters:
- Returns:
List of warnings/messages
- Raises:
ValueError – If validation fails in strict mode
- Return type:
- create_validation_report(step_name, step_data, validation_mode='warn')[source]¶
Create a comprehensive validation report for a step definition.
This function provides simple error reporting functionality identified as essential in Phase 2 of the implementation plan.