Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Keep the files of an app Peel saw go with that app

Țugui Dragoșfb214334a1f9
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md
index a94d8d64..9905272a 100644
--- a/ARCHITECTURE.md
+++ b/ARCHITECTURE.md
@@ -76,7 +76,8 @@ Take the most common case, uninstalling an app. Every other page follows the sam
by the program it runs, since anyone can name its file: a job that runs a program inside the app is the
app's, and one that runs a program inside another installed app is that app's. The answer is a
`LeftoverMatch`: a confidence (`certain`, `likely`, or `possible`), the reason, the other installed apps that
- claim the file too (with the apps of the same maker that macOS knows outside the Applications folders), the
+ claim the file too (with the apps of the same maker that macOS knows outside the Applications folders, and the
+ apps Peel saw installed before, whose identifiers stay theirs once they are gone), the
other copies of the app that use it (any macOS knows, wherever they are, named by their place), and, when Peel
holds it back, why (`HoldBack`).
3. **Measure.** `FileSize` walks each folder on a thread of its own, with a time budget. A size is what moving
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Commands/FileCommands.swift b/Packages/PeelCore/Sources/PeelCommandLine/Commands/FileCommands.swift
index 83b1c61c..eaa811f7 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Commands/FileCommands.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Commands/FileCommands.swift
@@ -86,6 +86,7 @@ struct OrphansCommand: AsyncParsableCommand {
group,
in: scan,
apps: apps,
+ remembered: remembered,
scanner: scanner,
using: TrashService(exclusions: exclusions)
)
@@ -159,6 +160,7 @@ struct OrphansCommand: AsyncParsableCommand {
_ identifier: String,
in scan: OrphanScan,
apps: [InstalledApp],
+ remembered: [RememberedApp],
scanner: OrphanScanner,
using service: TrashService,
recordingIn log: RemovalLog = RemovalLog(),
@@ -196,6 +198,7 @@ struct OrphansCommand: AsyncParsableCommand {
return await OrphanRemoval.trash(
items.filter { wanted.contains($0.url) },
installedApps: apps,
+ remembered: remembered,
scanner: scanner,
using: service,
mayUseHelper: false
diff --git a/Packages/PeelCore/Sources/PeelCore/Apps/AppMemory.swift b/Packages/PeelCore/Sources/PeelCore/Apps/AppMemory.swift
index 0ba090a0..2a3ee61f 100644
--- a/Packages/PeelCore/Sources/PeelCore/Apps/AppMemory.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Apps/AppMemory.swift
@@ -36,13 +36,17 @@ public struct AppMemory: Sendable {
self.url = url
}
- public static var defaultURL: URL {
- PeelFolder.url.appending(path: "apps.json")
+ public static var defaultURL: URL { url(inHome: .homeDirectory) }
+
+ static func url(inHome home: URL) -> URL {
+ PeelFolder.url(inHome: home).appending(path: "apps.json")
}
@concurrent
public func load() async -> [RememberedApp] {
- FileLock.whileHeld(beside: url) { read() } ?? []
+ // Taking the lock makes its file and folder, and a read must leave a home as it found it.
+ guard !url.isMissing else { return [] }
+ return FileLock.whileHeld(beside: url) { read() } ?? []
}
/// Records the apps currently installed, keeping every app seen before. Reading, merging, and writing happen
diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverMatcher.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverMatcher.swift
index 241610b2..2218a8cc 100644
--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverMatcher.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverMatcher.swift
@@ -222,6 +222,7 @@ extension LeftoverMatcher {
let reason: MatchReason
let confidence: MatchConfidence
let rank: Int
+ let specificity: Int
let family: Family
/// An identifier that is only a word, such as `notes`, which a folder of anybody's could be called.
let isAWord: Bool
@@ -230,6 +231,7 @@ extension LeftoverMatcher {
self.reason = reason
self.confidence = confidence
isAWord = false
+ self.specificity = specificity
rank = Self.tier(of: reason) * 10_000 + specificity
family = switch reason {
case .bundleIdentifier, .embeddedBundleIdentifier, .applicationGroup, .bundleIdentifierPrefix,
@@ -247,7 +249,8 @@ extension LeftoverMatcher {
self.reason = reason
confidence = .likely
isAWord = !candidate.key.contains(".")
- rank = Self.tier(of: .name) * 10_000 + candidate.normalized.count
+ specificity = candidate.normalized.count
+ rank = Self.tier(of: .name) * 10_000 + specificity
family = .name
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift
index fc88e511..4e62ef7d 100644
--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift
@@ -46,7 +46,17 @@ public struct LeftoverScanner: Sendable {
/// outright. So are the apps macOS knows outside the list that may use the same files (`appsElsewhere`).
func matcher(for app: InstalledApp, installedApps: [InstalledApp]) async -> LeftoverMatcher {
let known = installedApps + (await AppCatalog.systemApps.value)
- return LeftoverMatcher(app: app, installedApps: known + (await appsElsewhere(like: app, besides: known)))
+ // An app Peel saw installed is an app of its own once it is gone too, not a helper of this one.
+ let remembered = await AppMemory(url: AppMemory.url(inHome: environment.homeDirectory)).load()
+ let places = Dictionary(
+ remembered.map {
+ ($0.bundleIdentifier.lowercased(), URL(filePath: $0.lastPath, directoryHint: .isDirectory))
+ },
+ uniquingKeysWith: { first, _ in first }
+ )
+ return LeftoverMatcher(app: app, installedApps: known + (await appsElsewhere(like: app, besides: known))) {
+ AppInspector.applicationURL(forBundleIdentifier: $0) ?? places[$0.lowercased()]
+ }
}
/// The apps macOS knows, outside `known`, that may use `app`'s files: every other copy of it, such as an older one
diff --git a/Packages/PeelCore/Sources/PeelCore/Orphans/AppOwnership.swift b/Packages/PeelCore/Sources/PeelCore/Orphans/AppOwnership.swift
index 1a7fd386..aed5a0f4 100644
--- a/Packages/PeelCore/Sources/PeelCore/Orphans/AppOwnership.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Orphans/AppOwnership.swift
@@ -2,10 +2,17 @@ import Foundation
struct AppOwnership: Sendable {
private let profiles: [LeftoverMatcher.Profile]
+ private let goneApps: [String]
private let isRegisteredApp: @Sendable (String) -> Bool
- init(installedApps: [InstalledApp], isRegisteredApp: @escaping @Sendable (String) -> Bool) {
+ /// `goneApps` are the identifiers of the apps Peel saw installed that are gone.
+ init(
+ installedApps: [InstalledApp],
+ goneApps: [String] = [],
+ isRegisteredApp: @escaping @Sendable (String) -> Bool
+ ) {
profiles = installedApps.map(LeftoverMatcher.Profile.init)
+ self.goneApps = goneApps.map { $0.lowercased() }
self.isRegisteredApp = isRegisteredApp
}
@@ -17,14 +24,27 @@ struct AppOwnership: Sendable {
if candidates[0].key != identifier.lowercased() {
candidates.append(LeftoverMatcher.Candidate(identifier))
}
- if profiles.contains(where: { profile in candidates.contains { profile.evidence(for: $0) != nil } }) {
+ // An identifier that was a gone app's own is that app's: a shorter prefix of it or its maker claims nothing.
+ let gone = goneApp(owning: identifier)
+ let claims = { (evidence: LeftoverMatcher.Evidence) in
+ guard let gone else { return true }
+ switch evidence.reason {
+ case .bundleIdentifierPrefix: return evidence.specificity > gone.count + 1
+ case .teamIdentifier, .vendorPrefix, .namePrefix: return false
+ default: return true
+ }
+ }
+ if profiles.contains(where: { profile in
+ candidates.contains { profile.evidence(for: $0).map(claims) ?? false }
+ }) {
return true
}
// macOS knows an app by its bundle identifier, never by a container's name with a team or `group.` in front.
// A Safari web app's identifier is Safari's web app template followed by its own UUID, and that template, an
// app Launch Services knows, is no owner of the web app's files.
var components = OrphanScanner.groupingKey(for: identifier).split(separator: ".")
- let shortest = SafariWebApp.isIdentifier(identifier) ? components.count : 3
+ let shortest = SafariWebApp.isIdentifier(identifier)
+ ? components.count : max(3, gone.map { $0.split(separator: ".").count } ?? 3)
while components.count >= shortest {
if isRegisteredApp(components.joined(separator: ".")) {
return true
@@ -34,6 +54,12 @@ struct AppOwnership: Sendable {
return false
}
+ /// The longest identifier of a gone app that `identifier` is, or begins with before a dot.
+ private func goneApp(owning identifier: String) -> String? {
+ let key = OrphanScanner.groupingKey(for: identifier).lowercased()
+ return goneApps.filter { key == $0 || key.hasPrefix($0 + ".") }.max { $0.count < $1.count }
+ }
+
static func launchServicesKnowsApp(withBundleIdentifier identifier: String) -> Bool {
AppInspector.applicationURL(forBundleIdentifier: identifier) != nil
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanRemoval.swift b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanRemoval.swift
index 04cfe758..16958b5b 100644
--- a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanRemoval.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanRemoval.swift
@@ -8,11 +8,12 @@ public enum OrphanRemoval {
public static func trash(
_ items: [OrphanItem],
installedApps: [InstalledApp],
+ remembered: [RememberedApp],
scanner: OrphanScanner,
using trashService: TrashService,
mayUseHelper: Bool
) async -> TrashResult {
- let orphaned = await scanner.stillOrphaned(items, installedApps: installedApps)
+ let orphaned = await scanner.stillOrphaned(items, installedApps: installedApps, remembered: remembered)
let kept = Set(orphaned.map(\.url))
let privileged = Set(orphaned.filter(\.requiresPrivileges).map(\.url))
let moving = mayUseHelper ? orphaned.map(\.url) : orphaned.map(\.url).filter { !privileged.contains($0) }
diff --git a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift
index 549fc016..ddab783b 100644
--- a/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Orphans/OrphanScanner.swift
@@ -55,14 +55,12 @@ public struct OrphanScanner: Sendable {
owners: [String: String] = [:]
) async -> OrphanScan {
let systemApps = if let systemApps { systemApps } else { await AppCatalog.systemApps.value }
- // `remembered` also holds the apps installed now, and only an app that is gone can have left files behind.
- let listed = Set(installedApps.map { $0.bundleIdentifier.lowercased() })
- let unlisted = remembered.filter { !listed.contains($0.bundleIdentifier.lowercased()) }
- let outOfSight = unlisted.compactMap { $0.stillInstalled() }
- let installedApps = installedApps + outOfSight
- let here = listed.union(outOfSight.map { $0.bundleIdentifier.lowercased() })
- let gone = unlisted.filter { !here.contains($0.bundleIdentifier.lowercased()) }
- let ownership = AppOwnership(installedApps: installedApps + systemApps, isRegisteredApp: isRegisteredApp)
+ let (installedApps, gone) = Self.split(remembered, installedApps: installedApps)
+ let here = Set(installedApps.map { $0.bundleIdentifier.lowercased() })
+ let goneApps = gone.map { $0.bundleIdentifier.lowercased() }
+ let ownership = AppOwnership(
+ installedApps: installedApps + systemApps, goneApps: goneApps, isRegisteredApp: isRegisteredApp
+ )
let jobs = BackgroundItemOwnership(installedApps: installedApps + systemApps)
let goneBundles = Dictionary(
gone.map {
@@ -74,7 +72,6 @@ public struct OrphanScanner: Sendable {
uniquingKeysWith: { first, _ in first }
)
- let goneApps = gone.map { $0.bundleIdentifier.lowercased() }
let goneNames = Dictionary(
gone.map { ($0.name.lowercased(), $0.bundleIdentifier) },
uniquingKeysWith: { first, _ in first }
@@ -138,11 +135,32 @@ public struct OrphanScanner: Sendable {
)
}
- /// Checks `items` again against `installedApps` and returns the ones that are still orphaned.
+ /// The apps installed now, with those `remembered` holds that are only out of sight, and the remembered apps
+ /// that are gone. `remembered` also holds the apps installed now, and only an app that is gone can have left
+ /// files behind.
+ static func split(
+ _ remembered: [RememberedApp], installedApps: [InstalledApp]
+ ) -> (installed: [InstalledApp], gone: [RememberedApp]) {
+ let listed = Set(installedApps.map { $0.bundleIdentifier.lowercased() })
+ let unlisted = remembered.filter { !listed.contains($0.bundleIdentifier.lowercased()) }
+ let outOfSight = unlisted.compactMap { $0.stillInstalled() }
+ let here = listed.union(outOfSight.map { $0.bundleIdentifier.lowercased() })
+ return (installedApps + outOfSight, unlisted.filter { !here.contains($0.bundleIdentifier.lowercased()) })
+ }
+
+ /// Checks `items` again against `installedApps` and the apps Peel remembers, and returns the ones that are still
+ /// orphaned.
@concurrent
- public func stillOrphaned(_ items: [OrphanItem], installedApps: [InstalledApp]) async -> [OrphanItem] {
+ public func stillOrphaned(
+ _ items: [OrphanItem], installedApps: [InstalledApp], remembered: [RememberedApp]
+ ) async -> [OrphanItem] {
let systemApps = if let systemApps { systemApps } else { await AppCatalog.systemApps.value }
- let ownership = AppOwnership(installedApps: installedApps + systemApps, isRegisteredApp: isRegisteredApp)
+ let (installedApps, gone) = Self.split(remembered, installedApps: installedApps)
+ let ownership = AppOwnership(
+ installedApps: installedApps + systemApps,
+ goneApps: gone.map { $0.bundleIdentifier },
+ isRegisteredApp: isRegisteredApp
+ )
let jobs = BackgroundItemOwnership(installedApps: installedApps + systemApps)
var kept: [OrphanItem] = []
for item in items {
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/FileCommandTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/FileCommandTests.swift
index 2cd5ca63..b8f88599 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/FileCommandTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/FileCommandTests.swift
@@ -285,7 +285,10 @@ struct FileCommandTests {
await #expect(throws: CommandFailure.self) {
try await (command(["orphans", "--remove", "com.example.gone", "-y"]) as OrphansCommand)
- .clean("com.example.gone", in: scan, apps: [], scanner: scanner(in: directory), using: try service(in: directory))
+ .clean(
+ "com.example.gone", in: scan, apps: [], remembered: [], scanner: scanner(in: directory),
+ using: try service(in: directory)
+ )
}
}
@@ -305,6 +308,7 @@ struct FileCommandTests {
"COM.EXAMPLE.GONE",
in: scan,
apps: [],
+ remembered: [],
scanner: scanner(in: directory),
using: try service(in: directory),
recordingIn: logs.removals,
@@ -329,7 +333,7 @@ struct FileCommandTests {
await #expect(throws: ExitCode.failure) {
try await (command(["orphans", "--remove", "com.example.gone", "-y"]) as OrphansCommand).clean(
- "com.example.gone", in: scan, apps: [], scanner: scanner(in: directory), using: service,
+ "com.example.gone", in: scan, apps: [], remembered: [], scanner: scanner(in: directory), using: service,
recordingIn: logs.removals, refusals: logs.refusals
)
}
@@ -356,6 +360,7 @@ struct FileCommandTests {
"com.example.gone",
in: scan,
apps: [],
+ remembered: [],
scanner: scanner(in: directory),
using: try service(in: directory),
recordingIn: logs.removals,
@@ -387,6 +392,7 @@ struct FileCommandTests {
"com.example.gone",
in: scan,
apps: [],
+ remembered: [],
scanner: scanner(in: directory),
using: try service(in: directory),
recordingIn: logs.removals,
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
index c45d6608..00c2eb9e 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
@@ -1176,6 +1176,24 @@ struct LeftoverScannerTests {
#expect(scan.leftovers.allSatisfy { $0.kind == .frameworks })
}
+ @Test func filesOfAnAppPeelSawGoAreNotTakenForAnAppWhoseIdentifierBeginsTheirs() async throws {
+ let directory = try TemporaryDirectory()
+ let environment = environment(in: directory)
+ try directory.file("home/Library/Caches/org.example.solo.nightly/cache.db")
+ try directory.file("home/Library/Caches/org.example.solo.helper/cache.db")
+ let solo = InstalledApp(url: URL(filePath: "/Applications/Solo.app"), bundleIdentifier: "org.example.solo", name: "Solo")
+ let nightly = InstalledApp(
+ url: directory.url.appending(path: "Solo Nightly.app"), bundleIdentifier: "org.example.solo.nightly", name: "Solo Nightly"
+ )
+ await AppMemory(url: AppMemory.url(inHome: environment.homeDirectory)).remember([nightly])
+
+ let scan = await LeftoverScanner(environment: environment).scan(solo, installedApps: [solo])
+ let found = Dictionary(uniqueKeysWithValues: scan.leftovers.map { ($0.url.lastPathComponent, $0.match) })
+
+ #expect(found["org.example.solo.nightly"]?.sharedWith == ["org.example.solo.nightly"])
+ #expect(found["org.example.solo.helper"]?.isRecommended == true)
+ }
+
/// A launchd job is named by whoever wrote it, so a job whose program sits inside the app is the app's,
/// whatever its file is called. That match is certain and outranks a weaker match on the file name.
@Test func findsAJobByTheProgramItRuns() async throws {
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/OrphanRemovalTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/OrphanRemovalTests.swift
index 1f4d9480..5b36c33a 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/OrphanRemovalTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/OrphanRemovalTests.swift
@@ -25,6 +25,7 @@ struct OrphanRemovalTests {
let result = await OrphanRemoval.trash(
listed,
installedApps: [back],
+ remembered: [],
scanner: scanner,
using: trash,
mayUseHelper: true
@@ -64,6 +65,7 @@ struct OrphanRemovalTests {
let result = await OrphanRemoval.trash(
listed,
installedApps: [],
+ remembered: [],
scanner: scanner,
using: trash,
mayUseHelper: false
@@ -73,7 +75,9 @@ struct OrphanRemovalTests {
#expect(result.failures.map(\.url) == privileged)
#expect(result.failures.allSatisfy { $0.reason == .needsHelper })
- _ = await OrphanRemoval.trash(listed, installedApps: [], scanner: scanner, using: trash, mayUseHelper: true)
+ _ = await OrphanRemoval.trash(
+ listed, installedApps: [], remembered: [], scanner: scanner, using: trash, mayUseHelper: true
+ )
#expect(helperWasAsked.withLock { $0 } == privileged)
}
}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
index b9b11cba..6ddf3d2f 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
@@ -283,7 +283,7 @@ struct OrphanScannerTests {
#expect(listed.count == 3)
let back = InstalledApp(url: URL(filePath: "/Applications/Back.app"), bundleIdentifier: "com.back.again", name: "Back")
- let still = await scanner.stillOrphaned(listed, installedApps: installed + [back])
+ let still = await scanner.stillOrphaned(listed, installedApps: installed + [back], remembered: [])
#expect(still.map(\.url.lastPathComponent) == ["com.gone.app"])
}
@@ -312,9 +312,12 @@ struct OrphanScannerTests {
#expect(group.items.allSatisfy { $0.heldBack == .namedLikeTheApp && $0.namedAfter == "com.figma.Desktop" })
#expect(group.confidence == OrphanConfidence(level: .unsure, reasons: [.onlyTheName(of: "Figma")]))
- #expect(await scanner.stillOrphaned(group.items, installedApps: installed).count == 3)
+ #expect(await scanner.stillOrphaned(group.items, installedApps: installed, remembered: [figma]).count == 3)
let back = InstalledApp(url: URL(filePath: "/Applications/Figma.app"), bundleIdentifier: "com.figma.Desktop2", name: "Figma")
- #expect(await scanner.stillOrphaned(group.items, installedApps: installed + [back]).isEmpty)
+ let afterwards = await scanner.stillOrphaned(
+ group.items, installedApps: installed + [back], remembered: [figma]
+ )
+ #expect(afterwards.isEmpty)
}
/// The settings a Safari web app leaves are named by its own identifier, which begins with `com.apple.`. Once
@@ -609,6 +612,21 @@ struct OrphanScannerTests {
#expect(Set(scan.groups.flatMap(\.items).map(\.url.lastPathComponent)) == ["Gone.vst3", "Gone Reverb.component"])
}
+ @Test func showsWhatAnAppThatLeftKeptWhileAnotherOfItsMakerStays() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.file("home/Library/Caches/org.example.solo.nightly/cache.db")
+ try directory.file("home/Library/Application Support/org.example.gonetool/data.db")
+ try directory.file("home/Library/Caches/org.example.solo.helper/cache.db")
+ let solo = InstalledApp(url: URL(filePath: "/Applications/Solo.app"), bundleIdentifier: "org.example.solo", name: "Solo")
+ let gone = ["org.example.solo.nightly", "org.example.gonetool"].map {
+ RememberedApp(bundleIdentifier: $0, name: $0, teamIdentifier: nil, lastSeen: .now, lastPath: "/Applications/\($0).app")
+ }
+
+ let scan = await scanner(in: directory, registered: ["org.example.solo"]).scan(installedApps: [solo], remembered: gone)
+
+ #expect(Set(scan.groups.map(\.identifier)) == ["org.example.solo.nightly", "org.example.gonetool"])
+ }
+
@Test func listsAMailBundleOfAnAppThatLeft() async throws {
let directory = try TemporaryDirectory()
let info = """
diff --git a/Peel/Model/OrphanLibrary.swift b/Peel/Model/OrphanLibrary.swift
index 0e23433f..3c678e87 100644
--- a/Peel/Model/OrphanLibrary.swift
+++ b/Peel/Model/OrphanLibrary.swift
@@ -104,6 +104,7 @@ extension OrphanLibrary: CarriesSelection {
return await OrphanRemoval.trash(
selected(in: group).filter { part.sizes.keys.contains($0.url) },
installedApps: apps.apps,
+ remembered: await AppMemory().load(),
scanner: OrphanScanner(exclusions: exclusions),
using: TrashService(exclusions: exclusions),
mayUseHelper: true
diff --git a/SAFETY.md b/SAFETY.md
index b4dee5ce..69b592af 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -234,7 +234,8 @@ Only matches Peel is `certain` or `likely` about, and only when nothing else ins
- **Shared means left unselected.** Anything another app uses is shown and left unselected, and so is what another
copy of the app uses: one macOS knows anywhere, such as an older copy in Downloads or one on another disk, named
by where it is. An app of the same maker kept outside the Applications folders, such as a Nightly build on another
- disk, counts like one inside them.
+ disk, counts like one inside them, and so does one Peel saw installed before: the files named for a Nightly you
+ removed are its, not this app's, and Orphaned Files lists them under it.
- **A name alone is a guess.** Something matched by the app's name alone inside another app's folder, or one of
Apple's, is shown and never selected, since it is most likely that app's data about this one; so is something
matched by name alone at the top of your home folder or of a Library, or in a maker's folder there.