Repository navigation
Conversation
…t find instead of launching the bare name
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a664ff68c
ℹ️ 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 reviewed changes appear safe to merge, with both earlier findings addressed. SummaryWindows objdump and Rizin lookups now refuse unresolved bare commands instead of passing them to Windows for another search.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Select command] --> B{Cancelled or service closed?}
B -->|Yes| C[Return existing error]
B -->|No| D{Command found?}
D -->|No| E[Record unavailable outcome]
E --> F[Return capability_unavailable]
D -->|Yes| G[Check capacity and cleanup]
G --> H[Read target if needed]
H --> I[Launch selected command]
I --> J[Record launch outcome]
Reviews (4) · Last reviewed commit: "fix(reverse): report a Windows lookup re..." · Reviewed by Greptile |
…to capability discovery
* refactor(process): give POSIX PATH search order one owner Program lookup, the packet-tool locator and Jadx's Java lookup each split PATH and resolved empty and relative entries themselves. They now take the candidates from posixPathCandidates in src/process/executableSearch and keep only their own probe and failure reporting. A counted architecture guard keeps new PATH splits from returning; the remaining Windows and Ghidra searches are baselined. * refactor(process): move the colon-split PATH searches onto the search owner REA's launcher-alias lookup and Ghidra's macOS Java lookup split PATH on ":" and skipped relative entries themselves; they now use posixPathCandidates with relativeEntries: "skip", and the guard counts colon splits of PATH as well. * fix(process): produce PATH candidates lazily so an unused entry cannot fail an earlier match * refactor(process): give Windows PATH/PATHEXT search order the executable search owner (#10916) * refactor(process): give Windows PATH/PATHEXT search order the executable search owner * fix(process): keep later PATH entries searchable after a stray quote or a removed working directory * fix(reverse): refuse a Windows objdump or Rizin command that PATH does not find (#10953) * fix(reverse): refuse an objdump or Rizin command Windows PATH does not find instead of launching the bare name * fix(reverse): report a Windows lookup refusal after cancellation and to capability discovery * fix(desktop): search a Windows host's PATH as Windows does when doctor looks up a program programOnPath sent every host through the POSIX PATH search, so on Windows a relative PATH entry reached absoluteCallerPath with platform linux and the Windows working directory, which resolved against itself until the stack overflowed. programOnPath now searches PATH and PATHEXT through windowsPathCandidates on a Windows host, and absoluteCallerPath refuses a non-POSIX working directory with a TypeError instead of recursing.
Summary
On Windows,
inspect_with_objdumpandexecute_rizin_commandresolved a bare command (objdump,rizin, or a bareREA_OBJDUMP_COMMAND/REA_RIZIN_COMMAND) on PATH/PATHEXT, but when nothing matched they launched the bare name anyway, and Windows process creation then also searches the current directory. This PR makes the unresolved case a typedcapability_unavailablerefusal before any launch, asfindWindowsExecutablealready does for the other Windows tools. Stacked on #10891, which now carries #10916 (the Windows PATH/PATHEXT search owner).Problem and expected behavior
objdump.exein REA's current directory. Before:resolveWindowsProviderExecutablereturned"objdump", the spawn searched the current directory and could run that file. An invalid PATHEXT entry likewise fell back to the bare name.capability_unavailableand nothing is launched. Configured paths (absolute, relative with a separator) are unchanged; POSIX is unchanged (execvpdoes not search the current directory unless PATH names it).Change and scope
resolveWindowsProviderExecutablereturnsResult<string, { kind: "not_found" } | WindowsPathSearchFailure>and never returns the bare name.ReverseEngineeringCommandPort) now returnsReverseEngineeringCommandSelection = Result<ReverseEngineeringProviderCommand, ReverseEngineeringCommandUnavailable>;ReverseEngineeringCommandUnavailablecarries the provider identity, the configured command and a tagged reason (not_found,invalid_pathext). Composition (src/composition/reverseEngineering.ts) binds the executable once throughselectCommand.ReverseEngineeringService.#observeturns a refused selection intoAnalysisCapabilityUnavailableErrorafter the cancellation and closed-service checks and before reserving capacity or touching the target, and records it per dispatch through#recordUnavailable(shared with the launch-failure path), soobservedLaunchFailures()and capability discovery report the refusal and its repair until a later success, with diagnostics{ boundary: "provider-lookup", command, lookup_failure, pathext_entry? }. The provider/setting/repair text the launch-failure path wrote inline moved toreverseCommandRepair, which both the lookup refusal and the launch failure use.docs/reverse-engineering-tools.mdstates the Windows lookup and refusal.statSyncper candidate); gdb's command lookup (different owner).Contract and boundary impact
resolveWindowsProviderExecutable(composition) decides found/not-found; the port carries that decision as aResult; the service owns the error and its repair text. Superseded: the bare-name fallback and the inline launch repair text.capability_unavailablewithboundary: "provider-lookup"instead of a launch attempt (previouslycapability_unavailablewithboundary: "provider-launch"andsystem_code: "ENOENT", or a run of a same-named file in the current directory).Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
tests/composition/resolveWindowsProviderExecutable.test.ts(unresolved bare name and invalid PATHEXT return typed failures; composition returns the provider identity and reason);tests/composition/reverseEngineeringCommandPort.test.ts(objdump not found and Rizin invalid PATHEXT through the real composition port and service:capability_unavailable,boundary: "provider-lookup", schema-valid projection, runner never called;observedLaunchFailures()carries the refusal; an already-aborted signal yieldsAnalysisCancelledErrorwith the caller's reason). Fake ports in three composition tests now returnok(...).capability_unavailablerefusal above, e.g. "Could not find the selected objdump command "rea-missing-objdump" on PATH; REA did not search the current directory."CreateProcessbehavior, and Windows is simulated throughwin32path functions and an injected file probe.For evidence-bearing changes:
Validation performed
npm run test:focused -- tests/composition/reverseEngineeringEdgeCases.test.ts tests/boundary/cli/reverseEngineeringCommands.test.ts tests/composition/resolveWindowsProviderExecutable.test.ts tests/composition/reverseEngineeringCommandPort.test.ts tests/composition/reverseEngineering.test.ts tests/composition/reverseEngineeringUnknownFailures.test.ts— 143 passed.observedLaunchFailuresconsumer tests — 185 passed; the two refusal cases fail on the previous commit (discovery and cancellation assertions).npm run typecheck,npx oxlint src/composition src/application/reverse tests/composition(no new findings),npx oxfmton changed files,node scripts/verify/architecture-guards.mjs— passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.