diff --git a/desktop/internal/toolchain/environment_link_other_test.go b/desktop/internal/toolchain/environment_link_other_test.go new file mode 100644 index 000000000..e9b83acce --- /dev/null +++ b/desktop/internal/toolchain/environment_link_other_test.go @@ -0,0 +1,99 @@ +//go:build !windows + +package toolchain + +import ( + "context" + "encoding/json" + "os" + "path/filepath" + "testing" + "time" + + "github.com/1lck/Lithe-IDEA/desktop/internal/core" +) + +// runtimeManifestLinkingOutside is the fixture runtime whose definition lets +// its program link outside the home. +func runtimeManifestLinkingOutside(t *testing.T) json.RawMessage { + t.Helper() + var manifest map[string]any + if err := json.Unmarshal(readManifest(t, "runtime.plugin.json"), &manifest); err != nil { + t.Fatal(err) + } + definition := manifest["toolDefinitions"].([]any)[0].(map[string]any) + definition["executableLinksOutsideHome"] = true + encoded, err := json.Marshal(manifest) + if err != nil { + t.Fatal(err) + } + return encoded +} + +// A virtual environment's program links to its base installation outside the +// environment. Core accepts it only for a definition that allows it and only +// when the host recorded every directory on the layout path, here jre and +// jre/bin. The program is probed and started from the environment's layout +// path, never its target, so it still finds the environment it belongs to. +func TestAnEnvironmentProgramLinkedOutsideItsHomeStartsFromItsLayoutPath(t *testing.T) { + for _, allowed := range []bool{true, false} { + name := "definition-allows-it" + if !allowed { + name = "definition-keeps-the-program-inside" + } + t.Run(name, func(t *testing.T) { + root, home, base, environment := t.TempDir(), t.TempDir(), t.TempDir(), t.TempDir() + baseProgram := filepath.Join(base, "jre", "bin", "vm") + writeExecutable(t, baseProgram) + bin := filepath.Join(environment, "jre", "bin") + if err := os.MkdirAll(bin, 0o755); err != nil { + t.Fatal(err) + } + if err := os.Symlink(baseProgram, filepath.Join(bin, "vm")); err != nil { + t.Fatal(err) + } + canonicalEnvironment := canonical(t, environment) + program := filepath.Join(canonicalEnvironment, "jre", "bin", "vm") + // Only the layout path answers: probing the base program would + // leave the environment. + options := fixtureOptions(home, environment, map[string]string{program: "vm 7.1\n"}) + manifest := readManifest(t, "runtime.plugin.json") + if allowed { + manifest = runtimeManifestLinkingOutside(t) + } + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + snapshot, err := Load(ctx, core.NewClient(), root, ".", []json.RawMessage{manifest}, options) + if err != nil { + t.Fatal(err) + } + if len(snapshot.Tools) != 1 { + t.Fatalf("tools = %+v", snapshot.Tools) + } + effective := snapshot.Tools[0].Effective + if !allowed { + if effective != nil { + t.Fatalf("selected %s although the definition keeps its program inside the home", effective.Executable) + } + return + } + if effective == nil { + for _, trace := range snapshot.Tools[0].Trace { + if trace.Reason != nil { + t.Logf("trace reason = %s", trace.Reason.Code) + } + } + t.Fatal("the environment was not selected") + } + if filepath.Clean(effective.Executable) != program || effective.Version != "7.1" { + t.Fatalf("selection = %s %s, want %s 7.1", effective.Executable, effective.Version, program) + } + if effective.Home == nil || filepath.Clean(*effective.Home) != canonicalEnvironment { + t.Fatalf("home = %v, want %s", effective.Home, canonicalEnvironment) + } + if got := effective.Environment["FICTIONAL_VM_HOME"]; filepath.Clean(got) != canonicalEnvironment { + t.Fatalf("FICTIONAL_VM_HOME = %s, want %s", got, canonicalEnvironment) + } + }) + } +} diff --git a/desktop/internal/toolchain/provider.go b/desktop/internal/toolchain/provider.go index 32b78300b..6aeb34273 100644 --- a/desktop/internal/toolchain/provider.go +++ b/desktop/internal/toolchain/provider.go @@ -249,11 +249,15 @@ func providerAbsolutePath(path string) bool { filepath.IsAbs(path) && filepath.Clean(path) == filepath.FromSlash(path) } +// observeToolHome records the facts Core needs to check an external home: the +// home, every directory on each layout path and the program with its link target, +// and the PATH directories. A program that links outside its home is accepted only +// when Core sees each directory on the way stay inside the home. func (w *workspace) observeToolHome(home string, definition core.ToolchainToolDefinition) { w.observe(home) for _, layout := range definition.ExecutableLayouts { if platformMatches(layout.Platforms, w.platform) { - w.observe(filepath.Join(home, filepath.FromSlash(layout.Path))) + w.observeChain(home, filepath.Join(home, filepath.FromSlash(layout.Path))) } } for _, template := range definition.PathPrepend { diff --git a/scripts/desktop/build-desktop-core.sh b/scripts/desktop/build-desktop-core.sh index 7a97261d4..f8ea9523f 100755 --- a/scripts/desktop/build-desktop-core.sh +++ b/scripts/desktop/build-desktop-core.sh @@ -355,7 +355,11 @@ PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git" # context; #174 merged with that field under a new ui 1, and #175 makes choose an optional field # within ui 0 again. The sources are the same as the branch commit a50cea1 that the desktop # pinned before; only the protocol changelog differs. -PINNED_CORE_REVISION="dcb3d77f7a56e58f3d7c0aceea5b7df6986ed2e2" +# Lithe-core-rust branch feat/toolchain-leaf-links-outside-home at 33e6b60 (#177, not merged yet): +# a tool definition may set executableLinksOutsideHome, a toolDefinitions 0 addition, so a +# virtual environment's program that links to its base interpreter outside the home is accepted +# and started from its layout path; the directories on the way must stay inside the home. +PINNED_CORE_REVISION="33e6b601857e22a787e1a4ce26da2a24a1ce41ea" PROFILE="debug" CHECKOUT_ONLY="no" while [[ $# -gt 0 ]]; do diff --git a/shared/platform-feature-matrix/features/plugin-injected-toolchains.json b/shared/platform-feature-matrix/features/plugin-injected-toolchains.json index 58213b934..dd927fd83 100644 --- a/shared/platform-feature-matrix/features/plugin-injected-toolchains.json +++ b/shared/platform-feature-matrix/features/plugin-injected-toolchains.json @@ -32,7 +32,8 @@ ".github/workflows/desktop-ci.yml", "desktop/internal/toolchain/load.go", "desktop/internal/settingswindow/toolchains_state.go", - "desktop/internal/settingswindow/build_style.go" + "desktop/internal/settingswindow/build_style.go", + "desktop/internal/toolchain/environment_link_other_test.go" ] }, "windows": { @@ -63,7 +64,7 @@ }, "owner": "Plugin Platform", "verification": "共享 Core:cargo test --manifest-path rust/Cargo.toml -p lithe-core --lib toolchain,核对定义独占与官方短 ID、第二种通用工具、旧候选边界、答案身份/代次、Windows 路径大小写、工作区排除、固定值失效不回落、最近项目要求、冲突选择、最低版本、环境隔离和纯声明扫描;按逐项计时工具生成 HTML/JUnit。macOS 继续补齐下列消费者与保存验收,Windows 须先实现对应 adapter:启动提供方并协商、取消/超时和过期结果隔离、输入新建/删除后整体重查、目录固定保存/取消/冲突回读、插件停用撤回、真实 Build/LSP/Run 消费者取得同一选择、发行目录哈希不变与子进程清理。未完成原生流程前保持 pending,不以 Core 测试代替实机验证。 提供方查询:cargo test -p lithe-core --lib toolchain(含 lsp 引擎脚本后端:只有插件后端被提供 litheToolchains、未协商的提供方不写请求、错误回复原样返回;别名链接只有链接路径事实时仍选中规范 home);MacToolchainDiscoveryTests 用真实临时目录与注入的查询验证全局与目录查询各带独立 operationID/代次、链接 home 规范化、工作区内 home 整份拒绝;ToolchainSettingsFeatureTests 验证监视文件连续变化只重载一次、外部输入观察随关闭释放。真实 mise 插件端到端尚未在应用内验证。 原生布局回归 ToolchainSettingsLayoutTests:同一设置宿主按900/1180/1400/900重复缩放,真实分隔条拖动;来源页按500/666/946/500缩放,检查AX控件边界、卡片不重叠、选择和快照不改变。此几何验证不代表提供方查询或保存功能已完成。 声明式扫描 MacToolchainDiscoveryTests:真实临时目录、注入的用户目录与探测,覆盖 homeLayouts 首个匹配、隐藏与未匹配条目、链接到工作区的条目不探测、只探测 Core 返回的可执行文件、同版本冲突、被拒声明不扫描,以及隔离预览样例清单通过 Core 准入;不运行本机安装的工具。 固定集成新增 MacToolchainDiscoveryTests 的运行前解析回归和 MacBuildToolResolverTests,验证两个目录使用各自 pin、最低版本、独立环境与失败不回落;RunLaunchEnvironmentTests 证明操作返回值不会留下共享执行许可槽。该测试不是完整应用 UI 验收。 生产准入回归 installedToolDeclarationsPassTheProductionHostAdmission 经 RustDeclarativePluginOperations 验证工具定义和提供者。Build PATH 保留声明的附加目录,拒绝空目录项。 Windows 原生解析基础:lithe-project::defined_toolchain 逐项计时覆盖两个工具、声明式扫描、固定目录、最近继承、同版本冲突、最低版本、显式 Wrapper、输入撤销及宿主秘密不进入 RPC。真实 Windows 命令包装和进程清理继续由现有 CI 验证;准入仍关闭。 本次回归另核对同目录两个 Run 独立选择、团队/本机逐项合并和显式清空、私有环境隔离、失效固定值不回落、工作区启动器被动零探测,以及未知默认值迁移失败保留源文件。 本批显式 LITHE_TEST_NODE 驱动真实 Core/Node 会话,逐项计时覆盖单次协商、多次查询、原始错误、无协商拒绝、静默超时、后端意外退出与撤销清理;原生解析验证查询与当前事实、来源在探测中变化及稳定模型摘要。安装状态按 plugin/operation/workspace 隔离且不可跨工作树复制。 #1581 最终合入回归包含固定值与未扫描目录、同轮次/上下文、冲突及提供方超时和不可用的来源展示。 通用默认增量:更改工作区工具 home 后,消费者继承读取新值,按 Run 固定值保持独立;失效明确路径不回落,来源在探测期间改变或越出工作区时拒绝。旧编辑保存保留通用偏好,显式空 v1 文档清除。矩阵保持 pending,未把手写测试文档当成设置页或旧配置迁移验收。 macOS Build 偏好编辑:ToolchainPreferencesTests 验证打开/草稿/取消/空重置不建文件、明确保存/回读与权限保留、外部冲突保留原始草稿基线、仅偏好文档不阻断旧默认迁移、缺失子目录的父链接/最终链接/只读安装目录拒绝及主动取消;原生 Save/Reset 按钮在深浅主题通过实际存储执行。ToolchainSettingsLoaderTests 验证使用方来自当前 Core invocation 并随停用撤回。运行全量 Core 与相关 macOS 逐项计时;完整产品、全局默认、旧消费者和 Windows 设置页仍待验收。 tool 引用验证:共享 fixture/Core 覆盖最近通用目录、根目录、跳过父消费者、目录与工作区默认变化、显式 Run 优先和禁止通用工具反向引用;MacToolchainDiscoveryTests 与 lithe-project::defined_toolchain 的真实临时安装/注入探测验证运行前重读,不冻结安装路径。 本机目录/重载回归覆盖仅消费者偏好、父目录连接、重置撤回、链接/非法层级拒绝、单次重试与可刷新错误、未修改表单更新、冲突草稿保留及自身保存通知不等待/撤销保存。该集成不代替完整 GUI。 运行前来源审计 missingPreferenceLeafBehindAParentAliasIsRejectedBeforeToolWork 覆盖两级父目录及存在/悬空链接,四种情况均在工具探测前拒绝。 ToolchainPluginAdmissionTests 使用正式契约 fixture 与真实 Core 验证市场可安装、完整安装审查、清单加载,以及无后端纯工具定义插件的启用模块和工厂登记;本地编译验证不代替真实 mise 与 Windows 工作流验收。 2026-11-02 本机 Swift 6.4.2:准入、后端、发现和加载器 42 项通过,新增两个准入用例分别 4/6 ms;Swift 6.3.3 在本机 Xcode 27.2 SDK 下编译依赖清单崩溃,不能作为固定工具链通过。真实 mise 0.2.1 发布包 SHA-256 与市场一致,Core 证明修复前 unsupported、修复后 available;真实后端完成协商、查询并停止销毁,当前环境未安装 mise,查询真实返回 miseNotFound,未验证安装列表和应用内工作流。 增补来源保存验收:不存在的 pin 重置不创建状态;拒绝逃出工作区的符号链接/junction;有界 UTF-8 与重复键、未知字段和 dormant pin 校验;Git 后续否定规则、换行/评论/权限保留;公开字节基线不可替代私有快照;已提交但回读失败必须重新加载后才能重试。 Viva 全局 SDK 页:运行 TestVisualSettings/33-settings-toolchains,使用 en、zh-Hans 和 dark/light 的生产无头窗口,核对无项目模式、自动实际值、多版本登记与全局默认选择。通过 run-go-tests-with-timing.mjs 记录单测试 HTML/JUnit;desktop-ci 的 macOS/Windows 每次上传四张图和计时报告。2026-11-15 本机 macOS 与 Windows 11 ARM64 来宾的 GNU x64 系统仿真均通过两个语言各 3 个计时结果,Windows 49 个 SDK/来源/诊断/资源定向用例通过;该证据不替代工具提供方与完整产品工作流验收,整体保持 partial/pending。 Windows #2042:TestToolchainCandidatesUseNativeShellPathsInUserProfiles 以真实 PATH 查找、真实有界版本进程和 Core 候选规则,覆盖 PATH-only/环境变量-only 及空格/中文用户目录;合成工具位于扫描目录之外,全局登记使用私有根。 通过现有 Windows CI 的 scripts/desktop/check.sh 运行;本机逐项计时报告覆盖这些合成场景,完整原生界面验收仍保持 pending。 2026-11-18(#2122):使用 dev.lithe.test.* 合成工具清单运行 TestUntrustedProjectEnvironmentNeverProbesWorkspaceExecutables、TestTrustedWorkspacePersistsInLocalSettingsOnlyAndResolvesSymlinkedVenv、TestTrustedWorkspaceResolvesSubdirectoryEnvironmentAndRejectsEscapingDirectories、TestProjectToolchainTrustSwitchGrantsAndRevokesImmediately 与 TestWorkbenchToolchainTrustPersistsLocallyLogsActionAndEnablesRuntimeResolution,验证未授权零探测、两跳符号链接虚拟环境字面路径保留、macOS 目录符号链接与 Windows 目录联接点指向外部时在探测前拒绝、本机 toolchains/global.json 原子保存与撤销(绝不写工作区 .lithe/)、performedIn 操作轨迹以及中英明暗无头截图 m47/m48;Windows 实机与完整原生 GUI 工作流保持 pending。", - "notes": "Viva:共享 Core toolchain 命令已接入 desktop/internal/core/toolchain.go;声明式扫描、文件事实、有界版本探测、toolchains.candidates/resolve 与目录 pin 保存位于 desktop/internal/toolchain/ 并有真实 Core 测试;设置窗口 Build 页可按插件声明展示工具、生效值与来源,显式 Save/Reset 写 .lithe/toolchains/local.json,Cancel 不写;Build 命令和 Provider Run 的 toolchain 候选使用 Core 解析出的可执行文件、环境导出和 PATH。提供方后端查询的现行证据见 plugin-toolchain-providers;本条 Windows 与完整 GUI/原生工作流仍保持 pending。 本轮通过外部 Core Draft PR #3 的精确提交接入 toolchains.editPins:平台不再编辑 pin schema;Core/Go 共用 fixture、批量保存和取消/外部并发修改回归通过。命令型 Tests 同样消费解析后的工具链环境。原生 Windows、提供方工具查询、完整 GUI 与发行验收仍 pending。 Windows 原生回归确认保存前后的文件模式以及真实访问控制描述符(所有者、组、DACL/继承保护)保留;元数据先准备到临时文件,再核对取消/冲突并原子发布。此证据不代表提供方查询或 GUI 已验收。 Viva 设置保存前核对读取项目的原生目录身份;项目关闭或切换后旧草稿拒绝写入,已确认保存的发布与回读固定捕获来源。冲突通过共享 i18n 显示并保留草稿,加载/保存失败进入目录日志;macOS 先失败后通过的回归已有计时,新增作用域行为的 Windows 验收尚未执行。 Windows 原生探测统一 Core 正斜杠路径与本机反斜杠/大小写别名,防止重复事实使目录 pin 解析遭拒绝;选择与校验规则仍由原有 Core 决定。 全局 SDK 登记与默认值可在未打开项目时编辑;项目范围保留独立覆盖,读取不创建文件,确认保存后按实际探测回显。新增合成工具原生与无头测试,不改变历史完整验收状态。 Viva 2026-11-16:Build 页每个工具改为一个下拉框,默认回显当前选择(未固定时为“自动(实际目录)”),列出识别到的其他安装、已保存固定值和已校验目录;选“自定义…”才显示目录输入、浏览和“使用此目录”,校验通过后该目录成为列表项并被选中。无版本的安装不可选,在列表下以说明文字列出。自动化:TestToolchainListShowsAutomaticAndHidesTheDirectoryUntilCustom 及原有草稿/保存/冲突用例;截图 TestVisualSettings/33-settings-toolchains、m44-toolchain-directory-menu、m45-toolchain-custom-directory。原生验收仍 pending。 Viva 2026-11-16(#2032):toolchains.candidates 改为同时接收宿主找到的 PATH 命令所在目录(commandHomes),JAVA_HOME 等声明变量和 PATH 上的安装校验通过后以 host:shell 并入安装列表并按规范目录去重,新建项目的工具选择、设置页和运行配置因此能选到只配置在 PATH 或环境变量上的 JDK;自动层的选择不变。Core 回归 toolchain_candidates_offer_shell_homes_that_no_discovery_scan_covers(Lithe-core-rust#67),宿主回归 TestShellHomesAreInstallationsWithoutADiscoveryScan;两者都确认修复前失败。Windows 0.8.0 实机复现了缺陷,修复后的完整 Windows 客户端尚未实机验收,状态保持 pending。 Viva 2026-11-18(#2122):prepareTool 沿工作区祖先链观测 discoveryPlan 返回的 projectFiles、requires、home、中间父目录、pathPrepend 及软链目标;probeAll 在 ProjectCodeAllowed 为 false 时拒绝探测任何工作区内可执行文件;本机信任记录经 Core catalogState/editCatalog 保存在应用用户设置目录 toolchains/global.json,设置页项目作用域提供带 ⓘ 说明的显式信任开关并立即回读生效值,工作台 resolveToolchainSelection 同步读取同一本机信任状态。 Viva 2026-11-18(构建设置重构):工具链页按 docs/design/build-execution-settings.html 重做为“全局默认 / 当前项目”两个作用域、按类别或插件分组、需处理与已手动指定过滤,列表与详情两栏;详情显示当前生效的程序、版本与来源标签和安装列表(自动、发现的安装、手动目录),项目作用域在未信任时显示信任提示。筛选、分组和计数由 Core 设置投影(Lithe-core-rust#99)给出,一个插件可以注册多个 SDK。固定值本身不再算一个来源标签,只有其目录不在其他来源中时才标出提供方。自动化:toolchains_view_test.go、TestVisualSettings 的 33、m44–m49 场景。原生与 Windows 验收仍 pending。", + "notes": "Viva:共享 Core toolchain 命令已接入 desktop/internal/core/toolchain.go;声明式扫描、文件事实、有界版本探测、toolchains.candidates/resolve 与目录 pin 保存位于 desktop/internal/toolchain/ 并有真实 Core 测试;设置窗口 Build 页可按插件声明展示工具、生效值与来源,显式 Save/Reset 写 .lithe/toolchains/local.json,Cancel 不写;Build 命令和 Provider Run 的 toolchain 候选使用 Core 解析出的可执行文件、环境导出和 PATH。提供方后端查询的现行证据见 plugin-toolchain-providers;本条 Windows 与完整 GUI/原生工作流仍保持 pending。 本轮通过外部 Core Draft PR #3 的精确提交接入 toolchains.editPins:平台不再编辑 pin schema;Core/Go 共用 fixture、批量保存和取消/外部并发修改回归通过。命令型 Tests 同样消费解析后的工具链环境。原生 Windows、提供方工具查询、完整 GUI 与发行验收仍 pending。 Windows 原生回归确认保存前后的文件模式以及真实访问控制描述符(所有者、组、DACL/继承保护)保留;元数据先准备到临时文件,再核对取消/冲突并原子发布。此证据不代表提供方查询或 GUI 已验收。 Viva 设置保存前核对读取项目的原生目录身份;项目关闭或切换后旧草稿拒绝写入,已确认保存的发布与回读固定捕获来源。冲突通过共享 i18n 显示并保留草稿,加载/保存失败进入目录日志;macOS 先失败后通过的回归已有计时,新增作用域行为的 Windows 验收尚未执行。 Windows 原生探测统一 Core 正斜杠路径与本机反斜杠/大小写别名,防止重复事实使目录 pin 解析遭拒绝;选择与校验规则仍由原有 Core 决定。 全局 SDK 登记与默认值可在未打开项目时编辑;项目范围保留独立覆盖,读取不创建文件,确认保存后按实际探测回显。新增合成工具原生与无头测试,不改变历史完整验收状态。 Viva 2026-11-16:Build 页每个工具改为一个下拉框,默认回显当前选择(未固定时为“自动(实际目录)”),列出识别到的其他安装、已保存固定值和已校验目录;选“自定义…”才显示目录输入、浏览和“使用此目录”,校验通过后该目录成为列表项并被选中。无版本的安装不可选,在列表下以说明文字列出。自动化:TestToolchainListShowsAutomaticAndHidesTheDirectoryUntilCustom 及原有草稿/保存/冲突用例;截图 TestVisualSettings/33-settings-toolchains、m44-toolchain-directory-menu、m45-toolchain-custom-directory。原生验收仍 pending。 Viva 2026-11-16(#2032):toolchains.candidates 改为同时接收宿主找到的 PATH 命令所在目录(commandHomes),JAVA_HOME 等声明变量和 PATH 上的安装校验通过后以 host:shell 并入安装列表并按规范目录去重,新建项目的工具选择、设置页和运行配置因此能选到只配置在 PATH 或环境变量上的 JDK;自动层的选择不变。Core 回归 toolchain_candidates_offer_shell_homes_that_no_discovery_scan_covers(Lithe-core-rust#67),宿主回归 TestShellHomesAreInstallationsWithoutADiscoveryScan;两者都确认修复前失败。Windows 0.8.0 实机复现了缺陷,修复后的完整 Windows 客户端尚未实机验收,状态保持 pending。 Viva 2026-11-18(#2122):prepareTool 沿工作区祖先链观测 discoveryPlan 返回的 projectFiles、requires、home、中间父目录、pathPrepend 及软链目标;probeAll 在 ProjectCodeAllowed 为 false 时拒绝探测任何工作区内可执行文件;本机信任记录经 Core catalogState/editCatalog 保存在应用用户设置目录 toolchains/global.json,设置页项目作用域提供带 ⓘ 说明的显式信任开关并立即回读生效值,工作台 resolveToolchainSelection 同步读取同一本机信任状态。 Viva 2026-11-18(构建设置重构):工具链页按 docs/design/build-execution-settings.html 重做为“全局默认 / 当前项目”两个作用域、按类别或插件分组、需处理与已手动指定过滤,列表与详情两栏;详情显示当前生效的程序、版本与来源标签和安装列表(自动、发现的安装、手动目录),项目作用域在未信任时显示信任提示。筛选、分组和计数由 Core 设置投影(Lithe-core-rust#99)给出,一个插件可以注册多个 SDK。固定值本身不再算一个来源标签,只有其目录不在其他来源中时才标出提供方。自动化:toolchains_view_test.go、TestVisualSettings 的 33、m44–m49 场景。原生与 Windows 验收仍 pending。 Viva 2026-11-23(#2316):工具定义可写 executableLinksOutsideHome(toolDefinitions 0 内的补充,Lithe-core-rust#177),项目外虚拟环境、Homebrew 式安装里链接到主目录外的程序可被固定、经 homeVariable 或发现规则选中,探测与启动用主目录下的布局路径;observeToolHome 改为沿布局路径观测各级目录与链接目标,Core 才能核对中间目录留在主目录内。宿主回归 TestAnEnvironmentProgramLinkedOutsideItsHomeStartsFromItsLayoutPath 用真实符号链接验证选中布局路径、导出指向环境,没有字段时仍拒绝,旧观测下以 unsafePath 失败;Windows 环境的 Scripts\\python.exe 不是链接,未在 Windows 实机验证,原生与完整工作流仍 pending。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": {