From 632c9793927a30c4bca3c91888e66b369d732dfe Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 8 Jun 2026 04:22:49 +0900 Subject: feat(phase-c): resolve PhpMixed-conversion phase-b TODOs Implement the foundational PhpMixed conversion infrastructure (From, order-sensitive PartialEq matching PHP ===) and resolve the category-G phase-b TODOs that depend on it: - Fix VCS driver cache paths that discarded parsed JSON or diverged on null caches (svn/forgejo/gitlab/git-bitbucket/github). - Wire up real conversions previously stubbed or dropped: suggests platform config, audit ignore-severities, composer_repository search and ProviderInfo, class_loader prefix/classmap merges, locker lock diff comparison, advisory JSON serialization, SPDX license fields. - Make GenericRule take a typed ReasonData; populate RULE_ROOT_REQUIRE with the constraint and convert PhpMixed at the call sites. --- crates/shirabe/src/dependency_resolver/solver.rs | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/solver.rs') diff --git a/crates/shirabe/src/dependency_resolver/solver.rs b/crates/shirabe/src/dependency_resolver/solver.rs index def586a..28e1e7f 100644 --- a/crates/shirabe/src/dependency_resolver/solver.rs +++ b/crates/shirabe/src/dependency_resolver/solver.rs @@ -211,23 +211,13 @@ impl Solver { .is_empty() { let mut problem = Problem::new(); - let mut reason_data: IndexMap = IndexMap::new(); - reason_data.insert( - "packageName".to_string(), - PhpMixed::String(package_name.clone()), - ); - // TODO(phase-b): store the constraint inside reason_data; PhpMixed needs to - // accept a `dyn ConstraintInterface` wrapper. - reason_data.insert("constraint".to_string(), PhpMixed::Null); problem.add_rule(Rc::new(RefCell::new(Rule::Generic(GenericRule::new( Vec::new(), - PhpMixed::Int(rule::RULE_ROOT_REQUIRE), - PhpMixed::Array( - reason_data - .into_iter() - .map(|(k, v)| (k, Box::new(v))) - .collect(), - ), + rule::RULE_ROOT_REQUIRE, + rule::ReasonData::RootRequire { + package_name: package_name.clone(), + constraint: active_constraint.clone(), + }, ))))); self.problems.push(problem); } @@ -620,8 +610,8 @@ impl Solver { array_unshift::(&mut other_learned_literals, learned_literal); let new_rule = GenericRule::new( other_learned_literals, - PhpMixed::Int(rule::RULE_LEARNED), - PhpMixed::Int(why), + rule::RULE_LEARNED, + rule::ReasonData::Int(why), ); Ok((learned_literal, rule_level, new_rule, why)) -- cgit v1.3.1