Skip to content

docs(agents): 提议桌面端更新渠道、可配置更新源与先看日志的更新对话框 - #1983

Closed
xiaoyumuxi wants to merge 1 commit into
mainfrom
docs/1913-desktop-update-channels
Closed

xiaoyumuxi wants to merge 1 commit into
mainfrom
docs/1913-desktop-update-channels

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Collaborator

关联 Issue / Linked issue

PR 类型 / Type

  • feat:新功能或用户可见的改进
  • fix:缺陷修复
  • docs:文档、Agent Note、Skill 等规则文件
  • release:稳定版发布准备

改动说明 / What changes

背景 / Why

Viva 桌面端已经实现应用内更新和增量更新,但没有发行构建注入更新源,设置 → 更新永远显示“此构建未配置更新源”。在接上发布流水线(#1913)之前,需要先定下来几件事:

  • 正式版和 AutoBuild 两个渠道怎么切换。
  • 更新源怎么配置。
  • 更新时界面怎么提示。
  • 两个渠道怎么共用设置。

本 PR 只提交方案 Note,不改代码。界面设计稿会单独发给维护者审核,审核通过后再按 Note 的落地顺序分 PR 实现。

改动 / Changes

  • 新增提案 Note .agents/notes/proposed/feature/2026-11-15-desktop-update-channels-and-dialog.md,内容包括:
    • 双渠道:区分“安装渠道”(打包时写入,只读)和“更新渠道”(用户选择,默认跟随安装渠道)。AutoBuild 版本号改为 <版本>-autobuild.<UTC 时间>。跨渠道切换从不比较完整版本号,并给出切换规则表。为此需要 Viva fork 增加 Client.Latest。
    • 可配置更新源:默认地址指向 1lck/Lithe-IDEA 的 desktop-update-feed 滚动 tag,写在代码里。用户可以按渠道改成镜像地址,但仍用内置公钥验签。
    • 更新交互(照 Motty):
      • 发现新版本时,标题栏右上角出现绿色下载箭头,同一版本只通知一次,不自动下载。
      • 点开后先显示更新日志,再选择“下载并安装 / 跳过此版本 / 稍后”。
      • 下载中箭头显示进度,下载完成后可以重启更新。
      • 不能自更新的安装改为打开下载页面,并说明原因。
    • 更新日志来源:Viva 更新源增加签名范围内的 notes 字段。正式版取发布说明,AutoBuild 由提交记录生成。
    • 不保留 Dev 身份,共用设置:
      • 记录 desktop/internal/store 保存时会抹掉不认识字段的现有缺陷,以及“保留不认识的配置并提示一次”的修法。
      • 跨渠道安装前保存设置快照,切回时可以选择恢复。
    • 发布端与落地顺序:4 个 PR,依次是 Viva fork、store、桌面端更新、发布流水线([Feature] 发布流程生成签名更新源与增量补丁,并在发行构建中注入更新源 #1913)。同时列出风险:macOS 版本字符串、私钥保管、fork 分歧、Core 日志事件依赖、AutoBuild 增量补丁。

不在本 PR 范围内 / Out of scope


类型专属:docs

  • 只改文档、Agent Note、Skill、入口文件等,没有产品代码的行为变化(有则改选 feat 或 fix)
  • 长期决策、取舍和约束写在 .agents/notes/(中文),docs/ 只保留操作说明、正式 schema、发布说明和验收材料;改了 Note 已运行 ./scripts/agent-notes/verify-agent-notes.sh
  • 规则只在真源(Skill、Note)里写一份,入口文件只留指针,没有复制出会漂移的第二份
  • 文中的路径、命令、链接已核对真实存在
  • [N/A] 涉及插件契约或宿主方法的,已完成下方“插件契约”一组:不涉及插件契约

范围检查 / Scope checks

功能矩阵 / Feature matrix

N/A:只提交提案 Note,没有宿主能力变化;功能矩阵在桌面端实现 PR 中更新。

插件归属 / Plugin ownership

N/A:不涉及插件。

UI 验证 / UI evidence

N/A:不改界面代码。设计稿会单独审核,实现 PR 再附无头截图。

统一日志系统 / Structured logging

N/A:不改代码。Note 已写明新日志事件需要先在 Core 日志目录声明。

界面文案 / i18n

N/A:不新增界面文案。

逻辑归属 / Logic placement

N/A:不改代码。Note 说明了更新器留在 desktop/ Go 代码、复用上游 Viva update 包的理由。

性能与内存 / Performance and memory

N/A:不改代码。

设置 / Settings

N/A:不改设置页。Note 中的设置行按“标签、ⓘ、控件、状态标签”设计,“默认”显示实际生效的地址。

插件契约 / Plugin contract

N/A:不涉及插件契约或宿主方法。

发行包与资源 / Bundle and resources

N/A:不改资源。Note 规定设置快照只写用户数据目录。

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

N/A:不改代码。store 丢弃未知字段是缺陷,不是重构债,在 store 修复 PR 中按缺陷流程处理。


验证 / Verification

命令或操作 平台 结果
./scripts/agent-notes/verify-agent-notes.sh macOS 通过:ok: 158 active Agent Note(s) verified
核对 Note 中的代码路径、脚本路径和相对链接 macOS 均存在

未能执行的检查和原因: 无。只改了 Note,不涉及构建和测试。

提交前确认 / Final checks

  • 分支从最新的 main 创建;目标分支:feat、fix、docs 为 main,release 以发布流程要求为准
  • 以 Draft 提交,本地验证通过后才标记 ready
  • 没有无关改动,没有提交 .build/、target/、dist/、.artifacts/ 等产物,没有凭据、个人路径和未脱敏的日志或截图
  • 本次构建、测试或预览启动的 Lithe 应用和子进程已全部关闭,没有进程残留(本次没有启动应用)

🤖 Generated with Claude Code

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

Refs #1913

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Nov 15, 2026

@lithe-support lithe-support Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lithe Review

发现一处签名密钥风险描述需要修正,见行内评论。其余审查范围为本次提案,不代表更新功能已实现或通过验收。

实际检查: Linux / Node 24.22.1 下使用仓库 Note 校验逻辑的单文档入口检查了结构、相对链接及适用路径,7 个路径在该 head 均存在。另用本地 Ed25519 合成签名实验验证了私钥泄露后的验签前提。未执行全仓库 Note 校验或真实更新链测试;本 PR 仅为设计文档。

## 风险

- **macOS 版本字符串**:Viva 的 macOS 安装器要求包内 `CFBundleShortVersionString` 与更新源版本一致。如果打包或安装器不接受带预发布后缀的版本,需要在 fork 里改为比较基础版本加构建号,并同步上游。
- **私钥丢失或泄露**:所有已安装的客户端都会停在旧版本。私钥必须备份;客户端支持多把公钥,可以轮换。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里把私钥丢失和泄露的后果混在一起了。丢失可能导致无法继续签发更新;泄露则不会让客户端自动停在旧版本:仍信任旧公钥的客户端会接受对应私钥生成的签名,攻击者若还能控制更新源或镜像,就可能投递伪造更新。仅增加新公钥也不会撤销旧公钥。建议分别说明丢失后的恢复,以及泄露后的旧钥撤销、客户端信任更新和必要的人工升级方案。

xiaoyumuxi added a commit that referenced this pull request Nov 15, 2026
Viva 客户端接受任何一把内置公钥签的更新源,没有吊销机制,只提供比当前版本新的版本。
原来的笔记把两种情况混在一起,写成“私钥丢失会让所有客户端停在旧版本”。

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

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

Copy link
Copy Markdown
Collaborator Author

这个 Draft 只有方案提议。按维护者要求,方案和实现放在同一个 PR:提议提交 95f010c6c 已包含在 #1993 中。那里的 Agent Note 已从 proposed 转为 implemented,并按 Motty 的做法补上了更新日志和增量补丁方案。

关于评审指出的私钥风险:确实把两件事混在了一起,已在 92dd7a47c 分开说明(Note 决策第 7 节,并同步到 release-lithe Skill 和 docs/ci-builds.md)。

  • 丢失: 签不了新的更新源,但没有安全风险。配置时就准备一把离线备用钥,公钥同样写进 LITHE_UPDATE_PUBLIC_KEYS;主钥丢失后改用备用钥签名。没有备用钥时,用户只能手动重装。
  • 泄露: Viva 客户端接受任何一把内置公钥签的更新源,没有吊销机制,只会提供比当前版本新的版本。所以还没升级的客户端会接受伪造的“新版本”,只加新公钥也不会撤销旧钥。处理步骤:
    1. 删掉泄露的公钥,换成备用私钥。
    2. 尽快发布一个用剩下那把钥签名的版本。
    3. 发布安全公告:请用户从官方发布页手动升级,使用自定义更新源的用户先恢复默认源。

这里关闭,后续讨论请到 #1993。

@xiaoyumuxi xiaoyumuxi closed this Nov 15, 2026
xiaoyumuxi added a commit that referenced this pull request Nov 15, 2026
* docs(agents): 提议桌面端更新渠道、可配置更新源与先看日志的更新对话框

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

Refs #1913

* docs(notes): follow Motty for update notes and delta patches

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

* fix(desktop): 保存设置时保留此版本不认识的配置并提示一次

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

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

Refs #1913

* feat(desktop): update channels, feed sources, skip and kept settings

- 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

* feat(desktop): green update arrow and a dialog that shows the changes 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

* fix(desktop): log stored values this version keeps but cannot read

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

* feat(desktop): sign and publish the stable feed with notes and delta 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

* docs(notes): update channels implemented; propose the AutoBuild feed

- 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

* fix(desktop): show the build's own update channel as Automatic (<channel>)

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.

* docs(desktop): 分开说明更新签名私钥的丢失与泄露

Viva 客户端接受任何一把内置公钥签的更新源,没有吊销机制,只提供比当前版本新的版本。
原来的笔记把两种情况混在一起,写成“私钥丢失会让所有客户端停在旧版本”。

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

同步 release-lithe Skill 和 docs/ci-builds.md。回应 #1983 的评审意见。
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