Repository navigation
Application support path - #150
Merged
Merged
Conversation
Both stores hold raw HTTP response bodies validated by an ETag, so losing them costs one refetch and nothing else. That belongs in Caches, which the system may purge and which is excluded from Time Machine; the catalogue is the largest thing the app writes and has no business in a backup. The app is unsandboxed, so the folder name is not cosmetic: "Brew" sat directly in the shared ~/Library, where it collides with anything else of that name and reads as if it belonged to the brew CLI. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pitCmmVCCRVwpUvPgDDoy
Reports are the opposite of the API caches: a pending report cannot be regenerated, and a purge would destroy one before the user ever saw the prompt to file it. So they stay in Application Support and only pick up the bundle-identifier namespace. The "attach the full crash log from ..." note in the pre-filled GitHub issue named the old path, and is updated to match. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pitCmmVCCRVwpUvPgDDoy
Which root each store writes to looks arbitrary later and invites someone to merge the two back together. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pitCmmVCCRVwpUvPgDDoy
Drop the three-line note on each cache's init explaining that its directory and defaults prefix are test seams. Injecting a directory for a test is an ordinary pattern and does not need narrating, and the block was longer than the initialiser it sat on. Shorten the one-line note on each default path to state the decision (which root, and why) rather than restate the return value. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pitCmmVCCRVwpUvPgDDoy
MikeMcQuaid
approved these changes
Sep 7, 2026
p-linnane
approved these changes
Sep 7, 2026
p-linnane
left a comment
Contributor
There was a problem hiding this comment.
Nice improvement. Will definitely make it easier to separate from brew itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Namespace on-disk storage by bundle identifier
Summary
The app is unsandboxed, so it writes into the shared
~/Librarywith no containerto namespace it, and every store resolved its own path into a folder called
Brew.That name collides with anything else using it and reads as the
brewCLI's. Thisnamespaces the paths as
sh.brew.appand moves each store into the root matchingwhether its data can be rebuilt.
Changes
~/Library/Caches/sh.brew.app.Both hold ETag-validated HTTP bodies: a purge costs one refetch, and the
catalogue leaves Time Machine backups.
~/Library/Application Support/sh.brew.app/CrashReports.A pending report cannot be regenerated, so it must not be purgeable.
updated to match.
default-path helpers lose
privateso the new tests can assert them.Nothing is released yet, so there is no migration: pre-1.0 installs lose a cached
catalogue and refetch it. Convention followed is Apple's File System Programming
Guide, macOS Library Directory Details.
Testing
scripts/test: 955 tests pass, up from 949.--strict, and BrewUILint all clean.xcodebuildscheme Brew builds.git archive HEAD, so nothing depends on anuntracked file.
scripts/test-uiwas not run: UI tests cannot run in this sandbox. No appcode changed, so the exposure is limited to the two cache stores at launch.
PR checklist
which directory each store belongs in. Verification is the automated runs above;
the app was not run by hand.
Follow-ups (optional)
sh.brew.appis written in three places, matching howBrewwas. Worth a sharedconstant only once something else needs it. Rationale is in
.ai/memory.md.