fix(errors): name rea doctor only for providers it can check (#10565)

* fix(errors): name rea doctor only for providers it can check

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.

* fix(errors): make provider recovery actionable

* test(android): remove brittle recovery wording check

* test: wait for observed child exit before cancellation

* test(errors): check that doctor is not offered instead of matching recovery prose
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 18:09:40 +08:00
1 parent 428e006f66
commit 4aefe2daec
24 files changed
+257 -143

No files matched your search

@@ -1038,6 +1038,61 @@ describe("analysis error projection: Hopper startup failures", () => {
});
});
describe("analysis error projection: unclassified failures", () => {
it.each(["hopper", "ghidra", "ida", "jadx", "kuna"])(
"names doctor only with the provider it can check (%s)",
(providerId) => {
const projected = projectAnalysisError(
new ProviderAdapterError(providerId, "open_binary"),
);
expect(projected.code).toBe("execution_failure");
expect(projected.message).toContain(
`${providerId} provider could not complete open_binary, and REA did not classify the failure`,
);
expect(projected.message).not.toContain("doctor");
expect(projected.remediation.action).toContain(
`\`rea doctor --provider ${providerId}\``,
);
},
);
it.each(["firmware", "native-macos", "rizin", "rea-cdp-browser", "rea"])(
"does not send %s failures to a doctor that cannot check them",
(providerId) => {
const projected = projectAnalysisError(
new ProviderAdapterError(providerId, "inspect"),
);
expect(projected.message).toContain("did not classify the failure");
for (const text of [projected.message, projected.remediation.action])
expect(text).not.toContain("doctor");
},
);
it("keeps an authored provider message as the recovery", () => {
const projected = projectAnalysisError(
new ProviderAdapterError("firmware", "inspect", {
userMessage: "Select a smaller firmware image.",
}),
);
expect(projected.remediation.action).toBe(
"Select a smaller firmware image.",
);
});
it("does not attribute an unreadable result to provider readiness", () => {
const projected = projectAnalysisError(
new AnalysisOutputError("decompile", "failed"),
);
expect(projected.code).toBe("unreadable_output");
for (const text of [projected.message, projected.remediation.action])
expect(text).not.toContain("doctor");
});
});
describe("analysis error projection: retry guidance", () => {
it.each([
[