Skip to content

fix(ghidra): omit duplicate load-image result - #7777

Merged
morluto merged 2 commits into
morluto:mainfrom
Ha1baraA11:pr/rea-7679
Oct 29, 2026
Merged

morluto merged 2 commits into
morluto:mainfrom
Ha1baraA11:pr/rea-7679

Conversation

@Ha1baraA11

Copy link
Copy Markdown
Contributor

Summary

inspect_native_load_image now keeps its normalized observations without repeating the bridge response in raw_result.
Related to #7679

Problem and expected behavior

  • A schema-valid inspect_native_load_image reply currently returns the same observation as both the parsed value and rawResult, so clients receive the load-image facts twice even when projection removes no fact.
  • The expected result is one normalized observation; entry-context rows with an empty registers array carry no register context and should be omitted.
  • raw_result is useful when it preserves a distinct bridge representation. Here it duplicates the normalized payload, while the attestation path can keep using its local bridge reply.

Change and scope

  • Apply an observation normalizer after strict parsing of inspect_native_load_image, removing only entry-context rows with empty registers arrays.
  • Omit the duplicate raw bridge result for that operation; the existing Evidence serializer emits raw_result: null while keeping observations under normalized_result.
  • Update DOS load-image, NativeAOT and shared-snapshot provider expectations, and document the Evidence contract while retaining local bridge-reply use for attestation.

Contract and boundary impact

  • Semantic owner and earliest changed stage: parseGhidraInventoryResult owns schema parsing and this normalization at the inventory result-projection boundary. It removes the duplicate rawResult path for inspect_native_load_image; the provider continues to pass the bridge reply to local attestation before projecting Evidence.
  • Contribution scope fit and linked maintainer decision: Focused correction within the existing Ghidra analysis boundary; no new provider, capability, target execution authority, injection, mutation, or protection recovery is added. A new maintainer scope decision is not applicable.
  • CLI and MCP/tool-catalog contract: Existing operation and Evidence schema remain. CLI/MCP results retain normalized_result.observations; because Evidence raw_result is nullable, absent provider raw data serializes as raw_result: null. No tool catalog or generated contract changes are included.
  • Provider, bridge, target-format, or platform compatibility: The Ghidra inventory projection changes only this operation. Bridge reply format, supported target formats, other inventory operations and provider lifecycle are unchanged. Local load-image attestation still receives the original bridge reply.
  • Evidence, artifact, provenance, or reconstruction contract: The normalized observation retains its fields except entry_context rows with no registers; raw_result no longer duplicates that observation. Evidence identity, artifact/source provenance, historical retained Evidence and failure handling are outside the changed code path.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): Not applicable to this parser-only correction; target admission, authority, upstream Ghidra behavior and cleanup are unchanged.
  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: None; no package, installation, or generated catalog files changed.

Evidence and regression coverage

  • Tests added or updated: src/ghidra/GhidraInventoryValues.test.ts adds a parser regression for retaining all reported observation facts while omitting raw output and another for removing empty-register rows. src/ghidra/GhidraProvider.behavior.test.ts updates three provider expectations to the Evidence raw_result: null contract.
  • Base reproduction or other evidence: The parser regression passes a schema-valid load-image observation to the result projection and asserts that all normalized facts remain while the redundant raw value is absent; the exact-base comparison and runner outcomes are listed under Validation performed.
  • User-visible CLI/MCP output (if applicable): No live CLI/MCP output was captured. Source-derived Evidence output retains normalized observations and serializes the absent raw value as raw_result: null; provider seam tests cover the serialization expectation.
  • Remaining proof gaps: No real Ghidra run, live MCP/CLI round trip, or private ESP32/ESP32-S3 ELF was available. The Issue's reported response sizes and entry counts were not remeasured, so no size or token reduction is quantified. The raw identity/normalization tests cover the parser boundary and provider projection, but not a live public CLI/MCP readback or retained-Evidence readback. No resource acquisition, lifecycle, cancellation, or cleanup code changed, so lifecycle regressions are not applicable.
  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Compatibility, safety, and release

  • Consumers that previously read the duplicate raw payload should read normalized_result.observations; no schema migration is needed.

Author readiness

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.
    Human owner: @Ha1baraA11

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T11:16:55.068693Z 68b9644 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable defect was found.

Summary

This PR removes duplicate bridge output from new inspect_native_load_image results and drops entry-context rows with no registers.

  • Ghidra load-image results keep one observation and drop empty register rows.

Review was source-based. No tests or live Ghidra workflows were run. GitHub status could not be checked without authentication.

Reviews (1) · Last reviewed commit: "docs(mcp): describe load-image evidence ..." · Reviewed by Greptile

@morluto
morluto merged commit a965cba into morluto:main Oct 29, 2026
41 checks passed
@morluto morluto added bug Something isn't working provider: ghidra Analysis provider / engine: ghidra labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants