[GH-ISSUE #8322] [Bug] Kuna ELF UI-trace discovery advertises an unavailable native-seed route #6546

Closed
opened 2026-11-01 21:12:06 +00:00 by bsakaguchi · 6 comments
Owner

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

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Provider or capability discovery

Observed behavior

With Kuna selected on an x86-64 ELF, binary_session reports the trace_native_ui_action mode native_seed_call_trace as available with no missing operations. Both a known native function name and its exact address then fail with capability_unavailable for list_names, which Kuna does not declare. The same session reports inspect_native_dispatch_metadata available, but that call fails the same way.

Reproduction

Using the self-built ELF and initial_only_call function from #8277 on REA b43c329 with Kuna 1.986:

  1. open_binary({path: <fixture.elf>, provider_id: "kuna"}) succeeds.
  2. binary_session({}) reports trace_native_ui_action → native_seed_call_trace: available, missing_operations: []. It separately marks list_names unavailable.
  3. procedure_address({procedure: "initial_only_call"}) returns 0x20117a.
  4. trace_native_ui_action({action: "0x20117a", max_depth: 3, max_nodes: 15, max_edges: 20}) returns capability_unavailable, details.operation: "list_names". The explicit function-name seed produces the same error. inspect_native_dispatch_metadata({}) also fails on list_names.
  5. procedure_callees remains usable, and close_binary succeeds. The target hash is unchanged; it was not executed.

I reproduced the address and name failures in a second fresh MCP server. As a format control, a different owned arm64 Mach-O using the same Kuna release reports the native-seed mode available and successfully completes both dispatch inspection and native-seeded UI tracing. A real Ghidra session on the ELF also completes the native-seeded trace. These controls do not establish all ELF or Mach-O behavior.

Expected behavior

Availability for the selected target and mode should reflect the operations the workflow can actually use, or distinguish unverified applicability from an available route. If the intended native-seed route can answer without dispatch metadata, that is a separate design option; do not manufacture UI or dispatch facts, silently switch providers, or drop uncertainty to make the advertised route succeed.

Impact and scope

An agent following session discovery can choose an advertised route that predictably fails for this observed target/provider pair, even when it supplies the already resolved address. No autonomous agent behavior, other hosts, other target formats, or CLI discovery were measured.

REA version

b43c329df779708e43ae297f498a844e45d9c923. The named discovery and workflow source files are unchanged at fetched origin/main 23de10bb2849cdce8ddbe70504aa7cc57de75a98; that newer runtime was not run.

Runtime and platform

Node 24.22.1, macOS arm64, Kuna 1.986; Ghidra 12.1.4/JDK 21 control.

Target and artifact context

One self-built x86-64 ELF and one separate arm64 Mach-O; static analysis only.

Interface

MCP

Earliest failure stage

Setup or provider admission (session capability discovery).

Relevant output or evidence

binary_session: trace_native_ui_action.native_seed_call_trace
  available: true; missing_operations: []
procedure_address(initial_only_call): 0x20117a
trace_native_ui_action(action=0x20117a):
  capability_unavailable; provider_id=kuna; operation=list_names
  reason=operation is not declared by this provider

Source-derived: native UI tracing attempts dispatch inspection before resolving the native seed. Dispatch inspection tries native binary metadata, then list_names after an eligible capability failure. Discovery composition names those alternatives; the exact erroneous target-applicability classification still needs diagnosis.

Typed outcome or recovery expected

A truthful target-specific unavailable or unknown route, with useful missing-operation context, unless execution is changed to support the native-seed case. Preserve the existing working Mach-O route and mode-specific availability.

Additional context

#7651 concerns loss of a failed dispatch reader's reason in a different 32-bit Mach-O fallback; #5071 concerned discovery rejecting working routes. This report concerns an advertised ELF/Kuna route that fails at execution. Suggested verification: public MCP discovery followed by execution for ELF/Kuna, Mach-O/Kuna, and supported symbol-fallback providers; distinguish genuinely unavailable metadata from failed I/O and preserve target identity. @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0

Originally created by @morluto on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/8322 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Provider or capability discovery ### Observed behavior With Kuna selected on an x86-64 ELF, `binary_session` reports the `trace_native_ui_action` mode `native_seed_call_trace` as available with no missing operations. Both a known native function name and its exact address then fail with `capability_unavailable` for `list_names`, which Kuna does not declare. The same session reports `inspect_native_dispatch_metadata` available, but that call fails the same way. ### Reproduction Using the self-built ELF and `initial_only_call` function from #8277 on REA `b43c329` with Kuna 1.986: 1. `open_binary({path: <fixture.elf>, provider_id: "kuna"})` succeeds. 2. `binary_session({})` reports `trace_native_ui_action` → `native_seed_call_trace: available`, `missing_operations: []`. It separately marks `list_names` unavailable. 3. `procedure_address({procedure: "initial_only_call"})` returns `0x20117a`. 4. `trace_native_ui_action({action: "0x20117a", max_depth: 3, max_nodes: 15, max_edges: 20})` returns `capability_unavailable`, `details.operation: "list_names"`. The explicit function-name seed produces the same error. `inspect_native_dispatch_metadata({})` also fails on `list_names`. 5. `procedure_callees` remains usable, and `close_binary` succeeds. The target hash is unchanged; it was not executed. I reproduced the address and name failures in a second fresh MCP server. As a format control, a different owned arm64 Mach-O using the same Kuna release reports the native-seed mode available and successfully completes both dispatch inspection and native-seeded UI tracing. A real Ghidra session on the ELF also completes the native-seeded trace. These controls do not establish all ELF or Mach-O behavior. ### Expected behavior Availability for the selected target and mode should reflect the operations the workflow can actually use, or distinguish unverified applicability from an available route. If the intended native-seed route can answer without dispatch metadata, that is a separate design option; do not manufacture UI or dispatch facts, silently switch providers, or drop uncertainty to make the advertised route succeed. ### Impact and scope An agent following session discovery can choose an advertised route that predictably fails for this observed target/provider pair, even when it supplies the already resolved address. No autonomous agent behavior, other hosts, other target formats, or CLI discovery were measured. ### REA version `b43c329df779708e43ae297f498a844e45d9c923`. The named discovery and workflow source files are unchanged at fetched `origin/main` `23de10bb2849cdce8ddbe70504aa7cc57de75a98`; that newer runtime was not run. ### Runtime and platform Node 24.22.1, macOS arm64, Kuna 1.986; Ghidra 12.1.4/JDK 21 control. ### Target and artifact context One self-built x86-64 ELF and one separate arm64 Mach-O; static analysis only. ### Interface MCP ### Earliest failure stage Setup or provider admission (session capability discovery). ### Relevant output or evidence ```text binary_session: trace_native_ui_action.native_seed_call_trace available: true; missing_operations: [] procedure_address(initial_only_call): 0x20117a trace_native_ui_action(action=0x20117a): capability_unavailable; provider_id=kuna; operation=list_names reason=operation is not declared by this provider ``` Source-derived: [native UI tracing](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/application/native/NativeUiActionTrace.ts#L43-L55) attempts dispatch inspection before resolving the native seed. [Dispatch inspection](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/application/native/NativeDispatchMetadataInspection.ts#L52-L87) tries native binary metadata, then `list_names` after an eligible capability failure. [Discovery composition](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/application/CapabilityInventory.ts#L174-L201) names those alternatives; the exact erroneous target-applicability classification still needs diagnosis. ### Typed outcome or recovery expected A truthful target-specific unavailable or unknown route, with useful missing-operation context, unless execution is changed to support the native-seed case. Preserve the existing working Mach-O route and mode-specific availability. ### Additional context #7651 concerns loss of a failed dispatch reader's reason in a different 32-bit Mach-O fallback; #5071 concerned discovery rejecting working routes. This report concerns an advertised ELF/Kuna route that fails at execution. Suggested verification: public MCP discovery followed by execution for ELF/Kuna, Mach-O/Kuna, and supported symbol-fallback providers; distinguish genuinely unavailable metadata from failed I/O and preserve target identity. @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0
bsakaguchi 2026-11-01 21:12:06 +00:00
  • closed this issue
  • added the
    bug
    triage
    labels
Author
Owner

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

Follow-up: target applicability is lost before the composed discovery decision, based on source inspection plus another real-provider control.

  • binary_session({detail:"complete"}) on both the failing ELF/Kuna session and the working Mach-O/Kuna session listed native-macos's inspect_native_dispatch_metadata capability as available: true. Its declaration uses host platform, while its execution boundary also rejects a non-Mach-O target. Session routing carries the auxiliary declarations into the selected route; the composition evaluator treats an available alternative as sufficient. This explains the observed mismatch for this case; it is not a claim about every capability declaration.
  • On the same ELF, real Ghidra list_names, dispatch inspection and native-seeded UI tracing succeeded. The dispatch result attributed its source to Ghidra and explicitly reported symbol-only partial/unsupported facets. Thus a correction should preserve that valid alternative rather than blanket-disabling ELF dispatch workflows.
  • Existing focused tests demonstrate pieces separately: capability inventory supplies an available descriptor for a universal Mach-O, and enhanced native tests exercise a controlled symbol fallback. These examples do not establish end-to-end discovery/execution agreement for the ELF/Kuna combination; this is a coverage observation, not a claim that no other tests exist.

A useful public-workflow regression would compare reported modes to the subsequent call for ELF/Kuna, ELF/Ghidra fallback and Mach-O/Kuna. The target was unmodified and unexecuted; all three are one-host controls.

<!-- gh-comment-id:6544890520 --> @morluto commented on GitHub (Oct 31, 2026): Follow-up: target applicability is lost before the composed discovery decision, based on source inspection plus another real-provider control. - `binary_session({detail:"complete"})` on both the failing ELF/Kuna session and the working Mach-O/Kuna session listed `native-macos`'s `inspect_native_dispatch_metadata` capability as `available: true`. Its [declaration](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/native/NativeMacOSProviderMetadata.ts#L34-L57) uses host platform, while its [execution boundary](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/native/NativeMacOSProvider.ts#L309-L329) also rejects a non-Mach-O target. [Session routing](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/application/binary/SessionProviderRouter.ts#L130-L154) carries the auxiliary declarations into the selected route; the [composition evaluator](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/application/CapabilityInventory.ts#L874-L898) treats an available alternative as sufficient. This explains the observed mismatch for this case; it is not a claim about every capability declaration. - On the **same ELF**, real Ghidra `list_names`, dispatch inspection and native-seeded UI tracing succeeded. The dispatch result attributed its source to Ghidra and explicitly reported symbol-only partial/unsupported facets. Thus a correction should preserve that valid alternative rather than blanket-disabling ELF dispatch workflows. - Existing focused tests demonstrate pieces separately: [capability inventory](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/application/CapabilityInventory.test.ts#L238-L254) supplies an available descriptor for a universal Mach-O, and [enhanced native tests](https://github.com/morluto/rea/blob/b43c329df779708e43ae297f498a844e45d9c923/src/application/native/EnhancedNativeInvestigation.test.ts#L562-L602) exercise a controlled symbol fallback. These examples do not establish end-to-end discovery/execution agreement for the ELF/Kuna combination; this is a coverage observation, not a claim that no other tests exist. A useful public-workflow regression would compare reported modes to the subsequent call for ELF/Kuna, ELF/Ghidra fallback and Mach-O/Kuna. The target was unmodified and unexecuted; all three are one-host controls.
Author
Owner

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

Recovery control in one real MCP connection, same ELF, REA b43c329, Kuna 1.986 and Ghidra 12.1.4: after the Kuna trace failed, binary_session still showed the target bound to Kuna. An explicit open_binary of the same path with provider_id: "ghidra" succeeded, and the same address-seeded trace succeeded with partial static-call coverage and unsupported cross-function value flow. Explicitly reopening with provider_id: "kuna" switched back and reproduced the original list_names error; the target digest stayed unchanged and close succeeded. No annotations were made in this test.

The failure's headline/remediation says “Choose another analysis or target”; it does not suggest selecting a different provider. A provider switch is an available recovery only when an appropriate provider is configured and applicable, and it changes the active provider/session. Existing #8289 covers the separate fact that switching away from an edited ephemeral Ghidra session can discard live edits. This one controlled recovery is not a recommendation for silent fallback or a claim that Ghidra and Kuna offer equivalent evidence.

<!-- gh-comment-id:6544898361 --> @morluto commented on GitHub (Oct 31, 2026): Recovery control in one real MCP connection, same ELF, REA `b43c329`, Kuna 1.986 and Ghidra 12.1.4: after the Kuna trace failed, `binary_session` still showed the target bound to Kuna. An explicit `open_binary` of the same path with `provider_id: "ghidra"` succeeded, and the same address-seeded trace succeeded with partial static-call coverage and unsupported cross-function value flow. Explicitly reopening with `provider_id: "kuna"` switched back and reproduced the original `list_names` error; the target digest stayed unchanged and close succeeded. No annotations were made in this test. The failure's headline/remediation says “Choose another analysis or target”; it does not suggest selecting a different provider. A provider switch is an available recovery only when an appropriate provider is configured and applicable, and it changes the active provider/session. Existing #8289 covers the separate fact that switching away from an edited ephemeral Ghidra session can discard live edits. This one controlled recovery is not a recommendation for silent fallback or a claim that Ghidra and Kuna offer equivalent evidence.
Author
Owner

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

Rechecked on merged main a989c0e458c91af177e097abd7be0fd021b0401d after the session/Evidence changes: real Kuna 1.986 still advertised native_seed_call_trace available for the original ELF, and both dispatch inspection and the address-seeded trace failed on unsupported list_names. The separate Mach-O/Kuna control still completed both operations. Real Ghidra 12.1.4 on the ELF still completed list_names, dispatch inspection and the address-seeded trace with partial native-call coverage. The selected target hashes were unchanged and targets were not executed. This checks the reported pair and controls on one macOS host, not all formats or providers.

<!-- gh-comment-id:6544963788 --> @morluto commented on GitHub (Oct 31, 2026): Rechecked on merged main `a989c0e458c91af177e097abd7be0fd021b0401d` after the session/Evidence changes: real Kuna 1.986 still advertised `native_seed_call_trace` available for the original ELF, and both dispatch inspection and the address-seeded trace failed on unsupported `list_names`. The separate Mach-O/Kuna control still completed both operations. Real Ghidra 12.1.4 on the ELF still completed `list_names`, dispatch inspection and the address-seeded trace with partial native-call coverage. The selected target hashes were unchanged and targets were not executed. This checks the reported pair and controls on one macOS host, not all formats or providers.
Author
Owner

@ShuaixinHuang commented on GitHub (Oct 31, 2026):

@morluto @kaoru0822-kitauji @N0zoM1z0 @gensokyo-dev

My account (@ShuaixinHuang) is still limited to eight open PRs in this repository, and all eight slots are currently occupied:

  • #8313 — CLI omitted exit-code handling
  • #8324 — PE certificate string alphabets and IA5 budget
  • #8250 — Electron module initialization (known review follow-up remains pending)
  • #8252 — Node target reconciliation
  • #8253 — Electron rejection and exception policies
  • #8256 — Electron protocol handler registration presence
  • #8258 — Retained Ghidra verification Evidence references
  • #8259 — Electron application argv preservation (test-coverage follow-up remains pending)

Could you please review the existing PRs when you have time? The eight-PR limit currently prevents me from opening additional submissions. I have the scoped fix for #8198 committed and queued on codex/fix-native-ui-handler-location, and would like to continue submitting further fixes as slots become available.

Thank you for your time.

<!-- gh-comment-id:6544990188 --> @ShuaixinHuang commented on GitHub (Oct 31, 2026): @morluto @kaoru0822-kitauji @N0zoM1z0 @gensokyo-dev My account (@ShuaixinHuang) is still limited to eight open PRs in this repository, and all eight slots are currently occupied: - [#8313](https://github.com/morluto/rea/pull/8313) — CLI omitted exit-code handling - [#8324](https://github.com/morluto/rea/pull/8324) — PE certificate string alphabets and IA5 budget - [#8250](https://github.com/morluto/rea/pull/8250) — Electron module initialization (known review follow-up remains pending) - [#8252](https://github.com/morluto/rea/pull/8252) — Node target reconciliation - [#8253](https://github.com/morluto/rea/pull/8253) — Electron rejection and exception policies - [#8256](https://github.com/morluto/rea/pull/8256) — Electron protocol handler registration presence - [#8258](https://github.com/morluto/rea/pull/8258) — Retained Ghidra verification Evidence references - [#8259](https://github.com/morluto/rea/pull/8259) — Electron application argv preservation (test-coverage follow-up remains pending) Could you please review the existing PRs when you have time? The eight-PR limit currently prevents me from opening additional submissions. I have the scoped fix for #8198 committed and queued on [codex/fix-native-ui-handler-location](https://github.com/ShuaixinHuang/rea/tree/codex/fix-native-ui-handler-location), and would like to continue submitting further fixes as slots become available. Thank you for your time.
Author
Owner

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

On current main 6e9ee97a69cb16c7150d8b550e705cba055ee4f0, I tested a same-provider recovery with the same unexecuted x86-64 ELF and real Kuna 1.986 on macOS arm64, through SDK 2.3.1 stdio MCP with fetched compact output schemas.

With native seed sequence (0x201181), trace_native_ui_action still failed on unavailable list_names. In the same open Kuna session, get_call_graph({address:"sequence",direction:"forward"}) returned both direct callees 0x201165 and 0x20117a; the two downstream nodes reported partial coverage for indirect calls. trace_call_path({start:"sequence",goal:"change_then_call",direction:"forward"}) reported the direct path as reached. The fixture source independently contains those direct calls. These are static provider observations, not runtime reachability or proof of complete indirect-call coverage.

This is a narrower available alternative for an analyst who already knows a native seed; it does not recover UI connections, typed call sites, value flow, or the original UI-trace contract, and it should not silently replace that request. The graph/path interfaces do not expose the UI trace's explicit node/depth/edge bounds; I did not measure their behavior on a large program. A real Ghidra control on the same seed completed the UI trace and included typed direct and resolved indirect call-site observations, which are not equivalent to Kuna's address-only graph.

For each provider, the graph and path results and their limitations were exported and reimported into a separate target-free MCP server and matched exactly. The target digest was unchanged. One fixture and host were tested; no target execution, autonomous-agent decision, or general provider equivalence is claimed.

<!-- gh-comment-id:6550750308 --> @morluto commented on GitHub (Oct 31, 2026): On current main `6e9ee97a69cb16c7150d8b550e705cba055ee4f0`, I tested a same-provider recovery with the same unexecuted x86-64 ELF and real Kuna 1.986 on macOS arm64, through SDK 2.3.1 stdio MCP with fetched compact output schemas. With native seed `sequence` (`0x201181`), `trace_native_ui_action` still failed on unavailable `list_names`. In the same open Kuna session, `get_call_graph({address:"sequence",direction:"forward"})` returned both direct callees `0x201165` and `0x20117a`; the two downstream nodes reported partial coverage for indirect calls. `trace_call_path({start:"sequence",goal:"change_then_call",direction:"forward"})` reported the direct path as reached. The fixture source independently contains those direct calls. These are static provider observations, not runtime reachability or proof of complete indirect-call coverage. This is a narrower available alternative for an analyst who already knows a native seed; it does not recover UI connections, typed call sites, value flow, or the original UI-trace contract, and it should not silently replace that request. The graph/path interfaces do not expose the UI trace's explicit node/depth/edge bounds; I did not measure their behavior on a large program. A real Ghidra control on the same seed completed the UI trace and included typed direct and resolved indirect call-site observations, which are not equivalent to Kuna's address-only graph. For each provider, the graph and path results and their limitations were exported and reimported into a separate target-free MCP server and matched exactly. The target digest was unchanged. One fixture and host were tested; no target execution, autonomous-agent decision, or general provider equivalence is claimed.
Author
Owner

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

I opened draft #8400 for the observed discovery mismatch. The Apple reader now declares target applicability shared by execution and session discovery; composed availability still permits an independently available symbol fallback.

Real MCP controls on macOS with Kuna 1.986 and Ghidra 12.1.4: Kuna/ELF changes from an advertised native-seed route to unavailable, while Ghidra/ELF, Ghidra/PE, and Kuna/Mach-O retain their successful routes. A selected read-only Ghidra Mach-O project also retained identical results and Evidence. The real Kuna verifier passed with separately built symbol-bearing and stripped ELF controls; the same verifier failed against main at the old availability assertion, with cleanup complete. Details and limits are in the PR.

The PR now also makes the top-level response direct callers to mode-specific recovery when target prerequisites differ; the native-seed mode retains its missing operations and recovery. It does not enable UI tracing on Kuna/ELF or automatically substitute the generic graph. A wording-only mutation passed the session and real-provider checks, while dropping a missing-operation fact failed the focused test. The issue stays open until the proposed change is merged.

<!-- gh-comment-id:6550828702 --> @morluto commented on GitHub (Oct 31, 2026): I opened draft #8400 for the observed discovery mismatch. The Apple reader now declares target applicability shared by execution and session discovery; composed availability still permits an independently available symbol fallback. Real MCP controls on macOS with Kuna 1.986 and Ghidra 12.1.4: Kuna/ELF changes from an advertised native-seed route to unavailable, while Ghidra/ELF, Ghidra/PE, and Kuna/Mach-O retain their successful routes. A selected read-only Ghidra Mach-O project also retained identical results and Evidence. The real Kuna verifier passed with separately built symbol-bearing and stripped ELF controls; the same verifier failed against main at the old availability assertion, with cleanup complete. Details and limits are in the PR. The PR now also makes the top-level response direct callers to mode-specific recovery when target prerequisites differ; the native-seed mode retains its missing operations and recovery. It does not enable UI tracing on Kuna/ELF or automatically substitute the generic graph. A wording-only mutation passed the session and real-provider checks, while dropping a missing-operation fact failed the focused test. The issue stays open until the proposed change is merged.
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#6546
No description provided.