From 87f5bcdc2d0e5fbec3848de3865d6c0d47d623ea Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 May 2026 13:17:04 +0900 Subject: fix(policy): prefer replaced original over replacer in cross-name pick MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors the `replaces()` shortcut in Composer's `DefaultPolicy::compareByPriority` (the cross-package `ignoreReplace=false` pass). When two candidates with different names both satisfy a request — say `update a/installed` finds the real `a/installed` package alongside an `a/replacer` declaring `replace: { "a/installed": "..." }` — the policy now picks the replaced original. Without this, the comparison falls through to the package-id tie-break and silently lands on whichever entry was inserted first (here, the replacer with the wrong source ref). Net effect on installer fixtures: `update_dev_ignores_providers` newly green. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/mozart/tests/installer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/mozart/tests') diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs index b4eb512..75ad3bf 100644 --- a/crates/mozart/tests/installer.rs +++ b/crates/mozart/tests/installer.rs @@ -391,7 +391,7 @@ installer_fixture!( ); installer_fixture!(update_allow_list_with_dependency_conflict, ignore); installer_fixture!(update_changes_url, ignore); -installer_fixture!(update_dev_ignores_providers, ignore); +installer_fixture!(update_dev_ignores_providers); installer_fixture!(update_dev_packages_updates_repo_url, ignore); installer_fixture!(update_dev_to_new_ref_picks_up_changes, ignore); installer_fixture!(update_downgrades_unstable_packages, ignore); -- cgit v1.3.1