Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Never select a Developer cache that holds a wallet or password database
Țugui Dragoșe13904ae7260
diff --git a/GUIDE.md b/GUIDE.mdindex 4a2afe48..ee1ebb57 100644--- a/GUIDE.md+++ b/GUIDE.md@@ -82,9 +82,9 @@ engines, and AI models, the graphics caches of Chrome, Chromium, Brave, and Operon Electron, such as Slack or Discord (never what a browser or an app keeps for you), and the browser profiles aPlaywright run left in the temporary folder when it ended early, never one a browser still has open. Xcode'sarchives and the symbols it copied from your devices, model weights, installed packages, what a tool keeps for you-to install again (Vagrant boxes, Asset Store packages, Godot's export templates), and an editor's saved state for-each project it opened are listed but never selected for you, and toolchains or anything holding an account are-never listed.+to install again (Vagrant boxes, Asset Store packages, Godot's export templates), an editor's saved state for each+project it opened, and a cache with a wallet, a signing key, or a password database inside are listed but never+selected for you, and toolchains or anything holding an account are never listed.**Build Artifacts:** what builds left in the folders you choose, like `node_modules`, `DerivedData`, `target`,`.nuxt`, `__pycache__`, Unity's `Library`, and any folder its tool tagged as a cache (`CACHEDIR.TAG`), each onlydiff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swiftindex 2eb8fabb..75927d4d 100644--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift@@ -67,19 +67,22 @@ public struct DeveloperEnvironment: Sendable, Hashable, Identifiable {public var isTheTools = true/// The newest write inside, from the walk that measured it. It is shown and never decides what is selected.public var lastWritten: Date?+ /// A wallet, a signing key, or a password database seen inside. Never a repository: the tool clones it again.+ public var heldBack: HoldBack?public var id: URL { url }/// True when Select All passes the location by: its size is not known, nothing shows the tool made it, a- /// workspace may still be in use, or it holds the archives of the apps the person built.+ /// workspace may still be in use, something inside may exist nowhere else, or it holds the archives of the+ /// apps the person built.public var isLeftToTheClick: Bool {- size == nil || !isTheTools || workspace?.mayStillBeInUse == true || kind == .archives+ size == nil || !isTheTools || workspace?.mayStillBeInUse == true || heldBack != nil || kind == .archives}/// Whether Peel selects this location for the user: only content that tools make or fetch again, or/// logs, and only once measured. Nothing is selected for the user without showing its size.public var isRecommended: Bool {- guard isTheTools, workspace?.mayStillBeInUse != true else { return false }+ guard isTheTools, workspace?.mayStillBeInUse != true, heldBack == nil else { return false }return switch kind {case .buildData, .downloads, .cache, .logs: size != nilcase .deviceSupport, .archives, .models, .environments, .keptDownloads, .projectState: false@@ -1252,7 +1255,8 @@ public enum DeveloperCaches {workspace: derived?.workspace,project: project,isTheTools: derived?.isXcodes ?? true,- lastWritten: contents.flatMap { $0.couldNotBeRead ? nil : $0.newestChange }+ lastWritten: contents.flatMap { $0.couldNotBeRead ? nil : $0.newestChange },+ heldBack: contents.flatMap(HoldBack.secret(in:))))}guard !locations.isEmpty else { return nil }diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swiftindex 3d50872d..50e9b61a 100644--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift@@ -130,9 +130,13 @@ public enum HoldBack: String, Sendable, Hashable {static func seen(in contents: FolderContents?) -> HoldBack? {guard let contents else { return .notMeasured }if contents.couldNotBeRead { return .couldNotBeRead }+ return secret(in: contents) ?? (contents.holdsRepository ? .holdsRepository : nil)+ }++ /// A wallet, a signing key, or a password database seen inside.+ static func secret(in contents: FolderContents) -> HoldBack? {if contents.holdsWallet { return .holdsAWallet }- if contents.holdsPasswordDatabase { return .holdsAPasswordDatabase }- return contents.holdsRepository ? .holdsRepository : nil+ return contents.holdsPasswordDatabase ? .holdsAPasswordDatabase : nil}}diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swiftindex 8fe1f944..61b748a1 100644--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift@@ -350,8 +350,7 @@ public struct LeftoverScanner: Sendable {) -> HoldBack? {// A wallet comes first: a cask's `zap` can name a coin app's whole data folder, which is where its keys// are. Holding it back costs a checkmark, and the row says what is inside.- if contents.holdsWallet { return .holdsAWallet }- if contents.holdsPasswordDatabase { return .holdsAPasswordDatabase }+ if let secret = HoldBack.secret(in: contents) { return secret }if contents.holdsRepository { return .holdsRepository }if kind == .logs, CrashReport.isOne(url) { return .crashReport }if kind == .sharedFolder { return .sharedWithEveryone }diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swiftindex dc7f2a21..7a6e4380 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift@@ -916,6 +916,28 @@ struct DeveloperCachesTests {#expect(DeveloperCaches.archive(at: directory.url.appending(path: "Pipe.xcarchive")) == nil)}+ @Test func aCacheWithAWalletOrAPasswordDatabaseInsideIsLeftToTheClick() async throws {+ let directory = try TemporaryDirectory()+ try directory.file("Library/Caches/Homebrew/glide_home/coin/wallet.dat", bytes: 400_000)+ try directory.file("Library/Caches/Homebrew/api-source/vault/passwords.kdbx", bytes: 400_000)+ try directory.file("Library/Caches/Homebrew/go_cache/data", bytes: 400_000)+ try directory.file("Library/Caches/Homebrew/gh-actions-artifact/clone/.git/HEAD", bytes: 400_000)+ let homebrew = DeveloperCaches.definitions.filter { $0.id == "homebrew" }++ let environment = try #require(await DeveloperCaches.scan(homebrew, homeDirectory: directory.url).first)+ let location = { (name: String) in environment.locations.first { $0.url.lastPathComponent == name } }++ for name in ["glide_home", "api-source"] {+ #expect(location(name)?.isRecommended == false)+ #expect(location(name)?.isLeftToTheClick == true)+ }+ #expect(location("glide_home")?.heldBack == .holdsAWallet)+ #expect(location("api-source")?.heldBack == .holdsAPasswordDatabase)+ #expect(location("go_cache")?.isRecommended == true)+ #expect(location("gh-actions-artifact")?.isRecommended == true)+ #expect(Set(environment.selectableRows.leftToTheClick.map(\.lastPathComponent)) == ["glide_home", "api-source"])+ }+@Test func offersEveryCacheHomebrewNamesAndNeverItsCopyOfTheDefinitions() async throws {let directory = try TemporaryDirectory()for folder in ["glide_home", "api-source", "gh-actions-artifact", "go_cache", "api"] {diff --git a/Peel/Views/Developer/DeveloperDetailView.swift b/Peel/Views/Developer/DeveloperDetailView.swiftindex ab938586..2b160548 100644--- a/Peel/Views/Developer/DeveloperDetailView.swift+++ b/Peel/Views/Developer/DeveloperDetailView.swift@@ -90,6 +90,9 @@ struct DeveloperDetailView: View {: HoldBack.notMeasured.explanation)}+ if let heldBack = location.heldBack {+ return String(localized: heldBack.explanation)+ }if !location.isTheTools {return String(localized: "Not selected: nothing shows that \(environment.name) made this folder.")}diff --git a/SAFETY.md b/SAFETY.mdindex c2137afb..5f9f018e 100644--- a/SAFETY.md+++ b/SAFETY.md@@ -302,11 +302,12 @@ A wallet's keys can be the only way to what they hold, so Peel keeps them in foubrowser keeps its profiles (`Google/Chrome/Default`): uninstalling a browser never takes its wallet. A profilewhose extension storage macOS will not let Peel list stays too, since it is not known to hold no wallet. The restof what a browser keeps, such as its caches, can still go.-- **A wallet found anywhere else is never selected for you.** When an uninstall or Orphaned Files measures a- folder, it also looks inside for the names wallets and key tools give their files: anything called- `wallet.dat`, `wallets`, `keystore`, `seed.dat`, `hsm_secret`, or `channel.backup`, anything ending in `.wallet`- or `.keys`, and the others `FileSize.isWallet` lists. A folder with one inside is shown with that reason and- never selected for you, not by `peel uninstall`, `peel orphans --remove`, or Select All. You can still select it+- **A wallet found anywhere else is never selected for you.** When an uninstall, Orphaned Files, Space, Developer,+ Build Artifacts, Installers and Backups, or Package Receipts measures a folder, it also looks inside for the names+ wallets and key tools give their files: anything called `wallet.dat`, `wallets`, `keystore`, `seed.dat`,+ `hsm_secret`, or `channel.backup`, anything ending in `.wallet` or `.keys`, and the others `FileSize.isWallet`+ lists. A folder with one inside is shown with that reason and never selected for you, not by `peel uninstall`,+ `peel orphans --remove`, `peel caches --remove`, `peel projects --remove`, or Select All. You can still select ityourself, because a name can mislead: a Java project keeps a `keystore` too.- **A folder Peel could not finish reading is treated the same way**, whether it ran out of time or macOS kept afolder inside it closed. A coin's data folder, with its blockchain, is the one most likely to be too big to read