fix(homebrew): preserve app code signature - #61
Conversation
Move the Homebrew ownership marker beside the signed app bundle and make release smoke tests reject any copied app whose signature or notarization is invalid.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 23 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes Homebrew-installed macOS app signature breakage by moving Homebrew’s ownership marker outside the signed Microbridge.app bundle, preventing post-signing mutations that cause Gatekeeper/codesign rejection.
Changes:
- Updates the Homebrew formula’s service wrapper to write a sidecar marker (
~/Applications/.Microbridge.app.microbridge-brew) instead of a file inside the app bundle, while preserving migration support for legacy installs. - Updates the Tauri app to detect the new sidecar marker (and still recognize the legacy in-bundle marker for migration).
- Strengthens Homebrew smoke checks (script + release workflow) to validate codesign, Gatekeeper assessment, stapling, and distribution policy.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
scripts/smoke-formula.sh |
Switches to sidecar marker + adds strict macOS signing/Gatekeeper/stapler/distribution verification in smoke test. |
Formula/microbridge.rb |
Writes the Homebrew ownership marker beside the app bundle (and supports legacy marker detection to decide ownership). |
apps/microbridge-ui/src-tauri/src/lib.rs |
Detects sidecar marker (with legacy fallback) to keep update routing consistent for Homebrew installs. |
.github/workflows/finalize-release.yml |
Adds sidecar marker checks and strict signing/Gatekeeper/stapler/distribution validation in final release verification. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## Summary Bump every product version source to 0.2.4 and add release notes for the Homebrew signature-marker repair and DMG notarization hardening. ## Why v0.2.4 v0.2.3 was never promoted from prerelease. During final public-install testing, we reproduced macOS's damaged-app alert on the Homebrew path: the Formula wrote an ownership marker inside the signed bundle and invalidated its resource seal. PR #61 fixes that path, but the app binary must also ship its matching external marker detection so Homebrew installations continue to use `brew upgrade`. This patch release supersedes v0.2.3 rather than promoting a binary that does not understand the corrected marker. ## Changes - Bump Rust workspace, Tauri app, npm package, bundle config, and lockfiles to 0.2.4. - Add `docs/releases/v0.2.4.md` with the blocker fix, distribution hardening, included product improvements, upgrade notes, and hardware-validation boundary. - Leave the Formula at v0.2.3 until the v0.2.4 release workflow publishes and smoke-tests the exact public assets, then opens its generated Formula PR. ## Verification - `make ci` passed: 62 Rust tests, 4 Cursor hook tests, 9 UI tests, Clippy, formatting, and the production UI build. - Root and Tauri Cargo checks passed at 0.2.4. - All workspace package metadata, npm metadata, and Tauri bundle metadata report 0.2.4. - No configuration, protocol, or data migration is required.
Issue
Launching the Homebrew-installed app could produce macOS's “Microbridge is
damaged and can’t be opened” alert even though the release app was signed,
notarized, and stapled correctly.
Root cause and user impact
The Formula copied
Microbridge.appto~/Applications, then wrote.microbridge-brewinside the bundle root. That post-signing mutation broke thesealed resource envelope.
codesignand Gatekeeper consequently rejected thecopied app as
unsealed contents present in the bundle root.This affected the Homebrew install path. Direct DMG apps remained valid.
Fix
~/Applications/.Microbridge.app.microbridge-brew.marker; the next service start replaces that owned bundle with a clean copy.
routing updates through
brew upgrade.app passes strict code-signing, Gatekeeper, stapler, and Apple distribution
checks.
Verification
codesignreportedunsealed contents present in the bundle rootand Gatekeeper rejected it.valid on disk,accepted, andsource=Notarized Developer ID.xcrun stapler validateandsyspolicy_check distributionpassed.make cipassed: 62 Rust tests, 4 Cursor hook tests, 9 UI tests, Clippy,formatting, and production UI build.
passed.