Repository navigation
refactor(core): crate 统一放到 rust/crates/,删除社区命令、wasm 入口和未使用依赖 - #26
Merged
Merged
Conversation
- 删除 community.discourse.* 七个命令、实现和 fixture,桌面端已不再调用 - lithe-core-rules 去掉 wasm 入口和 cdylib,只作为 rlib 链接进 Core - lithe-core 删除未使用的 reqwest、rsa、sha1、shell-words、toml_edit 依赖,去掉 num-bigint-dig 专用 profile - 修复工作区编译警告:host_failure 显式处理 BACKEND_EXITED(错误码保留,仍映射为 plugin.host.failed)、限定 forward_slash_path 的编译条件、收窄 network 重导出 - 新增 unparseable_requests_fail_without_an_id 测试
- 六个 crate 从 rust/lithe-*/ 移到 rust/crates/<包名去掉 lithe- 前缀>/,包名不变;工作区成员改为 crates/* - 同步更新路径引用:Cargo 路径依赖、SDK e2e 测试路径、fixture 和契约文档里的源码路径、README 目录表 - C 头文件的位置变为 rust/crates/core/include/lithe_core.h - 注释门禁改为遍历 rust/crates/ 下的全部 crate;lithe-remote 缺 404 处公开项文档(1lck/Lithe-IDEA#1863),暂时只跳过它的 missing_docs,链接检查照常进行 - 为 lithe-git-host、lithe-ide-host 的公开项补齐文档,把 log-exempt 注释改成英文 - search_index 测试的权限写成八进制 0o000,修复 clippy 的 deny 级 lint
This was referenced Nov 13, 2026
xiaoyumuxi
marked this pull request as ready for review
November 13, 2026 17:17
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联
forward_slash_path未使用的那一条。agent.*日志事件)。这个 PR 做什么
两个提交,可以分开看。
1. 删除社区命令、wasm 入口和未使用依赖(
7ecfe2e)community.discourse.*命令auth.begin、auth.complete、auth.revoke、categories、search、topic、topics。实现、rust/fixtures/community/discourse-auth-v1.json、rust-core-api.md和application-boundary.md中的对应章节一起删除。桌面端已不再调用这些命令。用户决定:社区相关的全部删除wasm.rs、cdylib和只给 wasm 用的execute_json、is_rule_command。crate 只作为 rlib 链接进 Core,fixture 测试改为直接调用executereqwest、rsa、sha1、shell-words、toml_edit,以及只为num-bigint-dig设的 profile。Cargo.lock减少约 500 行host_failure显式处理BACKEND_EXITED:常量和错误码plugin.backend.exited都保留,映射结果仍是plugin.host.failed,按 1lck/Lithe-IDEA#1796 的建议处理,错误码仍一码一义。另外给forward_slash_path加上#[cfg(any(windows, test))],收窄network的重导出,删除workspace_status.rs中未使用的测试导入unparseable_requests_fail_without_an_id:请求无法解析时,响应不带id。原来这个行为由 core-rules 的execute_json测试覆盖,现在改由 Core 测试2. crate 统一放到
rust/crates/(8a89a0f)移动前后的目录:
lithe-前缀,包名不变,cargo -p lithe-core等命令照常可用。工作区成员改为crates/*,以后新增的 crate 放进去就会自动加入工作区。contracts/、fixtures/、logging/和target/的位置不变,桌面端LITHE_CORE_FIXTURE_DIR、LITHE_PLUGIN_CONTRACT_DIR指向的路径不受影响。[[test]]路径和sdk-e2e.mjs、三个 SDK 示例协议文件里的 fixture 路径注释、rust/contracts/和shared/plugins/文档里的源码路径、rust/fixtures/debug/v1-baseline.json里的 34 处源码位置,以及 README 的目录表(中英文都加了rust/crates/、rust/contracts/、rust/fixtures/、rust/logging/四行)。rust/crates/core/include/lithe_core.h。C ABI 本身不变。注释门禁
scripts/rust-core/verify-rust-core-comments.sh改为遍历rust/crates/*/Cargo.toml,不再手写 crate 列表。新 crate 放进rust/crates/后会自动接受检查。-D missing_docs只检查 lithe-core、lithe-core-rules 和 lithe-ai。扩大范围后发现了下面三处缺口:log-exempt注释,这个 PR 已改成英文;豁免类别名使用英文标签Expected absence:、User cancellation:、Same failure already recorded:。missing_docs_pending,名单上只有 lithe-remote,并注明 Issue [Feature] lithe-remote 补齐 404 处公开项文档注释,纳入 Core 注释门禁的 rustdoc 检查 1lck/Lithe-IDEA#1863。名单上的 crate 只跳过missing_docs,链接检查和词法检查照常进行。Issue 完成后从名单中删除。scripts/rust-core/README.md同步说明这份名单的用法。其他:
lithe-ide-host的Cargo.toml补上description。search_index测试的权限写法从0改成八进制0o000。原写法触发 clippy 的 deny 级 lintnon_octal_unix_permissions。不动的部分
桌面端(1lck/Lithe-IDEA)跟进
这个 PR 合入后,从最新 preview 开分支,在同一个 PR 里完成:
scripts/desktop/build-desktop-core.sh:PINNED_CORE_REVISION升到包含这个 PR 的 commit;第 145 行的头文件路径改为rust/crates/core/include/lithe_core.h。不改这一行,升级固定版本后桌面构建会失败。desktop/internal/core/desktop_go_test.go:128:测试构造的头文件路径同步修改。desktop/internal/core/errors.go:9:注释中的rust/lithe-core/src/protocol/error.rs改为新路径。scripts/resources/worktree-resources.json及其测试中的rust/lithe-core/src/diagnostics/catalog_generated.rs、docs/ci-builds.md中的rust/lithe-core/、rust/lithe-remote/路径;develop-litheSkill 及references/logging.md中的 Core 源码路径。docs/viva-migration.md中关于社区的段落。验证
cargo fmt --all --check:通过。scripts/rust-core/verify-rust-core-comments.sh:通过(lithe-remote 按上面的名单跳过missing_docs)。node shared/plugins/scripts/verify-docs.mjs:通过。node shared/plugins/scripts/sdk-e2e.mjs:Node、Java、Rust 三个 SDK 和构建场景全部通过。cargo check -p lithe-remote --no-default-features --features server:通过,远端服务器的构建方式不受影响。cargo check --workspace --all-targets:第一个提交单独构建时没有警告。cargo test --workspace:1933 passed / 0 failed,rustc 没有警告。原来是 1937 个,减去随社区命令删除的 5 个,加上新增的 1 个。cargo clippy --workspace --all-targets:86 条告警都是原有代码产生的,这个 PR 没有新增告警。lithe-core 的 84 条记在 [Feature] 清零 lithe-core 在 rustc 1.96 下的 84 条 clippy 告警 1lck/Lithe-IDEA#1864;lithe-git-host、lithe-core-rules 各剩 1 条,记在 [Bug] rustc 1.96 下 lithe-git-host、lithe-core-rules 出现 3 条新 clippy 告警 1lck/Lithe-IDEA#1789。