[GH-ISSUE #4555] [Bug] Static native inspection CLI commands require unrelated deep-provider selection #2369

Closed
opened 2026-10-17 21:03:49 +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/4555

Before submitting

  • I searched open and closed issues for a related report. Related #726 documents explicit selection for deep analysis; this report concerns static native helper CLI operations.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

CLI

Observed behavior

Three public inspect-macho workflows fail before native inspection when the host has both Hopper and Ghidra available. The CLI advertises this operation as running without launching Hopper, but its session creation first requires choosing a deep-analysis provider.

Observed projected result:

{"code":"capability_unavailable","details":{"operation":"open_binary","selection_reason":"ambiguous","requested_provider_id":"auto","candidate_ids":["ghidra","hopper","ida","kuna"]}}

The message requests provider_id, --provider, or REA_ANALYSIS_PROVIDER. IDA and Kuna were reported unconfigured. The failing commands never reach the native adapter.

Reproduction

Executed twice on macOS arm64 with Node 24.18.0:

npm run test:focused -- tests/boundary/cli/nativeMachoObjectSegmentCli.test.ts tests/boundary/cli/nativeMachoLinkerOptionsCli.test.ts tests/boundary/cli/nativeMachoDylibIdentityCli.test.ts

All three fail with CLI exit 1 instead of 0. Each test compiles its own C fixture using system xcrun clang, then calls inspect-macho <fixture> --json. Targets cover thin Mach-O object files and a dylib. Exact temporary artifact digests were not retained: NOT_ENOUGH_INFO for those digests.

REA 6.5.0 at 9d940c2f284cc6f75b27900336e52ceeba4aa2af plus local native error-propagation edits. The affected selection/composition sources are unchanged from that commit; this is not claimed as a separate clean-checkout reproduction.

Expected behavior

Static native helper inspection should reach its existing native provider without requiring an unrelated deep-analysis preference. Keep deep-provider selection explicit for tasks that actually use those engines.

Impact and scope

Observed for three thin Mach-O native inspection CLI workflows on one host with multiple configured engines. Other native commands and MCP workflows have not been reproduced for this report.

Relevant output or evidence

Source-derived boundary: native CLI registration calls runProviderAnalysis; direct analysis selects a special session for artifact operations but uses the default session for native helpers; binary composition includes the deep-engine registry before the auxiliary native provider.

Typed outcome or recovery expected

Return native inspection Evidence, or a typed native-tool/target readiness failure. Deep-provider ambiguity should remain relevant to deep analysis operations.

Analysis or suspected cause

Source-derived: native helper CLI session admission runs deep-engine selection before the requested native operation is considered. Proposed check: compose a session from the existing native provider for the static helper workflow, preserving target identity, caller inputs, cleanup and Evidence. This does not request new providers or target-execution authority.

Originally created by @morluto on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4555 ### Before submitting - [x] I searched open and closed issues for a related report. Related #726 documents explicit selection for deep analysis; this report concerns static native helper CLI operations. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area CLI ### Observed behavior Three public `inspect-macho` workflows fail before native inspection when the host has both Hopper and Ghidra available. The CLI advertises this operation as running without launching Hopper, but its session creation first requires choosing a deep-analysis provider. Observed projected result: ```json {"code":"capability_unavailable","details":{"operation":"open_binary","selection_reason":"ambiguous","requested_provider_id":"auto","candidate_ids":["ghidra","hopper","ida","kuna"]}} ``` The message requests `provider_id`, `--provider`, or `REA_ANALYSIS_PROVIDER`. IDA and Kuna were reported unconfigured. The failing commands never reach the native adapter. ### Reproduction Executed twice on macOS arm64 with Node 24.18.0: ``` npm run test:focused -- tests/boundary/cli/nativeMachoObjectSegmentCli.test.ts tests/boundary/cli/nativeMachoLinkerOptionsCli.test.ts tests/boundary/cli/nativeMachoDylibIdentityCli.test.ts ``` All three fail with CLI exit 1 instead of 0. Each test compiles its own C fixture using system `xcrun clang`, then calls `inspect-macho <fixture> --json`. Targets cover thin Mach-O object files and a dylib. Exact temporary artifact digests were not retained: NOT_ENOUGH_INFO for those digests. REA 6.5.0 at `9d940c2f284cc6f75b27900336e52ceeba4aa2af` plus local native error-propagation edits. The affected selection/composition sources are unchanged from that commit; this is not claimed as a separate clean-checkout reproduction. ### Expected behavior Static native helper inspection should reach its existing native provider without requiring an unrelated deep-analysis preference. Keep deep-provider selection explicit for tasks that actually use those engines. ### Impact and scope Observed for three thin Mach-O native inspection CLI workflows on one host with multiple configured engines. Other native commands and MCP workflows have not been reproduced for this report. ### Relevant output or evidence Source-derived boundary: [native CLI registration](https://github.com/morluto/rea/blob/9d940c2f284cc6f75b27900336e52ceeba4aa2af/src/cli/utilityCommands.ts#L172) calls `runProviderAnalysis`; [direct analysis](https://github.com/morluto/rea/blob/9d940c2f284cc6f75b27900336e52ceeba4aa2af/src/application/DirectAnalysis.ts#L130) selects a special session for artifact operations but uses the default session for native helpers; [binary composition](https://github.com/morluto/rea/blob/9d940c2f284cc6f75b27900336e52ceeba4aa2af/src/composition/binary.ts#L20) includes the deep-engine registry before the auxiliary native provider. ### Typed outcome or recovery expected Return native inspection Evidence, or a typed native-tool/target readiness failure. Deep-provider ambiguity should remain relevant to deep analysis operations. ### Analysis or suspected cause Source-derived: native helper CLI session admission runs deep-engine selection before the requested native operation is considered. Proposed check: compose a session from the existing native provider for the static helper workflow, preserving target identity, caller inputs, cleanup and Evidence. This does not request new providers or target-execution authority.
Author
Owner

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

This appears to already be resolved on main via commit f31b231a9 (fix(cli): validate run command flags and argument bounds).

<!-- gh-comment-id:6224428922 --> @nikhilsaxena04 commented on GitHub (Oct 16, 2026): This appears to already be resolved on `main` via commit f31b231a9 (`fix(cli): validate run command flags and argument bounds`).
Author
Owner

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

Closing as fixed on main after reconciling this report with the landed owner/consumer changes.

  • 060587b45: fix(cli): prefer native byte inspection for automatic dispatch metadata. Share runtime composition and target admission with the native byte reader. Keep target parsing, resource ownership and Evidence on the original session.
  • a70c42e03: fix(native): recover malformed Objective-C names at decode boundaries. Byte fixtures reproduced the reported validation failures. Final focused 4-file run: 118 passed; npm run check passed. Six existing CLI property controls remain blocked before decoding by deep-provider auto-selection ambiguity, as exposed by improved assertion diagnostics (#4555). No Windows runtime or real malformed-application verification performed.

Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.

<!-- gh-comment-id:6256003905 --> @morluto commented on GitHub (Oct 18, 2026): <!-- rea-backlog-reconciliation-2026-10-19-4555 --> Closing as fixed on `main` after reconciling this report with the landed owner/consumer changes. - [060587b45](https://github.com/morluto/rea/commit/060587b4567a1c92e8926c9b210008f7099e062c): fix(cli): prefer native byte inspection for automatic dispatch metadata. Share runtime composition and target admission with the native byte reader. Keep target parsing, resource ownership and Evidence on the original session. - [a70c42e03](https://github.com/morluto/rea/commit/a70c42e03dc526e76f360ecec9f1002187ffb23e): fix(native): recover malformed Objective-C names at decode boundaries. Byte fixtures reproduced the reported validation failures. Final focused 4-file run: 118 passed; npm run check passed. Six existing CLI property controls remain blocked before decoding by deep-provider auto-selection ambiguity, as exposed by improved assertion diagnostics (#4555). No Windows runtime or real malformed-application verification performed. Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.
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#2369
No description provided.