chore: drop OpenSpec CLI version pin and strict validation (WealthLedger/specs#67) #78
@@ -37,9 +37,9 @@ jobs:
|
|||||||
- uses: https://github.com/actions/setup-node@v4
|
- uses: https://github.com/actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: .nvmrc
|
node-version-file: .nvmrc
|
||||||
- name: Install pinned OpenSpec CLI and lychee 0.24.2
|
- name: Install OpenSpec CLI and lychee 0.24.2
|
||||||
run: |
|
run: |
|
||||||
npm install -g "@fission-ai/openspec@$(cat openspec/.cli-version)"
|
npm install -g @fission-ai/openspec
|
||||||
openspec store register .
|
openspec store register .
|
||||||
curl --fail --location --silent --show-error https://github.com/lycheeverse/lychee/releases/download/lychee-v0.24.2/lychee-x86_64-unknown-linux-gnu.tar.gz -o /tmp/lychee.tar.gz
|
curl --fail --location --silent --show-error https://github.com/lycheeverse/lychee/releases/download/lychee-v0.24.2/lychee-x86_64-unknown-linux-gnu.tar.gz -o /tmp/lychee.tar.gz
|
||||||
echo '1f4e0ef7f6554a6ed33dd7ac144fb2e1bbed98598e7af973042fc5cd43951c9a /tmp/lychee.tar.gz' | sha256sum --check
|
echo '1f4e0ef7f6554a6ed33dd7ac144fb2e1bbed98598e7af973042fc5cd43951c9a /tmp/lychee.tar.gz' | sha256sum --check
|
||||||
|
|||||||
@@ -21,20 +21,20 @@ OpenSpec применяется после явного решения Change Ow
|
|||||||
npm run validate
|
npm run validate
|
||||||
```
|
```
|
||||||
|
|
||||||
Одна команда, её же вызывает CI `verify`: `check:openspec` (Node, версия CLI,
|
Одна команда, её же вызывает CI `verify`: `openspec schema validate` (все schemas),
|
||||||
store), `openspec schema validate` (все schemas), `openspec validate --all --strict`
|
`openspec validate --all` (specs и active changes) и [lychee](https://lychee.cli.rs/) 0.24.2 `--offline
|
||||||
(specs и active changes) и [lychee](https://lychee.cli.rs/) 0.24.2 `--offline
|
|
||||||
--include-fragments` для относительных ссылок и anchors в корневых `*.md`
|
--include-fragments` для относительных ссылок и anchors в корневых `*.md`
|
||||||
(включая `AI_INDEX`) и `openspec/specs`. Архивы и внешние URL не проверяются.
|
(включая `AI_INDEX`) и `openspec/specs`. Архивы и внешние URL не проверяются.
|
||||||
В чистой среде один раз: `openspec store register .`; lychee ставится
|
В чистой среде один раз: `openspec store register .`; lychee ставится
|
||||||
отдельно (например, `brew install lychee`). Для отдельного change:
|
отдельно (например, `brew install lychee`). Для отдельного change:
|
||||||
`openspec status --change <change> --store wealth-ledger-specs`.
|
`openspec status --change <change> --store wealth-ledger-specs`.
|
||||||
|
|
||||||
OpenSpec CLI ставится глобально и не закрепляется в `package.json`: его транзитивная
|
OpenSpec CLI ставится глобально (`npm install -g @fission-ai/openspec`) и не закрепляется
|
||||||
зависимость `braces` имеет advisory без исправления в 3.x. Ожидаемая версия хранится
|
ни в `package.json` (его транзитивная зависимость `braces` имеет advisory без исправления
|
||||||
в `openspec/.cli-version`; `npm run check:openspec` проверяет Node из `.nvmrc`, версию
|
в 3.x), ни отдельным файлом версии: CI ставит актуальный выпуск. `validate` не использует
|
||||||
CLI и доступность store, и при расхождении выводит команду исправления. Structural
|
`--strict`: с 1.15 предупреждение о длинных требованиях (>500 символов) считается ошибкой
|
||||||
validation не заменяет semantic verification и independent read-only review перед archive.
|
в strict-режиме. Structural validation не заменяет semantic verification и independent
|
||||||
|
read-only review перед archive.
|
||||||
|
|
||||||
Node задаётся собственной `.nvmrc`; после `nvm use --silent` выполните `npm ci`.
|
Node задаётся собственной `.nvmrc`; после `nvm use --silent` выполните `npm ci`.
|
||||||
`npm run verify` локально проверяет whitespace в незакоммиченном diff; CI `verify`
|
`npm run verify` локально проверяет whitespace в незакоммиченном diff; CI `verify`
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
1.13.1
|
|
||||||
+1
-2
@@ -7,8 +7,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"verify": "git diff --check",
|
"verify": "git diff --check",
|
||||||
"check:openspec": "node scripts/check-openspec.cjs",
|
"validate": "openspec schema validate && openspec validate --all --no-interactive --store wealth-ledger-specs && lychee --offline --include-fragments --no-progress './*.md' openspec/specs",
|
||||||
"validate": "npm run check:openspec && openspec schema validate && openspec validate --all --strict --no-interactive --store wealth-ledger-specs && lychee --offline --include-fragments --no-progress './*.md' openspec/specs",
|
|
||||||
"release:preview": "release-it --dry-run --ci",
|
"release:preview": "release-it --dry-run --ci",
|
||||||
"release:prepare": "release-it --ci",
|
"release:prepare": "release-it --ci",
|
||||||
"commitlint": "commitlint",
|
"commitlint": "commitlint",
|
||||||
|
|||||||
@@ -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`);
|
|
||||||
Reference in New Issue
Block a user