From da1f44ee9e186a9ef3ea49bfa6f779ab81c110be Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Tue, 3 Nov 2026 06:50:22 +0300 Subject: [PATCH] chore: drop OpenSpec CLI version pin and strict validation (WealthLedger/specs#67) --- openspec/.cli-version | 1 - scripts/check-openspec.cjs | 39 -------------------------------------- 2 files changed, 40 deletions(-) delete mode 100644 openspec/.cli-version delete mode 100644 scripts/check-openspec.cjs diff --git a/openspec/.cli-version b/openspec/.cli-version deleted file mode 100644 index b50dd27..0000000 --- a/openspec/.cli-version +++ /dev/null @@ -1 +0,0 @@ -1.13.1 diff --git a/scripts/check-openspec.cjs b/scripts/check-openspec.cjs deleted file mode 100644 index 0a92e8a..0000000 --- a/scripts/check-openspec.cjs +++ /dev/null @@ -1,39 +0,0 @@ -const assert = require("node:assert/strict"); -const { execFileSync } = require("node:child_process"); -const { readFileSync } = require("node:fs"); -const path = require("node:path"); - -// OpenSpec CLI is installed globally (no npm pin: its transitive braces advisory has no 3.x fix). -// This check fails fast with an actionable message instead of silently using another version. -const root = path.resolve(__dirname, ".."); -const expectedCli = readFileSync(path.join(root, "openspec/.cli-version"), "utf8").trim(); -const expectedNode = readFileSync(path.join(root, ".nvmrc"), "utf8").trim(); -const store = "wealth-ledger-specs"; - -const run = (command, args) => - execFileSync(command, args, { cwd: root, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim(); - -assert.equal( - process.version.replace(/^v/, ""), expectedNode, - `Node ${process.version} differs from .nvmrc ${expectedNode}. Run: nvm use --silent`, -); - -let cliVersion; -try { - cliVersion = run("openspec", ["--version"]); -} catch { - assert.fail(`openspec CLI not found. Install it globally: npm install -g @fission-ai/openspec@${expectedCli}`); -} -assert.equal( - cliVersion, expectedCli, - `openspec ${cliVersion} differs from openspec/.cli-version ${expectedCli}. Reinstall: npm install -g @fission-ai/openspec@${expectedCli}`, -); - -// Store presence is checked by the CLI itself: an unknown store must fail, not fall back silently. -try { - run("openspec", ["validate", "--specs", "--store", store]); -} catch (error) { - assert.fail(`openspec store '${store}' is not usable: ${error.stderr || error.stdout || error.message}`); -} - -console.log(`openspec ${cliVersion} on Node ${expectedNode}: toolchain matches`);