Skip to content

Commit ff75212

Browse files
feat: expand audited cleanup rules and space analysis actions
1 parent 67ba76f commit ff75212

13 files changed

Lines changed: 437 additions & 59 deletions

File tree

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ body:
1010
id: version
1111
attributes:
1212
label: CDriveCare version
13-
placeholder: v0.2.1
13+
placeholder: v0.3.0
1414
validations:
1515
required: true
1616
- type: input

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this project are documented here. The format follows [Kee
44

55
## [Unreleased]
66

7+
## [0.3.0] - 2026-07-31
8+
9+
### Added
10+
11+
- Seven reviewed cleanup rules for Outlook WebView, Tencent applications, VS Code, Codex desktop caches, and stale Perfect World updater packages.
12+
- Explicit Chromium shader, Dawn, component, and extension download cache coverage for Chrome and Edge.
13+
- Open-folder and copy-path commands in Space Analysis, available from the toolbar, double-click, Enter, and the row context menu.
14+
- Regression boundaries for browser site data, local AI models, OneDrive, OpenAI runtimes, Tencent user/plugin data, VS Code user state, IDM downloads, and protected Windows stores.
15+
16+
### Changed
17+
18+
- Expanded the embedded catalog from 21 to 28 rules while keeping new vendor-specific rules review-required except for the narrowly scoped Outlook WebView cache.
19+
- Documented the local C-drive audit, including large directories intentionally excluded from raw deletion.
20+
721
## [0.2.1] - 2026-07-28
822

923
### Fixed
@@ -46,7 +60,8 @@ All notable changes to this project are documented here. The format follows [Kee
4660
- Safe cancellation semantics that let an active Windows maintenance command finish before skipping later items.
4761
- A safety test suite and deterministic PowerShell build/package script.
4862

49-
[Unreleased]: https://github.com/sanrokamlan-prog/CDriveCare/compare/v0.2.1...HEAD
63+
[Unreleased]: https://github.com/sanrokamlan-prog/CDriveCare/compare/v0.3.0...HEAD
64+
[0.3.0]: https://github.com/sanrokamlan-prog/CDriveCare/compare/v0.2.1...v0.3.0
5065
[0.2.1]: https://github.com/sanrokamlan-prog/CDriveCare/compare/v0.2.0...v0.2.1
5166
[0.2.0]: https://github.com/sanrokamlan-prog/CDriveCare/compare/v0.1.0...v0.2.0
5267
[0.1.0]: https://github.com/sanrokamlan-prog/CDriveCare/releases/tag/v0.1.0

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
## 下载即用
1919

20-
1.[Releases](https://github.com/sanrokamlan-prog/CDriveCare/releases/latest) 下载 `CDriveCare-v0.2.1-win.zip`
20+
1.[Releases](https://github.com/sanrokamlan-prog/CDriveCare/releases/latest) 下载 `CDriveCare-v0.3.0-win.zip`
2121
2. 解压后双击 `CDriveCare.exe`,接受 Windows 管理员权限提示。
2222
3. 等待自动扫描,核对勾选项后点击“清理所选”。
2323

@@ -35,12 +35,12 @@ CDriveCare 的目标不是清得最多,而是在每个规则都能解释、能
3535

3636
## 核心能力
3737

38-
- **21 条内嵌规则**`rules.json` 只作为构建输入嵌入 EXE;运行时不读取同目录外部规则,启动时严格校验 schema、必填/未知/重复字段、规则 ID、风险、动作、年龄门槛和路径白名单,任何异常都会拒绝加载。
38+
- **28 条内嵌规则**`rules.json` 只作为构建输入嵌入 EXE;运行时不读取同目录外部规则,启动时严格校验 schema、必填/未知/重复字段、规则 ID、风险、动作、年龄门槛和路径白名单,任何异常都会拒绝加载。
3939
- **先扫描再清理**:逐项显示预计空间、文件数、风险和影响。
4040
- **日常 / 深度模式**:“日常清理”只选择有内容的低风险项;“深度清理”增加需确认的文件规则,但回收站和 Windows 托管动作仍需逐项手动选择。
4141
- **驱动缓存分层**:可清理 NVIDIA/AMD 着色器缓存、厂商下载/解压残留;DriverStore 只导出报告,绝不自动删。
4242
- **Windows 托管动作**:传递优化使用 `Delete-DeliveryOptimizationCache`,组件存储使用 DISM `StartComponentCleanup`
43-
- **只读空间分析**:并行统计 LocalAppData/RoamingAppData 大目录,可直接定位目录,不自动迁移或删除。
43+
- **只读空间分析**:并行统计 LocalAppData/RoamingAppData 大目录;可通过工具栏、双击、回车或右键打开目录,并可复制完整路径,不自动迁移或删除。
4444
- **安全更新提示**:后台检查最新正式 Release;新版本只显示可点击提示,不自动下载或替换高权限程序。
4545
- **可核对结果**:同时记录候选文件大小和系统盘实际可用空间变化;每次运行的本地日志写入 `%LOCALAPPDATA%\CDriveCare\Logs`,保留 30 天且最多 20 份。
4646

@@ -64,15 +64,16 @@ CDriveCare 的目标不是清得最多,而是在每个规则都能解释、能
6464

6565
## 默认会清理什么
6666

67-
21 条规则由 18 条文件规则、1 条回收站动作和 2 条 Windows 托管动作组成。“日常清理”选择以下 7 条低风险文件规则:
67+
28 条规则由 25 条文件规则、1 条回收站动作和 2 条 Windows 托管动作组成。“日常清理”选择以下 8 条低风险文件规则:
6868

6969
- 当前用户 LocalAppData `Temp` 中超过 48 小时的临时文件;
7070
- Windows Temp 中超过 7 天的未占用文件;
7171
- CBS/DISM 中超过 30 天的归档维护日志;
72-
- Chrome、Edge、Firefox 的网页/代码/GPU 缓存;
72+
- Chrome、Edge、Firefox 的网页/代码/GPU/着色器缓存,以及 Chrome/Edge 的组件下载缓存;
73+
- 新版 Outlook 的 Edge WebView 缓存;
7374
- Discord、Slack 的 Chromium 缓存目录。
7475

75-
“深度清理”还会选择有内容的需确认文件规则,包括分开的用户 WER、机器 WER、崩溃转储、DirectX/NVIDIA/AMD 着色器缓存、NVIDIA/AMD/Intel 安装材料和缩略图缓存。回收站、传递优化和组件存储清理不会被两种模式自动选择。
76+
“深度清理”还会选择有内容的需确认文件规则,包括腾讯应用缓存/旧日志/微信更新包、VS Code 与 Codex 缓存、完美世界更新器旧包,以及原有的 WER、崩溃转储、驱动缓存和缩略图缓存。回收站、传递优化和组件存储清理不会被两种模式自动选择。
7677

7778
## 明确不会自动删除
7879

@@ -86,6 +87,10 @@ CDriveCare 的目标不是清得最多,而是在每个规则都能解释、能
8687
| `SoftwareDistribution\DataStore` | Windows Update 数据库,不是普通下载缓存 |
8788
| Prefetch、事件日志、搜索索引 | 清理收益小,可能降低性能或损失诊断信息 |
8889
| Program Files、整个 AppData/ProgramData | 应用数据边界不明确,不能按目录名猜测 |
90+
| Chrome/Edge 的 Service Worker、IndexedDB、本地 AI 模型 | 可能包含离线站点数据、用户状态或数 GB 需重新下载的模型 |
91+
| OneDrive、Microsoft Store `Packages`、OpenAI 本地运行时 | 同步状态、应用状态或正在使用的程序文件,不是普通缓存 |
92+
| 腾讯插件/聊天/小程序数据、VS Code `User`/`WebStorage` | 用户数据与扩展状态,目录再大也不纳入规则 |
93+
| Ditto 数据库、IDM `DwnlData` | 分别是剪贴板历史和可续传的未完成下载 |
8994
| 注册表 | 不提供“注册表清理”;没有可靠的通用空间收益 |
9095

9196
## 架构

README_EN.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Quick start
1212

13-
1. Download `CDriveCare-v0.2.1-win.zip` from the latest [Release](https://github.com/sanrokamlan-prog/CDriveCare/releases/latest).
13+
1. Download `CDriveCare-v0.3.0-win.zip` from the latest [Release](https://github.com/sanrokamlan-prog/CDriveCare/releases/latest).
1414
2. Extract it and double-click `CDriveCare.exe`.
1515
3. Review the scan results, then select **Clean selected**.
1616

@@ -20,7 +20,7 @@ CDriveCare is a single-file Windows desktop utility with no telemetry or ads and
2020

2121
## Principles
2222

23-
- Ship 21 reviewed rules as a read-only embedded `rules.json` resource. The executable does not load a neighboring rules file, and startup fails closed on missing, unknown, duplicate, or misspelled fields as well as invalid IDs, contracts, age gates, or targets.
23+
- Ship 28 reviewed rules as a read-only embedded `rules.json` resource. The executable does not load a neighboring rules file, and startup fails closed on missing, unknown, duplicate, or misspelled fields as well as invalid IDs, contracts, age gates, or targets.
2424
- Scan first and show per-rule size, file count, risk, and impact.
2525
- Offer **Daily cleanup** for low-risk items and **Deep cleanup** for low-risk plus review-required file rules. Neither mode automatically selects the Recycle Bin or Windows-managed actions.
2626
- Never automatically delete Downloads, Windows Installer, Package Cache, DriverStore, WinSxS contents, Defender data, Prefetch, event logs, or broad application directories.
@@ -30,10 +30,11 @@ CDriveCare is a single-file Windows desktop utility with no telemetry or ads and
3030
- Re-read size and last-write time from that open handle; skip candidates changed or replaced since enumeration. CDriveCare never deletes directories, including empty cache directories.
3131
- Use supported Windows commands for Delivery Optimization and component-store maintenance.
3232
- Export a read-only driver inventory instead of guessing which DriverStore package is unused.
33+
- Open an analyzed AppData directory from the toolbar, double-click, Enter, or its context menu, and copy its full path without turning analysis results into deletion targets.
3334
- Check the fixed GitHub Releases endpoint in the background and show a download link only when a newer stable version exists. CDriveCare never downloads or installs updates automatically.
3435
- Keep per-run audit logs locally under `%LOCALAPPDATA%\CDriveCare\Logs`, retaining 30 days and at most 20 files. Log and driver-report output uses unique new files and validates directory/file handles before writing or rotation.
3536

36-
The 21-rule catalog contains 18 file rules, one Recycle Bin action, and two Windows-managed actions. User-scoped and machine-scoped WER are separate review-required rules; the latter requires administrator rights. When cancellation is requested during a Windows-managed command, that command is allowed to finish safely and later selected items are skipped.
37+
The 28-rule catalog contains 25 file rules, one Recycle Bin action, and two Windows-managed actions. New coverage includes narrowly scoped Chrome, Edge, Outlook WebView, Tencent, VS Code, Codex, and stale updater caches. Vendor-specific additions are review-required by default except for Outlook's explicit WebView cache. User-scoped and machine-scoped WER remain separate; the latter requires administrator rights.
3738

3839
See [rule safety](docs/rule-safety.md) and [architecture](docs/architecture.md) for the full design.
3940

RELEASE_NOTES.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
1-
# CDriveCare v0.2.1
1+
# CDriveCare v0.3.0
22

3-
此版本修复大量缓存文件清理时界面可能表现为卡住的问题
3+
此版本基于本机 C 盘目录审计扩充规则,并补齐空间分析结果的目录快捷操作
44

5-
## 清理响应修复
5+
## 新增和扩展规则
66

7-
- 审计日志仍完整写入本地文件,但界面日志改为分批刷新,避免海量跳过或失败记录挤满 WinForms 消息队列;
8-
- 每条规则开始处理时立即更新状态栏和进度,避免在大缓存项开始时长时间停留在泛化的“正在清理”状态;
9-
- 不改变扫描范围、文件删除检查、默认选择或 Windows 系统维护命令的安全边界。
7+
- 规则总数由 21 条增加到 28 条,其中 25 条为带年龄门槛的文件规则;
8+
- Chrome 与 Edge 增加 Dawn、Shader、组件和扩展下载缓存,仍排除 Service Worker、IndexedDB、Cookie、密码和本地 AI 模型;
9+
- 新增新版 Outlook Edge WebView 缓存,默认仅清理超过 24 小时的明确缓存文件;
10+
- 新增 WeGame/腾讯会议/微信缓存、腾讯应用旧日志和微信旧更新下载,均默认不选;
11+
- 新增 VS Code 和 Codex 桌面端缓存,排除用户设置、工作区、WebStorage、扩展状态、项目和 OpenAI 本地运行时;
12+
- 新增完美世界竞技平台更新器 pending 旧包,仅在存在 `update-info.json` 标记时匹配超过 14 天的 `.exe`,根目录当前安装器不在范围内。
1013

11-
## v0.2.0 的新版本提示
14+
## 空间分析快捷操作
1215

13-
- 启动后异步检查 GitHub 最新正式 Release,不阻塞 C 盘扫描;
14-
- 工具栏增加手动检查按钮;发现新版本时在状态栏显示可点击提示;
15-
- 只接受 CDriveCare 官方 GitHub 仓库的 HTTPS Release 地址;
16-
- 设置 6 秒超时和 256 KiB 响应上限;
17-
- 不自动下载、不静默安装、不在高权限进程中替换 EXE;
18-
- 不上传扫描结果、日志、文件名、设备信息或唯一标识;
19-
- 可通过 `--no-update-check` 关闭启动检查。
16+
- 工具栏文件夹按钮可打开所选目录;
17+
- 双击行或按 Enter 可直接在资源管理器中打开;
18+
- 右键菜单提供“打开目录”和“复制路径”;
19+
- 分析结果仍是只读数据,不能转成自定义清理路径。
2020

21-
## GitHub Actions 发布
21+
## 本机审计后继续排除
2222

23-
- 本地 `build.ps1` 现在只负责编译和运行安全测试
24-
- 普通分支构建的 ZIP、EXE 和 SHA-256 由 `build.yml` 生成
25-
- 推送 `vMAJOR.MINOR.PATCH` tag 后,`release.yml` 自动校验 tag、EXE 版本和本文件
26-
- 校验通过后由 GitHub Actions 创建 Release 并上传 `CDriveCare.exe`、版本化 ZIP 与 `SHA256SUMS.txt`
27-
- 正式二进制不再由开发机手工打包或上传
23+
- Chrome/Edge 的 Service Worker、IndexedDB、站点存储和本地 AI 模型
24+
- OneDrive、Microsoft Store `Packages`、OpenAI/Codex 本地运行时
25+
- 腾讯聊天、小程序、插件和会议动态资源
26+
- VS Code `User``WebStorage`,Ditto 剪贴板数据库和 IDM 未完成下载
27+
- `$WINDOWS.~BT``Windows\Panther`、Windows Installer、DriverStore、WinSxS、Defender、Prefetch 和注册表
2828

29-
## 延续的安全边界
29+
Windows 升级残留继续建议通过“设置 > 系统 > 存储 > 临时文件”处理,不做原始目录删除。
3030

31-
- 默认只选择低风险规则,回收站与 Windows 托管动作始终手选;
32-
- 不自动删除 Downloads、Installer、DriverStore、WinSxS 内容、Defender 数据、Prefetch 或注册表;
33-
- 文件删除继续使用最终物理路径、年龄、大小、Reparse Point 和替换检查;
34-
- 程序不删除目录。
31+
## 发布与安全边界
3532

36-
## 注意
37-
38-
- 支持 Windows 10 22H2 与 Windows 11
39-
- 当前二进制未进行商业代码签名,SmartScreen 可能显示未知发布者
40-
- 请仅从本仓库 Release 下载,并使用 `SHA256SUMS.txt` 核对文件
33+
- 正式 EXE、ZIP 和 `SHA256SUMS.txt` 继续只由 GitHub Actions 构建和发布;
34+
- 默认只选择低风险规则,腾讯、开发工具和第三方更新器规则均需用户明确选择;
35+
- 删除前继续复核最终物理路径、年龄、大小、Reparse Point 和文件身份
36+
- 程序不会强制结束应用,不删除任何目录,锁定文件会记录并跳过
37+
- 支持 Windows 10 22H2 与 Windows 11;当前二进制未进行商业代码签名

docs/architecture.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ CDriveCare 把“发现空间”“判断是否可清理”“执行删除”和
88

99
| 模块 | 责任 | 明确不负责 |
1010
| --- | --- | --- |
11-
| `RuleManifestLoader` / `CleanupCatalog` | 从 EXE 内的只读 `rules.json` 加载 21 条规则,严格校验 JSON 结构并公开为只读目录,同时计算清单 SHA-256 | 忽略未知/拼错字段、读取外部规则、接受任意路径或命令 |
11+
| `RuleManifestLoader` / `CleanupCatalog` | 从 EXE 内的只读 `rules.json` 加载 28 条规则,严格校验 JSON 结构并公开为只读目录,同时计算清单 SHA-256 | 忽略未知/拼错字段、读取外部规则、接受任意路径或命令 |
1212
| `KnownFolders` / `PathSafety` | 通过 Windows Known Folder API 解析固定 token,执行完整路径规范化、系统盘边界、受保护目录和 Reparse Point 检查 | 展开任意环境变量或判断文件业务用途 |
1313
| `FileScanner` | 在规则边界内只读枚举,应用年龄和文件名模式,统计候选 | 缓存候选路径后直接删除 |
1414
| `CleanerService` / `SafeFileDeleter` | 重新枚举,打开规则根与候选句柄,验证最终物理路径后通过句柄删除,跳过锁定项并汇总结果 | 强制结束进程或删除规则根 |
1515
| `SystemActions` | Shell 回收站 API、Delivery Optimization、DISM、PnPUtil 报告 | 直接删除系统数据库和 DriverStore |
16-
| `LargeFolderAnalyzer` | 并行统计当前用户 AppData 顶级目录 | 删除、移动、创建 Junction |
16+
| `LargeFolderAnalyzer` | 并行统计当前用户 AppData 顶级目录,并把结果交给 UI 打开或复制路径 | 删除、移动、创建 Junction,或把分析结果变成清理目标 |
1717
| `AuditLogger` / `SafeDirectoryLease` | 以目录与文件句柄验证最终输出路径,按次记录结果并安全轮换旧日志 | 跟随输出目录 Junction、覆盖已有文件、上传日志或收集遥测 |
1818
| `UpdateService` | 限时请求固定 GitHub API,限制响应大小、解析稳定版本并验证 Release URL | 下载/安装更新、上传扫描数据、跟随外部重定向地址 |
1919
| `MainForm` | 展示、选择、确认、取消、实际空间复测 | 接受用户输入的自定义删除路径 |
@@ -35,7 +35,7 @@ sequenceDiagram
3535
participant C as CleanerService
3636
participant A as AuditLogger
3737
38-
UI->>M: Load and strictly validate 21 rules
38+
UI->>M: Load and strictly validate 28 rules
3939
M-->>UI: Immutable catalog or fail closed
4040
UI->>S: ScanRule(rule)
4141
S->>G: Resolve Known Folder token and validate roots
@@ -62,6 +62,8 @@ sequenceDiagram
6262
- **深度清理**:选择扫描到内容的低风险和需确认文件规则,包括分开的用户 WER 与机器 WER。
6363
- **始终手动**:回收站和 Windows 托管动作不会被任一模式自动选择;执行前仍显示影响并确认。
6464

65+
空间分析与清理目录严格分离。表格行只保存 `LargeFolderAnalyzer` 返回的现有路径,用于资源管理器打开和复制文本;双击、回车、右键菜单与工具栏最终调用同一个只读打开方法,不能将路径提交给 `CleanerService`
66+
6567
## 失败模型
6668

6769
- 单个文件拒绝访问、正在使用、路径过长或瞬间消失:记录并跳过,继续当前规则。

0 commit comments

Comments
 (0)