From baa40325659a44938ad2e9ad6525ea3b3aaacfe2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 1 May 2026 21:55:09 +0900 Subject: fix(registry): accept composer.lock without content-hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Composer's `Locker` treats `content-hash` as optional with BC support (see Locker::isLocked() / isFresh() lines 142-147): if a lock predates the field — or, in the case of installer fixtures, deliberately omits it — Composer simply considers the lock "not fresh" against any composer.json. Mozart's deserializer was strict, rejecting the lock with `missing field content-hash` before any of the install-time checks could run. Default the field to empty via `#[serde(default)]`. With an empty hash, `is_fresh()` returns false (matching Composer's BC behavior, so the freshness warning still fires) and downstream code that overwrites `content_hash` continues to work unchanged. Closes the parsing barrier exercised by the updating-dev-from-lock-removes-old-deps installer fixture. Note: matching Composer's exact operations trace ("Upgrading a/devpackage …", alias-removal lines) requires a `compute_operations` that compares package source references — out of scope for this change and tracked in .ken/test_design.md §7.2 under "EXPECT (operations trace) 比較". Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/mozart/tests/installer.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/mozart') diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs index 5d83bac..314771c 100644 --- a/crates/mozart/tests/installer.rs +++ b/crates/mozart/tests/installer.rs @@ -791,10 +791,7 @@ installer_fixture!( update_without_lock, ignore = "mozart binary cannot yet run this fixture" ); -installer_fixture!( - updating_dev_from_lock_removes_old_deps, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(updating_dev_from_lock_removes_old_deps); installer_fixture!( updating_dev_updates_url_and_reference, ignore = "mozart binary cannot yet run this fixture" -- cgit v1.3.1