[GH-ISSUE #7679] [Bug] inspect_native_load_image still repeats its observations in raw_result #4600

Closed
opened 2026-10-31 00:51:11 +00:00 by bsakaguchi · 0 comments
Owner

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

Before submitting

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

Area

Native analysis or decompilation

Observed behavior

A follow-up to #5337, which #5355 fixed for other operations: inspect_native_load_image still returns its observations twice.

  • Observed: on two ESP-IDF 5.5 application ELFs, raw_result equalled normalized_result.observations. The default result was 661 KB for the ESP32 app and 1.53 MB for the ESP32-S3 app.
  • Observed: the results carry 5,983 and 13,593 entry_points, each with an entry_context row whose registers list is empty.
  • Source-derived: parseGhidraInventoryResult (src/ghidra/GhidraInventoryValues.ts) returns { value: parsed.data, rawResult: value } for this operation unconditionally. ParsedGhidraInventoryResult documents keeping raw output only when projection omits reported facts, and docs/mcp-contracts.md describes raw_result as a representation distinct from the result.

Reproduction

  1. Open an ELF with the Ghidra provider through MCP. The measurements above used Xtensa ELFs admitted by #7486, but the code path is shared, so any ELF on main should show it.
  2. Call inspect_native_load_image.
  3. Compare raw_result with normalized_result.observations.

Expected behavior

raw_result is omitted when the strict parse keeps every reported fact, as #5355 does for other operations. If the local attestation mentioned beside that code needs the bridge value, it can use it without returning it. Entry points without context registers omit the empty row.

Impact and scope

Every client pays for the duplicate. The default load image of a mid-sized firmware app runs to several hundred thousand tokens.

REA version

6.8.0 (main at baec375c3) plus the Xtensa admission from #7486; the code above is unchanged on main.

Runtime and platform

Linux x64 (Debian 13), Ghidra 12.1.4, OpenJDK 21, Node 24.22.1

Target and artifact context

ESP-IDF 5.5 application ELFs for ESP32 and ESP32-S3; private builds, not attached.

Interface

MCP

Earliest failure stage

Transport or result projection

Relevant output or evidence

Result ESP32 app ESP32-S3 app
inspect_native_load_image default size 661 KB 1.53 MB
entry_points 5,983 13,593
Originally created by @Entrpi on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/7679 ### 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 Native analysis or decompilation ### Observed behavior A follow-up to #5337, which #5355 fixed for other operations: `inspect_native_load_image` still returns its observations twice. - *Observed:* on two ESP-IDF 5.5 application ELFs, `raw_result` equalled `normalized_result.observations`. The default result was 661 KB for the ESP32 app and 1.53 MB for the ESP32-S3 app. - *Observed:* the results carry 5,983 and 13,593 `entry_points`, each with an `entry_context` row whose `registers` list is empty. - *Source-derived:* `parseGhidraInventoryResult` (`src/ghidra/GhidraInventoryValues.ts`) returns `{ value: parsed.data, rawResult: value }` for this operation unconditionally. `ParsedGhidraInventoryResult` documents keeping raw output only when projection omits reported facts, and `docs/mcp-contracts.md` describes `raw_result` as a representation distinct from the result. ### Reproduction 1. Open an ELF with the Ghidra provider through MCP. The measurements above used Xtensa ELFs admitted by #7486, but the code path is shared, so any ELF on `main` should show it. 2. Call `inspect_native_load_image`. 3. Compare `raw_result` with `normalized_result.observations`. ### Expected behavior `raw_result` is omitted when the strict parse keeps every reported fact, as #5355 does for other operations. If the local attestation mentioned beside that code needs the bridge value, it can use it without returning it. Entry points without context registers omit the empty row. ### Impact and scope Every client pays for the duplicate. The default load image of a mid-sized firmware app runs to several hundred thousand tokens. ### REA version 6.8.0 (`main` at baec375c3) plus the Xtensa admission from #7486; the code above is unchanged on `main`. ### Runtime and platform Linux x64 (Debian 13), Ghidra 12.1.4, OpenJDK 21, Node 24.22.1 ### Target and artifact context ESP-IDF 5.5 application ELFs for ESP32 and ESP32-S3; private builds, not attached. ### Interface MCP ### Earliest failure stage Transport or result projection ### Relevant output or evidence | Result | ESP32 app | ESP32-S3 app | | --- | --- | --- | | `inspect_native_load_image` default size | 661 KB | 1.53 MB | | `entry_points` | 5,983 | 13,593 |
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#4600
No description provided.