Skip to content

fix(hopper): keep automated Linux setup off non-x86_64 hosts - #3422

Merged
morluto merged 4 commits into
morluto:mainfrom
DavidFB-creator:fix/3419-hopper-linux-architecture
Oct 22, 2026
Merged

morluto merged 4 commits into
morluto:mainfrom
DavidFB-creator:fix/3419-hopper-linux-architecture

Conversation

@DavidFB-creator

@DavidFB-creator DavidFB-creator commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

Fixes #3419. On Linux arm64 hosts, rea setup treated automated Hopper installation as supported whenever /etc/os-release matched a tested distribution. Every pinned Linux Hopper package is x86_64-only, so on such hosts setup planned and asked for approval of an install that cannot succeed. This change refuses that install up front instead.

Problem and expected behavior

Smallest trigger, on Ubuntu 24.04 aarch64: rea setup --client codex --install-hopper --json returned needs_confirmation with an install_hopper action for Hopper-6.4.2-Linux-demo.deb. With --yes, it would go on to download that package and run pkexec apt-get install.

Violated invariant: hopperSetupSupported should only be true where the pinned package can be installed. The pinned packages declare Architecture: amd64 (deb), x86_64 (RPM lead) and arch = x86_64 (Arch .PKGINFO).

Expected behavior: on non-x86_64 Linux, setup should report needs_human with a remediation before any download or package-manager call. This is the same path unsupported distributions such as Debian already take, so that recovery path is unchanged.

Change and scope

  • Owning boundary: parseLinuxDistribution / readLinuxDistribution now take the host architecture. hopperSetupSupported additionally requires it to match SUPPORTED_RELEASE_ARCHITECTURE (x64). The comment on that constant records how the package metadata was read.
  • Consumers: setup planning, setup preflight, installLinuxHopper and verify-package-discovery.mjs already read hopperSetupSupported. They now inherit the corrected decision with no downstream repair.
  • Wiring: the doctor host passes its injected architecture. The setup host takes its Linux distribution from the doctor host, as it already does for macosVersion, so planning and doctor share one host-fact owner. The Linux install host takes the same distribution reader from the setup host (ad47dcce3, from review), so planning, preflight and installation cannot disagree. The unused default install host on installLinuxHopper, which read process.env and process.arch directly, is removed.
  • Remediation text: the duplicated list of supported hosts in setup and doctor remediation moves to LINUX_HOPPER_SETUP_HOSTS and now names x86_64. docs/installation.md#hopper is updated to match.
  • Package verification (a8290eb00, from review): on Linux, packageSetupSupport now requires doctor Hopper readiness only where the automated installer applies (hopperSetupSupported === true); macOS is unchanged. This narrows the readiness assertion from fix(verify-package): read Hopper installer applicability from its owner #2973: on hosts outside the installer matrix, such as Kali and ubuntu-24.04-arm, package verification no longer asserts that the doctor admits the configured HOPPER_LAUNCHER_PATH launcher.
  • Unchanged: macOS Hopper setup, REA host support (supportsReaHost still accepts arm64 Linux), Ghidra/IDA, and the pinned releases themselves.

Contribution scope: a routine fix within existing setup boundaries, so no maintainer scope decision applies.

Contract and boundary impact

  • Semantic owner and earliest changed stage: LinuxHopper.parseLinuxDistribution, setup/provider admission.
  • Contribution scope fit and linked maintainer decision: not applicable (routine fix within existing boundaries).
  • CLI and MCP/tool-catalog contract: no schema change. On non-x86_64 Linux, setup --install-hopper now returns needs_human with the new remediation instead of needs_confirmation. The setup and doctor remediation strings change wording on all hosts.
  • Provider, bridge, target-format, or platform compatibility: automated Hopper setup is no longer offered on Linux arm64 or other non-x64 architectures. An existing Hopper launcher via HOPPER_LAUNCHER_PATH is unaffected.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: removes a planned network download and privileged package-manager call on hosts where they cannot succeed.
  • Generated metadata, package, or installation impact: on ubuntu-24.04-arm, package verification now expects needs_human for the explicit --install-hopper run, because both sides read the same readLinuxDistribution(process.arch) decision. On Linux hosts outside the installer matrix (Kali, ubuntu-24.04-arm), package verification no longer requires doctor Hopper readiness.

