Skip to content

feat(core): 八组 Viva 宿主规则移进 Core(重新提交 #30 到 main) - #31

Merged
xiaoyumuxi merged 1 commit into
mainfrom
feat/core-sink-viva-rules-main
Nov 14, 2026
Merged

xiaoyumuxi merged 1 commit into
mainfrom
feat/core-sink-viva-rules-main

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Contributor

关联 Issue

Refs 1lck/Lithe-IDEA#1800、1lck/Lithe-IDEA#1806、1lck/Lithe-IDEA#1814、1lck/Lithe-IDEA#1817、1lck/Lithe-IDEA#1829、1lck/Lithe-IDEA#1830、1lck/Lithe-IDEA#1842、1lck/Lithe-IDEA#1847。这几张单在桌面端 1lck/Lithe-IDEA#1888 合入后关闭。

为什么要重新提交

#30 的 base 是 #28 的分支。#28 在 03:01:25 squash 合入 main,#30 在 03:01:40 才合入,而且合进的是 #28 原来的分支 refactor/core-split-logging-workspace,没有进 main。所以 main 上现在只有 46 个 crate,缺 #30 的 4 个新 crate 和八组规则。

本 PR 从 main(7ae0c16)开分支,只摘取 #30 的 squash 提交 dfab9c5,没有其他改动。

改动

与 #30 完全相同,逐条说明见 #30。概括:

  • 新增 lithe-editor-layout、lithe-plugin-lifecycle、lithe-project-tree、lithe-row-selection 四个 crate,workspace 从 46 个变为 50 个。
  • 新命令:
    • git.changedFileGroups
    • git.worktreeCreationPreview
    • plugins.installed.lifecycle
    • editor.groupLayout.reduce、editor.groupLayout.dropTargets
    • workspace.rowSelection.reduce、workspace.projectTree.rows
  • 已有命令新增字段:
    • processLifecycle.resolve 返回 gracefulStopRule;
    • network.proxyPolicy 返回 exclusionRules 和 invalidExclusions;
    • git.worktrees 返回每个工作树的状态、允许和被禁止的操作,并支持 countChanges。
  • 没有改插件契约、能力版本或插件函数协议。

验证

main(7ae0c16)的代码与 #28 的 head d235401 完全相同(git diff --quiet d235401 7ae0c16),本 PR 的代码与 #30 的 head 5efe90b 完全相同(git diff --quiet 5efe90b HEAD)。以下结果都在 5efe90b 上测得,见 #30:

命令 平台 结果
cargo fmt --all -- --check macOS 通过
./scripts/rust-core/verify-rust-core-comments.sh macOS 通过
cargo clippy --locked --workspace --all-targets -- -D warnings macOS;另在 macOS 上交叉检查 Windows target 通过
cargo test --locked --workspace macOS 全部通过
node shared/plugins/scripts/verify-docs.mjs、sdk-e2e.mjs macOS 通过
桌面端 desktop-go.sh vet / test,指向 5efe90b macOS 通过(54 个包 ok),见 1lck/Lithe-IDEA#1888

未能执行的检查:没有在 Windows 实机上运行 cargo test。

…#30)

* feat(process): processLifecycle.resolve 返回停止等待时间的默认值与上下限 gracefulStopRule

设置页读取 gracefulStopRule { defaultSeconds, minSeconds, maxSeconds },不再用三个越界值探测推导(Lithe-IDEA #1830)。规则与 resolve 共用同一组常量。

* feat(network): read proxy exclusion entries in Core

network.proxyPolicy now returns exclusionRules, the exclusion entries as
host, suffix, ip, cidr and local rules, and invalidExclusions, the entries
with none of the forms. The contract states the exact comparison a network
stack applies, addresses compared within their family and an IPv6 zone
ignored, and rust/fixtures/network/proxy-bypass-v1.json pins which hosts
go direct, so hosts no longer parse the entries themselves.

* feat(git): git.changedFileGroups groups changed files by folder in natural order

The changed-file lists of a commit, a stash and a shelf grouped their files
in the desktop client with path.Dir and a byte comparison. Core now owns the
grouping: a file belongs to the folder before its last slash, the top being
"", folders sort segment by segment and files by name in the project tree's
natural order (lithe_core_rules::file_names), a folder right before its
subfolders. The response carries indices into the request's paths so hosts
keep their own file records. Shared fixture rust/fixtures/git/changed-file-groups-v1.json.

Refs Lithe-IDEA/Lithe-IDEA#1814

* feat(git): worktree states, allowed writes and creation preview in Core

git.worktrees now gives each worktree its state (missing, locked, modified,
current, available) and the writes it allows with the reason a write is
blocked; countChanges counts the local changes of every checkout in the same
listing. git.worktreeCreationPreview derives the dialog's choices, held
reference, cleaned branch name, suggested destination and readiness, so the
desktop no longer keeps its own copy of these rules (Lithe-IDEA#1817).

* feat(core): 新增 plugins.installed.lifecycle,插件启用与卸载规则由 Core 持有

新 crate lithe-plugin-lifecycle:输入已安装版本、用户的启用选择和动作(确认安装、启用、
禁用、卸载),返回每个已安装插件的启用状态和宿主按顺序执行的步骤(记录/清除选择、停止
程序、逐个删除版本并清除其批准记录、删除状态目录)。没有选择即禁用;确认安装只在没有
选择时启用;禁用先记录再停止;卸载先停止,再删除全部版本、清除选择和状态。对未安装插件
的动作返回 plugin.lifecycle.notInstalled。契约写入 rust-core-api.md,共享用例在
rust/fixtures/plugins/installed-lifecycle.json。

Refs 1lck/Lithe-IDEA#1842

* feat(editor-layout): 编辑分组与分栏树的状态转换下沉到 Core

新增纯规则 crate lithe-editor-layout,公开两条命令:

- editor.groupLayout.reduce:在分组状态和分栏树上一起执行一次转换。
  支持 editor.workbenchState.reduce 的全部动作,以及 openTab、dropTab、
  removeEmptyGroups;分组离开状态时,叶子自动从树中移除。
  拖放落点过期返回 stale,规则拒绝返回 refused,两种情况都按原样返回状态和树。
- editor.groupLayout.dropTargets:拖动开始时给出每个分组可接受的落点
  (标签条、主体边缘分栏、主体中间追加),以及空编辑区是否可接受。

分栏比例、像素和拖动过程留在宿主;Core 只接收树的形状。新分栏使用宿主
提供的编号,新分组使用宿主提供的 ID。契约、fixture 和测试同步补齐。

Refs 1lck/Lithe-IDEA#1806

* feat(project-tree): 项目树可见行与多选规则下沉到 Core

新增两个纯规则 crate,公开两条命令:

- workspace.rowSelection.reduce(lithe-row-selection):路径行的多选。
  普通点击选中并清掉标记和锚点;Cmd/Ctrl 点击切换标记并设为锚点;Shift
  点击从锚点(没有锚点时从选中行)标记到点击行,保留其他标记;clear 结束
  批量操作。根节点永远不会被标记。点击已经消失的行返回 stale。targets 给出
  批量操作的对象:去掉已标记文件夹里面的路径。项目树和变更列表共用。
- workspace.projectTree.rows(lithe-project-tree):宿主按先序发送已加载
  节点(深度、是否展开)、选择和视口顶行路径;Core 返回可见行、修复后的选择
  (节点消失或被折叠时移到最近的可见上级)、顶行的新行号和 targets。不读
  磁盘,只在树形变化时调用,不在每帧调用。

契约、fixture 和测试同步补齐。

Refs 1lck/Lithe-IDEA#1800
@xiaoyumuxi
xiaoyumuxi marked this pull request as ready for review November 14, 2026 03:07
@xiaoyumuxi
xiaoyumuxi merged commit 62b8a08 into main Nov 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant