Repository navigation
feat(desktop): 更新渠道(正式版 / AutoBuild)、可配置更新源与先看日志的更新对话框 - #1993
Merged
Merged
Conversation
记录正式版 / 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
9 of 12 tasks
xiaoyumuxi
marked this pull request as ready for review
November 15, 2026 18:47
17 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
95f010c6c已包含在本分支,按维护者要求实现和方案放在同一个 PR。docs(agents): 提议桌面端更新渠道、可配置更新源与先看日志的更新对话框 #1983 的评审指出笔记把“私钥丢失”和“私钥泄露”混为一谈,已在92dd7a47c分开说明,见下方“文档”。PR 类型 / Type
改动说明 / What changes
背景 / Why
Viva 桌面端本来能检查、下载和安装签名更新,但发行构建没带更新源和公钥,设置 › 更新只显示“此构建未配置更新源”,用户每次都要去发布页手动下载完整安装包。另外还有四个问题:
本 PR 照 Motty 的交互和发布方式补齐,具体做法:
设计、取舍和被否方案见 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,空值表示跟随安装渠道。update.Config.Current传的是比较基准。0.0.0比较,完整下载替换。updateSources。自定义源只换下载地址,仍用内置公钥验签。updateSkipped:它不再出现绿箭头和通知,主动“检查更新”时仍显示。patchFrom,与 Motty 的patchesFor相同)。补丁失败时自动改下完整包。标题栏绿色箭头与更新对话框(
update_dialog.go、chrome_view.go、welcome_view.go、root.go、notifications.go)RGB(22, 163, 74)放在标题栏最右侧(可排列按钮之后、系统窗口按钮之前),欢迎页同一位置也有。悬停提示写出版本号;下载中外圈变成进度环。更新日志放在更新源旁边(
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)updateCard(c, full),关于页传false,只显示卡片,不显示已安装、渠道和更新源几行。共用设置与保留不认识的配置(
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保证两次发布不同时写更新源。只有这个任务拿到 secretVIVA_UPDATE_KEY,打包任务拿不到私钥。scripts/ci/desktop-release/publish-update-feed.sh(新增):desktop-update-feed发布stable.json、.sig和stable.notes.md,日志来自docs/releases/v<版本>.md。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。文档、规则、资源登记与矩阵
implemented/feature/2026-11-15-desktop-update-channels-and-dialog.md(新增,已实现)。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。shared/i18n/messages.json与中英 locale 新增更新渠道、更新源、对话框、快照和保留配置的词条(包括desktop.settings.updates.channelFollowsBuild),并提交了生成的desktop/internal/i18n/shared.generated.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)。publish-update-feed.test.mjs、package-desktop.test.mjs、package-autobuild.test.mjs。不在本 PR 范围内 / Out of scope
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,需要维护者授权后单独做。viva update-keygen生成两对 Ed25519 密钥:VIVA_UPDATE_KEY。LITHE_UPDATE_PUBLIC_KEYS是两把公钥,主钥在前,用逗号分隔:IeTFR29DkWodfNy2AdZC8DSb3x2vqRftYFLbQNbiJOQ=,YTW5fQVCx2BpKCXVFmzmx/Nf8bNZLc/rqP0Q8K3baYE=。stable.json。pending。类型专属:feat
多平台对齐
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/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节的自查命令,结果为空plugintrust_test.go的补充只用测试内联的合成插件授权UI 验证 / UI evidence
cd desktop && LITHE_VISUAL_OUTPUT_DIR=<目录> ../scripts/desktop/desktop-go.sh test -tags vivahead -run TestVisualUpdateDialog ./internal/workbench(1280×800 窗口,2x,2560×1600)cd desktop && LITHE_VISUAL_OUTPUT_DIR=<目录> ../scripts/desktop/desktop-go.sh test -tags vivahead -run TestVisualUpdatesPage ./internal/settingswindow(900×700 窗口,2x,1800×1400)63afbc4b4生成。工作台截图生成于此前的提交;63afbc4b4只改设置页渠道列表,不影响工作台。统一日志系统 / Structured logging
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
shared/i18n/补齐中英词条,运行node scripts/i18n/generate-i18n.mjs并提交生成结果,没有手改生成文件node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或豁免名单。更新日志正文由发布者编写,不翻译。逻辑归属 / Logic placement
update包(Go)。这些规则是这层调用外面的薄壳,例如wanted的结果直接作为update.Config.Current交给 Viva。单独搬进 Core 会拆开同一个判定。已建refactorIssue [Feature] 桌面端更新渠道的比较基准、日志校验、设置快照和保留未知配置规则写在 Go 客户端,未进 Rust Core #1991,由维护者决定迁入 Core,或在 develop-lithe 登记例外。性能与内存 / Performance and memory
startUpdates列出偏好目录update-snapshots/(最多 5 个文件和一个标记)。keepSettingsForSwitch在关闭窗口、交给安装器的同一步里写一份settings.json副本。viva命令只在 CI 的update-feed任务里编译,不进安装包。设置 / Settings
buildinfo解析,不来自 Core,见 [Feature] 桌面端更新渠道的比较基准、日志校验、设置快照和保留未知配置规则写在 Go 客户端,未进 Rust Core #1991。settings.json),不是外部工具配置;打开设置页不写文件。插件契约 / Plugin contract
N/A:不改插件契约、能力版本、插件函数协议或宿主方法。
发行包与资源 / Bundle and resources
update-snapshots/,下载仍在用户缓存Lithe/Updates/<版本>。./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
package-desktop.sh里的 Viva 工具编译挪到build-viva-tool.sh后,原代码已删除。refactorIssue,没有在本 PR 顺手处理:[Feature] 日志窗口偏好、目录排除规则和启动背景读取失败时静默回退默认值,未记日志 #1990、[Feature] 桌面端更新渠道的比较基准、日志校验、设置快照和保留未知配置规则写在 Go 客户端,未进 Rust Core #1991截图
基线是 0.7.0 正式版构建,发现 0.8.0 和一个 3.4 MB 的增量补丁。更新日志是测试里的示例文字。
工作台:右上角绿色箭头(欢迎页)
更新对话框:先看日志,再选“跳过此版本 / 稍后 / 下载并安装”
下载中(箭头外圈是进度环)
下载完成,“重启并更新”
正式版切到 AutoBuild 后提供的 AutoBuild 构建
设置 › 更新:有新版本,渠道列表里此构建的渠道显示为“自动(正式版)”
设置 › 更新:正式版切到 AutoBuild 前的确认
设置 › 更新:AutoBuild 回到正式版,可选恢复上次离开时的设置
设置 › 更新:正式版使用自定义更新源
验证 / Verification
除特别注明外,都在分支 HEAD
fda3375b2上运行,这是合并最新 main(#1985、#1989)之后的提交。合并时只有生成文件desktop/internal/i18n/shared.generated.go冲突,已用node scripts/i18n/generate-i18n.mjs从合并后的词条重新生成,没有手改。合并带入了 main 新固定的 Viva commit97fdbdde326b。它的update/client.go(多把公钥验签、只提供更新的版本)和cmd/viva的feed命令都和旧 pin 相同;update/install*.go改了 Windows 替换文件时备份的位置。补丁仍按清单从安装目录复制未变的文件,所以本 PR 的补丁基线不受影响。cd desktop && ../scripts/desktop/desktop-go.sh vet ./...cd desktop && ../scripts/desktop/desktop-go.sh test -count=1 ./...../scripts/desktop/desktop-go.sh test -race:store、workbench、settingswindow、logstore、plugintrust、buildinfo63afbc4b4上全部通过;合并后fda3375b2上重跑两边都改过的 settingswindow 和 workbench,通过../scripts/desktop/desktop-go.sh vet/test -tags lithe_package_info ./internal/buildinfo/...(生成的package_info.go,用后删除)63afbc4b4上通过;合并没有改动 buildinfoTestVisualUpdateDialog、TestVisualUpdatesPage(-tags vivahead)scripts/desktop/build-viva-tool.sh,然后用真实的viva feed --patch-from对两个合成版本出更新源(旧 pin;新 pin 的cmd/viva与update/补丁代码和旧 pin 相同)node --test运行publish-update-feed、package-release、package-autobuild、package-desktop四个测试node scripts/resources/test-reuse-worktree-resources.mjsactionlint:desktop-release.yml、desktop-autobuild.yml、desktop-ci.ymlshellcheck -S warning(与 CI 相同):publish-update-feed.sh、build-viva-tool.sh、package-desktop.sh、package-autobuild.sh;bash -n publish-update-feed.sh-S warning时publish-update-feed.sh:110有一条 SC2016 info,是单引号里node -e脚本的 JS 模板字符串,本来就不该被 shell 展开./scripts/desktop/verify/verify-runtime-bundle-immutability.shnode scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check./scripts/agent-notes/verify-agent-notes.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main HEAD./.agents/skills/write-stable-tests/scripts/verify-test-stability.shrg(develop-lithe 第三节)git rev-list --left-right --count origin/main...HEAD0 11:已合并最新 main,不落后未能执行的检查和原因:
update-feed任务要等本 PR 合并后的第一次发布才运行,而且至少要有两个签名版本,才能验收从旧版到新版的检查、增量补丁和安装。功能矩阵保持pending。update-feed任务:只在 Desktop Release 中运行,本 PR 不触发发布。脚本由 Node 测试和本地真实viva feed覆盖。scripts/logging/校验脚本已在仓库移除,等价检查恢复前日志门禁记为未完成;事件 ID 由TestLogEventsMatchCatalog对照目录检查。提交前确认 / Final checks
main创建,目标分支main。已用 merge commit 合并最新 main,没有 rebase 或强推。.build/、target/、dist/、.artifacts/等产物,没有凭据和个人路径。截图在单独的pr-assets/desktop-update-channelsref,不在本分支。