Repository navigation
feat(core): 八组 Viva 宿主规则移进 Core(项目树、编辑分组、插件生命周期、工作树、Git 分组、代理排除、停止等待) - #30
Merged
xiaoyumuxi merged 7 commits intoNov 14, 2026
Merged
Conversation
…Rule
设置页读取 gracefulStopRule { defaultSeconds, minSeconds, maxSeconds },不再用三个越界值探测推导(Lithe-IDEA #1830)。规则与 resolve 共用同一组常量。
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.
…tural 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
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).
新 crate lithe-plugin-lifecycle:输入已安装版本、用户的启用选择和动作(确认安装、启用、 禁用、卸载),返回每个已安装插件的启用状态和宿主按顺序执行的步骤(记录/清除选择、停止 程序、逐个删除版本并清除其批准记录、删除状态目录)。没有选择即禁用;确认安装只在没有 选择时启用;禁用先记录再停止;卸载先停止,再删除全部版本、清除选择和状态。对未安装插件 的动作返回 plugin.lifecycle.notInstalled。契约写入 rust-core-api.md,共享用例在 rust/fixtures/plugins/installed-lifecycle.json。 Refs 1lck/Lithe-IDEA#1842
新增纯规则 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
新增两个纯规则 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
21 of 26 tasks
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 03:01
xiaoyumuxi
merged commit Nov 14, 2026
dfab9c5
into
refactor/core-split-logging-workspace
5 checks passed
Contributor
Author
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 14, 2026
…#30) (#31) * 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 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(Lithe-IDEA 侧的“需要沉入内核”八张单)。这几张单在桌面端的跟进 PR 里关闭;本 PR 只负责 Core 这一侧。
本 PR 叠在 #28(
refactor/core-split-logging-workspace)上,base 就是 #28 的分支,diff 里只有本 PR 新增的 7 个提交。#28 合入后,本 PR 会自动改到main为目标。背景
Viva 桌面端(Go)里还留着八组本该由 Core 决定的规则:停止等待时间的上下限、代理排除项的写法、Git 改动文件按目录分组、工作树状态与新建对话框、插件启用与卸载步骤、编辑分组的拆分与拖放、项目树可见行与多选。宿主各写一份,将来换 UI 壳子时还得再写一份。这次把它们都移进 Core,宿主只负责 I/O 和绘制。
新增的规则都放在独立的小 crate 里,纯计算、不读磁盘,可以并行编译。crate 总数从 46 个增加到 50 个。
改动
按提交列出:
processLifecycle.resolve返回gracefulStopRule([Feature] 停止等待时间的默认值与上下限由 Core 公开,桌面端不再三次探测推导 1lck/Lithe-IDEA#1830){ defaultSeconds, minSeconds, maxSeconds },与resolve共用同一组常量。rust/fixtures/process-lifecycle/*。network.proxyPolicy新增exclusionRules,按 host、suffix、ip、cidr、local 五种规则解析。invalidExclusions:哪种写法都不是的条目。rust/fixtures/network/proxy-bypass-v1.json固定哪些主机直连。git.changedFileGroups([Feature] 将 Viva Git Log 提交改动文件的文件夹分组下沉到 Core 1lck/Lithe-IDEA#1814)/之前的目录分组,顶层目录是""。lithe_core_rules::file_names),所以v0.1.4排在v0.1.12前面。rust/fixtures/git/changed-file-groups-v1.json。git.worktrees给每个工作树返回状态(missing、locked、modified、current、available)、允许的写操作和被禁止的原因。countChanges:一次列出里统计每个检出的本地改动数。git.worktreeCreationPreview:给出新建对话框的可选项、占用的引用、清理后的分支名、建议目录和是否可以创建。rust/fixtures/git/worktree-*.json和worktrees-v1.json。plugins.installed.lifecycle,新 cratelithe-plugin-lifecycle([Feature] Viva 插件生命周期规则(启用选择、卸载清理与停止顺序)仍在 Go 平台层,应迁入 Rust Core 1lck/Lithe-IDEA#1842)plugin.lifecycle.notInstalled(新错误码,没有和别的情况共用)。rust/fixtures/plugins/installed-lifecycle.json。shared/plugins/contract/v1/、能力版本或插件函数协议。editor.groupLayout.reduce/editor.groupLayout.dropTargets,新 cratelithe-editor-layout([Feature] 将编辑分组的共享状态转换迁入 Rust Core 1lck/Lithe-IDEA#1806)editor.workbenchState.reduce的全部动作,另加openTab、dropTab、removeEmptyGroups;分组离开状态时,它的叶子自动从树里移除。stale,规则拒绝返回refused,两种情况都原样返回状态和树。dropTargets在拖动开始时给出每个分组接受的落点:标签条、主体边缘分栏、主体中间追加,以及空编辑区。rust/fixtures/editor/group-layout-v1.json。workspace.rowSelection.reduce和workspace.projectTree.rows,新 cratelithe-row-selection、lithe-project-tree([Feature] 将 Viva 项目树可见行和导航规则下沉到 Rust Core 1lck/Lithe-IDEA#1800)rowSelection.reduce:路径行的多选。stale。targets给出批量操作的对象,去掉已标记文件夹里面的路径。projectTree.rows:宿主按先序发送已加载的节点,Core 返回:targets。projectTree.rows只在树的形状变化时调用,不是每帧调用。rust/fixtures/workspace/project-tree-rows-v1.json、row-selection-v1.json。每条新命令都在
rust/contracts/rust-core-api.md的命令表里登记了,写明来自哪个 crate。不在本 PR 范围内
PINNED_CORE_REVISION固定到本 PR 的 head。验证
在本 PR head 5efe90b 上运行:
cargo fmt --all -- --check(rust/)./scripts/rust-core/verify-rust-core-comments.shcargo clippy --locked --workspace --all-targets -- -D warningscargo clippy --locked --workspace --all-targets --target x86_64-pc-windows-msvc -- -D warningscargo test --locked --workspacenode shared/plugins/scripts/verify-docs.mjsnode shared/plugins/scripts/sdk-e2e.mjsdesktop-go.sh vet/test,指向本分支未能执行的检查:没有在 Windows 实机上运行
cargo test,只做了 Windows target 的 clippy 交叉检查。