Repository navigation
feat(macos): 本地历史忽略规则(通配符/正则)、用量显示与清空 - #1615
Merged
Merged
Conversation
- 每个项目上限 100MB(按 4KB 分配块计,占用量进程内缓存),其中项目基线最多 50MB - 基线跳过 node_modules、.venv、target、.claude、.uv-cache 等生成目录和嵌套 Git 仓库 - 保存时清理过期条目和旧版本遗留的排除目录基线;超限按基线→编辑→标签由旧到新淘汰
- Rust Core:history.record 支持 ignoreRules(通配符 + 不区分大小写正则),新增 history.ignorePreview / history.usage / history.clear - 设置 › 通用 › 本地历史:显示 已用 X / 100 MB,可清空当前项目历史(二次确认); 通配符/正则两种规则草稿编辑,测试路径实时预览命中规则,无效正则逐行提示, 点“应用”才保存 - 补齐中英词条、契约文档、功能矩阵与集成测试
- 隐藏路径、不做初始副本把内置项列进文本框,删掉一行即关闭该内置项(存为 !条目,后续版本新增的内置项仍生效) - 本地历史新增「不做初始副本」分段;Rust Core 支持 baselineExcludedDirectoryNames 与 hiddenFilePatterns 的 ! 条目,workspace.filterChanges 接受对象载荷 - 每个项目的本地历史上限可在「已用」旁调整(50–5000 MB,默认 100 MB),Rust 接受 storageLimitBytes 并限定在 10 MiB–100 GiB,基线预算为上限一半 - 用量按二进制单位显示(100 MB 而非 104.9 MB);测试路径加标签与说明
- LitheSettingsStepper 新增可选 parse,支持在数值处直接输入(失焦或回车提交,超出范围自动限定);本地历史上限启用 - 测试路径加 ⓘ 说明用途;结果分两行:本地历史是否记录、Git 是否忽略(仅作对照,本地历史不跟随 .gitignore) - history.ignorePreview 接受 workspaceRoot,返回 gitIgnored(复用 git check-ignore;无路径、工作区或仓库时为 null) - 契约文档、功能矩阵、中英 i18n 同步
Collaborator
Author
xiaoyumuxi
changed the base branch from
fix/local-history-storage-cap
to
preview
October 31, 2026 03:54
- 合并 preview(含 #1610 存储锁与容量回收),解决 history.rs、i18n、功能矩阵冲突 - 去掉「不做初始副本」页签与设置;29 个依赖/缓存/构建输出文件夹改为内置通配符 忽略规则 `**/名称/`,在通配符文本框中列出,删掉一行保存为 `!**/名称/` - 这些文件夹的基线和编辑都不再记录;保存时清理被当前规则命中的旧基线 - 测试路径结果显示命中的具体规则(「被通配符规则 %@ 忽略」) - 隐藏路径默认加入 `.lithe/**`(类似 IDEA 的 .idea),说明补充无斜杠模式只隐藏文件 - 同步契约文档、功能矩阵、中英词条与测试
Lithe Review结论: Findings
Scope Check
Suggestions
Summary未发现需要阻塞合并的问题。职责分层基本沿用现有结构,但新增测试尚未覆盖上述规则组合、清空并发和预览失效场景。 Verification
|
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.

#1610(本地历史 100MB 上限)已合并,本 PR 已合入最新 preview 并改为以 preview 为 base。
改动点
Rust Core(
project/history.rs、dispatcher、契约)history.record新增可选ignoreRules { pathPatterns, pathRegexes }:命中通配符或正则(不区分大小写,单条 1MB 编译上限)的文件不记录历史;编译结果按规则做单条缓存。history.ignorePreview:返回无效正则的行号与错误、生成目录基线排除列表(Pods、.idea 等),以及某路径命中的规则(hidden / baselineExcluded / pattern / regex)。history.usage(已用字节 / 100MB 上限)和history.clear(清空存储目录内容,目录本身保留)。shared/contracts/rust-core-api.md补三条命令与 ignoreRules 说明。macOS
LocalHistorySettingsControl):AppSettings新增localHistoryIgnorePatterns/localHistoryIgnoreRegexes,恢复默认时清空;修改后只更新当前已激活的本地历史功能。history-snapshots证据更新。追加:内置项可删改、上限可调(6ca02c615)
!**/name/,后续版本新增的内置项仍会生效;再输入回来即恢复。!name(新设置localHistoryBaselineExcludedDirectoryNames)。localHistoryStorageLimitMegabytes),改后在下次保存时按新上限淘汰;基线预算为上限一半。hiddenFilePatterns的!条目关闭对应规则,包括内置项。workspace.filterChanges接受{ paths, hiddenFilePatterns },仍兼容纯数组。ignoreRules.baselineExcludedDirectoryNames可用。ignorePreview接受hiddenFilePatterns,返回字段改名为builtInBaselineExcludedDirectoryNames。history.record/history.usage接受storageLimitBytes,范围限定在 10 MiB–100 GiB。!条目传给filterChanges,被显示回来的内置目录的变化不再被过滤掉。BuiltInRuleList(文本框行 ↔ 存储形式)及单测;i18n 新增/更新 6 条;契约文档与功能矩阵同步。test-macos.sh跑本地历史、设置、文件可见性、项目树相关测试全过(含真实 Rust Core 集成:!Pods、!**/.git/、自定义上限);i18n、shared contracts、module/service boundaries、Rust comments/layout、矩阵 gate 均通过。追加:上限可输入、测试路径对照 Git(07dbbecaa)
LitheSettingsStepper新增可选parse,其他调用处不受影响。.gitignore;没打开项目或不是 Git 仓库时不显示。history.ignorePreview接受workspaceRoot,返回gitIgnored,复用git::ignored_paths(git check-ignore --stdin -z);工作区不存在只丢 Git 一行,不影响规则预览。新增 Rust 测试覆盖仓库内忽略/未忽略、非仓库为空。追加:内置文件夹并入通配符、
.lithe默认隐藏、合入 preview(a7ed4a1d6)history.rs保留存储锁、容量回收与本 PR 的可配置上限;i18n、功能矩阵合并)。补齐 preview 新增测试替身BatchOperations缺的 usage / clear / ignorePreview。localHistoryBaselineExcludedDirectoryNames(未发布过,直接删除)。**/名称/(node_modules、.venv、target、Pods、.idea、.claude 等),在通配符文本框开头列出;删掉一行存为!**/名称/(!名称也认),后续版本新增的内置规则仍生效。**/Pods/忽略」,替代原来的「被通配符第 N 行忽略」和「在 X 中:不做初始副本」。ignoreRules去掉baselineExcludedDirectoryNames;ignorePreview返回builtInIgnorePatterns;matched的pattern改为携带规则文本{ kind: "pattern", pattern },去掉baselineExcluded。.lithe/**(类似 IDEA 的.idea),删掉这一行即显示回来;文件监听里.lithe下的配置文件仍照常触发刷新。说明文案补充:无尾部斜杠的模式只隐藏文件(.lithe隐藏名为 .lithe 的文件,不隐藏文件夹)。test-macos.sh中 LocalHistoryIgnoreRulesTests、BuiltInRuleListTests、LocalHistoryModuleTests 及文件可见性相关测试通过;i18n、shared contracts、module/service boundaries、Rust Core comments/layout、矩阵 gate(对 origin/preview)、runtime bundle immutability 均通过。LitheCoreLogicTests 全量中有 7 个窗口/会话/保存相关测试本地挂起未完成,与本改动无直接关系,留给 CI 确认。验证
cargo test(lithe-core 全量通过)、clippy 改动文件无新警告scripts/macos/test/test-macos.sh --filter "LocalHistoryIgnoreRulesTests|LocalHistoryModuleTests|SettingsSearchVocabulary|AppSettings":42 个测试通过(新增真实 Rust Core 集成测试)test-macos.sh本地历史相关测试、verify-runtime-bundle-immutability.sh均通过