Skip to content

feat(desktop): 更新渠道(正式版 / AutoBuild)、可配置更新源与先看日志的更新对话框 - #1993

Merged
xiaoyumuxi merged 11 commits into
mainfrom
feat/1913-desktop-update-channels
Nov 15, 2026
Merged

xiaoyumuxi merged 11 commits into
mainfrom
feat/1913-desktop-update-channels

Conversation

@xiaoyumuxi

@xiaoyumuxi xiaoyumuxi commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

关联 Issue / Linked issue

PR 类型 / Type

  • feat:新功能或用户可见的改进

改动说明 / What changes

背景 / Why

Viva 桌面端本来能检查、下载和安装签名更新,但发行构建没带更新源和公钥,设置 › 更新只显示“此构建未配置更新源”,用户每次都要去发布页手动下载完整安装包。另外还有四个问题:

  • 用户不能在稳定版和每日构建之间选择。
  • 跨渠道直接比较 SemVer 会让 AutoBuild 用户“更新”回更旧的正式版。
  • 后台检查只弹一条“有新版本”,看不到更新内容。
  • 旧版本保存设置时会抹掉新版本写入的字段。

本 PR 照 Motty 的交互和发布方式补齐,具体做法:

  • 更新分正式版和 AutoBuild 两个渠道,更新源可配置,默认指向本仓库。
  • 有新版本时右上角出现绿色下载箭头,先看更新日志,再选“下载并安装 / 跳过此版本 / 稍后”,从不自动下载。
  • 两个渠道共用一份设置,不再有单独的 Dev 应用。旧版本读到不认识的配置时保留、不删,并提示一次。
  • 切换渠道时可以恢复离开该渠道时的设置。
  • 正式版更新源由 Desktop Release 签名发布,同一渠道的上一版可以走增量补丁。

设计、取舍和被否方案见 Agent Note .agents/notes/implemented/feature/2026-11-15-desktop-update-channels-and-dialog.md。

改动 / Changes

渠道与构建信息(desktop/internal/buildinfo/、scripts/desktop/package-desktop.sh)

  • 新增“安装渠道”:package-desktop.sh 生成 desktop/internal/buildinfo/package_info.go,写入渠道、UTC 构建时间、commit 和更新公钥(逗号分隔,支持轮换)。
    • 原有的 --stable(只有 Desktop Release 传,显示不带预览后缀的版本)现在同时表示正式版渠道;新增 --autobuild(只有 AutoBuild 工作流传),两者同时传会报错。
    • 该文件使用 lithe_package_info 构建标签,打包结束即删除,并已加入 .gitignore。viva package 不接受 -ldflags,所以不用 -X。
    • 打包时校验 LITHE_BUILD_TIME(RFC 3339 UTC)、LITHE_BUILD_COMMIT(十六进制)和公钥格式;带渠道却没有公钥时给出警告。
    • 两者都不传的本地包没有渠道:不检查更新,渠道选项置灰。
  • package-desktop.sh 里原有的 Viva 工具编译挪到新的 scripts/desktop/build-viva-tool.sh,打包和 update-feed 任务共用。
  • buildinfo/update.go:KnownChannel、ReleaseBase(0.7.0-autobuild.* → 0.7.0)、DefaultFeedURL。默认更新源是 https://github.com/1lck/Lithe-IDEA/releases/download/desktop-update-feed/{stable,autobuild}.json。

更新逻辑(desktop/internal/workbench/updates.go、update_channels.go)

  • “更新渠道”存进 settings.json 的 updateChannel,空值表示跟随安装渠道。
  • 跨渠道从不比较两个渠道的版本号:Viva update.Config.Current 传的是比较基准。
    • 同渠道:和运行版本比较,可用增量补丁。
    • 正式版 → AutoBuild,或 AutoBuild 回正式版时选“立即切换”:确认后和 0.0.0 比较,完整下载替换。
    • AutoBuild 等下一个正式版:和去掉后缀的版本比较,只有更高的正式版才算更新。
  • 下载或安装进行中不允许切换渠道或更新源。切换后丢掉上次检查结果和补丁重建的包,立即检查新渠道。
  • 更新源按渠道可改成自定义 HTTPS 地址,只有改过的渠道才写入 updateSources。自定义源只换下载地址,仍用内置公钥验签。
  • 跳过的版本按渠道记入 updateSkipped:它不再出现绿箭头和通知,主动“检查更新”时仍显示。
  • Windows NSIS 安装版复用同一平台 zip 的增量补丁(patchFrom,与 Motty 的 patchesFor 相同)。补丁失败时自动改下完整包。

