diff --git a/tests/boundary/mcp/ghidraEvidenceMcp.test.ts b/tests/boundary/mcp/ghidraEvidenceMcp.test.ts index 610ebba9b7..87050304bc 100644 --- a/tests/boundary/mcp/ghidraEvidenceMcp.test.ts +++ b/tests/boundary/mcp/ghidraEvidenceMcp.test.ts @@ -84,7 +84,7 @@ it.each([ name: "compare_functions", arguments: { left: evidence, right: evidence }, }); - expect(reply.isError).not.toBe(true); + expect(reply.isError, JSON.stringify(reply)).not.toBe(true); const comparison = functionComparisonResultSchema.parse( sessionEvidence(harness.session, reply.structuredContent) .normalized_result, @@ -176,7 +176,7 @@ it("retains terminal-call qualifications across function views and snapshot repl : { procedure: identity.address, document: "fixture" }, }; const reply = await harness.mcp.callTool(request); - expect(reply.isError, name).not.toBe(true); + expect(reply.isError, `${name}: ${JSON.stringify(reply)}`).not.toBe(true); const evidence = sessionEvidence( harness.session, reply.structuredContent, @@ -231,7 +231,7 @@ it("retains handler-region limitations on incoming and outgoing reference Eviden name: "procedure_references", arguments: { procedure: dossier.procedure.address, direction }, }); - expect(reply.isError).not.toBe(true); + expect(reply.isError, JSON.stringify(reply)).not.toBe(true); const evidence = sessionEvidence( harness.session, reply.structuredContent, diff --git a/tests/boundary/mcp/ghidraMcpHarness.ts b/tests/boundary/mcp/ghidraMcpHarness.ts index ca4e87ed02..13e2a272fa 100644 --- a/tests/boundary/mcp/ghidraMcpHarness.ts +++ b/tests/boundary/mcp/ghidraMcpHarness.ts @@ -265,6 +265,8 @@ const resultBuilders = new Map([ procedure: ghidraFunctionIdentity(), direction: input.direction ?? "outgoing", references: [ghidraReferenceEdge()], + reference_kinds_available: true, + unresolved_calls: [], }), ], ["xrefs", () => ["0x401001"]], diff --git a/tests/boundary/mcp/ghidraProfileRefusalMcp.test.ts b/tests/boundary/mcp/ghidraProfileRefusalMcp.test.ts index fd32c4051d..cda019642c 100644 --- a/tests/boundary/mcp/ghidraProfileRefusalMcp.test.ts +++ b/tests/boundary/mcp/ghidraProfileRefusalMcp.test.ts @@ -14,7 +14,7 @@ import { parseMcpToolError } from "../../fixtures/mcpToolError.js"; import { ghidraInstallationHost } from "./ghidraMcpHarness.js"; const REFUSAL = - "REA_GHIDRA_LANGUAGE_ID cannot override the admitted raw-binary import."; + "Processor or compiler specification overrides cannot replace the admitted raw-binary import."; const openRawArm = async (languageId: string | undefined) => { const directory = await mkdtemp(join(tmpdir(), "rea-profile-refusal-")); @@ -67,24 +67,15 @@ const openRawArm = async (languageId: string | undefined) => { } }; -it("returns provider-selection diagnostics when the selected provider refuses its profile", async () => { +it("returns configuration diagnostics when a language override conflicts with the admitted profile", async () => { const { result, clients } = await openRawArm("ARM:LE:32:v7"); expect(clients).toBe(0); const { error } = parseMcpToolError(result); expect(error).toMatchObject({ - code: "capability_unavailable", + code: "configuration_invalid", message: expect.stringContaining(REFUSAL), details: { - selection_reason: "target_unsupported", - requested_provider_id: "ghidra", - candidate_ids: ["ghidra"], - rejections: [ - expect.objectContaining({ - provider_id: "ghidra", - code: "target_format_unsupported", - reason: REFUSAL, - }), - ], + settings: [{ setting: "REA_GHIDRA_LANGUAGE_ID", constraint: REFUSAL }], }, }); }); diff --git a/tests/boundary/mcp/nativeCallObservationMcp.test.ts b/tests/boundary/mcp/nativeCallObservationMcp.test.ts index 863e05ed65..12a8f647b7 100644 --- a/tests/boundary/mcp/nativeCallObservationMcp.test.ts +++ b/tests/boundary/mcp/nativeCallObservationMcp.test.ts @@ -156,8 +156,11 @@ it("routes observe_native_calls through MCP with schema-checked input and output details: { issues: [ expect.objectContaining({ - path: ["environment", "__proto__"], - reason: "invalid_type", + path: [], + reason: "invalid_value", + message: expect.stringMatching( + /environment\.__proto__:.*expected string, received number/u, + ), }), ], }, diff --git a/tests/boundary/mcp/nativeUiFinalizationMcp.test.ts b/tests/boundary/mcp/nativeUiFinalizationMcp.test.ts index 2a389e1554..55583a411f 100644 --- a/tests/boundary/mcp/nativeUiFinalizationMcp.test.ts +++ b/tests/boundary/mcp/nativeUiFinalizationMcp.test.ts @@ -81,7 +81,7 @@ it.each([false, true])( ...(fails ? { cleanup: "incomplete", - execution_failure: "execution_failure", + execution_failure: "provider_timeout", diagnostics: { primary_error: { code: "provider_timeout" }, }, diff --git a/tests/boundary/mcp/workflowUnknownIdentityMcp.test.ts b/tests/boundary/mcp/workflowUnknownIdentityMcp.test.ts index d563d571ca..92779dd525 100644 --- a/tests/boundary/mcp/workflowUnknownIdentityMcp.test.ts +++ b/tests/boundary/mcp/workflowUnknownIdentityMcp.test.ts @@ -243,6 +243,9 @@ it("continues rejecting duplicate explicit record_unknown identities", async () name: "record_unknown", arguments: input, }); - expect(parseMcpToolError(duplicate).error.code).toBe("revision_conflict"); + expect(parseMcpToolError(duplicate).error).toMatchObject({ + code: "invalid_request", + message: expect.stringContaining("already exists"), + }); }); });