From 2af684c6397001944c9d9aac20ca59677d6a9650 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 May 2026 12:32:10 +0900 Subject: fix(install): emit MarkAliasUninstalled and fix dev-branch upgrade direction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two pieces of Composer's update-trace machinery were missing: 1. VersionParser::isUpgrade in Composer\Package\Version (which overrides the upstream Semver one) substitutes dev-master / dev-trunk / dev-default with the 9999999-dev default-branch alias, then returns true whenever either side starts with `dev-`. Mozart's is_upgrade compared via the generic version order, so dev-master → dev-foo came out as Downgrading. Port the override. 2. Transaction::calculateOperations seeds removeAliasMap from the currently-installed AliasPackages and emits MarkAliasUninstalled for every entry not covered by the new lock. Mozart never emitted those, so updating away from a branch-aliased package produced no trace line for the alias retirement. Walk installed.json's `extra.branch-alias` map, compare against the new lock's aliases[] block, and emit a MarkAliasUninstalled PackageOperation (a new variant on the executor surface — no filesystem effects, only the trace recorder cares). Unblocks update_alias, update_alias_lock2, and update_no_dev_still_resolves_dev installer fixtures. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/mozart-registry/src/installer_executor/filesystem.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crates/mozart-registry/src/installer_executor/filesystem.rs') diff --git a/crates/mozart-registry/src/installer_executor/filesystem.rs b/crates/mozart-registry/src/installer_executor/filesystem.rs index cceb5da..cb1a2cc 100644 --- a/crates/mozart-registry/src/installer_executor/filesystem.rs +++ b/crates/mozart-registry/src/installer_executor/filesystem.rs @@ -29,10 +29,11 @@ impl InstallerExecutor for FilesystemExecutor { op: PackageOperation<'_>, ctx: &ExecuteContext, ) -> anyhow::Result<()> { - // Marking an alias as installed has no filesystem side effects — - // the target package's files are already in vendor/. Mirrors - // Composer's `MarkAliasInstalledOperation` which the installation - // manager only uses to update the in-memory installed repository. + // Marking an alias as installed/uninstalled has no filesystem side + // effects — the target package's files are already in vendor/. + // Mirrors Composer's `MarkAlias{,Un}installedOperation` which the + // installation manager only uses to update the in-memory installed + // repository. let Some(pkg) = op.package() else { return Ok(()); }; -- cgit v1.3.1