标题栏绿色箭头与更新对话框(update_dialog.go、chrome_view.go、welcome_view.go、root.go、notifications.go)

  • 绿色箭头 RGB(22, 163, 74) 放在标题栏最右侧(可排列按钮之后、系统窗口按钮之前),欢迎页同一位置也有。悬停提示写出版本号;下载中外圈变成进度环。
  • 后台检查发现新版本:同一版本只通知一次,带“查看更新内容”按钮。不弹对话框,也不自动下载。
  • 对话框内容:
    • 标题是版本号;副标题是当前版本、渠道和下载大小,有补丁时同时显示增量和完整大小。
    • 正文是 Markdown 日志,限高可滚动;底部有“在 GitHub 查看完整说明”。
    • 按钮是“跳过此版本 / 稍后 / 下载并安装”,下载完成后主按钮变为“重启并更新”。
    • deb/rpm 管理的安装和不可写的安装目录,主按钮改为“打开下载页面”并说明原因。

更新日志放在更新源旁边(update_notes.go)

  • stable.json 旁是 stable.notes.md,autobuild.json 旁是 autobuild.notes.md,日志本身不签名。
  • 第一行 <!-- lithe-update-notes version=… --> 必须与已验签的版本一致才显示正文。客户端最多读 16 KB,按 UTF-8 字符边界截断,在后台 goroutine 读取。
  • 日志取不到时对话框照常显示版本、大小和按钮。

设置 › 更新(desktop/internal/settingswindow/updates_view.go、controller.go、window.go、about_view.go)

  • 新增“已安装”一行,显示此构建的渠道、构建时间和 commit。
  • 关于页和设置页共用更新卡片:updateCard(c, full),关于页传 false,只显示卡片,不显示已安装、渠道和更新源几行。
  • 更新渠道列表中,此构建自己的渠道显示为“自动(正式版)”或“自动(AutoBuild)”,选它即不保存选择、跟随构建;另一个渠道只显示名称,选中即显式切换。
  • 选另一个渠道前先确认:
    • 正式版 → AutoBuild:“切换到 AutoBuild?”,说明它未经发布测试、会完整替换当前构建。
    • AutoBuild → 正式版:“切回正式版?”,可选“等下一个正式版”(显示“正式版发布 x.y.z 之后的版本时切回正式版”)或“立即切换”(安装正式版现在的最新版本,可能比当前构建旧)。
    • 有该渠道的快照时,确认里可勾选“恢复上次使用<渠道>时的设置”;不勾选就继续用当前设置。
  • 下载或安装期间渠道和发布源不能修改,并说明原因。
  • 每个渠道一行发布源,默认显示“默认(1lck/Lithe-IDEA)”,可改成自定义 HTTPS 地址后保存,或恢复默认。
  • 设置页的“查看更新内容”打开同一个更新对话框。

共用设置与保留不认识的配置(desktop/internal/store/、settings_kept.go、update_snapshots.go)

  • store/keep.go:读取时按目标类型的 JSON 字段(含嵌套对象和字符串键 map)找出当前版本没有的键,以及字段存在但形状读不了的值,保存时原样合并回去。
    • 当前版本改过或清空的字段以当前版本为准,不会被旧值“复活”。
    • 所有经 store.Save 保存的文件都受益。
  • Store.Unread 返回读不了的值的解码错误,调用方照旧记日志:
    • 设置和标题栏布局记 app.settings.decode_failed,编辑器会话记 editor_session_load。
    • 日志目录(logstore)和插件授权(plugintrust)读不了时仍按读取失败处理,不读一半。
  • 读到新版本写的键时每组键只通知一次(settings_kept.go)。
  • 切换渠道前把 settings.json 原始字节存到偏好目录 update-snapshots/<渠道>-<版本>-<UTC 时间>.json,只留 5 份。
    • 要恢复时,由新构建在下次启动、读设置前复制回来,只保留当前的更新设置。
    • 快照不写安装目录。

