Repository navigation
Conversation
…ack fails When the byte reader for inspect_native_dispatch_metadata refuses a target (for example a 32-bit Mach-O) and the list_names symbol fallback then fails or returns an invalid inventory, only the fallback's error reached the caller. Retain the reader failure under diagnostics.binary_metadata_failure. Fixes morluto#7651. Carries forward e7884a7 (by @morluto, on @dreinst's morluto#7701). Co-authored-by: morluto <[email protected]> Signed-off-by: Zhaowei Gu <[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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Low impact] The PR appears safe to merge; no actionable issues were found. SummaryThe PR preserves the native reader’s refusal when the symbol fallback fails or returns an invalid inventory.
Reviews (3) · Last reviewed commit: "test(native): pin IDA and Kuna in the di..." · Reviewed by Greptile |
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]>
|
TL;DR: On head 7ae095c, two of the 3 changed test files passed on three Node versions, with 11 tests each. The third, Edit (9 Nov): I ran the new head, 2cba185, in a VM, and the results are here. Results
The PR changes 5 files against the merge base 72d5e72. Three are test files. The other two are The 3 red-run failures on Node 24.22.1 were:
I only have the test names for Node 24.22.1. CI on the head, read live with
The head is 6 commits behind main 88cf498. Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/application/native/NativeDispatchMetadataInspection.fallback.test.ts tests/acceptance/nativeDispatchFallbackFailure.test.ts tests/boundary/mcp/nativeDispatchAvailability.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
The darwin-only acceptance test passes the caller's environment to the CLI and points only Hopper, Ghidra and Java at missing paths. On macOS the list_names fallback has four candidates (ghidra, hopper, ida, kuna), so a REA_IDA_MCP_CONFIG or REA_KUNA_COMMAND set in the developer's shell still reaches it: with REA_KUNA_COMMAND set, kuna is no longer rejected as not_configured. Point both at missing paths, as tests/acceptance/nativeDispatchSnapshot.test.ts does, so the test always exercises the unavailable fallback. Signed-off-by: Zhaowei Gu <[email protected]>
|
Thanks for the independent run on three Node versions. On the three items under "Not run" (everything below ran on macOS 26.7, Intel x86_64, Node 24.22.1, after
|
|
TL;DR: On head 2cba185, the PR's 3 changed test files gave 11 passed and 1 skipped on Node 22.23.4, 24.22.1 and 26.12.1. The skipped file is Thanks, zw-g, for the reply and for commit 2cba185,
The 3 files are CI on the head, read live with
Not run
Test setupCommandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- src/application/native/NativeDispatchMetadataInspection.fallback.test.ts tests/acceptance/nativeDispatchFallbackFailure.test.ts tests/boundary/mcp/nativeDispatchAvailability.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
Thanks for running the new head. On the three "Not run" items, all run on macOS 26.7 (Intel x86_64, Node 24.22.1,
|
…ack fails When the byte reader for inspect_native_dispatch_metadata refuses a target (for example a 32-bit Mach-O) and the list_names symbol fallback then fails or returns an invalid inventory, only the fallback's error reached the caller. Retain the reader failure under diagnostics.binary_metadata_failure. Fixes #7651. Carries forward e7884a7 (by @morluto, on @dreinst's #7701). Signed-off-by: Zhaowei Gu <[email protected]> Supersedes #8036 Co-authored-by: morluto <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
…ack fails When the byte reader for inspect_native_dispatch_metadata refuses a target (for example a 32-bit Mach-O) and the list_names symbol fallback then fails or returns an invalid inventory, only the fallback's error reached the caller. Retain the reader failure under diagnostics.binary_metadata_failure. Fixes #7651. Carries forward e7884a7 (by @morluto, on @dreinst's #7701). Signed-off-by: Zhaowei Gu <[email protected]> Supersedes #8036 Co-authored-by: morluto <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
…ack fails When the byte reader for inspect_native_dispatch_metadata refuses a target (for example a 32-bit Mach-O) and the list_names symbol fallback then fails or returns an invalid inventory, only the fallback's error reached the caller. Retain the reader failure under diagnostics.binary_metadata_failure. Fixes #7651. Carries forward e7884a7 (by @morluto, on @dreinst's #7701). Signed-off-by: Zhaowei Gu <[email protected]> Supersedes #8036 Co-authored-by: morluto <[email protected]> Co-Authored-By: gensokyo-dev <[email protected]>
|
Thank you for this fix. It landed in #10499 with your authorship kept on the commit (adapted where noted in the PR), so I'm closing this PR as superseded. |
Summary
Fixes #7651. When
inspect-native-dispatch-metadata(MCPinspect_native_dispatch_metadata) falls back to thelist_namessymbol inventory because the native byte reader refused the target, and that fallback also fails or returns an invalid inventory, the final error now keeps the reader's refusal underdetails.diagnostics.binary_metadata_failure. Before, only the fallback's error reached the caller, so the reader's reason (for exampleUnsupported 32-bit Mach-O metadata for requested CPU type arm) was lost.This carries forward e7884a7, which @morluto wrote on @dreinst's #7701. dreinst closed #7701 on 2026-10-29. Its other two parts landed separately as #8002 (#7696) and #8013 (#7652). This part is not on main yet.
Problem and expected behavior
Smallest trigger: a 28-byte thin 32-bit Mach-O header (
0xfeedface, CPU 12/subtype 9 armv7, or 7/3 i386,MH_EXECUTE, no load commands) with nolist_namesprovider configured.inspectNativeDispatch(src/application/native/NativeDispatchMetadataInspection.ts) keepsbinaryMetadata.errorin a local variable. On the failed-fallback path it returnserr(execution.error). On the invalid-inventory path it builds a newAnalysisOutputError. Neither carries the reader failure. AGENTS.md asks that partial facts and meaningful failure reasons be preserved, anddocs/tool-design.mdasks that relevant limitations stay with the returned result.Expected: the caller sees both facts. The direct metadata operation was refused for a stated reason, and the symbol alternative could not run. The final error code and category stay those of the fallback (
provider_unavailable,details.operation: list_names).Change and scope
Both failure returns now attach the reader failure with the existing
retainSecondaryFailure(binaryMetadata.error, { binary_metadata_failure: projectAnalysisError(binaryMetadata.error) }). The production change is e7884a7 unchanged.docs/guides/native/native-investigation.md(moved fromdocs/native-investigation.mdby #2791) gains one sentence in the dispatch-fallback paragraph.Scope decision: not applicable. This is an ordinary fix inside an existing read-only static workflow.
Not included:
Contract and boundary impact
inspectNativeDispatch, the shared dispatch workflow that owns the direct-then-symbol fallback. The CLI and MCP adapters consume its error unchanged. No superseded paths.details.diagnosticsgains abinary_metadata_failureentry. Code, category, retryability and the other details are unchanged.docs/public/product-catalog.json), package, or installation impact: none.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 added or updated:
src/application/native/NativeDispatchMetadataInspection.fallback.test.ts(from e7884a7). It covers both failure paths: a failed fallback, and an invalid inventory that keeps its partial observation.tests/boundary/mcp/nativeDispatchAvailability.test.ts, new casekeeps the binary reader refusal when the symbol fallback is unavailable. This is the Linux-runnable public-boundary regression. It uses the production MCP server,open_binaryon a real 28-byte armv7 file, the realNativeMacOSProviderbyte reader with Darwin host support injected, and the realAnalysisProviderRegistrywith one unconfiguredlist_namescandidate. It assertsprovider_unavailableforlist_names, that candidate's availability rejection, abinary_metadata_failurewhose reason matches/32-bit/, and that the unconfigured provider was never called.tests/acceptance/nativeDispatchFallbackFailure.test.ts(from e7884a7). This is the issue's CLI reproduction. It is darwin-only and not part of theapple-artifactsCI list, so it runs only on a macOS developer machine.Base reproduction: the first two files on base give
Tests 3 failed | 8 passed | 1 skipped. The MCP case fails only on the missingdetails.diagnostics.binary_metadata_failure; code, operation and rejections already match on base. All pass with the fix. Commands and counts are under Validation.User-visible CLI/MCP output: from the Linux VM, built CLI, armv7 header, isolated HOME/XDG, missing Hopper launcher. The i386 output has the same shape.
On Linux the byte reader refuses the host before it reads the file, so the retained reason is the platform refusal. With Darwin support injected (the MCP case above, plus a direct call to the built reader), the retained reason is
Unsupported 32-bit Mach-O metadata for requested CPU type arm(x86for i386).Remaining proof gaps: I have not run the real CLI on macOS, where the issue was reported. The darwin-only acceptance test above would cover it. No real provider was configured.
Boundary regressions covered: preserved failure reasons across the CLI/MCP error boundary, and unknown or unavailable outcomes kept visible. No lifecycle stages are touched.
For evidence-bearing changes:
Validation performed
Linux x86_64 (Ubuntu 24.04 VM), Node v24.22.1, rebased on 860fdd8.
npm run test:focused -- src/application/native/NativeDispatchMetadataInspection.fallback.test.ts tests/boundary/mcp/nativeDispatchAvailability.test.ts tests/acceptance/nativeDispatchFallbackFailure.test.ts:Test Files 2 failed | 1 skipped (3),Tests 3 failed | 8 passed | 1 skipped (12);Test Files 2 passed | 1 skipped (3),Tests 11 passed | 1 skipped (12). The skip is the darwin-only acceptance test.npm run test:focused --over the 33 test files that exercise native dispatch metadata, on the fix:Test Files 26 passed | 7 skipped (33),Tests 433 passed | 23 skipped (456). The skipped files are darwin-only.npm run check:fast: pass.npm run docs:check: pass (includesreadmeConsistency.test.ts, 9 passed).npx --no-install lint-stagedandoxfmt --checkon the changed files: pass, no modifications.npm run test:fastand the fullnpm run check. The latter stops at an existing architecture guard that fails the same way on main.Compatibility, safety, and release
Author readiness
Human owner: @zw-g
Before merge
type(scope): outcome.I searched open and closed PRs and issues for
7651, "dispatch fallback reader failure", "retain dispatch reader failure",binary_metadata_failureandinspectNativeDispatch. The only related PR is the closed #7701. The open PRs touchingNativeDispatchMetadataInspection.tsorCapabilityFallback.tsdo not change this function.