Expected effects:

  • Read existing files or captured data. (/etc/os-release, unchanged)
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated:

    • LinuxHopper.test.ts: every tested distribution on arm64 keeps its package family and REA host support but has hopperSetupSupported: false. The x64 cases are unchanged.
    • packageSetupSupport.test.ts: the packaged verifier does not expect automated Hopper on arm64 Ubuntu 24.04, and on Linux it no longer requires Hopper readiness where the installer does not apply (arm64 Ubuntu 24.04, Kali). Both cases fail without the a8290eb00 change.
    • setupEnvironment.test.ts: the real systemSetupHost installs Linux Hopper from the selected doctor host's classification. A supported x64 fixture reaches the (mocked, refused) download; an unsupported arm64 fixture returns unsupported_host without any download.
    • The setup and doctor remediation expectations are updated.
  • Base reproduction (executed): with the new architecture condition replaced by true (base behavior), all 7 new cases fail. They pass with it restored. With the install host reading readLinuxDistribution(process.arch) directly again, the new setupEnvironment.test.ts x64 case fails on this arm64 host; on an x64 host the arm64 case would fail instead (source-derived, not run).

  • User-visible CLI output (executed on Ubuntu 24.04.5 LTS aarch64, Node 24.18.1, isolated HOME):

    # before: npx [email protected] setup --client codex --install-hopper --json
    {"status":"needs_confirmation","remediation":"Review the setup plan, then rerun interactively or with --yes.","planned":["install_hopper","configure_client","install_skill"],"applied":[]}
    
    # after: node scripts/rea.mjs setup --client codex --install-hopper --json
    {"status":"needs_human","remediation":"Automated Hopper setup requires an x86_64 host running Ubuntu 24.04+, Fedora 41+, Nobara 44+, Arch Linux, CachyOS, or Omarchy; configure an existing supported provider instead.","planned":["install_hopper","configure_client","install_skill"],"applied":[]}
    
    # after, with --yes
    {"status":"needs_human","remediation":"Automated Hopper setup requires an x86_64 host running …","applied":[]}
    

    In the --yes run, no file was written under the isolated HOME, no rea-hopper-* temporary directory was created, and dpkg -s hopper reports the package as not installed. I did not run the base build with --yes, because it would attempt the real package install.

  • Remaining proof gaps:

    • Not run on an x86_64 Linux host. That path is covered only by the unchanged x64 unit cases.
    • Interactive (TTY) setup on arm64 not exercised; source-derived, it uses the same hopperInstallSupported gate.
    • The CI ubuntu-24.04-arm package lane has not run yet; the same npm run verify:package passes locally on aarch64.

Validation performed

  • npm run test:local -- src/application/LinuxHopper.test.ts src/application/Setup.recovery.test.ts src/application/Doctor.test.ts src/application/Setup.planning.test.ts src/application/Setup.configuration.test.ts src/ghidra/GhidraDoctor.test.ts tests/evaluation/package/packageSetupSupport.test.ts — 7 files, 156 tests passed
  • Same two new-test files with the architecture condition replaced by true — 7 failed (expected), then restored
  • npm run test:local -- src/setupEnvironment.test.ts src/application/LinuxHopper.test.ts — 2 files, 59 tests passed
  • Same setupEnvironment.test.ts with the install host reading the ambient host again — 1 failed (expected, x64 case on arm64), then restored
  • npm run test:local -- tests/evaluation/package/packageSetupSupport.test.ts — 6 passed; without the a8290eb00 change, 2 failed (expected)
  • npm run test:changed -- --base origin/main — 30 files, 534 tests passed (on ad47dcce3 and again on a8290eb00)
  • npm run check:fast — typecheck and lint passed
  • npm run format:check — passed
  • npm run docs:check — passed
  • npm run build:cached plus the CLI runs above on Ubuntu 24.04.5 aarch64 — results as shown
  • npm run verify:package on Ubuntu 24.04.5 aarch64, Node 24.18.1 — exit 0 on dca573dd4, ad47dcce3 and a8290eb00; all 18 stages complete, including package discovery and setup and uninstall CLI

