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

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.
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 22:03:14 +08:00
1 parent 341924d043
commit 271e375924
15 files changed
+55 -46

No files matched your search

@@ -628,14 +628,15 @@ it("reads an admitted file even when Windows casing lookup is unavailable", asyn
// The injected descriptor represents a readable share while the optional
// host spelling lookup has no path on this filesystem.
const selected = join(root, "share-selection.bin");
const platform = vi
.spyOn(process, "platform", "get")
.mockReturnValue("win32");
const service = new ByteEntropyService({
stat: ((...args: Parameters<typeof stat>) =>
stat(path, args[1])) as typeof stat,
open: async () => open(path, "r"),
});
const service = new ByteEntropyService(
{
stat: ((...args: Parameters<typeof stat>) =>
stat(path, args[1])) as typeof stat,
open: async () => open(path, "r"),
},
undefined,
"win32",
);
try {
const result = await service.inspect({ path: selected });
if (!result.ok) throw result.error;
@@ -645,6 +646,5 @@ it("reads an admitted file even when Windows casing lookup is unavailable", asyn
expect(result.value.caller_input_path).toBe(selected);
} finally {
await service.close();
platform.mockRestore();
}
});