From b9c6e2875f21746635411ed56a01263bfdd55636 Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Thu, 3 Dec 2026 14:18:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(core):=20=E5=88=A0=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=96=B9=E7=9A=84=E4=BB=A3=E7=A0=81=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BB=8D=E6=8C=89=E5=8F=8C=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E6=8F=8F=E8=BF=B0=E7=9A=84=E6=B3=A8=E9=87=8A=E5=92=8C?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除没有调用方的命令名单、函数和常量:AGENT_COMMANDS、 AGENT_SESSION_COMMANDS、AGENT_LIBRARY_COMMANDS、AGENT_PROVIDER_COMMANDS、 core::start_lsp_owned、lsp_engine::start_server_owned、 is_hidden_directory_name、CHANNEL_ROOTS、DIAGNOSTIC_DURATION_MS、 KNOWN_PLATFORMS、LIFECYCLE_EVENTS、devcontainer_up_with - 去掉两个未使用的依赖:agent-runtime 的 lithe-plugin-model、 core 的 lithe-plugin-ui - 注释和文档里“两个宿主”“Windows 前端”等说法改为当前的单一桌面端 - rust-core-api.md 的 C ABI 清单补上 lithe_core_is_plain_text 和 lithe_core_execute_document_json,并指向头文件 Refs 1lck/Lithe-IDEA#2651 --- README.md | 4 +- rust/Cargo.lock | 2 - rust/contracts/rust-core-api.md | 12 ++--- rust/crates/agent-runtime/Cargo.toml | 1 - rust/crates/agent-runtime/src/lib.rs | 47 ------------------- rust/crates/build/src/test_outcome.rs | 2 +- rust/crates/build/src/test_outcome_merge.rs | 2 +- .../core-rules/src/editor/workbench_state.rs | 4 +- rust/crates/core-rules/src/visibility.rs | 7 --- rust/crates/core/Cargo.toml | 1 - rust/crates/core/src/lib.rs | 23 --------- rust/crates/core/src/protocol/command.rs | 7 ++- .../core/src/tests/declarative_plugins.rs | 2 +- rust/crates/debug/src/variable_paging.rs | 2 +- rust/crates/diagnostics/src/channel.rs | 5 -- rust/crates/diagnostics/src/logging.rs | 4 +- rust/crates/diff/src/tests.rs | 4 +- rust/crates/editor/src/line_edit.rs | 7 ++- rust/crates/git-host/src/lib.rs | 4 +- rust/crates/git/src/branch_names.rs | 6 +-- rust/crates/git/src/graph.rs | 2 +- rust/crates/git/src/lib.rs | 2 +- rust/crates/lsp-engine/src/lib.rs | 8 ---- rust/crates/network/src/lib.rs | 2 +- rust/crates/plugin-manifest/src/lib.rs | 2 +- rust/crates/plugin-manifest/src/views.rs | 2 +- rust/crates/plugin-marketplace/src/lib.rs | 5 -- rust/crates/plugin-model/src/lib.rs | 2 +- rust/crates/plugin-model/src/settings.rs | 2 +- rust/crates/process/src/inventory.rs | 4 +- rust/crates/process/src/lifecycle.rs | 2 +- rust/crates/project/src/encoding.rs | 2 +- rust/crates/remote/src/failure_log.rs | 16 ------- rust/crates/request-context/src/events.rs | 2 +- rust/crates/vcs/src/model.rs | 4 +- rust/crates/workspace/src/test_support.rs | 9 ---- rust/logging/README.md | 4 +- shared/plugins/contract/v1/README.md | 4 +- 38 files changed, 45 insertions(+), 175 deletions(-) diff --git a/README.md b/README.md index 6d08e0d6..c0e000f9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Lithe 的跨平台应用内核,以及插件契约、插件开发资料和官 | [`rust/contracts/`](rust/contracts) | Core 命令的接口契约和 schema | | [`rust/fixtures/`](rust/fixtures) | Core 命令的测试数据,Core 测试和桌面端测试共用 | | [`rust/logging/`](rust/logging) | 日志事件目录 | -| [`shared/plugins/`](shared/plugins) | 插件契约 `contract/v1/`、开发指南 `guides/`、参考 `reference/`、官方 SDK `sdk/{node,java,rust}` 和它们的端到端测试 | +| [`shared/plugins/`](shared/plugins) | 插件契约 `contract/v1/`、开发指南 `guides/`、参考 `reference/`、官方 SDK `sdk/{rust,go,node,java}` 和它们的端到端测试 | | [`scripts/rust-core/`](scripts/rust-core) | Rust Core 的 CI 脚本:选择受影响的 crate、平台测试放置检查、注释规范检查(模块文档、英文注释、`unsafe` 安全说明、导出项 Rustdoc) | | [`scripts/logging/`](scripts/logging) | 日志事件目录生成器,从 `rust/logging/events/` 生成 `rust/crates/diagnostics/src/catalog_generated.rs` | @@ -43,7 +43,7 @@ Lithe's cross-platform application core, and the single source of the plugin con | [`rust/contracts/`](rust/contracts) | Interface contracts and schemas for Core commands | | [`rust/fixtures/`](rust/fixtures) | Test data for Core commands, shared by the Core and desktop tests | | [`rust/logging/`](rust/logging) | The logging event catalog | -| [`shared/plugins/`](shared/plugins) | The plugin contract `contract/v1/`, guides `guides/`, reference `reference/`, the official SDKs `sdk/{node,java,rust}` and their end-to-end tests | +| [`shared/plugins/`](shared/plugins) | The plugin contract `contract/v1/`, guides `guides/`, reference `reference/`, the official SDKs `sdk/{rust,go,node,java}` and their end-to-end tests | | [`scripts/rust-core/`](scripts/rust-core) | The Rust Core CI scripts: affected crate selection, the platform test placement check, and the comment rules check (module docs, English comments, `unsafe` safety sections, Rustdoc on exported items) | | [`scripts/logging/`](scripts/logging) | The logging event catalog generator, which turns `rust/logging/events/` into `rust/crates/diagnostics/src/catalog_generated.rs` | diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 64fd3eb5..cd2cf758 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -946,7 +946,6 @@ dependencies = [ "lithe-platform", "lithe-plugin-agents", "lithe-plugin-manifest", - "lithe-plugin-model", "lithe-plugin-rpc", "lithe-protocol", "lithe-request-context", @@ -1037,7 +1036,6 @@ dependencies = [ "lithe-plugin-model", "lithe-plugin-output-links", "lithe-plugin-rpc", - "lithe-plugin-ui", "lithe-plugin-web-content", "lithe-process", "lithe-project", diff --git a/rust/contracts/rust-core-api.md b/rust/contracts/rust-core-api.md index c8b5fc32..e5dff2fb 100644 --- a/rust/contracts/rust-core-api.md +++ b/rust/contracts/rust-core-api.md @@ -323,13 +323,14 @@ order, and every id a setting may choose, in menu order, so a settings page can machine. It fails as `outputStyle.decode` does for an unsupported id or an unknown member. See `rust/fixtures/terminal/output-encoding-v1.json`. -The Rust core is the shared application runtime for macOS SwiftUI and Windows -React/Tauri. macOS calls the stable C ABI while the Tauri host links the Rust -crate directly. The C ABI remains: +The Rust core is the application runtime shared by every Lithe host. The Go +desktop host links the `staticlib` through cgo and calls the stable C ABI: ```c const char *lithe_core_version(void); +int32_t lithe_core_is_plain_text(const uint8_t *bytes, size_t length); char *lithe_core_execute_json(const char *request); +char *lithe_core_execute_document_json(const char *request, const uint8_t *bytes, size_t length); char *lithe_core_execute_json_with_events(const char *request, void (*callback)(const char *, void *), void *context); int32_t lithe_core_git_askpass(const char *prompt); int32_t lithe_core_cancel(const char *operation_id); @@ -338,10 +339,7 @@ void lithe_core_install_log_waker(void (*callback)(void *), void *context); int32_t lithe_core_remove_log_waker(void *context); ``` -The macOS package uses the small C bridge in `macos/Sources/LitheRustCore/`. The -canonical C declarations are in `rust/crates/core/include/lithe_core.h`. -Native clients link the `staticlib`; Rust hosts call -`lithe_core::execute_json` and `lithe_core::cancel_operation` directly. +The canonical C declarations are in `rust/crates/core/include/lithe_core.h`. Strings returned by the core are UTF-8 JSON allocated by Rust. The caller must release response strings with `lithe_core_free_string`. diff --git a/rust/crates/agent-runtime/Cargo.toml b/rust/crates/agent-runtime/Cargo.toml index e2595eac..3f44c14e 100644 --- a/rust/crates/agent-runtime/Cargo.toml +++ b/rust/crates/agent-runtime/Cargo.toml @@ -14,7 +14,6 @@ lithe-lsp-transport = { path = "../lsp-transport" } lithe-platform = { path = "../platform" } lithe-plugin-agents = { path = "../plugin-agents" } lithe-plugin-manifest = { path = "../plugin-manifest" } -lithe-plugin-model = { path = "../plugin-model" } lithe-plugin-rpc = { path = "../plugin-rpc" } lithe-protocol = { path = "../protocol" } lithe-request-context = { path = "../request-context" } diff --git a/rust/crates/agent-runtime/src/lib.rs b/rust/crates/agent-runtime/src/lib.rs index 2442e72a..bbe66b4b 100644 --- a/rust/crates/agent-runtime/src/lib.rs +++ b/rust/crates/agent-runtime/src/lib.rs @@ -63,53 +63,6 @@ use std::collections::BTreeMap; use std::sync::{Arc, OnceLock}; use std::time::{SystemTime, UNIX_EPOCH}; -/// The commands of the `agents.*` family. -pub const AGENT_COMMANDS: &[&str] = &[ - "agents.configure", - "agents.catalog", - "agents.sessions", - "agents.start", - "agents.prompt", - "agents.cancel", - "agents.updateQueue", - "agents.respondQuestion", - "agents.respondPermission", - "agents.setConfigOption", - "agents.close", - "agents.waitEvents", - "agents.projection", -]; - -/// The commands of the `agentSessions.*` family. -pub const AGENT_SESSION_COMMANDS: &[&str] = &[ - "agentSessions.configure", - "agentSessions.sync", - "agentSessions.forget", - "agentSessions.list", - "agentSessions.search", - "agentSessions.read", - "agentSessions.page", - "agentSessions.stats", - "agentSessions.calls", -]; - -/// The commands of the `agentLibrary.*` family. -pub const AGENT_LIBRARY_COMMANDS: &[&str] = &[ - "agentLibrary.configure", - "agentLibrary.read", - "agentLibrary.save", - "agentLibrary.apply", - "agentLibrary.importSkill", - "agentLibrary.removeSkill", -]; - -/// The commands of the `agentProviders.*` family. -pub const AGENT_PROVIDER_COMMANDS: &[&str] = &[ - "agentProviders.read", - "agentProviders.apply", - "agentProviders.restore", -]; - /// The agent catalog, the live sessions, the session records and the /// agent library. pub(crate) struct Runtime { diff --git a/rust/crates/build/src/test_outcome.rs b/rust/crates/build/src/test_outcome.rs index c1abb372..562ce3fc 100644 --- a/rust/crates/build/src/test_outcome.rs +++ b/rust/crates/build/src/test_outcome.rs @@ -151,7 +151,7 @@ mod tests { .unwrap() } - // The shared fixture is the cross-platform contract: both hosts feed the + // The shared fixture is the cross-platform contract: every host feeds the // same facts and must show the same verdict. #[test] fn shared_fixture_cases_resolve_to_their_expected_verdicts() { diff --git a/rust/crates/build/src/test_outcome_merge.rs b/rust/crates/build/src/test_outcome_merge.rs index c7ec05b5..6370aebf 100644 --- a/rust/crates/build/src/test_outcome_merge.rs +++ b/rust/crates/build/src/test_outcome_merge.rs @@ -116,7 +116,7 @@ mod tests { use super::*; use serde_json::Value; - // The shared fixture is the cross-platform contract: both hosts build the + // The shared fixture is the cross-platform contract: every host builds the // same scope and must keep the same history. #[test] fn shared_fixture_cases_merge_to_their_expected_history() { diff --git a/rust/crates/core-rules/src/editor/workbench_state.rs b/rust/crates/core-rules/src/editor/workbench_state.rs index 612270a3..7c28ab87 100644 --- a/rust/crates/core-rules/src/editor/workbench_state.rs +++ b/rust/crates/core-rules/src/editor/workbench_state.rs @@ -1,8 +1,8 @@ //! Membership and selection rules for editor tab groups. //! -//! Both hosts keep a different shape of the same fact: which tabs live in which group, which tab a +//! Each host keeps its own shape of the same fact: which tabs live in which group, which tab a //! group shows, and what happens to that when a tab opens, closes or moves. This module defines one -//! canonical group model (the union of what the two hosts track) and one reducer over it. A host +//! canonical group model (the union of what hosts track) and one reducer over it. A host //! maps its own state into [`State`], runs one [`Action`], and maps the result back. //! //! Layout trees, split ratios, pixels and dragging stay in the host. The reducer only reports which diff --git a/rust/crates/core-rules/src/visibility.rs b/rust/crates/core-rules/src/visibility.rs index 5004a99d..7b02c532 100644 --- a/rust/crates/core-rules/src/visibility.rs +++ b/rust/crates/core-rules/src/visibility.rs @@ -218,13 +218,6 @@ impl VisibilityRules { } } - /// Whether `name` is one of the effective hidden folder names. - pub fn is_hidden_directory_name(&self, name: &str) -> bool { - self.hidden_directories - .iter() - .any(|hidden| hidden.eq_ignore_ascii_case(name)) - } - /// Whether a workspace-relative path is hidden. `path` uses `/` separators. pub fn is_hidden(&self, path: &str, is_directory: bool) -> bool { self.is_hidden_of_kind(path, Some(is_directory)) diff --git a/rust/crates/core/Cargo.toml b/rust/crates/core/Cargo.toml index 761a3e83..4acf0c57 100644 --- a/rust/crates/core/Cargo.toml +++ b/rust/crates/core/Cargo.toml @@ -41,7 +41,6 @@ lithe-plugin-manifest = { path = "../plugin-manifest" } lithe-plugin-lifecycle = { path = "../plugin-lifecycle" } lithe-plugin-marketplace = { path = "../plugin-marketplace" } lithe-plugin-model = { path = "../plugin-model" } -lithe-plugin-ui = { path = "../plugin-ui" } lithe-plugin-output-links = { path = "../plugin-output-links" } lithe-plugin-rpc = { path = "../plugin-rpc" } lithe-plugin-web-content = { path = "../plugin-web-content" } diff --git a/rust/crates/core/src/lib.rs b/rust/crates/core/src/lib.rs index f6dd6a79..bee532c8 100644 --- a/rust/crates/core/src/lib.rs +++ b/rust/crates/core/src/lib.rs @@ -28,29 +28,6 @@ pub fn execute_json(request: &str) -> String { runtime::execute_json(request) } -/// Starts the existing LSP engine with a native resource owner attached before -/// initialization. The callback only records the ID; it must not call Core. -/// Unlike a wire request, this also preserves ownership when the first write -/// fails and the ordinary start command returns an error. -pub fn start_lsp_owned( - mut payload: serde_json::Value, - registered: impl FnOnce(&str), -) -> Result { - lithe_document_uri::resolve_request_paths("lsp.startServer", &mut payload)?; - let request = serde_json::from_value(payload).map_err(|error| { - CoreError::new(ErrorCode::InvalidRequest, "Invalid language-server launch.") - .with_details(error.to_string()) - })?; - let response = lithe_lsp_engine::start_server_owned(request, registered)?; - serde_json::to_value(response).map_err(|error| { - CoreError::new( - ErrorCode::Unknown, - "Could not encode language-server launch.", - ) - .with_details(error.to_string()) - }) -} - /// Requests cooperative cancellation of an active operation. /// /// Rust callers use this entry point; C ABI hosts call `lithe_core_cancel`. diff --git a/rust/crates/core/src/protocol/command.rs b/rust/crates/core/src/protocol/command.rs index 1d704659..1b75990c 100644 --- a/rust/crates/core/src/protocol/command.rs +++ b/rust/crates/core/src/protocol/command.rs @@ -518,7 +518,7 @@ pub enum KeymapCommand { /// Finds conflicts among the final layered shortcut bindings (`keymap.analyzeConflicts`). AnalyzeConflicts, /// Advances the double-Shift gesture recognizer by one event (`keymap.modifierGestureStep`). - /// The rule itself lives in `lithe-core-rules` so the Windows frontend can run it synchronously. + /// The rule itself lives in `lithe-core-rules`. ModifierGestureStep, /// Reduces named shortcut schemes (`keymap.schemes.reduce`). SchemesReduce, @@ -735,7 +735,7 @@ pub enum WorkspaceCommand { /// Searches provider-owned text snapshots in one request (`workspace.searchTextBatch`). SearchTextBatch, /// Classifies a batch of workspace-relative paths as hidden or visible (`workspace.classifyVisibility`). - /// The rule lives in `lithe-core-rules` so the Windows frontend can run it synchronously. + /// The rule lives in `lithe-core-rules`. ClassifyVisibility, /// Returns the default hidden-path lists (`workspace.visibilityDefaults`), also from `lithe-core-rules`. VisibilityDefaults, @@ -778,8 +778,7 @@ pub enum HistoryCommand { /// The `editor.*` commands; their names live in [`CoreCommand::parse`]. pub enum EditorCommand { /// Applies one editor-group state transition: open, close, move, pin, preview, merge or normalize - /// (`editor.workbenchState.reduce`). The rule lives in `lithe-core-rules` so the Windows frontend - /// can run it synchronously inside store updates. + /// (`editor.workbenchState.reduce`). The rule lives in `lithe-core-rules`. WorkbenchStateReduce, /// Applies one transition to the editor groups and the tree that divides the editor area /// among them: a workbench state action, opening a tab, dropping a dragged one or removing diff --git a/rust/crates/core/src/tests/declarative_plugins.rs b/rust/crates/core/src/tests/declarative_plugins.rs index 0034b81c..4fc2d591 100644 --- a/rust/crates/core/src/tests/declarative_plugins.rs +++ b/rust/crates/core/src/tests/declarative_plugins.rs @@ -621,7 +621,7 @@ fn validation_probe_cannot_use_settings() { } /// A setting declaration is part of the normalized manifest, ordered by ID so -/// two hosts show and store the same list. +/// every host shows and stores the same list. #[test] fn settings_are_normalized_in_identifier_order() { let outcome = validate(fixture("node-runtime.plugin.json")); diff --git a/rust/crates/debug/src/variable_paging.rs b/rust/crates/debug/src/variable_paging.rs index c9273514..09cd221b 100644 --- a/rust/crates/debug/src/variable_paging.rs +++ b/rust/crates/debug/src/variable_paging.rs @@ -293,7 +293,7 @@ mod tests { .unwrap() } - // Each scenario replays the same plan/reduce sequence both hosts run, so a + // Each scenario replays the same plan/reduce sequence a host runs, so a // change in the stop rules shows up in the shared fixture first. #[test] fn variable_page_plan_matches_the_shared_fixture() { diff --git a/rust/crates/diagnostics/src/channel.rs b/rust/crates/diagnostics/src/channel.rs index 3c088535..8787f591 100644 --- a/rust/crates/diagnostics/src/channel.rs +++ b/rust/crates/diagnostics/src/channel.rs @@ -7,11 +7,6 @@ use std::collections::BTreeSet; /// Maximum distinct persisted channels in one session, excluding the overflow sink. pub const MAX_SESSION_CHANNELS: usize = 128; -/// Fixed routing roots shared by both native hosts. -pub const CHANNEL_ROOTS: [&str; 12] = [ - "app", "editor", "perf", "lsp", "vcs", "run", "debug", "terminal", "remote", "agent", "update", - "plugins", -]; /// Closed routing domains; hosts may specialize a domain only with validated segments. #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] diff --git a/rust/crates/diagnostics/src/logging.rs b/rust/crates/diagnostics/src/logging.rs index c544c20f..8598ce58 100644 --- a/rust/crates/diagnostics/src/logging.rs +++ b/rust/crates/diagnostics/src/logging.rs @@ -24,8 +24,6 @@ pub const MAX_LOG_FILE_BYTES: u64 = 10 * 1024 * 1024; pub const MAX_LOG_TOTAL_BYTES: u64 = 100 * 1024 * 1024; /// Performance sampling must not consume the general error-log budget. pub const MAX_PERFORMANCE_BYTES: u64 = 20 * 1024 * 1024; -/// A diagnostic session expires automatically after fifteen minutes. -pub const DIAGNOSTIC_DURATION_MS: u64 = 15 * 60 * 1000; /// Total uncompressed log evidence accepted into one export or timeline query. pub const MAX_LOG_EXPORT_BYTES: usize = 10 * 1024 * 1024; @@ -272,7 +270,7 @@ fn severity(level: &str) -> u8 { } } -/// Merges module files into a stable timeline and applies the same filters on both hosts. +/// Merges module files into a stable timeline and applies the same filters on every host. pub fn query_logs(request: LogQueryRequest) -> LogQueryResponse { let mut lines = Vec::new(); let mut remaining = MAX_LOG_EXPORT_BYTES; diff --git a/rust/crates/diff/src/tests.rs b/rust/crates/diff/src/tests.rs index f005340d..cd466725 100644 --- a/rust/crates/diff/src/tests.rs +++ b/rust/crates/diff/src/tests.rs @@ -15,8 +15,8 @@ fn fixture() -> Value { #[test] fn compare_texts_matches_shared_fixture() { - // Both hosts render these exact rows; any drift changes what Local History - // and agent diffs show on macOS and Windows at once. + // Hosts render these exact rows; any drift changes what Local History + // and agent diffs show on every platform at once. for case in fixture()["cases"].as_array().expect("cases") { let response = compare_texts_command(json!({ "oldText": case["oldText"], diff --git a/rust/crates/editor/src/line_edit.rs b/rust/crates/editor/src/line_edit.rs index a73c38b7..077d1e7a 100644 --- a/rust/crates/editor/src/line_edit.rs +++ b/rust/crates/editor/src/line_edit.rs @@ -1,8 +1,7 @@ -//! Deterministic line-level editing transforms shared by both products. +//! Deterministic line-level editing transforms shared by every host. //! -//! The algorithms operate on UTF-16 code units so offsets map directly onto -//! NSTextView ranges on macOS and JavaScript string indices on Windows. The -//! transforms are pure: they take the source text plus a selection and return +//! The algorithms operate on UTF-16 code units; a host converts its own text +//! offsets to them. The transforms are pure: they take the source text plus a selection and return //! the replacement text, the replaced range, and the selection to restore. //! Platform code only applies the result through its native text engine. diff --git a/rust/crates/git-host/src/lib.rs b/rust/crates/git-host/src/lib.rs index d3f26b86..392cf2fd 100644 --- a/rust/crates/git-host/src/lib.rs +++ b/rust/crates/git-host/src/lib.rs @@ -1,8 +1,8 @@ //! Native Git process ownership, incremental pipe reads, and bounded cleanup. //! //! This adapter does not construct Git arguments or interpret Git output. -//! The compatibility Core caller supplies policy and cancellation; both hosts -//! share this native adapter while the existing Git command ABI is retained. +//! The compatibility Core caller supplies policy and cancellation; every host +//! shares this native adapter while the existing Git command ABI is retained. //! [`ProcessTree`] exposes the same process-tree ownership to long-lived //! processes whose output a host streams itself. diff --git a/rust/crates/git/src/branch_names.rs b/rust/crates/git/src/branch_names.rs index 79173833..2267b9af 100644 --- a/rust/crates/git/src/branch_names.rs +++ b/rust/crates/git/src/branch_names.rs @@ -1,8 +1,8 @@ //! IDEA-compatible new-branch name cleanup and conflict validation. //! -//! Both native products show the same new-branch dialog, so the cleanup rules +//! Every host shows the same new-branch dialog, so the cleanup rules //! mirrored from IDEA's `GitRefNameValidator` and the `git.branch.cleanup.symbol` -//! default live here instead of in either platform. The module is pure: it never +//! default live here instead of in a host. The module is pure: it never //! starts Git and only reads the reference facts the caller already loaded. use lithe_protocol::{CoreError, ErrorCode}; @@ -59,7 +59,7 @@ pub enum GitBranchNameReferenceKind { #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] -/// Stable new-branch validation outcomes shared by both products. +/// Stable new-branch validation outcomes shared by every host. pub enum GitBranchNameErrorCode { /// The submit-time name is empty. Empty, diff --git a/rust/crates/git/src/graph.rs b/rust/crates/git/src/graph.rs index ac2d7f85..2cb81cd9 100644 --- a/rust/crates/git/src/graph.rs +++ b/rust/crates/git/src/graph.rs @@ -20,7 +20,7 @@ //! `GraphColorManagerImpl`, `DottedFilterEdgesGenerator`, //! `PrintElementGeneratorImpl`, `GraphElementComparatorByLayoutIndex`, //! `NaturalComparator`), Apache-2.0, Copyright 2000-2024 JetBrains s.r.o. and -//! contributors. See `macos/Resources/GitGraph/NOTICE.txt`. +//! contributors. See `rust/fixtures/git/graph-idea/NOTICE.txt`. use lithe_core_rules::file_names::compare_reference_names; use lithe_protocol::{CoreError, ErrorCode}; diff --git a/rust/crates/git/src/lib.rs b/rust/crates/git/src/lib.rs index ab91ce8c..d1c0a0cd 100644 --- a/rust/crates/git/src/lib.rs +++ b/rust/crates/git/src/lib.rs @@ -7,7 +7,7 @@ //! serialized responses, which `lithe-core` re-exports unchanged. // The initial projection/routing IR is deliberately not command- or host-facing -// until both native products can consume the same versioned contract. +// until hosts can consume one versioned contract. mod authentication_failure; mod branch_names; pub mod catalog; diff --git a/rust/crates/lsp-engine/src/lib.rs b/rust/crates/lsp-engine/src/lib.rs index 57db4ac5..34245c14 100644 --- a/rust/crates/lsp-engine/src/lib.rs +++ b/rust/crates/lsp-engine/src/lib.rs @@ -136,14 +136,6 @@ pub fn start_server(request: StartServerRequest) -> Result Result { - engine().start_server_owned(request, registered) -} - /// Performs a bounded graceful shutdown while retaining the session record. pub fn stop_server(request: SessionRequest) -> Result<(), CoreError> { engine().session(&request.session_id)?.stop() diff --git a/rust/crates/network/src/lib.rs b/rust/crates/network/src/lib.rs index b995b227..c13944e4 100644 --- a/rust/crates/network/src/lib.rs +++ b/rust/crates/network/src/lib.rs @@ -1,7 +1,7 @@ //! Network proxy policy normalization shared by the macOS and Windows hosts. //! //! The user-facing proxy settings (mode, server, credentials, exclusions) are -//! normalized and validated here so both hosts interpret the same stored +//! normalized and validated here so every host interprets the same stored //! values identically. Platforms only map the returned policy onto their own //! network stack: `connectionProxyDictionary` plus an authentication delegate //! on macOS, and the HTTP client configuration on Windows. What an exclusion diff --git a/rust/crates/plugin-manifest/src/lib.rs b/rust/crates/plugin-manifest/src/lib.rs index fb29c48f..a11badae 100644 --- a/rust/crates/plugin-manifest/src/lib.rs +++ b/rust/crates/plugin-manifest/src/lib.rs @@ -3,7 +3,7 @@ //! //! A declarative plugin carries no host-loaded code. The host reads its //! `plugin.json`, asks this module to validate and normalize it, and launches -//! the declared external processes itself. Both products must produce the +//! the declared external processes itself. Every host must produce the //! same outcome for the fixtures in `shared/plugins/contract/v1/`. //! //! Content problems in a manifest or request are reported as `rejected` diff --git a/rust/crates/plugin-manifest/src/views.rs b/rust/crates/plugin-manifest/src/views.rs index 0f0438d0..a892f113 100644 --- a/rust/crates/plugin-manifest/src/views.rs +++ b/rust/crates/plugin-manifest/src/views.rs @@ -5,7 +5,7 @@ //! declares. The backend answers each view event with a whole view, patches //! against the view the host drew last, or nothing. Core checks the result //! against the surface's vocabulary and the plugin's declared settings, -//! actions and tools, so both products draw the same nodes and refuse the +//! actions and tools, so every host draws the same nodes and refuses the //! same results; the host only renders. use crate::{validate_manifest_value, DeclarativePluginManifest}; diff --git a/rust/crates/plugin-marketplace/src/lib.rs b/rust/crates/plugin-marketplace/src/lib.rs index 7dd64318..a9bec2fb 100644 --- a/rust/crates/plugin-marketplace/src/lib.rs +++ b/rust/crates/plugin-marketplace/src/lib.rs @@ -33,11 +33,6 @@ pub const REPOSITORY_INDEX_FILE_NAME: &str = "lithe-plugin-index.json"; /// Companion workspace-recommendation file resolved beside a marketplace index. pub const REPOSITORY_RECOMMENDATIONS_FILE_NAME: &str = "lithe-plugin-recommendations.json"; const DELTAS_FILE_NAME: &str = "lithe-plugin-deltas.json"; -/// Platforms with a Lithe host today. Other well-formed identifiers are -/// accepted so an index can list future platforms without breaking older -/// hosts; they simply never match. -pub const KNOWN_PLATFORMS: &[&str] = - &["darwin-arm64", "darwin-x64", "windows-arm64", "windows-x64"]; /// Who maintains a marketplace source. Only the host's built-in default /// source is `official`; every user-added source is `thirdParty`. diff --git a/rust/crates/plugin-model/src/lib.rs b/rust/crates/plugin-model/src/lib.rs index b8586e7a..6c5962f9 100644 --- a/rust/crates/plugin-model/src/lib.rs +++ b/rust/crates/plugin-model/src/lib.rs @@ -10,7 +10,7 @@ //! each domain can live in its own crate; assembling a whole manifest stays //! with the plugin host in `lithe-core`. //! -//! Note: the contract is `shared/plugins/contract/v1/`; both products must +//! Note: the contract is `shared/plugins/contract/v1/`; every host must //! produce the same outcome for its fixtures. pub mod capabilities; diff --git a/rust/crates/plugin-model/src/settings.rs b/rust/crates/plugin-model/src/settings.rs index 7d77c21b..581d99b6 100644 --- a/rust/crates/plugin-model/src/settings.rs +++ b/rust/crates/plugin-model/src/settings.rs @@ -10,7 +10,7 @@ //! //! Hosts never merge values themselves. They send the stored layers and Core //! answers with the effective value of every setting and the layer it came -//! from, so both products show and launch with the same value. +//! from, so every host shows and launches with the same value. //! //! Note: the decision is recorded in .agents/notes/implemented/architecture/2026-10-21-plugin-settings-surfaces.md diff --git a/rust/crates/process/src/inventory.rs b/rust/crates/process/src/inventory.rs index e136eeb6..5cf6c6b8 100644 --- a/rust/crates/process/src/inventory.rs +++ b/rust/crates/process/src/inventory.rs @@ -2,7 +2,7 @@ //! //! Hosts read their process table (PIDs, sessions, inherited environment) and //! signal processes; everything between those two steps is decided here so -//! both products classify the same snapshot the same way: +//! every host classifies the same snapshot the same way: //! //! - which processes belong to the instance (its `LITHE_PROCESS_SCOPE` token), //! - which of an Agent's processes are its own infrastructure and which are @@ -577,7 +577,7 @@ mod tests { expected: serde_json::Value, } - // Both hosts replay this file, so a rule change must update it. + // Hosts replay this file, so a rule change must update it. #[test] fn shared_fixture_inventories_match() { let fixture: Fixture = serde_json::from_str(include_str!( diff --git a/rust/crates/process/src/lifecycle.rs b/rust/crates/process/src/lifecycle.rs index b36e2ec2..a5b878b5 100644 --- a/rust/crates/process/src/lifecycle.rs +++ b/rust/crates/process/src/lifecycle.rs @@ -658,7 +658,7 @@ mod tests { expected: serde_json::Value, } - // Both hosts replay this file, so a rule change must update it. + // Hosts replay this file, so a rule change must update it. #[test] fn shared_fixture_decisions_match() { let fixture: Fixture = serde_json::from_str(include_str!( diff --git a/rust/crates/project/src/encoding.rs b/rust/crates/project/src/encoding.rs index c3dadd2a..5b5b67f1 100644 --- a/rust/crates/project/src/encoding.rs +++ b/rust/crates/project/src/encoding.rs @@ -1,6 +1,6 @@ //! Shared document text-encoding rules for `file.read` and `file.write`. //! -//! Both native clients keep editor buffers as Unicode and only convert bytes at +//! Hosts keep editor buffers as Unicode and only convert bytes at //! the file boundary. The catalog, BOM handling, automatic detection and //! strict/lossy decoding live here so macOS and Windows agree byte for byte. //! Codec tables come from `encoding_rs` (WHATWG Encoding Standard). diff --git a/rust/crates/remote/src/failure_log.rs b/rust/crates/remote/src/failure_log.rs index fb862532..9c326cc5 100644 --- a/rust/crates/remote/src/failure_log.rs +++ b/rust/crates/remote/src/failure_log.rs @@ -18,22 +18,6 @@ pub const EVENTS: &[&str] = &[ "remote.forward.connection_failed", ]; -/// Connection lifecycle facts emitted through the same hook (S34). Each has -/// its own fields; see `rust/logging/events/remote.json`. -pub const LIFECYCLE_EVENTS: &[&str] = &[ - "remote.connection.connect.started", - "remote.connection.connect.finished", - "remote.connection.connect.failed", - "remote.connection.shell_started", - "remote.server.deploy_finished", - "remote.connection.interrupted", - "remote.connection.cleaned", - "remote.forward.started", - "remote.forward.removed", - "remote.forward.host_started", - "remote.forward.host_removed", -]; - /// Borrowed scalar fields; callers supply only fixed summaries and stable categories. pub type Fields<'a> = &'a [(&'static str, Value)]; /// Process-owned callback; no file writer or dependency on Core lives here. diff --git a/rust/crates/request-context/src/events.rs b/rust/crates/request-context/src/events.rs index 3d5968d5..b1a84cfd 100644 --- a/rust/crates/request-context/src/events.rs +++ b/rust/crates/request-context/src/events.rs @@ -33,7 +33,7 @@ pub struct JournalRetention { pub max_total_output_characters: usize, } -/// One budget for both products, chosen for the lower resident memory. +/// One budget for every host, chosen to keep resident memory low. pub const JOURNAL_RETENTION: JournalRetention = JournalRetention { max_records: 200, max_record_output_characters: 32_768, diff --git a/rust/crates/vcs/src/model.rs b/rust/crates/vcs/src/model.rs index 93cca893..de5ef1d3 100644 --- a/rust/crates/vcs/src/model.rs +++ b/rust/crates/vcs/src/model.rs @@ -1,12 +1,12 @@ //! The VCS-neutral model: capability IDs, file statuses, revisions, and the -//! validation that turns a plugin provider's reply into a result both hosts +//! validation that turns a plugin provider's reply into a result every host //! can render without trusting the provider. //! //! Replies are untrusted input. A value outside the contract fails the reply //! with `plugin.vcs.invalidOutput`; optional data Core does not know (a flag, //! a field) is dropped, so a newer provider can add it within version 1. //! Lists the host renders as sets are sorted here, and every list is capped, -//! so both hosts show the same result for the same reply. +//! so every host shows the same result for the same reply. use lithe_plugin_model::{PluginRejection, Validation}; use serde_json::{json, Map, Value}; diff --git a/rust/crates/workspace/src/test_support.rs b/rust/crates/workspace/src/test_support.rs index 85809eed..07658ecf 100644 --- a/rust/crates/workspace/src/test_support.rs +++ b/rust/crates/workspace/src/test_support.rs @@ -86,12 +86,3 @@ pub fn list_containers_with( ) -> Result { crate::containers::list_with(request, Some(program)) } - -/// `remote.devcontainerUp` with `program` in place of both the Dev Container -/// CLI and the engine CLI. -pub fn devcontainer_up_with( - request: crate::devcontainers::UpRequest, - program: &str, -) -> Result { - crate::devcontainers::up_with(request, Some(program)) -} diff --git a/rust/logging/README.md b/rust/logging/README.md index 01fdf221..5f5a4127 100644 --- a/rust/logging/README.md +++ b/rust/logging/README.md @@ -174,6 +174,6 @@ Rust 通过静态 `EVENTS`(按 ID 排序)和二分查找的 `event_by_id` ## 十三、CI、工作树与发行包 -- Draft PR 只运行 Linux 检查;ready PR 和 preview push 运行三平台检查。 +- Draft PR 只运行 Linux 检查;ready PR 运行三平台检查。 - 目录输入和已提交的生成物都由 Git 管理,每个 worktree 在本地重建和检查;它们没有跨工作树可复用的 identity stamp,不复制其他工作树的生成物。 -- 生成的类型没有运行时 I/O,不写 app bundle、插件资源或安装目录,不影响代码签名和 Sparkle delta。日志文件位于平台可写存储适配器提供的目录。 +- 生成的类型没有运行时 I/O,不写 app bundle、插件资源或安装目录,不影响代码签名和 Viva 增量补丁的基线。日志文件位于平台可写存储适配器提供的目录。 diff --git a/shared/plugins/contract/v1/README.md b/shared/plugins/contract/v1/README.md index 3f75e5d2..381d2e5e 100644 --- a/shared/plugins/contract/v1/README.md +++ b/shared/plugins/contract/v1/README.md @@ -2175,7 +2175,7 @@ records are reusable worktree build resources: a content hash does not transfer user consent or provide a version/platform/architecture/toolchain identity stamp. They are excluded as `plugin-disk-install-state`. No runtime write targets the signed app bundle or Windows installation resources, so these paths do not -change code signatures or Sparkle differential-update baselines. +change code signatures or Viva incremental-patch baselines. Static checks alone do not verify the UI confirmation, complete program rendering, cleanup, or bundle hashes in a real workflow. @@ -5706,7 +5706,7 @@ A document summary has `documentID,version,path,languageID,isReadOnly,isDirty, encoding,lineEnding`. `path` is workspace-relative or null for a document outside the root; `languageID` may be null. Positions `{line,column}` are one-based UTF-16; ranges `{start,end}` are half-open and cannot split a surrogate pair. Selections -keep anchor/active direction. Batches are atomic and one Monaco undo step. Stale +keep anchor/active direction. Batches are atomic and one editor undo step. Stale versions, read-only buffers, pending editor synchronization and IME composition are refused. Background documents without a mounted editor can be listed/read, but edits/selections may return `busy`; opening a foreground tab does not imply