Compatibility, safety, and release

  • Breaking changes or migration steps: none. On non-x64 Linux, explicit --install-hopper now stops with needs_human instead of attempting an install that could not succeed. Remediation wording changes.
  • Real Hopper/Ghidra, browser, or OS coverage: real setup CLI on Ubuntu 24.04 aarch64, without Hopper because no arm64 package exists. Not run on x86_64 Linux or macOS.
  • Package or release metadata impact: none beyond the CI expectations noted above.
  • Security, privacy, process, or containment review: reduces privileged package-manager invocations and external downloads on unsupported hosts. No new effects.

Author readiness

Human owner: @DavidFB-creator

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Maintainer blocker verification

macOS arm64, Node 24.18.0/npm 11.16.0, exact head abb451f4cb23bd10dd83381e296fb58fad6e20a2: npm pack --dry-run --json passed through prepack (1,671 files, including Linux Hopper/setup outputs). npm run verify:package passed archive, install/update, CLI/MCP, setup/uninstall and cleanup checks, including read-only setup planning and preservation of existing Hopper. This run did not verify additional OS hosts.

@DavidFB-creator
DavidFB-creator marked this pull request as ready for review October 14, 2026 10:19
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no blocking defects were found.

Summary

This PR limits automated Linux Hopper installation to supported x86_64 hosts and shares the doctor host’s classification with setup and installation.

  • Linux Hopper setup checks host architecture before offering an install.
  • Linux package checks expect Hopper readiness only where setup can install it.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Doctor host architecture"] --> B["readLinuxDistribution"]
  B --> C["Shared classification for setup and installation"]
  C --> D{"x64 and supported distribution?"}
  D -- No --> E["Explicit install: needs_human"]
  D -- Yes --> F["Normal approval and install path"]
Loading

Reviews (5) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Every pinned Linux Hopper package (deb, rpm, Arch) is x86_64-only, but
hopperSetupSupported was derived from os-release alone. Setup therefore
planned and confirmed an amd64 package install on arm64 Ubuntu 24.04 and
the other tested distributions.

Classify installer support with the host architecture where the
distribution is parsed, so setup planning, preflight, installation and
package verification share one decision. Setup now takes its Linux
distribution from the doctor host, as it already does for the macOS
version, and the supported-host remediation text has a single owner.

Fixes morluto#3419

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

arm64 ubuntu is now hopperSetupSupported false, but packageSetupSupport still sets hopperReadinessRequired from the host check alone, and the new test expects that. verify-package-discovery.mjs fails the package when hopperReadinessRequired is set and hopper is not ready, so an arm64 host still has to have hopper even though setup will not install it. readiness should follow hopperSetupSupported on linux.

@rahul05ranjan rahul05ranjan 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.

I read this on actual arm64 Linux hardware (a Raspberry Pi), so the failure mode being fixed — setup offering a Hopper-*-Linux-demo.deb that declares Architecture: amd64 to a host that can't install it — is one I can picture a user on this machine hitting exactly as described.

What I verified:

  • The gate sits in the right place. parseLinuxDistribution now takes the host architecture and folds architecture === "x64" into hopperSetupSupported, so setup planning, hostRemediation, installLinuxHopper, and the packaged verifier all inherit one decision instead of each re-checking. Grep over the PR head shows no remaining caller of parseLinuxDistribution/readLinuxDistribution without an explicit architecture argument.
  • installLinuxHopper still independently re-reads host.distribution() and refuses with unsupported_host before any download or package-manager call, so the preflight gate isn't the only line of defense.
  • I bundled LinuxHopper.ts and ran the real gate on this arm64 host with a synthetic Ubuntu 24.04 os-release document: parsed as arm64 it returns packageFamily: "deb", hopperSetupSupported: false, and supportsReaHost: true; the same document parsed as x64 returns hopperSetupSupported: true. Architecture is the only differing variable, and REA host support survives, matching the new tests.
  • src/application/LinuxHopper.test.ts passes 51/51 here, including the new non-x86_64 cases.
  • Launcher discovery (linuxHopperLauncherCandidates / HOPPER_LAUNCHER_PATH) never consults hopperSetupSupported, so an arm64 user with a manually working Hopper build keeps their existing-launcher path — the fix correctly touches only the automated installer.
  • Reusing the DoctorHost.architecture injection (options.architecture ?? process.arch) matches how the Ghidra doctor already classifies host architecture, and pointing the setup host's linuxDistribution at the doctor host keeps a single host-fact owner.

