This commit marks the initial release of ChzEx, a comprehensive configuration
management library for Elixir, ported from OpenAI's chz Python library. This
release establishes the core architecture and feature set required for building
composable, type-safe command-line interfaces.
Key features implemented in this release include:
1. Schema Definition System
Introduced ChzEx.Schema macro for defining typed configuration structs.
Supports primitive types, nested embeds (one/many), and default values.
Integrates with Ecto changesets for robust data validation.
2. Blueprint and Construction Pipeline
Implemented the Blueprint pattern to decouple configuration definition from
instantiation. This includes the ArgumentMap for layered argument storage
and a Lazy evaluation engine that handles dependency resolution, parameter
references, and cycle detection during construction.
3. CLI Argument Parsing
Added a parser capable of handling standard key=value arguments, dotted
paths for nested fields (e.g., model.layers=12), and special syntax for
references (key@=source) and wildcards (...key=value).
4. Polymorphism and Factories
Implemented a registry-based system for polymorphic configuration. This
allows runtime selection of concrete types for embedded fields using
string identifiers, supported by a standard factory implementation.
5. Advanced Configuration Features
- Wildcard matching for setting multiple fields simultaneously.
- Parameter references for dynamic value linking within the config tree.
- Validation hooks for field-level and struct-level constraints.
- Mungers for post-initialization value transformation.
6. Documentation and Examples
Added comprehensive documentation including guides for getting started,
CLI parsing, and polymorphism. Included a suite of 10 fully functional
examples in the examples/ directory demonstrating various use cases.
7. Infrastructure and Testing
Established the project structure with Mix configuration, dependencies,
and GitHub Actions CI for automated testing and static analysis. Added a
complete test suite covering all core modules to ensure behavior parity
with the reference implementation.