[GH-ISSUE #4501] [Bug] OpenCode layered-registration acceptance depends on host Ghidra discovery #1786

Closed
opened 2026-10-16 21:10:15 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @morluto on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4501

Before submitting

  • Searched open/closed registrationRuntimeEnvironmentCli reports; no matching report found.
  • Removed private host paths and target data.

Area

Other

Observed behavior

Executed the74-file client/setup selection on macOS with a valid caller-installed Ghidra/JDK. OpenCode CLI validates dependent settings after merging JSON and JSONC fails: setup correctly plans and applies configured_opencode to add discovered GHIDRA_INSTALL_DIR/JAVA_HOME, while the test requires empty planned/applied actions and byte-identical files.

Reproduction

npm run test:focused -- tests/acceptance/setup/registrationRuntimeEnvironmentCli.test.ts on a host whose supported Ghidra/JDK is discovered from PATH. The broader executed selection returned984passed21skipped1failed; this test was the failure. A focused repair rerun is pending at filing. No Ghidra engine or target was executed.

Expected behavior

The dependent-setting/layer-merge test should control unrelated provider discovery through public caller-selected installation paths, as it already does for Hopper. Preserve its strong no-write, missing-inherited-setting and no-backup assertions. Product setup should continue registering valid discovered providers in ordinary workflows.

Impact and scope

Observed local false failure in a public CLI acceptance test. CI failure depends on host installations; CI on a host without Ghidra can pass. Not evidence of an OpenCode setup product failure. Investigation confirms clientConfigurationDesired writes the target fragment, not copied lower-layer settings.

REA version

6.5.0; source base fe2a398dd9 with ongoing local audit changes.

Runtime and platform

Node24.18.0, macOS arm64; caller-installed Ghidra12.1.4/JDK21 discovered. Native Windows not run.

Target and artifact context

Isolated real OpenCode JSON/JSONC profile with dependent REA_GHIDRA_LANGUAGE_ID and REA_GHIDRA_COMPILER_SPEC_ID settings.

Interface

CLI acceptance test.

Earliest failure stage

Setup or provider admission

Relevant output or evidence

tests/acceptance/setup/registrationRuntimeEnvironmentCli.test.ts: the OpenCode case pins an absent HOPPER_LAUNCHER_PATH but leaves Ghidra/JDK discovery host-dependent. Executed response: status ready, appliedActions[configured_opencode], plannedActions[configure_client:opencode], with GHIDRA_INSTALL_DIR= and JAVA_HOME=. Assertion expected both arrays empty.

Typed outcome or recovery expected

The acceptance fixture should consistently exercise its intended no-provider-edit workflow. Keep the separate invalid inherited-setting case and assert no files/backups changed.

Analysis or suspected cause

Partial provider isolation in a public workflow fixture. Proposed correction: explicitly select absent Ghidra/JDK directories in this test's environment, retaining native public discovery behavior and all existing assertions.

Originally created by @morluto on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4501 ### Before submitting - [x] Searched open/closed registrationRuntimeEnvironmentCli reports; no matching report found. - [x] Removed private host paths and target data. ### Area Other ### Observed behavior Executed the74-file client/setup selection on macOS with a valid caller-installed Ghidra/JDK. `OpenCode CLI validates dependent settings after merging JSON and JSONC` fails: setup correctly plans and applies `configured_opencode` to add discovered GHIDRA_INSTALL_DIR/JAVA_HOME, while the test requires empty planned/applied actions and byte-identical files. ### Reproduction `npm run test:focused -- tests/acceptance/setup/registrationRuntimeEnvironmentCli.test.ts` on a host whose supported Ghidra/JDK is discovered from PATH. The broader executed selection returned984passed21skipped1failed; this test was the failure. A focused repair rerun is pending at filing. No Ghidra engine or target was executed. ### Expected behavior The dependent-setting/layer-merge test should control unrelated provider discovery through public caller-selected installation paths, as it already does for Hopper. Preserve its strong no-write, missing-inherited-setting and no-backup assertions. Product setup should continue registering valid discovered providers in ordinary workflows. ### Impact and scope Observed local false failure in a public CLI acceptance test. CI failure depends on host installations; CI on a host without Ghidra can pass. Not evidence of an OpenCode setup product failure. Investigation confirms clientConfigurationDesired writes the target fragment, not copied lower-layer settings. ### REA version 6.5.0; source base fe2a398dd9ab290ba6cb3411403d319cec8d07a2 with ongoing local audit changes. ### Runtime and platform Node24.18.0, macOS arm64; caller-installed Ghidra12.1.4/JDK21 discovered. Native Windows not run. ### Target and artifact context Isolated real OpenCode JSON/JSONC profile with dependent REA_GHIDRA_LANGUAGE_ID and REA_GHIDRA_COMPILER_SPEC_ID settings. ### Interface CLI acceptance test. ### Earliest failure stage Setup or provider admission ### Relevant output or evidence `tests/acceptance/setup/registrationRuntimeEnvironmentCli.test.ts`: the OpenCode case pins an absent HOPPER_LAUNCHER_PATH but leaves Ghidra/JDK discovery host-dependent. Executed response: status ready, appliedActions[configured_opencode], plannedActions[configure_client:opencode], with GHIDRA_INSTALL_DIR=<discovered host installation> and JAVA_HOME=<discovered host JDK>. Assertion expected both arrays empty. ### Typed outcome or recovery expected The acceptance fixture should consistently exercise its intended no-provider-edit workflow. Keep the separate invalid inherited-setting case and assert no files/backups changed. ### Analysis or suspected cause Partial provider isolation in a public workflow fixture. Proposed correction: explicitly select absent Ghidra/JDK directories in this test's environment, retaining native public discovery behavior and all existing assertions.
Author
Owner

@1052326311 commented on GitHub (Oct 16, 2026):

Prepared a test-only candidate: dcc4e00d. It selects absent GHIDRA_INSTALL_DIR/JAVA_HOME alongside Hopper in the existing OpenCode fixture; all no-write, merged-dependency and no-backup assertions remain unchanged.

On base 313a86a3 I reproduced the unwanted configured_opencode action using a PATH-discovered filesystem installation fixture and simulated Java property probe (not a real Ghidra/JDK run). With the patch and same discovery fixtures, all 15 tests pass; check and docs:check pass on pinned Node24/macOS arm64. The full passing run selects a temporary root without the substring private; the default macOS /private root independently causes five existing NUL tests to falsely match their no-private-output assertion.

Publication is currently blocked: HTTPS cannot connect, REST ref creation returns404, and GraphQL CreateRef explicitly denies permission. The exact commit object is uploaded and verified, but no topic branch or PR exists yet. Human initial-readiness declarations remain for the human owner.

Update 2026-10-17: fresh main inspection finds the provider isolation and unrelated NUL-fixture assertion repair already landed in maintainer-authored 9abdad33, which references #4501 (and repairs #4496 too). This candidate is superseded; I will not open a duplicate PR. The upstream commit contains no contributor author/co-author attribution, so this is not claimed as credited adoption.

<!-- gh-comment-id:6220329864 --> @1052326311 commented on GitHub (Oct 16, 2026): Prepared a test-only candidate: [dcc4e00d](https://github.com/1052326311/rea/commit/dcc4e00d264308f1f8afe6ff70cf10e4e0fbc66b). It selects absent GHIDRA_INSTALL_DIR/JAVA_HOME alongside Hopper in the existing OpenCode fixture; all no-write, merged-dependency and no-backup assertions remain unchanged. On base 313a86a3 I reproduced the unwanted configured_opencode action using a PATH-discovered filesystem installation fixture and simulated Java property probe (not a real Ghidra/JDK run). With the patch and same discovery fixtures, all 15 tests pass; check and docs:check pass on pinned Node24/macOS arm64. The full passing run selects a temporary root without the substring private; the default macOS /private root independently causes five existing NUL tests to falsely match their no-private-output assertion. Publication is currently blocked: HTTPS cannot connect, REST ref creation returns404, and GraphQL CreateRef explicitly denies permission. The exact commit object is uploaded and verified, but no topic branch or PR exists yet. Human initial-readiness declarations remain for the human owner. Update 2026-10-17: fresh main inspection finds the provider isolation and unrelated NUL-fixture assertion repair already landed in maintainer-authored [9abdad33](https://github.com/morluto/rea/commit/9abdad335c22cf5af2a4518a0a3f8864ea7f983a), which references #4501 (and repairs #4496 too). This candidate is superseded; I will not open a duplicate PR. The upstream commit contains no contributor author/co-author attribution, so this is not claimed as credited adoption.
Author
Owner

@morluto commented on GitHub (Oct 17, 2026):

Revalidated and closing as fixed on main abb54ce3743dd51a54304833a6e081b89243a5e8. The runtime fixes were already published in 9abdad335; this reconciliation adds missing focused regressions in abb54ce37.

The fixture isolation is already present in 9abdad335. The OpenCode dependent-setting CLI test now selects absent GHIDRA_INSTALL_DIR/JAVA_HOME beside its Hopper override, preserving the existing no-write, merged dependency and no-backup assertions. The entire registrationRuntimeEnvironmentCli file passes (15 public CLI tests). No duplicate provider-isolation implementation or contributor candidate was integrated in this reconciliation.

Validation:82 tests across four configuration/CLI files passed. Seven newly checked-in controls ran against pre-fix6d5281407: six failed for the expected original defects and one existing-behavior guard passed; all seven pass now. Typecheck/lint, formatting, test discovery (1563files exactly once) and pre-push checks passed. Related header/skill/doctor reconciliation added186passing checks across nine other files.

Scope: macOS arm64 / Node24.18.0; controlled native files, source/platform-selected Windows adapters and real REA CLI commands. No native Windows Claude app,3P deployment, Windows/Linux permission fault or provider/target execution was verified. No full-suite or performance improvement claim.

<!-- gh-comment-id:6242954405 --> @morluto commented on GitHub (Oct 17, 2026): Revalidated and closing as fixed on main `abb54ce3743dd51a54304833a6e081b89243a5e8`. The runtime fixes were already published in `9abdad335`; this reconciliation adds missing focused regressions in `abb54ce37`. The fixture isolation is already present in 9abdad335. The OpenCode dependent-setting CLI test now selects absent GHIDRA_INSTALL_DIR/JAVA_HOME beside its Hopper override, preserving the existing no-write, merged dependency and no-backup assertions. The entire registrationRuntimeEnvironmentCli file passes (15 public CLI tests). No duplicate provider-isolation implementation or contributor candidate was integrated in this reconciliation. Validation:82 tests across four configuration/CLI files passed. Seven newly checked-in controls ran against pre-fix6d5281407: six failed for the expected original defects and one existing-behavior guard passed; all seven pass now. Typecheck/lint, formatting, test discovery (1563files exactly once) and pre-push checks passed. Related header/skill/doctor reconciliation added186passing checks across nine other files. Scope: macOS arm64 / Node24.18.0; controlled native files, source/platform-selected Windows adapters and real REA CLI commands. No native Windows Claude app,3P deployment, Windows/Linux permission fault or provider/target execution was verified. No full-suite or performance improvement claim.
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#1786
No description provided.