diff --git a/rust/crates/core/src/tests/toolchain_definitions.rs b/rust/crates/core/src/tests/toolchain_definitions.rs index 53912882..713530da 100644 --- a/rust/crates/core/src/tests/toolchain_definitions.rs +++ b/rust/crates/core/src/tests/toolchain_definitions.rs @@ -150,11 +150,13 @@ fn registry_accepts_short_ids_from_any_enabled_plugin() { .is_err()); } -/// Install order and plugin ID must not pick an owner, so a contested ID has none. +/// Install order and plugin ID must not pick an owner, so differing claims stay unowned. #[test] fn registry_leaves_a_contested_tool_id_unowned_and_registers_the_rest() { let first = manifest("dev.lithe.fixture.first", definition("compiler")); - let second = manifest("dev.lithe.fixture.second", definition("compiler")); + let mut different = definition("compiler"); + different["executableLayouts"] = json!([{"path":"bin/other-compiler"}]); + let second = manifest("dev.lithe.fixture.second", different); let mut third = manifest("dev.lithe.fixture.third", definition("renderer")); third["toolDefinitions"] .as_array_mut() @@ -184,11 +186,66 @@ fn registry_leaves_a_contested_tool_id_unowned_and_registers_the_rest() { .is_err()); } +/// Identical normalized short-ID definitions across plugins aggregate into one shared entry. +#[test] +fn registry_aggregates_identical_short_tool_definitions_across_plugins() { + let first = manifest("dev.lithe.fixture.first", definition("compiler")); + let second = manifest("dev.lithe.fixture.second", definition("compiler")); + for plugins in [ + json!([{"manifest":first},{"manifest":second}]), + json!([{"manifest":second},{"manifest":first}]), + ] { + let result = registry(&json!({"plugins":plugins}), validated_manifest_json).unwrap(); + assert_eq!(result["conflicts"], json!([])); + assert_eq!(result["definitions"].as_array().map(Vec::len), Some(1)); + let entry = &result["definitions"][0]; + assert_eq!(entry["definition"]["id"], "compiler"); + assert_eq!(entry["pluginID"], "dev.lithe.fixture.first"); + assert_eq!( + entry["pluginIDs"], + json!(["dev.lithe.fixture.first", "dev.lithe.fixture.second"]) + ); + let plan = crate::execute_json( + &json!({ + "id": "shared-plan", + "command": "toolchains.discoveryPlan", + "payload": { + "registry": {"plugins": plugins}, + "platform": "macos" + } + }) + .to_string(), + ); + let plan: Value = serde_json::from_str(&plan).unwrap(); + assert_eq!(plan["ok"], true, "{plan}"); + assert_eq!( + plan["data"]["plan"]["tools"][0]["pluginIDs"], + json!(["dev.lithe.fixture.first", "dev.lithe.fixture.second"]) + ); + } + // Any semantic difference still triggers a conflict instead of silently picking one. + let mut changed = definition("compiler"); + changed["version"]["arguments"] = json!(["-v"]); + let differing = manifest("dev.lithe.fixture.second", changed); + let conflict = registry( + &json!({"plugins":[{"manifest":first},{"manifest":differing}]}), + validated_manifest_json, + ) + .unwrap(); + assert_eq!(conflict["definitions"], json!([])); + assert_eq!( + conflict["conflicts"], + json!([{"tool":"compiler","pluginIDs":["dev.lithe.fixture.first","dev.lithe.fixture.second"]}]) + ); +} + /// A provider that lists a contested tool still registers; only the definition is withheld. #[test] fn registry_keeps_providers_that_name_a_contested_tool() { let first = manifest("dev.lithe.fixture.first", definition("compiler")); - let second = manifest("dev.lithe.fixture.second", definition("compiler")); + let mut different = definition("compiler"); + different["displayName"] = json!("Different compiler"); + let second = manifest("dev.lithe.fixture.second", different); let provider = json!({"schemaVersion":0,"id":"dev.lithe.fixture.provider","displayName":"Provider","version":"1.0.0", "pluginAPIVersion":0,"requires":{"toolchainProviders":0,"backend":0}, "vendor":{"id":"org.example","displayName":"Fixture","signatureRequirement":"publisherPackage"}, diff --git a/rust/crates/core/src/tests/toolchain_resolution.rs b/rust/crates/core/src/tests/toolchain_resolution.rs index 7959ced0..109093d1 100644 --- a/rust/crates/core/src/tests/toolchain_resolution.rs +++ b/rust/crates/core/src/tests/toolchain_resolution.rs @@ -1208,9 +1208,10 @@ fn toolchain_resolution_contested_tool_id_is_unowned_for_every_consumer() { installation(&mut value, HOME, "21.0.4"); value["local"] = local_pins(); value["commandHomes"][tool.as_str()] = json!(HOME); - // The rival is a copy of the defining plugin under another ID. + // The rival claims the same short ID with a differing definition. let mut rival = value["registry"]["plugins"][0]["manifest"].clone(); rival["id"] = json!("io.example.rival"); + rival["toolDefinitions"][0]["displayName"] = json!("Rival Java"); value["registry"]["plugins"] .as_array_mut() .unwrap() @@ -2093,3 +2094,37 @@ fn toolchain_candidates_and_multi_hop_environment_links_use_synthetic_tool_defin assert_eq!(selection["pathPrepend"], json!([dir]), "{platform}"); } } + +/// An existing external scan root (such as `~/.local`) whose declared layouts are all observed +/// as missing must resolve to `notFound` rather than `unsafePath`, and must not taint valid runs. +#[test] +fn empty_observed_system_scan_directory_does_not_report_unsafe_path() { + let mut value = input(); + let empty_home = "/opt/lithe-fixtures/empty-local"; + value["filesystem"].as_array_mut().unwrap().extend([ + fact(empty_home, "directory", false), + fact(&format!("{empty_home}/bin/java"), "missing", false), + ]); + value["systemInstallations"] = json!([{"tool":"java","home":empty_home}]); + value["probes"] = json!([]); + + let unresolved = resolve(&value); + assert_eq!(unresolved["outcome"]["kind"], "skip"); + assert_eq!(unresolved["outcome"]["reason"]["code"], "notFound"); + let listed_empty = candidates(&value); + assert_eq!(listed_empty["skipped"], json!([])); + + // With another valid candidate, the empty scan directory does not leave any skipped error. + installation(&mut value, HOME, "21.0.4"); + value["systemInstallations"] = + json!([{"tool":"java","home":empty_home},{"tool":"java","home":HOME}]); + let resolved = resolve(&value); + assert_eq!(resolved["outcome"]["kind"], "resolved"); + assert_eq!(resolved["outcome"]["selection"]["home"], HOME); + assert_eq!(candidates(&value)["skipped"], json!([])); + + // Unobserved directories and escaping links still fail closed as unsafePath. + let unobserved_home = "/opt/lithe-fixtures/unobserved"; + value["systemInstallations"] = json!([{"tool":"java","home":unobserved_home}]); + assert_eq!(fixed_home_failure(&value, unobserved_home), "unsafePath"); +} diff --git a/rust/crates/toolchain/src/definitions.rs b/rust/crates/toolchain/src/definitions.rs index 9914172d..c8e3f149 100644 --- a/rust/crates/toolchain/src/definitions.rs +++ b/rust/crates/toolchain/src/definitions.rs @@ -762,20 +762,21 @@ pub fn validate_declarations( } /// Revalidates the complete manifests of enabled plugins and builds the tool registry. -/// A tool ID declared by several plugins belongs to none of them: install order and plugin -/// ID must not decide ownership, or a hostile plugin could claim an ID before its rightful -/// owner. Those definitions are left out and reported in `conflicts`; every other definition -/// still registers. Duplicate plugin IDs make the enabled set ambiguous, so they reject the -/// whole batch. +/// When several plugins declare the same short tool ID with identical normalized definitions, +/// they aggregate into one shared registry entry carrying `pluginIDs`. When their definitions +/// differ, ownership belongs to none of them: install order and plugin ID must not decide +/// ownership, or a hostile plugin could claim an ID before its rightful owner. Those differing +/// definitions are left out and reported in `conflicts`; every other definition still registers. +/// Duplicate plugin IDs make the enabled set ambiguous, so they reject the whole batch. /// /// `validate_manifest` revalidates each complete manifest. The plugin host supplies it: /// only the host assembles the sections every domain contributes to a manifest. pub fn registry(input: &Value, validate_manifest: ManifestValidator) -> Validation { object(input, &["plugins"], &["plugins"], "registry")?; let plugins = list(&input["plugins"], 0, 128, "plugins")?; - let mut definitions = Vec::new(); + let mut grouped: BTreeMap> = BTreeMap::new(); let mut providers = Vec::new(); - let mut owners: BTreeMap> = BTreeMap::new(); + let mut definition_count = 0usize; let mut plugin_ids = BTreeSet::new(); for entry in plugins { object(entry, &["manifest"], &["manifest"], "plugins")?; @@ -789,23 +790,23 @@ pub fn registry(input: &Value, validate_manifest: ManifestValidator) -> Validati } for definition in optional_list(&manifest, "toolDefinitions", 32)? { let id = text(&definition["id"], 192, "toolDefinitions.id")?; - owners - .entry(id.to_owned()) - .or_default() - .insert(plugin_id.to_owned()); let mut normalized = definition.clone(); let indices = candidates(definition)?; normalized["executables"] = json!(indices .iter() .map(|index| definition["executables"][*index].clone()) .collect::>()); - definitions.push(json!({"pluginID":plugin_id,"definition":normalized})); + grouped + .entry(id.to_owned()) + .or_default() + .insert(plugin_id.to_owned(), normalized); + definition_count += 1; } for provider in optional_list(&manifest, "toolchainProviders", 8)? { providers.push(json!({"pluginID":plugin_id, "version":manifest["requires"]["toolchainProviders"],"provider":provider})); } - if definitions.len() > 512 || providers.len() > 256 { + if definition_count > 512 || providers.len() > 256 { return Err(invalid( "plugins", "The registry exceeds aggregate contribution limits.", @@ -813,23 +814,34 @@ pub fn registry(input: &Value, validate_manifest: ManifestValidator) -> Validati } } // A qualified ID starts with its unique plugin ID, so only short IDs can be claimed twice. - let conflicts: Vec = owners - .iter() - .filter(|(_, claimants)| claimants.len() > 1) - .map(|(tool, claimants)| json!({"tool":tool,"pluginIDs":claimants})) - .collect(); - definitions.retain(|entry| { - entry["definition"]["id"] - .as_str() - .and_then(|id| owners.get(id)) - .is_some_and(|claimants| claimants.len() == 1) - }); - definitions.sort_by_key(|entry| { - ( - entry["definition"]["id"].as_str().unwrap_or("").to_owned(), - entry["pluginID"].as_str().unwrap_or("").to_owned(), - ) - }); + // Identical normalized declarations share one entry; differing ones stay unowned conflicts. + let mut definitions = Vec::new(); + let mut conflicts = Vec::new(); + for (tool, claimants) in grouped { + let mut entries = claimants.into_iter(); + let Some((first_plugin, first_definition)) = entries.next() else { + continue; + }; + let mut all_plugin_ids = vec![first_plugin.clone()]; + let mut all_identical = true; + for (plugin_id, definition) in entries { + if definition != first_definition { + all_identical = false; + } + all_plugin_ids.push(plugin_id); + } + if all_plugin_ids.len() == 1 { + definitions.push(json!({"pluginID": first_plugin, "definition": first_definition})); + } else if all_identical { + definitions.push(json!({ + "pluginID": first_plugin, + "pluginIDs": all_plugin_ids, + "definition": first_definition, + })); + } else { + conflicts.push(json!({"tool": tool, "pluginIDs": all_plugin_ids})); + } + } providers.sort_by_key(|entry| { ( entry["pluginID"].as_str().unwrap_or("").to_owned(), diff --git a/rust/crates/toolchain/src/query.rs b/rust/crates/toolchain/src/query.rs index bd9decc8..ff79d237 100644 --- a/rust/crates/toolchain/src/query.rs +++ b/rust/crates/toolchain/src/query.rs @@ -507,23 +507,38 @@ fn same_target(known: &FileFact, target: &FileFact, facts: &Facts) -> bool { && known.executable == target.executable } +/// Distinguishes an observed external directory that simply lacks any matching +/// executable from an unobserved, escaping, or non-executable path. +pub(crate) enum InstallationCheckError { + MissingExecutable, + Unsafe(PluginRejection), +} + +impl From for InstallationCheckError { + fn from(error: PluginRejection) -> Self { + Self::Unsafe(error) + } +} + /// `layout_path` limits the search to one declared executable layout, as an environment /// candidate names; otherwise the first present platform layout is selected. -fn checked_installation( +fn checked_installation_detail( home: &str, definition: &Value, facts: &Facts, roots: &[String], layout_path: Option<&str>, -) -> Validation { +) -> Result { let canonical_home = facts.canonical(home, Some("directory"))?; if roots.iter().any(|root| facts.within(&canonical_home, root)) { return Err(reject( UNSAFE, "installation.home", "A provider installation cannot be workspace code.", - )); + ) + .into()); } + let mut saw_unobserved_layout = false; for layout in definition["executableLayouts"] .as_array() .into_iter() @@ -540,6 +555,7 @@ fn checked_installation( let path = paths::join(home, layout["path"].as_str().unwrap_or(""), &facts.platform) .ok_or_else(|| reject(UNSAFE, "executableLayouts", "Invalid executable layout."))?; let Some(fact) = facts.values.get(&facts.key(&path)?) else { + saw_unobserved_layout = true; continue; }; if fact.kind == "missing" { @@ -554,7 +570,7 @@ fn checked_installation( ) }; if roots.iter().any(|root| facts.within(&executable, root)) { - return Err(escapes()); + return Err(escapes().into()); } if facts.within(&executable, &canonical_home) { let executable = invoked_executable(&executable, &canonical_home, layout, facts)?; @@ -564,7 +580,7 @@ fn checked_installation( // starts from the layout path so the program still finds the environment it was // started from; the canonical target would run the base installation instead. if definition["executableLinksOutsideHome"] != true { - return Err(escapes()); + return Err(escapes().into()); } let relative = layout["path"].as_str().unwrap_or(""); contained_parents(home, relative, &canonical_home, facts, roots)?; @@ -572,11 +588,34 @@ fn checked_installation( .ok_or_else(|| reject(UNSAFE, "executableLayouts", "Invalid executable layout."))?; return Ok(json!({"home":canonical_home,"executable":executable})); } + if !saw_unobserved_layout { + return Err(InstallationCheckError::MissingExecutable); + } Err(reject( UNSAFE, "installation.executable", "No validated executable matches the tool definition.", - )) + ) + .into()) +} + +fn checked_installation( + home: &str, + definition: &Value, + facts: &Facts, + roots: &[String], + layout_path: Option<&str>, +) -> Validation { + checked_installation_detail(home, definition, facts, roots, layout_path).map_err( + |err| match err { + InstallationCheckError::MissingExecutable => reject( + UNSAFE, + "installation.executable", + "No validated executable matches the tool definition.", + ), + InstallationCheckError::Unsafe(error) => error, + }, + ) } /// Checks the directories between a home and its layout's program (such as `bin` in @@ -667,6 +706,34 @@ pub fn validate_installation( checked_installation(home, definition, &facts, &roots, layout_path) } +/// Validates an installation for host resolution, returning `"notFound"` instead of +/// `"unsafePath"` when an observed external directory simply lacks all declared layouts. +pub(crate) fn validate_installation_reason( + home: &str, + definition: &Value, + filesystem: &[Value], + workspace_roots: &[String], + platform: &str, + case_sensitive: bool, + layout_path: Option<&str>, +) -> Result { + if !matches!(platform, "macos" | "windows" | "linux") { + return Err("unsafePath"); + } + let facts = read_facts(filesystem, platform, case_sensitive).map_err(|_| "unsafePath")?; + let roots = workspace_roots + .iter() + .map(|root| facts.canonical(root, Some("directory"))) + .collect::>>() + .map_err(|_| "unsafePath")?; + checked_installation_detail(home, definition, &facts, &roots, layout_path).map_err(|err| { + match err { + InstallationCheckError::MissingExecutable => "notFound", + InstallationCheckError::Unsafe(_) => "unsafePath", + } + }) +} + /// Decodes one provider reply using only the revalidated registry and native facts. /// No filesystem, process, environment or JSON-RPC transport is accessed here. pub fn decode(input: &Value, validate_manifest: ManifestValidator) -> Validation { diff --git a/rust/crates/toolchain/src/resolution/automatic.rs b/rust/crates/toolchain/src/resolution/automatic.rs index 84154826..d1b360b5 100644 --- a/rust/crates/toolchain/src/resolution/automatic.rs +++ b/rust/crates/toolchain/src/resolution/automatic.rs @@ -37,6 +37,11 @@ pub(crate) fn automatic_set( } } Err(code) => { + // An existing shared scan root (such as `~/.local` or `/usr/local`) without + // this tool's executable is simply empty for this tool, not a broken candidate. + if code == "notFound" && provider == SYSTEM_PROVIDER { + continue; + } set.failure = Some(code); let checked = snapshot.checked(home, None).ok(); let canonical = checked diff --git a/rust/crates/toolchain/src/resolution/discovery.rs b/rust/crates/toolchain/src/resolution/discovery.rs index 4498536b..a6455375 100644 --- a/rust/crates/toolchain/src/resolution/discovery.rs +++ b/rust/crates/toolchain/src/resolution/discovery.rs @@ -81,11 +81,18 @@ pub(crate) fn discovery_plan( row }) .collect(); - json!({"tool":definition["id"],"pluginID":entry["pluginID"],"scans":scans,"providers":providers, + let mut plan = json!({"tool":definition["id"],"pluginID":entry["pluginID"],"scans":scans,"providers":providers, "homeLayouts":definition.get("homeLayouts").cloned().unwrap_or(json!([])), "executableLayouts":definition["executableLayouts"],"version":definition["version"], "pathPrepend":definition.get("pathPrepend").cloned().unwrap_or(json!([])), - "environment":environment,"projectFiles":project_files}) + "environment":environment,"projectFiles":project_files}); + if let Some(plugin_ids) = entry + .get("pluginIDs") + .filter(|value| value.as_array().is_some_and(|items| items.len() > 1)) + { + plan["pluginIDs"] = plugin_ids.clone(); + } + plan }) .collect::>(); Ok(json!({"tools":tools,"limits":{"roots":256,"entries":4096,"ancestors":64}})) diff --git a/rust/crates/toolchain/src/resolution/snapshot.rs b/rust/crates/toolchain/src/resolution/snapshot.rs index 67d9ce3e..db7fa1a5 100644 --- a/rust/crates/toolchain/src/resolution/snapshot.rs +++ b/rust/crates/toolchain/src/resolution/snapshot.rs @@ -175,7 +175,15 @@ impl Snapshot<'_> { provider: &str, layer: &str, ) -> Result { - let checked = self.checked(home, layout).map_err(|_| "unsafePath")?; + let checked = query::validate_installation_reason( + home, + self.definition, + self.facts, + &self.roots, + self.platform, + self.case_sensitive, + layout, + )?; let executable = checked["executable"].as_str().ok_or("unsafePath")?; let version = self.version(executable)?; self.environment_selection( diff --git a/shared/plugins/contract/v1/toolchains/README.md b/shared/plugins/contract/v1/toolchains/README.md index d8a7fa19..b754ca8f 100644 --- a/shared/plugins/contract/v1/toolchains/README.md +++ b/shared/plugins/contract/v1/toolchains/README.md @@ -148,12 +148,17 @@ are not a substitute for that adapter. These commands perform no native I/O. Every `registry` input is the raw `{plugins:[{manifest}]}` request of the enabled plugins, not a previously normalized result. Core revalidates complete production manifests; the host supplies no proof of a plugin's origin, and a plugin's own -claim of one is not read. Output is `{definitions:[{pluginID,definition}], +claim of one is not read. Output is `{definitions:[{pluginID,pluginIDs?,definition}], providers:[{pluginID,version,provider}],conflicts:[{tool,pluginIDs}]}` in stable order. A provider row's `version` is its revalidated manifest's `requires.toolchainProviders`, never a number claimed by a query response. -A short ID defined by more than one enabled plugin belongs to none of them. Core +When multiple enabled plugins declare the same short ID with **identical** +normalized definitions, Core aggregates them into a single `definitions` entry +whose `pluginID` is the first sorted declaring plugin ID and whose `pluginIDs` +array lists all sorted declaring plugin IDs (also forwarded to +`toolchains.discoveryPlan`). When multiple enabled plugins declare the same short +ID with **differing** normalized definitions, it belongs to none of them: Core registers none of those definitions and registers every other definition as usual. `conflicts` lists each contested tool once, sorted by `tool`, with the IDs of all plugins that defined it, sorted. Ownership is never decided by arrival @@ -161,11 +166,13 @@ order or by plugin ID order, because a hostile plugin could take a tool by being loaded first or by choosing a smaller ID. A contested tool is absent from the registry: `discoveryPlan` lists no scans or providers for it, and a consumer that resolves it treats it as declared by nobody. A host should tell the user which -plugins contest the tool; the macOS settings page shows one diagnostic per +plugins contest the tool; the settings page shows one diagnostic per conflict and advises keeping only one of those plugins enabled. Qualified IDs cannot be contested, since their prefix is the defining plugin's ID. A repeated plugin ID still rejects the whole batch without replacing earlier owners. Limits -are 128 plugins, 512 aggregate definitions and 256 aggregate providers. +are 128 plugins, 512 aggregate definitions and 256 aggregate providers. This +aggregation is compatible within `toolDefinitions: 0` / `1` and introduces no new +capability version. ## Provider backend negotiation diff --git a/shared/plugins/reference/protocol-changelog.md b/shared/plugins/reference/protocol-changelog.md index 1743fa07..09204084 100644 --- a/shared/plugins/reference/protocol-changelog.md +++ b/shared/plugins/reference/protocol-changelog.md @@ -20,6 +20,7 @@ | --- | --- | --- | --- | --- | | [#218](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/218)(待合入) | [@WhiteZeek](https://github.com/WhiteZeek) | API-29 | `buildSystems` 0 内的补充 | 清单 `buildSystems[].detection` 新增可选 `ignoredPaths`:最多 256 条有序的 `.gitignore` 目录规则,每条不超过 1024 个 UTF-8 字节,相对工作区根匹配,只过滤这个构建系统的候选目录。候选目录或它到工作区根之间的任一目录被忽略就不算实例,`outermost` 下被忽略的外层根下的标记文件也不会变成实例;每一层先看工作区规则,工作区的 `!` 规则可以放回;工作区根本身不参与匹配。规则无法编译或超长时整个清单以 `plugin.manifest.invalid` 拒绝,字段为 `buildSystems[i].detection.ignoredPaths[j]`。Core 命令 `build.detect` 的回答总是带 `detection.pluginIgnoredPaths`(`{pluginID, buildSystemID, displayName, patterns}`,按构建系统 ID 排序,只列胜出的声明,没有时为 `[]`),供宿主和可编辑的工作区规则分开展示。固定样例见 [`detect-plugin-ignored-paths-v1.json`](../../../rust/fixtures/build/detect-plugin-ignored-paths-v1.json)。不影响项目树、搜索和索引;没有新增宿主方法、通知、错误码或 SDK 版本。旧宿主会拒绝使用该字段的清单,插件要等包含这个改动的桌面端发布后再用。 | | [#227](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/227)(待合入) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 市场索引 `schemaVersion` 0 内的补充 | 一个仓库发布多个插件时,每个插件的 Release 标签用自己的前缀:`<前缀>MAJOR.MINOR.PATCH`(如 `codex-v0.1.0`、`claude-code-v0.1.0`)。索引字段不变:`plugins.marketplace.validateIndex` 的输出条目新增 `releaseTagPrefix`,由 Core 从下载地址的标签派生;每个标签都拆成同一个前缀加上列出它的版本号时为该前缀,否则为 `null`。宿主用它读取插件自己的更新日志(`listReleases` 的 `tagPrefix`)。只新增 Core 输出字段,旧宿主照常读取同一份索引;没有新增宿主方法、通知、错误码、能力版本或 SDK 版本。规则见 [`marketplace.md`](domains/marketplace.md#一个仓库发布多个插件)。 | +| [#228](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/228)(待合入) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | `toolDefinitions` 0 / 1 内的补充 | 多个已启用插件声明同一个工具短 ID 且规范化定义完全一致时,`toolchains.registry` 与 `toolchains.discoveryPlan` 自动聚合成一条定义,并在有多个声明插件时附带排序后的 `pluginIDs`;定义不同仍作为 `conflicts` 拒绝。不提升 `toolDefinitions` 能力版本,不新增宿主方法、通知、错误码或 SDK 版本。规则见 [`toolchains/README.md`](../contract/v1/toolchains/README.md#commands-and-envelopes)。 | ## 按协议查首次出现