From 2019b77afbc7e62b7cf70d6dbb9521c77b2d049c Mon Sep 17 00:00:00 2001 From: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com> Date: Thu, 29 Oct 2026 16:15:35 +0800 Subject: [PATCH] chore(release): prepare CLI 0.3.0 and DSH 0.6.0 Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com> --- .github/workflows/check-dsh-plugin.yml | 40 ++++++++++++++++ .github/workflows/release-cli.yml | 1 + cli/CHANGELOG.md | 23 +++++++++ cli/README.md | 10 ++-- cli/package.json | 2 +- cli/src/generated/pkg-info.ts | 2 +- cli/test/fixtures/toggle-crash-child.ts | 11 +++-- .../unit/integrations/native-toggle.test.ts | 48 ++++++++++++++++--- .../add-dsh-native-plugin/release-guide.md | 23 ++++++--- .../add-dsh-native-plugin/release-notes.md | 14 +++++- .../changes/add-dsh-native-plugin/tasks.md | 9 ++++ plugins/dsh/README.en.md | 16 ++++--- plugins/dsh/README.md | 16 ++++--- plugins/dsh/package.json | 2 +- plugins/dsh/scripts/smoke-native-host.mjs | 17 +++++-- plugins/dsh/test/smoke-native-host.test.ts | 10 +++- 16 files changed, 200 insertions(+), 44 deletions(-) diff --git a/.github/workflows/check-dsh-plugin.yml b/.github/workflows/check-dsh-plugin.yml index 6c90778d9..0dd4de254 100644 --- a/.github/workflows/check-dsh-plugin.yml +++ b/.github/workflows/check-dsh-plugin.yml @@ -147,3 +147,43 @@ jobs: path: plugins/dsh/host-release-summary.json if-no-files-found: warn retention-days: 7 + + activation: + name: Installed skill activation (${{ matrix.os }}, DSH ${{ matrix.dsh }}) + needs: check + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + dsh: ['0.2.0-rc.2', '0.2.1-rc.2'] + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24.2.0' + - uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.3.13' + - name: Install local Registry fixture dependencies + working-directory: cli + run: bun install --frozen-lockfile + - uses: actions/download-artifact@v4 + with: + name: skillhub-dsh-development-package-${{ matrix.os }}-node-24.2.0 + path: plugins/dsh/artifacts + - name: Verify installed skill activation in a fresh isolated Profile + working-directory: plugins/dsh + run: node scripts/smoke-native-host.mjs --artifact artifacts --report host-toggle-summary.json --scenario skill-toggle --dsh-version '${{ matrix.dsh }}' + - name: Verify watch-off activation in a fresh isolated Profile + working-directory: plugins/dsh + run: node scripts/smoke-native-host.mjs --artifact artifacts --report host-toggle-watch-off-summary.json --scenario skill-toggle-watch-off --dsh-version '${{ matrix.dsh }}' + - name: Upload sanitized activation summaries + if: always() + uses: actions/upload-artifact@v4 + with: + name: skillhub-dsh-activation-${{ matrix.os }}-${{ matrix.dsh }} + path: plugins/dsh/host-toggle*-summary.json + if-no-files-found: warn + retention-days: 7 diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index c54b7e6fb..129829624 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -297,6 +297,7 @@ jobs: EOF gh release create "$TAG" \ + --latest=false \ --title "CLI ${VERSION}" \ --notes-file release-notes.md \ "skillhub-cli-${VERSION}.tar.gz" \ diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 5622c3832..8b889c195 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -2,6 +2,29 @@ All notable CLI behavior changes are documented in this file. +## 0.3.0 (release candidate) + +### Changed + +- Read inventory v1/v2 without migrating it; the first successful mutation writes v3 with + per-location `installationState`, preserving an immutable, byte-verified backup of the old + inventory. Existing targets remain enabled unless explicitly disabled through DSH. +- Preserve disabled installations across namespace synchronization and doctor reconciliation. + CLI upgrade refuses disabled targets, including with `--force`; Suite operations cannot adopt + disabled positions. This release does not add CLI enable/disable commands. +- Supply the compatible local installation core for DSH `0.6.0`, including entry-only + enable/disable and recovery. The DSH plugin bundles this core and does not invoke CLI commands. + +### Upgrade and rollback + +- For users sharing inventory between CLI and DSH, stop old writers, finish pending recovery, + upgrade CLI to `0.3.0`, and then upgrade DSH to `0.6.0`. Plugin-only users need no separate CLI. +- CLI `0.2.0` does not support v3. Old clients rejecting v3 are not a usable rollback and do not + make mixed-version writers safe. Do not restore only `inventory.json`: reconcile entry names, + skill files, metadata and operation journals before considering a downgrade. +- Candidate versions are not a publication claim. Final package integrity, clean installation + and migration acceptance must be recorded separately for the published packages. + ## 0.2.0 ### Added diff --git a/cli/README.md b/cli/README.md index 66da5873a..0caf3428a 100644 --- a/cli/README.md +++ b/cli/README.md @@ -621,7 +621,7 @@ subject to the server's package validation. ### Installation inventory compatibility -The local installation inventory uses schema version 3 in the unreleased enable/disable increment. Each installation directory owns its +The `0.3.0` release candidate uses installation inventory schema version 3. Each installation directory owns its version, fingerprint, timestamp and ownership, so a user installation and a project installation of the same skill can remain on different versions. `list --json` reports the actual version for each target. `upgrade --check --json` and upgrade results contain one row per selected installation @@ -637,9 +637,11 @@ writes v3 (`schemaVersion`, `records`, `suites`). Each target records `installat (`enabled` or `disabled`); legacy targets project to enabled without inventing missing integrity. Stop incompatible CLI writers and let DSH finish pending recovery before migration. Published -CLI `0.2.0` and `0.1.12` must not share writes with v3. Protocol rejection is not a complete -cross-process guard: historical commands have different read paths. Release the compatible CLI -before exposing this plugin increment. Restoring old inventory alone is not a safe downgrade; +CLI `0.2.0` and `0.1.12` do not support v3 and must not share writes with it. An old package +rejecting v3 is not a usable rollback. Protocol rejection is not a complete +cross-process guard: historical commands have different read paths. The planned release order is CLI `0.3.0` followed by DSH `0.6.0`; verify that the exact +versions are publicly available before installing them. Users sharing inventory must upgrade +all CLI writers first. DSH bundles its core: plugin-only users do not need a separate CLI. Restoring old inventory alone is not a safe downgrade; verify entry names, package bytes, metadata and operation logs together. This CLI does not add enable/disable commands. Use DSH for explicit toggles and disabled updates; diff --git a/cli/package.json b/cli/package.json index 990587273..3f60629e6 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@astron-team/skillhub", - "version": "0.2.0", + "version": "0.3.0", "description": "Manage and install skills for AI coding agents", "keywords": [ "skillhub", diff --git a/cli/src/generated/pkg-info.ts b/cli/src/generated/pkg-info.ts index 4391833da..f871a8442 100644 --- a/cli/src/generated/pkg-info.ts +++ b/cli/src/generated/pkg-info.ts @@ -1,3 +1,3 @@ // Generated by scripts/generate-pkg-info.ts - do not edit by hand. export const PKG_NAME = "@astron-team/skillhub" -export const PKG_VERSION = "0.2.0" +export const PKG_VERSION = "0.3.0" diff --git a/cli/test/fixtures/toggle-crash-child.ts b/cli/test/fixtures/toggle-crash-child.ts index 38576fdb7..a618f4805 100644 --- a/cli/test/fixtures/toggle-crash-child.ts +++ b/cli/test/fixtures/toggle-crash-child.ts @@ -1,10 +1,11 @@ +import { writeFile } from 'node:fs/promises' import { join } from 'node:path' import { InventoryStore } from '../../src/stores/inventory-store' import { OperationStore } from '../../src/integrations/operation-store' import { inspectToggle, executeNativeToggle } from '../../src/integrations/native-toggle' -const [home, operationId, boundary] = process.argv.slice(2) -if (!home || !operationId || !['intent', 'linked', 'moved', 'restore-linked', 'committed'].includes(boundary!)) throw new Error('Invalid fixture arguments') +const [home, operationId, boundary, readyFile] = process.argv.slice(2) +if (!home || !operationId || !readyFile || !['intent', 'linked', 'moved', 'restore-linked', 'committed'].includes(boundary!)) throw new Error('Invalid fixture arguments') const inventory = new InventoryStore(home) const operations = await OperationStore.open(join(home, 'operations')) const baseline = await inspectToggle(inventory, { registry: 'https://registry.example', namespace: 'demo', slug: 'writer', version: '1.0.0' }, @@ -13,7 +14,11 @@ if (baseline.status !== 'ready') throw new Error('Fixture baseline unavailable') const append = operations.recordToggle.bind(operations) operations.recordToggle = async (...args) => { const saved = await append(...args) - if (args[3].stage === boundary) process.kill(process.pid, 'SIGKILL') + if (args[3].stage === boundary) { + await writeFile(readyFile!, boundary, { flag: 'wx' }) + // The parent force-terminates this owned process using the native platform API. + await new Promise(() => { setInterval(() => {}, 1000) }) + } return saved } if (boundary === 'restore-linked') inventory.mutateAtomic = async () => { throw new Error('Injected CAS rejection') } diff --git a/cli/test/unit/integrations/native-toggle.test.ts b/cli/test/unit/integrations/native-toggle.test.ts index e1e6b2e6d..4d244388f 100644 --- a/cli/test/unit/integrations/native-toggle.test.ts +++ b/cli/test/unit/integrations/native-toggle.test.ts @@ -1,6 +1,7 @@ import { expect, test } from 'bun:test' import { randomUUID } from 'node:crypto' import { cp, mkdtemp, mkdir, readFile, realpath, rm, writeFile } from 'node:fs/promises' +import { fileURLToPath } from 'node:url' import { tmpdir } from 'node:os' import { join } from 'node:path' import { InventoryStore } from '../../../src/stores/inventory-store' @@ -135,7 +136,7 @@ test.each([false, true])('restart recovers a renamed entry without overwriting a } finally { await rm(f.home, { recursive: true, force: true }) } }) -test.skipIf(process.platform === 'win32')('killed toggle writers recover intent, renamed and committed boundaries', async () => { +test('killed toggle writers recover intent, renamed and committed boundaries', async () => { const fixtures = await Promise.all(['intent', 'linked', 'moved', 'restore-linked', 'committed'].map(async boundary => { const f = await fixture() const accepted = await f.runtime.acceptToggle({ hostInstanceId: f.runtime.hostInstanceId, ownerId: 'owner', mode: 'new', requestKey: randomUUID(), parameters: { boundary } }, async () => ({ @@ -145,12 +146,47 @@ test.skipIf(process.platform === 'win32')('killed toggle writers recover intent, return { ...f, boundary, operationId: accepted!.operationId } })) try { - await Promise.all(fixtures.map(async f => { - const child = Bun.spawn([process.execPath, new URL('../../fixtures/toggle-crash-child.ts', import.meta.url).pathname, f.home, f.operationId, f.boundary], + const crashes = await Promise.allSettled(fixtures.map(async f => { + const readyFile = join(f.home, 'crash-ready') + const child = Bun.spawn([process.execPath, fileURLToPath(new URL('../../fixtures/toggle-crash-child.ts', import.meta.url)), f.home, f.operationId, f.boundary, readyFile], { stdout: 'pipe', stderr: 'pipe' }) - expect(await child.exited).not.toBe(0) - expect(await new Response(child.stderr).text()).toBe('') + const waitForExit = async (exited: Promise) => { + let timer: ReturnType | undefined + try { + return await Promise.race([exited, new Promise((_, reject) => { + timer = setTimeout(() => reject(new Error('Owned crash process did not exit within 10 seconds')), 10000) + })]) + } finally { clearTimeout(timer) } + } + const terminate = async () => { + if (child.exitCode !== null) return + if (process.platform === 'win32') { + const killer = Bun.spawn(['taskkill.exe', '/PID', String(child.pid), '/T', '/F'], { stdout: 'ignore', stderr: 'pipe' }) + try { expect(await waitForExit(killer.exited)).toBe(0) } finally { if (killer.exitCode === null) killer.kill() } + } else child.kill('SIGKILL') + } + try { + const deadline = Date.now() + 20000 + let ready = false + while (Date.now() < deadline && child.exitCode === null) { + try { ready = (await readFile(readyFile, 'utf8')) === f.boundary } catch (error) { + if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error + } + if (ready) break + await Bun.sleep(25) + } + expect(ready).toBe(true) + await terminate() + expect(await waitForExit(child.exited)).not.toBe(0) + expect(await new Response(child.stderr).text()).toBe('') + } finally { + // Cleanup uses only this child handle even if taskkill failed; it is not a passing crash assertion. + if (child.exitCode === null) child.kill() + await waitForExit(child.exited) + } })) + const failures = crashes.filter((result): result is PromiseRejectedResult => result.status === 'rejected') + if (failures.length) throw new AggregateError(failures.map(result => result.reason), 'Crash fixtures failed after all owned children settled') // Reverse-link recovery holds the inventory lease; its stale timeout is 30 seconds. await Bun.sleep(31_500) for (const f of fixtures) { @@ -162,7 +198,7 @@ test.skipIf(process.platform === 'win32')('killed toggle writers recover intent, expect(await readFile(join(f.path, state === 'disabled' ? 'SKILL.md.disabled' : 'SKILL.md'), 'utf8')).toBe('# Original\n') } } finally { await Promise.all(fixtures.map(f => rm(f.home, { recursive: true, force: true }))) } -}, 60_000) +}, 90_000) test.each(['forward', 'rollback'] as const)('exclusive entry creation preserves a competitor appearing after preflight: %s', async direction => { const f = await fixture() diff --git a/openspec/changes/add-dsh-native-plugin/release-guide.md b/openspec/changes/add-dsh-native-plugin/release-guide.md index eca6cde82..58dff9ad9 100644 --- a/openspec/changes/add-dsh-native-plugin/release-guide.md +++ b/openspec/changes/add-dsh-native-plugin/release-guide.md @@ -10,11 +10,20 @@ 插件运行在 DSH 主机,不部署进 SkillHub 网站,也不要求网站嵌入插件 UI。插件内部 Remote 接口随插件版本交付;Registry API 随服务端交付。两者分别管理版本和发布节奏。 -### 1.1 当前插件发布 +### 1.1 当前候选与发布顺序 -本轮仅发布 DSH 插件 `0.5.0`,提供只读技能可用性诊断。CLI 保持已发布的 `0.2.0`,无需再次发布;库存格式与兼容范围不变。发布标签为 `dsh-v0.5.0`,通过专用工作流上传经过检查的 tarball;发布后从 npm 重新下载安装验证。 +本轮候选为 CLI `0.3.0`(`cli-v0.3.0`)和 DSH 插件 `0.6.0`(`dsh-v0.6.0`)。交付范围仅包含 main 已合并的技能启停与库存 v3([#1025](https://github.com/iflytek/skillhub/pull/1025))、统一只读检查更新([#1030](https://github.com/iflytek/skillhub/pull/1030))、紧凑已安装卡片及真实本地摘要([#1032](https://github.com/iflytek/skillhub/pull/1032))。不发布服务端镜像、不部署 SaaS,也不把路线图中的场景助手或技能清单复用加入本轮。 -### 1.2 0.4.0 库存升级说明 +1. 在隔离目录用旧公开 CLI `0.2.0` 与插件 `0.5.0` 建立升级基线,保留候选与旧包的校验值。读取旧库存 v1/v2 不得迁移,首次成功写入 v3 前必须核对原始字节备份;不能只构造旧 JSON 代替真实旧包升级验收。 +2. 完成候选 CLI/插件检查、跨平台启停及恢复、双 RC Host、真实浏览器与草稿保护验收;未验证项明确留在验证记录,历史 CI 或浏览器通过不能替代本次候选。 +3. 获准后先经专用 CLI 工作流发布 `@astron-team/skillhub@0.3.0`,核对公开包完整性、干净安装、旧库存读取及首次 v3 写入,并验证 disabled 安装保护。 +4. 再经专用插件工作流发布 `@astron-team/skillhub-dsh@0.6.0`,核对公开包与已验候选字节一致,验证干净 Profile 安装和既有安装升级。两包当前均为候选,不能将准备完成写成已发布。 + +插件仍内置本地核心,不调用外部 CLI。仅使用插件的用户无需安装 CLI;共享库存的用户须先停止旧 CLI 写入并完成恢复,再升级全部 CLI,最后升级 DSH。旧 CLI `0.2.0` 不支持 v3;旧包拒绝 v3 只表示不兼容,不构成可用回滚或完整混写防护。 + +v3 增加每位置 `installationState`。读取 v1/v2 不写盘迁移,首次成功写入前保留原库存字节及摘要寻址备份。备份不包含之后改变的入口名、技能文件、安装元数据和操作日志。回退须停止所有写入、核对以上状态并使用真正兼容的包;不得只还原库存、删除日志或把 `SKILL.md.disabled` 随意改名来绕过恢复检查。 + +### 1.2 历史:0.4.0 库存升级说明 此前库存升级交付 CLI `0.2.0` 和 DSH 插件 `0.4.0`,不发布服务端镜像、不部署 SaaS。插件内置安装核心,不要求另装 CLI;但同一用户使用 CLI 共同管理技能时,两者必须使用兼容库存格式。 @@ -80,6 +89,8 @@ npm pack --ignore-scripts --pack-destination /absolute/path/to/candidate-output `check-dsh-plugin.yml` 使用 Linux、macOS、Windows 三平台矩阵,Node 24.2.0 与当前 Node 24 双版本、Bun 1.3.13,分别运行共享 CLI 检查、插件 `bun run check` 和隔离 Web Profile 的 Host 安装冒烟,并保存带平台名的 tarball 与脱敏摘要。新 RC `0.2.1-rc.2` 另有 Linux 双 Node 原生 Host 检查,复用对应 Node 档的原矩阵产物;不将此结果扩大为新 RC 的 Windows/macOS 原生文件操作验收。步骤显式使用 Bash,避免 Windows 默认 shell 对脚本的不同解释;平台失败不取消其他平台任务。矩阵通过只证明该次构建与自动化测试结果,真实 DSH Profile 安装、页面和对话验收仍须单独完成。平台测试中的跳过项必须记录,不能算作通过。 +新增独立安装启停验收矩阵:Linux/macOS/Windows × DSH `0.2.0-rc.2`/`0.2.1-rc.2`,固定 Node `24.2.0`,复用对应平台检查过的候选 tarball。`--scenario skill-toggle` 与 `--scenario skill-toggle-watch-off` 分别创建全新隔离 Host/Profile,不能复用可用性探针遗留的安装状态。核心恢复测试在五个持久化边界终止本次测试子进程;Windows 使用原生进程终止,POSIX 使用 SIGKILL。核心进程恢复、Host 启停发现及真实浏览器交互分别记录,不将核心测试称为完整 Host 强杀重启验收。矩阵配置不等于本次已通过,结果见最终发布验证记录。 + ### 2.2 插件包检查 - Host、Client、patch、Remote 元数据、声明及许可证包含在包中,exports 指向有效文件。 @@ -90,7 +101,7 @@ npm pack --ignore-scripts --pack-destination /absolute/path/to/candidate-output ### 2.3 隔离环境验证 -本次 `0.5.0` 候选分别验证 DSH `0.2.0-rc.2` 与 `0.2.1-rc.2`,Node `>=24.2.0 <25`。Host、app-boot、核心模块及注入 Client 模块须为同一精确发行版。新 RC 仅使用 `4.0.5 / 1.0.6 / 1.0.10 / 1.1.7`;旧 RC 的 Cordis、Loader、Include、Timer 须为已验证的完整组合:`4.0.4 / 1.0.5 / 1.0.9 / 1.1.6` 或 `4.0.5 / 1.0.6 / 1.0.10 / 1.1.7`,不得交叉混装;以实际 Host 解析结果为准。已发布 `0.1.0` 尚不包含后一组合支持及历史回执修复,`0.1.1` 起包含这些修复,`0.2.0` 延续此兼容基线;发布前使用本次 tarball 验证。在独立测试账户或容器中准备 Web Profile、工作区和测试技能,连接测试 Registry。仅隔离 Profile/DSH home 不足以隔离共享 inventory。 +本次 `0.6.0` 候选分别验证 DSH `0.2.0-rc.2` 与 `0.2.1-rc.2`,Node `>=24.2.0 <25`。Host、app-boot、核心模块及注入 Client 模块须为同一精确发行版。新 RC 仅使用 `4.0.5 / 1.0.6 / 1.0.10 / 1.1.7`;旧 RC 的 Cordis、Loader、Include、Timer 须为已验证的完整组合:`4.0.4 / 1.0.5 / 1.0.9 / 1.1.6` 或 `4.0.5 / 1.0.6 / 1.0.10 / 1.1.7`,不得交叉混装;以实际 Host 解析结果为准。已发布 `0.1.0` 尚不包含后一组合支持及历史回执修复,`0.1.1` 起包含这些修复,`0.2.0` 延续此兼容基线;发布前使用本次 tarball 验证。在独立测试账户或容器中准备 Web Profile、工作区和测试技能,连接测试 Registry。仅隔离 Profile/DSH home 不足以隔离共享 inventory。 首次创建测试 Web Profile,然后安装本地候选包: @@ -175,7 +186,7 @@ SaaS 使用其现有流水线部署;公共接口契约、测试数据规则与 ### 4.1 独立发布流程 -插件使用独立版本,tag 前缀固定为 `dsh-v`(本次为 `dsh-v0.5.0`),不复用 CLI 的 `cli-v*` 发布流程。专用工作流为 `.github/workflows/release-dsh-plugin.yml`;发布前仍须确认 npm 包名、兼容基线及候选包验收,本次候选为 `0.5.0`,manifest 已显式设为 `private: false`;缺省 Registry 为 `https://skill.xfyun.cn`,显式空串/空白仍断开,已有自定义来源保留。发布前分别验证缺省、断开和自定义配置,以及正式域名的固定版本安装、状态识别和本地管理。正式发布仍以最终提交、候选验收和审批结果为准。 +插件使用独立版本,tag 前缀固定为 `dsh-v`(本次为 `dsh-v0.6.0`),不复用 CLI 的 `cli-v*` 发布流程。专用工作流为 `.github/workflows/release-dsh-plugin.yml`;发布前仍须确认 npm 包名、兼容基线及候选包验收,本次候选为 `0.6.0`,manifest 已显式设为 `private: false`;缺省 Registry 为 `https://skill.xfyun.cn`,显式空串/空白仍断开,已有自定义来源保留。发布前分别验证缺省、断开和自定义配置,以及正式域名的固定版本安装、状态识别和本地管理。正式发布仍以最终提交、候选验收和审批结果为准。 发布流程依次完成:校验版本 → 测试与构建 → 生成并检查 tarball → 隔离 DSH 候选验收 → 发布审批 → 发布 npm → 校验已发布包。当前工作流自动执行版本校验、测试与构建、包检查、上传及完整性校验;隔离 DSH 的 UI、真实模型和平台验收按本次确认范围另行执行,未验项目须单独注明;CI 矩阵成功不等同于这些验收通过。工作流使用仓库的 `NPM_TOKEN` 发布凭证,源码及 npm 包不包含凭证;配置了环境保护规则时还须完成对应审批。 @@ -198,7 +209,7 @@ SaaS 使用其现有流水线部署;公共接口契约、测试数据规则与 ### 4.3 发布说明 -`0.5.0` 的变更说明见 [release-notes.md](release-notes.md)。正式版本发布前按最终候选及验收结果更新,不沿用开发版本的支持声明。 +`0.6.0` 的变更说明见 [release-notes.md](release-notes.md)。正式版本发布前按最终候选及验收结果更新,不沿用开发版本的支持声明。 每个版本包含: diff --git a/openspec/changes/add-dsh-native-plugin/release-notes.md b/openspec/changes/add-dsh-native-plugin/release-notes.md index e536cfcd0..46d75df3e 100644 --- a/openspec/changes/add-dsh-native-plugin/release-notes.md +++ b/openspec/changes/add-dsh-native-plugin/release-notes.md @@ -1,6 +1,16 @@ # SkillHub DSH 原生插件发布说明 +## 0.6.0 候选:启停、检查更新与紧凑卡片 + +- **受管理技能启停**:[#1025](https://github.com/iflytek/skillhub/pull/1025) 按确认的位置将 `SKILL.md` 转换为 `SKILL.md.disabled`,启用恢复入口,保留目录和资源。更新停用安装后仍保持停用;文件修改、共享归属、目标被占用及不可信记录仍阻止写操作。停用不撤回已加载会话内容,也不停止任务。 +- **统一检查、逐项更新**:[#1030](https://github.com/iflytek/skillhub/pull/1030) 主动只读检查当前来源库存,渐进显示结果和失败重试。一次可信快照、有界并发、同来源技能共用远端 resolve;取消及上下文变化不接纳迟到结果。真正更新仍进入详情按位置确认,不提供批量自动覆盖。 +- **日常围绕使用技能**:[#1032](https://github.com/iflytek/skillhub/pull/1032) 已安装页采用桌面两列、窄屏一列的紧凑横向卡片,显示真实本地名称、一行摘要和实际安装版本;至多两个语义标签。整卡进入详情,保留使用技能主按钮,管理安装/检查更新收进更多菜单。单卡检查不清除其他卡结果,使用和菜单不误触详情。 +- **库存与配套 CLI**:首次成功写入库存 v3,读取 v1/v2 不迁移,旧库存保留字节核对备份。共享库存的 CLI 配套候选为 `0.3.0`,计划先发布 CLI 再发布 DSH;插件内置核心、不会调用 CLI,只有插件的用户无需另装 CLI。CLI `0.2.0` 不支持 v3;旧包拒绝 v3 不是可用回滚,不能只恢复库存而忽略入口、文件、元数据和操作日志。 +- **交付边界**:保留现有双 RC、Node/Cordis 与来源边界;详情官网链接仅使用 API 的安全 `webUrl`,缺失即隐藏。该增量不包含 SaaS 部署、场景助手或技能清单导入导出。 + +上述是已合并源码的候选范围,不声明 `0.6.0`/CLI `0.3.0` 已发布,也不把历史功能验收等同本轮最终候选、跨平台恢复或公开包验收。发布顺序和限制见 [发布指南](release-guide.md),结果由 [验证记录](verification.md) 单独维护。 + ## 0.5.0 技能可用性诊断 - 技能卡片“更多 → 检查可用性”与对话工具 `astron_skillhub_check_availability` 提供只读诊断,区分文件完整性、同名覆盖、宿主未知及用户/模型调用策略([#1023](https://github.com/iflytek/skillhub/pull/1023))。 @@ -10,7 +20,7 @@ ## 版本与交付状态 -当前准备版本为 `0.5.0`;上一公开版本为 `0.4.0`。发布状态以对应 npm 版本和发布工作流为准。 +当前准备版本为 DSH `0.6.0` 和配套 CLI `0.3.0`,尚不据此声明已公开发布。历史版本说明保留;实际公开状态以对应 npm 版本和专用发布工作流为准。 `@astron-team/skillhub-dsh@0.3.1` 已发布,独立标签为 `dsh-v0.3.1`。[发布准备 PR #995](https://github.com/iflytek/skillhub/pull/995) 已合并,[专用发布工作流](https://github.com/iflytek/skillhub/actions/runs/39556075587) 成功;[公开 npm 包](https://www.npmjs.com/package/@astron-team/skillhub-dsh/v/0.3.1) 与工作流产物逐字节一致,发布时 `latest` 指向 `0.3.1`。两版 Linux 的严格安装、原生探针及浏览器操作复验通过,测试工件与公开包字节一致,结果见 [验证摘要](verification.md)。历史已发布版本保持不变。 @@ -100,7 +110,7 @@ Node 保持 `>=24.2.0 <25`。精确兼容与验证边界见 [兼容设计](compa ## 安装、更新与维护 -可通过 `dsh plugin --profile skillhub-test add @astron-team/skillhub-dsh@0.3.1 --ignore-scripts` 安装到已有 Web Profile。发布前从源码执行 `bun run check` 后生成 `.tgz`,使用固定版本 DSH 的 `plugin ... add` 安装。具体准备、命令、配置和测试流程见 [中文指南](../../../plugins/dsh/README.md)、[英文指南](../../../plugins/dsh/README.en.md) 及 [发布指南](release-guide.md)。 +`0.6.0` 公开可用后,可通过 `dsh plugin --profile skillhub-test add @astron-team/skillhub-dsh@0.6.0 --ignore-scripts` 安装到已有 Web Profile;发布前使用本地候选 tarball。发布前从源码执行 `bun run check` 后生成 `.tgz`,使用固定版本 DSH 的 `plugin ... add` 安装。具体准备、命令、配置和测试流程见 [中文指南](../../../plugins/dsh/README.md)、[英文指南](../../../plugins/dsh/README.en.md) 及 [发布指南](release-guide.md)。 更新或回退前保留原包和校验值、停止新操作并处理待恢复事务,然后停止 Host、安装兼容包并重新启动。浏览器旧资源可强制刷新;这不能代替 Host 依赖重载。禁用或移除包不会卸载技能,不应删除技能目录、inventory 或操作日志。 diff --git a/openspec/changes/add-dsh-native-plugin/tasks.md b/openspec/changes/add-dsh-native-plugin/tasks.md index c72a5cd3b..ecf0c5e45 100644 --- a/openspec/changes/add-dsh-native-plugin/tasks.md +++ b/openspec/changes/add-dsh-native-plugin/tasks.md @@ -406,3 +406,12 @@ - [x] 46.5 优化统一检查的全量库存重复读取与同技能resolve重复请求,保留精确目标与上下文保护。 - [x] 46.6 完成10/100/500位置规模测量、独立复审和真实DSH新协议回归。 + + +## 47. CLI 0.3.0 / DSH 0.6.0 配套发布收尾 + +- [x] 47.1 准备版本与发布说明,明确库存 v3、旧消费者拒绝、不安全降级边界及先 CLI 后 DSH 的顺序。 +- [ ] 47.2 在原生 Windows/macOS 补技能入口转换、五阶段核心进程强制终止恢复及两版 Host 独立启停场景;明确核心恢复不等于 Host 强杀恢复。 +- [ ] 47.3 补旧对话草稿往返保护的真实浏览器证据,核对候选完整性、旧公开包升级和旧包遇 v3 的拒写保护。 +- [ ] 47.4 完成发布准备 PR、独立评审与 CI,先发布 CLI 0.3.0 并验证,再发布 DSH 0.6.0;核对公开字节、安装与保留原技能。 +- [ ] 47.5 同步路线图 #998 的已完成、暂缓及后续范围,记录最终发布结果与证据边界。 diff --git a/plugins/dsh/README.en.md b/plugins/dsh/README.en.md index e0c7a320c..3b7e134be 100644 --- a/plugins/dsh/README.en.md +++ b/plugins/dsh/README.en.md @@ -12,11 +12,13 @@ Version `0.4.0` uses the independent `dsh-v0.4.0` tag. It adds versioned example `0.5.0` adds read-only skill availability diagnosis in installed cards and conversations, with separate integrity, discovery and invocation-policy results. It retains the compatibility and inventory format of `0.4.0`. +`0.6.0` is the current release candidate. It includes managed enable/disable, unified read-only update checks, and compact horizontal installed cards with a More menu. The first mutation uses inventory v3. CLI `0.3.0` is the companion candidate for shared inventory; the planned release order is CLI first, then DSH. Candidate versions do not imply public availability or completed final-package/platform acceptance. + ## Use an installed skill Market, installed and everyday conversation lists show one card per skill. “使用技能” asks the Host to verify the unique installation actually usable in the current session. Catalog use creates a conversation in the same workspace; conversation use keeps the current session. Choose an example or custom task to insert an editable draft. This never sends a message, invokes a model or overwrites the original draft. -“管理安装” opens skill details, where the inline installation panel shows each location’s version, state and explicit use/update/enable/disable/removal actions. Disabled or unverified skills lead to management. Installation scope remains in advanced confirmation options, with the current-user default unchanged. +In the installed card’s More menu, “管理安装” opens skill details, where the inline installation panel shows each location’s version, state and explicit use/update/enable/disable/removal actions. Disabled or unverified skills lead to management. Installation scope remains in advanced confirmation options, with the current-user default unchanged. An active session is required. Shadowed skills, modified files, disabled user invocation or changed context are reported without modifying the draft. Historical receipts are not proof of current installation. This feature is available from `0.4.0`. @@ -76,8 +78,8 @@ Published `0.1.0` still requires the original Cordis `4.0.4` baseline and does n Query the exact npm version first and install only after confirming availability. Check DSH, Node and a complete Cordis combination listed above, stop the target Web Profile Host, then install the plugin. A verified local tarball can also be installed using the next section: ```sh -npm view @astron-team/skillhub-dsh@0.5.0 version -dsh plugin --profile skillhub-test add @astron-team/skillhub-dsh@0.5.0 --ignore-scripts +npm view @astron-team/skillhub-dsh@0.6.0 version +dsh plugin --profile skillhub-test add @astron-team/skillhub-dsh@0.6.0 --ignore-scripts dsh --profile skillhub-test --host 127.0.0.1 --port 0 --no-open ``` @@ -85,9 +87,9 @@ Replace `skillhub-test` with the intended Web Profile; initial creation is docum ## Upgrade from an older version -`0.4.0` uses inventory schema v2 with per-location versions. The installation core remains bundled, so a separate CLI is unnecessary. If the same user also manages these skills through SkillHub CLI, upgrade every such CLI to `0.2.0` before upgrading the plugin and stop scheduled/background writes from old clients. Confirm availability with `npm view @astron-team/skillhub@0.2.0 version`, then run `npm install -g @astron-team/skillhub@0.2.0`, verify `skillhub version`, then install the exact plugin version above. +The `0.6.0` candidate uses inventory v3 with per-location activation state. Its compatible core is bundled; it does not invoke CLI commands, and plugin-only users need no CLI. If the same user shares inventory with CLI, stop old scheduled/background writers and finish pending recovery first. Confirm `npm view @astron-team/skillhub@0.3.0 version`, install `npm install -g @astron-team/skillhub@0.3.0`, verify `skillhub version`, and then upgrade the plugin. Before publication, use local candidate tarballs; do not substitute old incompatible packages when the new public version is unavailable. -Reading v1 inventory does not migrate it. Before the first v2 write, a byte-verified `inventory.v1..backup.json` is retained beside the inventory. User and project copies may retain different versions. Old CLI/v2 inventory mixed writes are unsupported. Once locations have changed independently, restoring the old inventory or downgrading the plugin alone is not a rollback: skill files, installation metadata and operation records must also be reconciled. +Reading v1/v2 inventory does not migrate it. Before the first successful v3 write, preserve the original inventory bytes and a digest-addressed backup. CLI `0.2.0` does not support v3; its rejection of v3 is neither a usable rollback nor a cross-process mixed-writer guard. Stop all writers and reconcile `SKILL.md` / `SKILL.md.disabled`, package contents, installation metadata and operation journals before considering a downgrade. Restoring inventory alone is insufficient. Authors provide examples at the fixed `.skillhub/examples.json` path inside each skill package. The file keeps its location after installation and follows the skill's version and fingerprint; no separate global example copy is created. Skills without examples use a custom task; invalid declarations remain ordinary files without exposing invalid examples. @@ -221,7 +223,7 @@ Choose “管理安装 → 检查可用性” on a conversational installed-skil The result distinguishes local integrity, current-session discovery, and user/model invocation policies. Shadowing, local modifications and unknown Host state are separate outcomes. A name-only lookup reports Host observations without proving installation ownership or integrity. Diagnosis never modifies, removes or enables/disables a skill, edits a draft, or sends a message. A historical result is not a guarantee about a later invocation. -## Managed skill enable/disable (unreleased increment) +## Managed skill enable/disable (0.6.0 candidate) Open “管理安装” and choose enable or disable on the explicit location row. User and project copies are independent: disabling the user copy does not disable a project copy. UI and conversation mutations require real human confirmation. `astron_skillhub_disable` / `astron_skillhub_enable` accept fresh installation references, never arbitrary paths. @@ -229,7 +231,7 @@ Disabling changes only the entry from `SKILL.md` to `SKILL.md.disabled`, keeping This does not revoke loaded conversation content or stop tasks. Another same-named installation can remain available. Unverified Host cache observations remain unknown; the older RC may need a new session to observe a fallback copy. Removing this plugin does not enable its disabled installations. -The increment writes inventory v3 with per-location `installationState`. Reading v1/v2 is non-mutating; migration preserves the original bytes and a digest-addressed backup. The plugin bundles its compatible core and does not invoke an external CLI. Stop old writers and use the matching compatible CLI build before sharing inventory: published CLI `0.2.0` and `0.1.12` are incompatible. Release versions and order are not assigned yet. An old inventory backup alone is not a downgrade procedure. Native Windows/macOS entry conversion still requires acceptance before release. +The increment writes inventory v3 with per-location `installationState`. Reading v1/v2 is non-mutating; migration preserves the original bytes and a digest-addressed backup. The plugin bundles its compatible core and does not invoke an external CLI. Stop old writers and use the matching compatible CLI build before sharing inventory: published CLI `0.2.0` and `0.1.12` are incompatible. The companion candidate is CLI `0.3.0`; publish and verify it before DSH `0.6.0`. Old-package rejection of v3 does not mean rollback is supported. An old inventory backup alone is not a downgrade procedure. Native Windows/macOS entry conversion still requires acceptance before release. The detail-header website link uses only the detail API’s optional `webUrl`. Missing, null, blank or unsafe values hide the action without breaking skill details or installation. There is no plugin website setting, route construction or Registry fallback; legacy `websiteUrl` settings are ignored. The open-source server uses its trusted `SKILLHUB_PUBLIC_BASE_URL` to supply an absolute link, or null when no valid website base is configured. SaaS must provide this additive API field separately. diff --git a/plugins/dsh/README.md b/plugins/dsh/README.md index a1883ea56..c084ee4bc 100644 --- a/plugins/dsh/README.md +++ b/plugins/dsh/README.md @@ -12,11 +12,13 @@ SkillHub 的 DSH 原生插件。在 DSH 侧栏打开 **技能中心**,匿名 `0.5.0` 新增技能卡片及对话中的只读可用性诊断,分别报告文件完整性、宿主发现和调用策略,保留 `0.4.0` 的兼容范围及库存格式。 +`0.6.0` 为当前发布候选,包含受管理技能启停、统一只读检查更新,以及横向已安装卡片和更多菜单。首次写操作使用库存 v3;同机共享库存的 CLI 配套候选为 `0.3.0`,计划先发布 CLI 再发布插件。候选版本不表示已公开发布,最终包和跨平台验收结果单独记录。 + ## 使用已安装技能 市场、已安装列表和对话中的日常列表均按技能展示。点击“使用技能”,由 Host 核验当前会话实际可用的唯一安装;不会让用户猜安装位置。技能中心入口在同一工作区新建对话,对话内入口保留当前会话。案例显示在原生输入框上方,确认案例或自定义任务后填入可编辑草稿;不会自动发送、调用模型或覆盖原会话草稿。 -“管理安装”进入技能详情,右侧直接展示每个位置的版本和状态,可明确使用此位置、检查更新、启停或卸载。全停用或状态无法确认时先进入管理安装。安装范围放在安装确认的高级选项中,未安装技能仍默认安装到当前用户。 +已安装卡片的更多菜单中,“管理安装”进入技能详情,右侧直接展示每个位置的版本和状态,可明确使用此位置、检查更新、启停或卸载。全停用或状态无法确认时先进入管理安装。安装范围放在安装确认的高级选项中,未安装技能仍默认安装到当前用户。 需要当前活动会话。被项目同名技能覆盖、本地文件变更、禁止用户调用或会话/来源变化时会提示原因;历史回执不能代替当前安装状态。此功能自 `0.4.0` 起提供。 @@ -76,8 +78,8 @@ npm pack --ignore-scripts --pack-destination /absolute/path/to/candidate-output 先查询 npm 上的精确版本,确认可用后安装。核对 DSH、Node 和上表完整 Cordis 组合,停止目标 Web Profile 的 Host,再执行插件安装;也可按下一节安装已验证的本地 tarball: ```sh -npm view @astron-team/skillhub-dsh@0.5.0 version -dsh plugin --profile skillhub-test add @astron-team/skillhub-dsh@0.5.0 --ignore-scripts +npm view @astron-team/skillhub-dsh@0.6.0 version +dsh plugin --profile skillhub-test add @astron-team/skillhub-dsh@0.6.0 --ignore-scripts dsh --profile skillhub-test --host 127.0.0.1 --port 0 --no-open ``` @@ -85,9 +87,9 @@ dsh --profile skillhub-test --host 127.0.0.1 --port 0 --no-open ## 从旧版本升级 -`0.4.0` 使用按安装位置记录版本的库存 v2。插件仍内置安装核心,无需为了使用插件单独安装 CLI;如果同一用户还使用 SkillHub CLI 管理这些技能,先将这些 CLI 升级到 `0.2.0`,再升级插件,并停止旧版 CLI 的定时或后台写入。先用 `npm view @astron-team/skillhub@0.2.0 version` 确认可用,再使用 `npm install -g @astron-team/skillhub@0.2.0`,确认 `skillhub version`,再执行上面的精确插件版本安装命令。 +`0.6.0` 候选使用库存 v3,记录每个安装位置的启停状态。插件内置兼容核心,不调用 CLI 命令,只有插件的用户无需安装 CLI。如果同一用户还使用 CLI 管理相同库存,先停止所有旧 CLI 的定时/后台写入并完成待恢复操作,确认 `npm view @astron-team/skillhub@0.3.0 version` 可用,再执行 `npm install -g @astron-team/skillhub@0.3.0` 并核对 `skillhub version`,最后升级插件。发布前请使用本地候选 tarball,公开版本不可用时不要替换成旧包混写。 -读取旧库存不迁移;首次写入 v2 前,在库存同目录保存经字节核对的 `inventory.v1..backup.json`。同一技能的用户与项目副本可保留不同版本。旧 CLI 与 v2 库存混写不受支持;已分位置更新后,不能只恢复旧库存文件或降级插件来回退,必须同时核对实际技能文件、安装元数据和操作记录。 +读取库存 v1/v2 不迁移;首次成功写入 v3 前保留旧库存原始字节和摘要寻址备份。旧 CLI `0.2.0` 不支持 v3;旧包拒绝读取 v3 不等于可用回滚,也不是跨进程混写保护。不能只恢复旧库存或降级包,必须停止写入并同时核对 `SKILL.md` / `SKILL.md.disabled`、技能内容、安装元数据和操作日志。 案例由作者随技能包提供固定文件 `.skillhub/examples.json`,安装后保持相同位置,跟随技能版本和指纹,不创建另一个全局案例副本。无案例时使用自定义任务;无效声明按普通文件保留,不提供错误的案例入口。 @@ -226,7 +228,7 @@ dsh plugin --profile skillhub-test remove @astron-team/skillhub-dsh 诊断分别核验本地文件、当前会话加载结果,以及用户/模型调用策略。同名技能生效、本地修改和宿主无法核验会给出不同结论。按技能名查询只说明当前宿主观察到的事实,不证明安装来源或内容完整性。检查不会修改、卸载、启停技能或发送消息;历史结果不保证下一次调用仍然可用。 -## 受管理技能启停(未发布增量) +## 受管理技能启停(0.6.0 候选) 在“管理安装”中,对明确位置选择“停用”或“启用”。用户级和项目级副本独立管理;停用用户副本不会关闭项目副本。页面与对话均需真实用户确认,取消不写文件。对话工具 `astron_skillhub_disable` / `astron_skillhub_enable` 使用新查询中的位置引用,不能提交自由路径。 @@ -234,7 +236,7 @@ dsh plugin --profile skillhub-test remove @astron-team/skillhub-dsh 这不撤回会话已加载的正文,也不终止任务;同名的其他安装可能继续可用。宿主缓存未确认时明确显示未知,不把文件操作成功当作发现已刷新。旧 RC 的同名接替可能需新会话才能观察到。卸载插件不会自动启用这些技能。 -本增量首次写入使用库存 v3(每位置 `installationState`),读取 v1/v2 不改写,迁移保留原始库存字节及摘要备份。插件内置兼容核心,仍不调用外部 CLI;同机使用 CLI 管理相同库存时,须先停止旧写入进程并使用配套兼容构建。现有公开 CLI `0.2.0`/`0.1.12` 不支持此协议,不可混写;配套正式版本与发布顺序另行确定。不能只恢复旧库存文件来降级,须核对入口、安装元数据及操作日志。原生 Windows/macOS 文件转换的实机验收仍是发布前门禁。 +本增量首次写入使用库存 v3(每位置 `installationState`),读取 v1/v2 不改写,迁移保留原始库存字节及摘要备份。插件内置兼容核心,仍不调用外部 CLI;同机使用 CLI 管理相同库存时,须先停止旧写入进程并使用配套兼容构建。现有公开 CLI `0.2.0`/`0.1.12` 不支持此协议,不可混写;配套候选为 CLI `0.3.0`,计划先发布并验证 CLI,再发布 DSH `0.6.0`。旧包拒绝 v3 不表示支持回滚。不能只恢复旧库存文件来降级,须核对入口、安装元数据及操作日志。原生 Windows/macOS 文件转换的实机验收仍是发布前门禁。 详情标题旁“在官网查看”仅使用详情API返回的可选`webUrl`。字段缺失、null、空白或不安全时隐藏按钮,详情与安装照常使用。插件不再提供网站地址配置、不拼路由、不从Registry回退;旧`websiteUrl`配置忽略。开源服务端复用可信`SKILLHUB_PUBLIC_BASE_URL`生成完整地址,未配置合法网站基址则返回null。SaaS需单独同步此可选字段。 diff --git a/plugins/dsh/package.json b/plugins/dsh/package.json index 885eea412..f0e270fb1 100644 --- a/plugins/dsh/package.json +++ b/plugins/dsh/package.json @@ -1,6 +1,6 @@ { "name": "@astron-team/skillhub-dsh", - "version": "0.5.0", + "version": "0.6.0", "private": false, "type": "module", "license": "Apache-2.0", diff --git a/plugins/dsh/scripts/smoke-native-host.mjs b/plugins/dsh/scripts/smoke-native-host.mjs index ff9b5a832..a45f83c89 100644 --- a/plugins/dsh/scripts/smoke-native-host.mjs +++ b/plugins/dsh/scripts/smoke-native-host.mjs @@ -13,6 +13,12 @@ export function selectDshVersion(version, family = 'fresh') { if (version === '0.2.1-rc.2' && family === 'retained') throw new Error('DSH 0.2.1 requires the current Cordis family.'); return version; } +export function scenarioProbes(scenario = 'smoke') { + if (scenario === 'smoke') return ['runtime-baseline', 'plugin-lifecycle', 'skill-availability']; + if (scenario === 'skill-toggle' || scenario === 'skill-toggle-watch-off') return ['runtime-baseline', scenario]; + throw new Error('Unsupported Host scenario'); +} + const PNPM_VERSION = '10.33.0'; export const retainedCordisFamily = { @@ -169,14 +175,15 @@ async function findNpm() { } async function main() { - const { values } = parseArgs({ options: { 'dsh-version': { type: 'string', default: '0.2.0-rc.2' }, artifact: { type: 'string' }, report: { type: 'string' }, help: { type: 'boolean' }, 'cordis-family': { type: 'string', default: 'fresh' } } }); + const { values } = parseArgs({ options: { 'dsh-version': { type: 'string', default: '0.2.0-rc.2' }, artifact: { type: 'string' }, report: { type: 'string' }, help: { type: 'boolean' }, 'cordis-family': { type: 'string', default: 'fresh' }, scenario: { type: 'string', default: 'smoke' } } }); if (values.help) { - console.log('node scripts/smoke-native-host.mjs --artifact --report [--cordis-family fresh|retained] [--dsh-version 0.2.0-rc.2|0.2.1-rc.2]'); + console.log('node scripts/smoke-native-host.mjs --artifact --report [--scenario smoke|skill-toggle|skill-toggle-watch-off] [--cordis-family fresh|retained] [--dsh-version 0.2.0-rc.2|0.2.1-rc.2]'); return; } if (!values.artifact || !values.report) throw new Error('Specify --artifact and --report; see --help.'); const [major, minor] = process.versions.node.split('.').map(Number); if (major !== 24 || minor < 2) throw new Error('Use the fixed Node >=24.2.0 <25 baseline.'); + const probes = scenarioProbes(values.scenario); const dshVersion = selectDshVersion(values['dsh-version'], values['cordis-family']); const installManifest = hostInstallManifest(values['cordis-family']); const artifact = await selectTarball(values.artifact); @@ -193,7 +200,7 @@ async function main() { process.once('SIGINT', stop); process.once('SIGTERM', stop); const summary = { passed: false, platform: process.platform, node: process.versions.node, - dsh: dshVersion, pnpm: PNPM_VERSION, cordisFamily: values['cordis-family'], + scenario: values.scenario, dsh: dshVersion, pnpm: PNPM_VERSION, cordisFamily: values['cordis-family'], artifactSha256: createHash('sha256').update(await readFile(artifact)).digest('hex'), modelCalled: false, probes: [], stage: 'install-host' }; const run = (name, args, timeoutMs = 300000) => runBounded(args, { cwd: join(root, 'workspace'), env, @@ -217,7 +224,7 @@ async function main() { const manifest = JSON.parse(await readFile(join(root, 'home/profiles/skillhub-m0/node_modules/@astron-team/skillhub-dsh/package.json'), 'utf8')); if (manifest.name !== '@astron-team/skillhub-dsh') throw new Error('Unexpected installed candidate identity.'); const probeScript = fileURLToPath(new URL('./probe-host.mjs', import.meta.url)); - for (const probe of ['runtime-baseline', 'plugin-lifecycle', 'skill-availability']) { + for (const probe of probes) { summary.stage = probe; await run(probe, [probeScript, '--root', root, '--probe', probe], 150000); const lines = (await readFile(join(root, 'logs', probe + '.log'), 'utf8')).trim().split('\n'); @@ -238,7 +245,7 @@ async function main() { } catch (error) { summary.failure = ['SPAWN_FAILED', 'DEADLINE_OR_CANCELLED', 'PROCESS_FAILED', 'CLEANUP_DEADLINE'].includes(error.code) ? error.code : 'INVALID_RESULT'; - if (['runtime-baseline', 'plugin-lifecycle', 'skill-availability'].includes(summary.stage)) { + if (probes.includes(summary.stage)) { const log = await readFile(join(root, 'logs', summary.stage + '.log'), 'utf8').catch(() => ''); summary.probeFailure = safeProbeFailure(log, summary.stage); } diff --git a/plugins/dsh/test/smoke-native-host.test.ts b/plugins/dsh/test/smoke-native-host.test.ts index 6d738ee2d..23ae17a38 100644 --- a/plugins/dsh/test/smoke-native-host.test.ts +++ b/plugins/dsh/test/smoke-native-host.test.ts @@ -4,7 +4,7 @@ import { tmpdir } from 'node:os'; import { join } from 'node:path'; // Node-only CI entry; keep its helpers importable without starting a Host or downloading dependencies. // @ts-expect-error The development-only Node entry has no TypeScript declarations. -import { hostInstallManifest, selectDshVersion, supportedDshVersions, isolatedEnvironment, profileInstallManifest, retainedCordisFamily, runBounded, selectTarball } from '../scripts/smoke-native-host.mjs'; +import { scenarioProbes, hostInstallManifest, selectDshVersion, supportedDshVersions, isolatedEnvironment, profileInstallManifest, retainedCordisFamily, runBounded, selectTarball } from '../scripts/smoke-native-host.mjs'; const roots: string[] = []; async function root() { @@ -173,3 +173,11 @@ test('native smoke accepts only explicit DSH releases and rejects incompatible r } expect(() => selectDshVersion('0.2.1-rc.2', 'retained')).toThrow('requires the current Cordis family'); }); + + +test('installation scenarios select a fresh smoke invocation without availability leftovers', () => { + expect(scenarioProbes()).toEqual(['runtime-baseline', 'plugin-lifecycle', 'skill-availability']); + expect(scenarioProbes('skill-toggle')).toEqual(['runtime-baseline', 'skill-toggle']); + expect(scenarioProbes('skill-toggle-watch-off')).toEqual(['runtime-baseline', 'skill-toggle-watch-off']); + expect(() => scenarioProbes('unknown')).toThrow('Unsupported Host scenario'); +});