From 984b95df9fcfec21ee1fbda4719684dd08e70db1 Mon Sep 17 00:00:00 2001 From: agent_coder Date: Tue, 7 Jul 2026 21:35:08 +0300 Subject: [PATCH] =?UTF-8?q?test(mcp):=20#410=20review=20=E2=80=94=20align?= =?UTF-8?q?=20HOST=5FCONTRACT=5FMETHODS=20drift-guard=20(#410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Promoting insertFootnote/insertImage/replaceImage into the in-app DocmostClientLike interface requires their mirror in the drift-guard's HOST_CONTRACT_METHODS list (the bidirectional deepEqual — 40 vs 43 — was red, exactly what the guard exists to catch). Added the three names and corrected the header comment: they were MCP-only but are now in-app-consumed and tracked; only deleteComment/updateComment remain untracked MCP-only. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/mcp/test/unit/client-host-contract.test.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/mcp/test/unit/client-host-contract.test.mjs b/packages/mcp/test/unit/client-host-contract.test.mjs index bf8c26bb..edbb2f74 100644 --- a/packages/mcp/test/unit/client-host-contract.test.mjs +++ b/packages/mcp/test/unit/client-host-contract.test.mjs @@ -28,8 +28,9 @@ import { DocmostClient } from "../../build/index.js"; // in the server's DocmostClientLike interface (the in-app per-user tool adapter // only — it is a SUBSET of the DocmostClient surface — covers only what the in-app adapter // consumes; the standalone MCP transport (packages/mcp/src/index.ts) calls additional -// client methods (insertImage/replaceImage/deleteComment/updateComment/insertFootnote) -// that this guard does NOT track — the MCP transport's own typecheck covers those). Full type-derivation +// client methods (deleteComment/updateComment) that this guard does NOT track — the +// MCP transport's own typecheck covers those. insertImage/replaceImage/insertFootnote +// were MCP-only but are now in-app-consumed too (#410), so they ARE tracked below. Full type-derivation // of DocmostClientLike from this class is deferred (see the staged plan in // docmost-client.loader.ts): the package emits no declarations and the real // (inferred, concrete) return types conflict with the host's loose @@ -76,6 +77,10 @@ const HOST_CONTRACT_METHODS = [ "restorePageVersion", "transformPage", "stashPage", + // write (image / footnote) — MCP-only until #410 promoted them to in-app tools + "insertImage", + "replaceImage", + "insertFootnote", // write (comment) "createComment", "resolveComment",