refactor(pe): rely on path input contracts

This commit is contained in:
morluto committed 2026-10-27 10:26:31 +08:00
1 parent b0c48e8b65
commit 4f2fc7ca28
3 files changed
+4 -46

No files matched your search

@@ -1,11 +1,7 @@
import { isAbsolute } from "node:path";
import type { ExecutionOptions } from "../AnalysisProvider.js";
import type { PeLoadConfigPort } from "./PeLoadConfigPort.js";
import type { AnalysisError } from "../../domain/analysisErrorBase.js";
import {
AnalysisInputError,
AnalysisOutputError,
} from "../../domain/analysisErrorCore.js";
import { AnalysisOutputError } from "../../domain/analysisErrorCore.js";
import { createEvidence, type Evidence } from "../../domain/evidence.js";
import {
inspectPeLoadConfigInputSchema,
@@ -38,16 +34,6 @@ export class PeLoadConfigService {
options?.signal,
);
if (!input.ok) return input;
if (!isAbsolute(input.value.path))
return err(
new AnalysisInputError(OPERATION, undefined, [
{
path: ["path"],
reason: "invalid_format",
message: "Expected an absolute filesystem path on this host.",
},
]),
);
const result = await this.provider.inspect(input.value, options);
if (!result.ok) return result;
const report = peLoadConfigSchema.safeParse(result.value);