Skip to content

fix(desktop): Core 固定版本改到 Lithe-core-rust#31 的合并提交,修好 Linux/Windows 上失败的两个测试 - #1891

Merged
xiaoyumuxi merged 3 commits into
previewfrom
chore/pin-core-31-merge
Nov 14, 2026
Merged

xiaoyumuxi merged 3 commits into
previewfrom
chore/pin-core-31-merge

Conversation

@xiaoyumuxi

@xiaoyumuxi xiaoyumuxi commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

关联 Issue / Linked issue

PR 类型 / Type

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

改动说明 / What changes

背景 / Why

#1889 合入 preview 时,scripts/desktop/build-desktop-core.sh 的 PINNED_CORE_REVISION 还是 5efe90b。这是 Lithe-core-rust#30 分支的 head,不在 Core main 上;脚本注释也还写着“#30、#28 尚未合入,合入后改成合并提交”。

现在 Lithe-core-rust#31 已经 squash 合入 Core main,合并提交是 62b8a08。git diff 5efe90b 62b8a08 为空,两者代码完全相同。本 PR 把固定版本改成这个合并提交:以后拉取 Core 时用的是 main 上的 commit,不再依赖功能分支或 PR 引用一直保留。

本 PR 第一次跑完整 CI 时,Linux 和 Windows 的 vet/test 失败了,原因是两个在 preview 上就已经失败的测试,和改固定版本无关:preview 在 bd0ba54(#1887)和 e02e3ce(#1889)的 Desktop CI 也是这两个失败。不修好它们,本 PR 和后面的 PR 都过不了完整 CI,所以在本 PR 里一起修掉。两处都只改测试,产品代码没有改。

改动 / Changes

两个 commit 的代码相同,所以没有改命令、JSON、错误码或 C 头文件,桌面端代码也不用改。

  • desktop/internal/workbench/workbench_background_test.go:frontLabeled 跳过窗口按钮所在的层
    • frontLabeled 按名字取最后声明的控件。Windows 和 Linux 上,Viva 在最上层(math.MaxUint16,见 Viva app/window_controls.go 的 windowControlsLayer)自绘最小化、最大化和关闭按钮,它们在弹窗之后声明。
    • 窗口的关闭按钮和弹窗的关闭按钮都叫“关闭”,测试点中的是窗口的关闭按钮,所以报 the close button left the popover open。
    • macOS 用系统的红绿灯,没有这个命中,所以 macOS 上一直通过。
    • 现在 frontLabeled 跳过 Layer == math.MaxUint16 的命中,Viva 记录命中时写的就是这个层。
  • desktop/internal/localshell/integration_windows_test.go:等待 shell 启动和等待 cd 后的提示符分开设期限
    • TestWindowsShellReportsDirectoryAfterChangingIt/powershell.exe 原来两次等待都是 12 秒。
    • Windows PowerShell 5.1 在 CI 上冷启动约 9 秒:e02e3ceee 那次通过,整个包 16 秒。两次失败都卡在 12 秒期限上(12.05 秒、12.14 秒),屏幕是空的,连第一个提示符都还没出来。
    • 现在等第一次提示符的期限是 45 秒,cd 后仍然是 12 秒。仍然有本地期限,超时时照样报出屏幕内容。

不在本 PR 范围内 / Out of scope


类型专属:fix

复现与根因

检查项

  • 已先写回归测试,确认它在修复前失败、修复后通过:被修的两个测试本身就是回归测试。修复前的失败输出见本 PR 第一次 CI(run 43551247153):Linux 和 Windows 报 workbench_background_test.go:535: the close button left the popover open,Windows 报 integration_windows_test.go:57: wanted "C:\\Users\\RUNNER~1\\…\\001", got ""; screen: ""。修复后的第二次 CI(run 43552863008)上 Linux、Windows、macOS 的 vet/test 都通过。macOS 本地无法复现:Viva 只在 Windows 和 Linux 上自绘窗口按钮。固定版本一项两个 commit 代码相同,没有能写成回归测试的差异。
  • 无法自动化时,已写明手动复现与验证步骤:git -C <Core 检出> diff --quiet 5efe90b 62b8a08 为空,见“验证”。
  • 已搜索被修改函数、类型、契约字段的全部调用方:git grep 5efe90b 在本仓库只有这一处固定版本,CI 和打包脚本都从这个变量读取固定版本;frontLabeled 只有 workbench_background_test.go 里的背景图测试在用。
  • 已检查另一平台是否有同类缺陷:弹窗测试的问题只在有自绘窗口按钮的 Windows 和 Linux 上出现;PowerShell 测试只在 Windows 上运行。
  • 只改了修复所需的代码,没有夹带重构。两个测试修复是为了让完整 CI 能通过,都只改测试代码
  • [N/A] 修复改变了行为约束或容易复发,已在 .agents/notes/implemented/bug-fix/ 记录:行为没有变化。

范围检查 / Scope checks

功能矩阵 / Feature matrix

没有用户可观察的变化。按矩阵改动门禁的要求,在两个被测试覆盖的能力里补了这两条回归的说明,状态都没改,仍是 pending:

  • workbench-background-image.json:verification 加一段,说明 TestStripeBackgroundButtonOpensThePopoverThatChoosesTheImage 在 Windows 和 Linux 上跳过 Viva 自绘窗口按钮的那一层(math.MaxUint16),以免点到窗口的关闭按钮。
  • terminal-shell.json:Windows 的 evidence 加入 desktop/internal/localshell/integration_windows_test.go;verification 加一段,说明 TestWindowsShellReportsDirectoryAfterChangingIt 测的内容:三个 Shell 报告起始目录和进入目录后的新目录,首个提示符期限 45 秒,进入目录后 12 秒。

统一日志系统 / Structured logging

N/A:没有改动日志。

界面文案 / i18n

N/A:没有用户可见文案。

逻辑归属 / Logic placement

N/A:没有改动业务逻辑。

性能与内存 / Performance and memory

N/A:Core 代码相同,没有性能影响。

设置 / Settings

N/A:没有改动设置。

插件契约 / Plugin contract

  • [N/A] 契约改动已在 Rust Core PR 里随执行它的代码一起提交:本 PR 不改契约。
  • scripts/desktop/build-desktop-core.sh 的 PINNED_CORE_REVISION 已升到包含该契约的 Core commit,桌面端测试经 scripts/desktop/desktop-go.sh 读到的就是这份契约:已改到 62b8a08,测试时 Core 检出就是这个 commit。
  • [N/A] 修改插件后端协议的,已运行 sdk-e2e.mjs:没有改协议。
  • [N/A] 新增或修改宿主方法、宿主通知:没有。

发行包与资源 / Bundle and resources

  • 运行时不向已安装的 app bundle 或 Windows 安装目录写入:已运行 ./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,通过。
  • [N/A] 新增或修改下载、解压、生成或缓存资源:没有新增资源,Core 源码的拉取方式没有变。

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

  • [N/A] 本次改动导致变成无用的代码已在本 PR 删除:没有因此变成无用的代码。
  • [N/A] 本次之前就存在的无用代码或可重构之处:没有发现。

验证 / Verification

Core 检出切到 62b8a08(origin/main),通过 LITHE_CORE_RUST_DIR 指给桌面端:

命令或操作 平台 结果
git diff --quiet 5efe90b 62b8a08(Core 仓库) macOS 为空,两个 commit 代码相同;rust/crates/ 下 50 个 crate
bash -n scripts/desktop/build-desktop-core.sh macOS 通过
scripts/desktop/desktop-go.sh vet ./...(desktop/) macOS 通过
scripts/desktop/desktop-go.sh test ./...(desktop/) macOS 通过,54 个包 ok
构建身份 .artifacts/desktop/lithe-core/*/debug/identity.txt macOS core-revision=62b8a08…,core-worktree=clean
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh macOS 通过
.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/workbench -- --filter '…Background…' macOS 通过,11 个背景图测试
.agents/skills/write-stable-tests/scripts/verify-test-stability.sh macOS 通过
scripts/desktop/desktop-go.sh test ./internal/workbench/ ./internal/localshell/ macOS 通过
GOOS=windows go vet ./internal/localshell/,GOOS=windows go test -c ./internal/localshell/ 在 macOS 上交叉检查 Windows 通过
gofmt -l macOS 无输出
./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh macOS 通过,222 项能力
./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD macOS 通过
node --test scripts/platform-feature-matrix/test-platform-feature-matrix.mjs macOS 通过,5 个用例
本 PR 第一次完整 CI(run 43551247153,只有固定版本提交) Linux、Windows、macOS macOS 通过;Linux 和 Windows 失败,失败的就是上面两个测试,和 preview 上相同
第二次完整 CI(run 43552863008,加上两个测试修复) Linux、Windows、macOS vet/test 三个平台都通过;功能矩阵检查(run 43552863088)因为没有更新能力文件而失败,已由第三个提交补上

未能执行的检查和原因: 修复的两个测试只在 Windows 和 Linux 上失败,macOS 本地复现不了,修复是否有效由第二次完整 CI 验证(见上表)。本地验证用的是 LITHE_CORE_RUST_DIR,没有走脚本自己拉取固定版本的路径,这条路径也由 CI 覆盖(Verify pins 已通过)。

提交前确认 / Final checks

#1889 合入 preview 时固定的是 Lithe-core-rust#30 分支的 head 5efe90b,它不在 Core main 上。
#31 已 squash 合入 main(62b8a08),代码与 5efe90b 完全相同,改用这个合并提交,并把注释里
"尚未合入" 的说明改成已合入。
@lithe-code-review

lithe-code-review Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Lithe Review

结论: ✅ 通过
范围: preview ← chore/pin-core-31-merge · head: 00b7ffd

未发现需要阻塞合并的问题。

Scope Check

逻辑块 归属 依据
无:scripts/desktop/build-desktop-core.sh:59 仅修改固定 SHA 构建配置 未新增或修改业务规则、平台实现或契约文件

Checked and cleared

  • 完整 diff 仅含 SHA 和注释,获取方式、构建参数、资源路径及身份记录逻辑均未改变。
  • build-desktop-core.sh:109 按同一固定 SHA 获取并检出源码;desktop-go.sh:89 在链接前调用该入口,fixture 目录也来自同一 Core 检出。
  • .github/workflows/desktop-ci.yml 的三个平台缓存键均包含构建脚本哈希;固定版本变化会改变缓存键,恢复旧缓存后仍会校验源码修订。
  • validate-pins.mjs:34 直接读取该变量并验证远程可获取性;提供的 head 检查记录显示 Verify pins 成功。

Summary

固定修订、构建入口和缓存身份之间保持一致,未发现本次改动引入的正确性或架构问题。Core 两提交内容等价及新提交位于 main 的结论依赖作者提供的信息,本次未独立复核。

Verification

  • 实际检查:指定 base/head 的聚焦 diff、base 脚本,以及 head 中的构建脚本、desktop-go.sh、validate-pins.mjs、桌面 CI 缓存配置和 Core 资源登记。
  • 作者提供结果:Core 两提交 diff --quiet 为空;macOS 下脚本语法、Go vet、54 个包测试及 bundle 不变性检查通过,构建身份记录为新 SHA 且工作树干净。
  • 已提供 CI:Verify pins、功能矩阵检查成功;平台测试及脚本检查尚无全部完成的成功结果。
  • 本次未运行代码、测试或边界脚本,未访问网络。Windows、Linux 及默认固定版本获取路径的完整验证仍待 CI 结果确认。

@lithe-code-review

Copy link
Copy Markdown

Lithe 运行验收

版本:00b7ffd2d7accb7d969b37ffda9e5ddc15228b6e;状态:blocked。
本报告独立于代码审查;只报告实际执行的场景,不代表所有问题均已修复。

执行未完成:Invalid scenario identity

本次未形成完整验收结果,详见执行原因。
详细步骤和原始证据保存在服务器受限目录(14 天、总计不超过 1 GiB);当前没有公开下载链接。

- TestStripeBackgroundButtonOpensThePopoverThatChoosesTheImage:frontLabeled 取最后声明的
  同名控件。Windows 和 Linux 上 Viva 在最上层(math.MaxUint16)自绘窗口按钮,窗口的关闭
  按钮也叫“关闭”,测试点中的是它,弹窗没有关闭。现在跳过窗口按钮所在的层。
- TestWindowsShellReportsDirectoryAfterChangingIt/powershell.exe:Windows PowerShell 5.1
  在 CI 上启动约 9 秒,有时超过 12 秒的期限。等待第一次提示符的期限改为 45 秒,cd 之后
  仍然是 12 秒。
@xiaoyumuxi xiaoyumuxi changed the title fix(desktop): Core 固定版本改到 Lithe-core-rust#31 的合并提交 62b8a08 fix(desktop): Core 固定版本改到 Lithe-core-rust#31 的合并提交,修好 Linux/Windows 上失败的两个测试 Nov 14, 2026
workbench-background-image:说明 Windows 和 Linux 上弹窗测试跳过 Viva 自绘窗口按钮所在的层。
terminal-shell:Windows 证据加入 integration_windows_test.go,说明首个提示符 45 秒、进入目录后 12 秒的期限。
@lithe-code-review

Copy link
Copy Markdown

Lithe 运行验收

版本:d4d8d5fcea18dda1ea8172035c06c899cc45dc15;状态:partial。
本报告独立于代码审查;只报告实际执行的场景,不代表所有问题均已修复。

对照:共同祖先 e02e3ceeea9b9cc4e5822e4f466a0f04a843ba30 → PR head;当前目标分支合并适用性:未运行。

  • 条件不足,未验证:Exercise the unchanged production Core acquisition/staging path with no local-source override, preserving desktop linkage and contract-fixture consistency after changing the pin.
    • Bash/GNU utilities, Go 1.27.3, MinGW-w64, and the Windows GNU Rust target are not supplied by the capability inventory. No staged Core checkout exists here, and no local Core Git/dependency fixture is provided. Default acquisition contacts GitHub. The Node pin validator also invokes Go and remote Git, so it is not an offline substitute. The reported identical Core payloads provide no defined runtime bug-versus-correct differential for this pin-only change.
  • 条件不足,未验证:Exercise TestStripeBackgroundButtonOpensThePopoverThatChoosesTheImage and the checked-out frontLabeled helper through the real Go/Viva headless driver on Windows; repeat on Linux when available.
    • The Go toolchain, Bash/MinGW build environment, linked Core, and pinned Viva dependencies are unavailable. Node and PowerShell cannot execute the existing Go helper and production rendering path. Linux execution is also unavailable. Source inspection or a rewritten JavaScript selector would not establish this regression.
  • 条件不足,未验证:Exercise real localshell ConPTY sessions and terminal directory-report parsing for all three shells, distinguishing initial startup from the prompt after changing directory.
    • Go and pinned dependencies are unavailable; cmd.exe and pwsh.exe are not supplied in the executable inventory. The PowerShell 5.1 prerequisite and isolated profile configuration are not established. No prespecified statistical protocol defines cold-start preparation, sample count, workload, failure threshold, or total time budget. Two attempts per revision cannot establish the intermittent timeout fix; a standalone PowerShell directory command bypasses Lithe's ConPTY and parser.

未覆盖:

  • Default Core acquisition without LITHE_CORE_RUST_DIR, staging, desktop linkage, matching contract fixtures, and cache reuse remain unverified.
  • The new Core commit's main ancestry and equivalence to the old commit require an independently supplied Core Git fixture; the PR's claims were not independently verified.
  • The Windows and Linux background regression remains unexecuted, including image selection, rendering, strength persistence, and selecting the popover close control instead of the window close control.
  • Native windows, actual file-picker dialogs, and visual behavior remain unverified and require desktop capability. The existing headless harness substitutes the picker.
  • Starting-directory and changed-directory reporting for cmd.exe, powershell.exe, and pwsh.exe remain unverified, including the Unicode, space, semicolon, and percent-sign fixture.
  • The intermittent PowerShell startup failure, separate 45-second startup and 12-second subsequent-prompt deadlines, timeout diagnostics, and process cleanup remain unverified.
  • Linux/macOS execution and runtime installation-directory immutability remain unverified. Feature-matrix verification states remain pending.

工作副本与运行状态已清理;可复用编译缓存按 12 GiB / 7 天预算保留。
详细步骤和原始证据保存在服务器受限目录(14 天、总计不超过 1 GiB);当前没有公开下载链接。

@xiaoyumuxi
xiaoyumuxi merged commit dad4962 into preview Nov 14, 2026
5 of 6 checks passed
@xiaoyumuxi
xiaoyumuxi deleted the chore/pin-core-31-merge branch November 14, 2026 04:19
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