@namewta/speculo 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +3 -2
  2. package/dist/src/structured.js +1 -1
  3. package/dist/src/structured.js.map +1 -1
  4. package/package.json +1 -1
  5. package/template/commands/archive-and-consolidate.md +39 -3
  6. package/template/commands/git-history-squash.md +76 -0
  7. package/template/skills/archive-and-consolidate/SKILL.md +1 -1
  8. package/template/skills/archive-and-consolidate/references/entry-procedure.md +11 -3
  9. package/template/skills/git-history-squash/SKILL.md +2 -0
  10. package/template/skills/git-history-squash/references/entry-procedure.md +1 -1
  11. package/template/workflows/ops/A-archive-and-learn/A-archive-and-learn.md +2 -0
  12. package/template/workflows/ops/H-computer-hygiene/H-computer-hygiene.md +105 -0
  13. package/template/workflows/ops/H-computer-hygiene/examples/README.md +9 -0
  14. package/template/workflows/ops/H-computer-hygiene/examples/linux/2026-09-14.environment.md +45 -0
  15. package/template/workflows/ops/H-computer-hygiene/examples/linux/2026-09-14.json +970 -0
  16. package/template/workflows/ops/H-computer-hygiene/examples/linux/2026-09-14.md +216 -0
  17. package/template/workflows/ops/H-computer-hygiene/examples/macos/2026-09-14.environment.md +45 -0
  18. package/template/workflows/ops/H-computer-hygiene/examples/macos/2026-09-14.json +970 -0
  19. package/template/workflows/ops/H-computer-hygiene/examples/macos/2026-09-14.md +216 -0
  20. package/template/workflows/ops/H-computer-hygiene/examples/windows/2026-09-14.environment.md +45 -0
  21. package/template/workflows/ops/H-computer-hygiene/examples/windows/2026-09-14.json +969 -0
  22. package/template/workflows/ops/H-computer-hygiene/examples/windows/2026-09-14.md +216 -0
  23. package/template/workflows/ops/H-computer-hygiene/references/00-sources.md +58 -0
  24. package/template/workflows/ops/H-computer-hygiene/references/01-safety.md +52 -0
  25. package/template/workflows/ops/H-computer-hygiene/references/10-windows.md +47 -0
  26. package/template/workflows/ops/H-computer-hygiene/references/11-macos.md +46 -0
  27. package/template/workflows/ops/H-computer-hygiene/references/12-linux.md +13 -0
  28. package/template/workflows/ops/H-computer-hygiene/references/20-toolchains.md +83 -0
  29. package/template/workflows/ops/H-computer-hygiene/references/21-path-migration.md +64 -0
  30. package/template/workflows/ops/H-computer-hygiene/references/22-repositories.md +35 -0
  31. package/template/workflows/ops/H-computer-hygiene/references/30-software-removal.md +41 -0
  32. package/template/workflows/ops/H-computer-hygiene/references/40-report-spec.md +54 -0
  33. package/template/workflows/ops/H-computer-hygiene/references/50-speculo-integration.md +26 -0
  34. package/template/workflows/ops/H-computer-hygiene/references/source-register.json +406 -0
  35. package/template/workflows/ops/H-computer-hygiene/rules/catalog.json +191 -0
  36. package/template/workflows/ops/H-computer-hygiene/scripts/hygiene.py +1348 -0
  37. package/template/workflows/ops/H-computer-hygiene/scripts/run.ps1 +7 -0
  38. package/template/workflows/ops/H-computer-hygiene/scripts/run.sh +5 -0
  39. package/template/workflows/ops/H-computer-hygiene/templates/config.example.json +13 -0
  40. package/template/workflows/ops/H-computer-hygiene/templates/maven-settings.fragment.xml +6 -0
  41. package/template/workflows/ops/H-computer-hygiene/templates/native-evidence.example.json +19 -0
  42. package/template/workflows/ops/H-computer-hygiene/tests/cli_smoke.py +65 -0
  43. package/template/workflows/ops/H-computer-hygiene/tests/make_examples.py +114 -0
  44. package/template/workflows/ops/H-computer-hygiene/tests/test_hygiene.py +486 -0
  45. package/template/workflows/ops/README.md +9 -3
  46. package/template/workflows/ops/common/rules/artifact-contract.md +2 -1
  47. package/template/workflows/ops/common/rules/closure-and-learning.md +2 -0
  48. package/template/workflows/ops/common/schemas/change-status.schema.json +2 -2
  49. package/template/workflows/ops/common/tools/validate-ops.mjs +29 -6
  50. package/template/workflows/ops/manifest.json +1 -1
