Repository navigation
fix(ghidra)!: qualify memory effect coverage - #8651
Merged
Merged
Conversation
3 tasks done
This was referenced Nov 2, 2026
Contributor
[Medium impact] The reviewed changes appear safe; no blocking issue remains, and identical changes already exist in local SummaryQualifies Ghidra memory-effect coverage without adding inferred memory effects.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Ghidra high p-code] --> B[Function dossier with coverage warning]
B --> C[Retained effects view]
B --> D[Value trace]
D --> E[Attributed and deduplicated caveats]
F[Producer profile] --> G[Reject old provider snapshots]
H[Workflow profile] --> I[Skip old cached traces]
Reviews (10) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
3 tasks done
morluto
marked this pull request as ready for review
November 4, 2026 16:53
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
morluto
enabled auto-merge (squash)
November 7, 2026 18:18
# Conflicts: # src/ghidra/GhidraRawProfileDigest.test.ts # src/ghidra/GhidraSnapshotCache.test.ts
Entrpi
added a commit
to Entrpi/rea
that referenced
this pull request
Nov 8, 2026
targetDiagnostics.test.ts: main checks the load remediation's arguments by pattern instead of a frozen sentence; check the branch's added arguments the same way with stating(). Main's instruction-status (morluto#8777), byte-search coverage (morluto#8608) and value-flow (morluto#8651) revisions change every Ghidra raw profile digest. The legacy pins take the digests main computes at 5044e20 for the same loads, the M-profile pin is recomputed, and rawLoadCompatibility.test.ts sets aside the new revisions.
3 tasks done
Entrpi
added a commit
to Entrpi/rea
that referenced
this pull request
Nov 8, 2026
Main's instruction-status (morluto#8777), byte-search coverage (morluto#8608) and value-flow (morluto#8651) revisions change every Ghidra profile. Control: with main's GhidraAnalysisProfile.ts changes since 99db80a reversed, the old pins hold (169 of 171; the other two assert the new parameters).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An empty Ghidra value-flow effects list can omit a direct global read or write. State the actual effect scope in the produced Evidence and advertised schema so an agent does not treat that empty list as proof of no memory access. Related: #8336.
Problem and expected behavior
Ghidra high p-code can represent a direct memory address as an input or output varnode of an operation other than
LOADorSTORE. REA's current memory-effect projection only selects those two opcodes. Its previous generic limitations did not explain this exclusion.Change and scope
The Ghidra producer now includes that scope and suggests recorded instruction references as complementary evidence. The field schema and native investigation guide describe the same boundary. Retained native views already propagate the producer's limitations.
trace_native_valuesnow carries each analyzed value-flow source limitation inline with provider/operation attribution and deduplicates repeated caveats. No new effect is inferred and no provider API or execution authority is added.Contract and boundary impact
effectsoutput schema has a description. The value-trace workflow profile addsvalue_flow_limitations: provider-attributed-v1, so older cached results without this policy are not replayed as current. This independent commitment composes with fix(native): retain value trace source evidence #8384's source-ownership revision. Existing historical Evidence is not rewritten.value_flow_effect_scope: pcode-load-store-explicit-v1. Snapshots created before that commitment are refused; analyze without the old snapshot and save a new one. For snapshot-only historical records, the existing manual extraction path is documented; direct snapshot-to-Evidence recovery is tracked separately in [Design] Recover historical Evidence from an incompatible analysis snapshot #8655. Observations remain distinct from instruction references and runtime access.Expected effects of verification:
Evidence and regression coverage
memory_read. Every dossier and its retainedvalue_flow_effectsview included the scope limitation after this change. Successful results validated against fetched output schemas. Independent disassembly andprocedure_referencesestablished the direct accesses; the target was not executed and its SHA-256d3baa5cf385b68e3a8de02ed0884d9c9e781bd2c6b63201250635e4dc37655e8was unchanged.ae8223ccfailed the scope assertion on the direct-read dossier. The baseline is a separate branch, not this PR's direct parent.trace_native_valueson the x86-64 direct-read, indirect-read and immediate-only functions: both compact and full MCP now show theanalyze_functionprovider scope inline; the prior head omitted it while retaining the source dossier ID. Source views and trace responses validated against advertised schemas. A controlled multi-function test verifies attribution and deduplication; a snapshot-cache regression verifies that prior trace Evidence is not replayed under the new commitment.d2ab1b852: the real-provider verifier now constructs a valid pre-scope snapshot from an actual Ghidra dossier, checks that MCP rejects its old profile without changing the active session or snapshot file, and then checks that a fresh trace retains the scope. This verifier helper passed against real Ghidra 12.1.4 in both MCP profiles on the x86-64 control fixture. The previously recorded real old-snapshot control independently reproduced the original missing-scope failure.evidence_integrity_mismatch, allowed separately exported historical Evidence to be imported unchanged, and produced the scope on fresh analysis and current-snapshot reopen. Snapshot, bundle and target digests were unchanged. This is one old snapshot and host.c103de06f: exported the direct-readtrace_native_valuesand its linked Ghidra dossier, then imported the bundle into a fresh session without an open target in compact and full MCP profiles. The trace record was unchanged, its inline source limitation remained, and the linked retained effects view carried the scope; bundle and target digests were unchanged. Successful replies validated against the advertised schemas. This covers one trace and host.ae8223ccand one from this PR, then imported each into fresh MCP sessions in both profiles. The retained effects view preserved the new limitation for the new record and did not invent it for the historical record; both bundle hashes and the target hash remained unchanged. Successful responses validated against advertised schemas. This checks one historical record, not general migration.a20c186ein an isolated checkout and manually preserved fix(native): retain value trace source evidence #8384's value-trace revision 2 after the intermediate cherry-pick removed it. Real Ghidra traces carried the scope and cited retained sources; real Kuna 1.988 partial traces retained resolvable source IDs and the no-def-use unknown, in compact and full profiles. The combined profile contained both revision 2 andvalue_flow_limitations: provider-attributed-v1. Both standalone branches had independently used revision 2 for different changes; the new separate commitment prevents that collision if the source-ownership revision is preserved during integration. The combined checkout had an older Kuna verified-release policy, so 1.988 was unverified there. This is one fixture and host, not a clean-branch run or broad provider-accuracy claim.Validation performed
Reconciled with main
015a02d5, preserving value-flow scope alongside containing-code identification and refreshing the combined raw-profile digest goldens. Node 24.22.1 focused native-value, analysis-snapshot and Ghidra profile/snapshot suites passed 109 tests; digest formatting and staged diff checks passed. Real Ghidra verification was not rerun after this reconciliation; earlier provider evidence predates it.Reconciled with main
f912a684: retained separate snapshot admission coverage for value-flow scope and inventory-search projection, and refreshed raw-profile digest goldens for their combined semantics. Node 24.22.1 focused native-value, analysis-snapshot and Ghidra profile/snapshot suites passed 108 tests; changed conflict files passed formatting and staged diff checks. Real-provider evidence below predates this integration and was not rerun.Reconciled with main
a67525cdafter the documentation move; Node 24.22.1 targeted native-value, analysis-snapshot and Ghidra profile/snapshot suites passed 107 tests. Moved guide formatting and staged diff check passed. Real-provider evidence below predates this integration and was not rerun.Follow-up: merged main
ac30fbd, including the style(test): format CLI help default annotations #9280 CLI-help formatting fix; Node 24npm run format:checkpasses. The focused tests below ran before this formatting-only main follow-up.Reconciled with main
2e2f981: the workflow profile retains both recorded-versus-unavailable and provider-attributed limitation commitments; source-closure replay tests and both real-verifier helpers are retained. Refreshed raw profile digests for the combined policy. On Node 24.22.1, 107 focused Ghidra snapshot/profile, source-closure, trace and MCP tests passed, as didcheck:fast,docs:check, changed-file formatting and diff checks.node --checkpassed for the combined verifier script. Real Ghidra and the full verifier were not rerun after reconciliation; earlier provider evidence below is for the earlier revision. Hosted checks must run on the updated head.Focused real stdio MCP control above: passed in both schema profiles on the changed branch.
npm run test:focused -- src/domain/analysisView/analysisView.test.ts tests/boundary/mcp/analyzeFunctionDetail.test.ts— 53 passed.npm run test:focused -- src/application/native/NativeValueTrace.test.ts src/application/binary/AnalysisSnapshotCache.test.ts tests/boundary/mcp/nativeValueTraceCompleteness.test.ts— 77 passed.npm run test:focused -- src/ghidra/GhidraRawProfileDigest.test.ts src/ghidra/GhidraSnapshotCache.test.ts src/ghidra/GhidraProvider.behavior.test.ts src/application/binary/AnalysisSnapshotCache.test.ts— 256 passed after updating profile goldens.npm run check:fast,npm run docs:check, changed-file formatting andgit diff --check— passed on the final change.npm run verify:ghidra— failed in existing verifier code as described above; not claimed as passed.Compatibility, safety, and release
Breaking: an
open_binaryrequest that supplies a previously valid Ghidra snapshot without the new effect-scope commitment now returnsevidence_integrity_mismatch. Analyze the target without that snapshot and save a fresh one; a separately exported historical Evidence bundle remains importable unchanged. This prevents an old cached dossier from suppressing the limitation in a newly computed trace. Cached value traces without the workflow limitation commitment likewise need fresh analysis. No schema shape or target authority changes. Provider verification is limited to the single host and fixture above.Author readiness
Human owner:
Before merge
type(scope): outcome.