fix(paths): enforce selected path contracts at admission (#9465)

This commit is contained in:
morluto authored and GitHub committed 2026-11-09 03:14:48 +08:00
1 parent b4b881116f
commit 25d3c7237f
18 files changed
+57 -93

No files matched your search

@@ -1,4 +1,3 @@
import { isAbsolute } from "node:path";
import { getHeapStatistics } from "node:v8";
import type { ArtifactResourceScope } from "../../artifacts/ArtifactResourceScope.js";
import { AnalysisError } from "../../domain/analysisErrorBase.js";
@@ -125,10 +124,6 @@ export const inspectApiContractEvidence = async (
);
if (!admitted.ok) return admitted;
const input = admitted.value;
if (!isAbsolute(input.path))
return err(
inputFailure("Expected an absolute filesystem path on this host."),
);
if (input.format === "graphql-sdl") {
const { importGraphqlContract } =
await import("./GraphqlContractImport.js");
@@ -1,4 +1,3 @@
import { isAbsolute } from "node:path";
import { getHeapStatistics } from "node:v8";
import { version } from "graphql";
import type { ArtifactResourceScope } from "../../artifacts/ArtifactResourceScope.js";
@@ -153,13 +152,6 @@ export const importGraphqlContract = async (
resources: ArtifactResourceScope,
signal?: AbortSignal,
) => {
if (input.operations_path !== undefined && !isAbsolute(input.operations_path))
return err(
inputFailure(
"operations_path",
"Expected an absolute filesystem path on this host.",
),
);
const loaded = await readApiContract(input, resources, signal);
if (!loaded.ok) return loaded;
const artifact = {