Skip to content

v2.0.7 — use the REA the machine already has

Choose a tag to compare

@czcdr czcdr released this 18 Oct 04:58
· 39 commits to main since this release

2.0.7

机器上已有可用的 REA 时,2.x 直接按 1.x 的方式跑它,不再供给。

机器上的情况 这一行跑什么
rea 在 PATH 上,且不比供给的版本旧 你自己那份(rea mcp),用你的 Node 和你的 PATH
rea 在 PATH 上但更旧 供给的 bundle(旧的全局 CLI 会把工具数往回退:6.4.0=170,6.5.0=207)
PATH 上没有 rea 供给的 bundle,首次使用自行供给
  • REA_BUNDLE_LAUNCH=auto|system|bundle(默认 auto)、REA_BUNDLE_SYSTEM_REA=<path> 点名不在 PATH 上的二进制;--shim-status 报告 launch.{mode,reason,unusable,systemRea,rejected}。
  • 探测用 CLI 自己的 --version,上限 8 秒(Windows 的 .cmd 垫片实测 ~2.4 秒);超时按进程树清理,不留活进程。
  • 委派出去的子进程带 REA_BUNDLE_DELEGATED=1,wrapper 无法让它无限委派给自己。

同时收紧 2.0.6 的宿主声明:engines.dsh 上限从 <0.3.0 改为 <0.3.0-0 —— includePrerelease 语义下前者会放行 0.3.0-alpha.1/0.3.0-rc.1,那是没人核对过的宿主。已用插件市场自己的 satisfiesRange 逐版本核对。

两轮独立复核发现的缺陷已修:.cmd 委派时参数被加引号(%* 收到 "mcp");3 秒探测预算与真机 2.4 秒同量级导致检测成掷硬币;Windows 上 SIGINT 只杀掉 cmd.exe 包装(REA 仍在跑);--shim-status 对「点名 system 但不可用」返回 0;existsSync 接受目录;PATH 项未规范化;fail() 的补救命令缺 --root;bootstrap 忽略 REA_BUNDLE_ROOT。

验证:单测 60 条(57 过 + 3 平台跳过,新增 12 条覆盖启动模式/PATH 发现/含空格路径/退出码透传/自委派防护/声明钉住/泄漏反向对照);verify-branch.ps1 全绿;audit-manifest clean;host-compat 10 covered / 5 correctly outside。真机:全局 6.4.0 与供给 6.5.0 并存时 auto 留 bundle,system 才切。


New: the row runs the REA already installed on the machine (the 1.x contract) instead of provisioning, with a version guard so a stale global CLI cannot walk the tool count backwards. REA_BUNDLE_LAUNCH=auto|system|bundle, REA_BUNDLE_SYSTEM_REA=<path>, and a launch block in --shim-status. Also: engines.dsh ceiling tightened to <0.3.0-0 (the previous <0.3.0 admitted 0.3.0 prereleases under includePrerelease), plus fixes for defects found by two independent reviews — quoted delegation arguments, a 3 s probe budget against a measured 2.4 s CLI, Windows signal forwarding that killed only the wrapper, a wrong --shim-status exit code, directory-shaped candidates, unnormalised PATH entries, a --root-less remediation command, and bootstrap ignoring REA_BUNDLE_ROOT.