Skip to content

fix(ghidra): explain literal search candidate evidence - #8816

Merged
morluto merged 4 commits into
mainfrom
codex/ghidra-literal-candidate-evidence
Nov 7, 2026
Merged

morluto merged 4 commits into
mainfrom
codex/ghidra-literal-candidate-evidence

Conversation

@morluto

@morluto morluto commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

A Ghidra case-insensitive literal search can return an unrelated Unicode row in raw_result while normalized_result correctly has no matches. The raw row is a broad bridge candidate, but REA did not explain that distinction. This change labels the raw candidates in fresh Evidence and in the search tool descriptions. Fixes #8815.

Problem and expected behavior

The bridge intentionally retains non-ASCII candidates to avoid missing matches across runtime Unicode versions. REA applies its own final matcher. Preserve both observations and identify the normalized rows as matches; do not describe case-sensitive or regex responses as candidate sets.

Change and scope

The Ghidra literal-search owner provides one limitation, attached at the filtering boundary for procedure and string searches. The catalog and native guide explain the same contract, including for readers of historical Evidence. Raw rows, normalized rows, matching, and provider selection are unchanged. Contribution scope decision: not applicable; the change explains an existing static analysis result.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Ghidra literal-search projection, after validating the bridge response and before creating Evidence.
  • CLI/MCP: a conditional Evidence limitation and updated search descriptions; no input or output schema changes. Fresh Evidence may have a different digest because its limitations changed; historical retained records are not rewritten.
  • Provider/platform: applies to Ghidra case-insensitive literal procedure and string search. Other providers and search modes are unchanged.
  • Evidence: preserve raw bridge candidates, final matches, provider identity and existing limitations.
  • Target and cleanup: no new provider operation or authority. Real verification used an existing ephemeral metadata rename and closed the session.
  • Generated metadata: catalog outputs remain ignored and are regenerated by normal checks.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Change process memory, registers, files, or configuration. (Existing Ghidra ephemeral analysis metadata during the real verification.)
  • Inject instrumentation or run scripts/code.
  • 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.

Evidence and regression coverage

  • Before the fix, real Ghidra 12.1.4 with a temporarily renamed Ωprobe function returned that raw candidate for an unrelated ASCII literal, while the normalized result was empty and no limitation explained the difference. The extended provider-boundary regression failed before the fix for both search operations and passes now, preserving raw and normalized rows and checking that other modes do not get the limitation.

  • After the fix, compact and full real stdio MCP controls validated their advertised schemas and confirmed the candidate, empty normalized result, limitation, search-mode distinction, and retained view. Export/import into a fresh server retained the exact Evidence and the explanation; closing and reopening Ghidra discarded the test rename. Target and bundle digests were unchanged.

  • Real CLI rea search with Ghidra exposed the limitation for string search. Its fixture had no non-ASCII string recognized by Ghidra, so this does not establish a real strings candidate/match difference; the shared boundary regression covers that branch. Other hosts and Ghidra versions remain unverified.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Current-main integration

Merged main through 2e2f981c. Kept the newer search guidance and checkpoint/reference limitations while adding the literal-candidate limitation to the same execution metadata owner. Node 24.22.1 focused provider and literal-search suites passed 277 tests; the simulated-provider MCP inventory boundary passed 4 tests. build:cached passed (3 tasks, 1 cached), check:fast passed uncached; full format:check passed after integrating upstream #9280. No real Ghidra run was performed on this merged head; the earlier real-provider evidence below is historical.

Validation performed

  • npm run test:focused -- src/ghidra/GhidraProvider.behavior.test.ts src/ghidra/GhidraLiteralSearch.test.ts tests/boundary/mcp/nativeInventoryViewsMcp.test.ts — 251 passed.
  • npm run check:ci:fast and npm run docs:check — passed.
  • Real Ghidra 12.1.4/JDK 21 on macOS arm64: compact/full stdio MCP, offline Evidence and ephemeral reopen controls, plus CLI string-search control — passed as described above.

Compatibility, safety, and release

  • No input or output schema changes. Fresh Evidence includes the additional limitation; previously retained Evidence is unchanged.
  • The tested Ghidra platform is macOS arm64; no Windows or Linux real-provider test was run.
  • No package or installer change. The selected executable is not modified or executed.

Author readiness

Human owner:

  • 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.

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.
  • This 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.

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

Explains that Ghidra case-insensitive literal searches retain bridge candidates in raw_result and final matches in normalized_result.

  • Ghidra literal searches explain when raw rows are only candidates.
  • The CLI help test keeps checking the same option defaults.

Reviews (3) · Last reviewed commit: "style(test): format CLI help default ann..." · Reviewed by Greptile

@morluto
morluto marked this pull request as ready for review November 4, 2026 03:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T14:54:19.688516Z 8d3456b New commits
ℹ️ 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.

@morluto
morluto merged commit cbd4bd4 into main Nov 7, 2026
48 of 50 checks passed
@morluto
morluto deleted the codex/ghidra-literal-candidate-evidence branch November 7, 2026 17:30
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction bug Something isn't working provider: ghidra Analysis provider / engine: ghidra labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Ghidra literal search raw results do not identify candidate rows

1 participant