Skip to content

refactor(application): read the host from HostPlatform in the remaining application modules - #11124

Merged
morluto merged 1 commit into
mainfrom
refactor/host-platform-application-rest
Nov 15, 2026
Merged

morluto merged 1 commit into
mainfrom
refactor/host-platform-application-rest

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

HostPlatform migration (W8), src/application slice 3: the remaining application modules stop reading process.platform / process.arch. After this, src/application has no ambient host reads. Stacked on #11120.

Problem and expected behavior

Fourteen reads remained in src/application (BinaryTargetResolver, LinuxHopper, desktop, environment, binary, binaryDiagnostics, javascript, process, reverse). Two were defaults on pure helpers (prepareProcessScenarioPlan, createProcessScenarioPlanEvidence), so a caller could silently fall back to the host; the rest are host file or process operations that should name the host explicitly. ByteEntropyService.test.ts stubbed process.platform to exercise its Windows casing branch.

Change and scope

  • Required platform: prepareProcessScenarioPlan(scenario, environment, platform, signal?) (its environment default is dropped too, so no defaulted parameter precedes the platform) and createProcessScenarioPlanEvidence(scenario, platform). Every caller already passed both.
  • Host operations read HOST_PLATFORM: target resolution's Windows source path and host architecture default (BinaryTargetResolver), the Linux distribution read (LinuxHopper), SafeOutputTree roots (desktop builds and solves, desktop output tree, environment bundle write), Windows native snapshot admission (AnalysisSnapshotCache), the Electron executable check, the process-ownership recovery fallback (ReverseEngineeringService) and the process CLI adapter (ProcessCli).
  • ByteEntropyService takes an optional platform constructor seam (default HOST_PLATFORM.platform); its Windows casing test injects "win32" instead of vi.spyOn(process, "platform", "get").
  • Baselines: -14 process.platform / -2 process.arch reads; -1 test stub (ByteEntropyService.test.ts) in test-host-platform-stub (refactor(android): take the host in JADX configuration, doctor and workspace roots #11086).
  • Not included: src/server/registerSessionTools.ts (passes process.platform to the scenario planner; moves with src/server).

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/platform/HostPlatform.
  • Contribution scope fit and linked maintainer decision: W8 plan (coordinator rule: pure helpers take a required platform; host-only operations and optional test seams read HOST_PLATFORM).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none on the running host (same values).
  • Evidence, artifact, provenance, or reconstruction contract: none; plan Evidence records the platform its caller passes, as before.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; 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.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: ByteEntropyService.test.ts (reads an admitted file even when Windows casing lookup is unavailable) injects the platform.
  • Base reproduction or other evidence: source-derived; the values are unchanged on the running host.
  • User-visible CLI/MCP output (if applicable): none.
  • Remaining proof gaps: no Windows host run.

Validation performed

  • npx tsc --noEmit -p . — passed.
  • node scripts/verify/architecture-guards.mjs --shrink-baselines — passed; baselines lowered.
  • npm run test:focused -- LinuxHopper, LinuxHopperPublisher, AnalysisSnapshotCache, ByteEntropyService, DesktopBuildComputers.cleanup, DesktopBuildSolves, DesktopOutputTree, environmentBundleWrite, ElectronActiveObservationService, ProcessScenarioPreparation and tests/boundary/process/ProcessEvidence.test.ts — 11 files, 206 passed, 1 skipped; src/ghidra/GhidraDolProfile.test.ts and src/application/binary/LazyAnalysisProvider.test.ts (target resolution) — 17 passed.
  • Pre-push hook (check:fast) — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none (internal signatures).
  • Real Hopper/Ghidra, browser, or OS coverage: macOS only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T12:54:09.443531Z
We couldn’t complete this review. Comment @codex review to try again.
e447c85 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@morluto
morluto force-pushed the refactor/host-platform-client-config branch from fdbba49 to 6bf7c55 Compare November 15, 2026 12:55
@morluto
morluto force-pushed the refactor/host-platform-application-rest branch from e447c85 to d1edca4 Compare November 15, 2026 12:56
@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

This PR moves the remaining application host reads to HOST_PLATFORM.

  • Binary targets use shared host facts for platform checks and default architecture.
  • Linux Hopper checks distribution support with the shared host architecture.
  • Host-specific admission checks use the shared platform value.
  • Byte entropy reads use a selectable platform value.
  • Desktop build environments use the shared host platform.
  • Desktop output writes use the shared host path rules.
  • Process planning now requires callers to name the environment and platform.

Reviews (1) · Last reviewed commit: "refactor(application): read the host fro..." · Reviewed by Greptile

@morluto
morluto force-pushed the refactor/host-platform-application-rest branch from d1edca4 to 8ac7bc0 Compare November 15, 2026 13:06
@morluto
morluto changed the base branch from refactor/host-platform-client-config to main November 15, 2026 13:31
…ng application modules

Scenario planning and plan Evidence take a required platform. Host file operations (target resolution, output trees, Windows spelling lookup, executable checks, native snapshot admission), the Linux distribution read and the process CLI adapter read HOST_PLATFORM explicitly. ByteEntropyService takes an optional platform seam, so its Windows casing test injects win32 instead of stubbing process.platform. src/application no longer reads process.platform or process.arch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant