Repository navigation
Conversation
…-review-pr2977-20261014
Use structured Ghidra comment Addresses instead of printed coordinates, preserving overlay identity and byte offsets while leaving branch targets unresolved. Add real AArch64, AVR8, and MIPS32 regression cases, negative markup controls, and v1 snapshot refusal. Focused follow-up based on morluto#2977 head 50b39ef.
Preserve the commits and authorship of upstream PR morluto#2977 and the warning-attribution follow-up while resolving current-main integration. Advance native API inspection to workflow revision 2; retain upstream source-limitations, instruction-reference, and function-boundary profiles. Update the real verifier to current installation/release-policy APIs. Validated tree: f5faac2 Validated upstream base: 95c8f57 283 focused tests passed; 2 Windows-only tests skipped. Real Ghidra 12.1.4: 106 assertions passed across four cases. Static/build and documentation checks passed. Prepared with AI assistance from ChatGPT/Codex. Draft depends on morluto#2977.
…und the branch inventory
A lint-staged autofix rewrote these unrelated files during a merge; [^/] is invalid in the advertised v-mode pattern and the edit broke format:check.
Ghidra emits each comment word as its own token with whitespace as syntax tokens, so the warning is matched over rebuilt markup text restricted to comment and whitespace characters.
# Conflicts: # docs/testing.md
Discount caller-authored jump-table warning lines by the address they name instead of their full text. Ghidra wraps comment lines past the display width, so a rendered copy can be cut short and no longer equal the stored comment, which let a stored copy stand in for a decompiler warning. The real-Ghidra verifier now also stores a WARNING:-prefixed copy and checks that the genuine warning still counts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013nDLgq92ifZmGnv55JdGoP
# Conflicts: # docs/testing.md # src/domain/investigationProviders.ts # src/ghidra/GhidraAnalysisProfile.ts
… source owners
[Medium impact] The changes affect Ghidra native-function analysis and the saved results used by that workflow. The remaining testing-rule violation must be addressed before merging. Findings
Fix with agent prompt### Issue 1
src/application/native/NativeApiInspection.test.ts:128-130
These assertions copy whole explanations from `NativeApiInspection.ts`, and the same text is repeated in workflow and MCP tests. The repository's testing guide says to assert facts rather than freeze explanatory sentences. A wording-only edit now breaks several suites.
Before merging, satisfy that requirement by comparing delivered wording with its owning formatter or constant. Separately assert addresses, outcomes, unsupported flags, and unknown counts.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThe PR records unresolved computed jumps and uses typed Ghidra comment addresses to attach warning evidence to the right instruction.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Typed `ClangCommentToken` addresses"] --> B["Warnings grouped by source"]
C["Saved listing comments"] --> D["Subtract exact matching occurrences"]
B --> D
D --> E["Warning evidence"]
F["Listing computed jumps"] --> G["`unresolved_indirect_branches`"]
E --> G
G --> H["`inspect_native_api`"]
H --> I["Evidence and open questions"]
Reviews (3) · Last reviewed commit: "test(ghidra): keep synthetic caller toke..." · Reviewed by Greptile |
| expect(projected.residual_unknowns).toEqual([ | ||
| "Which targets can the indirect branch at 0x401040 reach? The decompiler could not recover a jump table there and rewrote it as a call or return; it may be a dispatch inside this function or an indirect tail call.", | ||
| "Is the indirect branch at 0x401050 a tail call or a dispatch inside this function, and which targets can it reach?", |
There was a problem hiding this comment.
Tests freeze explanatory sentences
These assertions copy whole explanations from NativeApiInspection.ts, and the same text is repeated in workflow and MCP tests. The repository's testing guide says to assert facts rather than freeze explanatory sentences. A wording-only edit now breaks several suites.
Before merging, satisfy that requirement by comparing delivered wording with its owning formatter or constant. Separately assert addresses, outcomes, unsupported flags, and unknown counts.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/native/NativeApiInspection.test.ts
Line: 128-130
Comment:
**Tests freeze explanatory sentences**
These assertions copy whole explanations from `NativeApiInspection.ts`, and the same text is repeated in workflow and MCP tests. The repository's testing guide says to assert facts rather than freeze explanatory sentences. A wording-only edit now breaks several suites.
Before merging, satisfy that requirement by comparing delivered wording with its owning formatter or constant. Separately assert addresses, outcomes, unsupported flags, and unknown counts.
**Context Used:** AGENTS.md ([source](https://github.com/morluto/rea/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Closing this draft as superseded by #2977, not as an abandoned fix. @RishTheFish21 fast-forwarded the canonical #2977 branch to this PR's exact head There is no independent merge path left for #5137; future review, CI and integration belong on #2977, with the separate PSP fixture still dependent as #6931. My prior validation caveats (real-Ghidra/current-head qualification and human owner review) continue to apply to the canonical PR; closing this draft does not attest they passed. |
Summary and dependency
Draft: #5137 corrects unresolved indirect-branch warning attribution by Ghidra's typed instruction address. It depends on #2977 and must not merge independently of that feature.
Current source head:
d9bb66a, after a test-only result-projection correction to the non-force merge079d733, following the non-force, two-parent mergea8596d7retaining the original #5137 branch and the rebased #2977/typed-warning integration. It contains current upstreammain(d3ab0fa); GitHub reports the 27-file diff as mergeable. The inherited #2977 implementation, source-owner migrations, and regression tests account for most of that diff. Its incremental, historical eight-file source-address fix remains reviewable. Existing contributor history and credit are preserved.Problem and approach
On real Ghidra, a warning printed as
0x0000100ccan refer to an instruction ataarch64_overlay:0x100c, while AVR's printed word-address0x0804refers to byte offset0x1008. Parsing that text as a listing address misattributes genuine warnings and losesghidra-decompiler-warningEvidence. Caller-authored comments can also repeat genuine warning text.The Ghidra producer now collects complete warning comments from
ClangCommentTokenwith the exact typed sourceAddress. It accepts only consistent token provenance and discounts an authored warning only when its exact rendered occurrence matches at the same source address. No fallback deletes a different warning when an authored comment is wrapped or omitted. A correctedindirect_branch_inventoryanalysis-profile commitment (listing-computed-jumps-typed-warning-address-v2) invalidates older cache/snapshot results. Unrecovered branch targets remain explicitly unknown.The existing source-owned AArch64, AVR8 and MIPS32 probe exercises non-entry computed branches, overlay/default collisions, word-address units, delay slots, misleading string literals, wrong addresses, and missing/wrapped comment sources. The current REA schema/application owners and recent workflow revisions are preserved rather than overwritten. This correction adds no general-purpose target execution, arbitrary PSP support or external dependency.
Executed verification and limits
aarch64_overlay_outcomebefore the typed-producer correction.compare_functionsrequest exceeded the existing default 1,024 MCP input-element limit.d9bb66a. Built-dependent test shards remain in progress at this checkpoint; the run is not fully green. The preceding079d733run passed package build, documentation and source tests; one built test failed because the new legacy-snapshot regression passed an unprojected{ok,value}toparseEvidence. That regression now uses the existingprojectCliAnalysisResulthelper for both current and replayed results. Static checks on the previous head listed only 16 format issues also present on upstreammain, none in these changed files.The final 27-file tree shares its implementation and verification-code blobs with the positively tested fork revision, except for the updated documentation. The temporary fork-only GitHub Actions trigger is not part of this PR. The exact merge commit has not been rerun through the optional real-Ghidra lane. Earlier historical results in this thread apply to their original revisions, not automatically to the current head.
Not established: live PSP/Allegrex or Monster Hunter runtime correctness, arbitrary module/PRX admission, true overlay residency, Windows/macOS equivalence, or the complete public CLI/MCP path for this source-owned typed-warning probe. AVR testing covers the Ghidra-producing boundary, not AVR admission.
Author readiness
Human owner: @jaelliot
Prepared with AI assistance from ChatGPT/Codex. This draft remains dependent on #2977 and human review.
Before merge