Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- feat(schema): Add ResultMerger class for combining phase results while maintaining output format consistency
- feat(schema): Comprehensive logging system for debugging two-phase execution with timing and rule counts
- feat(schema): Intelligent rule separation - automatically separate SCHEMA rules from other rule types for phased execution
- **feat(schema): Implement desired_type soft validation with compatibility analysis and rule generation**
- feat(schema): Add desired_type parsing support with extended TypeParser for complex type definitions
- feat(schema): Implement CompatibilityAnalyzer for intelligent type conversion analysis (COMPATIBLE/INCOMPATIBLE/CONFLICTING)
- feat(schema): Add DesiredTypeRuleGenerator for automatic validation rule creation based on compatibility analysis
- feat(schema): Generate LENGTH rules for precision/length reduction scenarios in type conversions
- feat(schema): Generate REGEX rules for string-to-numeric type conversion validation
- feat(schema): Generate DATE_FORMAT rules for date validation (MySQL support)
- feat(schema): Enhanced result merging with desired_type validation results integration
- feat(schema): Updated JSON and table output formats to display desired_type validation status
- feat(schema): Comprehensive error handling with clear distinction between schema vs desired_type failures
- feat(tests): Complete test coverage for desired_type validation including compatibility analysis and rule generation

### Changed
- enhance(cli): Updated schema command to support both syntactic sugar and detailed JSON type definitions
Expand All @@ -32,23 +43,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- refactor(schema): Added `_decompose_schema_payload_atomic()` for backward compatibility with single-list return format
- refactor(tests): Updated all schema-related test mocks to handle new tuple return format from rule decomposition
- improve(architecture): All validation maintains identical output format and behavior - no user-visible changes
- **enhance(schema): Extended two-phase execution framework with actual desired_type validation implementation**
- enhance(schema): DesiredTypePhaseExecutor now performs actual compatibility analysis and rule generation (no longer skip-only)
- enhance(schema): Enhanced type parser with full desired_type syntax support including complex type definitions
- enhance(validation): Intelligent compatibility matrix ensures optimal validation performance by skipping unnecessary checks
- enhance(output): Merged validation results clearly distinguish between schema structure validation and desired_type compatibility validation

### Fixed
- **fix(async): Resolved RuntimeError event loop management issue in two-phase execution**
- fix(async): Consolidated both validation phases into single event loop to prevent database connection pool conflicts
- fix(async): Eliminated multiple `asyncio.run()` calls that caused "Event loop is closed" errors in production
- fix(tests): Updated test contracts and mocks to work with new two-phase execution architecture
- **fix(sqlite): Implemented custom functions to solve SQLite regex compatibility limitations**
- fix(sqlite): Created comprehensive SQLite custom validation functions for precision and length validation
- fix(sqlite): Added `DETECT_INVALID_INTEGER_DIGITS`, `DETECT_INVALID_STRING_LENGTH`, `DETECT_INVALID_FLOAT_PRECISION` functions
- fix(sqlite): Automatic registration of custom functions via SQLAlchemy event listeners on connection establishment
- fix(database): Enhanced database dialect to intelligently use custom functions for SQLite regex replacement
- fix(validation): Seamless fallback from regex patterns to custom function calls for incompatible databases

### Removed
- None

### Architecture Notes
- **Two-Phase Execution Framework**: Implemented foundation for future desired_type compatibility analysis
- **Two-Phase Execution Framework**: Complete implementation with desired_type soft validation capabilities
- **Phase 1**: Schema rules execute first to collect native type information and validate table/column existence
- **Phase 2**: Additional rules execute with intelligent filtering based on schema analysis results (skip semantics)
- **Phase 2**: Desired_type compatibility analysis with automatic rule generation for incompatible type conversions
- **Compatibility Analysis**: Intelligent type conversion analysis (COMPATIBLE/INCOMPATIBLE/CONFLICTING) optimizes validation performance
- **Rule Generation**: Automatic LENGTH, REGEX, and DATE_FORMAT rule creation based on compatibility analysis results
- **Skip Logic**: Rules targeting missing tables/columns are automatically skipped to prevent cascading failures
- **Result Merging**: Synthetic results created for skipped rules to maintain consistent output format
- **Result Merging**: Unified results combining schema validation and desired_type validation with clear error distinction
- **Performance**: Current implementation optimizes for stability over concurrency - both phases execute serially within single event loop
- **Database Support**: DATE_FORMAT validation currently supports MySQL with planned SQLite/PostgreSQL support in Phase 4
- **SQLite Regex Compatibility**: Custom function implementation (`shared/database/sqlite_functions.py`) provides seamless regex replacement for SQLite databases that lack native regex support
- **Custom Function Architecture**: Automatic registration of `DETECT_INVALID_INTEGER_DIGITS`, `DETECT_INVALID_STRING_LENGTH`, and `DETECT_INVALID_FLOAT_PRECISION` functions via SQLAlchemy event listeners
- **Intelligent Fallback**: Database dialect automatically detects SQLite and converts regex patterns to equivalent custom function calls for precision/length validation

## [0.4.3] - 2025-09-06

Expand Down
Loading