Files
ycode/docs/OMP内置分发-2026-10-18.md
T

26 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OMP 内置分发
日期:2026-10-18。按用户要求,将 OMP 从外部依赖改为 Windows x64 安装包内置,并重新生成 v0.01 分发包。
## 实现
- 固定上游 OMP 18.6.3。运行时锁记录发布地址、发布时间、字节数和 SHA-256:`resources/omp/runtime.lock.json`。
- `npm run omp:vendor` 从固定版本恢复资产并逐项校验;支持离线验证和用本地已校验副本导入。
- `npm run dist` / `npm run dist:installer` 在构建前自动执行 `omp:vendor`。
- Electron 打包将 `omp.exe`、MIT LICENSE、第三方声明和运行时锁复制到安装目录 `resources/omp/`。
- 运行时探测顺序:`YCODE_OMP_PATH` 显式覆盖、包内 `resources/omp/omp.exe`、兼容旧环境的 Ygent 安装、内置 HTTP 回退。正常安装包不依赖外部 Ygent。
- 新增路径回归和包内资产验证:`npm run test:omp:bundled`,打包后使用 `node scripts/verify-bundled-omp.cjs --packaged`。
## 验证
- `npm run omp:verify` 通过;OMP、LICENSE、第三方声明的大小和 SHA-256 全部匹配运行时锁。
- `npm run test:omp:bundled` 通过;无 `YCODE_OMP_PATH` 时解析到 `resources/omp/omp.exe`,`omp.exe --version` 返回 `omp/18.6.3`。
- 使用隔离临时 profile 完成真实 RPC 握手,收到 `{"type":"ready","protocolVersion":1,...}`,随后清理临时 profile。
- 安装程序归档包含 `resources/omp/omp.exe`(235,715,072字节)、LICENSE、THIRD-PARTY-NOTICES.txt 和 runtime.lock.json。
- 正式 `release/win-unpacked/YCode.exe` 在空用户数据目录启动;生产 IPC 返回 OMP 可用,实际 `exePath` 为包内 `resources/omp/omp.exe`。10项包内容与启动检查通过,0个未捕获 renderer 异常。报告 `.tmp/release-v001-mfDVCw/report.json`。
- 最终安装程序为 `release/YCode-v0.01-Setup-x64.exe`,246,498,049字节(235.08MiB),SHA-256 `4a8ceaeb1dd12bfc228911c2d586a7db2f4682b02b995c62602e7b14e6830184`。当前未签名。
## 限制
本轮验证使用已安装的正式 Electron 构建并在隔离用户目录启动,没有实际执行 NSIS 安装/卸载。未验收干净 Windows 设备、标准用户权限、硬件加速全路径及所有业务功能。包内 OMP仅覆盖 Windows x64;其他平台仍需提供对应运行时。