Repository navigation
feat(ghidra): reuse existing projects through verified copies - #7236
Conversation
Integrate launcher and boundary groundwork from #2150. Public selection, provenance and real-provider verification follow in this branch. Co-authored-by: morluto <[email protected]>
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 792525ae8e
ℹ️ 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".
[Medium impact] The PR appears safe to merge; all four earlier findings are fixed and no new blocking issue was found. SummaryAdds opt-in reuse of existing Ghidra projects through fingerprint-checked private copies.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["Selected .gpr / .rep pair"] --> B["Fingerprint committed into profile"]
B --> C["Copy into owned runtime"]
C --> D{"Copied digest matches?"}
D -- No --> E["Reject and clean up"]
D -- Yes --> F["Launch process / noanalysis / readOnly"]
F --> G["Authenticate bridge and check target digest"]
G --> H["Read-only results with historical Evidence"]
H --> I["Close and remove owned copy"]
Reviews (2) · Last reviewed commit: "fix(ghidra): preserve reused project bou..." · Reviewed by Greptile |
Summary
Fixes #1048 and #2147. Repeated Ghidra investigations can select an existing project instead of paying import and auto-analysis on every session. Builds on the launcher groundwork in #2150 by @akushonkamen and @morluto, preserving their attribution.
Change and scope
REA_GHIDRA_PROJECT_PATHselects an expanded.gprmarker; optionalREA_GHIDRA_PROGRAM_NAMEselects one exact root program (default: resolved executable filename). Shared CLI/MCP configuration and saved registrations use the same selection.One provider owner fingerprints the selected
.gpr/.reppair with serial 64-KiB reads, copies only that pair into the owned runtime, and verifies copied content against the committed profile before launch. The engine runs-process -noanalysis -readOnly, skips repair scripts and exposes no database-edit capabilities. The bridge still validates the recorded import SHA against the admitted target. Source changes/mismatches fail explicitly; close/reopen resolves a new commitment.Existing-project Evidence records caller/resolved paths, program and project content identity. Original analysis completeness/settings stay unknown; the authenticated bridge reports that origin with read-only capabilities and null completion. Fresh-import handshake semantics remain supported. Import overrides and Windows/special import profiles are rejected for this mode.
Scope decision: not applicable; existing static provider operations, owned helper processes/copies, no added target execution, injection or target mutation. The original database is read for copying/fingerprinting and is never opened/saved by Ghidra. No new installer or implicit persistent cache. Authored setup/contract/skill docs are updated; generated outputs remain ignored.
Executed validation
/tmpparents. Actual Ghidra saved seed/analyzer reports reopen successfully as one immutable historical Evidence record linked from observations; a real project directly under/tmpalso preserves identical facts and unchanged source content.Matched rows use the same five-family catalog and complete task. A narrower executed ls pair removes the unused native family (97 tools), preserves facts, and uses 67,523 / 67,820 estimated full-wire tokens; the broader pair uses 85,151 / 85,448. Extra project provenance slightly increases response tokens. Estimates use cl100k_base; actual model usage is unmeasured. Preparation costs are separate: ls 36.17 s / 59.54 CPU s; crypto 231.76 s / 251.08 CPU s. Sequential shared-host samples do not establish a general speed ratio. All runs use 2-CPU affinity and an 8-GiB family guard; no OOM/guard or cleanup failure.
Full protocol, cold/warm calls, source revisions, heap settings, preparation, calibration receipts and limits: verification.
Baseline controls on main
cd68181c9and final featurebfd33f571both produce the same 17 failures / 54 passes across six exact files: CLI advertised defaults (12), WorkBuddy/Trae paths, redirected-AppData uninstall, pcap ENOTDIR diagnostics and pwntools completed-read cleanup. Failure names and assertions match. Final-head CI run 40338086104 passed source tests, static checks, build/docs, Ghidra bridge compilation, Linux x64/arm64 and macOS arm64 packages, Windows capability/package tests, and Greptile review. Shard 7 reports 13 baseline failures; cancelled shard logs add the same WorkBuddy/pwntools baseline failures. Other cancelled coverage remains unverified. Readiness declarations stay unchecked.Main subsequently fixed these failures. A local integration of final feature
bfd33f571with main2b84efe0dbuilt successfully and passed 248 tests across eight files, including both Ghidra boundary suites and all six baseline-control files. The authorized bypass applies to the old-baseline CI result, with current-main integration checked; no human-review attestation is made.Real PE/Mach-O/macOS reuse and very large project trees remain unverified. Windows existing-project mode remains unsupported.
Author readiness
Human owner: @gensokyo-dev
The user explicitly authorized opening ready for review and bypassing this gate without an AI attestation of human review. Baseline CI failures, if any, will be attributed before applying the authorized bypass.