Repository navigation
fix(discovery): carry provider repair instructions into capability discovery - #8532
Conversation
…scovery Provider readiness reported only a failure description, so capability discovery copied that description into tool_availability remediation and dropped repairs the owners already had: the JEB discovery-deadline setting, the ADB/Apktool execute-permission repair kept in diagnostics, and the IDA and Kuna configuration recovery. Unavailable ProviderAvailability now requires the owner's remediation next to its reason, and readiness-derived unavailable capability descriptors carry it too. Every producer supplies it (ADB, Apktool, JADX, JEB, Ghidra, Hopper, IDA, Kuna, pcap, owned-process prerequisites, profile rejection); the inventory uses it verbatim, falling back to the reason only for static capability facts that declare no repair. ADB/Apktool configuration failures own remediation as a field instead of diagnostics, and execution refusals project it as remediation.action. JADX doctor reads the availability's remediation instead of re-deriving it. binary_session complete candidate availability and unavailable capability groups expose remediation (CLI capabilities/providers too); summary omits it and lists it in omitted_fields. The superseded IDA configuration_remediation and windows_native_failure.remediation diagnostics are removed. Fixes #8506 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 146213c91f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[Medium impact] The reporting changes appear safe to merge; all three earlier findings are fixed. SummaryAdds owner-authored
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Owner["Provider readiness owner"] --> Availability["Unavailable provider + repair"]
Owner --> Operations["Unavailable operations + repair"]
Availability --> Candidates["Complete provider candidates"]
Availability --> Selection["Explicit selection errors"]
Availability --> Inventory["Tool availability"]
Operations --> Groups["Session capability groups"]
Groups --> Inventory
Reviews (2) · Last reviewed commit: "fix(discovery): keep owner repairs throu..." · Reviewed by Greptile |
…ability maps Address review findings on the readiness-remediation contract: - Provider selection rejections carry the availability owner's remediation, CLI/MCP error details project it, and an explicit selection refused by readiness uses it as remediation.action. IDA's unreadable registration and Ghidra's Windows readiness repair no longer degrade to generic selection advice now that the diagnostics copies are gone. - Ghidra's Windows readiness and existing-project capability maps carry the same repair as the availability. - pcap readiness keeps the limiter owner's repair (now a typed remediationAction) and falls back to Wireshark guidance only when the failure has none. - ADB/Apktool repairs are owner constants that are complete sentences. The execution refusal keeps its previous message-plus-repair recovery, which the compiled CLI contract asserts. - Regression tests compare with the owning formatter or constant and add public MCP and CLI coverage for an explicit IDA selection. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…scovery (morluto#8532) * fix(discovery): carry provider repair instructions into capability discovery Provider readiness reported only a failure description, so capability discovery copied that description into tool_availability remediation and dropped repairs the owners already had: the JEB discovery-deadline setting, the ADB/Apktool execute-permission repair kept in diagnostics, and the IDA and Kuna configuration recovery. Unavailable ProviderAvailability now requires the owner's remediation next to its reason, and readiness-derived unavailable capability descriptors carry it too. Every producer supplies it (ADB, Apktool, JADX, JEB, Ghidra, Hopper, IDA, Kuna, pcap, owned-process prerequisites, profile rejection); the inventory uses it verbatim, falling back to the reason only for static capability facts that declare no repair. ADB/Apktool configuration failures own remediation as a field instead of diagnostics, and execution refusals project it as remediation.action. JADX doctor reads the availability's remediation instead of re-deriving it. binary_session complete candidate availability and unavailable capability groups expose remediation (CLI capabilities/providers too); summary omits it and lists it in omitted_fields. The superseded IDA configuration_remediation and windows_native_failure.remediation diagnostics are removed. Fixes morluto#8506 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(discovery): keep owner repairs through provider selection and capability maps Address review findings on the readiness-remediation contract: - Provider selection rejections carry the availability owner's remediation, CLI/MCP error details project it, and an explicit selection refused by readiness uses it as remediation.action. IDA's unreadable registration and Ghidra's Windows readiness repair no longer degrade to generic selection advice now that the diagnostics copies are gone. - Ghidra's Windows readiness and existing-project capability maps carry the same repair as the availability. - pcap readiness keeps the limiter owner's repair (now a typed remediationAction) and falls back to Wireshark guidance only when the failure has none. - ADB/Apktool repairs are owner constants that are complete sentences. The execution refusal keeps its previous message-plus-repair recovery, which the compiled CLI contract asserts. - Regression tests compare with the owning formatter or constant and add public MCP and CLI coverage for an explicit IDA selection. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…uidance Resolve conflicts in CapabilityInventory.ts, createServer.ts, and registerSessionTools.ts. Main's morluto#8532 made unavailable ProviderAvailability carry the owner's remediation next to its reason, which is the same provider-ownership rule this change threads through AndroidAnalysisPort.setupGuidance. The resolutions keep both: availability remediation is the primary source, provider setup guidance (with the pinned JAR URL and SHA-256) replaces the two hardcoded literals main added to the application and server layers, and the reason field keeps reporting the observation rather than the repair. Main's morluto#8051 moved session registration into a family callback that already supplies the availability probes, so the standalone block is dropped in favour of adding androidSetupGuidance to that callback. The IDA effects fixture added on main needs setupGuidance to satisfy the widened AndroidAnalysisPort contract.
…superseded Main's owner-remediation contract already carries the provider's repair instruction into capability discovery, so the guidance threaded through AndroidAnalysisPort.setupGuidance, AvailabilityPolicy.androidAnalysisRemediation, and SessionToolOptions.androidSetupGuidance never reaches a production server: createServer always supplies an Android availability probe, and the status tool drops the entries that would read the fallback. JADX_SETUP_GUIDANCE was inert. Remove that channel and its wrapper, keep the provider-owned string in JadxRelease and JadxConfiguration, and let the inventory read the availability remediation the way its adb, apktool, and jeb siblings do.
main moved docs/native-investigation.md to docs/guides/native/native-investigation.md (morluto#2791). Git carries this branch's four-line docs change over to the new path. main also made `remediation` required on an unavailable ProviderAvailability (morluto#8532), so the unconfigured symbol provider fixture in nativeDispatchAvailability.test.ts now sets one. Without it the merged tree fails `npm run typecheck` (TS2322). Signed-off-by: Zhaowei Gu <[email protected]>
What broke: Capability discovery (
binary_session.tool_availability) put each provider's failure description inremediationand dropped the repair the owner already had (JEB discovery deadline setting, ADB/Apktool execute-permission repair, IDA and Kuna configuration recovery).Fix: Unavailable
ProviderAvailabilitynow requires the owner'sremediationnext toreason. Readiness-derived unavailable capability descriptors and provider-selection rejections carry it too. The inventory uses it verbatim, and an explicit selection of an unready provider returns it asremediation.action.Risk: Additive output change: complete candidate availability and unavailable capability groups gain
remediation, summary lists it inomitted_fields, and the superseded IDAconfiguration_remediationandwindows_native_failure.remediationdiagnostics are removed. Reason texts are unchanged except JEB's connection reason, which no longer embeds the repair.Summary
Fixes #8506. Also covers the Kuna configuration case confirmed in the issue comment.
Before this change, the shared availability contract (
ProviderAvailability) had onlystatus/code/reason/diagnostics, so the capability inventory usedreason(what failed) asremediation(what to do). Owners that had a repair either dropped it (JEB, Kuna) or kept it in free-form diagnostics that the inventory ignored (ADB, Apktool, IDA). Now the repair has one first-class slot that every readiness producer fills, and discovery, doctor and CLI/MCP output read that slot.Problem and expected behavior
REA_JEB_MCP_TIMEOUT_MSdiscovery deadline gaveremediation: "This request reached REA's configured JEB catalog discovery deadline of 100 ms (deadlineExpired).". It now gives the deadline owner's action,Increase REA_JEB_MCP_TIMEOUT_MS in REA's launch environment … restart and reconnect REA to apply it. …. Caller cancellation still throws instead of reporting unavailability (unchanged).Check file type and execute permission for REA_ADB_PATH or select an executable adb binary.(and the Apktool equivalent). A missing selection gets the different "existing binary" repair.REA_IDA_MCP_CONFIGnow carriesCorrect REA_IDA_MCP_CONFIG in the environment that starts REA (your shell or the MCP client's registration), then rerun.to the availability and to every operation it makes unavailable.REA_KUNA_JOBS/REA_KUNA_TIMEOUT_MS/REA_KUNA_CACHE_DIRnow reaches discovery with the configuration owner'sCorrect … or unset it to use its default. Restart REA after changing the environment., the same text the doctor already reported.Change and scope
src/application/AnalysisProvider.ts): unavailableProviderAvailabilityrequiresremediation; unavailableCapabilityDescriptorhas optionalremediationfor readiness-derived refusals (static capability facts declare none).remediationas a constructor field (exported owner constants) instead ofdiagnostics.remediation. Their execution refusal keeps its previous message-plus-repair recovery. The pcap limiter refusal now carries a typedremediationAction, which readiness keeps ahead of the Wireshark fallback. JADX derives remediation from its tagged failure kind; JEB uses the failure's projected action (deadline owner) or the connection remediation; IDA, Kuna, Ghidra, Hopper, pcap, owned-process prerequisites, profile rejection and the missing-Android fallback each supply theirs. IDA, Kuna and Ghidra (Windows readiness and Windows existing-project maps) mark readiness-gated operations with the same reason, code and remediation.ProviderSelectionRejectioncarries the availability owner'sremediation, and CLI/MCP error details project it. Aprovider_unavailableselection of a concrete provider uses that repair asremediation.action; refusal-supplied recovery still wins, andautokeeps the generic advice.CapabilityInventoryreadsremediationfrom owner probes (ADB, Apktool, JEB, Android, EVM) and from descriptors, falling back toreasononly when a static descriptor has no repair. JADX doctor reads the availability's remediation instead of re-deriving it (an untagged owned-process failure now gets the procps repair instead of JAR guidance).BinarySessionStatusgroups descriptors by remediation too, and a runtime unavailability replaces an earlier repair rather than keeping it.remediationhere (marked with a comment). [Bug] Firmware capability recovery recommends the wrong alternative engine #8507 (firmware engine selection) has a different cause and its own PR, fix(firmware): recommend the operation-specific engine #8513. Some deep-provider reasons still embed their repair (Ghidra installation reason equals its remediation, Kunanot_configured, owned-process), so complete detail repeats that text. Splitting them would change summary output, so it is left as follow-up.Contract and boundary impact
remediation. The sharedProviderAvailability/CapabilityDescriptor/ProviderSelectionRejectioncontracts carry it.CapabilityInventory,BinarySessionStatus,ProviderSelectionError, the error projection,JadxDoctorandproviderConfigurationRefusalconsume it. The superseded diagnostics copies are removed: ADB/Apktooldiagnostics.remediation, IDAconfiguration_remediation, and IDA/Ghidrawindows_native_failure.remediation.binary_sessionoutput schema addsremediationto complete unavailable candidate availability and an optionalremediationto unavailable capability groups.omitted_fieldsaddsanalysis_provider_candidates.availability.remediation, and thedetailinput description is updated. CLIcapabilities/providersshare the same status projection. Tool-availability semantics are unchanged except thatremediationtext is now the owner's repair.windows_native_failure.stage..agents/skills/reverse-engineer-anything/mentions the complete-detail remediation.Expected effects:
(Existing readiness probes are unchanged; this changes only what they report.)
Evidence and regression coverage
tests/boundary/mcp/capabilityRemediationMcp.test.ts(new, production MCP composition): real JEB discovery deadline against the HTTP JEB fixture (REA_JEB_MCP_TIMEOUT_MS=100, hanging catalog), plus real ADB/Apktool readiness probes against mode-0600 and missing selections, checked through finaltool_availability.tests/boundary/providers/readinessRemediationInventory.test.ts(new): an unreadable IDA registration throughinspectReadinessSnapshot→providerCapabilitySets→ inventory foranalyze_function/procedure_pseudo_code. KunaREA_KUNA_JOBS=33,REA_KUNA_TIMEOUT_MS=0andREA_KUNA_CACHE_DIR=relativego through the same projection, with the doctor (inspectKunaProvider) as the matching control. A controlled open-target status exercises only the final projection, as in the issue.open_binary(provider_id: "ida") and compiled-CLIdecompile … --provider ida --jsontests (tests/boundary/cli/providerSelectionRemediationCli.test.ts) compareremediation.actionand the rejection'sremediationwith IDA's readiness output. The Windows Ghidra readiness repair is checked throughregistry.selectplus completesession.statuscapability groups. The pcap limiter repair is checked at its owner (PcapNativeBound.test.ts) and at Linux-only readiness.src/application/binary/BinarySessionStatus.test.ts: groups split by remediation, runtime unavailability drops a superseded repair, scoped registrations keep it, complete detail keeps candidate remediation and summary omits it.jebMcp,sessionMcpprocps case, JEB/ADB/Apktool/IDA/Ghidra/Hopper provider tests,providerConfigurationRefusal), plus fixtureremediationfields.src/files restored toaa48d494e(tests kept), both new boundary files failed all 7 tests: JEB, both ADB/Apktool cases, IDA and all three Kuna settings got the old description-as-remediation. The fix was then restored andgit statuswas clean against the commit.createDirectAnalysis(env).runSessionStatus(), the CLIcapabilitiesimplementation, with a missingREA_IDA_MCP_CONFIGandREA_KUNA_JOBS=33):Boundary regressions: final discovery output for distinct producer outcomes (timeout, permission denied, missing selection, unreadable registration, invalid settings) with a working doctor comparison, and cancellation still distinct (JEB rethrows on caller abort, unchanged). No lifecycle stages changed.
Validation performed
Local Node 26.5.0 (CI uses the pinned 24.22.1), Darwin arm64.
adbClifailures):npm run compilesucceeded locally. Against thatdist/, the CLI filesadbCli,apktoolCli,pcapCli,jebCli,directAnalysisStatus,projectedErrorStatusandproviderSelectionRemediationClipass.doctorHopperDiscovery,idaDoctorRegistration,kunaDoctorIdentityandsetupProviderReadiness, plus the doctor step ofidaWorkspaceDiscovery, fail only because local Node 26.5.0 is below doctor's supported 26.12.1+. Their discovery steps pass.nativeMachoSummaryMcppasses locally in 5.8 s. Its CI 30 s timeout in the optional Apple lane looks unrelated: this PR only adds optional string fields to thebinary_sessionschema.npm run check:fast— passed (typecheck + lint; no new lint errors; the ADB/Apktool failure constructors add 2max-paramswarnings, matching the existingJadxConfigurationFailureshape).npm run format:check— passed.vitest run --maxWorkers=3over 158 related files (ADB, Apktool, JADX, JEB, IDA, Kuna, pcap, Ghidra, EVM, Hopper, registry/status/inventory, doctor, server, composition, related MCP/provider boundaries, README consistency) on the final commit — 2845 passed, 82 skipped (platform-gated).dist/(EVM worker, IDA verifier, ADB CLI). That run also had one load-related failure,pcapProviderCancellation; on rerun it passed 8/8 with this change and on base.tests/conformance/readmeConsistency.test.ts— 9 passed.npm run docs:checkandnpm run metadata:check. Under Node 26 they crash instripTypeScriptTypes(modetransform). CI runs them on Node 24.Compatibility, safety, and release
availability.remediationinstead ofdiagnostics.configuration_remediation(IDA) ordiagnostics.windows_native_failure.remediation(IDA/Ghidra on Windows).binary_sessionschema.Author readiness
Human owner: @kaoru0822-kitauji
Before merge
type(scope): outcome.🤖 Generated with Claude Code