Conversation
…Models.jl into breaking/ctmodels-0.7
…254) - Implement extract_solver_infos for generic SolverCore.AbstractExecutionStats - Add MadNLP extension for objective sign and status handling - Add comprehensive test suite (unit and integration) - Update Project.toml with weakdeps and extensions - Document new functionality in CHANGELOG and interfaces doc
- Add explicit registry architecture (11_explicit_registry_architecture.md) - Add action pattern analysis with 3-module proposal (12_action_pattern_analysis.md) - Add simplified solve.jl demonstrating new architecture (solve_simplified.jl) - Update existing docs to reflect explicit registry approach - Mark superseded documents (06, 07) Key decisions: - Explicit registry (passed as argument) instead of global mutable state - Strategy-based disambiguation: backend=(:sparse, :adnlp) - 3-module architecture proposal: Options, Strategies, Actions - 62% code reduction in solve.jl (~670 → ~250 lines)
- Add module dependencies architecture (13_module_dependencies_architecture.md) - Add action genericity analysis (14_action_genericity_analysis.md) - Add ideal solve.jl demonstrating final architecture (solve_ideal.jl) - Rename Actions module to Orchestration (clearer role) - Add renaming summary (15_renaming_summary.md) Key decisions: - 3-module architecture: Options → Strategies → Orchestration - Orchestration provides tools (routing, extraction) not magic dispatch - Each action implements its own mode detection - Generic routing: route_all_options() separates action vs strategy options
- Add OptionValue{T} struct for value+source tracking
- Add OptionSchema struct with validation and aliases support
- Implement extract_option and extract_options functions
- Add comprehensive test suite (122 tests passing)
- Include full documentation with docstrings
- Support Vector and NamedTuple schema interfaces
- Handle validation errors via CTBase.IncorrectArgument
- Add type checking with warnings for mismatches
BREAKING CHANGE: New Options module replaces legacy option handling
- Flatten Options module structure (no api/contract subdirs) - Move files directly to src/Options/ root level - Remove validation.jl (redundant with OptionSchema.validator) - Update include paths in Options.jl - Keep Options as simple utility module (types + extraction) This prepares for Strategies module to have proper contract/api structure while Options remains a lightweight toolkit.
…affolding - Create unified OptionDefinition type replacing OptionSchema and OptionSpecification - Implement StrategyMetadata with varargs constructor using OptionDefinition - Update extraction API to work with OptionDefinition - Scaffold complete Strategies module structure (contract/api) - Add comprehensive tests for OptionDefinition and StrategyMetadata - Remove legacy options_schema.jl file - Add documentation for OptionDefinition unification - Update module dependencies and exports This unifies the option system while maintaining clean separation between Options (extraction tools) and Strategies (contract definition) modules.
- Add and to OptionDefinition docstrings - Improve extraction API docstrings with OptionDefinition unification context - Add custom show method for OptionDefinition with aliases display - Simplify StrategyMetadata show method to use OptionDefinition display - Add comprehensive display tests for OptionDefinition and StrategyMetadata - Remove obsolete OptionSchema and OptionSpecification types and tests - Update StrategyMetadata to use Dict instead of NamedTuple for flexibility - Add audit reports for test coverage and documentation improvements
…tion - Refactor StrategyOptions to use OptionValue struct for provenance tracking - Update all tests to reflect new API with OptionValue instances - Update extraction API to use OptionDefinition instead of OptionSchema - Refine validator contract to use || throw pattern - Implement @error + rethrow() for better exception handling - Suppress @error logs in tests with redirect_stderr - Add comprehensive docstrings with DocStringExtensions macros - Add detailed documentation for StrategyMetadata indexability - Update abstract strategy contract to use id instead of symbol - Fix test expectations for original exception types - All tests passing with clean output
- Add StrategyRegistry struct with explicit passing architecture - Implement create_registry(), strategy_ids(), type_from_id() functions - Add comprehensive introspection API for strategy metadata - Refactor to remove instance overloads for metadata functions - Fix encapsulation by using StrategyMetadata public interface - Remove misplaced strategy_registry.jl from contract/ - Update module exports with organized categories Features: - Registry validation (ID uniqueness, type hierarchy) - Type-level introspection (option_names, option_type, etc.) - Instance-level state access (option_value, option_source, etc.) - Complete documentation with examples - SOLID principles compliance
- Implement complete test suite for StrategyRegistry (38 tests) * Registry creation with validation * strategy_ids() and type_from_id() lookups * Error handling for duplicate IDs, wrong hierarchy, unknown families * Display methods * Integration tests for multiple families and round-trips - Implement complete test suite for introspection API (70 tests) * Type-level metadata access (option_names, option_type, etc.) * Instance-level state access (option_value, option_source, etc.) * Provenance tracking predicates (is_user, is_default, is_computed) * Integration tests for consistency and workflows - Fix create_registry signature to accept abstract types from tests - Fix option_source to access OptionValue.source field directly - Update tests to expect FieldError instead of KeyError for NamedTuple All tests passing: 108/108 total (38 registry + 70 introspection)
Breaking change: OptionDefinition is now parameterized by default value type
## Changes
### Core refactoring
- Change OptionDefinition from non-parametric to OptionDefinition{T}
- default::Any → default::T for type stability
- Constructor automatically infers T from default value
- Special handling for nothing defaults (uses OptionDefinition{Any})
### API updates
- Update extract_options signature: Vector{OptionDefinition} → Vector{<:OptionDefinition}
- Add type-stable get(opts, Val(:key)) method to StrategyOptions
- Document type-unstable vs type-stable access patterns
### Tests
- Add comprehensive type stability tests (14 new tests)
- Test parametric type inference
- Test @inferred for type-stable access
- Test heterogeneous collections
- Test type narrowing in loops
- All 146 options tests passing
## Performance impact
- ~2.5x faster access to default values
- Zero allocation in type-stable paths
- Eliminates boxing in loops over defaults
## Migration
Existing code continues to work - constructor infers type automatically
- Refactor StrategyMetadata from Dict to NamedTuple for type stability
- Add parametric StrategyMetadata{NT <: NamedTuple} type
- Implement complete collection interface (getindex, keys, values, pairs, iterate)
- Add 10 type stability tests for StrategyMetadata
- Simplify Base.getindex with direct delegation to NamedTuple
- Update introspection tests to expect FieldError instead of KeyError
- Add comprehensive type stability tests (38 total across Options/Strategies)
- Update TODO report to reflect 70% completion of Strategies module
- Update type stability report with complete refactorization results
Performance improvements:
- 2.5x faster option access with zero allocations
- Type-stable metadata storage and access
- All core structures now type-stable (OptionDefinition, StrategyOptions, StrategyMetadata)
Tests: 295 total tests passing, 38 type stability tests validated
- Add strategy builders with method tuple support - Replace error() with CTBase.IncorrectArgument - Add development standards reference - All tests passing
- Add build_strategy_options with Options API integration - Add utilities: filter_options, suggest_options, levenshtein_distance - 99 tests passing (47 config + 52 utilities) - Update TODO.md: Strategies now 80% complete
Add comprehensive validation for AbstractStrategy contracts including: - Metadata-options consistency verification - Constructor behavior validation - Advanced test coverage (51 tests total) - Enhanced documentation and error messages - Support for edge cases and complex types
…updates - Update todo.md to reflect 85% completion of Strategies module - Add remaining_work_report.md: Detailed analysis of ~85% complete architecture - Add documentation_update_report.md: Professional plan for post-implementation docs Key findings: - Options: 100% complete (147 tests) - Strategies: 85% complete (~323 tests) - functionally complete - Orchestration: 0% complete (needs implementation) Documentation plan includes: - 20 new/updated files across 5 phases - Step-by-step tutorials for strategy creation - Migration guide from AbstractOCPTool to AbstractStrategy - Professional examples and API reference updates Estimated timeline: 2-3 weeks total
- Change triple backticks to quadruple backticks for code block examples - Fix markdown formatting to prevent rendering issues - Add proper spacing around code fences - Ensure proper markdown syntax for documentation templates
- Add complete Orchestration module with routing, disambiguation, and method builders - Implement route_all_options() with auto-routing and disambiguation support - Add extract_strategy_ids() for strategy-based disambiguation syntax - Add build_strategy_to_family_map() and build_option_ownership_map() helpers - Add method builder wrappers for strategy construction - Add comprehensive test suite: 79 tests covering all scenarios - Support single-strategy disambiguation: backend = (:sparse, :adnlp) - Support multi-strategy routing: backend = ((:sparse, :adnlp), (:cpu, :ipopt)) - Full CTBase exception handling with user-friendly error messages - Complete documentation with and examples - Update status reports: Tools architecture 100% complete (649 tests) - All modules production-ready with full standards compliance Results: - Options: 147 tests ✅ - Strategies: 323 tests ✅ - Orchestration: 79 tests ✅ - Total: 649 tests passing ✅
- Add comprehensive Orchestration routing guide - Add detailed routing examples with disambiguation - Separate public/private APIs for all modules - Reorganize documentation structure - Remove empty types.md file - Fix public=true, private=true confusion - Activate Orchestration module documentation
- Remove CTModels prefix from migrated module references - Update imports to use CTSolvers for migrated functionality - Fix test imports and references - Update extension exports and dependencies - Clean up remaining CTModels.* references to moved modules All tests pass after migration cleanup
Update version number for beta.1 release after migration cleanup
…and documentation
- initial_guess() is now pure construction (no validation) - build_initial_guess() validates ALL branches including direct AbstractOptimalControlInitialGuess - Fixed validation hole: direct InitialGuess passed to build_initial_guess was unchecked - Internal builders (_initial_guess_from_*) return without validation - Updated docstrings to reflect construction/validation separation - Added regression tests for the refactoring - All 147 tests pass This follows Single Responsibility Principle: - Construction functions only construct - build_initial_guess orchestrates construction + validation - validate_initial_guess provides explicit validation API
Refactoring completed with centralised validation in build_initial_guess. All 147 tests pass.
- Document InitialGuess validation architecture refactoring - Note that this is internal change with no user migration required - Highlight validation gap fix for direct InitialGuess inputs - All 147 tests passing, improved error detection
- Rename OptimalControlInitialGuess → InitialGuess - Rename OptimalControlPreInit → PreInitialGuess - Rename AbstractOptimalControlInitialGuess → AbstractInitialGuess - Update all related docstrings and documentation - Maintain backward compatibility through type aliases - Update all tests to use new type names - Improve API consistency and naming clarity This is a breaking change for type names but maintains functionality through aliases during transition period.
- Remove circular type alias AbstractModel = AbstractModel from OCP.jl - Remove corresponding documentation reference from index.md - Clean up unnecessary compatibility alias that was self-referential
- Add new builders.jl file for construction functions - Reorganize InitialGuess module structure for better clarity - Update exports and module organization - Update meta tests to reflect new structure - Improve code organization and maintainability
- Rename InitialGuess module → Init module - Rename OptimalControlPreInit → PreInitialGuess - Update all exports and imports - Update documentation references - Delete old InitialGuess directory structure - Create new Init module with consolidated structure - Update tests to use new module and type names - All 3146 tests passing This completes the module renaming for better API ergonomics.
Module renaming completed: - InitialGuess → Init module - OptimalControlPreInit → PreInitialGuess type - All tests passing (3146/3146) - Ready for merge to develop
- Document module renaming InitialGuess → Init - Document type renaming OptimalControlPreInit → PreInitialGuess - Add migration guide with code examples - Update breaking changes documentation - Include benefits and compatibility information
Major version bump for breaking API changes: - InitialGuess module → Init module - OptimalControlPreInit type → PreInitialGuess type - Requires user migration (see BREAKING.md) Ready for merge to develop as 0.9.0-beta
- CHANGELOG.md: update section title to 0.9.0-beta - BREAKING.md: update version references to 0.9.0-beta - Reflects major version bump for breaking API changes
- Update discretization_utils.jl docstrings to follow docstrings.md standards - Translate all French comments in solution.jl, test files - Replace 'nd' with 'multi' to avoid typos false positives - Improve code clarity for international contributors
- Update docs/api_reference.jl to use CTModels.Init instead of CTModels.InitialGuess
- Change path from InitialGuess/ to Init/ to match new module structure
- Fixes documentation build error: Cannot convert Type{CTModels.Init.InitialGuess} to Module
refactor: rename InitialGuess module to Init for better API ergonomics
Contributor
- Update CHANGELOG.md with 0.9.1 release notes - Document test/extras/ directory cleanup - Add 0.9.1 section to BREAKING.md (no breaking changes) - All public APIs remain unchanged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.