Skip to content

fix(desktop): 统一桌面端 10 处原子文件写入到共享 atomicfile(#2257) - #2351

Merged
1lck merged 12 commits into
mainfrom
lithe-support/issue-2257-install-atomicfile
Nov 24, 2026
Merged

1lck merged 12 commits into
mainfrom
lithe-support/issue-2257-install-atomicfile

Conversation

@lithe-support

@lithe-support lithe-support Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

关联 Issue / Linked issue

PR 类型 / Type

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

改动说明 / What changes

背景 / Why

Issue #2257 指出桌面端有 10 处各自实现“在同目录创建临时文件并改名替换目标文件”的原子写入逻辑,导致关键行为长期不一致:其中 4 处(logwindow、pluginservice、pluginhost、projectgen)缺少 fsync,断电或系统崩溃后可能留下空文件或半截文件;只有 conpty 与 remoteserver 处理了 Windows 下目标被并发进程/相同文件占用时的改名失败;各处临时文件命名、权限控制、错误清理与测试覆盖也分散在各个包中。

原 Draft PR #2351 早期仅完成了“第一阶段(2/10 处)”,后续提交推进至全部 10 处但尚未同步 PR 标题/正文、功能矩阵记录以及本地 Go 1.27 + Rust Core 全量审计。本次审计合并最新 origin/main(3d7b5acb5),补强 atomicfile 共享包与 pluginruntime 遗弃临时文件清理缺陷,补齐缺失回归测试与 10 份功能矩阵记录,并完成 macOS 全量本地验证。

改动 / Changes

  • 新增并加固共享包 desktop/internal/atomicfile(desktop/internal/atomicfile/atomicfile.go、desktop/internal/atomicfile/atomicfile_test.go):
    • 提供 Write(path, data, perm)、Install(path, data, perm)、InstallWithRename(path, data, perm, rename)、WriteWith(path, perm, write)、WriteWithCheck(path, perm, write, beforeRename),内部通过 writeWithRename 统一执行同目录独占临时文件(os.CreateTemp(dir, "."+filepath.Base(path)+".*"))、写入、设置权限(f.Chmod(perm))、落盘同步(f.Sync())、关闭及 rename 发布,失败自动清理临时文件;
    • 显式拒绝空路径、.、.. 及目录分隔符(validateTargetPath),守卫 write == nil 与 rename == nil;
    • 关闭与清理流程使用 closed 标记与 errors.Join 合并关闭错误,且 os.Remove 清理仅忽略 os.ErrNotExist(附封闭 // log-exempt: 说明);
    • Install / InstallWithRename 通过 os.Lstat 与 holds(path, data) 在目标已为相同内容的常规文件时跳过重写(符号链接不视为已有目标);仅在 rename 阶段失败时通过 acceptOnRenameError 检查并发写者是否已写入相同字节,非 rename 阶段错误(写入、权限、fsync、关闭、beforeRename)即使目标恰好已含相同字节也绝不吞错;
    • 覆盖 9 项测试函数(含子测试共 11 条用例),包括 TestInstallDoesNotSwallowNonRenameErrorsEvenWhenTargetMatches、TestWriteAndInstallRejectInvalidPaths 与 TestWriteWithStreamsToFileDirectly(验证 WriteWith 直接流式写入临时文件而不缓冲整块字节)。
  • 完成 Issue [Feature] 桌面端 10 处各写一份临时文件改名的原子写入,fsync 和 Windows 改名失败处理不一致,合并为共用实现 #2257 全部 10 处调用点迁移及配套测试更新:
    1. desktop/internal/idehelp/idehelp.go(Install -> atomicfile.Install,0o700)及 idehelp_test.go(新增目录单文件无残留断言);
    2. desktop/internal/localshell/conpty/conpty.go(place -> atomicfile.Install,0o700)及 conpty_test.go(临时文件前缀断言同步为 .);
    3. desktop/internal/remoteserver/remoteserver.go(installFile -> atomicfile.InstallWithRename,0o600,保留测试 rename 注入钩子);
    4. desktop/internal/store/store.go((*Store).WriteFile -> atomicfile.Write,0o600,保留 os.MkdirAll(store.dir, 0o755));
    5. desktop/internal/draftstore/store.go((*Store).SaveSource -> atomicfile.WriteWith,流式直写 *os.File 不在内存缓冲整份源码,0o600)及 store_test.go(新增 TestSaveSourceStreamingFailurePreservesPriorCheckpointAndLeavesNoTemp);
    6. desktop/internal/pluginruntime/runtime.go((*Manager).archive -> atomicfile.WriteWithCheck,io.Copy 流式直写,并在写入后及 beforeRename 两次检查 ctx.Err(),0o600;同时修复 removeAbandoned 识别新的 .archive. 临时文件前缀与历史 .archive- 前缀)及 runtime_test.go(新增 TestPrepareCleansAbandonedAtomicArchiveTemps);
    7. desktop/internal/logwindow/export.go(writeAtomic -> atomicfile.Write,0o600 + fsync)及 export_test.go(校验导出目录无 . 前缀临时文件残留);
    8. desktop/internal/pluginservice/pages.go((*Service).SetPageState -> atomicfile.Write,0o600)及 pages_test.go(补充 SetPageState 后无临时文件残留断言);
    9. desktop/internal/pluginhost/commands.go((*CommandStore).Record -> atomicfile.Write,0o600,保留 os.MkdirAll(directory, 0o755))及 commands_test.go(同步清理前缀与非 Windows 0o600 权限断言);
    10. desktop/internal/projectgen/files.go(writeFile -> atomicfile.Write,保留 0o644/0o755 权限、ensureDirectory 与拒绝目录/符号链接目标)及 run_test.go(同步清理前缀断言)。
  • 评估 logwindow/export.go 增补 fsync 对大文件导出的性能影响:
    • 在空闲 Apple M4(darwin/arm64、APFS)运行临时对比基准 BenchmarkWriteAtomicLargeExport(-benchtime=5x,测毕已移除):因 macOS (*os.File).Sync() 调用 fcntl(F_FULLFSYNC),1x10MiB 从 1,533,658 ns/op(1.53 ms)增至 9,950,108 ns/op(9.95 ms,+8.4 ms);10x1MiB 从 2,038,425 ns/op(2.04 ms)增至 63,423,225 ns/op(63.42 ms,+61.4 ms);最坏场景 200x50KiB(maxExportFiles = 200)从 26,770,125 ns/op(26.77 ms)增至 1,128,218,875 ns/op(1.13 s,单次 F_FULLFSYNC 约 5.5 ms)。导出执行在后台 m.spawn 协程且每个文件前均检查 ctx.Err(),不阻塞主线程且可随时取消,保留 atomicfile.Write 与 fsync。
  • 更新功能矩阵记录(清理早期第一阶段/Go 1.23 过时描述,保持 verificationStatus: "pending"):
    • 更新 shared/platform-feature-matrix/features/ 下 10 份记录:diagnostics-export.json、editor-unsaved-recovery.json、ide-mcp-connection.json、plugin-command-installers.json、plugin-functions.json、plugin-managed-runtimes.json、plugin-project-generators.json、remote-development-workspace.json、runtime-package-integrity.json、terminal-shell.json。

不在本 PR 范围内 / Out of scope

  • desktop/internal/documentio/write.go 与 desktop/internal/configfile/configfile.go:保存文档或工具配置文件时需要保留目标文件既有权限与扩展属性,语义不同,按 Issue [Feature] 桌面端 10 处各写一份临时文件改名的原子写入,fsync 和 Windows 改名失败处理不一致,合并为共用实现 #2257 明确排除;
  • desktop/internal/marketplace/archive_cache.go:可重建的市场缓存故意不做 fsync 并依赖 .incoming- 前缀做 24 小时过期清理,维持现状;
  • desktop/internal/pluginsettings/sources.go、desktop/internal/logstore/store.go 及 workbench 的纯探测/临时文件 CreateTemp 调用:不以同目录改名原子替换目标文件,不迁移;
  • 审计过程中发现的两处本次之前已存在的固定 .tmp + os.Rename 写入(desktop/internal/processledger/processledger.go 的 (*Ledger).write 与 desktop/internal/loginenv/loginenv_unix.go 的 writeCache):按 develop-lithe 第九节单独建单,见重构 Issue [Feature] processledger 与 loginenv 仍手写固定 .tmp 文件改名写入,迁移到 atomicfile.Write #2376,不在本 PR 顺手改动;
  • 原生 Windows 实机/CI 验证(包含 Windows 文件被占用时的 ConPTY/Remote 改名失败路径、Windows 权限表现及端到端产品界面验收):当前 macOS 环境无法直接运行 Windows 原生二进制,由 CI Windows runner 及后续 Windows VM 验收。

类型专属:fix

复现与根因

  • 复现步骤、实际结果、期望结果:
    • 主体为按 Issue [Feature] 桌面端 10 处各写一份临时文件改名的原子写入,fsync 和 Windows 改名失败处理不一致,合并为共用实现 #2257 对齐桌面端 10 处原子文件写入实现(其中 4 处原未调用 fsync,仅有 conpty 与 remoteserver 兼容 Windows 并发占用同字节改名失败)。
    • 本次代码审计另外发现并修复两个具体缺陷:(1)原合并提交中的 atomicfile.InstallWithRename 若在写入、设权限、fsync、关闭或 beforeRename 阶段失败,但目标文件当时恰好已包含相同字节,会在错误兜底分支误将该非 rename 错误吞掉返回 nil;(2)pluginruntime.Manager.archive 迁移为 atomicfile.WriteWithCheck 后临时文件命名从 .archive-* 变为 .archive.*,但 removeAbandoned 仍只匹配 .archive-,导致异常中断后的新格式临时文件无法在下次 Prepare 时被清理。
  • 根因(引入该行为的提交或 PR,用 git log -S 或 git blame 查):
    • 原 10 处实现历史演进分散在各自功能中实现(如 #2231 新增 remoteserver.installFile 时单独复制了 conpty.place 逻辑);上述两处审出缺陷由本分支早期提交(0d623d061、82dc8239b)引入,已在 dcf7af69a 修复。
  • 影响平台:
    • macOS 与 Windows 共用同一份 desktop/internal/atomicfile Go 实现。

检查项

  • [N/A] 已先写回归测试,确认它在修复前失败、修复后通过;测试路径与修复前的失败输出:主体为按 [Feature] 桌面端 10 处各写一份临时文件改名的原子写入,fsync 和 Windows 改名失败处理不一致,合并为共用实现 #2257 合并 10 处既有一致实现;针对审计发现的非 rename 阶段误吞错、非法路径入参、WriteWith 流式直写与 pluginruntime.removeAbandoned 前缀不匹配问题,已在修复同时补全 desktop/internal/atomicfile/atomicfile_test.go、desktop/internal/pluginruntime/runtime_test.go 与 desktop/internal/draftstore/store_test.go 对应回归并通过(未单独录制修复前失败输出);全部 10 处既有单测保留并同步修正临时文件前缀断言。
  • [N/A] 无法自动化时,已写明手动复现与验证步骤:Unix/macOS 行为(包含注入 rename 失败与并发写者竞争)已由 Go 单元测试自动化覆盖;Windows 原生文件系统锁占用竞争与产品窗口手工/VM 验收步骤见 shared/platform-feature-matrix/features/ 各条目及下方“未能执行的检查和原因”。
  • 已搜索被修改函数、类型、契约字段的全部调用方(含另一平台、插件、SDK、脚本和按字符串分发的调用):已对 desktop/internal 全量检索 CreateTemp(、os.Rename( 与 .tmp,核对 10 处迁移点及 workbench 等全部上游调用方,确认保留目录预创建、权限、ctx 取消、只读/符号链接校验与错误返回契约。
  • 已检查另一平台是否有同类缺陷(有则本 PR 一并修复,或已提交 Issue):[Feature] processledger 与 loginenv 仍手写固定 .tmp 文件改名写入,迁移到 atomicfile.Write #2376(atomicfile 同时覆盖 macOS 与 Windows;审计全量 desktop/internal 发现的另外两处预存固定 .tmp 改名实现已提交重构 Issue [Feature] processledger 与 loginenv 仍手写固定 .tmp 文件改名写入,迁移到 atomicfile.Write #2376)
  • 只改了修复所需的代码,没有夹带重构;修复过程中发现的其他问题已提交 Issue:[Feature] processledger 与 loginenv 仍手写固定 .tmp 文件改名写入,迁移到 atomicfile.Write #2376(同时未修改无关的 .github/workflows/desktop-ci.yml)
  • [N/A] 修复改变了行为约束或容易复发,已在 .agents/notes/implemented/bug-fix/ 记录:未改变既有功能契约或架构边界,已校验现有 204 篇 Agent Note 无过时描述(./scripts/agent-notes/verify-agent-notes.sh 通过)。

范围检查 / Scope checks

功能矩阵 / Feature matrix

  • 已更新 shared/platform-feature-matrix/features/<id>.json:两端的实现状态和验证状态、证据路径、owner、验证动作都如实填写;没有运行验证的保持 pending(共更新 10 个能力文件,全部保持 verificationStatus: "pending",并移除过时“第一阶段 2/10 / Go 1.23”描述)
  • 已运行 ./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh;改了平台实现路径的,还运行了 ./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD(两者均通过,校验 222 项平台能力)
  • 没有提交 .artifacts/ 下生成的矩阵视图(git ls-files .artifacts 为空)
  • [N/A] 没有更新矩阵的,理由:已按实更新全部 10 项受影响能力记录,未申请豁免。

插件归属 / Plugin ownership

  • 已在仓库根目录运行 develop-lithe 第三节“插件归属与宿主零依赖”的自查命令,结果为空(desktop/ 下除 dev.lithe.test.* / dev.lithe.fixture.* 合成测试插件与第三方源禁止 dev.lithe. 前缀校验外,无任何具体插件依赖)
  • 新增或修改的测试只使用测试内联的合成插件、Core 契约 fixture 或插件市场索引快照;没有读取具体插件的插件包、仓库检出、构建产物或清单,没有使用真实插件 ID,没有“缺少插件时跳过”的测试
  • 没有为具体插件提供的能力新建或更新宿主功能矩阵条目;宿主条目的证据和验证动作不引用插件的测试、插件包或插件仓库
  • [N/A] 插件文案没有写进 shared/i18n/;插件的构建步骤、资源路径和补丁没有写进 docs/ci-builds.md、Agent Note 或 Skill:本次未涉及任何具体插件或 shared/i18n/、docs/ci-builds.md 改动
  • [N/A] 修改了通用扩展点、可能影响已发布插件的,已在受影响插件的仓库运行它的测试,插件仓库与结果:本次仅重构宿主内部文件写入细节,未改动通用插件扩展点或插件契约

UI 验证 / UI evidence

N/A:本次改动不涉及布局、控件、样式、文案、菜单、弹窗或任何可见交互状态变化。

统一日志系统 / Structured logging

  • 已接入统一日志系统:事件先在固定 Core 修订的 rust/logging/events/<root>.json 声明,再用生成的事件类型和 span 记录;没有 NSLog、os_log/Logger、直接写 stderr、print 或手写事件 ID(atomicfile 返回 Go 错误交由既有的 Core/调用方边界结构化日志处理,未新增 NSLog、os_log、直接写 stderr 或手写事件 ID)
  • 一个操作只有一条终态,错误只在处理它的边界记录一次;高频路径没有用 INFO 逐项输出(atomicfile 为底层原子写入库,不重复打日志,调用方终态与频次逻辑保持不变)
  • 没有记录源码、编辑内容、环境变量值、命令输出、凭据;路径用 path、错误用 error 类型,动态通道段来自已校验的 ID(atomicfile 仅传递标准错误及清理注释 // log-exempt: 预期的缺失:成功改名已移走本次独占临时文件。)
  • 旧日志生成和使用校验脚本(scripts/logging/)已移除,等价检查恢复前在“验证”一节写明日志门禁未完成,不记为通过(未增删日志事件,已运行 ./scripts/desktop/desktop-go.sh test -v -count=1 ./internal/core -run TestEveryLoggedEventIsAcceptedByTheKernel 校验 645 个操作 / 1478 处日志调用全部被内核接受;如仅指静态代码生成器旧脚本门禁,已在下方“未能执行的检查和原因”注明)

界面文案 / i18n

N/A:未新增或修改任何用户可见文案或 shared/i18n/ 词条(已运行 node scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check(12628/12628)与 node --test --test-timeout=60000 scripts/i18n/test-i18n.mjs(62/62)确认无异常)。

逻辑归属 / Logic placement

  • [N/A] 可共享的逻辑(解析、校验、默认值和“自动”值的解析、状态规则、错误码等)在 Rust Core,并且共享契约和 fixture 先于平台接入;平台层只做原生 I/O 和呈现:本次抽象的 desktop/internal/atomicfile 属于桌面 Go 原生文件系统 I/O 原子替换封装(CreateTemp/Chmod/Sync/Rename),按边界归属平台 Go 层,未新增业务规则或域解析逻辑
  • [N/A] 修改平台层已有的可共享逻辑时已迁入 Core;本次确有理由不迁的,理由与 refactor Issue:未修改可共享业务逻辑;全量核对中发现的另外两处遗留 .tmp 文件写入重构已建单 [Feature] processledger 与 loginenv 仍手写固定 .tmp 文件改名写入,迁移到 atomicfile.Write #2376
  • 工具或运行时专属的知识放在插件或成熟上游,宿主和 Core 没有按工具名加分支

性能与内存 / Performance and memory

  • 功能、子进程、语言服务器、WebView 首次需要才启动;没有新增空闲轮询;缓存和缓冲有上限;关闭项目、窗口、面板、标签时释放独占资源(未新增后台常驻资源、轮询或内存缓存;draftstore.SaveSource 与 pluginruntime.archive 分别通过 WriteWith 与 WriteWithCheck 直接流式写入临时文件,避免整文件缓冲进内存)
  • 主线程没有文件读写、目录遍历、进程启动;跨 C ABI、web view 只传增量或可见窗口(logwindow/export.go 导出在后台 m.spawn 协程执行且逐文件检查 ctx.Err(),不阻塞 UI 主线程)
  • 涉及启动、打开项目、输入、滚动、大文件、长输出或搜索的,已附改动前后的性能基线数据;新增运行时或大型依赖的,已写明对启动时间、常驻内存和安装包体积的影响:logwindow/export.go 新加 fsync(macOS 为 F_FULLFSYNC)前后基准已在“改动”一节给出实测对比(1x10MiB: 1.53 ms -> 9.95 ms;10x1MiB: 2.04 ms -> 63.42 ms;200x50KiB: 26.77 ms -> 1.13 s),无新增依赖。

设置 / Settings

N/A:未新增或修改任何设置项、设置页或工具来源配置逻辑。

插件契约 / Plugin contract

N/A:未修改 Rust Core 插件契约(shared/plugins/contract/v1/)、能力版本、插件函数协议、PINNED_CORE_REVISION 或任何宿主方法/通知。

发行包与资源 / Bundle and resources

  • 运行时不向已安装的 app bundle 或 Windows 安装目录写入;新增的资源路径已说明生命周期、所有权和可写位置,并运行 ./scripts/desktop/verify/verify-runtime-bundle-immutability.sh(全部迁移站点仅写用户数据/缓存/状态/导出目录,不涉及发行包目录;已运行 verify-runtime-bundle-immutability.sh 与 test-runtime-bundle-immutability.mjs 均通过)
  • [N/A] 新增或修改宿主自身的下载、解压、生成或缓存资源的,已在 docs/ci-builds.md“独立工作树的本地编译”一节写清路径、归属、生命周期和能否跨工作树复制:未新增任何缓存、下载或构建产物路径。

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


验证 / Verification

命令或操作 平台 结果
(cd desktop && gofmt -l .) macOS (arm64) 通过(无输出)
git diff --check origin/main...HEAD macOS (arm64) 通过(无空白/冲突标记)
./scripts/desktop/desktop-go.sh vet ./... macOS (arm64) 通过(exit 0)
./scripts/desktop/desktop-go.sh vet -tags dev ./... macOS (arm64) 通过(exit 0)
./scripts/desktop/desktop-go.sh --exec go run github.com/vivaui/viva/cmd/viva vet ./internal/atomicfile/... ./internal/idehelp/... ./internal/localshell/... ./internal/remoteserver/... ./internal/store/... ./internal/draftstore/... ./internal/pluginruntime/... ./internal/logwindow/... ./internal/pluginservice/... ./internal/pluginhost/... ./internal/projectgen/... ./internal/workbench/... macOS (arm64) 通过(exit 0)
./scripts/desktop/desktop-go.sh test -v -count=1 ./internal/core -run TestEveryLoggedEventIsAcceptedByTheKernel macOS (arm64) 通过(3.253s,645 actions / 1478 log calls)
./scripts/desktop/desktop-go.sh test -race -tags 'dev vivahead' -count=1 ./internal/atomicfile ./internal/idehelp ./internal/localshell/conpty ./internal/remoteserver ./internal/store ./internal/draftstore ./internal/pluginruntime ./internal/logwindow ./internal/pluginservice ./internal/pluginhost ./internal/projectgen macOS (arm64) 全部 11 个包通过(atomicfile 1.407s, idehelp 4.134s, conpty 4.714s, remoteserver 4.466s, store 3.259s, draftstore 2.413s, pluginruntime 3.450s, logwindow 6.392s, pluginservice 60.839s, pluginhost 5.327s, projectgen 9.387s)
./scripts/desktop/desktop-go.sh test -race -tags 'dev vivahead' -timeout=20m -count=1 ./internal/workbench macOS (arm64) 通过(585.401s)
./.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/atomicfile ... ./internal/projectgen(11 包逐项计时) macOS (arm64) 通过(380 passed, 1 skipped:TestToolchainProviderFixtureProcess 为夹具进程入口跳过;最大耗时 10830ms < 15000ms,新增/更新单测均为 0–20ms)
./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/main macOS (arm64) 通过(9 个 Go 测试文件需辅以人工审阅与上述计时/竞态跑分;Rust N/A)
./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD 与 ./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh 与 node --test scripts/platform-feature-matrix/test-platform-feature-matrix.mjs macOS (arm64) 均通过(校验 222 项能力,脚本单测 5/5)
./scripts/agent-notes/verify-agent-notes.sh macOS (arm64) 通过(204 active Agent Note(s) verified)
node scripts/desktop/validate-pins.mjs macOS (arm64) 通过(viva 与 Core 9ab2336e8ca651e40baa5e65848b717b26f69e43 均可达)
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh 与 node --test scripts/desktop/verify/test-runtime-bundle-immutability.mjs macOS (arm64) 均通过(8 个工作流,单测 5/5)
node scripts/i18n/verify-app-language-localization.mjs 与 node scripts/i18n/generate-i18n.mjs --check 与 node --test --test-timeout=60000 scripts/i18n/test-i18n.mjs macOS (arm64) 均通过(12628/12628,单测 62/62)
临时基准 BenchmarkWriteAtomicLargeExport(APFS、Apple M4、-benchtime=5x,测完移除) macOS (arm64) 1x10MiB: 1.53 ms -> 9.95 ms;10x1MiB: 2.04 ms -> 63.42 ms;200x50KiB: 26.77 ms -> 1.13 s

未能执行的检查和原因:

  • Windows 平台原生构建与 go test(含 ConPTY DLL / 远端文件被进程占用时的 atomicfile.Install / InstallWithRename 竞争、Windows 文件权限及各功能端到端页面恢复验收):当前工作环境为 macOS(darwin/arm64),未在本机启动 Windows VM 执行,待 CI Windows 检查与后续 Windows VM 验收补齐;因此 10 份功能矩阵记录均保持 verificationStatus: "pending"。
  • 旧 scripts/logging/ 日志静态生成校验脚本已被上游移除(develop-lithe 说明),等价完整日志声明静态门禁未执行(仅运行了 TestEveryLoggedEventIsAcceptedByTheKernel 内核目录验证,且本 PR 未增删任何日志事件)。
  • 未运行无头视觉截图测试(lithevisual):本 PR 未涉及 UI 布局或可见交互改动。

提交前确认 / Final checks

  • 分支从最新的 main 创建;目标分支:feat、fix、docs 为 main,release 以发布流程要求为准(已合并最新 origin/main 3d7b5acb5)
  • 以 Draft 提交,本地验证通过后才标记 ready(保持 Draft 状态,不运行 gh pr ready)
  • 没有无关改动,没有提交 .build/、target/、dist/、.artifacts/ 等产物,没有凭据、个人路径和未脱敏的日志或截图(git ls-files .artifacts 为空,未修改 .github/workflows/desktop-ci.yml)
  • 本次构建、测试或预览启动的 Lithe 应用和子进程已全部关闭,没有进程残留

@ghfind-review ghfind-review Bot added the review: no-score ghfind author score missing (not zero) label Nov 23, 2026
@lithe-support

lithe-support Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Lithe Review — 自查与 CI 纠正(最新 head 1cae6e1fc992)

首轮 Linux CI 发现 idehelp.go 在迁移时保留了旧函数尾部,导致语法错误。已在后续提交 1cae6e1fc992 删除残留旧实现,并回读 PR Diff 确认只保留共享安装函数调用;不将此失败误判为上游或环境问题。

最新提交的 Format and script tests、Verify pins、矩阵门禁与远端服务构建/测试均已通过;Linux Go 检查仍在进行,Windows 原生测试因 Draft 跳过。该 PR 仅完成 #2257 其中 2/10 处,仍需完整 CI 及独立审核,保持 Draft、不关闭 Issue、不合并。

@lithe-support

lithe-support Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Lithe Review(最新提交 c437ba0)

已纠正最初“2/10 处”的过时描述:本分支现在覆盖 #2257 列出的 10/10 处写入路径。共享 atomicfile 提供 Install、Write 与流式 WriteWith,保留 remoteserver 的竞争重命名测试钩子和各调用方权限;失败时清理临时文件。

最新 Linux CI 中 atomicfile、remoteserver、idehelp、conpty、store、draftstore、pluginruntime、logwindow、pluginservice、pluginhost、projectgen 共 11 个受影响 Go 包均通过;格式/脚本、矩阵、固定依赖、远端构建与测试也通过。完整 CI 未通过:settingswindow/workbench 的 Viva 现有 Text/Spacer Key 断言 panic,变更不涉及这两个位置。Draft 状态保留,macOS/Windows 原生验收仍未执行。请以此评论代替 PR 描述里关于“第一阶段”的旧信息;不自动合并、不提前关闭 Issue。

@lithe-support

lithe-support Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Lithe Review|最终范围与验证摘要(head 3d0491ec6039)

原 PR 描述的“仅迁移 2/10”是早期状态,现已过时;请以本整合回复和 Diff 为准。

@1lck 1lck changed the title refactor(desktop): 将 IDE Helper 和 ConPTY 安装统一为原子写入(#2257) fix(desktop): 统一桌面端 10 处原子文件写入到共享 atomicfile(#2257) Nov 24, 2026
@1lck
1lck marked this pull request as ready for review November 24, 2026 03:36
…257-install-atomicfile

# Conflicts:
#	shared/platform-feature-matrix/features/plugin-command-installers.json
#	shared/platform-feature-matrix/features/plugin-project-generators.json
@1lck
1lck merged commit c44a26d into main Nov 24, 2026
10 checks passed
@1lck
1lck deleted the lithe-support/issue-2257-install-atomicfile branch November 24, 2026 04:24
@xiaoyumuxi xiaoyumuxi mentioned this pull request Nov 24, 2026
12 of 15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: no-score ghfind author score missing (not zero)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 桌面端 10 处各写一份临时文件改名的原子写入,fsync 和 Windows 改名失败处理不一致,合并为共用实现

1 participant