Repository navigation
refactor(browser): take the host in Chromium, Electron and capture adapters - #11130
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
d1edca4 to
8ac7bc0
Compare
c810fad to
799490b
Compare
[High impact] The reviewed changes appear safe to merge, with the previous finding fully addressed. SummaryThe PR moves host choices into
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[HOST_PLATFORM default] --> C[Composition]
B[Caller-selected host] --> C
C --> D[Provider host checks]
C --> E[Environment rules]
C --> F[Command and cleanup choices]
Reviews (9) · Last reviewed commit: "refactor(config): drop the unused host p..." · Reviewed by Greptile |
8ac7bc0 to
f8c59f5
Compare
799490b to
970938e
Compare
…apters chromiumSandboxEnabled and safeElectronEnvironment take a required platform. The scenario browser, native module resolver, Electron provider and capture cleanup, mitmproxy adapter and web script artifacts take an optional platform seam (default HOST_PLATFORM); Electron fuses read the host architecture from HOST_PLATFORM. Their tests inject the platform instead of redefining process.platform. src/browser no longer reads process.platform or process.arch.
970938e to
3dc9c78
Compare
|
@greptileai please review the latest commit (3dc9c78). The branch was rebased onto main after #11124 merged; the last score refers to an older head. |
…und and batch launch (#11141) * refactor(pcap): take the host platform in the packet tools, native bound and batch launch * test(pcap): cover the selected host in batch launch and capture-host support * refactor(apktool): take the host platform in launcher selection, version probe and decode (#11164) * refactor(apktool): take the host platform in launcher selection, version probe and decode * test(apktool): cover the provider's selected host in launcher selection * refactor(hopper): give the launcher the provider's host platform * refactor(native): inject the host into the pwntools decoders and native capability defaults (#11173) * refactor(native): inject the host into the pwntools decoders and native capability defaults * fix(native): give composed pwntools services the capability host and drop empty test hooks * refactor(adb): take the host platform in binary selection and pulled file names (#11176) * refactor(adb): take the host platform in binary selection and pulled file names * refactor(cli): pass the resolved host platform through rea mcp add (#11179) * refactor(cli): pass the resolved host platform through rea mcp add * refactor(composition): default composition entry points to HOST_PLATFORM and pass it to Hopper and IDA (#11183) * refactor(kuna): require the host platform in admission and installation, and give it to the session client (#11186) * refactor(kuna): require the host platform in admission and installation, and give it to the session client * fix(kuna): pass the host platform from the JavaScript installation callers verify-real-kuna, both native oracle helpers and the command-lifetime child script call inspectKunaInstallation from dist, where TypeScript cannot see the now-required platform. They passed undefined and got unsupported_host on supported hosts. * refactor(server): give createServer a host option and pass it to session tools, sigrok and EVM (#11203) * refactor(server): give createServer a host option and pass it to session tools, sigrok and EVM createServer read process.platform and process.arch live for its capability services, and registerSessionTools read process.platform for process capture. A host option (default HOST_PLATFORM) now selects both, and composition passes the capability host to the sigrok provider and the EVM provider (execution gate, limiter probe and environment rules), as it does for pwntools. hostRestrictedAvailabilityMcp selects its host through the option instead of redefining process.platform and process.arch, and moves to the MCP boundary lane since it no longer touches process-global state. evmCleanupRetry passes SIMULATED_LINUX_X64 to the provider instead of 52 property redefinitions; the fixture moves to tests/fixtures/simulatedHost.ts. * refactor(desktop): require the host platform in build computer and secret folder paths (#11210) * refactor(desktop): require the host platform in build computer and secret folder paths buildComputerArchiveDirectory, defaultBuildComputerArchive, resolveBuildComputerEnvironment and buildSecretsDirectory defaulted to process.platform. Every caller but DesktopBuildComputers' secret folder already passed the platform; it now passes HOST_PLATFORM.platform, which it reads for the build environment. * refactor(filesystem): default caller paths and ChangeTime settling to HOST_PLATFORM (#11212) appendCallerPath, absoluteCallerPath and the ChangeTime settle seams defaulted to a live process.platform read. Their defaults now come from HOST_PLATFORM: the 59 callers that omit the platform join or settle paths they open on this host, and callers describing another host's layout already pass it. The webScriptExport case that redefined process.platform to reach the Windows settle budget moves to its own file, which selects Windows by mocking HostPlatform. * fix(server): report process capture availability for the server's host sessionAvailabilityPolicy imported platform from node:process, so with a selected host binary_session reported capture_process_scenario from the running host while planning and capture used the selected one. It takes the platform from createServer and registerSessionTools. hostRestrictedAvailabilityMcp checks discovery against a dry-run plan on win32 and linux hosts. * build(guards): count platform and arch imports from node:process and node:os as ambient host reads sessionAvailabilityPolicy's named import of platform from node:process escaped the ambient-host-platform guard. The guards now also match named platform/arch imports from node:process or node:os and os.platform()/os.arch(). The one other site, DesktopApplicationCapture's os.arch(), records the capturing host and now reads HOST_PLATFORM.architecture. * refactor(config): take the host platform in parseConfig and give debugger managers the capability host (#11237) * refactor(config): take the host platform in parseConfig and give debugger managers the capability host parseConfig read process.platform for the default Hopper launcher; it takes the platform (default HOST_PLATFORM). GdbSessionManager and RizinDebugSessionManager default their platform to HOST_PLATFORM, and composition passes the capability host that already decides their availability. GDB's /proc descriptor check reads HOST_PLATFORM explicitly: it inspects this host's /proc whatever host the manager models. * refactor(firmware): give the firmware and Wakaru providers the capability host (#11239) * refactor(firmware): give the firmware and Wakaru providers the capability host resolveFirmwareCommand and resolveWakaruCommand read process.platform (and process.arch) for their host gate. They take the platform or host as a parameter; FirmwareProvider and WakaruProvider take a host (default HOST_PLATFORM) for the gate and their environment snapshots, and composition passes the capability host that already decides their availability. The JavaScript analysis source transfer defaults to HOST_PLATFORM. artifactSelectedCommand passes SIMULATED_LINUX_X64 to both providers instead of redefining process.platform and process.arch, and the Wakaru limiter configuration cases now run on any POSIX host. * refactor(captures): give tshark the capability host and default Cutter to HOST_PLATFORM (#11240) * refactor(captures): give tshark the capability host and default Cutter to HOST_PLATFORM TsharkCaptureProvider and CutterBridgeClient defaulted their platform to process.platform. Both default to HOST_PLATFORM now, and composition passes the capability host to the packet capture service, which already decides its availability. * refactor(platform): read HOST_PLATFORM explicitly in host-only path checks (#11241) * refactor(platform): read HOST_PLATFORM explicitly in host-only path checks Electron's readlink target split, IDA's host path comparison, the inspector's reported runtime path, the server identity check and WABT's executable names all describe paths on the running host. They read HOST_PLATFORM instead of process.platform. * test(native): select the native UI verifier's host through HostPlatform (#11242) verify-native-ui.mjs reads its macOS requirement from HOST_PLATFORM, and its action test resolves the script's HostPlatform import to a simulated darwin host instead of redefining process.platform in the child preload. Simulating linux there fails the macOS requirement, so the redirect is effective. * test(mcp): check that composition forwards the selected host to execution hostRestrictedAvailabilityMcp ran execution only on darwin, where the runner's own host also refuses. The new case calls the firmware, Wakaru, tshark, sigrok and EVM tools under a darwin and a linux x64 host and requires different outcomes, so dropping a provider's host forwarding fails on any runner (checked by removing the firmware forwarding). * fix(composition): give the pcap, Apktool and ADB providers the capability host createServer's selected host decided pcap capture discovery, but the default pcap, Apktool and ADB factories built their providers with HOST_PLATFORM. The factories take the platform (default HOST_PLATFORM) and capabilityServices passes its context platform, so availability and execution follow one host.
# Conflicts: # scripts/verify-native-ui.mjs # src/server/sessionAvailabilityPolicy.ts
…wser # Conflicts: # scripts/verify/architecture-guard-baselines.json
# Conflicts: # src/composition/evm.ts
# Conflicts: # scripts/verify/baselines/ambient-host-platform.json # src/application/McpClientRegistration.formats.test.ts # src/browser/PlaywrightElectronActiveFuses.ts # src/captures/TsharkCaptureProvider.ts # src/composition/binary.ts # src/config.test.ts # src/config/parseConfig.ts # src/cutter/CutterBridgeClient.ts # src/electron/ElectronFusePath.ts # src/hopper/HopperProvider.ts # src/native/NativeMacOSProvider.ts
Summary
HostPlatform migration (W8), src/browser: Chromium, Electron and capture adapters take the host instead of reading
process.platform/process.arch, and their tests inject the platform instead of redefining it. Stacked on #11124.Problem and expected behavior
src/browser read the host in 10 places. Six tests redefined
process.platformto reach Android, Linux or Windows branches; once a module takes its host fromHostPlatform, such a test keeps passing without exercising the branch (the failure mode thetest-host-platform-stubguard from #11086 counts).Change and scope
platform:chromiumSandboxEnabled(environment, platform),safeElectronEnvironment(environment, runId, platform).HOST_PLATFORM.platform:openPlaywrightScenarioBrowseroptions (platform, used for the Termux environment, the sandbox decision and--single-process),NativeModuleResolver(third constructor argument),PlaywrightElectronActiveProvider(fourth),ElectronCaptureCleanup(fourth),MitmproxyCaptureAdapter(second, carried throughsnapshotConfiguration),LocalWebScriptArtifacts(third).ElectronProcessCleanupgainssystemElectronCleanupHost(platform), the one owner of its default process operations, used byElectronCaptureCleanupwith its platform.PlaywrightElectronActiveFusesreads the host architecture fromHOST_PLATFORM(it selects the slice this host launches).commandon an adapter built with"linux"), webScriptManifestPaths.process.platform, -2process.arch, -14 test stubs.tests/boundary/filesystem/webScriptExport.test.tsstill redefinesprocess.platformfor a ChangeTime setting read outside src/browser.Contract and boundary impact
src/platform/HostPlatform;systemElectronCleanupHostowns Electron cleanup's default host operations.HOST_PLATFORM).docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): 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
Validation performed
npx tsc --noEmit -p .— passed.npx oxlint src/browserplus the two changed boundary tests — no errors (existing warnings only).node scripts/verify/architecture-guards.mjs --shrink-baselines— passed; baselines lowered.npm run test:focused --ElectronCaptureCleanup, PlaywrightElectronActiveProvider, PlaywrightScenarioBrowser, NativeModuleResolver, ElectronProcessCleanup, PlaywrightElectronActiveFuses, WebArtifactCleanup,tests/boundary/browser/historicalCaptureDecoder.test.ts,tests/boundary/filesystem/webScriptManifestPaths.test.ts— 9 files, 182 passed, 2 skipped.check:fast) — passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.