From ca01cf5a1f1f04ebca8ce048b4f4b515329d4ef1 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sat, 24 Oct 2026 03:13:01 +0800 Subject: [PATCH] fix(verification): bind Copilot schema profile to observed inputs --- docs/client-verification.md | 6 ++++++ scripts/verify-copilot-client.mjs | 34 +++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/docs/client-verification.md b/docs/client-verification.md index 117e369cda..e1496e5e92 100644 --- a/docs/client-verification.md +++ b/docs/client-verification.md @@ -149,6 +149,12 @@ REA_VERIFY_COPILOT_MODEL=gpt-4.1 REA_VERIFY_COPILOT_SCHEMA_PROFILE=compact npm r REA_VERIFY_COPILOT_MODEL=gpt-4.1 REA_VERIFY_COPILOT_SCHEMA_PROFILE=compact npm run verify:copilot-client -- call ``` +The verifier explicitly writes either selected profile into its disposable +registration and compares the input schemas forwarded by Copilot with that +profile's advertised schemas. A run must not infer `full` from an unset setting: +REA's runtime default is now `compact`. The recorded client results above remain +scoped to their executed revisions; this verifier correction is not a new client run. + Both native workflows passed with the complete tool inventory. The verifier selects the profile only in its disposable Copilot registration and records it in the receipt. Compact advertisements can reduce nested validation structure; the diff --git a/scripts/verify-copilot-client.mjs b/scripts/verify-copilot-client.mjs index a2b0e5a62f..02b069d694 100644 --- a/scripts/verify-copilot-client.mjs +++ b/scripts/verify-copilot-client.mjs @@ -9,6 +9,9 @@ import { TOOL_CONTRACTS, toolContract, } from "../dist/contracts/toolContracts.js"; +import { advertisedInputJsonSchema } from "../dist/contracts/toolSchemaMetadata.js"; +import { presentAdvertisedInputSchema } from "../dist/contracts/compactInputSchema.js"; +import { compactPresentationForMcpInputSchemaProfile } from "../dist/config/mcpInputSchemaProfile.js"; import { exec } from "./lib/verify-package-core.mjs"; import { assertJavaScriptApplicationInputPaths } from "./lib/javascript-application-paths.mjs"; import { createVerifierRun, completeVerifierRun } from "./lib/verifier-run.mjs"; @@ -161,6 +164,16 @@ const fixture = await createOpenAiModelFixture({ schemaValidator.validateSchema(tool.parameters), `${tool.name}: invalid input schema: ${JSON.stringify(schemaValidator.errors)}`, ); + assert.deepEqual( + tool.parameters, + presentAdvertisedInputSchema( + advertisedInputJsonSchema( + toolContract(tool.name.slice(prefix.length)), + ), + compactPresentationForMcpInputSchemaProfile(inputSchemaProfile), + ), + `${tool.name}: Copilot must forward the selected ${inputSchemaProfile} input schema`, + ); schemasChecked++; } } @@ -327,16 +340,15 @@ try { assert.deepEqual(JSON.parse(repeated.stdout).appliedActions, []); assert.equal(await readFile(configPath, "utf8"), configured); assert.equal(await readFile(`${configPath}.rea.backup`, "utf8"), original); - if (inputSchemaProfile === "compact") { - // Select the existing presentation in this disposable native-client profile. - const customized = JSON.parse(configured); - assert(customized.mcpServers.rea); - customized.mcpServers.rea.env = { - ...customized.mcpServers.rea.env, - REA_MCP_INPUT_SCHEMA_PROFILE: inputSchemaProfile, - }; - await writeFile(configPath, JSON.stringify(customized, null, 2)); - } + // Bind both choices explicitly: the server's default can change independently + // of the profile this verifier promises to exercise and records in its receipt. + const customized = JSON.parse(configured); + assert(customized.mcpServers.rea); + customized.mcpServers.rea.env = { + ...customized.mcpServers.rea.env, + REA_MCP_INPUT_SCHEMA_PROFILE: inputSchemaProfile, + }; + await writeFile(configPath, JSON.stringify(customized, null, 2)); const installedSkill = await readFile( join(skillDirectory, "SKILL.md"), "utf8", @@ -451,7 +463,7 @@ try { capacityBoundary: inputSchemaProfile === "compact" ? "Explicit compact profile: complete inventory and canonical server validation; advertised schemas may be reduced. This does not fix the full-profile gpt-4.1 context boundary." - : "Complete canonical input and output schemas. Client model ID and wire model are recorded separately; effective token capacity and live provider compatibility remain unknown.", + : "Full advertised input schemas, checked at the client request boundary. Client model ID and wire model are recorded separately; effective token capacity and live provider compatibility remain unknown.", catalogSize, schemasChecked, spillReadRequested,