From fc14f7a58a6f14e4876a54e99a3e9610284a07e0 Mon Sep 17 00:00:00 2001 From: lick <2188718831@qq.com> Date: Wed, 25 Nov 2026 00:26:42 -0800 Subject: [PATCH] =?UTF-8?q?fix(toolchains):=20=E8=A1=A5=E8=AE=B0=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=9B=AE=E5=BD=95=E8=AF=BB=E5=8F=96=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=B9=B6=E9=AA=8C=E8=AF=81=E9=83=A8=E5=88=86=E5=8F=91=E7=8E=B0?= =?UTF-8?q?=E4=B8=8B=E7=9A=84=E8=BF=90=E8=A1=8C=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internal/workbench/command_installers.go | 19 ++- .../workbench/command_installers_test.go | 30 +++++ .../internal/workbench/debug_launch_test.go | 110 +++++++++++++++--- .../features/plugin-injected-toolchains.json | 2 +- 4 files changed, 141 insertions(+), 20 deletions(-) diff --git a/desktop/internal/workbench/command_installers.go b/desktop/internal/workbench/command_installers.go index c9fabadcb..e13b0af41 100644 --- a/desktop/internal/workbench/command_installers.go +++ b/desktop/internal/workbench/command_installers.go @@ -105,7 +105,7 @@ func (s settingsCommandInstalls) Missing(ctx context.Context, pluginID string) ( installers[installer.ID] = installer } var missing []settingswindow.MissingCommand - var tools map[string]string + tools := sync.OnceValue(func() map[string]string { return s.toolNames(ctx) }) for _, consumer := range requirements.Consumers { commands := make([]string, 0, len(consumer.Commands)) installerID := "" @@ -128,10 +128,7 @@ func (s settingsCommandInstalls) Missing(ctx context.Context, pluginID string) ( if installer, ok := installers[installerID]; ok { entry.Installer = installer.ID if installer.Tool != nil { - if tools == nil { - tools = s.toolNames(ctx) - } - entry.Tool = toolName(tools, *installer.Tool) + entry.Tool = toolName(tools(), *installer.Tool) } } missing = append(missing, entry) @@ -172,12 +169,22 @@ func commandConsumerCapability(kind string) string { // toolNames are the display names of the enabled plugins' tool definitions by ID; nil when // the registry cannot be read, which shows the IDs. func (s settingsCommandInstalls) toolNames(ctx context.Context) map[string]string { - manifests, _, _ := s.app.usableToolchainManifests(ctx, "command_installer_tool_discovery") + const operation = "command_installer_tool_discovery" + manifests, _, err := s.app.usableToolchainManifests(ctx, operation) + if err != nil { + if ctx.Err() == nil { + s.app.backgroundFailedIn(ctx, operation, err) + } + return nil + } if len(manifests) == 0 { return nil } registry, err := s.app.kernel.ToolchainRegistryOf(ctx, manifests) if err != nil { + if ctx.Err() == nil { + s.app.backgroundFailedIn(ctx, operation, err) + } return nil } names := make(map[string]string, len(registry.Definitions)) diff --git a/desktop/internal/workbench/command_installers_test.go b/desktop/internal/workbench/command_installers_test.go index 633386024..b02d24621 100644 --- a/desktop/internal/workbench/command_installers_test.go +++ b/desktop/internal/workbench/command_installers_test.go @@ -18,7 +18,10 @@ import ( "github.com/1lck/Lithe-IDEA/desktop/internal/core" "github.com/1lck/Lithe-IDEA/desktop/internal/i18n" "github.com/1lck/Lithe-IDEA/desktop/internal/pluginhost" + "github.com/1lck/Lithe-IDEA/desktop/internal/pluginservice" + "github.com/1lck/Lithe-IDEA/desktop/internal/pluginstate" "github.com/1lck/Lithe-IDEA/desktop/internal/settingswindow" + "github.com/1lck/Lithe-IDEA/desktop/internal/store" ) const commandInstallerPluginID = "dev.lithe.test.command-installers" @@ -475,3 +478,30 @@ func TestCommandMissingFailuresAreLocalized(t *testing.T) { t.Fatal("an unrelated failure counted as a missing command") } } + +func TestCommandInstallerFallsBackToToolIDAndRecordsUnreadableCatalog(t *testing.T) { + const plugin = "dev.lithe.test.incomplete" + root := t.TempDir() + if err := os.MkdirAll(filepath.Join(root, plugin, "1.0.0"), 0o700); err != nil { + t.Fatal(err) + } + prefs := store.At(t.TempDir()) + if err := pluginstate.New(prefs).SetEnabled(plugin, true); err != nil { + t.Fatal(err) + } + service, err := pluginservice.Open(core.NewClient(), prefs, root) + if err != nil { + t.Fatal(err) + } + log := &treeRecordingLog{} + installer := settingsCommandInstalls{app: &App{plugins: service, logSink: log}} + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + const tool = plugin + ":compiler" + if name := toolName(installer.toolNames(ctx), tool); name != tool { + t.Fatalf("fallback = %q, want %q", name, tool) + } + if len(log.events) != 1 || log.events[0].Fields["operation"] != "command_installer_tool_discovery" { + t.Fatalf("expected one discovery diagnostic, got %+v", log.events) + } +} diff --git a/desktop/internal/workbench/debug_launch_test.go b/desktop/internal/workbench/debug_launch_test.go index 4b93f4575..414c9c2f5 100644 --- a/desktop/internal/workbench/debug_launch_test.go +++ b/desktop/internal/workbench/debug_launch_test.go @@ -3,14 +3,20 @@ package workbench import ( "context" "encoding/json" + "errors" "os" + "path/filepath" "reflect" + "strings" "sync/atomic" "testing" "time" "github.com/1lck/Lithe-IDEA/desktop/internal/core" + "github.com/1lck/Lithe-IDEA/desktop/internal/pluginbackend" + "github.com/1lck/Lithe-IDEA/desktop/internal/pluginhost" + "github.com/1lck/Lithe-IDEA/desktop/internal/pluginstate" ) // countedDebugCreate observes whether native preparation reached the engine. @@ -55,6 +61,21 @@ func TestDebugMissingTargetIsRejectedBeforeStartingTheAdapter(t *testing.T) { } func TestDebugRuntimeArgumentsComeFromTheToolDefinition(t *testing.T) { + home, err := filepath.EvalSymlinks(t.TempDir()) + if err != nil { + t.Fatal(err) + } + runtimeName := "jre/bin/vm" + if filepath.Ext(debugFixtureProgramName()) == ".exe" { + runtimeName += ".exe" + } + executable := filepath.Join(home, runtimeName) + if err := os.MkdirAll(filepath.Dir(executable), 0o700); err != nil { + t.Fatal(err) + } + copyTestBinary(t, executable) + t.Setenv("FICTIONAL_VM_HOME", home) + t.Setenv(syntheticWorkbenchInterpMarkerEnv, filepath.Join(home, "probe-marker")) h := debugHarness(t) p := openDebugPanel(t, h, t.TempDir()) adapter := p.debug.adapters[0] @@ -73,14 +94,20 @@ func TestDebugRuntimeArgumentsComeFromTheToolDefinition(t *testing.T) { definition := toolManifest["toolDefinitions"].([]any)[0].(map[string]any) toolID := adapter.PluginID + ":vm" definition["id"] = toolID - definition["launch"] = []string{"${executable}", "${runtimeArguments}", "${entry}", "${arguments}"} + definition["launch"] = []string{"${executable}", "${runtimeArguments}", "${arguments}", "${entry}"} + definition["executableLayouts"].([]any)[0].(map[string]any)["path"] = runtimeName + definition["executables"].([]any)[0].(map[string]any)["path"] = runtimeName + definition["version"] = map[string]any{"arguments": []string{"--version"}, "pattern": "SyntheticInterp ([0-9.]+)"} manifest["toolDefinitions"] = []any{definition} manifest["requiresTools"] = []string{toolID} + manifest["permissions"] = []string{"debug.launch", "run.start", "backend.launch"} + manifest["activationEvents"] = []string{"onDebug:fixture", "onWorkspaceOpen"} + manifest["backend"] = map[string]any{"launch": map[string]string{"kind": "packaged", "path": debugFixtureProgramName()}} requires := manifest["requires"].(map[string]any) - requires["toolDefinitions"], requires["debugAdapters"] = 0, 0 + requires["toolDefinitions"], requires["backend"] = 0, 0 declared := manifest["debugAdapters"].([]any)[0].(map[string]any) declared["configurations"].(map[string]any)["launch"].(map[string]any)["targetBindings"] = map[string]any{"args": "target.arguments", "env": "target.environment"} - declared["launch"].(map[string]any)["process"].(map[string]any)["launch"] = map[string]any{"kind": "runtime", "tool": toolID, "entry": "adapter-entry", "runtimeArguments": []string{"--runtime"}} + declared["launch"].(map[string]any)["process"].(map[string]any)["launch"] = map[string]any{"kind": "runtime", "tool": toolID, "entry": "adapter-entry", "runtimeArguments": []string{"-test.count=1"}} adapter.Manifest, err = json.Marshal(manifest) if err != nil { t.Fatal(err) @@ -92,24 +119,81 @@ func TestDebugRuntimeArgumentsComeFromTheToolDefinition(t *testing.T) { if err := os.WriteFile(entry, []byte("fixture entry"), 0o600); err != nil { t.Fatal(err) } - runtime := filepath.Join(adapter.Directory, debugFixtureProgramName()) - home := adapter.Directory - h.app.toolchainResolve = func(_ context.Context, root, directory, tool, minimum string) (core.ToolchainSelection, error) { - if root != p.root || directory != "." || tool != toolID { - t.Fatalf("wrong runtime selection: %s %s %s", root, directory, tool) - } - return core.ToolchainSelection{Executable: runtime, Home: &home, Environment: map[string]string{"VM_HOME": home}}, nil + // An incomplete installation has a version directory but no readable manifest. + const brokenID = "dev.lithe.test.unreadable" + broken := filepath.Join(filepath.Dir(filepath.Dir(adapter.Directory)), brokenID, "1.0.0") + if err := os.MkdirAll(broken, 0o700); err != nil { + t.Fatal(err) } - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + if err := pluginstate.New(h.app.store).SetEnabled(brokenID, true); err != nil { + t.Fatal(err) + } + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() plan, err := h.app.prepareDebugLaunch(ctx, debugStart{adapter: adapter, request: "launch"}, filepath.Join(t.TempDir(), "state"), p, "", 1, "unavailable") if err != nil { + var r *core.MarketplaceRejection + if errors.As(err, &r) { + t.Fatalf("prepare: %s: %v", r.Field, err) + } t.Fatal(err) } - expected := []string{"--runtime", entry, "-test.run=^TestDebugAdapterRunner$"} - if plan.Executable != runtime || !reflect.DeepEqual(plan.Arguments, expected) || plan.Environment["VM_HOME"] != home { + expected := []string{"-test.count=1", "-test.run=^TestDebugAdapterRunner$", entry} + if plan.Executable != executable || !reflect.DeepEqual(plan.Arguments, expected) || plan.Environment["FICTIONAL_VM_HOME"] != home { t.Fatalf("tool definition launch = %+v, arguments want %v", plan, expected) } + manifests, discoveryErr := h.app.toolchainManifests(ctx) + if len(manifests) == 0 || discoveryErr == nil { + t.Fatalf("expected a partially readable catalog, got %d manifests and %v", len(manifests), discoveryErr) + } + verifyPartialCatalogRun(t, h, p, ctx, adapter, toolID, entry) + if err := os.WriteFile(filepath.Join(p.root, "debug.marker"), []byte("debug"), 0o600); err != nil { + t.Fatal(err) + } + p.debug.adapters[0] = adapter + h.app.startDebug(p) + awaitStateWithin(t, h, 30*time.Second, "runtime adapter frames", func() bool { + if p.debug.failure != "" { + t.Fatalf("runtime adapter: %s", p.debug.failure) + } + return p.debug.state == "paused" && len(p.debug.frames) == 2 + }) + h.app.stopDebug(p) + awaitStateWithin(t, h, 20*time.Second, "runtime adapter stopped", func() bool { return p.debug.activeSession() == nil }) +} + +// verifyPartialCatalogRun exercises the runtime entry planner and run/start with the real installed registry. +func verifyPartialCatalogRun(t *testing.T, h *harness, p *project, ctx context.Context, adapter debugAdapter, toolID, entry string) { + t.Helper() + run, err := h.app.resolveBackendToolEntry(ctx, adapter.PluginID, p.root, pluginbackend.ToolEntryLaunch{Tool: toolID, Entry: entry, Arguments: []string{"-test.list=^TestDebugAdapterRunner$"}}) + if err != nil { + t.Fatal(err) + } + workspace, ok := h.app.plugins.Contexts.ByPath(p.root) + if !ok { + t.Fatal("workspace context not open") + } + params, err := json.Marshal(map[string]any{ + "context": workspace.ContextRef, "label": "Partial catalog runtime", "process": map[string]any{ + "executable": map[string]string{"kind": "tool", "tool": toolID}, "arguments": run.Arguments, "workingDirectory": ".", "environment": map[string]string{}, + }, + }) + if err != nil { + t.Fatal(err) + } + caller := pluginhost.WithCaller(ctx, pluginhost.Caller{PluginID: adapter.PluginID, SessionID: "fixture-session"}) + reply, failure := h.app.plugins.HostServices.Respond(caller, pluginhost.MethodPrefix+"run/start", params) + if failure != nil { + t.Fatalf("run/start: %+v", failure) + } + var result struct{ RunID string } + if err := json.Unmarshal(reply, &result); err != nil || result.RunID == "" { + t.Fatalf("run/start response: %s, %v", reply, err) + } + awaitStateWithin(t, h, 15*time.Second, "run process output", func() bool { + session := p.runEntry(result.RunID) + return session != nil && !session.running && strings.Contains(session.output.all(), "TestDebugAdapterRunner") + }) } func debugAdapterWithProgramSetting(t *testing.T, adapter debugAdapter, candidates []string) debugAdapter { diff --git a/shared/platform-feature-matrix/features/plugin-injected-toolchains.json b/shared/platform-feature-matrix/features/plugin-injected-toolchains.json index 84f351a8b..44c9b92ed 100644 --- a/shared/platform-feature-matrix/features/plugin-injected-toolchains.json +++ b/shared/platform-feature-matrix/features/plugin-injected-toolchains.json @@ -63,7 +63,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。 自忽略回归:TestSavePinIgnoresGeneratedFileWithoutHidingSharedFiles 经真实 Core 和 SavePin 写入,用隔离全局配置的 Git check-ignore 核对 .lithe/.gitignore 与本机 pin 被忽略、共享配置和嵌套 .gitignore 未被忽略;现有保存测试继续核对 CRLF、后续否定规则、权限和无变化保存。Core 与桌面桥接共同执行 toolchain-pin-storage fixture 的 BOM、已生效规则、否定规则与无变化来源场景;两个原生平台完成对应流程前保持 pending。", + "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。 自忽略回归:TestSavePinIgnoresGeneratedFileWithoutHidingSharedFiles 经真实 Core 和 SavePin 写入,用隔离全局配置的 Git check-ignore 核对 .lithe/.gitignore 与本机 pin 被忽略、共享配置和嵌套 .gitignore 未被忽略;现有保存测试继续核对 CRLF、后续否定规则、权限和无变化保存。Core 与桌面桥接共同执行 toolchain-pin-storage fixture 的 BOM、已生效规则、否定规则与无变化来源场景;两个原生平台完成对应流程前保持 pending。 macOS 无头测试启用一个缺少清单的插件后,经宿主 run/start 读取健康工具的实际进程输出,启动运行时调试适配器、读取两个栈帧并停止。安装器在清单全部不可读时保留工具 ID,并记录一次发现失败。", "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",