Repository navigation
fix(native): accept walkable Mach-O command tables - #8002
Conversation
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. |
[Medium impact] The PR appears safe to merge; no blocking issue was found. SummaryRemoves the separate 4096-command ceiling from
Reviews (2) · Last reviewed commit: "test(native): verify large command table..." · Reviewed by Greptile |
Summary
Fixes #7696. A valid 4097-command Mach-O table was refused as malformed by native dispatch inspection, even though it fit the selected slice and input-byte budget. Remove the separate 4096-command ceiling; the shared
MachoLoadCommandCursorcontinues to validate command sizes, alignment, count and exact table exhaustion.Change and boundary impact
The shared native Mach-O layout producer owns this change; dispatch decoding and its CLI/MCP consumers reuse it. Retain selected-slice bounds, CPU/FAT identity checks, input-byte admission, target digests, resource cleanup and existing partial/unsupported metadata semantics. There is no command inventory allocation: the cursor walks each header and retains only interpreted metadata. No schemas, response shape, provider capabilities or authority change. Maintainer scope decision: not applicable to this existing static parser fix.
Validation performed
npm run test:local -- src/native/AppleMachoSelection.test.ts src/domain/apple/machoLoadCommands.test.ts src/native/AppleDispatchMetadata.test.ts— 177 passed.npm run test:focused -- tests/boundary/filesystem/machoCommandAdmission.test.ts tests/boundary/providers/native/objcClassMetadataFallback.test.ts tests/boundary/providers/native/nativeDispatchMetadataFileCleanup.test.ts tests/boundary/cli/nativeDispatchInputBudget.test.ts tests/boundary/cli/nativeDispatchRecordBudget.test.ts— 27 passed, 3 existing macOS-only CLI tests skipped on Linux. This covers malformed framing, slice identity, unsupported formats and failed descriptor cleanup.npm run check:fast, changed-fileoxfmt --threads=2,node --check scripts/verify/apple/dispatch.mjs,git diff --check— passed.verify:apple-dispatch, already selected by the macOS CI lane: exercise public CLI and stdio MCP with an exact caller byte budget, assert admission/provenance and identical normalized results. The macOS 15 CI verifier step passed, including this case and the existing compiler-produced Objective-C/Swift fixtures. The full Apple CI job also passed 28 boundary files (401 tests passed, 5 skipped); dispatch verification reported 11 fixture variants. Local Linux skips are reported separately above.54f5cf7e1(including the MCP validation change) in a temporary merge worktree: 177 source tests and 8 public MCP boundary tests passed, 2 macOS-only tests skipped. MCP capability scenarios use an injected provider; this additional check does not claim macOS execution.inspectAppleDispatchMetadatafile workflow, including digest admission, result schema and scope cleanup: real 2,228,640-byte SevenZipJBinding macOS x86_64 dylib distributed with Ghidra 12.1.4, plus 65 KiB 4096/4097-command controls. The real artifact and 4096 control returned byte-identical results before/after; 4097 changed from a bounds exception to valid metadata.Real-artifact SHA-256:
dc0e3f370c2966c37c98c33a1f2070308c274f86fc2c1a44e525588fe5961915. The real dylib static file comparison ran on Linux x64 / Node 24.22.1; macOS CLI/MCP coverage is established separately by the CI verifier above.Performance and limits
Production decoder/file workflow, first call then 10 warm calls (OS-cache cold runs unmeasured): real-artifact wall 41.8 → 48.1 ms first, 17.1 → 19.7 ms per warm call; CPU 103.1 → 111.7 ms first, 32.1 → 36.3 ms warm. Whole-probe sampled process-family peak RSS 184.1 → 185.2 MiB (5 ms sampling, no children; 512 MiB JS heap, 2 V8/IO workers). Timings include host variance; no speedup is claimed. The newly accepted 4097 table completed in 2.4 ms first / 2.8 ms warm. Prior failure latency is not a successful-task baseline.
The real normalized result remains 1,958 bytes; command headers are not added to agent replies. Actual agent tokens, client/catalog overhead and end-to-end macOS CLI costs were not measured; no token-reduction claim. No cache or retained command list was added.
Author readiness
Human owner: @gensokyo-dev
The user explicitly authorized a ready PR and waived the human-confirmation gate for this session. The unchecked declarations do not attest that a human reviewed the diff or validation evidence.