Repository navigation
fix(ghidra): keep listing facts when one function fails to decompile - #4650
gensokyo-dev merged 8 commits into
Conversation
Codex Review SummaryThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no new actionable defect was found. SummaryKeeps Ghidra’s listing-backed function facts when decompilation fails.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Analyze function] --> B{Decompilation result}
B -->|Success| C[Full dossier]
B -->|Failure| D[Listing-backed dossier with failure reason]
B -->|Cancellation| E[End request]
C --> F[Retain Evidence and allow caching]
D --> G[Retain Evidence and skip caching]
G --> H[Pass live policy to composed workflows]
Reviews (6) · Last reviewed commit: "test(ghidra): format transient workflow ..." · Reviewed by Greptile |
|
CI status on this branch: the PR's own checks pass, but the last three CI runs each failed in a different test this PR doesn't touch.
None of these touch the decompiler bridge or GhidraProviderClient paths changed here. |
|
@codex review Please review current head e605975 against current main. The refreshed comparison has eight focused files. Executed Linux evidence: 153 related TypeScript tests, real Ghidra controlled failure/recovery (32 checks), and public MCP on a real installed ELF with retained Evidence and verified cleanup. Natural failure inputs and degraded CLI/MCP projection remain explicitly unverified; full checks/CI are in progress. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6059750ec
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
CI attribution for latest head
Executed bounded local checks reproduce these results with identical package, lockfile, detector configuration and report-runner digests for main and the CI merge. Main already fails without this PR. No threshold adjustment or unrelated refactor is included. Production/native/MCP verification is current in the body; the final follow-up only formats the workflow regression fixture. |
|
Portable-test attribution is now verified on both exact trees: main |
Adapt upstream morluto#5356, morluto#4650 and morluto#5662 to the Windows fork. Preserve listing facts and live retry policy, carry explicit settings into client setup, and qualify natural timeouts with a source-owned Windows DLL. Windows acceptance, default real-provider checks and SDK schema regressions passed; details in the verification record.
Summary
Fixes #4644. When one Ghidra function fails to decompile,
analyze_functionnow returns its listing-backed dossier with pseudocode, native API and p-code value flow explicitly unavailable and the decompiler's reason preserved. Assembly, comments, callers/callees, references, strings/names, CFG and relationship coverage remain available. Cancellation still ends the request.procedure_pseudo_codestill fails, with procedure-specific recovery advice instead of blaming environment readiness.Keep @RishTheFish21's production fix. Qualification merges current main
052956af3, selects exact exported entries in the native probe, binds the Linux fixture's local calls, supervises compiler cleanup and requires positive lineage evidence before reporting cleanup complete. Reports now retain target/source/bridge digests and the provider/profile identity. The actual comparison contains eight focused files.Contract and scope
The Ghidra bridge owns the unavailable-facet interpretation; the provider adapter projects its named error. CLI and MCP use the existing shared function workflow and dossier schemas. The bridge digest already versions analysis profiles. Existing read-only provider authority applies; additional maintainer scope decision is not applicable. Public schemas and read-only authority remain unchanged. A result-specific live policy prevents replay of transient failures in direct and composed snapshots; healthy caching remains enabled.
Executed validation
Linux x64; pinned Node 24.18.0 / npm 11.16.0; BYO Ghidra 12.1.4 / JDK 21:
RequestFailure: Ghidra decompilation failed: Injected backend failure; the requested dossier is lost. With the candidate bridge, 34 checks passed. All listing facets and availability/relationship coverage match the healthy observation; decompiler facets retain the failure reason; pseudocode-only failure, cancellation and session recovery remain covered. The probe invokes the actual request response producer; both the native response and parsed observation mark transient failures live. The degraded dossier passes the real provider output contract; the healthy path also passes through the authenticated TCP provider.f8b25a00da8a04575cc5dc78fe737f5589cc99d2e6733f6dca7bf20379ada5f2; source/bridge digests and compiler arguments are emitted by the verifier./usr/bin/trueELF, 35,664 bytes, SHA-256c79bf44242829108e323378531f4ac839513ca1fba45efd6583643526e1e9fd2: select a provider-returned entry address, analyze twice in one session, verify identical normalized dossiers, export complete Evidence, close and verify immutable input/empty temporary roots. Protocol 2026-07-28.format:checkafter the corrective commit. Runtime/native verification remains applicable because that follow-up only formats a test fixture.check:fast, fullnpm run check(typecheck, formatting, lint, knip, metadata/module/architecture guards), andnpm run docs:check: passed; the documentation check also passed 5 consistency tests.Initial Linux probe attempts stopped before the injected failure: PLT name ambiguity, then the fixture's ELF symbol interposition invalidating its direct-call expectations. Those are retained as harness diagnostics, not bug reproductions. Exact exported-address selection and explicit Linux local binding fix the producing fixture. A later stronger-handler attempt stopped at missing nested headless context before fault comparison; the final probe binds the actual HeadlessAnalyzer as Ghidra does for nested scripts, then passes all 34 checks. Native disassembly independently verifies the direct calls. The successful main/candidate fault comparison uses the corrected fixture.
Performance and limits
One CPU; 8-GiB hard / 7-GiB early family-memory stop; no swap. 34-check real conformance: 76.952 s elapsed, 74.492 s family CPU, 570.0 MiB peak. The probe uses the real request handler and positive lineage cleanup. Public real-ELF MCP task: 38.007 s elapsed, 36.655 s CPU, 1,100.7 MiB peak. Cold import/search 29.553 s; first function 181.1 ms, repeated warm dossier 29.6 ms. All completed with positive cleanup evidence and no OOM. OS cache is uncontrolled; these samples do not establish a general speedup. The failed baseline does not complete the same dossier task, so its failure time is not an equivalent latency comparison. The previous-head equivalent task measured 38.936 s / 37.550 CPU s / 1,116.6 MiB (174.5 ms first / 24.4 ms warm); single samples do not establish a performance change. Only transient failures opt out of existing caches.
Captured post-connect MCP traffic for six tool calls: 21,908
cl100k_basetoken estimate (519 outbound / 21,389 inbound; previous head 21,905). SDK initialization/startup catalog or schema traffic was not captured; actual agent/model usage and prompts are unmeasured. This is neither a whole-task token total nor a token-savings claim.The decompiler failure is injected into a real Ghidra program; a naturally failing public binary is unavailable. The degraded public CLI with a real backend and Windows were not run. Controlled-wire MCP tests exercise degraded composed output and cache recovery; simulated failures do not establish natural decompiler failure conditions. The public real-ELF MCP control is healthy. Prior contributor macOS evidence predates this Linux qualification and was not rerun here. Target code is never executed.
Author readiness
Human owner: @RishTheFish21
The original readiness declaration is retained. The agent qualified the final diff for @gensokyo-dev under the task owner's explicit delegation to validate, update ready PRs and merge; no new separate human review by the original author is claimed.
Before merge
c374c2fe7290b914d73d9e27af38b498753ec593with the task owner’s authorization to leave unrelated CI failures unchanged. Exact CI main already fails duplication (3.52498% > 3.5%; exact PR merge 3.52671%). The two failing EVM cancellation/cleanup cases also reproduce on that main; four other shards were cancelled, so their coverage is unavailable. No unrelated changes or threshold adjustments. See the controlled attribution.