Browse Source

fix(desktop): 固定配套运行时并完善发布构建与升级验收

打包检查后端提交、文件完整性、协议和目标架构,正式签名缺失时明确失败,内部预览显式启用未签名模式。配套运行时固定为 893fa0e0,并更新版本及界面回归入口。

App/Desktop 类型检查、发布与运行时测试 5 项通过;完整界面和真实模型验收边界另附记录。
邵勃源 4 hours ago
parent
commit
2d2cbd09d1

+ 1 - 1
bun.lock

@@ -383,7 +383,7 @@
     },
     "packages/desktop": {
       "name": "@opencode-ai/desktop",
-      "version": "0.1.0-beta.5",
+      "version": "0.1.0-beta.9",
       "dependencies": {
         "@zip.js/zip.js": "2.7.62",
         "effect": "catalog:",

+ 4 - 0
packages/app/e2e/paas/desktop-product.spec.ts

@@ -1,3 +1,4 @@
+import { selectEditableAgent } from "./edit-agent-helper"
 import { expect, test, type Page } from "@playwright/test"
 async function connect(page: Page, key = "desktop-product") {
   await page.getByLabel("API Key", { exact: true }).fill(key)
@@ -23,6 +24,7 @@ test("agent settings draft survives a window reload without applying changes", a
   await page.goto("/e2e/paas/index.html?ux")
   await connect(page)
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await page.getByLabel("最多研究轮次", { exact: true }).fill("9")
   await expect
     .poll(() => page.evaluate(() => localStorage.getItem("test-draft:test-desktop-product:agent:research")))
@@ -30,6 +32,7 @@ test("agent settings draft survives a window reload without applying changes", a
   await page.reload()
   await connect(page)
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await expect(page.getByLabel("最多研究轮次", { exact: true })).toHaveValue("9")
   expect(await page.evaluate(() => window.paasTestCalls.filter((call) => call.action === "update-agent").length)).toBe(
     0,
@@ -88,6 +91,7 @@ test("unreadable persisted draft is not erased by opening and closing settings",
     Object.assign(window.paasUX, { draftError: true })
   })
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await expect(page.getByText("本机草稿暂时无法读取,仍可编辑当前配置。", { exact: true })).toBeVisible()
   await page.getByRole("button", { name: "返回工作台" }).click()
   expect(await page.evaluate(() => localStorage.getItem("test-draft:test-desktop-product:agent:research"))).toBe(

+ 10 - 0
packages/app/e2e/paas/edit-agent-helper.ts

@@ -0,0 +1,10 @@
+import { expect, type Page } from "@playwright/test"
+
+// Automatic routing now asks for an explicit configuration target.
+export async function selectEditableAgent(page: Page) {
+  const picker = page.getByRole("dialog", { name: "选择要编辑的智能体", exact: true })
+  const editor = page.getByRole("heading", { name: "编辑智能体", exact: true })
+  await expect(picker.or(editor)).toBeVisible()
+  if (await picker.isVisible()) await picker.getByRole("option", { name: /^科研助手/ }).click()
+  await expect(editor).toBeVisible()
+}

+ 2 - 0
packages/app/e2e/paas/form-validation.spec.ts

@@ -1,3 +1,4 @@
+import { selectEditableAgent } from "./edit-agent-helper"
 import { expect, test } from "@playwright/test"
 
 test("connection validation stays inline without browser invalid events", async ({ page }) => {
@@ -41,6 +42,7 @@ test("invalid research settings show a field error and valid settings still save
   await page.getByLabel("API Key", { exact: true }).fill("form-settings")
   await page.getByRole("button", { name: "连接平台", exact: true }).click()
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   const rounds = page.getByLabel("最多研究轮次", { exact: true })
   await rounds.fill("9")
   await page.getByRole("button", { name: "保存修改", exact: true }).click()

+ 2 - 0
packages/app/e2e/paas/fullcheck.spec.ts

@@ -1,3 +1,4 @@
+import { selectEditableAgent } from "./edit-agent-helper"
 import { expect, test, type Page } from "@playwright/test"
 async function connect(page: Page, suffix = "") {
   await page.goto(`/e2e/paas/index.html?ux${suffix}`)
@@ -85,5 +86,6 @@ test("narrow windows retain settings and developer actions in the more menu", as
   await menu.locator("summary").click()
   await expect(menu.getByRole("button", { name: "在开发区打开工作区", exact: true })).toBeVisible()
   await menu.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await expect(page.getByRole("heading", { name: "编辑智能体", exact: true })).toBeVisible()
 })

+ 6 - 0
packages/app/e2e/paas/recovery.spec.ts

@@ -1,3 +1,4 @@
+import { selectEditableAgent } from "./edit-agent-helper"
 import { expect, test, type Page } from "@playwright/test"
 declare global {
   interface Window {
@@ -127,6 +128,10 @@ test("conversation rename, search and local archive persist without cancelling a
   await expect(page.locator(".paas-session-items").getByRole("button", { name: /光学研究记录/ })).toBeVisible()
   await page.locator(".paas-more-actions > summary").click()
   await page.getByRole("button", { name: "在本机归档", exact: true }).click()
+  await page
+    .getByRole("dialog", { name: "归档此会话?" })
+    .getByRole("button", { name: "确认归档", exact: true })
+    .click()
   await expect(page.locator(".paas-session-items").getByRole("button", { name: /光学研究记录/ })).toHaveCount(0)
   await page.getByRole("button", { name: "查看本机归档", exact: true }).click()
   await expect(page.locator(".paas-session-items").getByRole("button", { name: /光学研究记录/ })).toBeVisible()
@@ -235,6 +240,7 @@ test("research settings return to the same draft without executing or changing b
   await connect(page)
   await page.getByRole("textbox", { name: "消息", exact: true }).fill("保留我的下一轮要求")
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await page.getByLabel("累计 Token 硬上限", { exact: true }).fill("2000000")
   await page
     .getByRole("group", { name: "科研预算与迭代", exact: true })

+ 9 - 0
packages/app/e2e/paas/round2.spec.ts

@@ -1,3 +1,4 @@
+import { selectEditableAgent } from "./edit-agent-helper"
 import { expect, test, type Page } from "@playwright/test"
 
 async function connect(page: Page) {
@@ -10,11 +11,13 @@ async function connect(page: Page) {
 test("settings survive navigation, stay unapplied until saved, and can be discarded", async ({ page }) => {
   await connect(page)
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   const rounds = page.getByLabel("最多研究轮次", { exact: true })
   await expect(rounds).toHaveValue("4")
   await rounds.fill("8")
   await page.getByRole("button", { name: "返回工作台" }).click()
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await expect(rounds).toHaveValue("8")
   await expect(page.getByText(/已恢复未保存的修改/)).toBeVisible()
   expect(await page.evaluate(() => window.paasTestCalls.filter((c) => c.action === "update-agent"))).toHaveLength(0)
@@ -23,6 +26,7 @@ test("settings survive navigation, stay unapplied until saved, and can be discar
   await rounds.fill("7")
   await page.getByRole("button", { name: /保存修改/ }).click()
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await expect(rounds).toHaveValue("7")
   await expect(page.getByText(/已恢复未保存的修改/)).toHaveCount(0)
 })
@@ -30,12 +34,14 @@ test("settings survive navigation, stay unapplied until saved, and can be discar
 test("settings from an older version are retained but cannot silently overwrite newer settings", async ({ page }) => {
   await connect(page)
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await page.getByLabel("最多研究轮次", { exact: true }).fill("8")
   await page.getByRole("button", { name: "返回工作台" }).click()
   await page.evaluate(() => {
     window.paasUX.configVersion = "version-2"
   })
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await expect(page.getByLabel("最多研究轮次", { exact: true })).toHaveValue("8")
   await expect(page.getByText(/平台配置已更新,已保留你的草稿/)).toBeVisible()
   await page.getByRole("button", { name: /保存修改/ }).click()
@@ -103,17 +109,20 @@ test("remote workspaces explain downloading files instead of offering a broken l
 test("a failed settings reload does not erase the retained draft", async ({ page }) => {
   await connect(page)
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await page.getByLabel("最多研究轮次", { exact: true }).fill("9")
   await page.getByRole("button", { name: "返回工作台" }).click()
   await page.evaluate(() => {
     window.paasUX.configError = true
   })
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await expect(page.getByText("配置服务暂时不可用")).toBeVisible()
   await page.getByRole("button", { name: "返回工作台" }).click()
   await page.evaluate(() => {
     window.paasUX.configError = false
   })
   await page.getByRole("button", { name: "研究设置", exact: true }).click()
+  await selectEditableAgent(page)
   await expect(page.getByLabel("最多研究轮次", { exact: true })).toHaveValue("9")
 })

+ 13 - 1
packages/desktop/electron-builder.config.ts

@@ -5,6 +5,8 @@ import { fileURLToPath } from "node:url"
 import { promisify } from "node:util"
 
 import type { Configuration } from "electron-builder"
+import { Arch } from "electron-builder"
+import { runtimeRelease, validateRuntimeBundle } from "./scripts/runtime-bundle"
 
 const execFileAsync = promisify(execFile)
 const packageDir = path.dirname(fileURLToPath(import.meta.url))
@@ -16,7 +18,9 @@ const metainfoFpm = (appId: string) =>
 
 async function signWindows(configuration: { path: string }) {
   if (process.platform !== "win32") return
-  if (process.env.GITHUB_ACTIONS !== "true") return
+  if (process.env.LAMBDA_AGENT_ALLOW_UNSIGNED === "1") return
+  if (process.env.GITHUB_ACTIONS !== "true")
+    throw new Error("Windows 正式包需要配置签名流水线;本机试用请显式使用 package:beta --unsigned。")
 
   await execFileAsync(
     "pwsh",
@@ -38,6 +42,14 @@ const APP_IDS = {
 } as const
 
 const getBase = (appId: string): Configuration => ({
+  forceCodeSigning:
+    channel !== "dev" && process.env.LAMBDA_AGENT_ALLOW_UNSIGNED !== "1" && process.platform !== "linux",
+  beforePack: async (context) => {
+    if (channel === "dev" || process.env.LAMBDA_AGENT_EXTERNAL_SERVICES === "1") return
+    if (context.electronPlatformName !== process.platform || Arch[context.arch] !== process.arch)
+      throw new Error("完整版请在目标系统与架构构建并验收,不能将当前本地运行组件打入其他系统或架构安装包。")
+    await validateRuntimeBundle(path.join(packageDir, "resources/agentpaas-runtime"), await runtimeRelease())
+  },
   artifactName: "lambda-agent-${version}-${os}-${arch}.${ext}",
   directories: {
     output: "dist",

+ 1 - 1
packages/desktop/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@opencode-ai/desktop",
   "private": true,
-  "version": "0.1.0-beta.5",
+  "version": "0.1.0-beta.9",
   "type": "module",
   "license": "MIT",
   "author": {

+ 4 - 0
packages/desktop/runtime-release.json

@@ -0,0 +1,4 @@
+{
+  "protocol": 1,
+  "revision": "893fa0e07920cf3bb6984c4b76923385367dfa52"
+}

+ 30 - 16
packages/desktop/scripts/native-release-smoke.cjs

@@ -8,6 +8,10 @@ const { _electron: electron, expect } = req("@playwright/test")
 
 ;(async () => {
   if (!process.argv[2]) throw new Error("Pass the packaged executable")
+  const upgradeIndex = process.argv.indexOf("--upgrade-from")
+  const previousExecutable = upgradeIndex < 0 ? undefined : process.argv[upgradeIndex + 1]
+  if (upgradeIndex >= 0 && !previousExecutable)
+    throw new Error("--upgrade-from requires the previous packaged executable")
   const root = await fs.mkdtemp(path.join(require("node:os").tmpdir(), "lambda-release-"))
   const profile = path.join(root, "profile")
   const archive = path.join(root, "project.zip")
@@ -38,7 +42,9 @@ const { _electron: electron, expect } = req("@playwright/test")
   })
   await new Promise((resolve) => model.listen(0, "127.0.0.1", resolve))
   const env = Object.fromEntries(
-    Object.entries(process.env).filter(([key]) => !/^(AGENTPAAS_|AGENT_SERVICE_|PYTHONPATH$)|(_API_KEY|_TOKEN)$/.test(key)),
+    Object.entries(process.env).filter(
+      ([key]) => !/^(AGENTPAAS_|AGENT_SERVICE_|PYTHONPATH$)|(_API_KEY|_TOKEN)$/.test(key),
+    ),
   )
   Object.assign(env, {
     OPENCODE_TEST_ONBOARDING: "1",
@@ -50,8 +56,8 @@ const { _electron: electron, expect } = req("@playwright/test")
   let page
   let connection
   let userData
-  const launch = async () => {
-    app = await electron.launch({ executablePath: path.resolve(process.argv[2]), env, timeout: 60000 })
+  const launch = async (executable = process.argv[2]) => {
+    app = await electron.launch({ executablePath: path.resolve(executable), env, timeout: 60000 })
     page = await app.firstWindow()
     await page.waitForFunction(() => !!window.api?.paas)
     userData = await app.evaluate(({ app }) => app.getPath("userData"))
@@ -73,7 +79,8 @@ const { _electron: electron, expect } = req("@playwright/test")
     return data
   }
   try {
-    const original = await launch()
+    const original = await launch(previousExecutable)
+    const previousVersion = await app.evaluate(({ app }) => app.getVersion())
     const setup = await api("/desktop/setup")
     for (const id of ["anthropic", "ollama"]) {
       const provider = setup.providers.find((item) => item.id === id)
@@ -93,17 +100,20 @@ const { _electron: electron, expect } = req("@playwright/test")
     const agentID = agent.agent_id || agent.id
     const scope = await page.evaluate((agentID) => window.api.paas.request({ action: "task-scope", agentID }), agentID)
     if (scope.agent_id !== agentID || scope.local_tools.length) throw new Error("Simple agent scope incorrect")
-    await page.evaluate(({ id, folders }) => {
-      window.nativeReleaseRun = window.api.paas.request({
-        action: "execute",
-        agentID: id,
-        input: "验证后台运行",
-        mode: "iterate",
-        executionID: "native-release-owned",
-        workDir: folders[0],
-        workDirs: folders,
-      })
-    }, { id: agentID, folders })
+    await page.evaluate(
+      ({ id, folders }) => {
+        window.nativeReleaseRun = window.api.paas.request({
+          action: "execute",
+          agentID: id,
+          input: "验证后台运行",
+          mode: "iterate",
+          executionID: "native-release-owned",
+          workDir: folders[0],
+          workDirs: folders,
+        })
+      },
+      { id: agentID, folders },
+    )
     await expect.poll(() => calls, { timeout: 60000 }).toBeGreaterThan(0)
     await app.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows()[0].close())
     await expect
@@ -163,6 +173,9 @@ const { _electron: electron, expect } = req("@playwright/test")
     await app.close()
     app = undefined
     await launch()
+    const currentVersion = await app.evaluate(({ app }) => app.getVersion())
+    if (previousExecutable && currentVersion === previousVersion)
+      throw new Error("Upgrade acceptance requires different versions")
     const saved = await api(`/agents/${agentID}/runs/${run.run_id}`)
     if (saved.status !== "completed" || calls !== before) throw new Error("Relaunch lost or replayed task")
     if (connection.scope !== original.scope) throw new Error("Managed workspace identity changed")
@@ -179,7 +192,8 @@ const { _electron: electron, expect } = req("@playwright/test")
           backupRestored: true,
           relaunchPreserved: true,
           replayedCalls: calls - before,
-          version: await app.evaluate(({ app }) => app.getVersion()),
+          version: currentVersion,
+          ...(previousExecutable ? { upgradedFrom: previousVersion } : {}),
         },
         null,
         2,

+ 3 - 2
packages/desktop/scripts/package-beta.ts

@@ -2,11 +2,12 @@
 import { $ } from "bun"
 import { existsSync } from "node:fs"
 import { join, resolve } from "node:path"
-import { validateRuntimeBundle } from "./runtime-bundle"
+import { runtimeRelease, validateRuntimeBundle } from "./runtime-bundle"
 
 // Build and package locally. Publishing is always a separate, explicit action.
 process.env.OPENCODE_CHANNEL = "beta"
 const unsigned = process.argv.includes("--unsigned")
+process.env.LAMBDA_AGENT_ALLOW_UNSIGNED = unsigned ? "1" : "0"
 if (unsigned) {
   process.env.CSC_IDENTITY_AUTO_DISCOVERY = "false"
   // An unsigned local preview must never offer an updater feed as a release.
@@ -25,7 +26,7 @@ if (!external) {
     throw new Error(
       "完整版缺少本地运行组件。先准备 LAMBDA_AGENT_RUNTIME_DIR;仅连接已有服务的精简版请显式使用 --external-services。",
     )
-  await validateRuntimeBundle("resources/agentpaas-runtime")
+  await validateRuntimeBundle("resources/agentpaas-runtime", await runtimeRelease())
 }
 if (process.platform === "win32") {
   if (process.arch !== "x64") throw new Error("Build the Windows Beta installer using x64 Bun")

+ 2 - 2
packages/desktop/scripts/prepare-paas-runtime.ts

@@ -2,7 +2,7 @@
 import { cp, mkdir, rm, chmod, stat, rename } from "node:fs/promises"
 import { join, resolve, sep } from "node:path"
 import { $ } from "bun"
-import { runtimeFiles, validateRuntimeBundle } from "./runtime-bundle"
+import { runtimeFiles, runtimeRelease, validateRuntimeBundle } from "./runtime-bundle"
 
 // Build the PaaS standalone directory on the target OS/architecture first.
 // A host Python installation is never copied into a user's installer.
@@ -37,7 +37,7 @@ try {
       2,
     ),
   )
-  await validateRuntimeBundle(staging)
+  await validateRuntimeBundle(staging, await runtimeRelease())
   const existed = await stat(target).then(
     () => true,
     () => false,

+ 39 - 0
packages/desktop/scripts/release-policy.test.ts

@@ -0,0 +1,39 @@
+import { expect, test } from "bun:test"
+import { execFileSync } from "node:child_process"
+
+function config(unsigned: boolean) {
+  return JSON.parse(
+    execFileSync(
+      process.execPath,
+      [
+        "-e",
+        `
+    import config from "./electron-builder.config.ts";
+    import { Arch } from "electron-builder";
+    let rejected = false;
+    try { await config.beforePack({ electronPlatformName: "other", arch: Arch.arm64 }); }
+    catch { rejected = true; }
+    console.log(JSON.stringify({ forceCodeSigning: config.forceCodeSigning, rejected }));
+  `,
+      ],
+      {
+        cwd: new URL("..", import.meta.url),
+        env: {
+          ...process.env,
+          OPENCODE_CHANNEL: "beta",
+          LAMBDA_AGENT_EXTERNAL_SERVICES: "0",
+          LAMBDA_AGENT_ALLOW_UNSIGNED: unsigned ? "1" : "0",
+        },
+        encoding: "utf8",
+      },
+    ),
+  )
+}
+
+test("release packaging requires signatures on supported platforms and rejects foreign runtimes", () => {
+  expect(config(false)).toEqual({ forceCodeSigning: process.platform !== "linux", rejected: true })
+})
+
+test("explicit internal previews may be unsigned but still require a matching runtime", () => {
+  expect(config(true)).toEqual({ forceCodeSigning: false, rejected: true })
+})

+ 40 - 0
packages/desktop/scripts/runtime-bundle.test.ts

@@ -4,6 +4,46 @@ import { join } from "node:path"
 import { tmpdir } from "node:os"
 import { runtimeFiles, validateRuntimeBundle } from "./runtime-bundle"
 
+test("release pairing rejects an intact but stale, dirty or incompatible runtime", async () => {
+  const root = await mkdtemp(join(tmpdir(), "runtime-release-"))
+  const release = { protocol: 1, revision: "a".repeat(40) }
+  const info = {
+    desktop_protocol: 1,
+    platform: process.platform,
+    arch: process.arch,
+    git_revision: release.revision,
+    dirty: false,
+  }
+  const prepare = async (metadata: object) => {
+    await writeFile(join(root, "build-info.json"), JSON.stringify(metadata))
+    await writeFile(
+      join(root, "desktop-runtime.json"),
+      JSON.stringify({
+        protocol: 1,
+        platform: process.platform,
+        arch: process.arch,
+        files: await runtimeFiles(root),
+      }),
+    )
+  }
+  try {
+    await writeFile(join(root, process.platform === "win32" ? "agentpaas.exe" : "agentpaas"), "launcher")
+    await prepare(info)
+    await validateRuntimeBundle(root, release)
+    for (const change of [
+      { git_revision: "b".repeat(40) },
+      { dirty: true },
+      { desktop_protocol: 2 },
+      { arch: "wrong" },
+    ]) {
+      await prepare({ ...info, ...change })
+      await expect(validateRuntimeBundle(root, release)).rejects.toThrow("版本不匹配")
+    }
+  } finally {
+    await rm(root, { recursive: true, force: true })
+  }
+})
+
 test("runtime manifest validates every dependency, not just its launcher", async () => {
   const root = await mkdtemp(join(tmpdir(), "runtime-manifest-"))
   try {

+ 20 - 1
packages/desktop/scripts/runtime-bundle.ts

@@ -3,6 +3,14 @@ import { readdir, readFile } from "node:fs/promises"
 import { createHash } from "node:crypto"
 import { join } from "node:path"
 
+export type RuntimeRelease = { protocol: number; revision: string }
+
+export async function runtimeRelease(): Promise<RuntimeRelease> {
+  const release = JSON.parse(await readFile(new URL("../runtime-release.json", import.meta.url), "utf8"))
+  if (release.protocol !== 1 || !/^[a-f0-9]{40}$/.test(release.revision)) throw new Error("运行组件版本清单无效。")
+  return release
+}
+
 export async function runtimeFiles(root: string) {
   const result: Record<string, string> = {}
   const visit = async (relative: string) => {
@@ -23,7 +31,7 @@ export async function runtimeFiles(root: string) {
   return Object.fromEntries(Object.entries(result).sort(([a], [b]) => a.localeCompare(b)))
 }
 
-export async function validateRuntimeBundle(root: string) {
+export async function validateRuntimeBundle(root: string, release?: RuntimeRelease) {
   const manifest = JSON.parse(await readFile(join(root, "desktop-runtime.json"), "utf8"))
   if (manifest.protocol !== 1 || manifest.platform !== process.platform || manifest.arch !== process.arch)
     throw new Error("本地运行组件与打包平台或协议不匹配。")
@@ -31,5 +39,16 @@ export async function validateRuntimeBundle(root: string) {
   const files = await runtimeFiles(root)
   if (!manifest.files || !files[binary] || JSON.stringify(files) !== JSON.stringify(manifest.files))
     throw new Error("本地运行组件文件校验失败,请重新准备运行组件。")
+  if (release) {
+    const info = JSON.parse(await readFile(join(root, "build-info.json"), "utf8"))
+    if (
+      info.git_revision !== release.revision ||
+      info.dirty !== false ||
+      info.desktop_protocol !== release.protocol ||
+      info.platform !== manifest.platform ||
+      info.arch !== manifest.arch
+    )
+      throw new Error(`本地运行组件版本不匹配或源码未提交,请使用 ${release.revision} 重新构建。`)
+  }
   return manifest
 }

+ 9 - 4
script/sign-windows.ps1

@@ -10,8 +10,7 @@ if (-not $Path -or $Path.Count -eq 0) {
 }
 
 if ($env:GITHUB_ACTIONS -ne "true") {
-  Write-Host "Skipping Windows signing because this is not running on GitHub Actions"
-  exit 0
+  throw "Windows release signing requires the configured GitHub Actions signing environment"
 }
 
 $vars = @{
@@ -21,8 +20,7 @@ $vars = @{
 }
 
 if ($vars.Values | Where-Object { -not $_ }) {
-  Write-Host "Skipping Windows signing because Azure Artifact Signing is not configured"
-  exit 0
+  throw "Azure Artifact Signing is not configured; refusing to produce an unsigned release"
 }
 
 $moduleVersion = "0.5.8"
@@ -68,3 +66,10 @@ $params = @{
 }
 
 Invoke-TrustedSigning @params
+
+foreach ($file in $files) {
+  $signature = Get-AuthenticodeSignature -FilePath $file
+  if ($signature.Status -ne 'Valid') {
+    throw "Signature verification failed for $file : $($signature.Status)"
+  }
+}