Repository navigation
fix(ghidra): report a missing existing-project program as a configuration error - #8222
Conversation
…tion error When REA_GHIDRA_PROJECT_PATH selects a project that has no root program with the selected name, Ghidra's headless analyzer aborts with "Requested project program file(s) not found: <name>". REA reported this as a generic execution_failure with rea doctor advice, and the reason was visible only in the captured diagnostics. Recognize that refusal in the operation-scoped launcher output, matching only the exact name REA passed to -process, and return a ConfigurationError for REA_GHIDRA_PROGRAM_NAME. The message says whether the name was configured or defaulted from the target file name, and the remediation explains how to select the exact root program. The selected project is unchanged and there is no fallback to a fresh import. Other launch failures keep their existing projection. Fixes morluto#8216
[Medium impact] The PR appears safe to merge, with the previous test-brittleness finding fixed and no new blocking issues found. SummaryThe PR reports a missing program in an existing Ghidra project as
Reviews (2) · Last reviewed commit: "test(ghidra): assert missing-program gui..." · Reviewed by Greptile |
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. |
Compare the projected setting constraint and remediation with ghidraMissingProgramGuidance instead of freezing explanatory phrases, following docs/testing.md. The program name and configured-or-defaulted origin are still checked independently.
Summary
Fixes #8216. When
REA_GHIDRA_PROJECT_PATHselects a project with no root program of the selected name, the first provider query now returnsconfiguration_invalidforREA_GHIDRA_PROGRAM_NAMEinstead of genericexecution_failurewithrea doctoradvice.Problem and expected behavior
REA_GHIDRA_PROGRAM_NAMEor, when unset, the target basename) not naming a root program in the project. Ghidra's headless analyzer aborts withRequested project program file(s) not found: <name>(thrown byHeadlessAnalyzer.processNoImportwhen-processmatched nothing).projectPrimarySessionErrorfell through toProviderAdapterError, so the caller sawAnalysis could not complete. Run rea doctor.... The actual reason was only in captured launcher output, and a target-free doctor run reports healthy.ConfigurationErrorwith settingREA_GHIDRA_PROGRAM_NAME. The message names the program and whether it was configured or defaulted from the target file name. The remediation says to set the exact root program name in the environment that starts REA, then restart and reopen. The project selection is preserved, no fresh-import fallback is attempted, and the originalGhidraSessionErrorand diagnostics stay attached as the cause.Change and scope
GhidraProviderClient.ts:readGhidraFailureOutputalso exposes the operation-scoped stdout/stderr text. If it contains Ghidra's refusal for the exact program name REA passed to-process, the projection returns the new error. The match requires the name to end at end-of-line or a space, so a longer name such asfixture_otheror unrelated output does not match.program_namefrom the committed existing-project profile now reaches the projection. Limits and program name travel together as oneGhidraProjectionargument, keepingconfig's live getters for runtime-updated limits.Not included: #8217 (changed-project refusal), any doctor check that lists project programs, and any change to program-name validation, project copying or selection.
Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
projectPrimarySessionErrorinGhidraProviderClient.ts, consuming the launcher's operation-scopedfailure_output. No producer changes.codechanges fromexecution_failuretoconfiguration_invalid, withdetails.settingsnamingREA_GHIDRA_PROGRAM_NAME, plus newmessageandremediation.actiontext. Other failures are unchanged.projectSessionErroris unchanged.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/ghidra/GhidraProvider.behavior.test.ts, new "Ghidra missing project program" block, using a temporary.gpr/.repand an injected start failure carrying Ghidra's abort line:fixture, the target basename):configuration_invalid,REA_GHIDRA_PROGRAM_NAMEsetting, "defaulted from the target file name" origin, norea doctorin the remediationREA_GHIDRA_PROGRAM_NAME=program_gamma: "set by REA_GHIDRA_PROGRAM_NAME" originfixture_other): staysexecution_failureexecution_failureGhidraProviderClient.tsreverted tod48e472fa, the first two tests fail and the two controls pass. The abort text is source-derived from Ghidra 12.1.4HeadlessAnalyzer.javaand matches the output quoted in [Bug] Missing Ghidra project program is hidden behind generic doctor advice #8216.configuration_invalidREA configuration is invalid: Ghidra found no root program named "fixture" (defaulted from the target file name because REA_GHIDRA_PROGRAM_NAME is unset) in the selected REA_GHIDRA_PROJECT_PATH project.Set REA_GHIDRA_PROGRAM_NAME to the exact name of a root program in the selected project, in the environment that starts REA (your shell or the MCP client's registration), then restart REA and open the target again. REA did not modify the project or fall back to a fresh import.npm run check:pranddocs:checkwere not run locally.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
Not a boundary or lifecycle change: only the projection of an existing startup failure changes.
Validation performed
npx vitest run src/ghidra/GhidraProvider.behavior.test.ts -t "Ghidra missing project program": 4 passed. With the source change reverted, 2 failed and 2 passed.npx vitest run src/ghidra: 34 files, 984 tests passed.npx tsc --noEmit -p .: no errors.npm run lint: passed, module boundaries checked in 3446 files. The oxlint warnings onGhidraProviderClient.tsmatchmain.npx oxfmt --checkon both changed files: correct format.Compatibility, safety, and release
execution_failurefor this case now getconfiguration_invalid, which is the code already used for an invalidREA_GHIDRA_PROGRAM_NAME.Author readiness
Human owner: @macjayz
Before merge
type(scope): outcome.