One small asymmetry, not blocking: systemLinuxHopperInstallHost reads process.arch directly while the doctor path uses the injectable architecture. In production both are process.arch, but the two could disagree if anything ever composes a doctor host with a non-default architecture for real.

The remediation rewording is a genuine improvement too — "requires an x86_64 host running ..." states both the why and the alternative (configure an existing provider, docs now point at Ghidra), where the old "64-bit Arch Linux" phrasing was quietly ambiguous about which 64-bit was meant.

…facts

systemLinuxHopperInstallHost read os-release with process.arch on its own,
while setup planning used the doctor host's injected architecture. Both
agree in production, but a doctor host composed with another architecture
could plan one answer and install with another.

The install host now takes its distribution reader from the caller, and
systemSetupHost passes the doctor host's, so planning, preflight and
installation share one host-fact owner. The unused default host on
installLinuxHopper, the other ambient reader, is removed.
@DavidFB-creator

Copy link
Copy Markdown
Author

@rahul05ranjan Thanks for testing this on real arm64 hardware and for the careful review.

Good catch on the asymmetry. In ad47dcc the Linux install host now takes its distribution from the setup host's doctor host instead of reading process.arch itself, and the unused default install host is gone. A new setupEnvironment.test.ts case covers it.

…installs it

packageSetupSupport required doctor Hopper readiness on every Linux host
whose host check passed, including installer-untested distributions and,
after the architecture gate, arm64 hosts where setup never provides
Hopper. On Linux, readiness now also requires automated installer
applicability; macOS is unchanged.

This narrows the readiness assertion from morluto#2973 on hosts outside the
installer matrix, such as Kali and ubuntu-24.04-arm.
@DavidFB-creator

Copy link
Copy Markdown
Author

@chessing234 Thanks, done in a8290eb: on Linux, Hopper readiness is now required only where hopperSetupSupported is true; macOS is unchanged.

@rahul05ranjan

Copy link
Copy Markdown

Thanks for following through on this — taking the distribution from the setup host's doctor host is the right call, and having setupEnvironment.test.ts pin it closes the loop nicely. Glad the arm64 run was useful.

# Conflicts:
#	src/application/LinuxHopper.ts
#	src/setupEnvironment.test.ts
@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Merged latest main into this branch to resolve the LinuxHopper.ts and setupEnvironment.test.ts conflicts. No rebase or force-push was used. Main replaced the pinned Linux release table with the signed HopperReleaseFeed and a publisher-backed install host, so that table is gone here too. Kept from this PR: the x86_64 architecture gate, LINUX_HOPPER_SETUP_HOSTS, the architecture-aware parseLinuxDistribution/readLinuxDistribution, and the caller-supplied distribution for systemLinuxHopperInstallHost. Main's new systemLinuxHopperPublisher reads only the package family, so it now calls readLinuxDistribution(process.arch); a comment explains that the architecture does not affect the family. Both tests in setupEnvironment.test.ts are kept. Validation: setupEnvironment, LinuxHopper, Doctor and Setup tests (149 passed, including this PR's x64/arm64 cases against main's feed-based installer), tests/evaluation/package/packageSetupSupport.test.ts (6 passed), and typecheck and lint via the pre-push hook.

@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: The new arm64 tests fail on main and pass with this PR. The patched tree also type-checks. Three test files that name doctor were skipped, and full CI did not run on this head. Thanks, DavidFB-creator, for the fix and the tests.

Results

I tested the patch on main 89faa86, not the older head tree. The patch applies cleanly. First I added only the PR's test changes to main. Then I applied the full patch.

