[PR #2983] [CLOSED] fix(setup): carry REA_JADX_MCP_JAR into agent registrations #5536

Closed
opened 2026-10-31 01:07:24 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2983
Author: @sx4im
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: fix/2944-jadx-jar-registration


📝 Commits (6)

  • b4365ed fix(setup): carry REA_JADX_MCP_JAR into agent registrations
  • b12d25c fix(setup): persist JDK selection and caller JAR path in jadx registrations
  • 2153ef7 fix(android): derive jadx remediation from failing phase and carry resource overrides
  • ca7a122 fix(android): route jadx remediation by failing phase and expose jadx provider scope
  • e15d265 fix(android): tag jadx failure kinds at the configuration boundary
  • e10147d fix(android): classify malformed JAVA_HOME as drift and preserve probe diagnostics

📊 Changes

10 files changed (+742 additions, -3 deletions)

View changed files

📝 src/android/JadxConfiguration.ts (+118 -2)
➕ src/android/JadxDoctor.ts (+140 -0)
📝 src/android/JadxRelease.ts (+20 -0)
📝 src/application/Doctor.ts (+1 -0)
📝 src/application/DoctorDiagnostics.ts (+1 -0)
📝 src/application/DoctorProviderIds.ts (+1 -1)
➕ src/doctorRuntime.test.ts (+56 -0)
📝 src/doctorRuntime.ts (+2 -0)
📝 tests/boundary/android/jadxConfiguration.test.ts (+7 -0)
➕ tests/boundary/android/jadxDoctor.test.ts (+396 -0)

📄 Description

With REA_JADX_MCP_JAR set in the shell, rea setup wrote only GHIDRA_INSTALL_DIR/JAVA_HOME into the agent MCP registration. Any agent session started without the variable then hit capability_unavailable on the Android tools.

Root cause: the registration environment is built only from DoctorProviderInspection.registrationEnvironment (see SetupRegistrationEnvironment.ts), and the system doctor host composed inspections for Ghidra and IDA only. There was no JADX inspection, so a validated JAR path had no route into the registration.

This adds one, following the Ghidra/IDA pattern:

  • src/android/JadxDoctor.ts (new): inspectJadxProvider() runs the existing inspectJadxAvailability() checks and projects the result into the doctor contract. REA_JADX_MCP_JAR is published as registration environment only when the configured JAR validates (the canonicalized real path, not the raw env var); otherwise nothing is published and the configuration check reports the failure with the repo's classification taxonomy (missing_analysis_engine, config_drift, missing_dependency, unsupported_host).
  • src/doctorRuntime.ts: the inspection is wired into createSystemDoctorHost's providerInspections next to Ghidra and IDA.

Verified with TDD. The composition test failed before the fix (expected [ 'ghidra', 'ida' ] to include 'jadx'), then went green with it. New tests: 4 unit cases in tests/boundary/android/jadxDoctor.test.ts (valid JAR publishes the var, unset var publishes nothing, invalid JAR publishes nothing, missing JDK classified as missing_dependency) and 2 composition cases in src/doctorRuntime.test.ts (validated var carried into providerRegistrationEnvironment, absent when unconfigured).

Broader suites: 90 passed, 1 skipped (pre-existing platform-conditional skip), across the android boundary tests, setup planning, and the Ghidra/IDA/doctor tests. npm run check:fast (typecheck + lint), npm run verify:test-discovery (1114 test files), npm run verify:package, and npm pack --dry-run all pass.

Fixes #2944


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2983 **Author:** [@sx4im](https://github.com/sx4im) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/2944-jadx-jar-registration` --- ### 📝 Commits (6) - [`b4365ed`](https://github.com/morluto/rea/commit/b4365ed80f923516d5b4bdc70c5442d81a2b02b7) fix(setup): carry REA_JADX_MCP_JAR into agent registrations - [`b12d25c`](https://github.com/morluto/rea/commit/b12d25cb3f43f1816b2174f748afa555386ee218) fix(setup): persist JDK selection and caller JAR path in jadx registrations - [`2153ef7`](https://github.com/morluto/rea/commit/2153ef79869d07d98ba42650233dd0d85e5ee3b6) fix(android): derive jadx remediation from failing phase and carry resource overrides - [`ca7a122`](https://github.com/morluto/rea/commit/ca7a122b8e71dc59373044d0ab761738169d013b) fix(android): route jadx remediation by failing phase and expose jadx provider scope - [`e15d265`](https://github.com/morluto/rea/commit/e15d265a1069a2eb15d0b4e1ca9aad152f0f4c15) fix(android): tag jadx failure kinds at the configuration boundary - [`e10147d`](https://github.com/morluto/rea/commit/e10147de61271d093b9a0e84ec0608f36b583032) fix(android): classify malformed JAVA_HOME as drift and preserve probe diagnostics ### 📊 Changes **10 files changed** (+742 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/android/JadxConfiguration.ts` (+118 -2) ➕ `src/android/JadxDoctor.ts` (+140 -0) 📝 `src/android/JadxRelease.ts` (+20 -0) 📝 `src/application/Doctor.ts` (+1 -0) 📝 `src/application/DoctorDiagnostics.ts` (+1 -0) 📝 `src/application/DoctorProviderIds.ts` (+1 -1) ➕ `src/doctorRuntime.test.ts` (+56 -0) 📝 `src/doctorRuntime.ts` (+2 -0) 📝 `tests/boundary/android/jadxConfiguration.test.ts` (+7 -0) ➕ `tests/boundary/android/jadxDoctor.test.ts` (+396 -0) </details> ### 📄 Description With `REA_JADX_MCP_JAR` set in the shell, `rea setup` wrote only `GHIDRA_INSTALL_DIR`/`JAVA_HOME` into the agent MCP registration. Any agent session started without the variable then hit `capability_unavailable` on the Android tools. Root cause: the registration environment is built only from `DoctorProviderInspection.registrationEnvironment` (see `SetupRegistrationEnvironment.ts`), and the system doctor host composed inspections for Ghidra and IDA only. There was no JADX inspection, so a validated JAR path had no route into the registration. This adds one, following the Ghidra/IDA pattern: - `src/android/JadxDoctor.ts` (new): `inspectJadxProvider()` runs the existing `inspectJadxAvailability()` checks and projects the result into the doctor contract. `REA_JADX_MCP_JAR` is published as registration environment only when the configured JAR validates (the canonicalized real path, not the raw env var); otherwise nothing is published and the `configuration` check reports the failure with the repo's classification taxonomy (`missing_analysis_engine`, `config_drift`, `missing_dependency`, `unsupported_host`). - `src/doctorRuntime.ts`: the inspection is wired into `createSystemDoctorHost`'s `providerInspections` next to Ghidra and IDA. Verified with TDD. The composition test failed before the fix (`expected [ 'ghidra', 'ida' ] to include 'jadx'`), then went green with it. New tests: 4 unit cases in `tests/boundary/android/jadxDoctor.test.ts` (valid JAR publishes the var, unset var publishes nothing, invalid JAR publishes nothing, missing JDK classified as `missing_dependency`) and 2 composition cases in `src/doctorRuntime.test.ts` (validated var carried into `providerRegistrationEnvironment`, absent when unconfigured). Broader suites: 90 passed, 1 skipped (pre-existing platform-conditional skip), across the android boundary tests, setup planning, and the Ghidra/IDA/doctor tests. `npm run check:fast` (typecheck + lint), `npm run verify:test-discovery` (1114 test files), `npm run verify:package`, and `npm pack --dry-run` all pass. Fixes #2944 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:07:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5536
No description provided.