发布流水线

  • .github/workflows/desktop-release.yml:
    • prepare 记录统一构建时间。打包任务拿到 LITHE_BUILD_TIME、LITHE_BUILD_COMMIT 和仓库变量 LITHE_UPDATE_PUBLIC_KEYS(公钥)。
    • 新增 update-feed 任务:在 publish 之后运行,并发组 desktop-update-feed-stable 保证两次发布不同时写更新源。只有这个任务拿到 secret VIVA_UPDATE_KEY,打包任务拿不到私钥。
  • scripts/ci/desktop-release/publish-update-feed.sh(新增):
    • 在固定 tag desktop-update-feed 发布 stable.json、.sig 和 stable.notes.md,日志来自 docs/releases/v<版本>.md。
    • 没有私钥时跳过,不让发布失败;更新源已经提供更新的版本时不动它。
    • 增量补丁照 Motty 的 tools/mirror-release.sh:以当前 stable.json 提供的版本为基线,逐个平台下载旧归档,同时对照更新源摘要和发布页的 .sha256,再交给 viva feed --patch-from <os>/<arch>=<版本>=<旧归档>。对不上的平台只发完整包。
  • scripts/desktop/build-viva-tool.sh(新增):从 desktop/go.mod 的 replace 编译 viva 命令,不用 go run …/cmd/viva@<版本>(会绕过 fork 固定)。
  • .github/workflows/desktop-autobuild.yml 和 scripts/ci/desktop-autobuild/package-autobuild.sh:AutoBuild 包传 --autobuild,并带上构建时间、commit 和公钥。
  • .github/workflows/desktop-ci.yml:publish-update-feed.sh 和 build-viva-tool.sh 加入 bash -n 与 ShellCheck,新增 publish-update-feed.test.mjs。

文档、规则、资源登记与矩阵

  • Agent Note:
    • implemented/feature/2026-11-15-desktop-update-channels-and-dialog.md(新增,已实现)。
      • 决策第 7 节分开写了签名私钥丢失和泄露的处理。客户端接受任何一把内置公钥签的更新源,没有吊销机制,只提供更新的版本(Viva update/client.go)。
      • 丢失不构成安全风险:改用离线备用钥签名;没有备用钥时,用户只能手动重装。
      • 泄露时,还没升级的客户端会接受伪造的“新版本”。处理方法是删掉泄露的公钥、用剩下的钥签发新版本,并发布手动升级、恢复默认源的公告。只加新公钥不会撤销旧钥。
    • proposed/feature/2026-11-16-desktop-autobuild-update-feed.md(新增,AutoBuild 更新源方案)。
  • .agents/skills/release-lithe/SKILL.md:发布时检查 update-feed 任务、VIVA_UPDATE_KEY 与 LITHE_UPDATE_PUBLIC_KEYS、离线备用钥和泄露时的撤换步骤,以及发布说明会作为对话框里的更新内容。
  • docs/ci-builds.md:更新源发布一节(含备用钥、丢失与泄露的处理),以及独立工作树里的两个生成物说明。
  • scripts/resources/worktree-resources.json:登记 desktop-package-build-info 和 desktop-viva-tool,都是 reusable: false(打包时生成、与工具链和 fork commit 绑定,不跨工作树共享)。test-reuse-worktree-resources.mjs 覆盖这两项被拒绝复用。
  • 功能矩阵:
    • updates-check-download.json、updates-failure-rollback.json、application-settings.json 更新了证据和说明。
    • verificationStatus 保持 pending。
  • i18n:shared/i18n/messages.json 与中英 locale 新增更新渠道、更新源、对话框、快照和保留配置的词条(包括 desktop.settings.updates.channelFollowsBuild),并提交了生成的 desktop/internal/i18n/shared.generated.go。

测试

  • 新增 Go 测试:
    • update_channels_test.go、update_dialog_test.go、settings_kept_test.go、store/keep_test.go、updates_view_test.go。
    • updates_test.go、about_view_test.go、logstore/writer_test.go、plugintrust/plugintrust_test.go 也有补充。
    • logevents_test.go 确认只使用目录里已有的日志事件。
  • 无头截图测试 update_dialog_visual_test.go、updates_visual_test.go(-tags vivahead)。
  • Node 测试 publish-update-feed.test.mjs、package-desktop.test.mjs、package-autobuild.test.mjs。

