Title: refactor(execution): 删除内置运行发现探测器,运行入口只来自插件 buildSystems[].run (#1856) by xiaoyumuxi · Pull Request #77 · Lithe-IDEA/Lithe-core-rust · GitHub
Open Graph Title: refactor(execution): 删除内置运行发现探测器,运行入口只来自插件 buildSystems[].run (#1856) by xiaoyumuxi · Pull Request #77 · Lithe-IDEA/Lithe-core-rust
X Title: refactor(execution): 删除内置运行发现探测器,运行入口只来自插件 buildSystems[].run (#1856) by xiaoyumuxi · Pull Request #77 · Lithe-IDEA/Lithe-core-rust
Description: 关联 Issue / Linked issue Refs 1lck/Lithe-IDEA#1856 #1856 要求把 Core 里剩下的 5 类语言专属默认值移出 Core。本 PR 做最后一项:第 4 项(运行发现的探测器与指纹)。第 5 项 #66、第 2 项 #68、第 3 项 #69、第 1 项 #72 已合入。本 PR 和桌面端接入 PR 合入后,#1856 的 Core 部分就做完了。 PR 类型 / Type fix:缺陷修复(去掉 Core 里写死的 8 类生态探测器;可运行入口只来自构建插件声明的 buildSystems[].run) 改动说明 / What changes 背景 / Why runConfig.generate 原来会在 execution/src/detectors/ 里跑 8 个写死的探测器,按文件名和文件内容自己生成 Run 配置: 探测器 认什么 生成什么 cargo.rs Cargo.toml 的 [[bin]] / src/main.rs cargo run --bin go.rs go.mod + package main go run npm.rs package.json 的 scripts、锁文件选 npm/pnpm/yarn/bun npm run,外加 project-node 运行时归一化 python.rs pyproject.toml、manage.py、main.py 等 python -m / 脚本 make.rs、shell.rs Makefile 目标、justfile、可执行脚本 make / just / 脚本 procfile.rs Procfile 每行一个服务 compose.rs compose.yaml 等 docker compose up,类别 infrastructure 每个探测器还登记了自己的“指纹输入”(inputs.rs)和“工具链要求”(requirements.rs),用来判断 Run 列表是否过期、工具链版本是否满足。这些全都是 Core 对具体语言和工具的特判,违反“Core 对语言和工具零依赖”。同一件事已经有通用机制:构建插件用 buildSystems[].run 声明 Run 入口,用 sync.watch 声明自己的过期输入(API-29)。Go 和 Gradle 插件已经这样做,Core 的 go.rs 和 Go 插件做的是同一件事。 改动 / Changes 生成:只把插件声明的 run 变成 Run 配置 删除 execution/src/detectors/(上表 8 个探测器)、configuration/inputs.rs、configuration/requirements.rs。随之没有用途的依赖 regex、serde_yaml_ng(及 unsafe-libyaml)、toml、lithe-diagnostics 从 lithe-execution 去掉。 runConfig.generate 只把 providerRuns 生成为 build.provider 条目,然后按工作目录给重名条目加后缀。没给 providerRuns 时等同 [],生成层为空。响应为 { generated, entryCount }。 生成层只留在进程内存,不写工作区、不写缓存目录,也不再读取旧版写下的 .lithe/run/generated.json。删除 cacheDirectory 参数和整条缓存读写路径。 generator 只剩 providerRunFingerprint。 检查:只认插件模型的快照 runConfig.inspect 只在给了 providerRuns、已有生成层、且快照指纹不同(或缺失)时报告 staleProviderModel。 删除 checkFingerprint 参数、staleFingerprint 和 incompleteProjectScan 状态:过期输入由各插件的 sync.watch 负责,Core 不再扫描工作区算指纹。 解析:不再匹配工具链 runConfig.resolve 删除 toolchainCandidates 参数和工具链版本、厂商诊断;删除对 npm.script 条目的 project-node 运行时归一化。 诊断只剩 orphanedOverride、disabled、missingWorkingDirectory、missingDefaultConfiguration。 默认项:.lithe/project.json 的团队默认,否则第一个生成的服务,否则第一个不是 Current File 的生成条目。 重名 provider 条目没有 source,重名只按工作目录区分:两个模块都声明 serve 时变成 serve (services/api)、serve (services/worker);工作目录不能把一组全部分开,或其中有工作区根目录时,名字不变。id 不受影响。 工作区扫描 workspace_scan 现在只给 build.detect 用,只留一种有界扫描:最多 6 层、不跟随符号链接、跳过默认隐藏目录(Core 自己的目录和已启用插件声明的目录)和 Git 忽略的目录,最多 4,000 个目录。根目录读不了、远程连接中断时报错;更深的目录读不了时跳过。 删除不限层数的扫描模式、unreadablePaths 和提前停止。API 改为 scan_workspace(root, max_depth, ignored) 和 scan_with_reader(root, max_depth, read)。 契约与文档 rust-core-api.md:重写 runConfig.inspect / generate / resolve 的说明,删除 Windows 指纹、checkFingerprint、unreadablePaths、incompleteProjectScan、cacheDirectory、toolchainCandidates 和“进程探测器声明运行时绑定”整段;构建系统一节补上共享扫描策略。 application-boundary.md:去掉“工具链匹配器”和“由探测器声明运行时”的说法。 run-configuration-v2.schema.json:generator 只剩 providerRunFingerprint。 删除 toolchain-requirements-v1.schema.json 和 fixture hybrid-service-web.json(已无引用)。 插件契约 README 一句措辞(“detector-generated Run configurations” → “Run configurations are generated”),协议更新记录已登记。 测试 删除 tests/detectors.rs 和只为内置探测器存在的 9 个 run_configuration 测试(混合项目、纯 Go、多语言、隐藏目录扫描、v2 遗留运行时等)。 新增 provider_run_generation_qualifies_repeated_names_and_reports_stale_snapshots:只用虚构的 dev.lithe.test.engine,验证重名后缀、相同快照不报过期、不同快照报 staleProviderModel、不给 providerRuns 时生成 0 条且不创建 .lithe。 Cargo 静态模型测试不再和内置探测器逐字段对照,改为直接断言每个二进制目标的 run 条目。 resolve 不安全工作目录测试先断言正常路径 ok 且无诊断,再保留 ../outside 的拒绝。 兼容性与发布顺序 / Compatibility and rollout 行为变化:合入并接入桌面端后,Run 列表只显示已启用构建插件声明的 run,加上用户保存的配置和 Current File。这是 #1856 讨论里确认过的取舍:这些探测器本来就应该由插件做。没有对应插件的生态失去自动生成的 Run 条目,用户可以自己保存配置: 生态 现在 之后 Go Core 探测 + Go 插件 1.0.1 声明 run 只剩插件声明,不再重复 Gradle 插件 2.0.0 声明 run(Core 原本没有探测器) 不变 Cargo Core 探测;插件 0.1.3 没有声明 run 插件声明 run 之前没有自动条目 Compose Core 探测(类别 infrastructure);Docker 插件 0.1.2 没有构建系统 只能来自保存的配置 npm / pnpm / yarn / bun、Python、Make、just、Procfile、脚本 Core 探测;没有插件 只能来自保存的配置 Maven 插件 1.0.0 没有声明 run(Core 原本没有探测器) 不变 旧客户端:请求结构没有 deny_unknown_fields,旧桌面端继续发送 checkFingerprint、cacheDirectory、toolchainCandidates 不会报错,只是被忽略;staleFingerprint、incompleteProjectScan 不再出现。旧版写下的 .lithe/run/generated.json 不再读取,也不删除。 发布顺序 本 PR 合入。 桌面端在升级 PINNED_CORE_REVISION 的同一个 PR 里去掉这些参数和状态的处理、run.incompleteProjectScan* 文案,更新依赖 npm 探测器的测试、功能矩阵和 Agent Note。 Cargo 插件声明 run、Docker 插件是否提供 Compose 构建系统,由插件维护者在插件仓库决定,不阻塞本 PR。 宿主方法:没有新增宿主方法、通知或能力版本。runConfig.* 是宿主调用 Core 的命令。 不在本 PR 范围内 / Out of scope 桌面端接入,见上方“发布顺序”第 2 步。 Cargo、Docker 插件的 run 声明(插件仓库)。 provider run 目前没有办法声明 infrastructure 类别;Compose 一类的基础设施条目只能来自保存的配置。是否给 buildSystems[].run 加类别字段,等有插件需要时再按 API-29 设计。 类型专属:fix 复现与根因 复现:打开 Cargo、npm、Python、Make 等项目,即使没有启用任何插件,Core 也会自己生成 Run 条目、检查工具链版本;插件无法接管、修改或关闭这些规则,Go 模块则由 Core 的 go.rs 和 Go 插件各识别一遍。 根因:execution/src/detectors/ 把 8 类生态的识别规则、指纹输入和工具链要求写死在 Core 里。 影响平台:macOS、Windows(同一个 Viva 桌面端)。 范围检查 / Scope checks 功能矩阵 / Feature matrix N/A:Core 仓库没有功能矩阵。宿主端的可见行为在桌面端接入 PR 里按矩阵规则更新(run-discovery)。 插件归属 / Plugin ownership Core 不再出现任何生态的 Run 识别规则;新测试只用虚构的 dev.lithe.test.* 插件。 测试只使用合成插件和契约 fixture。 没有为具体插件新建功能矩阵条目。 没有插件文案或插件构建说明写进 Core 文档。 [N/A] 在受影响插件仓库跑测试:插件清单和插件协议都没有变。 UI 验证 / UI evidence N/A:Core 没有界面。Run 列表的可见变化在桌面端接入 PR 里验证。 统一日志系统 / Structured logging N/A:没有新增或改动日志事件(generate-log-events.mjs --check 通过)。 界面文案 / i18n N/A:没有用户可见文案。桌面端接入 PR 会删掉不再出现的 run.incompleteProjectScan* 文案。 逻辑归属 / Logic placement 生成、合并、解析、重名和过期判断仍全部在 Core;识别哪些东西能运行由插件声明。 Core 不按工具名加分支。 性能与内存 / Performance and memory runConfig.generate 不再扫描工作区、不再读写缓存,只处理宿主交来的 providerRuns(最多 10,000 条)。runConfig.inspect 不再计算工作区指纹。 没有新增后台任务、子进程或缓存;删掉了生成缓存。 设置 / Settings N/A:没有设置项变化。 插件契约 / Plugin contract 契约 README 的一句措辞随本 PR 修改,协议更新记录已登记在 2026-11-16 下。schema、fixture、能力版本都没有变。 [N/A] PINNED_CORE_REVISION:在桌面端接入 PR 里升级。 [N/A] sdk-e2e.mjs:没有改插件后端协议。 [N/A] 宿主方法表:没有新增宿主方法或通知。 发行包与资源 / Bundle and resources N/A:没有运行时资源;删掉了生成缓存的写入。 无用代码与重构 / Dead code and refactoring 删除 8 个探测器、指纹输入、工具链要求、生成缓存、npm 运行时归一化、不限层数的扫描模式、unreadablePaths、提前停止,以及只为它们存在的 4 个依赖、1 个 schema 和 1 个 fixture(共删 3,714 行)。 验证 / Verification 命令或操作 平台 结果 cargo fmt --manifest-path rust/Cargo.toml --all -- --check macOS arm64 通过 node scripts/logging/generate-log-events.mjs --check macOS arm64 通过(133 个事件) scripts/rust-core/verify-rust-core-comments.sh core execution macOS arm64 通过 cargo clippy --workspace --all-targets --all-features -- -D warnings macOS arm64 通过 cargo clippy --locked --workspace --all-targets --target x86_64-pc-windows-msvc -- -D warnings macOS arm64(交叉检查 Windows 目标) 通过 cargo test --locked --workspace --features lithe-remote/server macOS arm64 通过(124 个测试二进制,2115 个测试,0 失败) cargo test --workspace --all-features --no-fail-fast macOS arm64 只有 plugin_sdk_build 的 2 个测试失败:它们需要 shared/plugins/scripts/sdk-e2e.mjs 设置的环境变量,和本 PR 无关(SDK 示例不调用 runConfig.*) node scripts/rust-core/verify-platform-tests.mjs macOS arm64 通过(52 个 crate) node shared/plugins/scripts/verify-docs.mjs macOS arm64 通过 node scripts/rust-core/affected-crates.mjs --base origin/main macOS arm64 Linux:--workspace --features lithe-remote/server;macOS:lithe-platform、lithe-remote、lithe-platform-tests;Windows:lithe-platform、lithe-platform-tests 未能执行的检查和原因: Windows 上没有在本机运行测试,ready 后由 CI 覆盖;本 PR 没有平台相关代码。Run 列表的整机效果要在桌面端接入 PR 里验证。 提交前确认 / Final checks 分支从最新的 main(ac8825b)创建;目标分支 main 以 Draft 提交 没有无关改动和构建产物 没有启动 Lithe 应用
Open Graph Description: 关联 Issue / Linked issue Refs 1lck/Lithe-IDEA#1856 #1856 要求把 Core 里剩下的 5 类语言专属默认值移出 Core。本 PR 做最后一项:第 4 项(运行发现的探测器与指纹)。第 5 项 #66、第 2 项 #68、第 3 项 #69、第 1 项 #72 已合入。本 PR 和桌面端接入 PR 合入后,#1856 的 Core 部...
X Description: 关联 Issue / Linked issue Refs 1lck/Lithe-IDEA#1856 #1856 要求把 Core 里剩下的 5 类语言专属默认值移出 Core。本 PR 做最后一项:第 4 项(运行发现的探测器与指纹)。第 5 项 #66、第 2 项 #68、第 3 项 #69、第 1 项 #72 已合入。本 PR 和桌面端接入 PR 合入后,#1856 的 Core 部...
Opengraph URL: https://github.com/Lithe-IDEA/Lithe-core-rust/pull/77
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:fd0cd887-3a7d-8638-e9e7-8869593fa393 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9278:330F10:B84AED:10407E4:6B07220A |
| html-safe-nonce | ed641a3fb55e3b6bf681f759783f324a5b8194bc89b41ed42ad452ddae7553f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Mjc4OjMzMEYxMDpCODRBRUQ6MTA0MDdFNDo2QjA3MjIwQSIsInZpc2l0b3JfaWQiOiI1NjExMTI3MTE3NjE1NDA3NjI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 57d56c4d005d5f578af1ca10756fd174c0f8911ac21e65afd99e61b79030e56d |
| hovercard-subject-tag | pull_request:5339731136 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/Lithe-IDEA/Lithe-core-rust/pull/77/files |
| twitter:image | https://avatars.githubusercontent.com/u/145102356?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/145102356?s=400&v=4 |
| og:image:alt | 关联 Issue / Linked issue Refs 1lck/Lithe-IDEA#1856 #1856 要求把 Core 里剩下的 5 类语言专属默认值移出 Core。本 PR 做最后一项:第 4 项(运行发现的探测器与指纹)。第 5 项 #66、第 2 项 #68、第 3 项 #69、第 1 项 #72 已合入。本 PR 和桌面端接入 PR 合入后,#1856 的 Core 部... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5a20fe9aa5e45c6df9328a5ec3f167a7805856126d8bf72d810541ca01962ef9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/Lithe-IDEA/Lithe-core-rust git https://github.com/Lithe-IDEA/Lithe-core-rust.git |
| octolytics-dimension-user_id | 340144206 |
| octolytics-dimension-user_login | Lithe-IDEA |
| octolytics-dimension-repository_id | 1449354685 |
| octolytics-dimension-repository_nwo | Lithe-IDEA/Lithe-core-rust |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1449354685 |
| octolytics-dimension-repository_network_root_nwo | Lithe-IDEA/Lithe-core-rust |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6ce961d9a663a99bc4bcab9fd6ac5cca54bd6fcc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width