Repository navigation
fix(errors): name rea doctor only for providers it can check - #10565
Merged
Merged
Conversation
An unclassified ProviderAdapterError, an unreadable result and the final presentation fallback all told the caller to run rea doctor, although doctor checks only hopper, ghidra, ida, jadx, kuna and desktop_build. The doctor scope list moves into the domain so presentation can consult it: covered providers get `rea doctor --provider ID`, others are told plainly that the failure is unclassified and where its reason is reported. Producers whose actionable reason lived only in details.diagnostics now author it: Ghidra's committed-profile conflicts share one owner that says to reopen the target, closed analysis clients share one owner, and a jadx-reported request failure no longer points at provider readiness. The deep-analysis profile rejection names doctor only for doctor-checkable providers. Dead presentation branches for tags handled earlier are removed.
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. SummaryThis PR limits generic
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ProviderAdapterError] --> B{Authored recovery?}
B -- Yes --> C[Keep authored recovery]
B -- No --> D{Authored message?}
D -- Yes --> E[Keep message as recovery]
D -- No --> F{Provider in shared doctor list?}
F -- Yes --> G[Offer provider-scoped doctor check]
F -- No --> H[State no specific recovery is known]
Reviews (11) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
# Conflicts: # src/ghidra/GhidraProviderClient.ts
# Conflicts: # tests/boundary/providers/kuna/kunaVersionProbeOwnership.test.ts
22 tasks
# Conflicts: # src/providers/AnalysisClientCreation.ts
This was referenced Nov 15, 2026
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
Recovery advice told callers to "Run
rea doctor" for any provider failure REA did not classify, for any unreadable result, and in the final presentation fallback.rea doctor --providercan check only hopper, ghidra, ida, jadx, kuna and desktop_build. This PR names doctor only for those providers; every other unclassified failure says plainly that REA did not classify it and where the provider's reason is reported.Refs #10482 (the doctor advice is removed for a jadx-reported per-method failure; the method-scoped
body_statusresult the issue asks for is not part of this change).Problem and expected behavior
new ProviderAdapterError("firmware", op)(and 113 other sites with no message or remediation) projected"Analysis could not complete. Run \rea doctor` and review the reported details; ...". doctor rejects--provider firmware`, so the advice cannot be followed.AnalysisOutputError/AnalysisProtocolError("unreadable result") also named doctor, though doctor does not inspect a provider's reply.details.diagnostics.reason. For example,GhidraProviderClient.tssaid "reopen the target to resolve a new profile" in diagnostics while the message said to run doctor and that repeating would not succeed.Expected: doctor appears only where doctor can check the provider. Otherwise the message states that the failure is unclassified, and recovery names the real next step when the producer knows it.
Change and scope
DOCTOR_PROVIDER_IDSmoves fromsrc/application/DoctorProviderIds.tstosrc/domain/doctorProviderIds.tswith anisDoctorProviderIdpredicate. Doctor, setup and the CLI import it from there, so presentation (domain) and doctor share one list.analysisErrorPresentation.ts:ProviderAdapterErrorgets the message "The {provider} provider could not complete {operation}, and REA did not classify the failure. Any reason the provider reported is in details.diagnostics."rea doctor --provider {id}for doctor-checkable providers. For other providers it states that no specific recovery is known.userMessagewithout remediation keeps today's behavior: the message is the recovery.createGhidraProviderClientand the installation-version conflict now go through oneghidraProfileConflictowner. It puts the reason in the message and says to reopen the target.AnalysisClientCreation,DeferredAnalysisClientandCompositeProviderare replaced byclosedAnalysisClientError.JadxSession) now says jadx answered with an error, so provider readiness checks cannot repair it.AnalysisProviderEvaluation) now namesrea doctor --provider IDonly for doctor-checkable providers. rizin and other providers get installation guidance without doctor.Intentionally not included:
FixedCeiling/AdjustableBudget/AmbiguousSelector). They come in a separate PR.UnclassifiedProviderFailure, plan W5d).ProviderAdapterErrorsites. They now get honest generic text.ConfigurationErrorwithout settings. Doctor covers both cases.Contribution scope: not applicable (ordinary fix within existing boundaries).
Contract and boundary impact
Semantic owner and earliest changed stage: the doctor scope list is owned in the domain and consumed by doctor, setup, CLI and error presentation. Presentation owns the generic text. Ghidra profile conflicts and closed-client errors each have one producer helper.
Contribution scope fit and linked maintainer decision: not applicable.
CLI and MCP/tool-catalog contract: no schema change. The projected
code,category,retryableanddetailsare unchanged; onlymessageandremediation.actiontext changes.Provider, bridge, target-format, or platform compatibility: none.
Evidence, artifact, provenance, or reconstruction contract: none.
details.diagnostics.reasonvalues are preserved, includingclient_closed.Target selection, authority, upstream behavior, and cleanup details: not applicable.
Generated metadata, package, or installation impact:
docs/user-visible-errors.csvrows for ProviderAdapterError and unreadable results are updated.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/domain/analysisErrorProjection.test.ts(new "unclassified failures" block). It checks that doctor-checkable providers getrea doctor --provider ID, that firmware/native-macos/rizin/rea-cdp-browser/rea never mention doctor, that an authored message stays the recovery, and that unreadable output names no doctor.tests/boundary/process/jadxIntegration.test.ts: a jadx tool-error reply through the real protocol fixture projects without doctor.src/ghidra/GhidraProvider.behavior.test.ts: the changed-installation refusal puts the reason in the message and says to reopen the target.AnalysisProviderRegistry.test.ts,WakaruReport.test.tsandenhancedTools.callPathsAndBatches.test.ts: updated from the old doctor text.Base reproduction: with only
analysisErrorPresentation.tsreverted toorigin/main, all 11 new projection cases fail (doctor text is emitted for every provider, and--provideris never named).User-visible output (from the projection test), for
ProviderAdapterError("firmware", "inspect"): message "The firmware provider could not complete inspect, and REA did not classify the failure. Any reason the provider reported is in details.diagnostics.", remediation "Review the reported details for the provider's reason; REA has no specific recovery for this unclassified failure. Repeating the unchanged request is not expected to succeed."Remaining proof gaps: no real Ghidra or jadx run. The Ghidra and jadx paths are covered by the existing simulated provider fixtures.
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
npm run check:fast: passed (typecheck + lint).npm run test:focused -- src/domain/analysisErrorProjection.test.ts src/ghidra/GhidraProvider.behavior.test.ts tests/boundary/mcp/enhancedTools.callPathsAndBatches.test.ts tests/boundary/process/jadxIntegration.test.ts src/doctorRuntime.test.ts: 5 files, 506 passed, 1 skipped.npm run test:local -- src/application/binary/CompositeProvider.test.ts src/application/binary/DeferredAnalysisClient.test.ts src/application/binary/LazyAnalysisProvider.test.ts src/application/binary/AnalysisProviderRegistry.test.ts src/providers/AnalysisClientFailure.test.ts src/domain/analysisErrorProjection.test.ts src/main/messages.test.ts: 7 files, 194 passed.npm run test:local -- src/javascript/recovery/WakaruReport.test.ts src/domain/analysisErrorProjection.test.ts src/application/binary/AnalysisProviderRegistry.test.ts: 159 passed.npm run docs:check: passed.npm run test:local -- src/application/binary/AnalysisProviderRegistry.test.ts— 47 passed;npm run test:focused -- tests/boundary/process/jadxIntegration.test.ts— 53 passed. Pre-pushnpm run check:fastpassed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.