From 4ab0f137ead6949b0d6a930461b5e9238741626e Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 27 May 2026 08:33:58 -0700 Subject: [PATCH] fix(test): tighten put_page regression pin to CLI subcommand The test asserted no substring 'put_page' anywhere in the resolver, but the BRAIN_WRITE_BACK resolver legitimately references the MCP op `mcp__gbrain__put_page` as the fallback path for calibration takes when gbrain v0.42+'s `takes_add` op isn't available. The check conflated the deprecated `gbrain put_page` CLI subcommand (renamed in v0.18+ to `gbrain put`) with the still-valid MCP op of the same name. Narrow the assertion to `gbrain put_page` (with the space) so the fallback prose stays legal while the CLI rename regression stays caught. Co-Authored-By: Claude Opus 4.7 (1M context) --- test/resolvers-gbrain-put-rewrite.test.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/resolvers-gbrain-put-rewrite.test.ts b/test/resolvers-gbrain-put-rewrite.test.ts index 1f9cac82a..75a0d2225 100644 --- a/test/resolvers-gbrain-put-rewrite.test.ts +++ b/test/resolvers-gbrain-put-rewrite.test.ts @@ -35,11 +35,18 @@ function listTrackedSkillMd(): string[] { return out.split("\n").filter((line) => line.trim().length > 0); } -describe("scripts/resolvers/gbrain.ts — no put_page in emitted instructions (regression for #1346)", () => { - it("resolver source ships only `gbrain put` instructions, not the renamed `put_page`", () => { +describe("scripts/resolvers/gbrain.ts — no `gbrain put_page` CLI subcommand in emitted instructions (regression for #1346)", () => { + it("resolver source ships only `gbrain put` CLI instructions, not the renamed `gbrain put_page`", () => { + // We're guarding against the v0.18 CLI subcommand rename + // (`gbrain put_page ` → `gbrain put `). The MCP op + // `mcp__gbrain__put_page` is a legitimately separate identifier (the + // MCP-layer write op, unrelated to the CLI rename) and may still + // appear in resolver output as a fallback reference for the + // calibration-take write-back path. So check the CLI subcommand + // shape specifically: `gbrain put_page` with a space. const src = readFileSync(RESOLVER_PATH, "utf-8"); const stripped = stripComments(src); - expect(stripped).not.toContain("put_page"); + expect(stripped).not.toContain("gbrain put_page"); }); it("every tracked SKILL.md file is free of the renamed gbrain put_page subcommand", () => {