From 3afcd641462bbd99ebdc3bf2fc8264e2c3344c09 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Tue, 29 Sep 2026 18:25:25 +0800 Subject: [PATCH] test(mcp): consolidate catalog inventory checks --- ....01-lists-the-complete-target-open.test.ts | 1 + tests/boundary/mcp/serverIdentity.test.ts | 3 ++- tests/boundary/mcp/serverLifecycleMcp.test.ts | 21 ------------------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts b/tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts index 7da2cf16f..0e6bad5dc 100644 --- a/tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts +++ b/tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts @@ -186,6 +186,7 @@ describe("enhanced MCP tools", () => { ) .sort(), ).toEqual(ENHANCED_TOOL_CONTRACTS.map(({ name }) => name).sort()); + expect(listed.tools.map(({ name }) => name)).not.toContain("open_binary"); }); it("executes all twelve tools through production registration", async () => { diff --git a/tests/boundary/mcp/serverIdentity.test.ts b/tests/boundary/mcp/serverIdentity.test.ts index 0891f6a0c..6bb79f94e 100644 --- a/tests/boundary/mcp/serverIdentity.test.ts +++ b/tests/boundary/mcp/serverIdentity.test.ts @@ -11,6 +11,7 @@ import { import { PACKAGE_METADATA } from "../../../src/generatedPackageMetadata.js"; import { PRODUCT_IDENTITY, SDK_IDENTITY } from "../../../src/identity.js"; import { TOOL_CONTRACTS } from "../../../src/contracts/toolContracts.js"; +import { PROMPT_CONTRACTS } from "../../../src/contracts/promptContracts.js"; import { createServer } from "../../../src/server/createServer.js"; import { createServerIdentity } from "../../../src/serverIdentity.js"; import { observed } from "../../fixtures/analysisExecution.js"; @@ -97,7 +98,7 @@ describe("server and catalog identity", () => { expect(CATALOG_IDENTITY.counts).toEqual({ cli_commands: CLI_COMMAND_NAMES.length, mcp_tools: TOOL_CONTRACTS.length, - mcp_prompts: 6, + mcp_prompts: PROMPT_CONTRACTS.length, }); expect(CATALOG_IDENTITY.digests.combined_sha256).toMatch(/^[a-f0-9]{64}$/u); }); diff --git a/tests/boundary/mcp/serverLifecycleMcp.test.ts b/tests/boundary/mcp/serverLifecycleMcp.test.ts index 74a6697ab..58e8b0bcd 100644 --- a/tests/boundary/mcp/serverLifecycleMcp.test.ts +++ b/tests/boundary/mcp/serverLifecycleMcp.test.ts @@ -7,11 +7,6 @@ import { HopperRemoteError } from "../../../src/domain/errors.js"; import { err } from "../../../src/domain/result.js"; import { observed as ok } from "../../fixtures/analysisExecution.js"; import { createServer } from "../../../src/server/createServer.js"; -import { - SESSION_TOOL_CONTRACTS, - TOOL_CONTRACTS, -} from "../../../src/contracts/toolContracts.js"; -import { MANAGED_WORKFLOW_TOOL_CONTRACTS } from "../../../src/contracts/managedWorkflowToolContracts.js"; const resources: Array<{ close(): Promise }> = []; @@ -50,22 +45,6 @@ const structured = (result: CallToolResult): Record => { return Object.fromEntries(Object.entries(result.structuredContent)); }; -it("preserves the target-open tool inventory without a session", async () => { - const client = await connect({ - execute: () => Promise.resolve(ok(null)), - }); - const listed = await client.listTools(); - expect(listed.tools).toHaveLength( - TOOL_CONTRACTS.length - - SESSION_TOOL_CONTRACTS.length - - MANAGED_WORKFLOW_TOOL_CONTRACTS.length, - ); - const names = listed.tools.map((t) => t.name); - expect(names).toContain("binary_overview"); - expect(names).toContain("batch_decompile"); - expect(names).not.toContain("open_binary"); -}); - it("projects remote failures without provider or bridge details", async () => { const client = await connect({ execute: () =>