Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(release): verify the Linux feed name instead of renaming it
vastsab8a5f7a3e8c4
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 7f31cd08a..59cac83d8 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -121,6 +121,7 @@ jobs:runner_arch: x86_64artifact: linux-x64platform: linux+ feed: latest-linux.ymldist: dist:linux- name: Linux arm64# GitHub's native arm64 runner packages the Electron app and the@@ -132,6 +133,7 @@ jobs:runner_arch: aarch64artifact: linux-arm64platform: linux+ feed: latest-linux-arm64.ymldist: dist:linuxruns-on: ${{ matrix.os }}timeout-minutes: 60@@ -341,13 +343,21 @@ jobs:if: matrix.platform == 'linux'run: node scripts/export-linux-asar.mjs --arch ${{ matrix.arch }}- - name: Disambiguate the arm64 Linux update feed- # electron-updater requests `latest-linux.yml` on x64 but- # `latest-linux-<arch>.yml` on every other Linux architecture, so the- # arm64 lane renames its feed instead of overwriting the x64 feed when- # the publish job merges both lanes' artifacts.- if: matrix.platform == 'linux' && matrix.arch != 'x64'- run: mv apps/desktop/release/latest-linux.yml apps/desktop/release/latest-linux-${{ matrix.arch }}.yml+ - name: Verify the Linux update feed+ # electron-builder names the Linux feed `latest-linux.yml` for x64 and+ # `latest-linux-<arch>.yml` for every other Linux architecture — the+ # same names electron-updater requests on those architectures — so the+ # two lanes cannot overwrite each other's feed when the publish job+ # merges their artifacts.+ if: matrix.platform == 'linux'+ run: |+ set -euo pipefail+ feed="apps/desktop/release/${{ matrix.feed }}"+ if [[ ! -f "$feed" ]]; then+ echo "::error::Expected the Linux updater feed at $feed"+ ls apps/desktop/release || true+ exit 1+ fi- name: Verify macOS artifact namesif: matrix.platform == 'macos'diff --git a/apps/desktop/test/ci-workflow.test.mjs b/apps/desktop/test/ci-workflow.test.mjsindex 23de9d380..d9796c963 100644--- a/apps/desktop/test/ci-workflow.test.mjs+++ b/apps/desktop/test/ci-workflow.test.mjs@@ -175,13 +175,17 @@ test("the release matrix ships native Linux x64 and arm64 lanes", () => {releaseWorkflowSource,/name: Verify native runner architecture[\s\S]*?if: matrix\.runner_arch/,);- // electron-updater resolves `latest-linux.yml` on x64 but- // `latest-linux-<arch>.yml` elsewhere, so the arm64 lane must rename its feed- // instead of overwriting the x64 one during the publish merge.+ // electron-builder already names each Linux lane's feed after its own+ // architecture (`latest-linux.yml` on x64, `latest-linux-arm64.yml` on+ // arm64) — the names electron-updater requests — so the lanes cannot+ // overwrite each other's feed during the publish merge, and the lane+ // verifies the name it will publish instead of renaming it.assert.match(releaseWorkflowSource,- /name: Disambiguate the arm64 Linux update feed[\s\S]*?mv apps\/desktop\/release\/latest-linux\.yml apps\/desktop\/release\/latest-linux-\$\{\{ matrix\.arch \}\}\.yml/,+ /name: Verify the Linux update feed[\s\S]*?feed="apps\/desktop\/release\/\$\{\{ matrix\.feed \}\}"/,);+ assert.match(releaseWorkflowSource, /feed: latest-linux\.yml/);+ assert.match(releaseWorkflowSource, /feed: latest-linux-arm64\.yml/);// The pi-host bundles the SSH bootstrap installs track the desktop's Linux// lanes one for one.assert.match(diff --git a/docs/adr/0318-linux-arm64-release-lane.md b/docs/adr/0318-linux-arm64-release-lane.mdindex 66d747a83..4dc3b9273 100644--- a/docs/adr/0318-linux-arm64-release-lane.md+++ b/docs/adr/0318-linux-arm64-release-lane.md@@ -22,11 +22,10 @@ than a new flag on one job:electron-builder prefers a target's configured arch list over the CLI`--x64` / `--arm64` flag. Pinning both architectures would make each Linuxlane build the other architecture around its own native sidecar.-3. The AppImage target's default artifact name carries no architecture, and- electron-builder writes one Linux updater feed per build. Two Linux lanes- would therefore publish the same `PI-Desktop-<version>.AppImage` file name- and the same `latest-linux.yml` feed, and the publish job's merged download- would keep only whichever arrived last.+3. The AppImage target's default artifact name carries no architecture, so two+ Linux lanes would publish the same `PI-Desktop-<version>.AppImage` file name+ and the publish job's merged download would keep only whichever lane arrived+ last.`electron-updater` resolves its Linux feed by architecture: `latest-linux.yml`on x64 and `latest-linux-<arch>.yml` on every other architecture@@ -48,10 +47,11 @@ on x64 and `latest-linux-<arch>.yml` on every other architecture`PI-Desktop-<version>-linux-arm64.AppImage`. The deb and rpm targets keeptheir own patterns and expand `${arch}` through FPM's arch names(`amd64`/`arm64` and `x86_64`/`aarch64`).-4. Each Linux job disambiguates its generated updater feed before upload: the- arm64 lane renames `latest-linux.yml` to `latest-linux-arm64.yml`, and the- x64 lane keeps `latest-linux.yml`. The publish job then merges both lanes'- artifacts without one feed overwriting the other.+4. Each Linux job verifies the updater feed it is about to publish —+ `latest-linux.yml` on x64, `latest-linux-arm64.yml` on arm64. electron-builder+ already writes that architecture-suffixed name+ (`getArchPrefixForUpdateFile`), so no rename is needed and the publish job+ merges both lanes' artifacts without one feed overwriting the other.5. `scripts/export-linux-asar.mjs` takes the lane architecture, reads thearchive from electron-builder's own unpacked directory(`linux-unpacked` for x64, `linux-arm64-unpacked` for arm64), and publishesdiff --git a/docs/spec/06-delivery/06-release-runbook.md b/docs/spec/06-delivery/06-release-runbook.mdindex 3c3710aa7..e4065f8b4 100644--- a/docs/spec/06-delivery/06-release-runbook.md+++ b/docs/spec/06-delivery/06-release-runbook.md@@ -267,6 +267,11 @@ to the versioned `PI-Desktop-<version>-linux-<arch>.asar` asset before upload.This preserves the exact archive used by the Linux installers for downstreamrepackaging with a system Electron.+The Linux updater feeds carry the architecture they were built for:+`latest-linux.yml` for x64 and `latest-linux-arm64.yml` for arm64. Those are the+channel files `electron-updater` requests on the matching architecture, so a+lane fails before upload if its own feed is missing.+### 4.4 Documentation site deploymentThe release workflow does not deploy the documentation site. Vercel Gitdiff --git a/docs/spec/08-meta/decisions-log.md b/docs/spec/08-meta/decisions-log.mdindex 838492fc6..cb529ea7d 100644--- a/docs/spec/08-meta/decisions-log.md+++ b/docs/spec/08-meta/decisions-log.md@@ -32,7 +32,7 @@ This log freezes previously open questions into concrete decisions.| D635 | Work-area-capped 800×560 window minimum | **Supersede the 1040×700 window minimum in D156 / D447 (and the matching clauses of ADR 0029 / ADR 0238) and the `1040..10000` `window/setWorkPanelChatWidth` range (ADR 0146): Electron enforces an 800×560 minimum, capped per dimension to the current display work area by `clampMinimumSizeToWorkArea`. The chat-width IPC and renderer accept `800..10000`. On narrow windows the existing `workPanelLayout` budget caps the docked panel so MainChat keeps its 450px floor, collapsing the sidebar first. See US-UI-19 and E2E-167.** | At 150% Windows scaling the work area is about 1280×672 DIP, so a fixed minimum could exceed the screen and leave the window unfittable. || D636 | Local permission approvals have no automatic deadline | **Amend D005 / ADR 0011 and supersede the local tool-permission timeout clauses in the runtime and UX specs: a permission-gated `tools.execute` request remains pending in host-core, the renderer, and the transport until the user chooses Allow once, Allow for session, or Deny, or the request is cancelled / the process shuts down. Remove the 120-second countdown and timeout fields from the local permission contract. Tool-specific execution budgets and the separate RACP/Plan approval lifetimes remain unchanged. See ADR 0310, issue #1214, and E2E-017.** | A visible permission request could be missed while the user worked elsewhere; automatic denial after 120 seconds silently prevented the requested action. Keeping cancellation and execution budgets preserves control and resource safety without turning inattention into a decision. || D637 | Remove the Windows frameless resize rim | **Disable the Windows main window's thick frame while retaining Electron 43.6 native frameless edge and corner resizing. Apply a 4 DIP native rounded shape by default; authorized plugin themes may choose an integer radius from 0 to 24 DIP. Keep the D635 minimum-size contract and existing work-panel resize ownership. See ADR 0317 and E2E-167.** | The thick frame paints an unwanted left, bottom, and right rim that themes cannot remove. Native hit testing and shape keep resizing and transparent outer corners without renderer resize IPC. |-| D638 | Publish native Linux arm64 artifacts | **Amend D126 / D285 / D603 / ADR 0022: tag releases publish native Linux arm64 AppImage, deb, and rpm packages, built on GitHub's native `ubuntu-22.04-arm` runner and carrying an arm64 `pi-desktop-host-core`. The static Linux targets drop their pinned `arch` and take the workflow's `--x64` / `--arm64` flag; `linux.artifactName` becomes `PI-Desktop-<version>-linux-<arch>.AppImage`; each Linux lane disambiguates its updater feed (`latest-linux.yml` on x64, `latest-linux-arm64.yml` on arm64); the ASAR export reads `linux-unpacked` or `linux-arm64-unpacked` and publishes `PI-Desktop-<version>-linux-<arch>.asar`. `pi-host-bundle` builds both Linux architectures and `PUBLISHED_TARGETS` gains `linux-arm64`. Updater ownership, signing, and delivery modes are unchanged. See ADR 0318, issue #1281, and E2E-192a.** | arm64 Linux devices could not install or run the published x64 artifact, and a cross-built or emulated lane would ship a mismatched Rust sidecar. |+| D638 | Publish native Linux arm64 artifacts | **Amend D126 / D285 / D603 / ADR 0022: tag releases publish native Linux arm64 AppImage, deb, and rpm packages, built on GitHub's native `ubuntu-22.04-arm` runner and carrying an arm64 `pi-desktop-host-core`. The static Linux targets drop their pinned `arch` and take the workflow's `--x64` / `--arm64` flag; `linux.artifactName` becomes `PI-Desktop-<version>-linux-<arch>.AppImage`; each Linux lane verifies its architecture-named updater feed (`latest-linux.yml` on x64, `latest-linux-arm64.yml` on arm64); the ASAR export reads `linux-unpacked` or `linux-arm64-unpacked` and publishes `PI-Desktop-<version>-linux-<arch>.asar`. `pi-host-bundle` builds both Linux architectures and `PUBLISHED_TARGETS` gains `linux-arm64`. Updater ownership, signing, and delivery modes are unchanged. See ADR 0318, issue #1281, and E2E-192a.** | arm64 Linux devices could not install or run the published x64 artifact, and a cross-built or emulated lane would ship a mismatched Rust sidecar. || D450 | Signed macOS GitHub Releases | **Amend D078 / ADR 0022: GitHub tag releases Developer ID-sign, notarize (`notarytool` via electron-builder 26), staple, and Gatekeeper-verify macOS DMG/ZIP before upload, using identity `Developer ID Application: XingYu Liu (DUV63RKYTW)` / team `DUV63RKYTW` from Actions secrets (`CSC_LINK`, `CSC_KEY_PASSWORD`, `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID`). Missing secrets fail the job. Local unsigned packaging without a certificate remains. `workflow_dispatch` may set `sign_macos: false` only for unsigned debug artifacts. Packaged macOS uses in-app `electron-updater` (ZIP + merged `latest-mac.yml`); Linux deb/rpm and Windows portable ZIP stay notify-and-link. No afterPack/afterSign adhoc codesign (ADR 0278).** | Production DMGs must open without a Gatekeeper warning, and signed macOS installs can download and restart into a new tag. See ADR 0289, E2E-196c, E2E-067A. |## B. Secondary implementation defaults@@ -7367,10 +7367,12 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.`PI-Desktop-<version>-linux-arm64.AppImage`). The x64 asset is thereforerenamed from its previous version-only name; in-app updates are unaffectedbecause the updater reads the published feed.-- Each Linux lane disambiguates its updater feed before upload:- `latest-linux.yml` stays x64 and the arm64 lane renames its feed to- `latest-linux-arm64.yml`, which is the name `electron-updater` requests on- arm64. The publish job can merge both artifacts without losing a feed.+- electron-builder names each Linux feed after the architecture it built+ (`latest-linux.yml` on x64, `latest-linux-arm64.yml` on arm64), which is what+ `electron-updater` requests on those architectures, so the lanes cannot+ overwrite each other's feed and each lane verifies that name before upload+ instead of renaming it. The publish job merges both artifacts without losing+ a feed.- `scripts/export-linux-asar.mjs` takes the lane architecture and exports`PI-Desktop-<version>-linux-<arch>.asar` from `linux-unpacked` (x64) or`linux-arm64-unpacked` (arm64).diff --git a/docs/zh-CN/spec/06-delivery/06-release-runbook.md b/docs/zh-CN/spec/06-delivery/06-release-runbook.mdindex b0a040fc9..044b056e4 100644--- a/docs/zh-CN/spec/06-delivery/06-release-runbook.md+++ b/docs/zh-CN/spec/06-delivery/06-release-runbook.md@@ -223,6 +223,10 @@ DMG、ZIP、NSIS、AppImage、deb、rpm、块图和更新程序提要输出已`PI-Desktop-<version>-linux-<arch>.asar` 资产。这保留了 Linux 安装器用于以系统 Electron 下游重新打包时使用的那份确切归档。+Linux 更新源带上它们所构建的架构:x64 为 `latest-linux.yml`,arm64 为+`latest-linux-arm64.yml`。这正是 `electron-updater` 在对应架构上请求的通道文件,+因此某条通道若缺少自己的更新源,会在上传前就失败。+### 4.4 CNB 镜像触发`softprops/action-gh-release` 发布或更新 GitHub Release 之后,diff --git a/docs/zh-CN/spec/08-meta/decisions-log.md b/docs/zh-CN/spec/08-meta/decisions-log.mdindex e10887ebb..a128ee8ec 100644--- a/docs/zh-CN/spec/08-meta/decisions-log.md+++ b/docs/zh-CN/spec/08-meta/decisions-log.md@@ -35,7 +35,7 @@| D635 | 按工作区上限裁剪的 800×560 窗口最小尺寸 | **取代 D156 / D447 中的 1040×700 窗口最小尺寸(及 ADR 0029 / ADR 0238 的对应条款)和 `window/setWorkPanelChatWidth` 的 `1040..10000` 范围(ADR 0146):Electron 强制 800×560 最小尺寸,并由 `clampMinimumSizeToWorkArea` 按维度裁剪到当前显示器工作区。聊天宽度 IPC 与渲染层接受 `800..10000`。窄窗口下沿用现有 `workPanelLayout` 预算:限制停靠面板宽度以保证 MainChat 的 450px 下限,并优先收起侧边栏。见 US-UI-19 与 E2E-167。** | Windows 150% 缩放下工作区约为 1280×672 DIP,固定最小尺寸可能超过屏幕,导致窗口无法适配。 || D636 | 本地权限确认没有自动截止时间 | **修订 D005 / ADR 0011:需要权限的 `tools.execute` 请求会在 host-core、渲染层和传输中保持待处理,直到用户选择允许一次、允许会话或拒绝,或请求被取消/进程关闭。移除 120 秒倒计时以及本地权限契约中的超时字段。工具自身执行预算以及独立的 RACP/Plan 审批时限保持不变。见 ADR 0310、issue #1214 与 E2E-017。** | 用户可能在其他工作期间错过可见的权限请求;保持取消和执行预算即可保留控制与资源安全,又不会把“未注意”变成一个决定。 || D637 | 移除 Windows 无边框窗口的缩放边缘 | **关闭 Windows 主窗口的厚边框,同时保留 Electron 43.6 原生无边框窗口的边缘和角落缩放。默认应用 4 DIP 原生圆角;获得授权的插件主题可选择 0 至 24 DIP 的整数半径。保留 D635 的最小尺寸约定和现有工作面板缩放归属。见 ADR 0317 与 E2E-167。** | 厚边框绘制了主题无法移除的左、下、右边缘。原生命中检测和窗口形状在不新增渲染层缩放 IPC 的情况下保留缩放能力及透明外角。 |-| D638 | 发布原生 Linux arm64 工件 | **修订 D126 / D285 / D603 / ADR 0022:标签发布构建并发布原生 Linux arm64 的 AppImage、deb 和 rpm 包,它们在 GitHub 原生 `ubuntu-22.04-arm` 运行器上构建并携带 arm64 `pi-desktop-host-core`。静态 Linux 目标去掉固定的 `arch`,改用工作流的 `--x64` / `--arm64` 参数;`linux.artifactName` 变为 `PI-Desktop-<version>-linux-<arch>.AppImage`;每条 Linux 通道消歧自己的更新源(x64 为 `latest-linux.yml`,arm64 为 `latest-linux-arm64.yml`);ASAR 导出读取 `linux-unpacked` 或 `linux-arm64-unpacked` 并发布 `PI-Desktop-<version>-linux-<arch>.asar`。`pi-host-bundle` 构建两个 Linux 架构,`PUBLISHED_TARGETS` 增加 `linux-arm64`。更新器归属、签名和交付模式不变。见 ADR 0318、issue #1281 与 E2E-192a。** | arm64 Linux 设备无法安装或运行已发布的 x64 工件,而交叉构建或模拟的通道会随包发布架构不匹配的 Rust sidecar。 |+| D638 | 发布原生 Linux arm64 工件 | **修订 D126 / D285 / D603 / ADR 0022:标签发布构建并发布原生 Linux arm64 的 AppImage、deb 和 rpm 包,它们在 GitHub 原生 `ubuntu-22.04-arm` 运行器上构建并携带 arm64 `pi-desktop-host-core`。静态 Linux 目标去掉固定的 `arch`,改用工作流的 `--x64` / `--arm64` 参数;`linux.artifactName` 变为 `PI-Desktop-<version>-linux-<arch>.AppImage`;每条 Linux 通道校验按架构命名的更新源(x64 为 `latest-linux.yml`,arm64 为 `latest-linux-arm64.yml`);ASAR 导出读取 `linux-unpacked` 或 `linux-arm64-unpacked` 并发布 `PI-Desktop-<version>-linux-<arch>.asar`。`pi-host-bundle` 构建两个 Linux 架构,`PUBLISHED_TARGETS` 增加 `linux-arm64`。更新器归属、签名和交付模式不变。见 ADR 0318、issue #1281 与 E2E-192a。** | arm64 Linux 设备无法安装或运行已发布的 x64 工件,而交叉构建或模拟的通道会随包发布架构不匹配的 Rust sidecar。 || D450 | 签名的 macOS GitHub Release | **修订 D078 / ADR 0022:GitHub tag 发布使用身份 `Developer ID Application: XingYu Liu (DUV63RKYTW)` / 团队 `DUV63RKYTW`,通过 Actions 密钥(`CSC_LINK`、`CSC_KEY_PASSWORD`、`APPLE_ID`、`APPLE_APP_SPECIFIC_PASSWORD`、`APPLE_TEAM_ID`)对 macOS DMG/ZIP 做 Developer ID 签名、`notarytool` 公证、装订和 Gatekeeper 校验;缺少密钥则失败。无证书的本地未签名打包仍可用。`workflow_dispatch` 仅可把 `sign_macos: false` 用于未签名调试产物。打包的 macOS 走应用内 `electron-updater`(ZIP + 合并后的 `latest-mac.yml`);Linux deb/rpm 与 Windows 便携版 ZIP 仍为通知并打开发布页。禁止 afterPack/afterSign adhoc 签名(ADR 0278)。** | 正式 DMG 应无需 Gatekeeper 警告即可打开,已签名 macOS 安装可下载并重启到新 tag。见 ADR 0289、E2E-196c、E2E-067A。 |## B. 辅助实现默认值@@ -5181,9 +5181,10 @@ Markdown 源码,不是 `text/html` 负载;对禁用行内 HTML 的外部编(`PI-Desktop-<version>-linux-x64.AppImage`、`PI-Desktop-<version>-linux-arm64.AppImage`)。因此 x64 资产从之前仅带版本号的名称改名;应用内更新不受影响,因为更新器读取的是已发布的更新源。-- 每条 Linux 通道在上传前消歧自己的更新源:`latest-linux.yml` 仍是 x64,- arm64 通道把自己的更新源改名为 `latest-linux-arm64.yml`,也就是 arm64 上- `electron-updater` 请求的名称。发布作业可以合并两份工件而不丢失任何更新源。+- electron-builder 会按构建的架构为每条 Linux 通道的更新源命名(x64 为+ `latest-linux.yml`,arm64 为 `latest-linux-arm64.yml`),这正是+ `electron-updater` 在这些架构上请求的名称,因此两条通道不会互相覆盖更新源,+ 每条通道在上传前校验该名称而不是改名。发布作业可以合并两份工件而不丢失任何更新源。- `scripts/export-linux-asar.mjs` 接收通道架构,并从 `linux-unpacked`(x64)或`linux-arm64-unpacked`(arm64)导出 `PI-Desktop-<version>-linux-<arch>.asar`。- `release.yml` 的 `pi-host-bundle` 作业构建两个 Linux 架构,`PUBLISHED_TARGETS`