fix(process): derive executable names from the capture host (#1108)

This commit is contained in:
Ysopwnable
2026-10-09 02:02:24 +08:00
committed by GitHub
parent 8b08ec0af9
commit 34cc9259c1
3 changed files with 32 additions and 2 deletions
@@ -6,6 +6,30 @@ import { parseProcessScenario } from "../../../src/domain/process/processScenari
import { createProcessCaptureEvidence } from "../../../src/application/process/ProcessEvidence.js";
import { observeSettlement } from "../../../src/process/capture/ProcessCaptureLifecycle.js";
it.each([
["win32", "program.exe"],
["linux", "directory\\program.exe"],
["darwin", "directory\\program.exe"],
] as const)(
"interprets the executable name using the captured %s host",
(platform, expectedName) => {
const scenario = parseProcessScenario({
executable: "/fixtures/directory\\program.exe",
working_directory: process.cwd(),
events: [],
});
const base = emptyUnverifiedProcessCapture();
const capture = parseProcessCapture({
...base,
manifest: { ...base.manifest, platform },
});
expect(
createProcessCaptureEvidence(scenario, capture).parameters
.executable_name,
).toBe(expectedName);
},
);
it("stamps process Evidence from the capture manifest host", () => {
const scenario = parseProcessScenario({
executable: process.execPath,