Check Main plus tests only Main plus full patch (head abb451f)
Linux setup unit test file, 6 new arm64 cases (one per distribution) all 6 fail all pass
Package setup support test, new arm64 case fails passes
Package setup support test, changed Kali case fails passes
Both files in total 8 failed, 48 passed 56 of 56 passed
npm run typecheck not run exit 0

So an arm64 host now gets the manual-step path, and x86_64 hosts keep the automated one. The file names are left out here because they name a closed-source disassembler.

CI: only the Greptile review ran on head abb451f. The full CI suite did not run on it, and I did not run it.

Not run

  • Three test files name doctor. They are the doctor suite, the setup environment test and the setup recovery test. The doctor suite uses mock hosts, by the plan notes, which I did not verify. The setup environment test builds the doctor host from empty settings. I did not trace whether that reaches the real home. The recovery test only has fake-host fields with that name. I skipped all three, so the changes to the doctor and setup-host code are covered by the type check only.
  • scripts/verify-package-discovery.mjs itself. It runs doctor. The test file imports only its pure support function, which does no work on import.
  • A real arm64 host, and a real install of the disassembler.
  • The docs change.
  • Node 22 and Node 26.
  • The full test suite, lint and the full local gate.
Commands
export PATH=~/.local/opt/node24/bin:$PATH
npm ci
# main plus the two test files' hunks only (names left out, see above)
npm run test:focused -- <Linux setup unit test> tests/evaluation/package/packageSetupSupport.test.ts   # exit 1
# main plus the full patch
npm run test:focused -- <Linux setup unit test> tests/evaluation/package/packageSetupSupport.test.ts   # exit 0
npm run typecheck   # exit 0
Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 24.18.0
  • Head: abb451f
  • Base: 89faa86
  • Other: the box was shared with other test jobs, and these are short unit tests.

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

@DavidFB-creator

Copy link
Copy Markdown
Author

@CassieFox23 Thanks for the independent check, especially the main-plus-tests-only comparison.

To close some of the gaps you listed, on head abb451f, Ubuntu 24.04.5 aarch64, Node 24.18.1 (after npm ci and npm run build:cached):

  • npm run test:focused -- src/application/Doctor.test.ts src/setupEnvironment.test.ts src/application/Setup.recovery.test.ts src/application/LinuxHopper.test.ts tests/evaluation/package/packageSetupSupport.test.ts: 5 files, 112 tests passed, including both setupEnvironment.test.ts cases (x64 and arm64 classification).
  • npm run verify:package: exit 0, all 18 stages complete, including package discovery (which runs verify-package-discovery.mjs and doctor) and setup and uninstall CLI.
  • npm run check:fast: typecheck and lint passed.

On the home question: the new setupEnvironment.test.ts cases build the setup host from createDoctorHostFixture with HOME=/fixture/home and a mocked, refused download, so they don't reach the real home or the network.

Still not run: Node 22/26, a real Hopper install, and the full CI, which is waiting for approval.

@morluto
morluto merged commit 86655ea into morluto:main Oct 22, 2026
36 checks passed
cursor Bot pushed a commit that referenced this pull request Oct 22, 2026
#3422 requires systemLinuxHopperInstallHost to take the caller's
distribution reader. These launcher and package tests still called the
old one-argument form, so typecheck failed on main.

Co-authored-by: morluto <[email protected]>
SandstromPL added a commit to SandstromPL/rea that referenced this pull request Oct 23, 2026
Resolve conflicts with morluto#3422 (Linux architecture gate) and morluto#5235 (POSIX
joins in MacHopperPaths): keep the shared launcher owner and both
renamed-bundle scans on posix.join, import LINUX_HOPPER_SETUP_HOSTS, and
run the scan agreement test from a Windows-safe temporary home.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@morluto morluto mentioned this pull request Oct 25, 2026
3 tasks done
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working labels Nov 23, 2026
@morluto morluto added the provider: hopper Analysis provider / engine: hopper label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working provider: hopper Analysis provider / engine: hopper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Setup offers automated Hopper installation on Linux arm64, but every pinned Hopper package is x86_64

6 participants