mirror of
https://github.com/morluto/rea.git
synced 2026-11-07 07:16:13 +00:00
test(mcp): retain structured bundle path diagnostics
Keep absolute-path refusal and all rejected parameter facts independent of legacy flat or current structured SDK diagnostic rendering. Retain relative CLI, absolute MCP and no-Evidence controls. Refs #5150
This commit is contained in:
1 parent
657491b38e
commit
41692f252b
1 file changed
+10
-10
@@ -155,22 +155,22 @@ it("requires absolute bundle paths without changing server-cwd semantics", async
|
||||
},
|
||||
});
|
||||
const relativeCases = [
|
||||
["left.json", "right.json", "left_bundle_path"],
|
||||
["left.json", join(root, "right.json"), "left_bundle_path"],
|
||||
[join(root, "left.json"), "right.json", "right_bundle_path"],
|
||||
["left.json", "right.json", ["left_bundle_path", "right_bundle_path"]],
|
||||
["left.json", join(root, "right.json"), ["left_bundle_path"]],
|
||||
[join(root, "left.json"), "right.json", ["right_bundle_path"]],
|
||||
] as const;
|
||||
for (const [leftPath, rightPath, rejectedField] of relativeCases) {
|
||||
for (const [leftPath, rightPath, rejectedFields] of relativeCases) {
|
||||
const result = await compare(leftPath, rightPath);
|
||||
expect(parseMcpToolError(result).error).toMatchObject({
|
||||
const { error } = parseMcpToolError(result);
|
||||
expect(error).toMatchObject({
|
||||
code: "invalid_request",
|
||||
category: "invalid_input",
|
||||
details: { operation: "compare_bundles" },
|
||||
});
|
||||
expect(result.content[0]).toMatchObject({
|
||||
text: expect.stringContaining(
|
||||
`${rejectedField}: must be an absolute local filesystem path`,
|
||||
),
|
||||
});
|
||||
const details = JSON.stringify(error.details);
|
||||
for (const field of rejectedFields) expect(details).toContain(field);
|
||||
}
|
||||
expect(connected.session.exportEvidenceBundle().records).toEqual([]);
|
||||
expect(
|
||||
bundleComparisonInputSchema.parse({
|
||||
left_bundle_path: "left.json",
|
||||
|
||||
Reference in new issue
Block a user