[PR #7081] [MERGED] fix(ghidra): report a DOL language override conflict as a configuration error #7628

Closed
opened 2026-11-03 13:39:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7081
Author: @Adolanium
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @morluto

Base: main ← Head: fix/ghidra-dol-override-conflict


📝 Commits (2)

  • 34fdb87 fix(ghidra): report a DOL language override conflict as a configuration error
  • c74384c test(ghidra): keep a valid compiler spec out of the DOL language conflict

📊 Changes

3 files changed (+47 additions, -12 deletions)

View changed files

📝 docs/ghidra-provider.md (+1 -1)
📝 src/ghidra/GhidraAnalysisProfile.ts (+9 -6)
📝 src/ghidra/GhidraDolProfile.test.ts (+37 -5)

📄 Description

Summary

Fixes #7082.

With REA_GHIDRA_LANGUAGE_ID set to a language outside PowerPC:BE:32:*, an otherwise admitted GameCube DOL is refused as an unsupported target. docs/ghidra-provider.md and the other fixed-import lanes treat such an override as a configuration error naming the conflicting setting, so the user is not told to pick another target. The DOL lane now does the same.

Problem and expected behavior

resolveGhidraAnalysisProfile returned AnalysisUnsupportedTargetError when ghidraDolLanguageUnsupportedReason rejected the override. The DOL is valid and opens without the override; the setting is what conflicts. docs/ghidra-provider.md: "An override that conflicts with a fixed raw, DOS, PSP, MIPS or RISC-V import is a configuration error naming the conflicting settings. It does not make an otherwise admitted target unsupported". The PSP, raw, DOS, MIPS and RISC-V lanes already return languageOverrideConflict (from the fix for #6031); the DOL lane landed afterwards with the older pattern.

Expected: configuration_invalid with settings: [{ setting: "REA_GHIDRA_LANGUAGE_ID", … }] and the same message.

Change and scope

  • src/ghidra/GhidraAnalysisProfile.ts: the DOL lane returns languageOverrideConflict. Only REA_GHIDRA_LANGUAGE_ID is named: DOL accepts a compiler-spec override, so the selected compiler spec is passed as the pinned value and is not blamed.
  • docs/ghidra-provider.md lists GameCube DOL among the fixed-import lanes.

Not included: which PowerPC variants are allowed is unchanged.

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.

Contribution scope: not applicable. This is a fix inside the existing Ghidra profile resolution.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the gamecube-dol branch of resolveGhidraAnalysisProfile.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: the error for this case changes from an unsupported target to configuration_invalid naming REA_GHIDRA_LANGUAGE_ID; the message is unchanged.
  • Provider, bridge, target-format, or platform compatibility: Ghidra, GameCube/Wii DOL targets.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): the requested setting is preserved and named; the target stays admitted.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; 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.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/ghidra/GhidraDolProfile.test.ts, "refuses an installed override that is not big-endian 32-bit PowerPC": with REA_GHIDRA_LANGUAGE_ID=x86:LE:32:default, the result keeps the existing message and now also projects configuration_invalid with exactly one setting, REA_GHIDRA_LANGUAGE_ID.
  • Base reproduction or other evidence: with GhidraAnalysisProfile.ts from upstream/main 0a2b7af90 and the updated test, the test fails.
  • User-visible CLI/MCP output (if applicable): the error for a DOL opened with a conflicting language override.
  • Remaining proof gaps: no real Ghidra run; the test uses the profile installation fixture.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

On Linux (WSL Ubuntu, Node 24.22.1) at 34fdb87b7 (on upstream/main 0a2b7af90), after npm ci and npm run build:cached:

  • npx tsc -p . --noEmit passed.
  • npx oxfmt --check on the changed files: clean. node scripts/ci/static-check-report.mjs lint: 0 errors. npm run docs:check passed.
  • npx vitest run src/ghidra tests/boundary/ghidra: 880 passed, 1 skipped, in two runs.
  • The negative check above failed the updated test.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; the message is unchanged and the error now matches the other fixed-import lanes.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux unit and boundary tests only; no real Ghidra.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @Adolanium

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7081 **Author:** [@Adolanium](https://github.com/Adolanium) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/ghidra-dol-override-conflict` --- ### 📝 Commits (2) - [`34fdb87`](https://github.com/morluto/rea/commit/34fdb87b76b3714f98c5b0d0221f89ac7e2b08f4) fix(ghidra): report a DOL language override conflict as a configuration error - [`c74384c`](https://github.com/morluto/rea/commit/c74384c7a5304901df1c0f7a88f563604d00f48b) test(ghidra): keep a valid compiler spec out of the DOL language conflict ### 📊 Changes **3 files changed** (+47 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `docs/ghidra-provider.md` (+1 -1) 📝 `src/ghidra/GhidraAnalysisProfile.ts` (+9 -6) 📝 `src/ghidra/GhidraDolProfile.test.ts` (+37 -5) </details> ### 📄 Description ## Summary Fixes #7082. With `REA_GHIDRA_LANGUAGE_ID` set to a language outside `PowerPC:BE:32:*`, an otherwise admitted GameCube DOL is refused as an unsupported target. `docs/ghidra-provider.md` and the other fixed-import lanes treat such an override as a configuration error naming the conflicting setting, so the user is not told to pick another target. The DOL lane now does the same. ## Problem and expected behavior `resolveGhidraAnalysisProfile` returned `AnalysisUnsupportedTargetError` when `ghidraDolLanguageUnsupportedReason` rejected the override. The DOL is valid and opens without the override; the setting is what conflicts. `docs/ghidra-provider.md`: "An override that conflicts with a fixed raw, DOS, PSP, MIPS or RISC-V import is a configuration error naming the conflicting settings. It does not make an otherwise admitted target unsupported". The PSP, raw, DOS, MIPS and RISC-V lanes already return `languageOverrideConflict` (from the fix for #6031); the DOL lane landed afterwards with the older pattern. Expected: `configuration_invalid` with `settings: [{ setting: "REA_GHIDRA_LANGUAGE_ID", … }]` and the same message. ## Change and scope - `src/ghidra/GhidraAnalysisProfile.ts`: the DOL lane returns `languageOverrideConflict`. Only `REA_GHIDRA_LANGUAGE_ID` is named: DOL accepts a compiler-spec override, so the selected compiler spec is passed as the pinned value and is not blamed. - `docs/ghidra-provider.md` lists GameCube DOL among the fixed-import lanes. Not included: which PowerPC variants are allowed is unchanged. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#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. Contribution scope: not applicable. This is a fix inside the existing Ghidra profile resolution. ## Contract and boundary impact - Semantic owner and earliest changed stage: the `gamecube-dol` branch of `resolveGhidraAnalysisProfile`. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: the error for this case changes from an unsupported target to `configuration_invalid` naming `REA_GHIDRA_LANGUAGE_ID`; the message is unchanged. - Provider, bridge, target-format, or platform compatibility: Ghidra, GameCube/Wii DOL targets. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): the requested setting is preserved and named; the target stays admitted. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; 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. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `src/ghidra/GhidraDolProfile.test.ts`, "refuses an installed override that is not big-endian 32-bit PowerPC": with `REA_GHIDRA_LANGUAGE_ID=x86:LE:32:default`, the result keeps the existing message and now also projects `configuration_invalid` with exactly one setting, `REA_GHIDRA_LANGUAGE_ID`. - Base reproduction or other evidence: with `GhidraAnalysisProfile.ts` from upstream/main 0a2b7af90 and the updated test, the test fails. - User-visible CLI/MCP output (if applicable): the error for a DOL opened with a conflicting language override. - Remaining proof gaps: no real Ghidra run; the test uses the profile installation fixture. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed On Linux (WSL Ubuntu, Node 24.22.1) at 34fdb87b7 (on upstream/main 0a2b7af90), after `npm ci` and `npm run build:cached`: - `npx tsc -p . --noEmit` passed. - `npx oxfmt --check` on the changed files: clean. `node scripts/ci/static-check-report.mjs lint`: 0 errors. `npm run docs:check` passed. - `npx vitest run src/ghidra tests/boundary/ghidra`: 880 passed, 1 skipped, in two runs. - The negative check above failed the updated test. ## Compatibility, safety, and release - Breaking changes or migration steps: none; the message is unchanged and the error now matches the other fixed-import lanes. - Real Hopper/Ghidra, browser, or OS coverage: Linux unit and boundary tests only; no real Ghidra. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: @Adolanium - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:39:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7628
No description provided.