From 1cb2c1f0c9a429c2ad500c375393042725e0bc3d Mon Sep 17 00:00:00 2001 From: Raghu Betina Date: Mon, 28 Sep 2026 11:28:34 -0500 Subject: [PATCH] Follow candidate pins in the CLI wrapper fixture A newer Drawing Board CLI pin makes unrelated wrapper checks fail because the fake executable still reports 0.7.0. Read the candidate pin for its default output and expected mismatch error, retaining the explicit 9.9.9 mismatch case. --- drawing-board/script/check-firstdraft-wrapper.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drawing-board/script/check-firstdraft-wrapper.mjs b/drawing-board/script/check-firstdraft-wrapper.mjs index 3ca3187..6be7383 100644 --- a/drawing-board/script/check-firstdraft-wrapper.mjs +++ b/drawing-board/script/check-firstdraft-wrapper.mjs @@ -3,6 +3,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; import {createRequire} from "node:module"; +import {parseEnv} from "node:util"; const require = createRequire(import.meta.url); const repositoryRoot = path.resolve(process.env.DRAWING_BOARD_PATH ?? process.cwd()); @@ -22,6 +23,9 @@ try { path.join(repositoryRoot, ".devcontainer", "agent-versions.env"), path.join(devcontainerDirectory, "agent-versions.env"), ); + const cliVersion = parseEnv(fs.readFileSync( + path.join(devcontainerDirectory, "agent-versions.env"), "utf8", + )).FIRSTDRAFT_CLI_VERSION; fs.writeFileSync(fakeCli, `#!/usr/bin/env node const fs = require("node:fs"); const arguments_ = process.argv.slice(2); @@ -42,7 +46,7 @@ const probe = { if (arguments_.length === 1 && arguments_[0] === "--version") { fs.writeFileSync(process.env.FIRSTDRAFT_TEST_VERSION_OUTPUT, JSON.stringify(probe)); process.stdout.write("firstdraft " + - (process.env.FIRSTDRAFT_TEST_CLI_VERSION ?? "0.7.0") + "\\n"); + (process.env.FIRSTDRAFT_TEST_CLI_VERSION ?? ${JSON.stringify(cliVersion)}) + "\\n"); if (process.env.FIRSTDRAFT_TEST_CLI_NOTICE) { process.stderr.write("A benign version notice.\\n"); } @@ -213,7 +217,7 @@ fs.writeFileSync(process.env.FIRSTDRAFT_TEST_OUTPUT, JSON.stringify(probe)); root: testRepository, stdio: "ignore", }), - /standalone First Draft CLI must be exactly 0\.7\.0/, + {message: `the standalone First Draft CLI must be exactly ${cliVersion}.`}, ); } finally { fs.rmSync(temporaryRoot, {force: true, recursive: true});