Repository navigation
refactor(process): require the platform for environment snapshots instead of reading the host - #11028
Merged
Merged
Conversation
…tead of reading the host
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. |
Contributor
[Medium impact] The PR appears safe to merge; no blocking issue was found. Summary
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
H["HOST_PLATFORM.platform"] --> C["Caller chooses platform"]
P["Explicit platform"] --> C
C --> S["snapshotEnvironment"]
S --> M["mergeEnvironmentOverrides"]
M --> E["Frozen environment with platform-specific names"]
Reviews (2) · Last reviewed commit: "refactor(process): require the platform ..." · Reviewed by Greptile |
This was referenced Nov 15, 2026
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
snapshotEnvironmentandmergeEnvironmentOverrides(src/process) take the platform as a required parameter instead of defaulting toprocess.platform. Callers that already hold a platform pass it; the others passHOST_PLATFORM.platformat the call site, so the ambient host choice is visible where it is made. Slice of the HostPlatform migration (W8) after #10911.Problem and expected behavior
Both helpers decide Windows case-folding of environment names from a
platform = process.platformdefault. A caller describing another host (a Windows client row inspected from macOS) could silently get the running host's folding, and tests could only select a platform by redefiningprocess.platform. Expected: every call names the platform whose environment rules apply.Change and scope
src/process/snapshotEnvironment.ts:platformis required on both helpers; the module no longer readsprocess.platform(baseline entry removed via--shrink-baselines).composition/binary.tsnow namesHOST_PLATFORM.platformonce asplatformfor the deep binary session and reuses it). Callers without one (providers inadb,android,apktool,browser,evm,firmware,ida,javascript,native,pcap,wasm,server,main,cli,composition, twoapplicationmodules) passHOST_PLATFORM.platform; Ghidra passes its optional installation-host platform orHOST_PLATFORM.platform.process.platformexplicitly.process.platformreads insrc/process(next PR) and in each provider folder; those callers will take the platform as a parameter when their folder migrates, replacing the call-siteHOST_PLATFORM.platform. No behavior change: every call resolves to the same platform value as before.Contract and boundary impact
src/platform/HostPlatformowns the host read;snapshotEnvironmentowns environment folding for a named platform.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/boundary/filesystem/clientConfigurationEnvironment.test.tsandtests/boundary/native/pwndbgReplyFinalization.test.tspass the platform explicitly. The type checker enforces the required parameter at every call; the countedambient-host-platformguard drops one file (2 reads).Validation performed
npx tsc --noEmit -p .— passed.npm run test:focused -- src/process/snapshotEnvironment.test.ts src/browser/modules/NativeModuleResolver.test.ts tests/boundary/browser/historicalCaptureDecoder.test.ts tests/boundary/evm/evmCleanupRetry.test.ts tests/boundary/android/jadxDoctor.test.ts tests/process-global/pwntoolsCleanup.test.ts tests/process-global/pwntoolsCliRemediation.test.ts tests/process-global/hostRestrictedAvailabilityMcp.test.ts tests/boundary/filesystem/clientConfigurationEnvironment.test.ts tests/boundary/native/pwndbgReplyFinalization.test.ts src/setupEnvironment.test.ts— 212 passed, 12 skipped.node scripts/verify/architecture-guards.mjs --shrink-baselines— passed.npm run check:fast— passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.