feat(mcp)!: harden contracts and evidence references

BREAKING CHANGE: comparison tools now require session-owned Evidence IDs or approved bundle paths, and structured Evidence results use compact references.
This commit is contained in:
morluto
2026-07-16 19:49:58 +08:00
parent ad398a17f5
commit ee1cd40405
47 changed files with 1387 additions and 672 deletions
+14 -2
View File
@@ -44,7 +44,11 @@ const parseJson = (value: string): unknown => {
const inputError = (operation: string): JsonValue => ({
error: "Application workflow failed",
...projectAnalysisError(new AnalysisInputError(operation)),
...projectAnalysisError(
new AnalysisInputError(operation, undefined, [
{ path: [], reason: "invalid_format", expected: "JSON" },
]),
),
});
const jsonFileError = (
@@ -55,7 +59,15 @@ const jsonFileError = (
ok: false as const,
error: {
error: "Application workflow failed",
...projectAnalysisError(new AnalysisInputError(operation)),
...projectAnalysisError(
new AnalysisInputError(
operation,
undefined,
reason === "invalid-json"
? [{ path: [], reason: "invalid_format", expected: "JSON" }]
: [],
),
),
input_path: path,
input_reason: reason,
maximum_input_bytes: MAX_JSON_INPUT_BYTES,