Skip to content

feat(core): #1662 第二轮 Git 更新与历史(GIT-14/15) - #1767

Merged
1lck merged 1 commit into
previewfrom
feat/issue-1662-r2-git-update-history
Nov 5, 2026
Merged

1lck merged 1 commit into
previewfrom
feat/issue-1662-r2-git-update-history

Conversation

@1lck

@1lck 1lck commented Nov 5, 2026

Copy link
Copy Markdown
Owner

关联 #1662 第二轮【Git 更新与历史】车道。

GIT-14 Branch Update / Pull 策略

  • 新增 Core git.updatePlan(route / inspect / defaultStrategy 三个阶段):统一路由、blocker(noUpstream/localChanges/upToDate/notFastForward/stateChanged)、是否询问策略、期望 checkout 与 upstream。
  • git.pullPreflight 新增 configuredStrategy(读 pull.rebase/pull.ff)。
  • 默认策略:用户选择 > Git 配置 > ffOnly(两端中更安全者;原先 macOS ffOnly、Windows merge)。
  • Windows:分叉时不再直接 merge,Update 返回 needs-strategy 并打开 Pull 对话框;对话框预选策略由 Core 决定;删除 GitPullWorkflow 内的策略等待与本地门禁。
  • macOS:前检失败(preflight/plan 失败)即停止,不再继续执行;Update 走 Core 路由,分叉询问并在确认后由 Core 复查历史是否变化;pull 带 expectedBranch 校验。
  • 两端 dirty 都阻止更新。

GIT-15 历史刷新窗口与选择

  • 新增 Core git.historyWindow(refreshPlan/extendPlan/mergePage/reconcileSelection)。
  • Windows:监听刷新按已加载数量读取并延伸保留旧尾部,不再缩回第一页;选中提交、焦点、范围锚点在仍已加载时保留。
  • macOS:窗口合并、翻页去重上限、选择归并改用 Core;像素滚动锚点仍留在视图。

其他

  • 新增 shared fixture:update-plan-v1.json、history-window-v1.json;Windows 测试替身用 fixture 对拍;macOS 测试走真实 Core。
  • i18n:三条 macOS 词条加入共享词条;更新契约文档与功能矩阵。
  • 撤出的条目:无。

验证

  • cargo: update_plan / history_window / pull_preflight 测试通过;cargo fmt、Rust 注释、契约、功能矩阵、i18n 检查通过。
  • Windows:bun run typecheck 通过;相关 git 测试逐文件通过。src/platform/git-patch-files.test.ts 失败,在 stash 掉本改动后同样失败(既有)。
  • macOS:swift build 通过;test-macos.sh --filter 'GitModuleTests|GitStatusObservationTests' 283 项通过。
  • 未执行:lithe-dev 上的 Windows 编译、cargo check --bin lithe-windows、verify-service-boundaries/verify-windows-boundaries、完整 Windows 前端全量测试。

重叠的 open PR:#1716(git-log-tool-window.tsx、git-history.json、messages.json/locales/shared.generated.ts);#1659(mod.rs、GitFeatureModel.swift、GitService.swift、GitModels.swift、RustCoreBridge.swift、RustGitOperations.swift、GitModuleTests.swift)。

🤖 Generated with Claude Code

@1lck

1lck commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

本地集成验证(#1662 第二轮)

本 PR 与 #1765、#1768、#1767、#1766、#1769 一起,在本地集成分支 feat/issue-1662-r2-integration(基于 preview c1c7015)上验证。结果如下:

Rust

  • cargo test -p lithe-core:2130 个测试通过。
  • cargo test -p lithe-agent-host -- --test-threads=2:270 个测试通过。
  • cargo fmt --check -p lithe-core 通过。
  • cargo check --bin lithe-windows 在 macOS 上只有 2 个已知的 std::os::windows 错误,没有新增。

校验脚本
以下脚本全部通过:rust-core-comments、verify-core、shared-contracts、service-boundaries、windows-boundaries、platform-feature-matrix、两个 i18n 检查、runtime-bundle-immutability。

macOS

  • swift build --build-tests 通过。
  • test-macos.sh 跑了相关的 701 个测试,没有本次引入的失败:
    • cancellingSaveAllDuringRemoteDrainDoesNotWrite 在 preview 上同样失败,是既有问题。
    • 另外 3 个失败是高负载下的时序抖动,单独重跑能通过。

Windows 前端(在 Mac 上用 bun 跑)

  • bun run typecheck 通过。
  • 逐文件跑了 259 个测试文件,只有 3 个失败(git-status-display-order、matcher 的 IME 用例、agent-hooks-settings),在 preview 上同样失败,都是既有问题。

未执行
Windows 真机上的编译和测试没跑,因为 lithe-dev 服务器暂时连不上。

验证通过后用 --admin squash 合并,没有触发云端 macOS/Windows CI。

- GIT-14:新增 Core 命令 git.updatePlan,统一分支 Update/Pull 的路由、blocker、是否询问和默认策略(用户选择 > pull.rebase/pull.ff > ffOnly);git.pullPreflight 增加 configuredStrategy。分叉时 Windows 不再直接 merge,改为在 Pull 对话框选择;macOS 前检失败不再继续执行;两端 dirty 都拦截。
- GIT-15:新增 Core 命令 git.historyWindow(refreshPlan/extendPlan/mergePage/reconcileSelection)。Windows 监听刷新按已加载数量读取,不再缩回第一页;选中、焦点、范围锚点保留;macOS 改用 Core 合并与选择归并。
- 删除两端旧的策略/窗口算法,补共享 fixture、测试替身(对拍 fixture)、功能矩阵和契约文档。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1lck
1lck force-pushed the feat/issue-1662-r2-git-update-history branch from 3122017 to c1bf929 Compare November 5, 2026 13:58
@1lck
1lck marked this pull request as ready for review November 5, 2026 13:58
@1lck
1lck merged commit ee03abe into preview Nov 5, 2026
0 of 8 checks passed
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