Repository navigation
fix(native): name the ownership helper prerequisite in command failures - #2506
Conversation
Every supervised native command launch needs the Darwin process-ownership helper. When that helper cannot be compiled (relative REA_DARWIN_SWIFTC_PATH, missing SDKROOT, a missing compiler, or an SDK/compiler mismatch), the runner reduced the typed DarwinProcessOwnershipInspectionError to a bare `io` failure. inspect_macho then reported `execution_failure` with no hint, and inspect_artifact on any universal Mach-O said only "lipo could not enumerate universal Mach-O slices". The runner now keeps the inspection message as the failure's `detail` at the launch boundary and carries it through xcrun resolution. The native provider adds it to its diagnostics and the slice reader appends it to its message, matching what the SQLite and capture providers already report. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@greptileai review |
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Every supervised native command launch on macOS needs the Darwin process-ownership helper. When that helper can't be compiled,
XcrunCommandRunnerturned the typedDarwinProcessOwnershipInspectionErrorinto a bareiofailure and dropped its message. Causes include a relativeREA_DARWIN_SWIFTC_PATH,REA_DARWIN_SWIFTC_PATHwithout an absoluteSDKROOT, a missing compiler, or an SDK/compiler mismatch after a toolchain update. Users then saw messages that pointed nowhere near the cause:rea doctordoesn't report it either. The cause chain waslipo: io→xcrun: io→DarwinProcessOwnershipInspectionError("Direct Darwin helper compilation requires absolute REA_DARWIN_SWIFTC_PATH and SDKROOT …"). The SQLite and web-capture providers already show this message indiagnostics.reason. Only the native path lost it.Fix
CommandRunnerclassifies the typed inspection error once, at the launch boundary. It stores the message asNativeCommandFailure.detailand carries it through thexcrun --findresolution wrapper.NativeMacOSProvideraddsdetailto theProviderAdapterErrordiagnostics.MachOSliceArtifactReaderappends the detail to its "lipo could not enumerate" message.Failure reasons and categories are unchanged. When the helper is healthy, the output is byte-identical:
inspect-artifact /bin/lsreturns the same evidence ID before and after.After:
Validation
NativeCommandLauncherseam: one on the runner (nativeCommandTermination.test.ts) and one on the slice reader (machoSliceReader.test.ts). Both fail on main and pass with this change. The production ownership host is a process-wide singleton built fromprocess.envat import time, so it can't be injected per test.npm run test:focusedpassed for those two files plusnativeProvider.test.tsandMachOSliceArtifactReader.test.ts(45 tests).npm run check:fastandformat:checkalso passed.SDKROOT, and a nonexistent compiler.Remaining
rea doctorstill doesn't check whether the ownership helper compiles, so its remediation can't point at this. That needs its own doctor check, which I left out of this PR.🤖 Generated with Claude Code
Summary by CodeRabbit