Repository navigation
fix(ghidra): commit analysis profiles to the bridge script sources - #10562
Merged
Merged
Conversation
Snapshot reuse for Ghidra depends on the analysis profile digest, but the profile committed only to hand-bumped semantic markers. A bridge change that forgot to bump its marker left earlier snapshots admissible (#3664). Add ghidraBridgeSourcesDigest, a SHA-256 over every packaged bridge source by name, and commit it as bridge_sources_sha256 in every Ghidra profile, for new imports and existing projects alike. A changed script now changes the profile digest without anyone remembering a marker. Existing snapshots are not reused once, after upgrading. GhidraRawProfileDigest.test.ts pinned literal digests that every bridge or marker change had to re-record; it now checks the committed parameters and that the digest is the profile owner's digest of them. A new test checks that the source list covers every packaged .java file.
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. |
Contributor
[Medium impact] The reviewed changes appear safe to merge. SummaryGhidra profiles now include a SHA-256 digest of the packaged Java bridge sources, so bridge changes invalidate earlier snapshots.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Packaged Java sources] --> B[Hash names, lengths, and bytes]
B --> C[bridge_sources_sha256]
C --> D[Ghidra profile parameters]
D --> E[Analysis profile digest]
E --> F[Snapshot reuse decision]
Reviews (3) · Last reviewed commit: "fix(ghidra): frame bridge digest metadat..." · Reviewed by Greptile |
22 tasks
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…producer identity instead of hand-bumped markers (#11320) * refactor(ghidra)!: key analysis profiles on the producer identity instead of hand-bumped markers Ghidra snapshot validity depended on 53 hand-maintained "-vN" semantic markers in the analysis profile; a behaviour fix that forgot to bump its marker left old snapshots admissible (#3664). #10562 added a digest of the bridge sources, but TypeScript projection changes still needed a bump and the REA release was not committed. - src/filesystem/ProducerIdentity.ts owns the producer identity: the REA release plus a framed SHA-256 of a producer's packaged scripts, read once per process. - Ghidra profiles commit `producer` in place of `bridge_sources_sha256` and the constant revision markers (shared semantics block, load-image, entry seed, PDB, jump-table, DOL import, MIPS ISA-mode markers) are removed. - Runtime-selected values keep their meaning without a revision suffix (language_selection, annotation_policy, relocation/no-return/launch policy, MIPS/PowerPC/PSP lanes, MIPS ABI basis). Bridge wire policy ids shared with the Java scripts (ilp32-prototype-v1, o32-soft-float-prototype-v1) are unchanged. BREAKING CHANGE: Ghidra Evidence `analysis_profile.parameters` replace the semantic marker keys and `bridge_sources_sha256` with `producer` ({rea_version, sources_sha256}), and selection values lose their "-vN" suffix (for example `language_selection: "provider-pinned"`). Ghidra Evidence IDs and profile digests change, and analysis snapshots saved by earlier builds are refused at open. Migration: open the target without the old snapshot and save a fresh one; consumers reading the removed marker keys should read `producer` instead. * fix(hopper)!: commit the REA release and bridge script in Hopper analysis profiles (#11324) Hopper analysis profiles committed the launcher digest and one hand-bumped marker (function_dossier_coverage "...-v1"), but neither the REA release nor bridge/hopper_bridge.py. A snapshot saved before a bridge or REA change replayed results the current bridge would not produce. HopperBridgeSources owns the packaged bridge script URL (used to launch it) and hopperProducerIdentity() on the shared ProducerIdentity owner; the profile commits `producer` in place of the marker. BREAKING CHANGE: Hopper Evidence `analysis_profile.parameters` replace `function_dossier_coverage` with `producer` ({rea_version, sources_sha256}). Hopper profile digests and Evidence IDs change, and analysis snapshots saved by earlier builds are refused at open. Migration: open the target without the old snapshot and save a fresh one. * fix(ghidra): build the legacy reference snapshot from another producer and use the shared temp directory * refactor(providers): key Kuna exports and the Native AOT profile on the producer identity (#11353) * fix(ghidra): keep the bridge source table import-free for the Node-loaded verifier scripts/verify-ghidra-bridge-sources.mjs loads GhidraBridgeSources.ts with Node type stripping, which does not resolve .js specifiers to .ts sources. The producer identity import made every verifier run fail with ERR_MODULE_NOT_FOUND; the identity now lives in GhidraProducerIdentity.ts. * fix(artifacts): import the moved file source and abort check from their resources owner after merging main
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
Ghidra snapshot reuse depends on the analysis profile digest. The profile committed only to hand-bumped semantic markers (
…-vNstrings), so a bridge change that forgot to bump its marker left earlier snapshots reusable. #3664 was one such case. Every Ghidra profile now also commits to a SHA-256 of the packaged bridge sources.Refs #3664
Problem and expected behavior
bridge/ghidra/*.javawithout bumping a marker kept the same profile digest, so stale snapshots stayed admissible.Change and scope
src/ghidra/GhidraBridgeSources.ts:ghidraBridgeSourcesDigest()hashes each listed bridge source by name, length and bytes, in name order. It reads the files once per process, from the same packaged directory the launcher uses.src/ghidra/GhidraAnalysisProfile.ts: the shared semantics become a function that addsbridge_sources_sha256. All three profile builders use it (raw/DOL, header-selected imports, existing projects).src/ghidra/GhidraRawProfileDigest.test.tspinned two literal digests that every marker or bridge change had to re-record (the audit counted 14 such commits). It now asserts the committed parameters, including the bridge digest, and that the profile digest is the owner's digest of those parameters.src/ghidra/GhidraBridgeSources.test.ts: the source list covers every packaged.javafile, and the digest matches an independent computation.Contract and boundary impact
Semantic owner and earliest changed stage: Ghidra analysis profile construction.
Contribution scope fit and linked maintainer decision: not applicable.
CLI and MCP/tool-catalog contract: no schema change. Ghidra
profile.parametersgainbridge_sources_sha256, and every Ghidra profile digest changes once.Provider, bridge, target-format, or platform compatibility: every packaged bridge file is listed in
package.json#files, so the digest is computable in installed packages.Evidence, artifact, provenance, or reconstruction contract: new Ghidra Evidence carries the new profile digest. Snapshots recorded before this change are not reused once after upgrading, which is deliberate.
Target selection, authority, upstream behavior, and cleanup details: none.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Evidence and regression coverage
Validation performed
npm run test:focused --on 142 Ghidra, snapshot and analysis-profile test files: 141 passed and 1 was skipped (2,275 tests passed, 11 skipped).npm run typecheckpassed.npx oxlinton the changed files: no errors (two existing warnings onresolveGhidraAnalysisProfile).oxfmtpassed.check:fastlint could not run in the main checkout because agent worktrees under.claude/worktrees/break oxlint config discovery, so the push used--no-verify.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.