不在本 PR 范围内 / Out of scope

  • AutoBuild 更新源的发布。 客户端已按渠道检查 autobuild.json,但 Viva 的 viva feed 拒绝预发布版本号,而当前 AutoBuild 包沿用 viva.toml 的版本号。因此 autobuild.json 还不存在:AutoBuild 用户的自动检查失败时不打扰,手动检查会显示取不到更新源。在这之前 AutoBuild 用户仍需手动下载。方案见 .agents/notes/proposed/feature/2026-11-16-desktop-autobuild-update-feed.md:在 Lithe-IDEA/viva fork 修改清单格式并向上游提 PR,需要维护者授权后单独做。
  • 仓库设置(已于 2026-11-16 配置,不属于代码改动)。 用本 PR 固定的 viva update-keygen 生成两对 Ed25519 密钥:
    • 主私钥已存为 Actions secret VIVA_UPDATE_KEY。
    • 备用私钥由维护者离线保存,不在 GitHub。
    • 仓库变量 LITHE_UPDATE_PUBLIC_KEYS 是两把公钥,主钥在前,用逗号分隔:IeTFR29DkWodfNy2AdZC8DSb3x2vqRftYFLbQNbiJOQ=,YTW5fQVCx2BpKCXVFmzmx/Nf8bNZLc/rqP0Q8K3baYE=。
    • 私钥不进仓库。本 PR 合并后,第一次 Desktop Release 会带上这两把公钥,并签发 stable.json。
  • 真实安装的更新验收。 需要完成一次带密钥的 Desktop Release 后,才能在 macOS 和 Windows 实际安装上检查、下载(含增量补丁)和安装;功能矩阵相应保持 pending。
  • 迁入 Rust Core 的决定([Feature] 桌面端更新渠道的比较基准、日志校验、设置快照和保留未知配置规则写在 Go 客户端,未进 Rust Core #1991),以及其他读取失败静默回退默认值的地方([Feature] 日志窗口偏好、目录排除规则和启动背景读取失败时静默回退默认值,未记日志 #1990)。

类型专属:feat

多平台对齐

  • 两端都具备:更新器、对话框、设置页和 store 都是 macOS 与 Windows 共用的 Viva Go 代码(desktop/internal/**);Windows 专属的 NSIS 复用 zip 补丁(patchFrom)有单测覆盖。Windows 尚未在本机虚拟机上原生验证,见“验证”。

范围检查 / Scope checks

功能矩阵 / Feature matrix

  • 已更新 shared/platform-feature-matrix/features/updates-check-download.json、updates-failure-rollback.json、application-settings.json。证据路径和说明如实填写;没有实机验收,两端 verificationStatus 保持 pending。
  • 已运行 ./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh 和 ./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD
  • 没有提交 .artifacts/ 下生成的矩阵视图
  • [N/A] 没有更新矩阵的理由:已更新矩阵

插件归属 / Plugin ownership

  • 已在仓库根目录运行 develop-lithe 第三节的自查命令,结果为空
  • 新增或修改的测试不涉及具体插件;plugintrust_test.go 的补充只用测试内联的合成插件授权
  • 没有为具体插件提供的能力新建或更新宿主功能矩阵条目
  • 插件文案、构建步骤和资源路径都没有写进宿主
  • [N/A] 修改了通用扩展点:本 PR 不改插件扩展点

UI 验证 / UI evidence

统一日志系统 / Structured logging

  • 只复用固定 Core 修订目录里已有的事件:app.action.performed、app.notification.operation_failed、app.background.operation_failed、app.settings.decode_failed。没有新事件 ID,不需要 Core PR;没有 NSLog、print 或直接写 stderr。logevents_test.go(TestLogEventsMatchCatalog)覆盖。
  • 一个操作只有一条终态,错误只在处理它的边界记录一次。读不了的存储值只在读取时记一次;更新检查失败沿用原有的后台失败路径。
  • 没有记录设置内容、更新日志正文、环境变量或凭据;错误以 error 类型记录。
  • 旧日志校验脚本(scripts/logging/)已移除,“验证”一节写明日志门禁未完成。

界面文案 / i18n

  • 宿主文案都走共享 i18n:在 shared/i18n/ 补齐中英词条,运行 node scripts/i18n/generate-i18n.mjs 并提交生成结果,没有手改生成文件
  • [N/A] 插件提供的文字:本 PR 不涉及插件文案
  • 已运行 node scripts/i18n/verify-app-language-localization.mjs 和 node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或豁免名单。更新日志正文由发布者编写,不翻译。

逻辑归属 / Logic placement

  • 可共享的逻辑在 Rust Core:没有。渠道比较基准、日志首行校验与截断、快照命名与保留、保留未知配置这几条规则写在 Go,原因见下一项。
  • 不迁的理由:Viva 是 macOS、Windows 和 Linux 的唯一客户端;验签、版本比较、下载、补丁和安装都复用 Viva 的 update 包(Go)。这些规则是这层调用外面的薄壳,例如 wanted 的结果直接作为 update.Config.Current 交给 Viva。单独搬进 Core 会拆开同一个判定。已建 refactor Issue [Feature] 桌面端更新渠道的比较基准、日志校验、设置快照和保留未知配置规则写在 Go 客户端,未进 Rust Core #1991,由维护者决定迁入 Core,或在 develop-lithe 登记例外。
  • 没有按工具名加分支

性能与内存 / Performance and memory

  • 不新增后台轮询:更新检查沿用原有的“启动 5 秒后、之后每小时”,窗口在后台时推迟。日志只在发现新版本后读取一次,上限 16 KB;快照最多 5 份;对话框只在打开时构建。
  • 主线程没有文件读写:有两处小的例外,请 reviewer 判断。
    • 启动时 startUpdates 列出偏好目录 update-snapshots/(最多 5 个文件和一个标记)。
    • 切换渠道安装时,keepSettingsForSwitch 在关闭窗口、交给安装器的同一步里写一份 settings.json 副本。
    • 日志读取在后台 goroutine。
  • [N/A] 性能基线:不涉及启动、打开项目、输入、滚动、大文件、长输出或搜索;不新增运行时或依赖。viva 命令只在 CI 的 update-feed 任务里编译,不进安装包。

设置 / Settings

  • 难以理解的项有 ⓘ;继承值显示为“自动(实际生效值)”:已显示。此构建自己的渠道写作“自动(正式版)”或“自动(AutoBuild)”,发布源默认值写作“默认(1lck/Lithe-IDEA)”;渠道、自动检查和发布源都有 ⓘ 说明。但括号里的值由 Go 的 buildinfo 解析,不来自 Core,见 [Feature] 桌面端更新渠道的比较基准、日志校验、设置快照和保留未知配置规则写在 Go 客户端,未进 Rust Core #1991。
  • [N/A] 非敏感的工具配置读取并回显真实来源:这些是 Lithe 自身的设置(settings.json),不是外部工具配置;打开设置页不写文件。
  • [N/A] 新增或移动 macOS 设置页:没有新增或移动设置页,只修改已有的“更新”页

插件契约 / Plugin contract

N/A:不改插件契约、能力版本、插件函数协议或宿主方法。

发行包与资源 / Bundle and resources

  • 运行时不向 app bundle 或 Windows 安装目录写入:
    • 设置快照和待恢复标记写偏好目录 update-snapshots/,下载仍在用户缓存 Lithe/Updates/<版本>。
    • 生命周期和所有权写在 Note 第 5 节。
    • 已运行 ./scripts/desktop/verify/verify-runtime-bundle-immutability.sh。
  • 新增的两个构建生成物都已登记,reusable: false,不需要新的校验路由:
    • desktop/internal/buildinfo/package_info.go,打包时生成、打包后删除。
    • viva 工具,从 fork commit 编译。
    • 已同步 scripts/resources/worktree-resources.json、test-reuse-worktree-resources.mjs 和 docs/ci-builds.md。

无用代码与重构 / Dead code and refactoring


截图

基线是 0.7.0 正式版构建,发现 0.8.0 和一个 3.4 MB 的增量补丁。更新日志是测试里的示例文字。

工作台:右上角绿色箭头(欢迎页)

深色 · 简体中文 Light · English

更新对话框:先看日志,再选“跳过此版本 / 稍后 / 下载并安装”

深色 · 简体中文 Light · English

下载中(箭头外圈是进度环)

深色 · 简体中文 Light · English

下载完成,“重启并更新”

深色 · 简体中文 Light · English

正式版切到 AutoBuild 后提供的 AutoBuild 构建

深色 · 简体中文 Light · English

设置 › 更新:有新版本,渠道列表里此构建的渠道显示为“自动(正式版)”

深色 · 简体中文 Light · English

设置 › 更新:正式版切到 AutoBuild 前的确认

深色 · 简体中文 Light · English

设置 › 更新:AutoBuild 回到正式版,可选恢复上次离开时的设置

深色 · 简体中文 Light · English

设置 › 更新:正式版使用自定义更新源

深色 · 简体中文 Light · English

验证 / Verification

除特别注明外,都在分支 HEAD fda3375b2 上运行,这是合并最新 main(#1985、#1989)之后的提交。合并时只有生成文件 desktop/internal/i18n/shared.generated.go 冲突,已用 node scripts/i18n/generate-i18n.mjs 从合并后的词条重新生成,没有手改。合并带入了 main 新固定的 Viva commit 97fdbdde326b。它的 update/client.go(多把公钥验签、只提供更新的版本)和 cmd/viva 的 feed 命令都和旧 pin 相同;update/install*.go 改了 Windows 替换文件时备份的位置。补丁仍按清单从安装目录复制未变的文件,所以本 PR 的补丁基线不受影响。

命令或操作 平台 结果
cd desktop && ../scripts/desktop/desktop-go.sh vet ./... macOS arm64 通过
cd desktop && ../scripts/desktop/desktop-go.sh test -count=1 ./... macOS arm64 57 个包 ok,0 失败
../scripts/desktop/desktop-go.sh test -race:store、workbench、settingswindow、logstore、plugintrust、buildinfo macOS arm64 6 个包在 63afbc4b4 上全部通过;合并后 fda3375b2 上重跑两边都改过的 settingswindow 和 workbench,通过
../scripts/desktop/desktop-go.sh vet/test -tags lithe_package_info ./internal/buildinfo/...(生成的 package_info.go,用后删除) macOS arm64 在 63afbc4b4 上通过;合并没有改动 buildinfo
无头截图 TestVisualUpdateDialog、TestVisualUpdatesPage(-tags vivahead) macOS arm64 生成 18 张截图并检查,见上
scripts/desktop/build-viva-tool.sh,然后用真实的 viva feed --patch-from 对两个合成版本出更新源(旧 pin;新 pin 的 cmd/viva 与 update/ 补丁代码和旧 pin 相同) macOS arm64 接受参数并签名;darwin 和 windows 的 zip 生成补丁,NSIS 没有补丁(客户端改用 zip 补丁);用后删除临时密钥
node --test 运行 publish-update-feed、package-release、package-autobuild、package-desktop 四个测试 macOS 27/27 通过
node scripts/resources/test-reuse-worktree-resources.mjs macOS 34/34 通过
actionlint:desktop-release.yml、desktop-autobuild.yml、desktop-ci.yml macOS 无问题
shellcheck -S warning(与 CI 相同):publish-update-feed.sh、build-viva-tool.sh、package-desktop.sh、package-autobuild.sh;bash -n publish-update-feed.sh macOS 无问题。不加 -S warning 时 publish-update-feed.sh:110 有一条 SC2016 info,是单引号里 node -e 脚本的 JS 模板字符串,本来就不该被 shell 展开
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh macOS(静态检查覆盖 macOS 与 Windows 源码) 通过
node scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check macOS 通过(中英各 11306/11306)
./scripts/agent-notes/verify-agent-notes.sh macOS 160 份 Note 通过
./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main HEAD macOS 193 项通过;变更门禁通过
./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh macOS 通过
插件归属自查 rg(develop-lithe 第三节) macOS 结果为空
git rev-list --left-right --count origin/main...HEAD — 0 11:已合并最新 main,不落后

未能执行的检查和原因:

  • 真实安装的检查、下载、增量补丁和安装(macOS 与 Windows):密钥已经配置,但还没有发布过带更新源的 Desktop Release。update-feed 任务要等本 PR 合并后的第一次发布才运行,而且至少要有两个签名版本,才能验收从旧版到新版的检查、增量补丁和安装。功能矩阵保持 pending。
  • Windows 本机虚拟机:未运行。Windows 代码路径(NSIS 复用 zip 补丁、安装目录不可写)只有 macOS 上的单测覆盖。
  • CI 的 update-feed 任务:只在 Desktop Release 中运行,本 PR 不触发发布。脚本由 Node 测试和本地真实 viva feed 覆盖。
  • 日志门禁:旧 scripts/logging/ 校验脚本已在仓库移除,等价检查恢复前日志门禁记为未完成;事件 ID 由 TestLogEventsMatchCatalog 对照目录检查。

提交前确认 / Final checks

  • 分支从 main 创建,目标分支 main。已用 merge commit 合并最新 main,没有 rebase 或强推。
  • 以 Draft 提交,本地验证通过后才标记 ready
  • 没有无关改动,没有提交 .build/、target/、dist/、.artifacts/ 等产物,没有凭据和个人路径。截图在单独的 pr-assets/desktop-update-channels ref,不在本分支。
  • 本次构建、测试或预览启动的 Lithe 应用和子进程已全部关闭,没有进程残留

记录正式版 / AutoBuild 双渠道、默认指向官方仓库且可改的签名更新源、
Motty 同款标题栏绿色下载箭头与“先显示更新日志再选择下载/跳过/稍后”的
更新对话框、不保留 Dev 身份的共用设置(保留不认识的配置并提示、切换渠道
可恢复设置快照),以及 Viva fork、store、桌面端和发布流水线的落地顺序。

Refs #1913
Motty 0.4.10 uses the Viva update package with a signed feed and fetches
the release notes separately after the check. Do the same: notes live
beside each feed with a version header, so no Viva fork change and no
Client.Latest are needed; cross-channel checks override Config.Current.
Patches come from the previous build, as Motty's mirror-release.sh does.

Refs #1913
正式版和 AutoBuild 共用一个 settings.json。store.Save 以前按当前版本的
结构体重写整个文件,较新版本写入的字段、或形状变了的值,换到较旧版本
保存一次就丢了;值形状不对时 Load 还会整体失败、回落默认设置。

- store.Load 按目标类型遍历文件,记住没有字段读取的键和解码不了的值;
  Save 把它们合并回去。当前版本自己改过或清空的字段以当前值为准,
  被删掉的对象不会带回里面的键。
- 首个窗口启动时,如有不认识的配置,提示一次(数量和前五个键名),
  同一组键不再重复提示。提示在恢复背景之后再保存,不会清掉背景设置。

Refs #1913
- Two channels, stable and AutoBuild, each with a configurable feed that
  defaults to the 1lck/Lithe-IDEA release feed. The installed channel is the
  default; the user's switch, "switch now" and "restore" choices are saved.
- Switching compares the other channel's feed with a version of its own
  (0.0.0, or the release AutoBuild is building towards when waiting), forgets
  the last check, and never runs during a download or install. Cross-channel
  releases install in full.
- Skip This Version per channel; the arrow and notice stay away until a newer
  version arrives. A check the user asks for still finds it.
- Release notes are read unsigned from <feed>.notes.md after the signed
  check, need a matching version header, and are cut at 16 KB.
- Moving to the other channel keeps settings.json in update-snapshots in the
  preferences directory (5 newest kept); a restore is applied by the next
  launch of exactly that channel and version, keeping the update settings.
- Installs that cannot replace themselves say why and offer the downloads page.

Refs #1913
… first

The start screen and a project's title bar show a green arrow at the top
right once a check finds a version: a ring fills while it downloads and a
badge marks it ready. The arrow opens a dialog that shows the release notes
before anything downloads, with Download, Skip This Version and Later; the
download size names the delta patch next to the full archive. While it
downloads the dialog follows the progress with Cancel, and once downloaded
its title says the version is ready and it offers Restart.

Settings > Updates gains the channel list, the feed of the chosen channel
with Save, a link back to the default feed under a custom one, the build's
channel, time and commit, and View Changes. Picking AutoBuild on a stable
build asks first; going back to stable from AutoBuild offers to wait for the
next stable release or switch now, and to restore the settings kept from
the last time on stable.

Headless captures of both cover the dark Chinese and light English scenes
(-tags vivahead with LITHE_VISUAL_OUTPUT_DIR).

Refs #1913
store.Load keeps a value whose stored shape this version cannot decode
and Save writes it back, so the value survives a downgrade. Until now
nothing said so: the setting quietly ran on its default.

- Store.Unread(name) returns the decode error of the values it kept for
  that file, or nil.
- Settings and the title bar layout log app.settings.decode_failed, the
  editor session logs editor_session_load; the rest still loads.
- The log directory and the plugin approvals fail their read as before
  instead of silently using the default or leaving a plugin unapproved.

Refs #1913
…patches

Follows Motty: the release builds a signed feed with viva feed, puts the
release notes beside it unsigned, and lists patches from the previous
version the feed offers.

- package-desktop.sh takes --stable or --autobuild and writes
  package_info.go for the lithe_package_info build tag (viva package takes
  no -ldflags): channel, build time, commit and LITHE_UPDATE_PUBLIC_KEYS.
  It removes the file once it has packaged.
- The release workflow gains an update-feed job. Only that job gets the
  VIVA_UPDATE_KEY secret. publish-update-feed.sh builds stable.json, its
  .sig and stable.notes.md from docs/releases/v<version>.md, with patches
  from the version the published feed offers, and uploads them to the
  desktop-update-feed release. A feed that already offers a later version
  is left alone; runs share the desktop-update-feed-stable concurrency
  group.
- build-viva-tool.sh builds the viva CLI from the pinned fork through
  desktop/go.mod, so the replace applies.
- viva feed lists patches on the archives only, so an NSIS installation
  uses the patch of the zip for its OS and architecture; the patch is
  checked against the installed files either way.
- AutoBuild packages pass --autobuild. Its feed is not published yet:
  Viva's manifest refuses pre-release versions (proposed note
  2026-11-16-desktop-autobuild-update-feed).
- Worktree resource manifest, docs/ci-builds.md and release-lithe list
  the viva tool, the secret and the variable.

Refs #1913
- Move 2026-11-15-desktop-update-channels-and-dialog to implemented and
  record what shipped: channels and sources, the arrow and dialog, notes
  beside the feed, deltas with the NSIS zip patch, kept settings and
  snapshots.
- Propose 2026-11-16-desktop-autobuild-update-feed: the Viva fork accepts
  SemVer pre-release versions in the manifest so AutoBuild can publish its
  own signed feed.
- Feature matrix: updates-check-download, updates-failure-rollback and
  application-settings gain the evidence, notes and test commands. They
  stay partial and pending until verified on real installs.

Refs #1913
…nel>)

Picking the build's own channel saves no choice: updates follow the build.
The list showed it by its plain name, the same as an explicit switch, so the
inherited value and an explicit one looked alike. Its entry now reads
"自动(正式版)" / "Automatic (Stable)" through a new shared i18n entry, and
the other channel keeps its plain name, as develop-lithe's "show the
effective value" rule asks.
Viva 客户端接受任何一把内置公钥签的更新源,没有吊销机制,只提供比当前版本新的版本。
原来的笔记把两种情况混在一起,写成“私钥丢失会让所有客户端停在旧版本”。

- 丢失:签不了新更新源,没有安全风险;用离线备用钥继续签名,没有备用钥只能手动重装。
- 泄露:仍内置旧公钥的客户端会接受伪造的“新版本”;只加新公钥不会撤销旧钥。
  要删掉泄露的公钥、用剩下的钥签发新版本,并发布手动升级和恢复默认源的公告。
- 配置时就生成离线备用钥,两把公钥都写进 LITHE_UPDATE_PUBLIC_KEYS。

同步 release-lithe Skill 和 docs/ci-builds.md。回应 #1983 的评审意见。
…ate-channels

# Conflicts:
#	desktop/internal/i18n/shared.generated.go
@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Nov 15, 2026
@xiaoyumuxi
xiaoyumuxi marked this pull request as ready for review November 15, 2026 18:47
@xiaoyumuxi
xiaoyumuxi merged commit 51c294b into main Nov 15, 2026
9 of 16 checks passed
@1lck 1lck mentioned this pull request Nov 15, 2026
17 tasks done
@xiaoyumuxi
xiaoyumuxi deleted the feat/1913-desktop-update-channels branch November 20, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant