aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-semver/src/lib.rs
AgeCommit message (Collapse)Author
2026-02-23fix(semver): handle partial upper bounds in hyphen ranges per Composer specnsfisis
`parse_hyphen_range` was using `<=` for all upper bounds, but Composer treats partial versions (1-2 segments) differently: `8.1 - 8.5` should mean `>=8.1.0 <8.6.0-dev`, not `>=8.1.0 <=8.5.0`. This caused constraints like `php 8.1 - 8.5` to reject PHP 8.5.3. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22feat(semver): support `==` (double equals) version constraintnsfisis
Parse `==` as an exact match operator, identical to `=`. Previously the `=` handler would strip only one `=`, leaving `=1.2.3` which failed to parse as a version number. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22feat(resolver): replace pubgrub with Composer-ported SAT solvernsfisis
Add mozart-sat-resolver crate implementing a CDCL SAT-based dependency resolver ported from Composer's DependencyResolver. This replaces the pubgrub library to ensure identical resolution behavior with Composer. The new crate includes: pool (package storage with integer IDs), rule/rule_set/rule_set_generator (constraint encoding), decisions (assignment tracking), rule_watch_graph (2-watched literal BCP), solver (CDCL loop with conflict analysis and clause learning), policy (version preference), problem (Composer-style error messages), and transaction (install/update/uninstall operation computation). The registry resolver is rewritten to use PoolBuilder → RuleSetGenerator → Solver pipeline instead of pubgrub's DependencyProvider trait. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22fix(resolver): replace ComposerVersion(u16) with semver::Version(u64)nsfisis
ComposerVersion used u16 segments (max 65535), causing overflow for PHP extensions like ext-dom (version 20031129). The extension became invisible to the resolver, failing create-project with "depends on ext-dom" errors. Use mozart_semver::Version (u64 segments) directly as pubgrub's version type, eliminating the overflow and redundant conversion layer. Also fixes Ord for patch pre-releases (patch1 > stable) and adds Display impl required by pubgrub. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22refactor: reorganize crates to match Composer subpackage structurensfisis
Rename mozart-constraint to mozart-semver (mirrors composer/semver) and extract mozart-class-map-generator from mozart-autoload (mirrors composer/class-map-generator). No logic changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>