From 86961b16b2f5c9c26a776193934d13ff87ab7fea Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 7 Jun 2026 13:37:11 +0900 Subject: refactor(phase-c): resolve shared-ownership TODOs via handle/Rc clones Resolve the resolvable subset of category A (shared ownership / non-cloneable PHP class) TODOs by leaning on values that are already shared behind Rc/handle wrappers, where cloning preserves PHP reference semantics: - solver: call IgnoreListPlatformRequirementFilter::filter_constraint with a cloned AnyConstraint (a Clone enum) and propagate the Result - update_command: filter PlatformRepository out of the repository manager's handles into a CompositeRepository (array_filter equivalent) - package_discovery_trait: pass the real platform_requirement_filter (Rc clone) instead of substituting ignore_nothing() - installation_manager: pass the original full operation list (Vec> clone) as all_operations - file_downloader: swap self.io to NullIO and restore via std::mem::replace - auditor: reuse the PackageInterfaceHandle list across the advisory and abandoned-package queries - process_executor: drop the unused, lossy Clone impl - config / array_repository: demote settled RefCell-design markers to comments Remaining category A items (factory installer wiring, purge_packages handle bridge, installer cache identity, reinstall flow, plugin command discovery) stay as TODOs since correct resolution needs structural refactors. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/advisory/auditor.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'crates/shirabe/src/advisory') diff --git a/crates/shirabe/src/advisory/auditor.rs b/crates/shirabe/src/advisory/auditor.rs index d50fe70..258099d 100644 --- a/crates/shirabe/src/advisory/auditor.rs +++ b/crates/shirabe/src/advisory/auditor.rs @@ -81,10 +81,8 @@ impl Auditor { ignore_unreachable: bool, ignore_abandoned: IndexMap>, ) -> Result { - // TODO(phase-b): packages is moved into get_matching_security_advisories; PHP keeps the - // original $packages alive — needs cloning/borrowing strategy for trait objects let result = repo_set.get_matching_security_advisories( - packages, + packages.clone(), format == Self::FORMAT_SUMMARY, ignore_unreachable, )?; @@ -96,9 +94,11 @@ impl Auditor { if format == Self::FORMAT_SUMMARY && self.needs_complete_advisory_load(&all_advisories, &ignore_list) { - // TODO(phase-b): $packages reused here; see note above - let result = - repo_set.get_matching_security_advisories(vec![], false, ignore_unreachable)?; + let result = repo_set.get_matching_security_advisories( + packages.clone(), + false, + ignore_unreachable, + )?; all_advisories = result.advisories; unreachable_repos.extend(result.unreachable_repos); } @@ -112,8 +112,7 @@ impl Auditor { if abandoned == Self::ABANDONED_IGNORE { abandoned_packages = vec![]; } else { - // TODO(phase-b): $packages reused here; see note above - abandoned_packages = self.filter_abandoned_packages(&[], &ignore_abandoned)?; + abandoned_packages = self.filter_abandoned_packages(&packages, &ignore_abandoned)?; if abandoned == Self::ABANDONED_FAIL { abandoned_count = abandoned_packages.len() as i64; } -- cgit v1.3.1