Repository navigation
fix(hopper): release a Spotlight not-found launch from the signed helper - #3011
bruno-candia wants to merge 7 commits into
Conversation
Hopper's native launcher locates the application through a fixed Spotlight query before any Apple event. With indexing disabled it exits 3 with a not-found report, but REA treated the external document as unconfirmed, retained the runtime and failed every later open_binary until the server restarted. Recognize the complete report as a pre-handoff failure, confirm no document exists, and tell the caller to enable Spotlight indexing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
test.each does not pass the workspace fixture, so the rows failed to typecheck and never ran. With test.for they run, and the not-found row now expects the unknown provider state that a non-zero launcher exit leaves, matching the boundary tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Spotlight not-found report keeps ownership unknown because a custom launcher could forward it after a handoff. Hopper's own helper fails its Spotlight lookup before any Apple event, so verify the exact launcher file with codesign against the vendor requirement (identifier hopper, Apple anchor, team 2AMA2753NF) before it runs. Only then does the complete report confirm that no document exists, so the session can retry after the user enables indexing instead of restarting the server. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Low impact] The test-only change appears safe to merge. SummaryAdds tests for native Hopper helper verification. This PR changes tests only; the implementation described in the PR is already in the base.
Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2bd3124833
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| HopperProcessError, | ||
| HopperStartError, | ||
| } from "../domain/hopperErrors.js"; | ||
| import { HOPPER_PUBLISHER } from "../application/MacHopper.js"; |
There was a problem hiding this comment.
Move the publisher identity into a provider-owned module
BridgeLauncher is a provider adapter, but this value import pulls it outward into application/MacHopper (and transitively into setup/download implementation), reversing the required dependency direction. Put the publisher identity in a provider-owned module and let the installation workflow import that instead.
AGENTS.md reference: AGENTS.md:L17-L17
Useful? React with 👍 / 👎.
| (await ( | ||
| this.dependencies.verifyNativeHelper ?? verifyHopperNativeHelper | ||
| )(this.options.launcherPath, this.options.environment)); | ||
| const started = await launchHopperProcess({ |
There was a problem hiding this comment.
Bind verification to the executable that is spawned
When the configured launcher path is replaceable (notably setup installs under ~/Applications and custom paths are allowed), this await verifies one path resolution, then launchHopperProcess performs asynchronous ownership preparation before spawn resolves the path again. A replacement in that window can run a wrapper while nativeHelper remains true; if it hands off a document and emits the exact exit-3 diagnostic, HopperClient marks shutdown confirmed and releases the lease/runtime. Execute an immutable verified copy or otherwise bind provenance to the executable identity.
AGENTS.md reference: AGENTS.md:L19-L21
Useful? React with 👍 / 👎.
| `-R${HOPPER_NATIVE_HELPER_REQUIREMENT}`, | ||
| launcherPath, | ||
| ], | ||
| { env: environment }, |
There was a problem hiding this comment.
Pass the startup abort signal to codesign
When codesign stalls on a slow/unavailable launcher volume, or the caller cancels while verification runs, this execFile has neither a signal nor a timeout and the injected verifier contract cannot receive one. The ProviderStartupDeadline signal can therefore abort while start() remains blocked until codesign exits, so timeout and cancellation no longer bound this startup phase; thread the launch signal through the verifier and into the execFile options.
Useful? React with 👍 / 👎.
Retain unresolved process identity and launch evidence through retryable cleanup. Share capture path normalization and preserve failed filesystem observations. Bound child output and drain Windows pipes without one-chunk throttling. Reviewed fixes include #1628, #2632, #2644, #2784, #2928, #2931, #2965, #2992, and #3011. Validation: 92 focused source tests passed; four platform-specific skips. Real Windows and Hopper lifecycle coverage was not rerun.
Main (599a8ee) already releases a Spotlight not-found launch only when the native helper is verified, through `nativeHelperVerified` and its `verifyNativeHelper` dependency. Keep main's launcher, client, diagnostic and fixtures instead of adding a second verifier and an `applicationNotFoundBeforeHandoff` flag. Port this branch's launcher-level tests to main's API: only a verified helper is marked, verification never runs outside macOS, and a real unsigned launcher stays unverified. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
CI-fix track: the failing Static checks (format) and |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
Heads up: main covers this in its own way in 4acda94. The code is in 🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
# Conflicts: # tests/boundary/providers/hopper/bridgeLauncher.test.ts
|
CI-track update: I merged latest |
|
Thanks for the Spotlight recovery investigation and helper-signature evidence. Main now verifies the native helper and uses that provenance for the not-found recovery path (4acda94), with provider boundary coverage. The remaining diff adds launcher-level controls for verified, unverified and non-macOS cases; I am closing that coverage-only overlap for now. Please reopen if those checks expose a distinct failure or an important missing signature case. A real Spotlight-disabled end-to-end run was not established here. |
Summary
Builds on #2795 (its three commits are included here until it merges; review only the last two). #2795 now reports the Spotlight not-found failure with setup guidance but, after review, deliberately keeps ownership unknown: a custom launcher could forward the same report after a handoff. As a result the original bug remains — after a Spotlight not-found launch, every later
open_binaryin the session fails withcleanup_incompleteuntil the MCP server restarts, even once indexing is enabled.This adds the provenance gate the review asked for (Greptile P1, Codex P2 on #2795): the not-found report confirms that no document exists only when the executed launcher is Hopper's own vendor-signed helper.
Refs #1808, #2795.
Problem and expected behavior
open_binarythrough the nativehopperhelper.HopperApplicationLauncherverifies the exact launcher file withcodesign --verify --strict -R'= identifier "hopper" and anchor apple generic and certificate leaf[subject.OU] = "2AMA2753NF"'. Only a verified helper setsapplicationNotFoundBeforeHandoffon the launch, and only then doesHopperClientmark shutdown confirmed for the complete not-found report (exit 3, exact stderr, empty stdout). Wrappers, custom launchers, extra output and non-macOS hosts keep the conservative unknown-handoff outcome from fix(hopper): recover from a Spotlight not-found launch #2795.Change and scope
src/hopper/BridgeLauncher.ts:applicationNotFoundBeforeHandofflaunch metadata; injectableverifyNativeHelperdependency; defaultcodesignverification reusingHOPPER_PUBLISHER.teamIdentifier. Verified only on macOS, for the non-owning native launch, before the helper runs.src/hopper/HopperClient.ts: confirms shutdown for the not-found report only with that metadata.tests/acceptance/providers/hopperStartupRecovery.test.ts(separate commit): the late-bridge rows usedtest.each, which does not pass the workspace fixture, so the file failedtypecheck(Property 'workspace' does not exist) and the rows never ran.test.forruns them; the not-found row now expectsprovider_operation_health.state: "unknown", which is what a non-zero launcher exit produces and what the boundary tests already assert.Ordinary fix within existing boundaries; maintainer scope decision: not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage: Hopper launch metadata (
src/hopper/BridgeLauncher.ts).Contribution scope fit and linked maintainer decision: bug fix; follows the review on fix(hopper): recover from a Spotlight not-found launch #2795.
CLI and MCP/tool-catalog contract: none; error text unchanged from fix(hopper): recover from a Spotlight not-found launch #2795.
Provider, bridge, target-format, or platform compatibility: macOS native launch only; adds one
codesigninvocation per launch.Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details: cleanup completes only for the verified helper; every other launcher keeps the runtime and lease.
Generated metadata, package, or installation impact: none.
Launch or attach to a process.
Evidence and regression coverage
Tests added: boundary tests in
hopperClient.helperFailure.test.ts(verified helper releases ownership and the same client starts again twice; unverified launcher and verified helper with extra stdout both staycleanup_incomplete) and inbridgeLauncher.test.ts(flag only with a verified helper; no verification outside macOS; the default verifier rejects a non-Hopper executable).Base reproduction: with
HopperClient.tsfrom fix(hopper): recover from a Spotlight not-found launch #2795's head,releases a verified native helper's Spotlight not-found launch so the session can retryfails; with this change it passes.Real signature: on macOS with Hopper Disassembler 6.6.0-demo,
Contents/MacOS/hoppersatisfies the requirement (Identifier=hopper,TeamIdentifier=2AMA2753NF); the mainHopper Disassemblerexecutable does not, so the identifier pins the helper.Remaining proof gaps: not reproduced end to end with Spotlight disabled on a real host (that needs changing the system indexing setting). The requirement was checked against the 6.6.0-demo build only.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npm run check:fast— typecheck and lint passed (on fix(hopper): recover from a Spotlight not-found launch #2795's head it fails with thetest.eachtypecheck error above)npm run test:focused --allsrc/hopper/*.test.ts,tests/boundary/providers/hopper/*.test.tsandtests/acceptance/providers/hopperStartupRecovery.test.ts— 30 files, 1 failure:retains a denial-shaped failure when caller arguments can alter the helper's AppleScript(ENOENT onloader-targetinacquireHopperTargetLease), which fails the same way on fix(hopper): recover from a Spotlight not-found launch #2795's head and onmainon this hostcodesign --verify --strict -R'<requirement>'against the installed helper — satisfiedCompatibility, safety, and release
Before merge
type(scope): outcome.🤖 Generated with Claude Code