@@ -0,0 +1,216 @@
1
+ # 2026-09-14 电脑环境与清理检测报告
2
+
3
+ **测试示例:SYNTHETIC_FIXTURE_NOT_YOUR_COMPUTER。数据来自隔离 fixture,不代表任何用户的真实电脑。**
4
+
5
+ 运行 ID:`4c413d09b58a`;开始:2026-09-14T08:44:02.779627+00:00;完成:2026-09-14T08:44:02.783712+00:00。
6
+
7
+ ## 1. 结论与空间口径
8
+
9
+ 系统:**Linux / SIMULATED_ARCHITECTURE**。本次发现 6 条待复核事项;可选隔离候选 3 项,自动永久删除动作 **0** 项。检测没有启动包管理器、连接网络、卸载软件或修改环境配置。
10
+
11
+ Home 所在卷剩余:120.00 GiB / 512.00 GiB。测量范围内按文件标识去重的逻辑大小:174.09 KiB;这**不是可释放空间**。扫描不完整时是已观察下界;硬链接、克隆、压缩、稀疏文件及文件系统特性会影响实际释放量。
12
+
13
+ **隔离只是同卷重命名,不释放磁盘空间。** 缓存重新生成可能需要网络,mtime 不等于最后使用时间;所有删除、迁移、卸载和系统改动仍需逐项授权。
14
+
15
+ 执行环境线索:\{"fixture\_only": true\}。若在容器、SSH 主机或 WSL 中运行,报告针对该执行环境,不自动代表桌面宿主机。
16
+
17
+ ## 2. 覆盖范围与缺口
18
+
19
+ | 范围 | 状态 | 说明 |
20
+ | --- | --- | --- |
21
+ | environment | partial | Process PATH and curated path variables inspected; no shell evaluation, tool execution or effective-version proof. |
22
+ | configuration | partial | Known profile anchors and allowlisted Maven/npm path fields; no credentials, includes, project overrides, or effective execution. |
23
+ | storage | partial | Known defaults and declared locations; per-tree/global budgets; no full-disk crawl; custom tool defaults may be missed. |
24
+ | projects | partial | Authorized roots only; depth <= 3; repository content/state/remote ownership not verified. |
25
+ | applications/startup | SIMULATED-NOT-NATIVE | Synthetic application metadata only; no real registry, Applications, launchd or service reads. |
26
+ | loose-files/duplicates | partial | Downloads direct-child installers/archives/large-file metadata only. No content hashes, full-disk duplicate proof, Documents/Desktop traversal or personal-data deletion. |
27
+
28
+ 已访问元数据条目:38;全局预算耗尽:False。不是全盘完整性证明。
29
+
30
+ No complete disk or effective-tool-version claim.
31
+
32
+ Stat calls on an unrecognized remote filesystem may block; budgets are cooperative, not OS I/O deadlines.
33
+
34
+ No universal detection of bind mounts, macOS firmlinks, APFS clones or same-device remote mappings.
35
+
36
+ Metadata mtime is not last-use evidence; content-identical duplicates not proven.
37
+
38
+ Current user's report does not cover other users, WSL guest systems or all external volumes.
39
+
40
+ Disk capacity, architecture and application identity are illustrative fixture values, not real measurements.
41
+
42
+ ## 3. 优先处理清单
43
+
44
+ | ID | 风险 | 发现 | 证据 | 建议 |
45
+ | --- | --- | --- | --- | --- |
46
+ | F0001 | R1 | PATH 字面重复项 | \{"index": 3, "value": "~/bin-primary", "expanded": "~/bin-primary", "status": "exists", "linklike": false, "duplicate\_of": 1\} | 保留必要优先级,备份后只修改产生重复的配置来源。 |
47
+ | F0002 | R1 | PATH 目录当前不存在 | \{"index": 4, "value": "~/missing-bin", "expanded": "~/missing-bin", "status": "missing", "linklike": false\} | 排除未挂载磁盘、会话级 shims 与延迟创建路径后再移除。 |
48
+ | F0003 | R2 | java 有多个 PATH 命中 | \["~/bin-primary/java", "~/bin-old/java"\] | 在可信终端核实实际版本和主用管理器;多个路径不等于冗余安装。 |
49
+ | F0004 | R2 | JAVA\_HOME 出现在多个 profile 位置 | \[\{"path": "~/.profile", "line": 1\}, \{"path": "~/.zshrc", "line": 1\}\] | 只是静态出现记录,未证明重复赋值或加载顺序;人工核实生效 shell 后整合。 |
50
+ | F0005 | R2 | 项目位于易被清理的位置 | ~/Downloads/source-clone | 先保全仓库状态与唯一数据,再规划项目根;位置不规范不等于允许删除。 |
51
+ | F0006 | R2 | 同一项目有多个 Node 包管理锁文件 | \{"path": "~/Projects/example-web", "locks": \["package-lock.json", "pnpm-lock.yaml"\]\} | 确认实际管理器、迁移期和 CI 约束;不自动删除任一锁文件。 |
52
+
53
+ 风险:R0 观察;R1 缓存候选;R2 可能影响离线构建或应用;R3 系统/应用数据级;P 保护项。等级低不代表允许自动删除。
54
+
55
+ ## 4. PATH 与工具解析
56
+
57
+ | 序号 | 当前项 | 状态 | 重复于 |
58
+ | --- | --- | --- | --- |
59
+ | 1 | ~/bin-primary | exists | — |
60
+ | 2 | ~/bin-old | exists | — |
61
+ | 3 | ~/bin-primary | exists | 1 |
62
+ | 4 | ~/missing-bin | missing | — |
63
+
64
+ | 工具 | PATH 候选首项 | 全部命中 | 实际版本 |
65
+ | --- | --- | --- | --- |
66
+ | java | ~/bin-primary/java | \["~/bin-primary/java", "~/bin-old/java"\] | 未执行,未知 |
67
+ | javac | — | \[\] | 未执行,未知 |
68
+ | mvn | — | \[\] | 未执行,未知 |
69
+ | mvnw | — | \[\] | 未执行,未知 |
70
+ | gradle | — | \[\] | 未执行,未知 |
71
+ | node | — | \[\] | 未执行,未知 |
72
+ | npm | — | \[\] | 未执行,未知 |
73
+ | npx | — | \[\] | 未执行,未知 |
74
+ | corepack | — | \[\] | 未执行,未知 |
75
+ | pnpm | — | \[\] | 未执行,未知 |
76
+ | go | — | \[\] | 未执行,未知 |
77
+ | rustc | — | \[\] | 未执行,未知 |
78
+ | cargo | — | \[\] | 未执行,未知 |
79
+ | rustup | — | \[\] | 未执行,未知 |
80
+ | python | — | \[\] | 未执行,未知 |
81
+ | python3 | — | \[\] | 未执行,未知 |
82
+ | uv | — | \[\] | 未执行,未知 |
83
+ | uvx | — | \[\] | 未执行,未知 |
84
+ | pip | — | \[\] | 未执行,未知 |
85
+ | pipx | — | \[\] | 未执行,未知 |
86
+ | mise | — | \[\] | 未执行,未知 |
87
+ | asdf | — | \[\] | 未执行,未知 |
88
+ | fnm | — | \[\] | 未执行,未知 |
89
+ | volta | — | \[\] | 未执行,未知 |
90
+ | nvm | — | \[\] | 未执行,未知 |
91
+ | pyenv | — | \[\] | 未执行,未知 |
92
+ | jenv | — | \[\] | 未执行,未知 |
93
+ | scoop | — | \[\] | 未执行,未知 |
94
+ | brew | — | \[\] | 未执行,未知 |
95
+ | winget | — | \[\] | 未执行,未知 |
96
+
97
+ PATH 查找不解析 shell alias/function、版本管理器 shim 内部逻辑或 IDE 环境;nvm 等函数型工具可能不会出现。
98
+
99
+ ## 5. 配置来源
100
+
101
+ | 路径 | 状态 | 允许记录的字段 |
102
+ | --- | --- | --- |
103
+ | ~/.profile | inspected | \{"declarations": \[\{"variable": "JAVA\_HOME", "line": 1, "value": "not recorded; no evaluation"\}\]\} |
104
+ | ~/.zshrc | inspected | \{"declarations": \[\{"variable": "JAVA\_HOME", "line": 1, "value": "not recorded; no evaluation"\}\]\} |
105
+ | ~/.m2/settings.xml | inspected | \{"localRepository": "~/.m2/repository", "sensitive\_sections\_recorded": false\} |
106
+ | ~/.cargo/config.toml | metadata-only | \{"note": "Potential configuration/credentials; content not exported. Effective values require trusted native queries."\} |
107
+
108
+ 当前进程的路径变量:
109
+
110
+ | 变量 | 值 |
111
+ | --- | --- |
112
+ | JAVA\_HOME | ~/old-jdk |
113
+ | GOCACHE | ~/.cache/go-build |
114
+ | CARGO\_HOME | ~/.cargo |
115
+
116
+ 持久化环境(Windows 可读范围):
117
+
118
+ 没有记录;请结合覆盖范围判断是不存在还是未检查。
119
+
120
+ ## 6. 工具链、依赖与缓存完整清单
121
+
122
+ | 类型 | 路径 | 状态 | 逻辑大小 | 风险 | 证据来源 / 说明 |
123
+ | --- | --- | --- | --- | --- | --- |
124
+ | maven-local-repository | ~/.m2/repository | measured | 18.00 KiB | P | settings.xml declaration, not effective configuration proof; known default hypothesis; not proof of active use — May contain unpublished artifacts installed locally; never blanket-delete. |
125
+ | gradle-home | ~/.gradle | absent | 未知 | P | known default hypothesis; not proof of active use — Contains configuration, caches, wrapper distributions and possibly credentials. |
126
+ | cargo-home | ~/.cargo | measured | 59.00 B | P | known default hypothesis; not proof of active use; process environment: CARGO\_HOME — Contains config, credentials, installed binaries, registry and Git stores. |
127
+ | rustup-home | ~/.rustup | absent | 未知 | R2 | known default hypothesis; not proof of active use — Installed toolchains; remove by exact toolchain through rustup after checking pins. |
128
+ | go-workspace | ~/go | absent | 未知 | P | known default hypothesis; not proof of active use — Can contain source code and installed tools, not a disposable cache. |
129
+ | uv-cache | ~/.cache/uv | absent | 未知 | R2 | known default hypothesis; not proof of active use — Use native uv cache commands after version verification; no automated moves. |
130
+ | pnpm-store | ~/.local/share/pnpm/store | absent | 未知 | R2 | known default hypothesis; not proof of active use — Version-dependent default hypothesis; use pnpm store path to establish actual location. |
131
+ | npm-home | ~/.npm | measured | 52.00 KiB | R2 | known default hypothesis; not proof of active use — May contain logs and other state; only \_cacache can qualify for quarantine. |
132
+ | nvm | ~/.nvm | absent | 未知 | R2 | known default hypothesis; not proof of active use — Version manager; includes per-version global packages. |
133
+ | volta | ~/.volta | absent | 未知 | R2 | known default hypothesis; not proof of active use — Version manager data; do not move without documented migration. |
134
+ | fnm | ~/.local/share/fnm | absent | 未知 | R2 | known default hypothesis; not proof of active use — Default hypothesis, verify with configuration. |
135
+ | mise | ~/.local/share/mise | absent | 未知 | R2 | known default hypothesis; not proof of active use — Support and path semantics must be checked against installed version. |
136
+ | asdf | ~/.asdf | absent | 未知 | R2 | known default hypothesis; not proof of active use — May contain plugins, shims and installed runtimes. |
137
+ | sdkman | ~/.sdkman | absent | 未知 | R2 | known default hypothesis; not proof of active use — Not assumed to support native Windows; WSL is a separate environment. |
138
+ | pyenv | ~/.pyenv | absent | 未知 | R2 | known default hypothesis; not proof of active use — Interpreters and virtualenvs may have absolute prefix references. |
139
+ | jdk-user | ~/.jdks | absent | 未知 | R2 | known default hypothesis; not proof of active use — Often IDE-managed; verify IDE ownership and project JDK pins. |
140
+ | bun | ~/.bun | absent | 未知 | R2 | known default hypothesis; not proof of active use — Runtime and package state; not a pure cache. |
141
+ | docker-user-state | ~/.docker | absent | 未知 | P | known default hypothesis; not proof of active use — Configuration may include authentication and contexts; no content export or automated deletion. |
142
+ | npm-content-cache | ~/.npm/\_cacache | measured | 52.00 KiB | R1 | conservative default cache location — Recreation may need network; metadata age does not prove disuse. |
143
+ | pip-cache | ~/.cache/pip | measured | 52.00 KiB | R1 | conservative default cache location — Recreation may need network; metadata age does not prove disuse. |
144
+ | go-build-cache | ~/.cache/go-build | measured | 52.00 KiB | R1 | conservative default cache location; process environment: GOCACHE — Recreation may need network; metadata age does not prove disuse. |
145
+ | jdk-install | ~/old-jdk | absent | 未知 | R2 | process environment: JAVA\_HOME — |
146
+ | project-artifact-node\_modules | ~/Projects/example-web/node\_modules | measured | 38.00 B | R2 | authorized project inventory — Name is only a hint; may contain source, local-only data, editable installs or tracked outputs. Manual review only. |
147
+
148
+ 不完整测量与跳过:
149
+
150
+ 没有记录;请结合覆盖范围判断是不存在还是未检查。
151
+
152
+ ## 7. 项目、仓库与构建产物
153
+
154
+ | 项目 | 标记 | Git 类型 / 状态 | 构建产物候选 | 版本 pin / Node 声明 |
155
+ | --- | --- | --- | --- | --- |
156
+ | ~/Downloads/source-clone | \[\] | gitfile/worktree-or-submodule / unknown; Git commands not executed | \[\] | \{"packageManager": null, "pin\_files": \[\]\} |
157
+ | ~/Projects/example-web | \[".nvmrc", "package-lock.json", "package.json", "pnpm-lock.yaml"\] | directory / unknown; Git commands not executed | \["~/Projects/example-web/node\_modules"\] | \{"packageManager": "pnpm@9.0.0", "pin\_files": \[".nvmrc"\]\} |
158
+
159
+ 目录名相同不证明仓库冗余;未验证 Git 的未提交/未推送内容、worktree、submodule、LFS 和分支。`build`、`dist`、`target` 或 `.venv` 可能含独有数据,不提供自动删除动作。
160
+
161
+ ## 8. 软件、启动项与卸载残留线索
162
+
163
+ | 应用 | 版本 | 身份/路径 | 系统组件 | 处理方式 |
164
+ | --- | --- | --- | --- | --- |
165
+ | Example Editor | 1.0-fixture | ~/Applications/Example Editor.app | False | fixture candidate; not real software and never uninstalled |
166
+
167
+ 没有记录;请结合覆盖范围判断是不存在还是未检查。
168
+
169
+ 启动项或可执行文件缺失仅是残留线索,不证明可删除。软件冗余必须核实架构、插件、项目依赖、许可证和个人数据选择。
170
+
171
+ | 平台读取缺口 |
172
+ | --- |
173
+ | Real OS inventory intentionally disabled for this example. |
174
+
175
+ ## 9. 下载资料与大文件复核
176
+
177
+ | 文件 | 逻辑大小 | 修改时间 | 处理 |
178
+ | --- | --- | --- | --- |
179
+ | ~/Downloads/old-installer.zip | 17.00 B | 2026-09-14T08:44:02.779491+00:00 | manual ownership/backup/content review; not a deletion candidate |
180
+
181
+ 没有读取这些文件内容、计算重复文件哈希或证明安装包已不再需要。个人资料与备份默认保留。
182
+
183
+ ## 10. 可选隔离计划
184
+
185
+ | 动作 ID | 缓存 | 路径 | 逻辑大小 | 释放空间 |
186
+ | --- | --- | --- | --- | --- |
187
+ | Q-b7c81bf877 | npm-content-cache | ~/.npm/\_cacache | 52.00 KiB | 否 |
188
+ | Q-9c24086cc8 | pip-cache | ~/.cache/pip | 52.00 KiB | 否 |
189
+ | Q-c7057cdfde | go-build-cache | ~/.cache/go-build | 52.00 KiB | 否 |
190
+
191
+ 计划有效期 24 小时,绑定主机与元数据快照。仅支持默认位置中结构可识别的 npm 内容缓存、pip 缓存和 Go 构建缓存;自定义路径、链接、硬链接、占位文件、扫描不全或近期变化会排除。执行前必须关闭相关工具,并以用户选中的 ID 审批。
192
+
193
+ ## 11. 原生清理与彻底卸载:待确认步骤
194
+
195
+ | 类别 | 风险 | 执行前要求 | 参考 |
196
+ | --- | --- | --- | --- |
197
+ | maven | R2 | 核实 settings.xml、-Dmaven.repo.local、IDE 与项目参数;本地仓库可能含未发布的 install 产物,先备份,不整体删除。 | 20-toolchains.md#java-maven-gradle |
198
+ | node-pnpm | R2 | 可信终端中核实 Node 管理器、npm cache/prefix 与 pnpm store path;按本地帮助选择原生命令,清理 store 前检查离线需求及正在运行的安装。 | 20-toolchains.md#node-npm-pnpm |
199
+ | go-rust-uv | R2 | 核实 go env、rustup toolchain list、uv 路径命令;保留 Cargo 配置/凭据/安装工具,不把 Cargo Home、.venv 或 SDK 当缓存。 | 20-toolchains.md |
200
+ | repositories | P | 对已授权且可信的仓库检查提交、推送、分支、worktree、submodule 和 LFS;未完成前不得删除仓库、.git、vendor、锁文件或虚拟环境。 | 22-repositories.md |
201
+ | software | R3 | 先按精确应用身份使用官方卸载器,再单独确认用户数据与残留;共享运行库、驱动、服务、插件不能按名称推断可删。 | 30-software-removal.md |
202
+ | system | R3 | 仅通过对应系统参考文档使用原生存储管理功能;不直接删除系统组件、快照、容器卷、WSL 磁盘或云同步文件。 | 10-windows.md / 11-macos.md / 12-linux.md |
203
+
204
+ 系统分流:Windows → `10-windows.md`;macOS → `11-macos.md`;Linux → `12-linux.md`。容器、WSL 和系统快照不计入可自动清理空间。
205
+
206
+ ## 12. 环境归一化、验证与回滚
207
+
208
+ 阅读同目录 `2026-09-14.environment.md`。该文件结合本机路径变量生成建议映射,不会修改 PATH 或持久化配置。按生态逐项验证,保留回滚副本;用户同意检测不等于同意迁移。
209
+
210
+ 隔离执行使用写前日志;恢复入口为 `hygiene.py restore`,若原路径已被工具重建会拒绝覆盖,需人工合并。真正永久删除后不能承诺自动回滚;备份、离线依赖和应用数据要在删除前另行确认。
211
+
212
+ ## 13. 证据、资料与隐私
213
+
214
+ 本报告事实来源为本次本地元数据、允许的配置字段和系统可读清单。官方核验入口见 `references/00-sources.md`;交付时未在线访问,不能当作已核实的最新命令支持。执行原生操作前须验证本机版本、帮助及供应商文档。
215
+
216
+ Markdown/公开 JSON 把当前 home 替换为 `~`,但软件清单、目录名、其他账户路径及项目名称仍可能敏感,分享前需复核。`.plan.json` 和执行 receipt 含真实绝对路径,应只保存在本机私密目录。Windows 文件权限继承父目录 ACL;本脚本不声称设置了专用 DACL。
@@ -0,0 +1,45 @@
1
+ **模拟示例,不是已执行迁移。**
2
+
3
+ # 2026-09-14 环境归一化方案
4
+
5
+ **这是一份未执行的方案,不是已生效配置。** 先确认主用版本管理器与项目 pin;不得把统一目录理解成任意搬动所有 SDK。
6
+
7
+ 建议 DevRoot:`~/Developer/.tooling`。系统/安装器管理的内容仍留在系统规定的位置。路径可以统一规划,但不要通过联接/符号链接掩盖配置混乱。
8
+
9
+ ## 当前进程证据
10
+
11
+ | 变量 | 当前声明 |
12
+ | --- | --- |
13
+ | JAVA\_HOME | ~/old-jdk |
14
+ | GOCACHE | ~/Library/Caches/go-build |
15
+ | CARGO\_HOME | ~/.cargo |
16
+
17
+ 没有被记录的变量不等于工具未安装;未执行原生查询,无法确认 CLI、项目或 IDE 的最终优先级。
18
+
19
+ ## 建议映射
20
+
21
+ | 对象 | 建议目标 | 约束 |
22
+ | --- | --- | --- |
23
+ | JDK / JAVA\_HOME | 由已确认的主用版本管理器解析 | 不把 JAVA\_HOME 写死到待淘汰版本;IDE、CI、项目分别验证 |
24
+ | Maven localRepository | ~/Developer/.tooling/data/maven/repository | 保留 settings.xml 官方锚点;备份未发布的 install 产物;不假设 MAVEN\_USER\_HOME 对所有版本生效 |
25
+ | GRADLE\_USER\_HOME | ~/Developer/.tooling/data/gradle | 整体包含配置/缓存/凭据;先停止 daemon,备份再验证 |
26
+ | Node 版本管理器 | 保留一个经确认的主用管理器 | nvm/fnm/volta/asdf/mise 不叠加争抢入口;原生 Windows 支持单独核实 |
27
+ | npm cache | ~/Developer/.tooling/cache/npm | 使用 npm 官方配置入口;不盲目设置全局 prefix;日志不等于纯缓存 |
28
+ | PNPM\_HOME / pnpm store | ~/Developer/.tooling/bin/pnpm / ~/Developer/.tooling/cache/pnpm-store | 两个不同概念;store 路径用本地版本支持的配置设置,注意项目所在卷与硬链接 |
29
+ | GOPATH / GOBIN | ~/Developer/.tooling/data/go / ~/Developer/.tooling/bin/go | GOPATH 可能是多路径并含源码;GOBIN 中有用户安装的工具 |
30
+ | GOCACHE / GOMODCACHE | ~/Developer/.tooling/cache/go-build / ~/Developer/.tooling/cache/go-mod | 清理影响离线构建;一般不设置 GOROOT;先检查 go env 和项目 toolchain |
31
+ | CARGO\_HOME / RUSTUP\_HOME | ~/Developer/.tooling/data/cargo / ~/Developer/.tooling/data/rustup | 非纯缓存;保护 credentials、config、bin、toolchain override;不要整目录自动迁移 |
32
+ | UV\_CACHE\_DIR | ~/Developer/.tooling/cache/uv | 先以当前 uv 帮助确认变量支持与现有配置 |
33
+ | UV\_PYTHON\_INSTALL\_DIR / UV\_TOOL\_DIR | ~/Developer/.tooling/data/uv/python / ~/Developer/.tooling/data/uv/tools | 解释器、工具环境与缓存分开;虚拟环境不保证可重定位 |
34
+ | UV\_TOOL\_BIN\_DIR | ~/Developer/.tooling/bin/uv | 确认 shell PATH 与已安装工具入口;避免和 pipx/系统 Python 重名 |
35
+ | mise/asdf/SDKMAN 等 | ~/Developer/.tooling/data 下各自专属根 | 仅建议;按已安装管理器的真实 OS/版本文档迁移;不默认安装新管理器 |
36
+
37
+ ## 迁移顺序与验收
38
+
39
+ 先备份配置与安装清单,确认没有运行中的 IDE、daemon、构建或安装。逐个生态迁移,不同时改所有变量。缓存优先让工具在新路径重建;含本地状态的目录按官方迁移方法处理。虚拟环境与绝对路径 shim 通常应重建。
40
+
41
+ 先在新终端进行会话级验证,再修改单一持久化来源,最后重开终端、IDE 和构建任务验证。Windows 用户与机器 PATH 分开处理,禁止用 setx PATH 拼接覆盖;macOS 登录 shell、交互 shell、GUI 启动环境各自核实。
42
+
43
+ 逐一检查 Maven/JDK 构建、Node/pnpm 安装与离线依赖需求、Go 测试、Rust override 与 cargo 工具、uv 项目及 tool 入口。需要网络的验证单独确认;失败则恢复原配置和原解析入口。旧目录只有在全部验证通过、唯一数据已备份并再次获准后才进入清理计划。
44
+
45
+ PATH 仅放必要的 bin/shims;不要加入缓存、库目录、整个 SDK 根或当前目录。项目级 pin、wrapper 与 lockfile 保留。详见 `references/20-toolchains.md` 和 `21-path-migration.md`。