Skip to content

fix(homebrew): preserve app code signature - #61

Merged
DevVig merged 1 commit into
mainfrom
codex/homebrew-signature-marker
Jul 20, 2026
Merged

fix(homebrew): preserve app code signature#61
DevVig merged 1 commit into
mainfrom
codex/homebrew-signature-marker

Conversation

@DevVig

@DevVig DevVig commented Jul 20, 2026

Copy link
Copy Markdown
Owner

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.app to ~/Applications, then wrote
.microbridge-brew inside the bundle root. That post-signing mutation broke the
sealed resource envelope. codesign and Gatekeeper consequently rejected the
copied app as unsealed contents present in the bundle root.

This affected the Homebrew install path. Direct DMG apps remained valid.

Fix

  • Move Homebrew's ownership marker beside the bundle at
    ~/Applications/.Microbridge.app.microbridge-brew.
  • Preserve migration support for older installs carrying the legacy in-bundle
    marker; the next service start replaces that owned bundle with a clean copy.
  • Teach the app to identify the new sidecar marker so Homebrew installs continue
    routing updates through brew upgrade.
  • Make local and final-release Homebrew smoke tests fail unless the installed
    app passes strict code-signing, Gatekeeper, stapler, and Apple distribution
    checks.

Verification

  • Reproduced the defect on the old Formula: codesign reported
    unsealed contents present in the bundle root and Gatekeeper rejected it.
  • Clean public-asset Homebrew lifecycle with the new marker passed.
  • Installed app reported valid on disk, accepted, and
    source=Notarized Developer ID.
  • xcrun stapler validate and syspolicy_check distribution passed.
  • App launch, service lifecycle, uninstall, and marker cleanup passed.
  • make ci passed: 62 Rust tests, 4 Cursor hook tests, 9 UI tests, Clippy,
    formatting, and production UI build.
  • Tauri crate check, shell syntax, Formula syntax, and workflow YAML parsing
    passed.

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.
@DevVig
DevVig marked this pull request as ready for review July 20, 2026 01:32
Copilot AI review requested due to automatic review settings July 20, 2026 01:32
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 149d369f-5b85-42ff-b695-ae0f3ea291dd

📥 Commits

Reviewing files that changed from the base of the PR and between d9c9a54 and 061167f.

📒 Files selected for processing (4)
  • .github/workflows/finalize-release.yml
  • Formula/microbridge.rb
  • apps/microbridge-ui/src-tauri/src/lib.rs
  • scripts/smoke-formula.sh

Comment @coderabbitai help to get the list of available commands.

@DevVig
DevVig merged commit 83d2b07 into main Jul 20, 2026
6 of 7 checks passed
@DevVig
DevVig deleted the codex/homebrew-signature-marker branch July 20, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

DevVig added a commit that referenced this pull request Jul 20, 2026
## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants