Skip to content

fix(verify-package): read Hopper installer applicability from its owner - #2973

Merged
morluto merged 3 commits into
morluto:mainfrom
txiki739:fix/verify-package-hopper-installer-support
Oct 13, 2026
Merged

morluto merged 3 commits into
morluto:mainfrom
txiki739:fix/verify-package-hopper-installer-support

Conversation

@txiki739

Copy link
Copy Markdown
Contributor

What

npm run verify:package fails on Debian-family hosts that REA supports but the automatic Hopper installer never tested — Debian 12 in the report, Kali 2026.3 here. The packaged setup correctly answers needs_human to --install-hopper; the verifier expected needs_confirmation.

Root cause

packageSetupSupport derived hopperSetupSupported from the general doctor host check plus a non-Windows condition. After #2073 that check means "REA runs here", which is a different fact from "the Hopper package was tested on this distribution", so on Kali and Debian both flags came back true while the owning readLinuxDistribution() reports hopperSetupSupported: false.

Change

  • scripts/verify-package-discovery.mjs — installer applicability now comes from readLinuxDistribution() in the built application, so the verifier follows the predicate the package ships instead of restating it. An unreadable distribution stays undefined rather than collapsing into a known-unsupported host, nothing is inferred from packageFamily, and doctor prose is never parsed. The distribution is imported lazily, which also keeps the derivation testable without a build.
  • scripts/verify-package-setup.mjs — the expected status for the explicit --install-hopper request is needs_confirmation only when applicability is explicitly true. The generic configuration and idempotence assertions (first, aligned) are untouched and remain independent of installer applicability; the expectation is still derived from the host rather than from the request being asserted.
  • scripts/verify-package-discovery.d.mts — contract updated. It is the source of truth for this script's types, and the previous one still declared platform: NodeJS.Platform.
  • tests/evaluation/package/packageSetupSupport.test.ts — positive/negative applicability selection: a Kali fixture (REA-supported, installer-untested) selects false; Ubuntu 24 selects true even when the doctor host check fails; an unreadable distribution stays undefined; macOS follows the owner's predicate; Windows selects false; agent setup support still comes from the node check alone. Fixtures are derived from what readLinuxDistribution() actually returns for those os-release files.

Verification

On Kali 2026.3 (Debian-family, hopperSetupSupported: false), with the packaged fixture's simulated Hopper environment and no other deep provider — the reporter's host profile:

npm run verify:package
before this change fails at verify-package-setup.mjs:403; packaged setup returns needs_human with an install_hopper plan and nothing applied
after this change passes every stage, exit 0
  • npm run test:local -- tests/evaluation/package/packageSetupSupport.test.ts tests/evaluation/package/packagePlatformDiagnostics.test.ts → 12 passed, and the new file needs no build.
  • npm run typecheck and npm run lint (including verify:module-boundaries) clean.
  • Branch coverage: this host exercises the negative branch; the Native package baseline job runs npm run verify:package on ubuntu-latest and ubuntu-24.04-arm, where applicability is true, so the positive branch stays exercised. Debian 12 itself was not re-run here.
  • No real Hopper installation was exercised, so no engine-compatibility claim follows from the simulated provider environment.

Closes #2939

packageSetupSupport derived hopperSetupSupported from the general doctor
host check plus a non-Windows condition, so a Debian-family host REA
supports but the Hopper package never tested reported an automated
installer the packaged setup never offers. verifySetupApply then expected
needs_confirmation for the explicit --install-hopper request and failed
at verify-package-setup.mjs:403.

Applicability now comes from readLinuxDistribution() in the built
application, so the verifier follows the predicate the package ships, and
it stays unknown when no distribution can be read instead of collapsing
into a known-unsupported host. Generic agent configuration and idempotence
assertions stay independent of installer applicability, and the expected
status is still derived from the host rather than from the request being
asserted.

Verified on Kali 2026.3, a Debian-family host with an installer-untested
distribution and the simulated Hopper package environment: before the
change npm run verify:package fails at verify-package-setup.mjs:403 with
the packaged setup correctly returning needs_human; after it the same run
passes every stage. Both applicability branches are covered by
tests/evaluation/package/packageSetupSupport.test.ts, which runs in the
source lane without a build. No real Hopper installation was exercised,
so no engine compatibility claim follows.

Refs morluto#2939
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T19:10:42.814077Z e6f9e87 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@txiki739

Copy link
Copy Markdown
Contributor Author

Note on reproducing #2939 locally (observation only, no code change proposed here)

While reproducing the report on Kali 2026.3 I hit a second, unrelated host dependence in the same verifier, worth recording in case others on Ghidra hosts try to reproduce this.

verify-package-environment.mjs:75 builds the isolated environment with ...process.env, and :123 sets HOPPER_LAUNCHER_PATH: "/bin/sh" to simulate the Hopper package. Nothing removes GHIDRA_INSTALL_DIR, so on a machine where Ghidra is installed and exported from the shell, the packaged CLI sees two providers for the fixture target and the run dies in the platform CLI stage before the setup stage is ever reached:

Error: packaged Linux Hopper verification did not fail closed:
{"code":"capability_unavailable","category":"unsupported_provider",
 "message":"Multiple analysis providers support this target. Choose one with provider_id, --provider, …"}
    at assertLinuxPackageProviderFailure (scripts/verify-package-platform.mjs:92:11)

That masks #2939 on exactly the hosts where it is easiest to hit: the run stops early, so the needs_confirmation / needs_human mismatch at verify-package-setup.mjs:403 never fires. Hiding the other provider reproduces the reporter's host profile:

env -u GHIDRA_INSTALL_DIR -u JAVA_HOME npm run verify:package

With that, main fails at :403 and this branch passes every stage. Whether the verifier should clear ambient provider variables, or pin provider_id in the platform fixture, looks like a separate call — I left it alone here.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was found.

Summary

The PR separates REA host support from automatic Hopper installer support.

  • Package checks match Hopper setup status to installer support.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Doctor checks] --> B[Node check: agent setup support]
  A --> C[Host check: require existing Hopper readiness]
  D[readLinuxDistribution] --> E[Linux installer applicability]
  E --> F{Explicitly true?}
  F -->|Yes| G[Expect needs_confirmation]
  F -->|No or unknown| H[Expect needs_human]
Loading

Reviews (3) · Last reviewed commit: "Merge commit '2895a18ca92f415ae62f87167b..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f3924a701

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/verify-package-discovery.mjs Resolved
@morluto
morluto merged commit e1897c3 into morluto:main Oct 13, 2026
3 checks passed
@txiki739
txiki739 deleted the fix/verify-package-hopper-installer-support branch October 13, 2026 19:36
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
DavidFB-creator added a commit to DavidFB-creator/rea that referenced this pull request Oct 14, 2026
…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.
morluto pushed a commit that referenced this pull request Oct 22, 2026
* fix(hopper): keep automated Linux setup off non-x86_64 hosts

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 #3419

* fix(hopper): install Linux Hopper from the setup host's distribution 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.

* fix(verify-package): require Hopper readiness only where Linux setup 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 #2973 on hosts outside the
installer matrix, such as Kali and ubuntu-24.04-arm.

---------

Co-authored-by: DavidFB-creator <[email protected]>
Co-authored-by: Kaoru0822 <[email protected]>
@morluto morluto added area: tests Test suite and verification provider: hopper Analysis provider / engine: hopper labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: tests Test suite and verification bug Something isn't working provider: hopper Analysis provider / engine: hopper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(verify-package): distinguish host readiness from Hopper installer support

2 participants